text
stringlengths
2.85k
2.55M
label
class label
11 classes
arXiv:1712.04604v2 [cs.NE] 30 Jan 2018 Deep Quaternion Networks Chase J. Gaudet Anthony S. Maida School of Computing & Informatics University of Lousiana at Lafayette Lafayette, USA [email protected] School of Computing & Informatics University of Lousiana at Lafayette Lafayette, USA [email protected] Abstract—The field of deep learning has seen significant advancement in recent years. However, much of the existing work has been focused on real-valued numbers. Recent work has shown that a deep learning system using the complex numbers can be deeper for a fixed parameter budget compared to its real-valued counterpart. In this work, we explore the benefits of generalizing one step further into the hyper-complex numbers, quaternions specifically, and provide the architecture components needed to build deep quaternion networks. We go over quaternion convolutions, present a quaternion weight initialization scheme, and present algorithms for quaternion batch-normalization. These pieces are tested in a classification model by end-to-end training on the CIFAR-10 and CIFAR-100 data sets and a segmentation model by end-to-end training on the KITTI Road Segmentation data set. The quaternion networks show improved convergence compared to real-valued and complex-valued networks, especially on the segmentation task. Index Terms—quaternion, complex, neural networks, deep learning I. I NTRODUCTION There have been many advances in deep neural network architectures in the past few years. One such improvement is a normalization technique called batch normalization [1] that standardizes the activations of layers inside a network using minibatch statistics. It has been shown to regularize the network as well as provide faster and more stable training. Another improvement comes from architectures that add so called shortcut paths to the network. These shortcut paths connect later layers to earlier layers typically, which allows for the stronger gradients to propagate to the earlier layers. This method can be seen in Highway Networks [2] and Residual Networks [3]. Other work has been done to find new activation functions with more desirable properties. One example is the exponential linear unit (ELU) [4], which attempts to keep activations standardized. All of the above methods are combating the vanishing gradient problem [5] that plagues deep architectures. With solutions to this problem appearing it is only natural to move to a system that will allow one to construct deeper architectures with as low a parameter cost as possible. Other work in this area has explored the use of complex and hyper-complex numbers, which are a generalization of the complex, such as quaternions. Using complex numbers in recurrent neural networks (RNNs) has been shown to increase learning speed and provide a more noise robust memory retrieval mechanism [6]–[8]. The first formulation of complex batch normalization and complex weight initialization is presented by [9] where they achieve some state of the art results on the MusicNet data set. Hyper-complex numbers are less explored in neural networks, but have seen use in manual image and signal processing techniques [10]–[12]. Examples of using quaternion values in networks is mostly limited to architectures that take in quaternion inputs or predict quaternion outputs, but do not have quaternion weight values [13], [14]. There are some more recent examples of building models that use quaternions represented as real-values. In [15] they used a quaternion multi-layer perceptron (QMLP) for document understanding and [16] uses a similar approach in processing multi-dimensional signals. Building on [9] our contribution in this paper is to formulate and implement quaternion convolution, batch normalization, and weight initialization 1 . There arises some difficulty over complex batch normalization that we had to overcome as their is no analytic form for our inverse square root matrix. II. M OTIVATION AND R ELATED W ORK The ability of quaternions to effectively represent spatial transformations and analyze multi-dimensional signals makes them promising for applications in artificial intelligence. One common use of quaternions is for representing rotation into a more compact form. PoseNet [14] used a quaternion as the target output in their model where the goal was to recover the 6−DOF camera pose from a single RGB image. The ability to encode rotations may make a quaternion network more robust to rotational variance. Quaternion representation has also been used in signal processing. The amount of information in the phase of an image has been shown to be sufficient to recover the majority of information encoded in its magnitude by Oppenheim and Lin [17]. The phase also encodes information such as shapes, edges, and orientations. Quaternions can be represented as a 2 x 2 matrix of complex numbers, which gives them a group of phases potentially holding more information compared to a single phase. Bulow and Sommer [12] used the higher complexity representation of quaternions by extending Gabor’s complex signal to a quaternion one which was then used for texture segmentation. Another use of quaternion filters is shown in [11] where 1 Source code located at https://github.com/gaudetcj/DeepQuaternionNetworks they introduce a new class of filter based on convolution with hyper-complex masks, and present three color edge detecting filters. These filters rely on a three-space rotation about the grey line of RGB space and when applied to a color image produce an almost greyscale image with color edges where the original image had a sharp change of color. More quaternion filter use is shown in [18] where they show that it is effective in the context of segmenting color images into regions of similar color texture. They state the advantage of using quaternion arithmetic is that a color can be represented and analyzed as a single entity, which we will see holds for quaternion convolution in a convolutional neural network architecture as well in Section III-C. A quaternionic extension of a feed forward neural network, for processing multi-dimensional signals, is shown in [16]. They expect that quaternion neurons operate on multidimensional signals as single entities, rather than real-valued neurons that deal with each element of signals independently. A convolutional neural network (CNN) should be able to learn a powerful set of quaternion filters for more impressive tasks. Another large motivation is discussed in [9], which is that complex numbers are more efficient and provide more robust memory mechanisms compared to the reals [10]–[12]. They continue that residual networks have a similar architecture to associative memories since the residual shortcut paths compute their residual and then sum it into the memory provided by the identity connection. Again, given that quaternions can be represented as a complex group, they may provide an even more efficient and robust memory mechanisms. III. Q UATERNION N ETWORK C OMPONENTS This section will include the work done to obtain a working deep quaternion network. Some of the longer derivations are given in the Appendix. A. Quaternion Representation This representation of quaternions is not unique, but we will stick to the above in this paper. It is also possible to represent H as M (2, C) where M (2, C) is a 2 x 2 complex matrix. With our real-valued representation a quaternion real-valued 2D convolution layer can be expressed as follows. Say that the layer has N feature maps such that N is divisible by 4. We let the first N/4 feature maps represent the real components, the second N/4 represent the i imaginary components, the third N/4 represent the j imaginary components, and the last N/4 represent the k imaginary components. B. Quaternion Differentiability In 1833 Hamilton proposed complex numbers C be defined as the set R2 of ordered pairs (a, b) of real numbers. He then began working to see if triplets (a, b, c) could extend multiplication of complex numbers. In 1843 he discovered a way to multiply in four dimensions instead of three, but the multiplication lost commutativity. This construction is now known as quaternions. Quaternions are composed of four components, one real part, and three imaginary parts. Typically denoted as H = {a + bi + cj + dk : a, b, c, d ∈ R} Since we will be performing quaternion arithmetic using reals it is useful to embed H into a real-valued representation. There exists an injective homomorphism from H to the matrix ring M (4, R) where M (4, R) is a 4x4 real matrix. The 4 x 4 matrix can be written as     a −b −c −d 1 0 0 0  b a −d c      = a 0 1 0 0 c d 0 0 1 0 a −b  d −c b a 0 0 0 1   0 −1 0 0 1 0 0 0   + b 0 0 0 −1 0 0 1 0   0 0 −1 0 0 0 0 1  + c 1 0 0 0 0 −1 0 0   0 0 0 −1 0 0 −1 0   . (4) + d 0 1 0 0 1 0 0 0 (1) In order for the network to perform backpropagation the cost function and activation functions used must be differentiable with respect to the real, i, j, and k components of each quaternion parameter of the network. As the complex chain rule is shown in [9], we provide the quaternion chain rule which is given in the Appendix section VII-A. C. Quaternion Convolution where a is the real part, (i, j, k) denotes the three imaginary axis, and (b, c, d) denotes the three imaginary components. Quaternions are governed by the following arithmetic: Convolution in the quaternion domain is done by convolving a quaternion filter matrix W = A+iB+jC+kD by a quaternion vector h = w + ix + jy + kz. Performing the convolution by using the distributive property and grouping terms one gets i2 = j 2 = k 2 = ijk = −1 (2) W ∗ h = (A ∗ w − B ∗ x − C ∗ y − D ∗ z)+ which, by enforcing distributivity, leads to the noncommutative multiplication rules i(A ∗ x + B ∗ w + C ∗ z − D ∗ y)+ j(A ∗ y − B ∗ z + C ∗ w + D ∗ x)+ ij = k, jk = i, ki = j, ji = −k, kj = −i, ik = −j (3) k(A ∗ z + B ∗ y − C ∗ x + D ∗ w). (5) Using a matrix to represent the components of the convolution we have:   R(W ∗ h) A  I (W ∗ h)  B    J (W ∗ h) = C K (W ∗ h) D  −B A D −C    −C −D w x −D C  ∗  A −B  y  B A z (6) An example is shown in Fig. 1 where one can see how quaternion convolution forces a linear depthwise mixture of the channels. This is similar to a mixture of standard convolution and depthwise separable convolution from [19]. This reuse of filters on every layer and combination may help extract texture information across channels as seen in [18]. sition of V−1 where V is the covariance matrix given by:   Vrr Vri Vrj Vrk  Vir Vii Vij Vik   V =  Vjr Vji Vjj Vjk  Vkr Vki Vkj Vkk  Cov(R{x}, R{x}) Cov(I {x}, R{x}) =  Cov(J {x}, R{x}) Cov(K {x}, R{x}) Cov(R{x}, I {x}) Cov(I {x}, I {x}) Cov(J {x}, I {x}) Cov(K {x}, I {x}) Cov(R{x}, J {x}) Cov(I {x}, J {x}) Cov(J {x}, J {x}) Cov(K {x}, J {x})  Cov(R{x}, K {x}) Cov(I {x}, K {x})   Cov(J {x}, K {x}) Cov(K {x}, K {x}) D. Quaternion Batch-Normalization Batch-normalization [1] is used by the vast majority of all deep networks to stabilize and speed up training. It works by keeping the activations of the network at zero mean and unit variance. The original formulation of batch-normalization only works for real-values. Applying batch normalization to complex or hyper-complex numbers is more difficult, one can not simply translate and scale them such that their mean is 0 and their variance is 1. This would not give equal variance in the multiple components of a complex or hyper-complex number. To overcome this for complex numbers a whitening approach is used [9], which scales the data by the square root of their variances along each of the two principle components. We use the same approach, but must whiten 4D vectors. However, an issue arises in that there is no nice way to calculate the inverse square root of a 4 x 4 matrix. It turns out that the square root is not necessary and we can instead use the Cholesky decomposition on our covariance matrix. The details of why this works for whitening given in the Appendix section VII-B. Now our whitening is accomplished by multiplying the 0-centered data (x − E[x]) by W: x̃ = W(x − E[x]) (7) where Cov(·) is the covariance and R{x}, I {x}, J {x}, and K {x} are the real, i, j, and k components of x respectively. Real-valued batch normalization also uses two learned parameters, β and γ. Our shift parameter β must shift a quaternion value so it is a quaternion value itself with real, i, j, and k as learnable components. The scaling parameter γ is a symmetric matrix of size matching V given by:   Vrr Vri Vrj Vrk  Vri Vii Vij Vik   γ= (9)  Vrj Vij Vjj Vjk  Vrk Vik Vjk Vkk Because of its symmetry it has only ten learnable parameters. The variance of the components of input √ x̃ are variance 1 so the diagonal of γ is initialized to 1/ 16 in order to obtain a modulus of 1 for the variance of the normalized value. The off diagonal terms of γ and all components of β are initialized to 0. The quaternion batch normalization is defined as: BN(x̃) = γx̃ + β (10) E. Quaternion Weight Initialization The proper initialization of weights is vital to convergence of deep networks. In this work we derive our quaternion weight initialization using the same procedure as Glorot and Bengio [20] and He et al. [21]. To begin we find the variance of a quaternion weight: W = |W |e(cosφ1 i+cosφ2 j+cosφ3 k)θ = R{W } + I {W } + J {W } + K {W }. where W is one of the matrices from the Cholesky decompo- (8) (11) where |W | is the magnitude, θ and φ are angle arguments, and cos2 φ1 + cos2 φ2 + cos2 φ3 = 1 [22]. Fig. 1. An illustration of quaternion convolution. Variance is defined as Var(W ) = E[|W |2 ] − (E[W ])2 , (12) but since W is symmetric around 0 the term (E[W ])2 is 0. We do not have a way to calculate Var(W ) = E[|W |2 ] so we make use of the magnitude of quaternion normal values |W |, which follows an independent normal distribution with four degrees of freedom (DOFs). We can then calculate the expected value of |W |2 to find our variance Z ∞ E[|W |2 ] = x2 f (x) dx = 4σ 2 (13) ∞ where f (x) is the four DOF distribution given in the Appendix. And since Var(W ) = E[|W |2 ], we now have the variance of W expressed in terms of a single parameter σ: Var(W ) = 4σ 2 . (14) To follow the Glorot and Bengio [20] initialization we have Var(W ) = 2/(nin +nout ), where nin and nout are the number of input and output units respectivly. p Setting this equal to (14) and solving for σ gives σ = 1/ 2(nin + nout ). To follow He et al. [21] initialization that is specialized for rectified linear units (ReLUs) [23], then we have Var(W ) = 2/nin , which √ again setting equal to (14) and solving for σ gives σ = 1/ 2nin . As shown in (11) the weight has components |W |, θ, and φ. We can initialize the magnitude |W | using our four DOF distribution defined with the appropriate σ based on which initialization scheme we are following. The angle components are initialized using the uniform distribution between −π and π where we ensure the constraint on φ. IV. E XPERIMENTAL R ESULTS Our experiments covered image classification using both the CIFAR-10 and CIFAR-100 benchmarks and image segmentation using the KITTI Road Estimation benchmark. A. Classification We use the same architecture as the large model in [9], which is a 110 layer Residual model similar to the one in [3]. There is one difference between the real-valued network and the ones used for both the complex and hyper-complex valued networks. Because the datasets are all real-valued the network must learn the imaginary or quaternion components. We use the same technique as [9] where there is an additional block immediately after the input which will learn the hypercomplex components BN → ReLU → Conv → BN → ReLU → Conv. Since all datasets that we work with are real-valued, we present a way to learn their imaginary components to let the rest of the network operate in the complex plane. We learn the initial imaginary component of our input by performing the operations present within a single real-valued residual block This means that to maintain the same approximate parameter count the number of convolution kernels for the complex network was increased. We however did not increase the number of convolution kernels for the quaternion trials so any increase in model performance comes from the quaternion filters and at a lower hardware budget. The architecture consists of 3 stages of repeating residual blocks where at the end of each stage the images are downsized by strided convolutions. Each stage also doubles the previous stage’s number of convolution kernels. The last layers are a global average pooling layer followed by a single fully connected layer with a softmax function used to classify the input as either one of the 10 classes in CIFAR-10 or one of the 100 classes in CIFAR-100. We also followed their training procedure of using the backpropagation algorithm with Stochastic Gradient Descent with Nesterov momentum [24] set at 0.9. The norm of the gradients are clipped to 1 and a custom learning rate scheduler is used. The learning scheduler is the same used in [9] for a direct comparison in performance. The learning rate is initially set to 0.01 for the first 10 epochs and then set it to 0.1 from epoch 10-100 and then cut by a factor of 10 at epochs 120 and 150. Table I presents our results along side the real and complex valued networks. Our quaternion model outperforms the real and complex networks on both datasets on a smaller parameter budget. Architecture [3] Real [9] Complex Quaternion CIFAR-10 CIFAR-100 6.37 5.60 27.09 5.44 26.01 TABLE I C LASSIFICATION ERROR ON CIFAR-10 AND CIFAR-100. N OTE THAT [3] IS A 110 LAYER RESIDUAL NETWORK , [9] IS 118 LAYER COMPLEX NETWORK WITH THE SAME DESIGN AS THE PRIOR EXCEPT WITH ADDITIONAL INITIAL LAYERS TO EXTRACT COMPLEX MAPPINGS . B. Segmentation For this experiment we used the same model as the above, but cut the number of residual blocks out of the model for memory reasons given that the KITTI data is large color images. The 110 layer model has 10, 9, and 9 residual blocks in the 3 stages talked about above, while this model has 2, 1, and 1 and does not perform any strided convolutions. This gives a total of 38 layers. The last layer is a 1 × 1 convolution with a sigmoid output so we are getting a heatmap prediction the same size as the input. The training procedure is also as above, but the learning rate is scheduled differently. Here we begin at 0.01 for the first 10 epochs and then set it to 0.1 from epoch 10-50 and then cut by a factor of 10 at 100 and 150. Table II presents our results along side the real and complex valued networks where we used Intersection over Union (IOU) for performance measure. Quaternion outperformed the other two by a larger margin compared to the classification tasks. Architecture KITTI Real 0.747 Complex 0.769 Quaternion 0.827 TABLE II IOU ON KITTI ROAD E STIMATION BENCHMARK . V. C ONCLUSIONS We have extended upon work looking into complex valued networks by exploring quaternion values. We presented the building blocks required to build and train deep quaternion networks and used them to test residual architectures on two common image classification benchmarks. We show that they have competitive performance by beating both the real and complex valued networks with less parameters. Future work will be needed to test quaternion networks for more segmentation datasets and for audio processing tasks. VI. ACKNOWLEDGMENT [15] T. Parcollet, M. Morchid, P.-M. Bousquet, R. Dufour, G. Linarès, and R. De Mori, “Quaternion neural networks for spoken language understanding,” in Spoken Language Technology Workshop (SLT), 2016 IEEE, pp. 362–368, IEEE, 2016. [16] T. Minemoto, T. Isokawa, H. Nishimura, and N. Matsui, “Feed forward neural network with random quaternionic neurons,” Signal Processing, vol. 136, pp. 59–68, 2017. [17] A. V. Oppenheim and J. S. Lim, “The importance of phase in signals,” Proceedings of the IEEE, vol. 69, no. 5, pp. 529–541, 1981. [18] L. Shi and B. Funt, “Quaternion color texture segmentation,” Computer Vision and image understanding, vol. 107, no. 1, pp. 88–96, 2007. [19] F. Chollet, “Xception: Deep learning with depthwise separable convolutions,” arXiv preprint arXiv:1610.02357, 2016. [20] X. Glorot and Y. Bengio, “Understanding the difficulty of training deep feedforward neural networks,” in Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249–256, 2010. [21] 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, pp. 1026–1034, 2015. [22] R. Piziak and D. Turner, “The polar form of a quaternion,” 2002. We would like to thank James Dent of the University of Louisiana at Lafayette Physics Department for helpful discussions. We also thank Fugro for research time on this project. [23] 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), pp. 807–814, 2010. R EFERENCES [25] A. Kessy, A. Lewin, and K. Strimmer, “Optimal whitening and decorrelation,” The American Statistician, no. just-accepted, 2017. [1] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in International Conference on Machine Learning, pp. 448–456, 2015. [2] R. K. Srivastava, K. Greff, and J. Schmidhuber, “Training very deep networks,” in Advances in neural information processing systems, pp. 2377– 2385, 2015. [3] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. [4] D.-A. Clevert, T. Unterthiner, and S. Hochreiter, “Fast and accurate deep network learning by exponential linear units (elus),” arXiv preprint arXiv:1511.07289, 2015. [5] S. Hochreiter, “Untersuchungen zu dynamischen neuronalen netzen,” Diploma, Technische Universität München, vol. 91, 1991. [6] M. Arjovsky, A. Shah, and Y. Bengio, “Unitary evolution recurrent neural networks,” in International Conference on Machine Learning, pp. 1120–1128, 2016. [7] I. Danihelka, G. Wayne, B. Uria, N. Kalchbrenner, and A. Graves, “Associative long short-term memory,” arXiv preprint arXiv:1602.03032, 2016. [8] S. Wisdom, T. Powers, J. Hershey, J. Le Roux, and L. Atlas, “Fullcapacity unitary recurrent neural networks,” in Advances in Neural Information Processing Systems, pp. 4880–4888, 2016. [9] C. Trabelsi, O. Bilaniuk, D. Serdyuk, S. Subramanian, J. F. Santos, S. Mehri, N. Rostamzadeh, Y. Bengio, and C. J. Pal, “Deep complex networks,” arXiv preprint arXiv:1705.09792, 2017. [10] T. Bülow, Hypercomplex spectral signal representations for the processing and analysis of images. Universität Kiel. Institut für Informatik und Praktische Mathematik, 1999. [11] S. J. Sangwine and T. A. Ell, “Colour image filters based on hypercomplex convolution,” IEE Proceedings-Vision, Image and Signal Processing, vol. 147, no. 2, pp. 89–93, 2000. [12] T. Bulow and G. Sommer, “Hypercomplex signals-a novel extension of the analytic signal to the multidimensional case,” IEEE Transactions on signal processing, vol. 49, no. 11, pp. 2844–2852, 2001. [13] A. Rishiyur, “Neural networks with complex and quaternion inputs,” arXiv preprint cs/0607090, 2006. [14] A. Kendall, M. Grimes, and R. Cipolla, “Posenet: A convolutional network for real-time 6-dof camera relocalization,” in Proceedings of the IEEE international conference on computer vision, pp. 2938–2946, 2015. [24] Y. Nesterov, “A method of solving a convex programming problem with convergence rate o (1/k2),” VII. A PPENDIX A. The Generalized Quaternion Chain Rule for a Real-Valued Function We start by specifying the Jacobian. Let L be a real valued loss function and q be a quaternion variable such that q = a + i b + j c + k d where a, b, c, d ∈ R then, ∂L ∂L ∂L ∂L ∂L = +i +j +k (15) ∂q ∂a ∂b ∂c ∂d ∂L ∂L ∂L ∂L = +i +j +k ∂R(q) ∂I(q) ∂J(q) ∂K(q) = R(∇L (q)) + I(∇L (q)) + J(∇L (q)) + K(∇L (q)) ∇L (q) = Now let g = m + i n + j o + k p be another quaternion variable where q can be expressed in terms of g and m, n, o, p ∈ R we where W is an n x n ‘whitening’ matrix. Since cov(Z) = I it follows that: then have, ∂L ∂L ∂L ∂L ∂L = +i +j +k (16) ∂g ∂m ∂n ∂o ∂p ∂L ∂a ∂L ∂b ∂L ∂c ∂L ∂d = + + + ∂a ∂m ∂b ∂m ∂c ∂m ∂d ∂m  ∂L ∂a ∂L ∂b ∂L ∂c ∂L ∂d +i + + + ∂a ∂n ∂b ∂n ∂c ∂n ∂d ∂n   ∂L ∂a ∂L ∂b ∂L ∂c ∂L ∂d +j + + + ∂a ∂o ∂b ∂o ∂c ∂o ∂d ∂o   ∂L ∂a ∂L ∂b ∂L ∂c ∂L ∂d +k + + + ∂a ∂p ∂b ∂p ∂c ∂p ∂d ∂p   ∂L ∂a ∂a ∂a ∂a = +i +j +k ∂a ∂m ∂n ∂o ∂p   ∂L ∂b ∂b ∂b ∂b + +i +j +k ∂b ∂m ∂n ∂o ∂p   ∂c ∂c ∂c ∂L ∂c +i +j +k + ∂c ∂m ∂n ∂o ∂p   ∂L ∂d ∂d ∂d ∂d + +i +j +k ∂d ∂m ∂n ∂o ∂p   ∂L ∂a ∂a ∂a ∂a = +i +j +k ∂R(q) ∂m ∂n ∂o ∂p   ∂b ∂b ∂b ∂L ∂b +i +j +k + ∂I(q) ∂m ∂n ∂o ∂p   ∂c ∂c ∂c ∂L ∂c +i +j +k + ∂J(q) ∂m ∂n ∂o ∂p   ∂d ∂d ∂d ∂d ∂L +i +j +k + ∂K(q) ∂m ∂n ∂o ∂p   ∂a ∂a ∂a ∂a = R(∇L (q)) +i +j +k ∂m ∂n ∂o ∂p   ∂b ∂b ∂b ∂b +i +j +k + I(∇L (q)) ∂m ∂n ∂o ∂p   ∂c ∂c ∂c ∂c + J(∇L (q)) +i +j +k ∂m ∂n ∂o ∂p   ∂d ∂d ∂d ∂d + K(∇L (q)) +i +j +k ∂m ∂n ∂o ∂p ∇L (q) = B. Whitening a Matrix E[ZZT ] = I E[W(X − µ)(W(X − µ))T ] = I E[W(X − µ)(X − µ)T WT ] = I WΣWT = I WΣWT W = W WT W = Σ−1 (18) From (18) it is clear that the Cholesky decomposition provides a suitable (but not unique) method of finding W. C. Cholesky Decomposition Cholesky decomposition is an efficient way to implement LU decomposition for symmetric matrices, which allows us to find the square root. Consider AX = b, A = [aij ]n×n , and aij = aji , then the Cholesky decomposition of A is given by A = LL0 where   l11 0 . . . 0  ..   l21 l22 . . . .    (19) L= .  . . . . .  . . 0  . ln1 ln2 ... lnn Let lki be the k th row and ith column entry of L, then   k<i  0, q Pi−1 2 lki = aii − j=1 lkj , k=i    1 (a − Pi−1 l l ), i < k ki j=1 ij kj lii D. 4 DOF Independent Normal Distribution Consider the four-dimensional vector Y = (S, T, U, V ) which has components that are normally distributed, centered at zero, and independent. Then S, T , U , and V all have density functions 2 Hx Let X be an n x n matrix and cov(X) = Σ is the symmetric covariance matrix of the same size. Whitening a matrix linearly decorrelates the input dimensions, meaning that whitening transforms X into Z such that cov(Z) = I where I is the identity matrix [25]. The matrix Z can be written as: Z = W(X − µ) (17) 2 e−x /(2σ ) fS (x; σ) = fT (x; σ) = fU (x; σ) = fV (x; σ) = √ . 2πσ 2 (20) Let X be the length of Y, which means X = √ S 2 + T 2 + U 2 + V 2 . Then X has the cumulative distribution function ZZZZ FX (x; σ) = fS (µ; σ)fT (µ; σ)fU (µ; σ)fV (µ; σ) dA, where Hx is the four-dimensional sphere n o p Hx = (s, t, u, v) : s2 + t2 + u2 + v 2 < x . (21) (22) We then can write the integral in polar representation Z πZ πZ 2π Z x 2 1 3 −r 2σ 2 sin(θ)sin(φ)cos(ψ) drdθdφdψ FX (x; σ) = r e 4π 2 σ 4 0 0 0 0 Z x 2 2 1 = r3 e−r /(2σ ) dr. (23) 4 2σ 0 The probability density function of X is the derivative of its cumulative distribution function so we use the funamental theorem of calculus on (23) to finally arrive at fX (x; σ) = d 1 3 −x2 /(2σ2 ) x e . FX (x; σ) = dx 2σ 4 (24)
1cs.CV
Fast Compressed Self-Indexes with Deterministic Linear-Time Construction∗ J. Ian Munro1 , Gonzalo Navarro2 , and Yakov Nekrich1 1 Cheriton School of Computer Science, University of Waterloo. [email protected], [email protected]. CeBiB — Center of Biotechnology and Bioengineering, Department of Computer Science, University of Chile. [email protected]. 2 arXiv:1707.01743v3 [cs.DS] 1 Sep 2017 Abstract We introduce a compressed suffix array representation that, on a text T of length n over an alphabet of size σ, can be built in O(n) deterministic time, within O(n log σ) bits of working space, and counts the number of occurrences of any pattern P in T in time O(|P | + log logw σ) on a RAM machine of w = Ω(log n)-bit words. This new index outperforms all the other compressed indexes that can be built in linear deterministic time, and some others. The only faster indexes can be built in linear time only in expectation, or require Θ(n log n) bits. We also show that, by using O(n log σ) bits, we can build in linear time an index that counts in time O(|P |/ logσ n + log n(log log n)2 ), which is RAM-optimal for w = Θ(log n) and sufficiently long patterns. 1998 ACM Subject Classification E.1 Data Structures; E.4 Coding and Information Theory Keywords and phrases Succinct data structures; Self-indexes; Suffix arrays; Deterministic construction Digital Object Identifier 10.4230/LIPIcs... 1 Introduction The string indexing problem consists in preprocessing a string T so that, later, we can efficiently find occurrences of patterns P in T . The most popular solutions to this problem are suffix trees [35] and suffix arrays [24]. Both can be built in O(n) deterministic time on a text T of length n over an alphabet of size σ, and the best variants can count the number of times a string P appears in T in time O(|P |), and even in time O(|P |/ logσ n) in the word-RAM model if P is given packed into |P |/ logσ n words [31]. Once counted, each occurrence can be located in O(1) time. Those optimal times, however, come with two important drawbacks: The variants with this counting time cannot be built in O(n) worst-case time. The data structures use Θ(n log n) bits of space. The reason of the first drawback is that some form of perfect hashing is always used to ensure constant time per pattern symbol (or pack of symbols). The classical suffix trees and arrays with linear-time deterministic construction offer O(|P | log σ) or O(|P | + log n) counting time, respectively. More recently, those times have been reduced to O(|P | + log σ) [10] and even to O(|P | + log log σ) [15]. Simultaneously with our work, a suffix tree variant was introduced by Bille et al. [7], which can be built in linear deterministic time and counts in time O(|P |/ logσ n + log |P | + log log σ). All those indexes, however, still suffer from the ∗ Funded with Basal Funds FB0001, Conicyt, Chile. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany second drawback, that is, they use Θ(n log n) bits of space. This makes them impractical in most applications that handle large text collections. Research on the second drawback dates back to almost two decades [30], and has led to indexes using nHk (T ) + o(n(Hk (T ) + 1)) bits, where Hk (T ) ≤ log σ is the k-th order entropy of T [25], for any k ≤ α logσ n − 1 and any constant 0 < α < 1. That is, the indexes use asymptotically the same space of the compressed text, and can reproduce the text and search it; thus they are called self-indexes. The fastest compressed self-indexes that can be built in linear deterministic time are able to count in time O(|P | log log σ) [1] or O(|P |(1 + logw σ)) [6]. There exist other compressed self-indexes that obtain times O(|P |) [5] or O(|P |/ logσ n + logσ n) for any constant  > 0 [19], but both rely on perfect hashing and are not built in linear deterministic time. All those compressed self-indexes use O(n logb n ) further bits to locate the position of each occurrence found in time O(b), and to extract any substring S of T in time O(|S| + b). In this paper we introduce the first compressed self-index that can be built in O(n) deterministic time (moreover, using O(n log σ) bits of space [28]) and with counting time O(|P | + log logw σ), where w = Ω(log n) is the size in bits of the computer word. More precisely, we prove the following result. I Theorem 1. On a RAM machine of w = Ω(log n) bits, we can construct an index for a text T of length n over an alphabet of size σ = O(n/ log n) in O(n) deterministic time using O(n log σ) bits of working space. This index occupies nHk (T ) + o(n log σ) + O(n logb n ) bits of space for a parameter b and any k ≤ α logσ n − 1, for any constant 0 < α < 1. The occurrences of a pattern string P can be counted in O(|P | + log logw σ) time, and then each such occurrence can be located in O(b) time. An arbitrary substring S of T can be extracted in time O(|S| + b). We obtain our results with a combination of the compressed suffix tree T of T and the Burrows-Wheeler transform B of the reversed text T . We manage to simulate the suffix tree traversal for P , simultaneously on T and on B. With a combination of storing deterministic dictionaries and precomputed rank values for sampled nodes of T , and a constant-time method to compute an extension of partial rank queries that considers small ranges in B, we manage to ensure that all the suffix tree steps, except one, require constant time. The remaining one is solved with general rank queries in time O(log logw σ). As a byproduct, we show that the compressed sequence representations that obtain those rank times [6] can also be built in linear deterministic time. Compared with previous work, other indexes may be faster at counting, but either they are not built in linear deterministic time [5, 19, 31] or they are not compressed [31, 7]. Our index outperforms all the previous compressed [13, 1, 6], as well as some uncompressed [15], indexes that can be built deterministically. As an application of our tools, we also show that an index using O(n log σ) bits of space can be built in linear deterministic time, so that it can count in time O(|P |/ logσ n + log n(log log n)2 ), which is RAM-optimal for w = Θ(log n) and sufficiently long patterns. Current indexes obtaining similar counting time require O(n log σ) construction time [19] or higher [31], or O(n log n) bits of space [31, 7]. 2 Related Work Let T be a string of length n over an alphabet of size σ that is indexed to support searches for patterns P . It is generally assumed that σ = o(n), a reasonable convention we will follow. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany Compressed Compact Uncompressed Deterministic |P | log log σ [1] |P |(1 + logw σ) [6] |P |+log logw σ (ours) |P |/ log n + log n [19] (constant σ) |P |/ logσ n+log n(log log n)2 (ours) |P | + log log σ [15] |P |/ logσ n+log |P |+log log σ [7] Randomized |P |(1 + log logw σ) [6] |P | [5] |P |/ logσ n + logσ n [19, 31] Table 1 Our results in context. The x axis refers to the space used by the indexes (compressed meaning nHk (T ) + o(n log σ) bits, compact meaning O(n log σ) bits, and uncompressed meaning Θ(n log n) bits), and the y axis refers to the linear-time construction. In the cells we show the counting time for a pattern P . We only list the dominant alternatives, graying out those outperformed by our new results. Searches typically require to count the number of times P appears in T , and then locate the positions of T where P occurs. The vast majority of the indexes for this task are suffix tree [35] or suffix array [24] variants. The suffix tree can be built in linear deterministic time [35, 26, 34], even on arbitrarily large integer alphabets [11]. The suffix array can be easily derived from the suffix tree in linear time, but it can also be built independently in linear deterministic time [23, 22, 21]. In their basic forms, these structures allow counting the number of occurrences of a pattern P in T in time O(|P | log σ) (suffix tree) or O(|P | + log n) (suffix array). Once counted, the occurrences can be located in constant time each. Cole et al. [10] introduced the suffix trays, a simple twist on suffix trees that reduces their counting time to O(|P | + log σ). Fischer and Gawrychowski [15] introduced the wexponential search trees, which yield suffix trees with counting time O(|P | + log log σ) and support dynamism. All these structures can be built in linear deterministic time, but require Θ(n log n) bits of space, which challenges their practicality when handling large text collections. Faster counting is possible if we resort to perfect hashing and give away the linear deterministic construction time. In the classical suffix tree, we can easily achieve O(|P |) time by hashing the children of suffix tree nodes, and this is optimal in general. In the RAM model with word size Θ(log n), and if the consecutive symbols of P come packed into |P |/ logσ n words, the optimal time is instead O(|P |/ logσ n). This optimal time was recently reached by Navarro and Nekrich [31] (note that their time is not optimal if w = ω(log n)), with a simple application of weak-prefix search, already hinted in the original article [2]. However, even the randomized construction time of the weak-prefix search structure is O(n log n), for any constant  > 0. By replacing the weak-prefix search with the solution of Grossi and Vitter [19] for the last nodes of the search, and using a randomized construction of their perfect hash functions, the index of Navarro and Nekrich [31] can be built in linear randomized time and count in time O(|P |/ logσ n + logσ n). Only recently, simultaneously with our work, a deterministic linear-time construction algorithm was finally obtained for an index obtaining O(|P |/ logσ n + log |P | + log log σ) counting time [7]. Still, these structures are not compressed. Compressed suffix trees and arrays appeared in © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany the year 2000 [30]. To date, they take the space of the compressed text and replace it, in the sense that they can extract any desired substring of T ; they are thus called self-indexes. The space occupied is measured in terms of the k-th order empirical entropy of T , Hk (T ) ≤ log σ [25], which is a lower bound on the space reached by any statistical compressor that encodes each symbol considering only the k previous ones. Self-indexes may occupy as little as nHk (T ) + o(n(Hk (T ) + 1)) bits, for any k ≤ α logσ n − 1, for any constant 0 < α < 1. The fastest self-indexes with linear-time deterministic construction are those of Barbay et al. [1], which counts in time O(|P | log log σ), and Belazzougui and Navarro [6, Thm. 7], which counts in time O(|P |(1 + logw σ)). The latter requires O(n(1 + logw σ)) construction time, but if log σ = O(log w), its counting time is O(|P |) and its construction time is O(n). If we admit randomized linear-time constructions, then Belazzougui and Navarro [6, Thm. 10] reach O(|P |(1 + log logw σ)) counting time. At the expense of O(n) further bits, in another work [5] they reach O(|P |) counting time. Using O(n log σ) bits, and if P comes in packed form, Grossi and Vitter [19] can count in time O(|P |/ logσ n + logσ n), for any constant  > 0, however their construction requires O(n log σ) time. Table 1 puts those results and our contribution in context. Our new self-index, with O(|P | + log logw σ) counting time, linear-time deterministic construction, and nHk (T ) + o(n log σ) bits of space, dominates all the compressed indexes with linear-time deterministic construction [1, 6], as well as some uncompressed ones [15] (to be fair, we do not cover the case log σ = O(log w), as in this case the previous work [6, Thm. 7] already obtains our result). Our self-index also dominates a previous one with linear-time randomized construction [6, Thm. 10], which we incidentally show can also be built deterministically. The only aspect in which some of those dominated indexes may outperform ours is in that they may use o(n(Hk (T ) + 1)) [6, Thm. 10] or o(n) [6, Thm. 7] bits of redundancy, instead of our o(n log σ) bits. We also derive a compact index (i.e., using O(n log σ) bits) that is built in linear deterministic time and counts in time O(|P |/ logσ n + log n(log log n)2 ), which is the only one in this category unless we consider constant σ for Grossi and Vitter [19]. 3 Preliminaries We denote by T [i..] the suffix of T [0, n − 1] starting at position i and by T [i..j] the substring that begins with T [i] and ends with T [j], T [i..] = T [i]T [i + 1] . . . T [n − 1] and T [i..j] = T [i]T [i + 1] . . . T [j − 1]T [j]. We assume that the text T ends with a special symbol $ that lexicographically precedes all other symbols in T . The alphabet size is σ and symbols are integers in [0..σ − 1] (so $ corresponds to 0). In this paper, as in the previous work on this topic, we use the word RAM model of computation. A machine word consists of w = Ω(log n) bits and we can execute standard bit and arithmetic operations in constant time. We assume for simplicity that the alphabet size σ = O(n/ log n) (otherwise the text is almost incompressible anyway [16]). We also assume log σ = ω(log w), since otherwise our goal is already reached in previous work [6, Thm. 7]. 3.1 Rank and Select Queries We define three basic queries on sequences. Let B[0..n − 1] be a sequence of symbols over alphabet [0..σ − 1]. The rank query, ranka (i, B), counts how many times a occurs among the first i + 1 symbols in B, ranka (i, B) = |{ j ≤ i, B[j] = a}|. The select query, selecta (i, B), finds the position in B where a occurs for the i-th time, selecta (i, B) = j iff B[j] = a and ranka (j, B) = i. The third query is access(i, B), which returns simply B[i]. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany We can answer access queries in O(1) time and select queries in any ω(1) time, or vice versa, and rank queries in time O(log logw σ), which is optimal [6]. These structures use n log σ + o(n log σ) bits, and we will use variants that require only compressed space. In this paper, we will show that those structures can be built in linear deterministic time. An important special case of rank queries is the partial rank query, rankB[i] (i, B), which asks how many times B[i] occurrs in B[0..i]. Unlike general rank queries, partial rank queries can be answered in O(1) time [6]. Such a structure can be built in O(n) deterministic time and requires O(n log log σ) bits of working and final space [28, Thm. A.4.1]. For this paper, we define a generalization of partial rank queries called interval rank queries, ranka (i, j, B) = hranka (i − 1, B), ranka (j, B)i, from where in particular we can deduce the number of times a occurs in B[i..j]. If a does not occur in B[i..j], however, this query just returns null (this is why it can be regarded as a generalized partial rank query). In the special case where the alphabet size is small, log σ = O(log w), we can represent B so that rank, select, and access queries are answered in O(1) time [6, Thm. 7], but we are not focusing on this case in this paper, as the problem has already been solved for this case. 3.2 Suffix Array and Suffix Tree The suffix tree [35] for a string T [0..n − 1] is a compacted digital tree on the suffixes of T , where the leaves point to the starting positions of the suffixes. We call Xu the string leading to suffix tree node u. The suffix array [24] is an array SA[0..n − 1] such that SA[i] = j if and only if T [j..] is the (i + 1)-th lexicographically smallest suffix of T . All the occurrences of a substring P in T correspond to suffixes of T that start with P . These suffixes descend from a single suffix tree node, called the locus of P , and also occupy a contiguous interval in the suffix array SA. Note that the locus of P is the node u closest to the root for which P is a prefix of Xu . If P has no locus node, then it does not occur in T . 3.3 Compressed Suffix Array and Tree A compressed suffix array (CSA) is a compact data structure that provides the same functionality as the suffix array. The main component of a CSA is the one that allows determining, given a pattern P , the suffix array range SA[i..j] of the prefixes starting with P . Counting is then solved as j − i + 1. For locating any cell SA[k], and for extracting any substring S from T , most CSAs make use of a sampled array SAMb , which contains the values of SA[i] such that SA[i] mod b = 0 or SA[i] = n − 1. Here b is a tradeoff parameter: CSAs require O(n logb n ) further bits and can locate in time proportional to b and extract S in time proportional to b + |S|. We refer to a survey [30] for a more detailed description. A compressed suffix tree [33] is formed by a compressed suffix array and other components that add up to O(n) bits. These include in particular a representation of the tree topology that supports constant-time computation of the preorder of a node, its number of children, its j-th child, its number of descendant leaves, and lowest common ancestors, among others [32]. Computing node preorders is useful to associate satellite information to the nodes. Both the compressed suffix array and tree can be built in O(n) deterministic time using O(n log σ) bits of space [28]. 3.4 Burrows-Wheeler Transform and FM-index The Burrows-Wheeler Transform (BWT) [8] of a string T [0..n−1] is another string B[0..n−1] obtained by sorting all possible rotations of T and writing the last symbol of every rotation © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany (in sorted order). The BWT is related to the suffix array by the identity B[i] = T [(SA[i] − 1) mod n]. Hence, we can build the BWT by sorting the suffixes and writing the symbols that precede the suffixes in lexicographical order. The FM-index [12, 13] is a CSA that builds on the BWT. It consists of the following three main components: The BWT B of T . The array Acc[0..σ − 1] where Acc[i] holds the total number of symbols a < i in T (or equivalently, the total number of symbols a < i in B). The sampled array SAMb . The interval of a pattern string P [0..m − 1] in the suffix array SA can be computed on the BWT B. The interval is computed backwards: for i = m − 1, m − 2, . . ., we identify the interval of P [i..m − 1] in B. The interval is initially the whole B[0..n − 1]. Suppose that we know the interval B[i1 ..j1 ] that corresponds to P [i + 1..m − 1]. Then the interval B[i2 ..j2 ] that corresponds to P [i..m − 1] is computed as i2 = Acc[a] + rankc (i1 − 1, B) and j2 = Acc[a] + rankc (j1 , B) − 1, where a = P [i]. Thus the interval of P is found by answering 2m rank queries. Any sequence representation offering rank and access queries can then be applied on B to obtain an FM-index. An important procedure on the FM-index is the computation of the function LF , defined as follows: if SA[j] = i + 1, then SA[LF (j)] = i. LF can be computed with access and partial rank queries on B, LF (j) = rankB[j] (i, B) + Acc[B[j]] − 1, and thus constant-time computation of LF is possible. Using SAMb and O(b) applications of LF , we can locate any cell SA[r]. A similar procedure allows extracting any substring S of T with O(b + |S|) applications of LF . 4 Small Interval Rank Queries We start by showing how a compressed data structure that supports select queries can be extended to support a new kind of queries that we dub small interval rank queries. An interval query ranka (i, j, B) is a small interval rank query if j − i ≤ log2 σ. Our compressed index relies on the following result. I Lemma 2. Suppose that we are given a data structure that supports access queries on a sequence C[0..m − 1], on alphabet [0..σ − 1], in time t. Then, using O(m log log σ) additional bits, we can support small interval rank queries on C in O(t) time. Proof. We split C into groups Gi of log2 σ consecutive symbols, Gi = C[i log2 σ..(i + 1) log2 σ − 1]. Let Ai denote the sequence of the distinct symbols that occur in Gi . Storing Ai directly would need log σ bits per symbol. Instead, we encode each element of Ai as its first position in Gi , which needs only O(log log σ) bits. With this encoded sequence, since we have O(t)-time access to C, we have access to any element of Ai in time O(t). In addition, we store a succinct SB-tree [18] on the elements of Ai . This structure uses O(p log log u) bits to index p elements in [1..u], and supports predecessor (and membership) queries in time O(log p/ log log u) plus one access to Ai . Since u = σ and p ≤ log2 σ, the query time is O(t) and the space usage is bounded by O(m log log σ) bits. For each a ∈ Ai we also keep the increasing list Ia,i of all the positions where a occurs in Gi . Positions are stored as differences with the left border of Gi : if C[j] = a, we store the difference j − i log2 σ. Hence elements of Ia,i can also be stored in O(log log σ) bits per symbol, adding up to O(m log log σ) bits. We also build an SB-tree on top of each Ia,i to provide for predecessor searches. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany Using the SB-trees on Ai and Ia,i , we can answer small interval rank queries ranka (x, y, C). Consider a group Gi = C[i log2 σ..(i + 1) log2 σ − 1], an index k such that i log2 σ ≤ k ≤ (i + 1) log2 σ, and a symbol a. We can find the largest i log2 σ ≤ r ≤ k such that C[r] = a, or determine it does not exist: First we look for the symbol a in Ai ; if a ∈ Ai , we find the predecessor of k − i log2 σ in Ia,i . Now consider an interval C[x..y] of size at most log2 σ. It intersects at most two groups, Gi and Gi−1 . We find the rightmost occurrence of symbol a in C[x..y] as follows. First we look for the rightmost occurrence y 0 ≤ y of a in Gi ; if a does not occur in C[i log2 σ..y], we look for the rightmost occurrence y 0 ≤ i log2 σ − 1 of a in Gi−1 . If this is ≥ x, we find the leftmost occurrence x0 of a in C[x..y] using a symmetric procedure. When x0 ≤ y 0 are found, we can compute ranka (x0 , C) and ranka (y 0 , C) in O(1) time by answering partial rank queries (Section 3.1). These are supported in O(1) time and O(m log log σ) bits. The answer is then hranka (x0 , C) − 1, ranka (y 0 , C)i, or null if a does not occur in C[x..y]. J The construction of the small interval rank data structure is dominated by the time √ needed to build the succinct SB-trees [18]. These are simply B-trees with arity O( log u) and height O(log p/ log log u), where in each node a Patricia tree for O(log log u)-bit chunks of the keys are stored. To build the structure in O(log p/ log log u) time per key, we only need to build those Patricia trees in linear time. Given that the total number of bits of all √ the keys to insert in a Patricia tree is O( log u log log u), we do not even need to build the Patricia tree. Instead, a universal precomputed table may answer any Patricia tree search for any possible set of keys and any possible pattern, in constant time. The size of the table √ √ is O(2O( log u log log u) log u) = o(u) bits (the authors [18] actually use a similar table to answer queries). For our values of p and u, the construction requires O(mt) time and the universal table is of o(σ) bits. 5 Compressed Index We classify the nodes of the suffix tree T of T into heavy, light, and special, as in previous work [31, 28]. Let d = log σ. A node u of T is heavy if it has at least d leaf descendants and light otherwise. We say that a heavy node u is special if it has at least two heavy children. For every special node u, we construct a deterministic dictionary [20] Du that contains the labels of all the heavy children of u: If the jth child of u, uj , is heavy and the first symbol on the edge from to u to uj is aj , then we store the key aj in Du with j as satellite data. If a heavy node u has only one heavy child uj and d or more light children, then we also store the data structure Du (containing only that heavy child of u). If, instead, a heavy node has one heavy child and less than d light children, we just keep the index of the heavy child using O(log d) = O(log log σ) bits. The second component of our index is the Burrows-Wheeler Transform B of the reverse text T . We store a data structure that supports rank, partial rank, select, and access queries on B. It is sufficient for us to support access and partial rank queries in O(1) time and rank queries in O(log logw σ) time. We also construct the data structure described in Lemma 2, which supports small interval rank queries in O(1) time. Finally, we explicitly store the answers to some rank queries. Let B[lu ..ru ] denote the range of Xu , where Xu is the reverse of Xu , for a suffix tree node u. For all data structures Du and for every symbol a ∈ Du we store the values of ranka (lu − 1, B) and ranka (ru , B). Let us show how to store the selected precomputed answers to rank queries in O(log σ) bits per query. Following a known scheme [17], we divide the sequence B into chunks of size σ. For each symbol a, we encode the number dk of times a occurs in each chunk k © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany in a binary sequence Aa = 01d0 01d1 01d2 . . .. If a symbol B[i] belongs to chunk k = bi/σc, then ranka (i, B) is select0 (k + 1, Aa ) − k plus the number of times a occurs in B[kσ..i]. The former value is computed in O(1) time with a structure that uses |Aa | + o(|Aa |) bits [9, 27], whereas the latter value is in [0, σ] and thus can be stored in Du using just O(log σ) bits. The total size of all the sequences Aa is O(n) bits. Therefore, Du needs O(log σ) bits per element. The total number of elements in all the structures Du is equal to the number of special nodes plus the number of heavy nodes with one heavy child and at least d light children. Hence all Du contain O(n/d) symbols and use O((n/d) log σ) = O(n) bits of space. Indexes of heavy children for nodes with only one heavy child and less than d light children add up to O(n log log σ) bits. The structures for partial rank and small interval rank queries on B use O(n log log σ) further bits. Since we assume that σ is ω(1), we can simplify O(n log log σ) = o(n log σ). The sequence representation that supports access and rank queries on B can be made to use nHk (T ) + o(n(Hk (T ) + 1)) bits, by exploiting the fact that it is built on a BWT [6, Thm. 10].1 We note that they use constant-time select queries on B instead of constant-time access, so they can use select queries to perform LF −1 -steps in constant time. Instead, with our partial rank queries, we can perform LF -steps in constant time (recall Section 3.4), and thus have constant-time access instead of constant-time select on B (we actually do not use query select at all). They avoid this solution because partial rank queries require o(n log σ) bits, which can be more than o(n(Hk (T ) + 1)), but we are already paying this price. Apart from this space, array Acc needs O(σ log n) = O(n) bits and SAMb uses O(n logb n ). The total space usage of our self-index then adds up to nHk (T ) + o(n log σ) + O(n logb n ) bits. 6 Pattern Search Given a query string P , we will find in time O(|P | + log logw σ) the range of the reversed string P in B. A backward search for P in B will be replaced by an analogous backward search for P in B, that is, we will find the range of P [0..i] if the range of P [0..i − 1] is known. Let [li ..ri ] be the range of P [0..i]. We can compute li and ri from li−1 and ri−1 as li = Acc[a] + ranka (li−1 − 1, B) and ri = Acc[a] + ranka (ri−1 , B) − 1, for a = P [i]. Using our auxiliary data structures on B and the additional information stored in the nodes of the suffix tree T , we can answer the necessary rank queries in constant time (with one exception). The idea is to traverse the suffix tree T in synchronization with the forward search on B, until the locus of P is found or we determine that P does not occur in T . Our procedure starts at the root node of T , with l−1 = 0, r−1 = n − 1, and i = 0. We compute the ranges B[li ..ri ] that correspond to P [0..i] for i = 0, . . . , |P | − 1. Simultaneously, we move down in the suffix tree. Let u denote the last visited node of T and let a = P [i]. We denote by ua the next node that we must visit in the suffix tree, i.e., ua is the locus of P [0..i]. We can compute li and ri in O(1) time if ranka (ri−1 , B) and ranka (li−1 − 1, B) are known. We will show below that these queries can be answered in constant time because either (a) the answers to rank queries are explicitly stored in Du or (b) the rank query that must be answered is a small interval rank query. The only exception is the situation when we move from a heavy node to a light node in the suffix tree; in this case the rank query takes O(log logw σ) time. We note that, once we are in a light node, we need not descend in T anymore; it is sufficient to maintain the interval in B. For ease of description we distinguish between the following cases. 1 In fact it is nHk (T ), but this is nHk (T ) + O(log n) [12, Thm. A.3]. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 1. Node u is heavy and a ∈ Du . In this case we identify the heavy child ua of u that is labeled with a in constant time using the deterministic dictionary. We can also find li and ri in time O(1) because ranka (li−1 − 1, B) and ranka (ri−1 , B) are stored in Du . 2. Node u is heavy and a 6∈ Du . In this case ua , if it exists, is a light node. We then find it with two standard rank queries on B, in order to compute li and ri or determine that P does not occur in T . 3. Node u is heavy but we do not keep a dictionary Du for the node u. In this case u has at most one heavy child and less than d light children. We have two subcases: a. If ua is the (only) heavy node, we find this out with a single comparison, as the heavy node is identified in u. However, the values ranka (li−1 − 1, B) and ranka (ri−1 , B) are not stored in u. To compute them, we exploit the fact that the number of non-a’s in B[li−1 ..ri−1 ] is less than d2 , as all the children apart from ua are light and less than d. Therefore, the first and the last occurrences of a in B[li−1 ..ri−1 ] must be at distance less than d2 from the extremes li−1 and ri−1 , respectively. Therefore, a small interval rank query, ranka (li−1 , li−1 + d2 , B), gives us ranka (li−1 − 1, B), since there is for sure an a in the range. Analogously, ranka (ri−1 − d2 , ri−1 , B) gives us ranka (ri−1 , B). b. If ua is a light node, we compute li and ri with two standard rank queries on B (or we might determine that P does not appear in T ). 4. Node u is light. In this case, P [0..i − 1] occurs at most d times in T . Hence P [0..i − 1] also occurs at most d times in T and ri−1 − li−1 ≤ d. Therefore we can compute ri and li in O(1) time by answering a small interval rank query, hranka (li−1 − 1, B), ranka (ri−1 , B)i. If this returns null, then P does not occur in T . 5. We are on an edge of the suffix tree between a node u and some child uj of u. In this case all the occurrences of P [0..i − 1] in T are followed by the same symbol, c, and all the occurrences of P [0..i − 1] are preceded by c in T . Therefore B[li−1 ..ri−1 ] contains only the symbol c. This situation can be verified with access and partial rank queries on B: B[ri−1 ] = B[li−1 ] = c and rankc (ri−1 , B) − rankc (li−1 , B) = ri−1 − li−1 . In this case, if a 6= c, then P does not occur in T ; otherwise we obtain the new range with the partial rank query rankc (ri−1 , B), and rankc (li−1 − 1, B) = rankc (ri−1 , B) − (ri−1 − li−1 + 1). Note that if u is light we do not need to consider this case; we may directly apply case 4. Except for the cases 2 and 3b, we can find li and ri in O(1) time. In cases 2 and 3b we need O(log logw σ) time to answer general rank queries. However, these cases only take place when the node u is heavy and its child ua is light. Since all descendants of a light node are light, those cases occur only once along the traversal of P . Hence the total time to find the range of P in B is O(|P | + log logw σ). Once the range is known, we can count and report all occurrences of P in the standard way. 7 7.1 Linear-Time Construction Sequences and Related Structures Apart from constructing the BWT B of T , which is a component of the final structure, the linear-time construction of the other components requires that we also build, as intermediate structures, the BWT B of T , and the compressed suffix trees T and T of T and T , respectively. All these are built in O(n) deterministic time and using O(n log σ) bits of space [28]. We also keep, on top of both B and B, O(n log log σ)-bit data structures able to report, for any interval B[i..j] or B[i..j], all the distinct symbols from this interval, and their frequencies in © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany the interval. The symbols are retrieved in arbitrary order. These auxiliary data structures can also be constructed in O(n) time [28, Sec. A.5]. On top of the sequences B and B, we build the representation that supports access in O(1) and rank in O(log logw σ) time [6]. In their original paper, those structures are built using perfect hashing, but a deterministic construction is also possible [4, Lem. 11]; we give the details next. The key part of the construction is that, within a chunk of σ symbols, we must build a virtual list Ia of the positions where each symbol a occurs, and provide predecessor search on those lists in O(log logw σ) time. We divide each list into blocks of log2 σ elements, and create a succinct SB-tree [18] on the block elements, much as in Section 4. The search time inside a block is then O(t), where t is the time to access an element in Ia , and the total extra space is O(n log log σ) bits. If there is more than one block in Ia , then the block minima are inserted into a predecessor structure [6, App. A] that will find the closest preceding block minimum in time O(log logw σ) and use O(n log log σ) bits. This structure uses perfect hash functions called I(P ), which provide constant-time membership queries. Instead, we replace them with deterministic dictionaries [20]. The only disadvantage of these dictionaries is that they require O(log σ) construction time per element, and since each element is inserted into O(log logw σ) structures I(P ), the total construction time per element is O(log σ log logw σ). However, since we build these structures only on O(n/ log2 σ) block minima, the total construction time is only O(n). On the variant of the structure that provides constant-time access, the access to an element in Ia is provided via a permutation structure [29] which offers access time t with extra space O((n/t) log σ) bits. Therefore, for any log σ = ω(log w), we can have t = O(log logw σ) with o(n log σ) bits of space. 7.2 Structures Du The most complex part of the construction is to fill the data of the Du structures. We visit all the nodes of T and identify those nodes u for which the data structure Du must be constructed. This can be easily done in linear time, by using the constant-time computation of the number of descendant leaves. To determine if we must build Du , we traverse its children u1 , u2 , . . . and count their descendant leaves to decide if they are heavy or light. We use a bit vector D to mark the preorders of the nodes u for which Du will be constructed: If p is the preorder of node u, then it stores a structure Du iff D[p] = 1, in which case Du is stored in an array at position rank1 (D, p). If, instead, u does not store Du but it has one heavy child, we store its child rank in another array indexed by rank0 (D, p), using log log σ bits per cell. The main difficulty is how to compute the symbols a to be stored in Du , and the ranges B[lu , ru ], for all the selected nodes u. It is not easy to do this through a preorder traversal of T because we would need to traverse edges that represent many symbols. Our approach, instead, is inspired by the navigation of the suffix-link tree using two BWTs given by Belazzougui et al. [3]. Let Tw denote the tree whose edges correspond to Weiner links between internal nodes in T . That is, the root of Tw is the same root of T and, if we have internal nodes u, v ∈ T where Xv = a · Xu for some symbol a, then v descends from u by the symbol a in Tw . We first show that the nodes of Tw are the internal nodes of T . The inclusion is clear by definition in one direction; the other is well-known but we prove it for completeness. I Lemma 3. All internal nodes of the suffix tree T are nodes of Tw . Proof. We proceed by induction on |Xu |, where the base case holds by definition. Now let a © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany non-root internal node u of T be labeled by string Xu = aX. This means that there are at least two different symbols a1 and a2 such that both aXa1 and aXa2 occur in the text T . Then both Xa1 and Xa2 also occur in T . Hence there is an internal node u0 with Xu0 = X in T and a Weiner link from u0 to u. Since |Xu0 | = |Xu | − 1, it holds by the inductive hypothesis that u0 belongs to Tw , and thus u belongs to Tw as a child of u0 . J We do not build Tw explicitly, but just traverse its nodes conceptually in depth-first order and compute the symbols to store in the structures Du and the intervals in B. Let u be the current node of T in this traversal and u its corresponding locus in T . Assume for now that u is a nod, too. Let [lu , ru ] be the interval of Xu in B and [lu , ru ] be the interval of the reverse string Xu in B.2 Our algorithm starts at the root nodes of Tw , T , and T , which correspond to the empty string, and the intervals in B and B are [lu , ru ] = [lu , ru ] = [0, n − 1]. We will traverse only the heavy nodes, yet in some cases we will have to work on all the nodes. We ensure that on heavy nodes we work at most O(log σ) time, and at most O(1) time on arbitrary nodes. Upon arriving at each node u, we first compute its heavy children. From the topology of T we identify the interval [li , ri ] for every child ui of u, by counting leaves in the subtrees of the successive children of u. By reporting all the distinct symbols in B[lu ..ru ] with their frequencies, we identify the labels of those children. However, the labels are retrieved in arbitrary order and we cannot afford sorting them all. Yet, since the labels are associated with their frequencies in B[lu ..ru ], which match their number of leaves in the subtrees of u, we can discard the labels of the light children, that is, those appearing less than d times in B[lu ..ru ]. The remaining, heavy, children are then sorted and associated with the successive heavy children ui of u in T . If our preliminary pass marked that a Du structure must be built, we construct at this moment the deterministic dictionary [20] with the labels a of the heavy children of u we have just identified, and associate them with the satellite data ranka (lu − 1, B) and ranka (ru , B). This construction takes O(log σ) time per element, but it includes only heavy nodes. We now find all the Weiner links from u. For every (heavy or light) child ui of u, we compute the list Li of all the distinct symbols that occur in B[li ..ri ]. We mark those symbols a in an array V [0..σ − 1] that holds three possible values: not seen, seen, and seen (at least) twice. If V [a] is not seen, then we mark it as seen; if it is seen, we mark it as seen twice; otherwise we leave it as seen twice. We collect a list Eu of the symbols that are seen twice along this process, in arbitrary order. For every symbol a in Eu , there is an explicit Weiner link from u labeled by a: Let X = Xu ; if a occurred in Li and Lj then both aXai and aXaj occur in T and there is a suffix tree node that corresponds to the string aX. The total time to build Eu amortizes to O(n): for each child v of u, we pay O(1) time for each child the node v has in T ; each node in T contributes once to the cost. The targets of the Weiner links from u in T correspond to the children of the node u in T . To find them, we collect all the distinct symbols in B[lu ..ru ] and their frequencies. Again, we discard the symbols with frequency less than d, as they will lead to light nodes, which we do not have to traverse. The others are sorted and associated with the successive heavy children of u. By counting leaves in the successive children, we obtain the intervals B[li0 ..ri0 ] corresponding to the heavy children u0i of u. We are now ready to continue the traversal of Tw : for each Weiner link from u by 2 In the rest of the paper we wrote B[lu ..ru ] instead of B[lu ..ru ] for simplicity, but this may cause confusion in this section. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany symbol a leading to a heavy node, which turns out to be the i-th child of u, we know that its node in T is u0i (computed from u using the tree topology) and its interval is B[li0 ..ri0 ]. To compute the corresponding interval on B, we use the backward step operation, B[x, y] = B[Acc[a] + ranka (lu − 1, B), Acc[a] + ranka (ru , B) − 1]. This requires O(log logw σ) time, but applies only to heavy nodes. Finally, the corresponding node in T is obtained in constant time as the lowest common ancestor of the x-th and the y-th leaves of T . In the description above we assumed for simplicity that u is a node in T . In the general case u can be located on an edge of T . This situation arises when all occurrences of Xu in the reverse text T are followed by the same symbol a. In this case there is at most one Weiner link from u; the interval in B does not change as we follow that link. A recursive traversal of Tw might require O(nσ log n) bits for the stack, because we store several integers associated to heavy children during the computation of each node u. We can limit the stack height by determining the largest subtree among the Weiner links of u, traversing all the others recursively, and then moving to that largest Weiner link target without recursion [3, Lem. 1]. Since only the largest subtree of a Weiner link target can contain more than half of the nodes of the subtree of u, the stack is guaranteed to be of height only O(log n). The space usage is thus O(σ log2 n) = O(n log σ). As promised, we have spent at most O(log σ) time on heavy nodes, which are O(n/d) = O(n/ log σ) in total, thus these costs add up to O(n). All other costs that apply to arbitrary nodes are O(1). The structures for partial rank queries (and the succinct SB-trees) can also be built in linear deterministic time, as shown in Section 4. Therefore our index can be constructed in O(n) time. 8 A Compact Index As an application of our techniques, we show that it is possible to obtain O(|P |/ logσ n+log2 n) search time, and even O(|P |/ logσ n + log n(log log n)2 ), with an index that uses O(n log σ) bits and is built in linear deterministic time. We store B in compressed form and a sample of the heavy nodes of T . Following previous work [19, 31], we start from the root and store a deterministic dictionary [20] with all the highest suffix tree nodes v representing strings of depth ≥ ` = logσ n. The key associated with each node is a log(n)-bit integer formed with the first ` symbols of the strings Pv . The satellite data are the length |Pv |, a position where Pv occurs in T , and the range B[lv ..rv ] of v. From each of those nodes v, we repeat the process with the first ` symbols that follow after Pv , and so on. The difference is that no light node will be inserted in those dictionaries. Let us charge the O(log n) bits of space to the children nodes, which are all heavy. If we count only the special nodes, which are O(n/d), this amounts to O((n log n)/d) total bits and construction time. Recall that d is the maximum subtree size of light nodes. This time will use d = Θ(log n) to have linear construction time and bit space, and thus will not take advantage of small rank interval queries. There are, however, heavy nodes that are not special. These form possibly long chains between special nodes, and these will also induce chains of sampled nodes. While building the dictionaries for those nodes is trivial because they have only one sampled child, the total space may add up to O(n log σ) bits, if there are Θ(n) heavy nodes and the sampling chooses one out of ` in the chains. To avoid this, we increase the sampling step in those chains, enlarging it to `0 = log n. This makes the extra space spent in sampling heavy non-special nodes to be O(n) bits as well. In addition, we store the text T with a data structure that uses nHk (T ) + o(n log σ) for © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany any k = o(logσ n), and allows us extract O(logσ n) consecutive symbols in constant time [14]. The search for P starts at the root, where its first ` symbols are used to find directly the right descendant node v in the dictionary stored at the root. If |Pv | > `, we directly compare the other |Pv | − ` symbols of P with the text, from the stored position where v appears, by chunks of ` symbols. Then we continue the search from v (ignore the chains for now). When the next ` symbols of P are not found in the dictionary of the current node v, or there are less than ` remaining symbols in P , we continue using backward search on B from the interval B[lv ..rv ] stored at v, and do not use the suffix tree topology anymore. If there are less than ` remaining symbols in P , we just proceed symbolwise and complete the search in O(` log logw σ) time. Before this point, we still proceed by chunks of ` symbols, except when (conceptually) traversing the explicit light suffix tree nodes, where we perform individual backward steps. Because there are only O(d) suffix tree nodes in the remaining subtree, the number of backward steps to traverse such light nodes is O(d) and can be performed in time O(d log logw σ). All the symbols between consecutive light nodes must be traversed in chunks of `. Let v be our current node and u its desired child, and let k + 1 be the number of symbols labeling the edge between them. After the first backward step from v to u leads us from the interval B[lv ..rv ] to B[l..r], we must perform k further backward steps, where each intermediate interval is formed by just one symbol. To traverse them fast, we first compute tl = SA[l] and tr = SA[r]. The desired symbols are then T [tl − 1] = T [tr − 1], . . . , T [tl − k] = T [tr − k]. We thus compare the suffixes T [n − tl ..] and T [n − tr ..] with what remains of P , by chunks of ` symbols, until finding the first difference; k is then the number of coincident symbols seen. If the two suffixes coincide up to k + 1 but they differ from P , then P is not in T . Otherwise, we can move (conceptually) to node u and consume the k coincident characters from P . We can compute the new interval [lu ..ru ] = [SA −1 [tl − k], SA −1 [tr − k]]. Since SA and its inverse are computed in O(b) time with arrays similar to SAMb , we spend O(b) time to cross each of the O(d) edges in the final part of the search. Let us now regard the case where we reach a sampled node v that starts a sampled chain. In this case the sampling step grows to `0 . We still compare P with a suffix of T where its heavy sampled child u appears, in chunks of ` symbols. If they coincide, we continue the search from u. Otherwise, we resume the search from B[lv ..rv ] using backward search. We might have to process `0 symbols of P , in time O(`0 log logw σ), before reaching a light node. Then, we proceed as explained. Overall, the total space is 2nHk (T ) + o(n log σ) + O(n) + O((n log n)/b) bits, and the construction time is O(n). To have o(n log σ) + O(n) bits of redundancy in total, we may choose b = Θ(log n) or any b = ω(logσ n). The search time is O(|P |/ logσ n + `0 log logw σ + d log logw σ + db). We can, for example, choose b = Θ(log n), to obtain the following result. I Theorem 4. On a RAM machine of w = Ω(log n) bits, we can construct an index for a text T of length n over an alphabet of size σ = O(n/ log n) in O(n) deterministic time using O(n log σ) bits of working space. This index occupies 2nHk (T ) + o(n log σ) + O(n) bits of space for any k = o(logσ n). The occurrences of a pattern string P can be counted in O(|P |/ logσ n + log2 n) time, and then each such occurrence can be located in O(log n) time. An arbitrary substring S of T can be extracted in time O(|S|/ logσ n). 8.1 Faster and Larger By storing the BWT B of T and the O(n) additional bits to support a compressed suffix tree T [33], we can reduce the O(log2 n) extra time to O(log n(log log n)2 ). © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany The idea is to speed up the traversal on the light nodes, as follows. For each light node v, we store the leaf in T where the heavy path starting at v ends. The heavy path chooses at each node the subtree with the most leaves, thus any traversal towards a leaf has to switch to another heavy path only O(log d) times. At each light node v, we go to the leaf u of its heavy path, obtain its position in T using the sampled array SAMb of B, and compare the rest of P with the corresponding part of the suffix, by chunks of ` symbols. Once we determine the number k of symbols that coincide with P in the path from v to u, we perform a binary search for the highest ancestor v 0 of u where |Pv0 − Pv | ≥ k. If |Pv0 − Pv | > k, then P does not appear in T (unless P ends at the k-th character compared, in which case the locus of P is v 0 ). Otherwise, we continue the search from v 0 . Each binary search step requires O(b) time to determine |Px | [33], so it takes time O(b log d). Since we switch to another heavy path (now the one starting at v 0 ) O(log d) times, the total time is O(b log2 d) = O(log n(log log n)2 ) instead of O(bd) = O(log2 n). To store the leaf u corresponding to each light node v, we record the difference between the preorder numbers of u and v, which requires O(log d) bits. The node u is easily found in constant time from this information [33]. We have the problem, however, that we spend O(log d) = O(log log n) bits per light node, which adds up to O(n log log n) bits. To reduce this to O(n), we choose a second sampling step e = O(log log n), and do not store this information on nodes with less than e leaves, which are called light-light. Those light nodes with e leaves or more are called light-heavy, and those with at least two light-heavy children are called light-special. There are O(n/e) light-special nodes. We store heavy path information only for light-special nodes or for light-heavy nodes that are children of heavy nodes; both are O(n/e) in total. A light-heavy node v that is not light-special has at most one light-heavy child u, and the heavy path that passes through v must continue towards u. Therefore, if it turns out that the search must continue from v after the binary search on the heavy path, then the search must continue towards the light-light children of v, therefore no heavy-path information is needed at node v. Once we reach the first light-light node v, we proceed as we did for Theorem 4 on light nodes, in total time O(eb) = O(log n log log n). We need, however, the interval B[lv , rv ] before we can start the search from v. The interval B[lv , rv ] is indeed known by counting leaves in T , and we can compute lv = SA −1 [n − 1 − SA[lv ]] and rv = SA −1 [n − 1 − SA[rv ]], in time O(b). I Theorem 5. On a RAM machine of w = Ω(log n) bits, we can construct an index for a text T of length n over an alphabet of size σ = O(n/ log n) in O(n) deterministic time using O(n log σ) bits of working space. This index occupies 3nHk (T ) + o(n log σ) + O(n) bits of space for any k = o(logσ n). The occurrences of a pattern string P can be counted in O(|P |/ logσ n + log n(log log n)2 ) time, and then each such occurrence can be located in O(log n) time. An arbitrary substring S of T can be extracted in time O(|S|/ logσ n). 9 Conclusions We have shown how to build, in O(n) deterministic time and using O(n log σ) bits of working space, a compressed self-index for a text T of length n over an alphabet of size σ that searches for patterns P in time O(|P | + log logw σ), on a w-bit word RAM machine. This improves upon previous compressed self-indexes requiring O(|P | log log σ) [1] or O(|P |(1 + logw σ)) [6] time, on previous uncompressed indexes requiring O(|P | + log log σ) time [15] (but that supports dynamism), and on previous compressed self-indexes requiring O(|P |(1 + log logw σ)) time and randomized construction (which we now showed how to build in linear deterministic © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany time) [6]. The only indexes offering better search time require randomized construction [5, 19, 31] or Θ(n log n) bits of space [31, 7]. As an application, we showed that using O(n log σ) bits of space, we can build in O(n) deterministic time an index that searches in time O(|P |/ logσ n + log n(log log n)2 ). It is not clear if O(|P |) time, or even O(|P |/ logσ n), query time can be achieved with a linear deterministic construction time, even if we allow O(n log n) bits of space for the index (this was recently approached, but some additive polylog factors remain [7]). This is the most interesting open problem for future research. References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 J. Barbay, F. Claude, T. Gagie, G. Navarro, and Y. Nekrich. Efficient fully-compressed sequence representations. Algorithmica, 69(1):232–268, 2014. D. Belazzougui, P. Boldi, R. Pagh, and S. Vigna. Fast prefix search in little space, with applications. In Proc. 18th Annual European Symposium on Algorithms (ESA), LNCS 6346, pages 427–438, 2010. D. Belazzougui, F. Cunial, J. Kärkkäinen, and V. Mäkinen. Versatile succinct representations of the bidirectional Burrows-Wheeler transform. In Proc. 21st Annual European Symposium on Algorithms (ESA), pages 133–144, 2013. D. Belazzougui, F. Cunial, J. Kärkkäinen, and V. Mäkinen. Linear-time string indexing and analysis in small space. CoRR, abs/1609.06378, 2016. D. Belazzougui and G. Navarro. Alphabet-independent compressed text indexing. ACM Transactions on Algorithms, 10(4):article 23, 2014. D. Belazzougui and G. Navarro. Optimal lower and upper bounds for representing sequences. ACM Transactions on Algorithms, 11(4):article 31, 2015. P. Bille, I. L. Gørtz, and F. R. Skjoldjensen. Deterministic indexing for packed strings. In Proc. 28th Annual Symposium on Combinatorial Pattern Matching (CPM), LIPIcs 78, page article 6, 2017. M. Burrows and D. Wheeler. A block sorting lossless data compression algorithm. Technical Report 124, Digital Equipment Corporation, 1994. D. R. Clark. Compact PAT Trees. PhD thesis, University of Waterloo, Canada, 1996. R. Cole, T. Kopelowitz, and M. Lewenstein. Suffix trays and suffix trists: Structures for faster text indexing. Algorithmica, 72(2):450–466, 2015. M. Farach. Optimal suffix tree construction with large alphabets. In Proc. 38th Annual Symposium on Foundations of Computer Science (FOCS), pages 137–143, 1997. P. Ferragina and G. Manzini. Indexing compressed text. Journal of the ACM, 52(4):552– 581, 2005. P. Ferragina, G. Manzini, V. Mäkinen, and G. Navarro. Compressed representations of sequences and full-text indexes. ACM Transactions on Algorithms, 3(2):article 20, 2007. P. Ferragina and R. Venturini. A simple storage scheme for strings achieving entropy bounds. Theoretical Computer Science, 371(1):115–121, 2007. J. Fischer and P. Gawrychowski. Alphabet-dependent string searching with wexponential search trees. In Proc. 26th Annual Symposium on Combinatorial Pattern Matching (CPM), LNCS 9133, pages 160–171, 2015. T. Gagie. Large alphabets and incompressibility. Information Processing Letters, 99(6):246– 251, 2006. A. Golynski, J. I. Munro, and S. S. Rao. Rank/select operations on large alphabets: a tool for text indexing. In Proc. 17th Annual ACM-SIAM Symposium on Discrete Algorithms, (SODA), pages 368–373, 2006. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 R. Grossi, A. Orlandi, R. Raman, and S. S. Rao. More haste, less waste: Lowering the redundancy in fully indexable dictionaries. In Proc. 26th International Symposium on Theoretical Aspects of Computer Science (STACS), pages 517–528, 2009. R. Grossi and J. S. Vitter. Compressed suffix arrays and suffix trees with applications to text indexing and string matching. SIAM Journal on Computing, 35(2):378–407, 2005. T. Hagerup, P. Bro Miltersen, and R. Pagh. Deterministic dictionaries. Journal of Algorithms, 41(1):69 – 85, 2001. J. Kärkkäinen, P. Sanders, and S. Burkhardt. Linear work suffix array construction. Journal of the ACM, 53(6):918–936, 2006. D. K. Kim, J. S. Sim, H. Park, and K. Park. Constructing suffix arrays in linear time. Journal of Discrete Algorithms, 3(2-4):126–142, 2005. P. Ko and S. Aluru. Space efficient linear time construction of suffix arrays. Journal of Discrete Algorithms, 3(2-4):143–156, 2005. U. Manber and G. Myers. Suffix arrays: a new method for on-line string searches. SIAM Journal on Computing, 22(5):935–948, 1993. G. Manzini. An analysis of the Burrows-Wheeler transform. Journal of the ACM, 48(3):407– 430, 2001. E. M. McCreight. A space-economical suffix tree construction algorithm. Journal of the ACM, 23(2):262–272, 1976. J. I. Munro. Tables. In Proc. 16th Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS), LNCS 1180, pages 37–42, 1996. J. I. Munro, G. Navarro, and Y. Nekrich. Space-efficient construction of compressed indexes in deterministic linear time. In Proc. 28th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 408–424, 2017. J. I. Munro, R. Raman, V. Raman, and S. S. Rao. Succinct representations of permutations and functions. Theoretical Computer Science, 438:74–88, 2012. G. Navarro and V. Mäkinen. Compressed full-text indexes. ACM Computing Surveys, 39(1):article 2, 2007. G. Navarro and Y. Nekrich. Time-optimal top-k document retrieval. SIAM Journal on Computing, 46(1):89–113, 2017. G. Navarro and K. Sadakane. Fully-functional static and dynamic succinct trees. ACM Transactions on Algorithms, 10(3):article 16, 2014. K. Sadakane. Compressed suffix trees with full functionality. Theory of Computing Systems, 41(4):589–607, 2007. E. Ukkonen. On-line construction of suffix trees. Algorithmica, 14(3):249–260, 1995. P. Weiner. Linear pattern matching algorithms. In Proc. 14th Annual Symposium on Switching and Automata Theory (FOCS), pages 1–11, 1973. © J. Ian Munro, Gonzalo Navarro, Yakov Nekrich; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany
8cs.DS
A Framework to Synergize Partial Order Reduction with State Interpolation Duc-Hiep Chu and Joxan Jaffar arXiv:1408.0957v1 [cs.LO] 5 Aug 2014 National University of Singapore hiepcd,[email protected] Abstract. We address the problem of reasoning about interleavings in safety verification of concurrent programs. In the literature, there are two prominent techniques for pruning the search space. First, there are wellinvestigated trace-based methods, collectively known as “Partial Order Reduction (POR)”, which operate by weakening the concept of a trace by abstracting the total order of its transitions into a partial order. Second, there is state-based interpolation where a collection of formulas can be generalized by taking into account the property to be verified. Our main contribution is a framework that synergistically combines POR with state interpolation so that the sum is more than its parts. 1 Introduction We consider the state explosion problem in safety verification of concurrent programs. This is caused by the interleavings of transitions from different processes. In explicit-state model checking, a general approach to counter this explosion is Partial Order Reduction (POR) (e.g., [20, 18, 9]). This exploits the equivalence of interleavings of “independent” transitions: two transitions are independent if their consecutive occurrences in a trace can be swapped without changing the final state. In other words, POR-related methods prune away redundant process interleavings in a sense that, for each Mazurkiewicz [16]1 trace equivalence class of interleavings, if a representative has been checked, the remaining ones are regarded as redundant. On the other hand, symbolic execution [15] is another method for program reasoning which recently has made increasing impact on software engineering research [4]. The main challenge for symbolic execution is the exponential number of symbolic paths. The works [17, 12] tackle successfully this fundamental problem by eliminating from the concrete model, on-the-fly, those facts which are irrelevant or too-specific for proving the unreachability of the error nodes. This learning phase consists of computing state-based interpolants in a similar spirit to that of conflict clause learning in SAT solvers. Now symbolic execution with state interpolation (SI) has been shown to be effective for verifying sequential programs. In SI [17, 12], a node at program 1 We remark that the concept of POR goes beyond the preservation of Mazurkiewicz traces, e.g. [20]. However, from a practical perspective, it is safe to consider such form of pruning as a representative example of POR. point ` in the reachability tree can be pruned, if its context is subsumed by the interpolant computed earlier for the same program point `. Therefore, even in the best case scenario, the number of states explored by an SI method must still be at least the number of all distinct program points2 . However, in the setting of concurrent programs, exploring each distinct global program point3 once might already be considered prohibitive. In short, symbolic execution with SI alone is not efficient enough for the verification of concurrent programs. Recent work (e.g., [25]) has shown the usefulness of going stateful in implementing a POR method. It directly follows that SI can help to yield even better performance. In order to implement an efficient stateful algorithm, we are required to come up with an abstraction for each (concrete or symbolic) state. Unsurprisingly, SI often offers us good abstractions. The above suggests that POR and SI can be very much complementary to each other. In this paper, we propose a general framework employing symbolic execution in the exploration of the state space, while both POR and SI are exploited for pruning. SI and POR are combined synergistically as the concept of interpolation. Interpolation is essentially a form of learning where the completed search of a safe subtree is then formulated as a recipe, ideally a succinct formula, for future pruning. The key distinction of our interpolation framework is that each recipe discovered by a node is forced to be conveyed back to its ancestors, which gives rise to pruning of larger subtrees. In summary, we address the challenge: “combining classic POR methods with symbolic technique has proven to be difficult” [14], especially in the context of software verification. More specifically, we propose an algorithm schema to combine synergistically POR with state interpolation so that the sum is more than its parts. However, we first need to formalize POR wrt. a symbolic search framework with abstraction in such a way that: (1) POR can be property driven and (2) POR, or more precisely, the concept of persistent set, can be applicable for a set of states (rather than an individual state). While the main contribution is a theoretical framework (for space reason, we present the proofs of the two theorems in the Appendix), we also indicate a potential for the development of advanced implementations. 2 Related Work Partial Order Reduction (POR) is a well-investigated technique in model checking of concurrent systems. Some notable early works are [20, 18, 9]. Later refinements of POR, Dynamic [8] and Cartesian [11] POR (DPOR and CPOR respectively) improve traditional POR techniques by detecting collisions on-the-fly. Recently, [1] 2 3 Whereas POR-related methods do not suffer from this. Here we assume that the input concurrent program has already been preprocessed (e.g., by static slicing to remove irrelevant transitions, or by static block encodings) to reduce the size of the transition system for each process. The number of global points is the product of the numbers of local program points in all processes. has proposed the novel of concept of source sets, optimizing the implementation for DPOR. These methods, in general, often achieve better reduction than traditional techniques, due to the more accurate detection of independent transitions. Traditional POR techniques [20, 18, 9] distinguish between liveness and safety properties. POR has also been extended for symbolic model checking [2]: a symbolic state can represent a number of concrete states. These methods, however, are not applicable to safety verification of modern concurrent programs (written in mainstream APIs such as POSIX). One important weakness of traditional POR is that it is not sensitive wrt. different target safety properties. In contrast, recent works have shown that property-aware reduction can be achieved by symbolic methods using a general-purpose SAT/SMT solver [24, 14, 22, 5]. Verification is often encoded as a formula which is satisfiable iff there exists an interleaving execution of the programs that violates the property. Reductions happen inside the SAT solver through the addition of learned clauses derived by conflict analysis [19]. This type of reduction is somewhat similar to what we call state interpolation. An important related work is [14], which is the first to consider enhancing POR with property driven pruning, via the use of an SMT solver. Subsequently, there was a follow-up work [22]. In [14], they began with an SMT encoding of the underlying transition system, and then they enhance this encoding with a concept of “monotonicity”. The effect of this is that traces can be grouped into equivalence classes, and in each class, all traces which are not monotonic will be considered as unsatisfiable by the SMT solver. The idea of course is that such traces are in fact redundant. This work has demonstrated some promising results as most concurrency bugs in real applications have been found to be shallow. We note that [14] incidentally enjoyed some (weak) form of SI pruning, due to the similarity between conflict clause learning and state interpolation. However, there the synergy between POR and SMT is unclear. We later demonstrate in Sec. 7 that such synergy in [14] is indeed relatively poor. There is a fundamental problem with scalability in [14], as mentioned in the follow-up work [22]: “It will not scale to the entire concurrent program” if we encode the whole search space as a single formula and submit it to an SMT solver. Let us first compare [14] with our work. Essentially, the difference is twofold. First, in this paper, the theory for partial order reduction is property driven. In contrast, the monotonicity reduction of [14] is not. In other words, though property driven pruning is observed in [14], it is contributed mainly by the conflict clauses learned, not from the monotonicity relation. We specifically exemplify the power of property driven POR in the later sections. Second, the encoding in [14] is processed by a black-box SMT solver. Thus important algorithmic refinements are not possible. Some examples: • There are different options in implementing SI. Specifically in this paper, we employ “precondition” computations. Using a black-box solver, one has to rely on its fixed interpolation methods. • Our approach is lazy in a sense that our solver is only required to consider one symbolic path at a time; in [14] it is not the case. This matters most when the program is unsafe and finding counter-examples is relatively easy (there are many traces which violate the safety property). • In having a symbolic execution framework, one can direct the search process. This is useful since the order in which state interpolants are generated does give rise to different reductions. Of course, such manipulation of the search process is hard, if not impossible, when using a black-box solver. In order to remedy the scalability issue of [14], the work [22] adapted it to the setting of program testing. In particular, [22] proposed a concurrent trace program (CTP) framework which employs both concrete execution and symbolic solving to strike a balance between efficiency and scalability of an SMT-based method. However, when the input program is safe, i.e., absence of bugs, [22] in general suffers from the same scalability issue as in [14]. We remark that, the new direction of [22], in avoiding the blow-up of the SMT solver, was in fact preceded by the work on under-approximation widening (UW) [10]. As with CTP, UW models a subset, which will be incrementally enlarged, of all the possible interleavings as an SMT formula and submits it to an SMT solver. In UW the scheduling decisions are also encoded as constraints, so that the unsatisfiable core returned by the solver can then be used to further the search in probably a useful direction. This is the major contribution of UW. However, an important point is that this furthering of the search is a repeated call to the solver, this time with a weaker formula; which means that the problem at hand is now larger, having more traces to consider. On this repeated call, the work done for the original call is thus duplicated. At first glance, it seems attractive and simple to encode the problem compactly as a set of constraints and delegate the search process to a general-purpose SMT solver. However, there are some fundamental disadvantages, and these arise mainly because it is hard to exploit the semantics of the program to direct the search inside the solver. This is in fact evidenced in the works mentioned above. We believe, however, the foremost disadvantage of using a general-purpose solver lies in the encoding of process interleavings. For instance, even when a concurrent program has only one feasible execution trace, the encoding formula being fed to the solver is still of enormous size and can easily choke up the solver. More importantly, different from safety verification of sequential programs, the encoding of interleavings (e.g., [14] uses the variable sel to model which process is selected for executing) often hampers the normal derivations of succinct conflict clauses by means of resolution in modern SMT solvers. We empirically demonstrate the inefficiency of such approach in Sec. 7. Another important related work is [21], developed independently4 by Wachter et al. [21] follows a similar direction as in this paper: combining POR with a standard state interpolation algorithm, which is often referred to as the IMPACT 4 Our work has been publicly available since 2012 in forms of a draft paper and a Ph.D. thesis. For anonymity reason, we omit the details here. algorithm [17]. Nevertheless, it is important to note that the framework presented in this paper subsumes [21]. While this paper proposes the novel concept of Property Driven POR before combining it with the state interpolation algorithm, [21] exploits directly the concept of “monotonicity” as in [14], thus their POR part does not give rise to property driven pruning. 3 Background We consider a concurrent system composed of a finite number of threads or processes performing atomic operations on shared variables. Let Pi (1 ≤ i ≤ n) be a process with the set transi of transitions. For simplicity, assume that transi contains no cycles. We also assume all processes have disjoint sets of transitions. Let T = ∪ni=1 transi be the set of all transitions. Let Vi be the set of local variables of process Pi , and Vshared the set of shared variables of the given concurrent program. Let pci ∈ Vi be a special variable representing the process program counter, and the tuple hpc1 , pc2 · · · , pcn i represent the global program point. Let SymStates be the set of all global symbolic states of the given program where s0 ∈ SymStates is the initial state. A state s ∈ SymStates comprises two parts: its global program point `, also denoted by pc(s), which is a tuple of local program counters, and its symbolic constraints JsK over the program variables. In other words, we denote a state s by hpc(s), JsKi. We consider the transitions of states induced by the program. Following [9], we only pay attention to visible transitions. A (visible) transition t{i} pertains to some process Pi . It transfers process Pi from control location `1 to `2 . In general, the application of t{i} is guarded by some condition cond (cond might be just true). At some state s ∈ SymStates, when the ith component of pc(s), namely pc(s)[i], equals `1 , we say that t{i} is schedulable 5 at s. And when s satisfies the guard cond, denoted by s |= cond, we say that t{i} is enabled at s. For each state s, let Schedulable(s) and Enabled(s) denote the set of transitions which respectively are schedulable at s and enabled at s. A state s, where Schedulable(s) = ∅, is called a terminal state. t Let s → s0 denote transition step from s to s0 via transition t. This step is possible only if t is schedulable at s. We assume that the effect of applying an enabled transition t on a state s to arrive at state s0 is well-understood. In our symbolic execution framework, executing a schedulable but not enabled transition results in an infeasible state. A state s is called infeasible if JsK is unsatisfiable. For technical reasons needed below, we shall allow schedulable transitions emanating from an infeasible state; it follows that the destination state must also be infeasible. For a sequence of transitions w (i.e., w ∈ T ∗ ), Rng(w) denotes the set of transitions that appear in w. Also let T` denote the set of all transitions which are schedulable somewhere after global program point `. We note here that the 5 This concept is not standard in traditional POR, we need it here since we are dealing with symbolic search. schedulability of a transition at some state s only depends on the program point component of s, namely pc(s). It does not depend on the constraint component of s, namely JsK. Given t1 , t2 ∈ T we say t1 can de-schedule t2 iff there exists a state s such that both t1 , t2 are schedulable at s but t2 is not schedulable after the execution of t1 from s. t ···t Following the above, s1 1=⇒m sm+1 denotes a sequence of state transitions, tm t2 t1 sm+1 ··· → s2 → and we say that sm+1 is reachable from s1 . We call s1 → a feasible derivation from state s1 , iff ∀ 1 ≤ i ≤ m • ti is enabled at si . As mentioned earlier, an infeasible derivation results in an infeasible state (an infeasible state is still aware of its global program point). An infeasible state satisfies any safety property. We define a complete execution trace, or simply trace, ρ as a sequence of ρ transitions such that it is a derivation from s0 and s0 =⇒ sf and sf is a terminal state. A trace is infeasible if it is an infeasible derivation from s0 . If a trace is infeasible, then at some point, it takes a transition which is schedulable but is not enabled. From thereon, the subsequent states are infeasible states. We say a given concurrent program is safe wrt. a safety property ψ if ∀s ∈ SymStates • if s is reachable from the initial state s0 then s |= ψ. A trace ρ is safe wrt. ψ, denoted as ρ |= ψ, if all its states satisfy ψ. Partial Order Reduction (POR) vs. State-based Interpolation (SI) We assume the readers are familiar with the traditional concept of POR. Regarding state-based interpolation, we follow the approach of [13, 17]. Here our symbolic execution is depicted as a tree rooted at the initial state s0 and for each state si therein, the descendants are just the states obtainable by extending si with a feasible transition. Definition 1 (Safe Root). Given a transition system and an initial state s0 , let s be a feasible state a reachable from s0 . We say s is a safe root wrt. a safety property ψ, denoted ψ (s), iff all states s0 reachable from s are safe wrt. ψ. Definition 2 (State Coverage). Given a transition system and an initial state s0 and si and sj are two symbolic states such that (1) si and sj are reachable from s0 and (2) si and sj share the same program a point `, we say a si covers sj wrt. a safety property ψ, denoted by si ψ sj , iff ψ (si ) implies ψ (sj ). The impact of state coverage relation is that if (1) si covers sj , and (2) the subtree rooted at si has been traversed and proved to be safe, then the traversal of subtree rooted at sj can be avoided. In other words, we gain performance by pruning the subtree at sj . Obviously, if si naturally subsumes sj , i.e., sj |= si , then state coverage is trivially achieved. In practice, however, this scenario does not happen often enough. Definition 3 (Sound Interpolant). Given a transition system and an initial state s0 , given a safety property ψ and program point `, we say a formula Ψ is a sound interpolant for `, denoted by SI(`, ψ), if for all states s ≡ h`, ·i reachable from s0 , s |= Ψ implies that s is a safe root. What we want now is to generate a formula Ψ (called interpolant), which still preserves the safety of all states reachable from si , but is weaker (more general) than the original formula associated to the state si . In other words, we should have si |= SI(`, ψ). We assume that this condition is always ensured by any implementation of state-based interpolation. The main purpose of using Ψ rather than the original formula associated to the symbolic state si is to increase the likelihood of subsumption. That is, the likelihood of having sj |= Ψ is expected to be much higher than the likelihood of having sj |= si . In fact, the perfect interpolant should be the weakest precondition [7] computed for program point ` wrt. the transition system and the safety property ψ. We denote this weakest precondition as wp(`, ψ). Any subsequent state sj ≡ h`, ·i which has sj stronger than this weakest precondition can be pruned. However, in general, the weakest precondition is too computationally demanding. An interpolant for the state si is indeed a formula which approximates the weakest precondition at program point ` wrt. the transition system, i.e., Ψ ≡ SI(`, ψ) ≡ Intp(si , wp(`, ψ)). A good interpolant is one which closely approximates the weakest precondition and can be computed efficiently. The symbolic execution of a program can be augmented by annotating each program point with its corresponding interpolants such that the interpolants represent the sufficient conditions to preserve the unreachability of any unsafe state. Then, the basic notion of pruning with state interpolant can be defined as follows. Definition 4 (Pruning with Interpolant). Given a symbolic state s ≡ h`, ·i such that ` is annotated with some interpolant Ψ , we say that s is pruned by the interpolant Ψ if s implies Ψ (i.e., s |= Ψ ). Now let us discuss the the effectiveness of POR and SI in pruning the search space with an example. For simplicity, we purposely make the example concrete, i.e., states are indeed concrete states. 1 (Closely coupled processes): See Fig. 1. Program points are shown in angle brackets. Fig. 1(a) shows the control flow graphs of two processes. Process 1 increments x twice whereas process 2 doubles x twice. The transitions associated with such actions and the safety property are depicted in the figure. POR requires a full search tree while Fig. 1(b) shows the search space explored by SI. Interpolants are in curly brackets. Bold circles denote pruned/subsumed states. {1} Let us first attempt this example using POR. It is clear that t1 is dependent {2} {1} {2} {2} {2} with both t1 and t2 . Also t2 is dependent with both t1 and t2 . Indeed, each of all the 6 execution traces in the search tree ends at a different concrete state. As classic POR methods use the concept of trace equivalence for pruning, no interleaving is avoided: those methods will enumerate the full search tree of 19 states (for space reasons, we omit it here). Revisit the example using SI, where we use the weakest preconditions [7] as the state interpolants: the interpolant for a state is computed as the weakest precondition to ensure that the state itself as well as all of its descendants are safe (see Fig. 1(b)). We in fact achieve the best case scenario with it: whenever we EXAMPLE {x ≤ 0} x=0 h0, 0i {1} Shared variables: x Initially: x = 0 {1} Process 2 Process 1 h0i h0i {1} t1 {2} :x=x∗2 {2} :x=x∗2 t1 :x++ h1i h1i {1} t2 :x++ t2 h2i h2i Safety: {2} t1 t1 {x ≤ 1} {x ≤ 2} x=0 x=1 h0, 1i h1, 0i ψ≡x≤8 (a) Two Closely Coupled Processes {2} {1} {2} t2 t1 t1 t2 {x ≤ 6} {x ≤ 2} {x ≤ 3} x=2 x=1 h0, 2i h1, 1i h2, 0i h1, 1i x=0 {2} x=2 {1} {2} {1} t1 t2 t2 t2 {x ≤ 4} x=3 h1, 2i x=4 h1, 2i h2, 1i x=4h2, 1i x=1 {x ≤ 7} {2} {1} t2 t2 x=8 h2, 2i {x ≤ 8} h2, 2i x=5 (b) Search Space by SI Fig. 1: Application of SI on 2 Closely Coupled Processes come to a program point which has been examined before, subsumption happens. The number of non-subsumed states is still of order O(k 2 ) (where k = 3 in this particular example), assuming that we generalize the number of local program points for each process to O(k). Fig. 1(b) shows 9 non-subsumed states and 4 subsumed states. In summary, the above example shows that SI might outperform POR when the component processes are closely coupled. However, one can easily devise an example where the component processes do not interfere with each other at all. Under such condition POR will require only one trace to prove safety, while SI is still (lower) bounded by the total number of global program points. In this paper, we contribute by proposing a framework to combine POR and SI synergistically. 4 Property Driven POR (PDPOR) “Combining classic POR methods with symbolic algorithms has been proven to be difficult” [14]. One fundamental reason is that the concepts of (Mazurkiewicz) equivalence and transition independence, which drive most practical POR implementations, rely on the equivalence of two concrete states. However, in symbolic traversal, we rarely encounter two equivalent symbolic states. We now make the following definition which is crucial for the concept of pruning and will be used throughout this paper. Definition 5 (Trace Coverage). Let ρ1 , ρ2 be two traces of a concurrent program. We say ρ1 covers ρ2 wrt. a safety property ψ, denoted as ρ1 wψ ρ2 , iff ρ1 |= ψ → ρ2 |= ψ. Instead of using the concept of trace equivalence, from now on, we only make use of the concept of trace coverage. The concept of trace coverage is definitely weaker than the concept of Mazurkiewicz equivalence. In fact, if ρ1 and ρ2 are (Mazurkiewicz) equivalent then ∀ψ • ρ1 wψ ρ2 ∧ ρ2 wψ ρ1 . Now we will define a new and weaker concept which therefore generalizes the concept of transition independence. Definition 6 (Semi-Commutative After A State). For a given concurrent θ program, a safety property ψ, and a derivation s0 =⇒ s, for all t1 , t2 ∈ T which cannot de-schedule each other, we say t1 semi-commutes with t2 after state s wrt. wψ , denoted by hs, t1 ↑ t2 , ψi, iff for all w1 , w2 ∈ T ∗ such that θw1 t1 t2 w2 and θw1 t2 t1 w2 are execution traces of the program, then we have θw1 t1 t2 w2 wψ θw1 t2 t1 w2 . From the definition, Rng(θ), Rng(w1 ), and Rng(w2 ) are pairwise disjoint. Importantly, if s is at program point `, we have Rng(w1 )∪Rng(w2 ) ⊆ T` \{t1 , t2 }. We observe that wrt. some ψ, if all important events, those have to do with the safety of the system, have already happened in the prefix θ, the “semicommutative” relation is trivially satisfied. On the other hand, the remaining transitions might still interfere with each other (but not the safety), and do not satisfy the independent relation. The concept of “semi-commutative” is obviously weaker than the concept of independence. If t1 and t2 are independent, it follows that ∀ψ ∀s•hs, t1 ↑ t2 , ψi∧ hs, t2 ↑ t1 , ψi. Also note that, in contrast to the relation of transition independence, the “semi-commutative” relation is not symmetric. We now introduce a new definition for persistent set. Definition 7 (Persistent Set Of A State). A set T ⊆ T of transitions schedulable in a state s ∈ SymStates is persistent in s wrt. a property ψ iff, tm−1 tm t1 t2 sm including only transitions for all derivations s → s1 → s2 . . . → sm−1 → ti ∈ T and ti 6∈ T, 1 ≤ i ≤ m, each transition in T semi-commutes with ti after s wrt. wψ . For each state, computing a Safety property ψ and current state s persistent set from the “semi- h1i T := ∅ commutative” relation is similar h2i Add an enabled transition t into T to computing the classical per- h3i foreach remaining schedulable transition ti if ¬(∀ tpj ∈ T • hs, tpj ↑ ti , ψi) sistent set under the transition h4i Add ti into T independence relation. The algo- h5i rithms for this task can be easily Fig. 2: Computing a Persistent Set of a State adapted from the algorithms presented in [9]. For convenience, we show one of such possibilities in Fig. 2. As in traditional algorithms, the quality (i.e. the size) of the returned persistent set is highly dependent on the first transitioned t to be added and the order in which the remaining transitions ti are considered. This is, however, not the topic of the current paper. With the new definition of persistent set, we now can proceed with the normal selective search as described in classic POR techniques. In the algorithm presented in Fig. 3, we perform depth first search (DFS), and only accommodate safety verification (invariant property ψ). Theorem 1. The selective search algorithm in Fig. 3 is sound6 . In preparing for POR and SI to work together, we now further modify the concept of persistent set so that it applies for a set of states sharing the same program point. We remark that the previous definitions apply only for a specific state. The key intuition is to attach a precondition φ to the program point of interest, indicating when semicommutativity happens. t u Safety property ψ and initial state s0 h1i Initially : Explore(s0 ) function Explore(s) h2i if s 6|= ψ Report Error and TERMINATE h3i T := Persistent Set(s) h4i foreach enabled transition t in T do t h5i s −→ s0 /* Execute t */ h6i Explore(s0 ) end function Fig. 3: New Selective Search Algorithm Definition 8 (Semi-Commutative After A Program Point). For a given concurrent program, a safety property ψ, and t1 , t2 ∈ T , we say t1 semi-commutes with t2 after program point ` wrt. wψ and φ, denoted as h`, φ, t1 ↑ t2 , ψi, iff for all state s ≡ h`, ·i reachable from the initial state s0 , if s |= φ then t1 semicommutes with t2 after state s wrt. wψ . Definition 9 (Persistent Set Of A Program Point). A set T ⊆ T of transitions schedulable at program point ` is persistent at ` under the interpolant Ψ wrt. a property ψ iff, for all state s ≡ h`, ·i reachable from the initial state s0 , t t tm−1 t 1 2 m s1 → if s |= Ψ then for all derivations s → s2 . . . → sm−1 → sm including only transitions ti ∈ T and ti 6∈ T, 1 ≤ i ≤ m, each transition in T semi-commutes with ti after state s wrt. wψ . Assume V that T = {tp1 , tp2 , · · · tpk }. The interpolant Ψ can now be computed as Ψ = φji for 1 ≤ j ≤ k, 1 ≤ i ≤ m such that h`, φji , tpj ↑ ti , ψi. For each program point, it is possible to have different persistent sets associated with different interpolants. In general, a state which satisfies a stronger interpolant will have a smaller persistent set, therefore, it enjoys more pruning. 5 Synergy of PDPOR and SI We now show our combined framework. We assume for each program point, a persistent set and its associated interpolant are computed statically, i.e., by separate analyses. In other words, when we are at a program point, we can right away make use of the information about its persistent set. The algorithm is in Fig. 4. The function Explore has input s and assumes the safety property at hand is ψ. It naturally performs a depth first search of the state space. 6 Proof outline is in the Appendix. Two Base Cases: The function Explore handles two base cases. Assume safety property ψ and initial state s0 h1i Initially : Explore(s0 ) One is when the current state function Explore(s) is subsumed by some computed Let s be h`, ·i (and memoed) interpolant Ψ . No h2i if (memoed(s, Ψ )) return Ψ further exploration is needed, and h3i if (s 6|= ψ) Report Error and TERMINATE Ψ is returned as the interpolant h4i Ψ := ψ h5i hT, Ψ trace i := Persistent Set(`) (line 2). The second base case is h6i if (s |= Ψ trace ) when the current state is found to h7i Ts := T be unsafe (line 3). h8i Ψ := Ψ ∧ Ψ trace Combining Interpolants: We h9i else Ts := Schedulable(s) make use of the (static) persistent h10i foreach t in (Ts \ Enabled(s)) do set T computed for the current h11i Ψ := Ψ ∧ pre(t, false) program point. We comment fur- h12i foreach t in (Ts ∩ Enabled(s)) do t ther on this in the next section. /* Execute t */ h13i s −→ s0 0 The set of transitions to be h14i Ψ := Explore(s0 ) 0 considered is denoted by Ts. h15i Ψ := Ψ ∧ pre(t, Ψ ) When the current state implies h16i memo and return (Ψ ) the interpolant Ψ trace associated end function with T , we need to consider only Fig. 4: A Framework for POR and SI (DFS) those transitions in T . Otherwise, we need to consider all the schedulable transitions. Note that when the persistent set T is employed, the interpolant Ψ trace must contribute to the combined interpolant of the current state (line 8). Disabled transitions at the current state will strengthen the interpolant as in line 11. Finally, we recursively follow those transitions which are enabled at the current state. The interpolant of each child state contributes to the interpolant of the current state as in line 15. In our framework, interpolants are propagated back using the precondition operation pre, where pre(t, φ) denotes a safe approximation of the weakest precondition wrt. the transition t and the postcondition φ [7]. Theorem 2. The algorithm in Fig. 4 is sound7 . 6 t u Implementation of PDPOR We now elaborate on the remaining task: how to estimate the semi-commutative relation, thus deriving the (static) persistent set at a program point. Similar to the formalism of traditional POR, our formalism is of paramount importance for the semantic use as well as to construct the formal proof of correctness (see the Appendix). In practice, however, we have to come up with sufficient conditions to efficiently implement the concepts. In this paper, we estimate the semi-commutative relation in two steps: 1. We first employ any traditional POR method and first estimate the “semicommutative” relation as the traditional independence relation (then the 7 Proof outline is in the Appendix. corresponding condition φ is just true). This is possible because the proposed concepts are strictly weaker than the corresponding concepts used in traditional POR methods. 2. We then identify and exploit a number of patterns under which we can statically derive and prove the semi-commutative relation between transitions. In fact, these simple patterns suffice to deal with a number of important real-life applications. In the rest of this section, we outline three common classes of problems, from which the semi-commutative relation between transitions can be easily identified and proved, i.e., our step 2 becomes applicable. Resource Usage of Concurrent Programs: Programs make use of limited resource (such as time, memory, bandwidth). Validation of resource usage in sequential setting is already a hard problem. It is obviously more challenging in the setting of concurrent programs due to process interleavings. Here we model this class of problems by using a resource variable r. Initially, r is zero. Each process can increment or decrement variable r by some concrete value (e.g., memory allocation or deallocation respectively). A process can also double the value r (e.g., the whole memory is duplicated). However, the resource variable r cannot be used in the guard condition of any transition, i.e., we cannot model the behavior of a typical garbage collector. The property to be verified is that, “at all times, r is (upper-) bounded by some constant”. Proposition 1. Let r be a resource variable of a concurrent program, and assume the safety property at hand is ψ ≡ r ≤ C, where C is a constant. For all transitions (assignment operations only) t1 : r = r+c1 , t2 : r = r∗2, t3 : r = r−c2 where c1 , c2 > 0, we have for all program points `: h`, true, t1 ↑ t2 , ψi ∧ h`, true, t1 ↑ t3 , ψi ∧ h`, true, t2 ↑ t3 , ψi t u Informally, other than common mathematical facts such as additions can commute and so do multiplications and subtractions, we also deduce that additions can semi-commute with both multiplications and subtractions while multiplications can semi-commute with subtractions. This Proposition can be proved by using basic laws of algebra. 2 : Let us refer back to the example of two closely coupled processes introduced in Sec. 3, but now under the assumption that x is the resource variable of interest. Using the semi-commutative relation derived from Proposition 1, we need to explore only one complete trace to prove this safety. We recall that, in contrast, POR (and DPOR)-only methods will enumerate the full execution tree which contains 19 states and 6 complete execution traces. Any technique which employs only the notion of Mazurkiewicz trace equivalence for pruning will have to consider all 6 complete traces (due to 6 different terminal states). SI alone can reduce the search space in this example, and requires to explore only 9 states and 4 subsumed states (as in Sec. 3). Detection of Race Conditions: [23] proposed a property driven pruning algorithm to detect race conditions in multithreaded programs. This work has achieved more reduction in comparison with DPOR. The key observation is that, EXAMPLE at a certain location (program point) `, if their conservative “lockset analysis” shows that a search subspace is race-free, the subspace can be pruned away. As we know, DPOR relies solely on the independence relation to prune redundant interleavings (if t1 , t2 are independent, there is no need to flip their execution order). In [23], however, even when t1 , t2 are dependent, we may skip the corresponding search space if flipping the order of t1 , t2 does not affect the reachability of any race condition. In other words, [23] is indeed a (conservative) realization of our PDPOR, specifically targeted for detection of race conditions. Their mechanism to capture the such scenarios is by introducing a trace-based lockset analysis. Ensuring Optimistic Concurrency: In the implementations of many concurrent protocols, optimistic concurrency, i.e., at least one process commits, is usually desirable. This can be modeled by introducing a flag variable which will be set when some process commits. The flag variable once set can not be unset. It is then easy to see that for all program point ` and transitions t1 , t2 , we have h`, flag = 1, t1 ↑ t2 , ψi. Though simple, this observation will bring us more reduction compared to traditional POR methods. 7 Experiments This section conveys two key messages. First, when trace-based and state-based methods are not effective individually, our combined framework still offers significant reduction. Second, property driven POR can be very effective, and applicable not only to academic programs, but also to programs used as benchmarks in the state-of-the-art. We use a 3.2 GHz Intel processor and 2GB memory running Linux. Timeout is set at 10 minutes. In the tables, cells with ‘-’ indicate timeout. We compare the performance of Partial Order Reduction alone (POR), State Interpolation alone (SI), the synergy of Partial Order Reduction and State Interpolation (POR+SI), i.e., the semi-commutative relation is estimated using only step 1 presented in Sec. 6, and when applicable, the synergy of Property Driven Partial Order Reduction and State Interpolation (PDPOR+SI), i.e., the semi-commutative relation is estimated using both steps presented in Sec. 6. For the POR component, we use the implementation from [3]. Table 1 starts with parameterized versions of the producer/consumer example because its basic structure is extremely common. There are 2 ∗ N producers and 1 consumer. Each producer will do its own non-interfered computation first, modeled by a transition which does not interfere with other processes. Then these producers will modify the shared variable x as follows: each of the first N producers increments x, while the other N producers double the value of x. On the other hand, the consumer consumes the value of x. The safety property is that the consumed value is no more than N ∗ 2N . Table 1 clearly demonstrates the synergy benefits of POR and SI. POR+SI significantly outperforms both POR and SI. Note that this example can easily be translated to the resource usage problem, where our PDPOR requires only a single trace (and less than 0.01 second) in order to prove safety. We next use the parameTable 1: Synergy of POR and SI terized version of the dining POR SI POR+SI philosophers. We chose this Problem States T(s) States T(s) States T(s) for two reasons. First, this is p/c-2 449 0.03 514 0.17 85 0.03 p/c-3 18745 2.73 6562 2.43 455 0.19 a classic example often used p/c-4 986418 586.00 76546 37.53 2313 1.07 in concurrent algorithm dep/c-5 − − − − 11275 5.76 sign to illustrate synchrop/c-6 − − − − 53261 34.50 nization issues and techp/c-7 − − − − 245775 315.42 niques for resolving them. din-2a 22 0.01 21 0.01 21 0.01 Second, previous work [14] din-3a 646 0.05 153 0.03 125 0.02 647 0.09 has used this to demon- din-4a 155037 19.48 1001 0.17 − − 6113 1.01 4313 0.54 strate benefits from combin- din-5a din-6a − − 35713 22.54 24201 4.16 ing POR and SMT. din-7a − − 202369 215.63 133161 59.69 The first safety property bak-2 48 0.03 38 0.03 31 0.02 used in [14], “it is not that bak-3 1003 1.85 264 0.42 227 0.35 all philosophers can eat sibak-4 27582 145.78 1924 5.88 1678 4.95 multaneously”, is somewhat bak-5 − − 14235 73.69 12722 63.60 trivial. Therefore, here we verify a tight property, which is (a): “no more than half the philosophers can eat simultaneously”. To demonstrate the power of symbolic execution, we verify this property without knowing the initial configurations of all the forks. Table 1, again, demonstrates the significant improvements of POR+SI over POR alone and SI alone. We note that the performance of our POR+SI algorithm is about 3 times faster than [14]. We additionally considered a second safety property as in [14], namely (b): “it is possible to reach a state in which all philosophers have eaten at least once”. Our symbolic execution framework requires only a single trace (and less than 0.01 second) to prove this property in all instances, whereas [14] requires even more time compared to proving property (a). This illustrates the scalability issue of [14], which is representative for other techniques employing general-purpose SMT solver for symbolic pruning. We also perform experiments on the “Bakery” algorithm. Due to existence of infinite domain variables, model checking hardly can handle this case. Here we remark that in symbolic methods, loop handling is often considered as an orthogonal issue. Programs with statically bounded loops can be easily unrolled into equivalent loop-free programs. For unbounded loops, either loop invariants are provided or the employment of some invariant discovery routines, e.g., [12], is necessary. In order for our algorithm to work here, we make use of the standard loop invariant for this example. To further demonstrate the power our synergy framework over [14]8 as well as the power of our property driven POR, we experiment next on the Sumof-ids program. Here, each process (of N processes) has one unique id and will 8 [14] is not publicly available. Therefore, it is not possible for us to make more comprehensive comparisons. increment a shared variable sum by this id. We prove that in the end this variable will be incremented by the sum of all the ids. See Table 2, where we exTable 2: Comparison with [14] periment with Z3 [6] (ver[14] w. Z3 POR+SI PDPOR+SI sion 4.1.2) using the encodT(s) #C #D T(s) States T(s) States T(s) ings presented in [14]. #C desum-6 1608 1795 0.08 193 0.05 7 0.01 notes the number of conflicts sum-8 54512 59267 10.88 1025 0.27 9 0.01 − − − 5121 1.52 11 0.01 while #D denotes the num- sum-10 − − − 24577 8.80 13 0.01 ber of decisions made by Z3. sum-12 sum-14 − − − 114689 67.7 15 0.01 We can see that our synergy framework scale much better than [14] with Z3. Also, this example can also be translated to resource usage problem, our use of property-driven POR again requires one single trace to prove safety. Finally, to benchmark our Table 3: Experiments on [5]’s Programs framework with SMT-based meth[5] SI PDPOR+SI ods, we select four safe proProblem C T(s) States T(s) States T(s) grams from [5] where the exper- micro 2 17 1095 20201 10.88 201 0.04 imented methods did not perform stack 12 225 529 0.26 529 0.26 29 0.03 29 0.03 well. Those programs are micro 2, circular buffer ∞ 477 10 95 1681 1.13 41 0.01 stack, circular buffer, and state- stateful20 ful20. We note that safe programs allow fairer comparison between different approaches since to verify them we have to cover the whole search space. Table 3 shows the running time of SI alone and of the combined framework. For convenience, we also tabulate the best running time reported in [5] and C is the context switch bound used. We assume no context switch bound, hence the corresponding value in our framework is ∞. We can see that even our SI alone significantly outperforms the techniques in [5]. We believe it is due to the inefficient encoding of process interleavings (mentioned in Sec. 2) as well as the following reasons. First, our method is lazy, which means that only a path is considered at a time: [5] itself demonstrates partially the usefulness of this. Second, but importantly, we are eager in discovering infeasible paths. The program circular buffer, which has only one feasible complete execution trace, can be efficiently handled by our framework, but not SMT. This is one important advantage of our symbolic execution framework over SMT-based methods, as discussed in [17]. It is important to note that, PDPOR significantly improves the performance of SI wrt. programs micro 2 and stateful20. This further demonstrates the applicability of our proposed framework. 8 Conclusion We present a concurrent verification framework which synergistically combines trace-based reduction techniques with the recently established notion of state interpolant. One key contribution is the new concept of property-driven POR which serves to reduce more interleavings than previously possible. We believe that fully automated techniques to compute the semi-commutative relations for specific, but important, application domains will be interesting future work. References 1. P. Abdulla, S. Aronis, B. Jonsson, and K. Sagonas. Optimal dynamic partial order reduction. In POPL, 2014. 2. R. Alur, R. K. Brayton, T. A. Henzinger, S. Qadeer, and S. K. Rajamani. Partialorder reduction in symbolic state space exploration. In CAV, 1997. 3. P. Bokor, J. Kinder, M. Serafini, and N. Suri. Supporting domain-specific state space reductions through local partial-order reduction. In ASE, 2011. 4. C. Cadar, P. Godefroid, S. Khurshid, C. S. Păsăreanu, K. Sen, N. Tillmann, and W. Visser. Symbolic execution for software testing in practice: preliminary assessment. In ICSE, 2011. 5. L. Cordeiro and B. Fischer. Verifying multi-threaded software using smt-based context-bounded model checking. In ICSE, 2011. 6. L. De Moura and N. Bjørner. Z3: an efficient smt solver. In TACAS, 2008. 7. E. W. Dijkstra. Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM, 1975. 8. C. Flanagan and P. Godefroid. Dynamic partial-order reduction for model checking software. In POPL, 2005. 9. P. Godefroid. Partial-Order Methods for the Verification of Concurrent Systems: An Approach to the State-Explosion Problem. Springer-Verlag New York, Inc., 1996. 10. O. Grumberg, F. Lerda, O. Strichman, and M. Theobald. Proof-guided underapproximation-widening for multi-process systems. In POPL, 2005. 11. G. Gueta, C. Flanagan, E. Yahav, and M. Sagiv. Cartesian partial-order reduction. In SPIN, 2007. 12. J. Jaffar, J.A. Navas, and A. Santosa. Unbounded Symbolic Execution for Program Verification. In RV, 2011. 13. J. Jaffar, A. E. Santosa, and R. Voicu. An interpolation method for clp traversal. In CP, 2009. 14. V. Kahlon, C. Wang, and A. Gupta. Monotonic partial order reduction: An optimal symbolic partial order reduction technique. In CAV, 2009. 15. J. C. King. Symbolic Execution and Program Testing. Com. ACM, 1976. 16. A. W. Mazurkiewicz. Trace theory. In Advances in Petri Nets, 1986. 17. K. L. McMillan. Lazy annotation for program testing and verification. In CAV, 2010. 18. D. Peled. All from one, one for all: on model checking using representatives. In CAV, 1993. 19. J. P. M. Silva and K. A. Sakallah. Grasp-a new search algorithm for satisfiability. In ICCAD, 1996. 20. A. Valmari. Stubborn sets for reduced state space generation. In Applications and Theory of Petri Nets, 1989. 21. B. Wachter, D. Kroening, and J. Ouaknine. Verifying multi-threaded software with impact. In FMCAD, 2013. 22. C. Wang, S. Chaudhuri, A. Gupta, and Y. Yang. Symbolic pruning of concurrent program executions. In ESEC/FSE, 2009. 23. C. Wang, Y. Yang, A. Gupta, and G. Gopalakrishnan. Dynamic model checking with property driven pruning to detect race conditions. In ATVA, 2008. 24. C. Wang, Z. Yang, V. Kahlon, and A. Gupta. Peephole partial order reduction. In TACAS, 2008. 25. Y. Yang, X. Chen, G. Gopalakrishnan, and R. M. Kirby. Efficient stateful dynamic partial order reduction. In SPIN, 2008. Appendix: Proofs of the Two Theorems Theorem 1. The selective search algorithm in Fig. 3 is sound. Proof (Outline). Assume that there exist some traces which violate the property ψ and are not examined by our selective search. Let denote the set of such traces tm t2 t1 sm , ρ ∈ Wviolated , let s2 · · · → s1 → as Wviolated . For each trace ρ = s0 → f irst(ρ) denote the smallest index i such that ti is not in the persistent set tm t2 t1 sm s2 · · · → s1 → of si−1 . Without loss of generality, assume ρmax = s0 → having the maximum f irst(ρ). Let i = f irst(ρmax ) < m. As the “commuter” and “commutee” cannot “de-schedule” each other, in the set {ti+1 · · · tm } there must be a transition which belongs to the persistent set of si−1 (otherwise, the must exist some transition that belongs to the persistent set of si−1 which is schedulable at sm . Therefore sm is not a terminal state). Let j be the smallest index such that tj belongs to the persistent set of si−1 . By definition, wrt. wψ and after si−1 , tj semi-commutes with ti , ti+1 , · · · tj−1 . Also due to the definition of the “semi-commutative” relation we deduce that all the following traces (by making tj repeatedly commute backward): ρ01 = t1 t2 · · · ti−1 ti ti+1 · · · tj tj−1 tj+1 · · · tm .. . ρ0j−i−1 = t1 t2 · · · ti−1 ti tj ti+1 · · · tj−1 tj+1 · · · tm ρ0j−i = t1 t2 · · · ti−1 tj ti ti+1 · · · tj−1 tj+1 · · · tm must violate the property ψ too. However, f irst(ρ0j−i ) > f irst(ρmax ). This contradicts the definition of ρmax . t u s0 θ2 θ1 Subsumed si t1 t2 t3 sj t1 si+1 sj+1 B A t2 t3 B’ A’ Fig. 5: Inductive Correctness Theorem 2. The synergy algorithm in Fig. 4 is sound. Proof (Outline). We use structural induction. Refer to Fig. 5. Assume that from s0 we reach state si ≡ h`, ·i. W.l.o.g., assume that at si there are three transitions which are schedulable, namely t1 , t2 , t3 , of which only t1 and t2 are enabled. Also assume that under the interpolant Ψ 2 , the persistent set of `, and therefore of si , is just {t1 }. From the algorithm, we will extend si with t1 (line 13) and attempt to verify the subtree A (line 14). Our induction hypothesis is that we have finished considering A, and indeed, it is safe under the interpolant Ψ A . That subtree will contribute Ψ 1 = pre(t1 , Ψ A ) (line 15) to the interpolant of si . Using the interpolant Ψ 2 , the branch having transition t2 followed by the subtree B is pruned and that is safe, due to Theorem 1. Also, the disabled transition t3 contributes Ψ 3 (line 11) to the interpolant of si . Now we need to prove that Ψ = Ψ 1 ∧ Ψ 2 ∧ Ψ 3 is indeed a sound interpolant for program point `. Assume that subsequently in the search, we reach some state sj ≡ h`, ·i. We will prove that Ψ is a sound interpolant of ` by proving that if sj |= Ψ , then the pruning of sj is safe. First, sj |= Ψ implies that sj |= Ψ 3 . Therefore, at sj , t3 is also disabled. t1 sj+1 (if not the pruning Second, assume that t1 is enabled at sj and sj −→ 0 of t1 followed by A is definitely safe). Similarly, sj |= Ψ implies that sj |= Ψ 1 . Consequently, sj+1 |= Ψ A and therefore the subtree A0 is safe too. Lastly, sj |= Ψ implies that sj |= Ψ 2 . Thus the reasons which ensure that the traces ending with subtree A cover the traces ending with subtree B also hold at sj . That is, the traces ending with subtree A0 also cover the traces ending with subtree B 0 . t u
6cs.PL
Numerical Model For Vibration Damping Resulting From the First Order Phase Transformations arXiv:cs/0702172v1 [cs.CE] 28 Feb 2007 L. X. Wang 1 ∗ and Roderick V.N. Melnik 1 MCI, Faculty of Science and Engineering, University of Southern Denmark, 2 2 Sonderborg, DK-6400, Denmark Mathematical Modelling and Computational Sciences, Wilfrid Laurier University, 75 University Avenue West, Waterloo, ON, Canada, N2L 3C5 Abstract A numerical model is constructed for modelling macroscale damping effects induced by the first order martensite phase transformations in a shape memory alloy rod. The model is constructed on the basis of the modified Landau-Ginzburg theory that couples nonlinear mechanical and thermal fields. The free energy function for the model is constructed as a double well function at low temperature, such that the external energy can be absorbed during the phase transformation and converted into thermal form. The Chebyshev spectral methods are employed together with backward differentiation for the numerical analysis of the problem. Computational experiments performed for different vibration energies demonstrate the importance of taking into account damping effects induced by phase transformations. Key words: Martensite transformation, thermo-mechanical coupling, vibration damping, Ginzburg-Landau theory. 1 Introduction Shape Memory Alloy (SMA) materials are able to directly transduce thermal energy into mechanical and vice versa. Their unique properties make them very attractive in many ∗ Corresponding Address:Tel.:+45 6550 1686, Fax:+45 6550 1660, E-mail:[email protected] 1 engineering applications, including mechanical and control engineering, biomedicine, communication, robotics and so on [1]. Among these applications, dampers made from SMA for passive and semi-active vibration damping, are quoted perhaps most frequently [2]. These devices exhibit fairly complicated nonlinear (hysteretic) behaviour induced by martensite phase transformations. An appropriate mathematical model involving phase transformations and thermo-mechanical coupling is essential for a better understanding of the dynamic behavior of SMA dampers. The damping effects of SMA cannot be understood without incorporating into the model the dynamics of the first order martensite transformations induced by mechanical loadings, and hysteresis as a consequence. SMAs have more than one martensite variants at low temperature that correspond to the same elastic potential energy of the material stored via deformation. When the martensite phase transformation is induced mechanically, part of the external energy will be consumed to transform the material from one variant to another, without increasing the total elastic energy stored in the material, but the deformation will be oriented in a way favored by the external loadings. The work done by the external loadings during the phase transformation process cannot be restored reversely when the loading is removed, since it is converted into thermal form, and will be dissipated eventually via, for example, thermal dissipation. This dissipation of mechanical energy due to phase transformation can be measured by the hysteretic behaviour of the material under mechanical loadings [3, 4]. Because of the nonlinear nature of phase transformations and the nonlinear coupling between the mechanical and thermal fields, the dynamic behavior of SMA dampers becomes very complex. Some investigations have been already carried out to understand the damping effects of SMA at either micro-scale or macro-scale [4, 5, 6]. Among many efforts, it was shown in Ref. [4, 7] ( and references therein) that the damping effects of SMA are influenced by the vibration frequency, heating/cooling rate (temperature change rate), and vibration amplitude . This influence is discussed and analyzed in terms of strain formation, interface moving, internal friction, and other factors, which are all considered either at micro-scale or mesoscale. For most current engineering applications of SMA dampers, damping effects due to hysteresis is more pronounced at macroscale, and one needs to model the dynamical behaviour and damping effects of SMAs at macroscale, which demands that the model should have the capability to capture all the contributions to vibration damping, particularly that due to hysteresis induced by cyclic mechanical loadings [3, 7]. Since vibration damping can be induced by hysteretic behaviour of the SMAs, interface moving, internal friction, and thermo-mechanical coupling, the model for damping devices made from SMA has to be constructed on the basis of dynamics of the materials, which involves the phase 2 transformation and thermo-mechanical coupling. Progressively, the impact induced phase transformation in SMA wires were investigated in [6, 7] where the constitutive laws were approximated linearly, and the thermo-mechanical coupling was neglected. Such models have obvious limitations. In what follows, we attempt to overcome such limitations by better capturing the thermo-mechanical coupling, hysteresis, and nonlinear nature of phase transformations with the Ginzburg-Landau theory, originally discussed in the context of SMAs in [8, 9] and later applied to model the dynamical behavior of SMA rods under dynamical loadings (e.g., [10, 11, 12] and references therein). In particular, in this paper we employ a mathematical model based on the modified Ginzburg - Landau theory for the SMA damper, the dynamics of the SMA damper are described by Navier’s equation with a non-convex constitutive relation. The damper is connected with a mass block with a given initial velocity. The movement of the mass block is then simulated as a single degree of freedom system, subject to the damping force from the SMA rod. 2 Mathematical Modelling The physical problem investigated here is sketched in Figure (1). There is a mass block connected to a SMA rod. The SMA rod has a cross section area of β and length L, and is initially at rest. The block has an initial velocity vm . The purpose of the current investigation is to show the damping effect of the SMA rod on the vibration of the mass block. In the current damping system, the mass block is a lumped sub-system, while the SMA rod is a distributed sub-system. Here, we construct the model describing their movements separately and then couple them together. For the mass block, the model can be easily formulated using the momentum conservation law as: mẍm + µm ẋm + km (xm − L) = fm , (1) where xm is the position of the block, µm the friction coefficient, km the spring stiffness, m the mass of the block, and fm is the external force on the mass block which is caused by the SMA rod discussed below. The mathematical model for the dynamics of the SMA rod can be constructed on the basis of the modified Ginzburg - Landau theory, as done in ([8, 9, 10, 12, 14] and references therein). For the convenience of discussion about damping and energy absorbing here, the model is constructed using the extended Hamilton’s principle, but using the same non-convex potential energy. 3 In order to formulate the governing equation for the mechanical field, the Lagrangean L is introduced for material particles as follows: ρ (2) L = (u̇)2 − F , 2 where ρ is the density of the material and F is the potential energy function of the material. The differntiating feature of the Ginzburg - Landau theory is that the potential energy function is constructed as a non-convex function of the chosen order parameters and temperature θ. It is a sum of local energy density (Fl ) and non-local energy density is chosen as the (Fg ). For the current one-dimensional problem, the strain ε(x, t) = ∂u ∂x order parameter, and the local free energy function can be constructed as the Landau free energy function Fl (θ, ε) [8, 9, 10, 11, 16]: k1 (θ − θ1 ) 2 k2 4 k3 6 ε + ε + ε, (3) 2 4 6 where k1 , k2 , and k3 are material-specific constants, θ1 is the reference transformation temperature. The non-local free energy function is usually constructed in a way similar to the class of ferroelastic materials as follows [10, 11]: Fl (θ, ε) = ∂ε 1 (4) Fg (∇ε) = kg ( )2 , 2 ∂x where kg is a material-specific constant. The non-local term above accounts for inhomogeneous strain field. It represents energy contributions from domain walls of different phases (hence, an analogy with the Ginzburg term in semiconductors). In order to account for dissipation effects accompanying phase transformations, a Rayleigh dissipation term is introduced here as follows [13]: 1 ∂ε (5) FR = − ν( )2 , 2 ∂t where ν is a material-specific constant. The above dissipation term accounts for the internal friction. At macroscale, it is translated into the viscous effects [18]. By substituting the potential energy function into the Lagrangian function given in Equation (2), and using the extended Hamilton’s principle, the governing equation for the dynamics of the mechanical field can be obtained as follows:  3  5 ! ∂u ∂ ∂2u ∂4u ∂u ∂u ∂ k1 (θ − θ1 ) +ν + k2 − k . (6) + k3 ρü = g ∂x ∂x ∂x ∂x ∂t ∂x2 ∂x4 In order to formulate the governing equation for the thermal field, the conservation law of the internal energy is employed here: ρ ∂e ∂q ∂ε ∂ε ∂ε ∂2ε + −σ −ν − kg = 0, ∂t ∂x ∂t ∂t ∂t ∂x∂t 4 (7) where e is the internal energy, q = −k∂θ/∂x is the (Fourier) heat flux, k is the heat conductance coefficient of the material, and σ is the stress. In order to capture the coupling between the mechanical and thermal fields, the internal energy is associated with the non-convex potential energy mentioned above via the Helmholtz free energy function as follows [8, 9, 10]: H(θ, ε) = F − cv θ ln θ (8) and the thermodynamical equilibrium condition gives: e=H−θ ∂H , ∂θ σ= ∂H , ∂ε (9) where cv is the specific heat capacitance. By substituting the above relationships into Equation (7), the governing equation for the thermal field can be formulated as: ∂θ ∂2θ ∂ε cv = k 2 + k1 θε + ν ∂t ∂x ∂t  ∂ε ∂t 2 . (10) It is shown clearly from the above derivation that the governing equations for both the mechanical and thermal fields are constructed using the same potential function Fl (θ, ε) + Fg (∇ε), which is taken here as the Ginzburg-Landau free energy function. It has been shown in Ref.([13, 14, 15]) that the mathematical model such as the one based Equation (6) and (10) is capable to capture the first order phase transformations in ferroelastic materials, and the thermo-mechanical coupling, by suitably choosing the coefficients according experiment results [10, 11, 15], as shown in section 3. The thermo-mechanical coupling is also shown by the term k1 (θ − θ1 )ε, which accounts for the influence of the 2 + ν ∂ε account thermal field on the mechanical one, and the other two terms k1 θε ∂ε ∂t ∂t for the conversion of mechanical energy into thermal form. Due to strong nonlinearity in the mechanical field and nonlinear coupling between the mechanical and thermal fields, numerical simulations based on this model is far from trivial [9, 10]. For the sake of convenience of numerical analysis discussed later on, the model is recast into a differential-algebraic system in a way similar to [9, 14]: ∂σ ∂4u ∂2u = − k + F, g ∂t2 ∂x ∂x4  2 ∂2θ ∂ε ∂ε ∂θ = k 2 + k1 θε + ν + G, cv ∂t ∂x ∂t ∂t ∂ε σ ∗ = k1 (θ − θ1 )ε − k2 ε3 + k3 ε5 + ν . ∂t ρ (11) where u is the displacement, θ is the temperature, ρ is the density, k1 , k2 , k3 , cv , kg , ν and k are normalized material-specific constants, σ ∗ is the effective stress incorporating the 5 viscous effects, and F and G are distributed mechanical and thermal loadings, which are all zero for the current problem. To couple the mathematical model for the SMA rod and that of the block, boundary conditions for Equation (11) should be associated with the movement of the mass block, which can be formulated as follows: ∂θ = 0, u = 0, at x = 0, ∂x (12) ∂θ fm = 0, σ(L) = , at x = L. ∂x β It is worthy to note that the above boundary conditions are not sufficient for the system to have a unique solution. Indeed, when the nonlinear constitutive law is used, as given in the last line of Equation (11), the relationship between σ and ε is no longer a one to one map. For a given stress value, one might be able to find three possible strain values which all satisfy the constitutive law. Therefore, an additional boundary condition on u or ε is necessary to guarantee uniqueness. Here we employ the idea given in Ref. [10] and set the additional boundary condition as ∂ε/∂x = 0. It is shown in Ref.([15, 18]) that, provided with such boundary conditions, the model has an unique solution and can be numerically analyzed. The geometrical coupling can be written as xm = L + u(L), so the velocity of the mass block can be written as vm = ẋm = u̇(L). By putting the two mathematical models, Equation (1) and Equation (11), and their coupling conditions together, our mathematical model can be formulated finally as: ∂σ ∂4u ∂2u = − k , g ∂t2 ∂x ∂x4  2 ∂2θ ∂ε ∂ε ∂θ = k 2 + k1 θε + ν cv , ∂t ∂x ∂t ∂t ∂ε σ ∗ = k1 (θ − θ1 )ε − k2 ε3 + k3 ε5 + ν , ∂t ∂ε ∂θ = 0, u = 0, = 0, at x = 0, ∂x ∂x 1 ∂θ = 0, σ = (mü(L) + µm u̇(L) + km u(L)), ∂x β ρ (13) ∂ε = 0, ∂x at x = L. The above model incorporates the phase transformation, thermo-mechanical coupling, viscous effects, and interfacial contributions, it is natural to expect that the model is able to model the vibration damping effects due to these contributions. 3 Vibration Damping Due to Phase Transformation As mentioned earlier, damping effects in SMA rod can be attributed to several factors. The internal friction (viscous effect) contributes to the damping effects when phase trans6 formation is taking place. Since the occurence of thermo-mechanical coupling, the SMA materials also have damping effects due to the energy conversion between thermal and mechanical fields. The most pronouncing contribution to the damping effects in the SMA rod is the mechanical hysteresis due to phase transformation between martensite variants. Unlike other contributions to the damping effects, the contribution due to hysteresis can be graphically explained using the non-convex potential energy function and the nonconvex constitutive relation. In the heart of the Ginzburg-Landau theory for the first order phase transformation in SMA, lies the free energy function defined as a non-convex function of the chosen order parameter for characterization of all the phases and variants (e.g., [10, 8, 12, 16]), which is defined as Equation (3). One example of the Landau free energy function is shown in Figure (2), for which the material and its physical parameters are given in section 5. It is shown clearly in the figure that the function has only one local minimum at high temperature (θ = 280K), which is associated with the only stable phase (austenite) in this case. At lower temperature (θ = 210K), there are two symmetrical local minima (marked with small gray rectangles), which are associated with martensite plus (P) and minus (M), respectively. For vibration damping purpose, it is always beneficial to make the SMA work at low temperature, so the hysteresis loop will be larger. The hysteretic behaviour and mechanical energy dissipation of the SMA rod at low temperature can be explained using its nonlinear constitutive relation as shown in Figure (3), which is obtained using the thermodynamical equilibrium condition [10]: σ= ∂F ∂ε (14) For a given external loading, it will induce an internal stress and deformation in the SMA rod, part of the work done by the loading is stored in the rod via its deformation and can be calculated as: Z εe (−σε)dε, (15) W = εs where εs and εe are starting and ending strain values, respectively. For pure elastic material, the stored energy can be released without loss when the external loading is removed, there is no mechanical energy dissipation. For thermomechanical coupling material, the stored energy is also obtainable when the loading is removed, but part of the input energy will be converted into thermal form and can not be fully released. If the material is insulated, its temperature will be slightly increased due to the input of mechanical energy. When viscous effects of the material are taken into account, the fraction of mechanical energy converted into thermal form will be larger, which means that dissipation of mechanical energy into thermal form is enhanced by 7 viscous effects. But, compared to those due to mechanical hysteresis, all these energy dissipation are not remarkable. The energy dissipation due to hysteresis can be presented schematically by considering the mechanical energy loss (converted from mechanical to thermal) in one cycle of loading [7, 12]. Assume that the loading process starts from point A in Figure (3), and the load is continuously increased to point E. Then, the constitutive relation in this case will be the curve ABCDE, and the work done by the loading is represented by the area of ABCDERA. When the load is decreased from E to A, the system will follow another constitutive curve EDF BA, and the work done by the rod is represented by the area of EDF BARE. There is a difference between the two areas, which is enclosed by the curve BCDF B and hatched in the figure. This area represents the mechanical energy loss due to the hysteretic behaviour. At the same time, due to the thermo-mechanical coupling, the temperature of the material will be increased, as indicated by the source 2 ∂t + ν ∂ε in the energy equation. terms k1 θε ∂t ∂t The physics behind this is that, when the external energy is applied to the SMA rod, part of the energy will be demanded by the material to convert itself from one variant (P) to another (M), as sketched in Figure (2). Both P and M are stable states, and have the same potential, so the material will not recover its previous configuration when the loading is removed. In this sense, the SMAs have plastic-like property. Part of the input mechanical energy is consumed just for converting the material from one variant to another (martensite phase transformation), and finally converted into thermal energy via the thermo-mechanical coupling. If one want to reverse the transformation, extra input energy is demanded. 4 Numerical Methodology The constructed model for the vibration damping system given in Equation (13) is a strongly nonlinear coupled system. Experiences gained from the numerical experiments on similar problems shows that the development of an efficient algorithm is necessary for the numerical analysis of the model because standard iteration algorithms have difficulties to cope with the very strong nonlinearity [10, 12, 14, 16]. For the current problem, an additional difficulty is that the boundary conditions are system dependent. Indeed, we observe that the stress on the right end of the rod is a function of its displacement, velocity, and acceleration. In order to deal with these difficulties, the model is reduced to a differential-algebraic system and solved by using backward differentiation in time. The practical implementation is done similarly to [9, 14, 16]. Note, however, that here for the Chebyshev pseudo-spectral approximation, a set of Chebyshev points {xi } are chosen 8 along the length direction as follows:   πi xi = L 1 − cos( ) /2, N i = 0, 1, . . . , N. (16) Using these nodes, ε, v, θ, and σ distributions in the rod can be expressed in terms of the following linear approximation: f (x) = N X fi φi (x), (17) i=0 where f (x) stands for ε, v, θ, or σ, and fi is the function value at xi . Function φi (x) is the ith interpolating polynomial which has the following property: ( 1, i = j, (18) φi (xj ) = 0, i 6= j. It is easy to see that the Lagrange interpolants would satisfy the the above requirements. Having obtained f (x) approximately, the derivative ∂f (x)/∂x can be obtained by taking the derivative of the basis functions φi (x) with respect to x: N X ∂φi (x) ∂f = fi . ∂x ∂x i=1 (19) All these approximations are formulated in matrix form, for the convenience of actual programming implementation. For approximation to higher order derivatives, similar matrix form can be easily obtained. By substituting all the approximation into the DAE system, it will be recast into a set of nonlinear algebraic equations, which can be solved by Newton-Raphson iteration, following a similar way as done in Ref. ([9, 10, 14, 16]). 5 Numerical Experiments Several different numerical experiments have been carried out to demonstrate the damping effects of hysteresis in the SMA rod induced by the phase transformations. All experiments reported in this section have been performed on a Au23 Cu30 Zn47 rod, with length of 1 cm. Most of the physical parameters for this specific material can be found in the literature (e.g., [8, 14, 15, 16]), which are listed as follows for the sake of convenience: k1 = 480 g/ms2cmK, θ1 = 208K, k2 = 6 × 106 g/ms2cmK, ρ = 11.1g/cm3 , cv = 3.1274g/ms2cmK, k3 = 4.5 × 108 g/ms2 cmK, k = 1.9 × 10−2 cmg/ms3 K. There are two coefficients, kg and ν, are not easy to find its value. Normally, kg is very small and here we take it as 5 by referring to the value indicated in Ref.([10, 11]). 9 The value of ν is take as 10, with the same unit system. To demonstrate the damping effects of the SMA rod, we set µm = km = 0 in Equation (13). Then, only the force from the SMA rod is taken into account. For all numerical experiments, the initial conditions for the rod are chosen as θ = 210o , ε = 0.115, u = v = 0, the simulation time span is [0, 4]ms, and 40 nodes have been used for the Chebyshev approximation. In the first experiment reported here, the parameter m/β is chosen as 200 (g/cm2 ) and the initial value of vm is chosen −3 (cm/ms). The numerical results are presented in Figure (4). From the upper left plot it can be observed that the velocity of the block is damped effectively, and gradually the velocity tends to a small value. The entire damping process can be roughly divided into two stages. The first stage is t ∈ [0, 2.6]ms in which the damping is more effective since the vibration energy is still large enough to switching the whole SMA rod between martensite plus and minus at low temperature (martensite phase transformation). While in the the second stage, the contribution from phase transformation becomes weaker and finally fades because the temperature is raised, the mechanical energy is also dissipated and not large enough to induce phase transformation. The motion of the rod finally becomes a thermo-mechanical vibration without phase transformations at the end of the simulation. The strain distribution, presented in the lower right part of the plot, shows this clearly. In the lower left plot, we present the average temperature of the rod, which could be regarded as a measurement of thermal energy. Since insulation thermal conditions are used and there is no thermal dissipation included in the model, the temperature is increased rapidly when there is phase transformation induced because the large change rate of strain, and much slower when there is no transformation. This observation indicates that the conversion of mechanical energy into thermal form is much faster when phase transformation takes place. The oscillation of average temperature is caused by the phase transformation and thermo-mechanical coupling. To analyze the damping effects further, we have increased the initial vibration energy to m/β = 500. The numerical results for this case are presented in Figure (5), in a similar way as those in Figure (4). It is seen from the strain plot that the whole rod is switched between compressed (ε < 0) and stretched (ε > 0) states in the entire simulation range, and vm is decreased continuously. This strain switching causes the temperature oscillation. The dissipation of mechanical energy is faster at the beginning and becomes slower after a while in the simulation, which is indicated by the velocity plot (consider that mechanical energy is proportional to the square of velocity). This is due to the fact that phase transformation only takes place in a short period in which the rod temperature is still low, which can be roughly read as [0, 1.4]ms form the temperature plot, in which 10 the temperature increases faster. Afterwards, there is no phase transformation since the rod is at high temperature state and the motion becomes thermo-mechanical vibration again. This observation leads to same conclusion that phase transformation contribute most to the damping effects (energy conversion). To show the damping effects contributed from the viscous effects and thermo-mechanical coupling, the last numerical example presented here has been dealing with the analysis of the damping effects when there is no phase transformation induced in the SMA rod at all. For this purpose, the parameters are chosen as m/β = 20, and initial velocity vm = −1 such that the input mechanical energy is too small to induce phase transformation, and the simulation time span is also extented to [0, 20]ms to capture the long time behaviour since the mechanical energy dissiption might be much slower. For the simulation of damping effects contributed from thermo-mechanical coupling alone, the parameter is set ν = 0 (no viscous effects), and the numerical results are presented on the left column of Figure (6), by plotting the evolution of mass block velocty (top) and average temperature of the SMA rod (bottom). It indicates that the coupling alone does contribute to damping effects, the mechanical energy stored via the mass block motion is finally converted into thermal form, and increase the SMA rod temperature slightly. But, the dissipation of mechanical energy into thermal form is rather slow, there are still oscillations at the end of the simulation. In order to include the contribution from viscos effects, now the viscosity parameter is set ν = 20, numerical results are presented on the right column similarly in the figure. It is shown clearly that when viscous effects are incorportate (right), the conversion of energy due to thermo-mechanical coupling is enhanced, the the system is already at rest at t = 15ms. In both case, the oscillation of velocity and average temperature has a series of peaks, which indicates a complicate nature of the thermo-mechanical energy conversion. In all these three numerical experiments, the energy conversion between mechanical and thermal form due to thermo-mechanical coupling is well captured. It is shown that when the phase transformation is induced, the vibration damping is remarkabley enhanced because the energy conversion is enhanced. Because there is no heat loss considered here, the average temperature of the rod increases continuously. It is clear that if the SMA damper is controlled at low temperature by external efforts, it will be an effective damper. 6 Conclusions In this paper, we constructed a mathematical model for vibration damping of a mass block connected with a SMA rod. We employed the modified Ginzburg - Landau theory for the mathematical modelling of the SMA rod to capture the phase transformation and 11 thermo-mechanical coupling. The model for the vibration of the block is coupled with the dynamics of the SMA rod by adjusting the boundary conditions. The model is then numerically analyzed and the damping characteristics of the SMA rod due to the first order martensite phase transformation are investigated. It is shown that the vibration can be effectively damped, if the first order phase transformation is induced. References [1] Birman,V., Review of mechanics of shape memory alloys structures, Appl.Mech.Rev. 50 (1997) 629-645. [2] Song, G., Ma, N., and Li, H. N., Application of shape memory alloys in civil structures, Engineering Structures 28 (2006) 1266 - 1274. [3] Juan, J. S., and No, M. L., Damping behaviour during martensite transformation in shape memory alloys, Journal of Alloys and Compounds 355 (2003) 65 - 71. [4] Humbeeck, J. V., Damping capacity of thermoelastic martensite shape memory alloys, Journal of Alloys and Compounds, 355 (2003) 58 -64 [5] Piedboeuf, M. C., Gauvin, R., and Thomas, M., Damping behaviour of shape memory alloys: Strain amplitude, frequency and temperature effects. Journal of Sound and Vibration 214 (5) (1998) 885 - 901 [6] Chen, Y.C., Lagoudas, D. C., Impact induced phase transformation in shape memory alloys, Journal of the Mechanics and Physics of Solids, 48 (2000) 275 - 300. [7] Masuda, A., and Noori, M. Optimisation of hysteretic characteristics of damping devices based on pseudoelastic shape memory alloys. Inter. J. Nonlinear Mech. 37 (2002) 1375-1386. [8] Falk, F., Model free energy, mechanics, and thermomechanics of shape memory alloys. Acta Metallurgica, 28, (1980) 1773-1780. [9] Matus, P., Melnik, R., Wang, L., Rybak, I.: Application of fully conservative schemes in nonlinear thermoelasticity: Modelling shape memory materials. Mathematics and Computers in Simulation. Mathematics And Computers in Simulation 65 4-5 489-509 [10] Bunber, N., Landau-Ginzburg model for a deformation-driven experiment on shape memory alloys. Continuum Mech. Thermodyn. 8 (1996) 293-308. 12 [11] Bubner, N., Mackin, G., and Rogers, R. C., Rate depdence of hysteresis in onedimensional phase transitions, Comp. Mater. Sci., 18 (2000) 245 - 254. [12] Koucek, P, Reynolds, D. R., and Seidman, T. I., Computational modelling of vibration damping in SMA wires, Continuum Mech. Thermodyn. 16 (2004) 495 - 514. [13] Bales, G.S. and Gooding, R.J., Interfacial dynamics at a 1st-order phase-transition involving strain dynamic twin formation. Phys. Rev. Lett.,67, (1991) 3412. [14] Melnik, R., Roberts, A., Thomas, K.: Phase transitions in shape memory alloys with hyperbolic heat conduction and differential algebraic models. Computational Mechanics 29 (1) (2002) 16-26. [15] Niezgodka, M., Sprekels, J.: Convergent numerical approximations of the thermomechanical phase transitions in shape memory alloys. Numerische Mathematik 58(1991) 759-778. [16] Wang, L.X, and R.V.N.Melnik, Thermomechanical waves in SMA patches under small mechanical loadings. in Lecture Notes in Computer Science 3039, (2004), 645652. [17] Chaplygin, M. N., Darinskii, B. M., and Sidorkin, A. S., Nonlinear Waves in Ferroelastics, Ferroelectrics, 307 (2004) 1-6. [18] Abeyaratne, R;, and Knowles, J. K., On a shock-induced martensitic phase transition, J. Appl. Phys. 87 (2000), 1123 - 1134. 13 x Km m, vm fm(t) L Figure 1: Vibration damping of a mass block connected to a shape memory alloy rod. 200 150 θ = 280 K 150 Landau Free Energy Landau Free Energy 100 100 50 θ = 245 K 0 θ = 230 K 50 θ = 210 K 0 −50 −50 θ = 210 K M P −100 −0.15 −0.1 −0.05 0 ε 0.05 0.1 0.15 −100 −0.15 −0.1 −0.05 0 ε 0.05 0.1 0.15 Figure 2: Non-convex free energy and its dependence on temperature 4000 E 3000 2000 D C σ 1000 0 −1000 B F −2000 −3000 −4000 −0.2 R A −0.15 −0.1 −0.05 ε 0 0.05 0.1 0.15 Figure 3: hysteretic behaviour and its damping effect caused by the non-convex free energy 14 0.2 3 0.15 2 Displacement [cm] Velocity [cm/ms] 0.1 1 0 −1 0.05 0 −0.05 −0.1 −2 −3 0 −0.15 0.5 1 1.5 2 2.5 3 3.5 −0.2 0 4 Time [ms] 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4 260 250 θ [K] 240 230 220 210 200 0 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4 Figure 4: Damping effect of a SMA rod involving mechanically induced phase transformations 15 3 0.2 0.15 2 Displacement [cm] Velocity [cm/ms] 0.1 1 0 −1 0.05 0 −0.05 −0.1 −2 −3 0 −0.15 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 −0.2 0 4 1 2 3 4 5 Time [ms] 320 300 θ [K] 280 260 240 220 200 0 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4 Figure 5: Damping effect of a SMA rod with large initial vibration energy 16 0.8 0.6 0.6 0.4 0.4 0.2 0.2 Velocity [cm/ms] Velocity [cm/ms] ν =20 0.8 0 −0.2 −0.4 0 −0.2 −0.4 −0.6 −0.6 −0.8 −0.8 −1 0 5 10 Time [ms] 15 −1 0 20 214 214 212 212 θ [K] θ [K] 216 210 208 206 206 10 Time [ms] 15 20 15 20 210 208 5 10 Time [ms] ν=20 ν =0 216 204 0 5 15 20 204 0 5 10 Time [ms] Figure 6: Effects of internal friction on damping performance of shape memory alloy rods (no phase transformations) 17 0.125 Displacement [cm] 0.12 0.115 0.11 0.105 0.1 0 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4 215 214 213 θ [K] 212 211 210 209 208 207 206 0 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4 0.8 0.6 Velocity [cm/ms] 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 0 0.5 1 1.5 2 2.5 Time [ms] 3 3.5 4
5cs.CE
The Likelihood Ratio Test in High-Dimensional Logistic Regression Is Asymptotically a Rescaled Chi-Square arXiv:1706.01191v1 [math.ST] 5 Jun 2017 Pragya Sur∗ Yuxin Chen† Emmanuel J. Candès∗‡ June 2017 Abstract Logistic regression is used thousands of times a day to fit data, predict future outcomes, and assess the statistical significance of explanatory variables. When used for the purpose of statistical inference, logistic models produce p-values for the regression coefficients by using an approximation to the distribution of the likelihood-ratio test. Indeed, Wilks’ theorem asserts that whenever we have a fixed number p of variables, twice the log-likelihood ratio (LLR) 2Λ is distributed as a χ2k variable in the limit of large sample sizes n; here, χ2k is a chi-square with k degrees of freedom and k the number of variables being tested. In this paper, we prove that when p is not negligible compared to n, Wilks’ theorem does not hold and that the chi-square approximation is grossly incorrect; in fact, this approximation produces p-values that are far too small (under the null hypothesis). Assume that n and p grow large in such a way that p/n → κ for some constant κ < 1/2. We prove that d for a class of logistic models, the LLR converges to a rescaled chi-square, namely, 2Λ → α(κ)χ2k , where the scaling factor α(κ) is greater than one as soon as the dimensionality ratio κ is positive. Hence, the LLR is larger than classically assumed. For instance, when κ = 0.3, α(κ) ≈ 1.5. In general, we show how to compute the scaling factor by solving a nonlinear system of two equations with two unknowns. Our mathematical arguments are involved and use techniques from approximate message passing theory, from non-asymptotic random matrix theory and from convex geometry. We also complement our mathematical study by showing that the new limiting distribution is accurate for finite sample sizes. Finally, all the results from this paper extend to some other regression models such as the probit regression model. Keywords. Logistic regression, likelihood-ratio tests, Wilks’ theorem, high-dimensionality, goodness of fit, approximate message passing, concentration inequalities, convex geometry, leave-one-out analysis 1 Introduction Logistic regression is by far the most widely used tool for relating a binary response to a family of explanatory variables. This model is used to infer the importance of variables and nearly all standard statistical softwares have inbuilt packages for obtaining p-values for assessing the significance of their coefficients. For instance, one can use the snippet of R code below to fit a logistic regression model from a vector y of binary responses and a matrix X of covariates: fitted <- glm(y ~ X+0, family = ‘binomial’) pvals <- summary(fitted)$coefficients[,4] ∗ Department of Statistics, Stanford University, Stanford, CA 94305, U.S.A. of Electrical Engineering, Princeton University, Princeton, NJ 08544, U.S.A. ‡ Department of Mathematics, Stanford University, Stanford, CA 94305, U.S.A. † Department 1 The vector pvals stores p-values for testing whether a variable belongs to a model or not, and it is well known that the underlying calculations used to produce these p-values can also be used to construct confidence intervals for the regression coefficients. Since logistic models are used hundreds of times every day for inference purposes, it is important to know whether these calculations—e.g. these p-values—are accurate and can be trusted. 1.1 Binary regression Imagine we have n samples of the form (yi , Xi ), where yi ∈ {0, 1} and Xi ∈ Rp . In a generalized linear model, one postulates the existence of a link function µ(·) relating the conditional mean of the response variable to the linear predictor Xi> β, E[yi |Xi ] = µ(Xi> β), (1) where β = [β1 , β2 , . . . , βp ]> ∈ Rp is an unknown vector of parameters. We focus here on the two most commonly used binary regression models, namely, the logistic and the probit models for which ( et /(1 + et ) in the logistic model, µ(t) := (2) Φ(t) in the probit model; here, Φ is the cumulative distribution function (CDF) of a standard normal random variable. In both cases, the Symmetry Condition µ(t) + µ(−t) = 1 (3) holds, which says that the two types yi = 0 and yi = 1 are treated in a symmetric fashion. Assuming that the observations are independent, the negative log-likelihood function is given by [1, Section 4.1.2]    n  X µi + log (1 − µi ) , µi := µ(Xi> β). yi log ` (β) := − 1 − µ i i=1 Invoking the symmetry condition, a little algebra reveals an equivalent expression Xn  ` (β) := ρ − ỹi Xi> β , i=1 where ( 1 if yi = 1, ỹi := −1 if yi = 0, ( and ρ(t) := log (1 + et ) in the logistic case, − log Φ (−t) in the probit case. (4) (5) Throughout we refer to this function ρ as the effective link. 1.2 The likelihood-ratio test and Wilks’ phenomenon Researchers often wish to determine which covariates are of importance, or more precisely, to test whether the jth variable belongs to the model or not: formally, we wish to test the hypothesis Hj : βj = 0 versus βj 6= 0. (6) Arguably, one of the most commonly deployed techniques for testing Hj is the likelihood-ratio test (LRT), which is based on the log-likelihood ratio (LLR) statistic   Λj := ` β̂(−j) − ` β̂ . (7) Here, β̂ and β̂(−j) denote respectively the maximum likelihood estimates (MLEs) under the full model and the reduced model on dropping the jth predictor; that is, β̂ = arg minp `(β) β∈R β̂(−j) = arg and 2 min β∈Rp ,βj =0 `(β). Inference based on such log-likelihood ratio statistics has been studied extensively in prior literature [12, 37, 52]. Arguably, one of the most celebrated results in the large-sample regime is the Wilks’ theorem. To describe the Wilk’s phenomenon, imagine we have a sequence of observations (yi , Xi ) where yi ∈ {0, 1}, Xi ∈ Rp with p fixed. Since we are interested in the limit of large samples, we may want to assume that the covariates are i.i.d. drawn from some population with non-degenerate covariance matrix so that the problem is fully p-dimensional. As before, we assume a conditional logistic model for the response. In this setting, Wilks’ theorem [52] calculates the asymptotic distribution of Λj (n) when n grows to infinity: (Wilks’ phenomenon) Under suitable regularity conditions which, for instance, guarantee that the MLE exists and is unique,1 the LLR statistic for testing Hj : βj = 0 vs. βj 6= 0 has asymptotic distribution under the null given by d 2Λj (n) → χ21 , as n → ∞. (8) This fixed-p large-n asymptotic result, which is a consequence of asymptotic normality properties of the MLE [50, Theorem 5.14], applies to a much broader class of testing problems in parametric models; for instance, it applies to the probit model as well. We refer the readers to [34, Chapter 12] and [50, Chapter 16] for a thorough exposition and details on the regularity conditions under which Wilks’ theorem holds. Finally, there is a well-known extension which states that if we were to drop k variables from the model, then the LLR would converge to a chi-square distribution with k degrees of freedom under the hypothesis that the reduced model is correct. 1.3 Inadequacy of Wilks’ theorem in high dimensions The chi-square approximation to the distribution of the LLR statistic is used in standard statistical softwares to provide p-values for the single or multiple coefficient likelihood ratio tests. Here, we perform a simple experiment on synthetic data to study the accuracy of the chi-square approximation when p and n are both decently large. Specifically, we set β = 0 and test β1 = 0 vs. β1 6= 0 using the LRT in a setting i.i.d. where p = 1200. In each trial, n = 4000 observations are produced with yi ∼ Bernoulli(1/2), and X := [X1 , · · · , Xn ]> ∈ Rn×p is obtained by generating a random matrix composed of i.i.d. N (0, 1) entries. We fit a logistic regression of y on X using R, and extract the p-values for each coefficient. Figure 1 plots the pooled histogram that aggregates 4.8 × 105 p-values in total (400 trials with 1200 p-values obtained in each trial). If the χ21 approximation were true, then we would expect to observe uniformly distributed p-values. The histrogram from Fig. 1 is, however, far from uniform. This is an indication of the inadequacy of Wilks’ theorem when p and n are both large. The same issue was also reported in [11], where the authors observed that this discrepancy is highly problematic since the distribution is skewed towards smaller values. Hence, such p-values cannot be trusted to construct level-α tests and the problem is increasingly severe when we turn attention to smaller p-values as in large-scale multiple testing applications. 1.4 The Bartlett correction? A natural question that arises immediately is whether the observed discrepancy could be an outcome of a finite-sample effect. It has been repeatedly observed that the chi-square approximation does not yield accurate results with finite sample size. One correction to the LRT that is widely used in finite samples is the Bartlett correction, which dates back to Bartlett [5] and has been extensively studied over the past few decades (e.g. [8, 10, 13, 15, 33]). In the context of testing for a single coefficient in the logistic model, this correction can be described as follows [38]: compute the expectation of the LLR statistic up to terms of order 1/n2 ; that is, compute a parameter α such that   1 α , E[2Λj ] = 1 + + O n n2 1 Such conditions would also typically imply asymptotic normality of the MLE. 3 12500 30000 15000 10000 7500 Counts Counts Counts 20000 10000 10000 5000 5000 2500 0 0 0.00 0.25 0.50 P−Values 0.75 1.00 0 0.00 (a) 0.25 0.50 P−Values 0.75 1.00 (b) 0.00 0.25 0.50 P−Values 0.75 1.00 (c) Figure 1: Histogram of p-values for logistic regression under i.i.d. Gaussian design, when β = 0, n = 4000, p = 1200, and κ = 0.3: (a) classically computed p-values; (b) Bartlett-corrected p-values; (c) adjusted p-values. which suggests a corrected LLR statistic 2Λj 1 + αnn (9) with αn being an estimator of α. With a proper choice of αn , one can ensure     2Λj 1 E =1+O 1 + αnn n2 in the classical setting where p is fixed and n diverges. In expectation, this corrected statistic is closer to a χ21 distribution than the original LLR for finite samples. Notably, the correction factor may in general be a function of the unknown β and, in that case, must be estimated from the null model via maximum likelihood estimation. In the context of GLMs, Cordeiro [13] derived a general formula for the Bartlett corrected LLR statistic, see [14, 17] for a detailed survey. In the case where there is no signal (β = 0), one can compute αn for the logistic regression model following [13] and [38], which yields αn =   n 2 Tr Dp2 − Tr Dp−1 . 2 (10) −1 > > Here, Dp is the diagonal part of X(X > X)−1 X > and Dp−1 is that of X(−j) X(−j) X(−j) X(−j) in which X(−j) is the design matrix X with the jth column removed. Comparing the adjusted LLRs to a χ21 distribution yields adjusted p-values. In the setting of Fig. 1(a), the histogram of Bartlett corrected p-values is shown in Fig. 1(b). As we see, these p-values are still far from uniform. If the mismatch is not due to finite sample-size effects, what is the distribution of the LLR in high dimensions? Our main contribution is to provide a very precise answer to this question; below, we derive the high-dimensional asymptotic distribution of the log-likelihood ratios, i.e. in situations where the dimension p is not necessarily negligible compared to the sample size n. 4 2 Main results 2.1 Modelling assumptions In this paper, we focus on the high-dimensional regime where the sample size is not much larger than the number of parameters to be estimated—a setting which has attracted a flurry of activity in recent years. In particular, we assume that the number p(n) of covariates grows proportionally with the number n of observations; that is, p(n) = κ, (11) lim n→∞ n where κ > 0 is a fixed constant independent of n and p(n). In fact, we shall also assume κ < 1/2 for both the logistic and the probit models, as the MLE is otherwise at ∞; see Section 2.2. To formalize the notion of high-dimensional asymptotics when both n and p(n) diverge, we consider a sequence of instances {X(n), y(n)}n≥0 such that for any n, • X(n) ∈ Rn×p(n) has i.i.d. rows Xi (n) ∼ N (0, Σ), where Σ ∈ Rp(n)×p(n) is positive definite;  ind. • yi (n) | X(n) ∼ yi (n) | Xi (n) ∼ Bernoulli µ(Xi (n)> β(n)) , where µ satisfies the Symmetry Condition; • we further assume β(n) = 0. From the Symmetry Condition it follows that µ(0) = 1/2, which directly implies that y(n) is a vector with i.i.d Bernoulli(1/2) entries. The MLE is denoted by β̂(n) and there are p(n) LLR statistics Λj (n) (1 ≤ j ≤ p(n)), one for each of the p(n) regression coefficients. In the sequel, the dependency on n shall be suppressed whenever it is clear from the context. 2.2 When does the MLE exist? Even though we are operating in the regime where n > p, the existence of the MLE cannot be guaranteed for all p and n. Interestingly, the norm of the MLE undergoes a sharp phase transition in the sense that kβ̂k = ∞ if κ > 1/2 and kβ̂k < ∞ if κ < 1/2. Here, we develop some understanding about this phenomenon. Given that ρ(t) ≥ ρ(−∞) = 0 for both the logistic and probit models, each summand in (4) is minimized if ỹi Xi> β = ∞, which occurs when sign(Xi> β) = sign(ỹi ) and kβk = ∞. As a result, if there exists a nontrivial ray β such that Xi> β > 0 if ỹi = 1 and Xi> β < 0 if ỹi = −1 (12) for any 1 ≤ i ≤ n, then pushing kβk to infinity leads to an optimizer of (4). In other words, the solution to (4) becomes unbounded (the MLE is at ∞) whenever there is a hyperplane perfectly separating the two sets of samples {i | ỹi = 1} and {i | ỹi = −1}. Under the assumptions from Section 2.1, ỹi is independent of X and the distribution of X is symmetric. Hence, to calculate the chance that there exists a separating hyperplane, we can assume ỹi = 1 (1 ≤ i ≤ n) without loss of generality. In this case, the event (12) becomes {Xβ | β ∈ Rp } ∩ Rn++ 6= ∅, (13) where Rn++ is the positive orthant. Write X = ZΣ1/2 so that Z is an n × p matrix with i.i.d. standard Gaussian entries, and θ = Σ1/2 β. Then the event (13) is equivalent to {Zθ | θ ∈ Rp } ∩ Rn++ 6= ∅. 5 (14) Now the probability that (14) occurs is the same as that {Zθ | θ ∈ Rp } ∩ Rn+ 6= {0} (15) occurs, where Rn+ denotes the non-negative orthant. From the approximate kinematic formula [3, Theorem I] in the literature on convex geometry, the event (15) happens with high probability if and only if the total statistical dimension of the two closed convex cones exceeds the ambient dimension, i.e.  δ ({Zθ | θ ∈ Rp }) + δ Rn+ > n + o(n). (16) Here, the statistical dimension of a closed convex cone K is defined as   δ(K) := Eg∼N (0,I) kΠK (g) k2 (17) with ΠK (g) := arg minz∈K kg − zk the Euclidean projection. Recognizing that [3, Proposition 2.4] δ ({Zθ | θ ∈ Rp }) = p and δ(Rn+ ) = n/2, we reduce the condition (16) to p + n/2 > n + o(n) or p/n > 1/2 + o(1), thus indicating that kβ̂k = ∞ when κ = lim p/n > 1/2. This argument only reveals that kβ̂k = ∞ in the regime where κ > 1/2. If κ = p/n < 1/2, then kΣ1/2 β̂k = O(1) with high probability, a fact we shall prove in Section 5. In light of these observations we work with the additional condition κ < 1/2. (18) 2.3 The high-dimensional limiting distribution of the LLR In contrast to the classical Wilks’ result, our findings reveal that the LLR statistic follows a rescaled chisquare distribution with a rescaling factor that can be explicitly pinned down through the solution to a system of equations. 2.3.1 A system of equations We start by setting up the crucial system of equations. Before proceeding, we first recall the proximal operator   1 (19) proxbρ (z) := arg min bρ(x) + (x − z)2 x∈R 2 defined for any b > 0 and convex function ρ(·). As in [18], we introduce the operator Ψ(z; b) := bρ0 (proxbρ (z)), (20) which is simply the proximal operator of the conjugate (bρ)∗ of bρ.2 To see this, we note that Ψ satisfies the relation [18, Proposition 6.4] Ψ(z; b) + proxbρ (z) = z. (21) The claim that Ψ(·; b) = prox(bρ)∗ (·) then follows from the Moreau decomposition proxf (z) + proxf ∗ (z) = z, 2 The ∀z, conjugate f ∗ of a function f is defined as f ∗ (x) = supu∈dom(f ) {hu, xi − f (u)}. 6 (22) 25.0 ● ● 20.0 2.00 ● 15.0 ● Rescaling Constant Rescaling Constant ● 10.0 ● 1.75 ● ● ● ● ● ● 1.50 ● ● ● ● ● 1.25 1.00 ●● ●● ●● ●●● 0.00 0.05 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 5.0 ● ● ● ● 1.0 0.10 0.15 0.20 κ 0.25 0.30 0.35 0.40 ● 2.5 ● ●●● ● ● ●●●● ●●● ●●● ●●● ●● ●●● ●●● ●● ●● ●● ●● ● ● ●● ● ● ● ● ● ● 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 κ Figure 2: Rescaling constant τ∗2 /b∗ as a function of κ for the logistic model. Note the logarithmic scale in the right panel. The curves for the probit model are nearly identical. which holds for a closed convex function f [39, Section 2.5]. Interested readers are referred to [18, Appendix 1] for more properties of proxbρ and Ψ. We are now in position to present the system of equations that plays a crucial role in determining the distribution of the LLR statistic in high dimensions: i 1 h 2 E (Ψ (τ Z; b)) , κ  κ = E Ψ0 (τ Z; b) , τ2 = (23) (24) where Z ∼ N (0, 1), and Ψ0 (·, ·) denotes differentiation with respect to the first variable. The fact that this system of equations would admit a unique solution in R2+ is not obvious a priori. We shall establish this for the logistic and the probit models later in Section 6. 2.3.2 Main result Theorem 1. Consider a logistic or probit regression model under the assumptions from Section 2.1. If κ ∈ (0, 1/2), then for any 1 ≤ j ≤ p, the log-likelihood ratio statistic Λj as defined in (7) obeys d 2Λj → τ∗2 2 χ , b∗ 1 as n → ∞, (25) where (τ∗ , b∗ ) ∈ R2+ is the unique solution to the system of equations (23) and (24). Furthermore, the LLR statistic obtained by dropping k variables for any fixed k converges to (τ∗2 /b∗ )χ2k . Finally, these results extend to all binary regression models with links obeying the assumptions listed in Section 2.3.3. Hence, the limiting distribution is a rescaled chi-square with a rescaling factor τ∗2 /b∗ that only depends on the aspect ratio κ. Fig. 2 illustrates the dependence of the rescaling factor on the limiting aspect ratio κ for logistic regression. The figures for the probit model are similar as the rescaling constants actually differ by very small values. To study the quality of approximation for finite samples, we repeat the same numerical experiments as before but now obtain the p-values by comparing the LLR statistic with the rescaled chi-square suggested by 7 Theorem 1. For a particular run of the experiment (n = 4000, p = 1200, κ = 0.3), we compute the adjusted LLR statistic (2b∗ /τ∗2 )Λj for each coefficient and obtain the p-values based on the χ21 distribution. The pooled histogram that aggregates 4.8 × 105 p-values in total is shown in Fig. 1(c). As we clearly see, the p-values are much closer to a uniform distribution now. One can compute the chi-square goodness of fit statistic to test the closeness of the above distribution to uniformity. To this end, we divide the interval [0, 1] into 20 equally spaced bins of width 0.05 each. For each bin we compute the observed number of times a p-value falls in the bin out of the 4.8 × 105 values. Then a chi-square goodness of fit statistic is computed, noting that the expected frequency is 24000 for each bin. The chi-square statistic in this case is 16.049, which gives a p-value of 0.654 in comparison with a χ219 variable. The same test when performed with the Bartlett corrected p-values (Fig. 1(b)) yields a chi-square statistic 5599 with a p-value of 0. 3 Thus, our correction gives the desired uniformity in the p-values when the true signal β = 0. Practitioners would be concerned about the validity of p-values when they are small—again, think about multiple testing applications. In order to study whether our correction yields valid results for small p-values, we compute the proportion of times the p-values (in all the three cases) lie below 5%, 1%, 0.5%, 0.1% out of the 4.8 × 105 times. The results are summarized in Table 1. This further illustrates the deviation from uniformity for the classical and Bartlett corrected p-values, whereas the “adjusted” p-values obtained invoking Theorem 1 are still valid. P{p-value ≤ 5%} P{p-value ≤ 1%} P{p-value ≤ 0.5%} P{p-value ≤ 0.1%} P{p-value ≤ 0.05%} P{p-value ≤ 0.01%} Classical 11.1044%(0.0668%) 3.6383%(0.038%) 2.2477%(0.0292%) 0.7519%(0.0155%) 0.4669%(0.0112%) 0.1575%(0.0064%) Bartlett-corrected 6.9592%(0.0534%) 1.6975%(0.0261%) 0.9242%(0.0178%) 0.2306%(0.0078%) 0.124%(0.0056%) 0.0342%(0.0027%) Adjusted 5.0110%(0.0453%) 0.9944%(0.0186%) 0.4952%(0.0116%) 0.1008%(0.0051%) 0.0542%(0.0036%) 0.0104%(0.0014%) Table 1: Estimates of p-value probabilities with estimated Monte Carlo standard errors in parentheses under i.i.d. Gaussian design. 2.3.3 Extensions As noted in Section 1.1, the Symmetry Condition (3) allows to express the negative log-likelihood in the form (4), which makes use of the effective link ρ(·). Theorem 1 applies to any ρ(·) obeying the following properties: 1. ρ is non-negative, has up to three derivatives, and obeys ρ(t) ≥ t. 2. ρ0 may be unbounded but it should grow sufficiently slowly, in particular, we assume |ρ0 (t)| = O(|t|) and ρ0 (proxcρ (Z)) is a sub-Gaussian random variable for any constant c > 0 and any Z ∼ N (0, σ 2 ) for some finite σ > 0. 3. ρ00 (t) > 0 for any t which implies that ρ is convex, and supt ρ00 (t) < ∞. 4. supt |ρ000 (t)| < ∞. 5. Given any τ > 0 ,the equation (24) has a unique solution in b. 6. The map V(τ 2 ) as defined in (57) has a fixed point. 3 Note that the p-values obtained at each trial are not exactly independent. However, they are exchangeable, and weakly dependent (see the proof of Corollary 1 for a formal justification of this fact). Therefore, we expect the goodness of fit test to be an approximately valid procedure in this setting. 8 It can be checked that the effective links for both the logistic and the probit models (5) obey all of the above. The last two conditions are assumed to ensure existence of a unique solution to the system of equations (23) and (24) as will be seen in Section 6; we shall justify these two conditions for the logistic and the probit models in Section 6.1. 2.4 Reduction to independent covariates In order to derive the asymptotic distribution of the LLR statistics, it in fact suffices to consider the special case Σ = Ip . Lemma 1. Let Λj (X) be the LLR statistic based on the design matrix X, where the rows of X are i.i.d. N (0, Σ) and Λj (Z) that where the rows are i.i.d. N (0, Ip ). Then d Λj (X) = Λj (Z). Proof: Recall from (4) that the LLR statistic for testing the jth coefficient can be expressed as Λj (X) = min β n X ρ(−ỹi e> i Xβ) i=1 n X − min β:βj =0 ρ(−ỹi e> i Xβ). i=1 Write Z 0 = XΣ−1/2 so that the rows of Z 0 are i.i.d. N (0, Ip ) and set θ 0 = Σ1/2 β. With this reparameter0 p ization, we observe that the constraint βj = 0 is equivalent to a> j θ = 0 for some non-zero vector aj ∈ R . This gives n n X X > 0 0 0 0 ρ(−ỹ e Z θ ) − min ρ(−ỹi e> Λj (X) = min i i i Z θ ). 0 θ 0 θ 0 :a> j θ =0 i=1 i=1 p Now let Q be an orthogonal matrix mapping aj ∈ R into the vector kaj kej ∈ Rp , i.e. Qaj = kaj kej . 0 Additionally, set Z = Z 0 Q (the rows of Z are still i.i.d. N (0, Ip )) and θ = Qθ 0 . Since a> j θ = 0 occurs if and only if θj = 0, we obtain Λj (X) = min θ n X i=1 ρ(−ỹi e> i Zθ) − min θ:θj =0 n X ρ(−ỹi e> i Zθ) = Λj (Z), i=1  which proves the lemma. In the remainder of the paper we, therefore, assume Σ = Ip . 2.5 Proof architecture This section presents the main steps for proving Theorem 1. We will only prove the theorem for {Λj }, the LLR statistic obtained by dropping a single variable. The analysis for the LLR statistic obtained on dropping k variables (for some fixed k) follows very similar steps and is hence omitted for the sake of conciceness. As discussed before, we are free to work with any configuration of the yi ’s. For the two steps below, we will adopt two different configurations for convenience of presentation. 2.5.1 Step 1: characterizing the asymptotic distributions of β̂j Without loss of generality, we assume here that yi = 1 (and hence ỹi = 1) for all 1 ≤ i ≤ n and, therefore, the MLE problem reduces to Xn minimizeβ∈Rp ρ(−Xi> β). i=1 We would first like to characterize the marginal distribution of β̂, which is crucial in understanding the LLR statistic. To this end, our analysis follows by a reduction to the setup of [18–21], with certain modifications 9 that are called for due to the specific choices of ρ(·) we deal with here. Specifically, consider the linear model y = Xβ + w, (26) and prior work [18–21] investigating the associated M-estimator Xn minimizeβ∈Rp ρ(yi − Xi> β). i=1 (27) Our problem reduces to (27) on setting y = w = 0 in (27). When ρ(·) satisfies certain assumptions (e.g. strong convexity), the asymptotic distribution of kβ̂k has been studied in a series of works [19–21] using a leave-one-out analysis and independently in [18] using approximate message passing (AMP) machinery. An outline of their main results is described in Section 2.7. However, the function ρ(·) in our cases has vanishing curvature and, therefore, lacks the essential strong convexity assumption that was utilized in both the aforementioned lines of work. To circumvent this issue, we propose to invoke the AMP machinery as in [18], in conjunction with the following critical additional ingredients: • (Norm Bound Condition) We utilize results from the conic geometry literature (e.g. [3]) to establish that kβ̂k = O(1) with high probability as long as κ < 1/2. This will be elaborated in Theorem 4. • (Likelihood Curvature Condition) We establish some regularity conditions on the Hessian of the loglikelihood function, generalizing the strong convexity condition, which will be detailed in Lemma 4. • (Uniqueness of the Solution to (23) and (24)) We establish that for both the logistic and the probit case, the system of equations (23) and (24) admits a unique solution. We emphasize that these elements are not straightforward, require significant effort and a number of novel ideas, which form our primary technical contributions for this step. These ingredients enable the use of the AMP machinery even in the absence of strong convexity on ρ(·), finally leading to the following theorem: Theorem 2. Under the conditions of Theorem 1, lim kβ̂k2 =a.s. τ∗2 . n→∞ (28) This theorem immediately implies that the marginal distribution of β̂j is normal. Corollary 1. Under the conditions of Theorem 1, for every 1 ≤ j ≤ p, it holds that √ d pβ̂j → N (0, τ∗2 ), as n → ∞. (29) Proof: From the rotational invariance of our i.i.d. Gaussian design, it can be easily verified that β̂/kβ̂k is uniformly distributed on the unit sphere Sp−1 and is independent of kβ̂k. Therefore, β̂j has the same √ distribution as kβ̂kZj /kZk, where Z = (Z1 , . . . , Zp ) ∼ N (0, Ip ) independent of kβ̂k. Since pkβ̂k/kZk √ converges in probability to τ∗ , we have, by Slutsky’s theorem, that pβ̂j converges to N (0, τ∗2 ) in distribution.  2.5.2 Step 2: connecting Λj with β̂j Now that we have derived the asymptotic distribution of β̂j , the next step involves a reduction of the LLR statistic to a function of the relevant coordinate of the MLE. Before continuing, we note that the distribution of Λj is the same for all 1 ≤ j ≤ p due to exchangeability. As a result, going forward we will only analyze Λ1 without loss of generality. In addition, we introduce the following convenient notations and assumptions: 10 • the design matrix on dropping the first column is written as X̃ and the MLE in the corresponding reduced model as β̃; • write X = [X1 , · · · , Xn ]> ∈ Rn×p and X̃ = [X̃1 , · · · , X̃n ]> ∈ Rn×(p−1) ; • without loss of generality, assume that ỹi = −1 for all i in this subsection, and hence the MLEs under the full and the reduced models reduce to Xn β̂ = arg minβ∈Rp `(β) := ρ(Xi> β), (30) i=1 Xn ˜ β̃ = arg minβ∈Rp−1 `(β) := ρ(X̃i> β). (31) i=1 With the above notations in place, the LLR statistic for testing β1 = 0 vs. β1 6= 0 can be expressed as n n o X ˜ β̃) − `(β̂) = Λ1 := `( ρ(X̃i> β̃) − ρ(Xi> β̂) . (32) i=1 To analyze Λ1 , we invoke Taylor expansion to reach Λ1 = n  1X   2   ρ00 Xi> β̂ X̃i> β̃ − Xi> β̂ ρ0 Xi> β̂ X̃i> β̃ − Xi> β̂ + 2 i=1 i=1 {z } | n X :=Qlin n +  3 1 X 000 ρ (γi ) X̃i> β̃ − Xi> β̂ , 6 i=1 (33) where γi lies between X̃i> β̃ and Xi> β̂. A key observation is that the linear term Qlin in the above equation vanishes. To see this, note that the first-order optimality conditions for the MLE β̂ is given by Xn ρ0 (Xi> β̂)Xi = 0. (34) i=1   0 Replacing X̃i> β̃ with Xi> in Qlin and using the optimality condition, we obtain β̃   Xn   >  0  0 > Qlin = ρ Xi β̂ Xi − β̂ = 0. i=1 β̃ Consequently, Λ1 simplifies to the following form n n  3 2 1 X 1 X 00 >  > ρ (Xi β̂) X̃i β̃ − Xi> β̂ + ρ000 (γi ) X̃i> β̃ − Xi> β̂ . Λ1 = 2 i=1 6 i=1 (35) Thus, computing the asymptotic distribution of Λ1 boils down to analyzing Xi> β̂ − X̃i> β̃. Our argument is inspired by the leave-one-predictor-out approach developed in [19, 20]. We re-emphasize that our setting is not covered by that of [19,20], due to the violation of strong convexity and some other technical assumptions. We sidestep this issue by utilizing the Norm Bound Condition and the Likelihood Curvature Condition. In the end, our analysis establishes the equivalence of Λ1 and β̂1 up to some explicit multiplicative factors modulo negligible error terms. This is summarized as follows. Theorem 3. Under the assumptions of Theorem 1, p P 2Λ1 − β̂12 → 0, b∗ as n → ∞. (36) Theorem 3 reveals a simple yet surprising connection between the LLR statistic Λ1 and the MLE β̂. As we shall see in the proof of the theorem, the quadratic term in (35) is 12 bp∗ β̂12 + o(1), while the remaining third-order term of (35) is vanishingly small. Finally, putting Corollary 1 and Theorem 3 together directly establishes Theorem 1. 11 2.6 Comparisons with the classical regime We pause to shed some light on the interpretation of the correction factor τ∗2 /b∗ in Theorem 1 and understand the differences from classical results. Classical theory (e.g. [30,31]) asserts that when p is fixed and n diverges, the MLE for a fixed design X is asymptotically normal, namely, √ d n(β̂ − β) → N (0, Iβ−1 ), where  Iβ = 1 > X Dβ X n  with Dβ :=  ρ00 X1> β (37)   .. . ρ 00 Xn> β    (38) is the normalized Fisher information at the true value β. In particular, under the global null and i.i.d. Gaussian design, this converges to ( 1 I, for the logistic model EX [Iβ ] = 42 π I, for the probit model as n tends to infinity [50, Example 5.40]. The behavior in high dimensions is different. In particular, Corollary 1 states that under the global null, we have √ d p(β̂j − βj ) → N (0, τ∗2 ). (39) Comparing the variances in the logistic model, we have that ( √  4κ, in classical large-sample theory; lim Var pβ̂j = n→∞ τ∗2 , in high dimensions. Fig. 3 illustrates the behavior of the ratio τ∗2 /κ as a function of κ. Two observations are immediate: • First, in Fig. 3(a) we have τ∗2 ≥ 4κ for all κ ≥ 0. This indicates an inflation in variance or an “extra Gaussian noise” component that appears in high dimensions, as discussed in [18]. The variance of the “extra Gaussian noise” component increases as κ grows. • Second, as κ → 0, we have τ∗2 /4κ → 1 in the logistic model, which indicates that classical theory becomes accurate in this case. In other words, our theory recovers the classical prediction in the regime where p = o(n). Further, for the testing problem considered here, the LLR statistic in the classical setup can be expressed, through Taylor expansion, as 2Λ1 = n(β̂ − β̃)> Iβ (β̂ − β̃) + oP (1), (40) where β̃ is defined in (31). In the high-dimensional setting, we will also establish a quadratic approximation of the form 1 2Λ1 = n(β̂ − β̃)> G(β̂ − β̃) + oP (1), G = X > Dβ̂ X. n In Theorem 7, we shall see that b∗ is the limit of n1 Tr(G−1 ), the Stieltjes transform of the empirical spectral distribution of G evaluated at 0. Thus, this quantity in some sense captures the spread in the eigenvalues of G one would expect to happen in high dimensions. 12 10 ● ● 30 ● ● ● ● 7.5 ● ● ● ● 20 ● τ2 κ τ2 κ ● ● ● ● ● ● ● 5 ● ● ● ● ● ● ● ● 10 4 ●● ●● ●● ●● ●● ●● ● ● ●●● ●●● ● 0.00 0.05 0.10 0.15 ● ● ● ● ● ● ● ● 2.5 ● ●●● ● 1.57 0.20 κ 0.25 0.30 0.35 0.40 ●● ●● ●● ●● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 κ (a) logistic regression (b) probit regression Figure 3: Ratio of asymptotic variance and dimensionality factor κ as a function of κ. 2.7 Prior art Wilks’ type of phenomenon in the presence of a diverging dimension p has received much attention in the past. For instance, Portnoy [43] investigated simple hypotheses in regular exponential families, and established the asymptotic chi-square approximation for the LLR test statistic as long as p3/2 /n → 0. This phenomenon was later extended in [46] to accommodate the MLE with a quadratic penalization, and in [53] to account for parametric models underlying several random graph models. Going beyond parametric inference, Fan et al. [22, 24] explored extensions to infinite-dimensional non-parametric inference problems, for which the MLE might not even exist or might be difficult to derive. While the classical Wilks’ phenomenon fails to hold in such settings, Fan et al. [22, 24] proposed a generalization of the likelihood ratio statistics based on suitable non-parametric estimators and characterized the asymptotic distributions. Such results have further motivated Boucheron and Massart [9] to investigate the non-asymptotic Wilks’ phenomenon or, more precisely, the concentration behavior of the difference between the excess empirical risk and the true risk, from a statistical learning theory perspective. The Wilks’ phenomenon for penalized empirical likelihood has also been established [48]. However, the precise asymptotic behavior of the LLR statistic in the regime that permits p to grow proportional to n is still beyond reach. On the other hand, as demonstrated in Section 2.5.1, the MLE here under the global null can be viewed as an M-estimator for a linear regression problem. Questions regarding the behavior of robust linear regression estimators in high dimensions—where p is allowed to grow with n—–were raised in Huber [30], and have been extensively studied in subsequent works, e.g. [36, 40–42]. When it comes to logistic regression, the behavior of the MLE was studied for a diverging number of parameters by [28], which characterized the squared estimation error of the MLE if (p log p)/n → 0. In addition, the asymptotic normality properties of the MLE and the penalized MLE for logistic regression have been established by [35] and [23], respectively. A very recent paper by Fan et al. [25] studied the logistic model under the global null β = 0, and investigated the classical asymptotic normality as given in (37). It was discovered in [25] that the convergence property (37) breaks down even in terms of the marginal distribution, namely, √ Iβ nβ̂i d −1/2 9 N (0, 1) , i,i 13 Iβ = 1 > X X, 4n 12500 30000 15000 10000 7500 Counts Counts Counts 20000 10000 10000 5000 5000 2500 0 0 0.00 0.25 0.50 P−Values 0.75 1.00 (a) 0 0.00 0.25 0.50 P−Values (b) 0.75 1.00 0.00 0.25 0.50 P−Values 0.75 1.00 (c) Figure 4: Histogram of p-values for logistic regression under i.i.d. Bernoulli design, when β = 0, n = 4000, p = 1200, and κ = 0.3: (a) classically computed p-values; (b) Bartlett corrected p-values; (c) adjusted p-values. as soon as p grows at a rate exceeding n2/3 . This result, however, does not imply the asymptotic distribution of the likelihood-ratio statistic in this regime. In fact, our theorem implies that LLR statistic 2Λj goes to χ21 (and hence Wilks phenomenon remains valid) when κ = p/n → 0. The line of work that is most relevant to the present paper was initially started by El Karoui et al. [21]. Focusing on the regime where p is comparable to n, the authors uncovered, via a non-rigorous argument, that the asymptotic `2 error of the MLE could be characterized by a system of nonlinear equations. This seminal result was later made rigorous independently by Donoho et al. [18] under i.i.d. Gaussian design and by El Karoui [19, 20] under more general i.i.d. random design as well as certain assumptions on the error distribution. Both approaches rely on strong convexity on the function ρ(·) that defines the M-estimator, which does not hold in the models considered herein. 2.8 Notations We adopt the standard notation f (n) = O (g(n)) or f (n) . g(n) which means that there exists a constant c > 0 such that |f (n)| ≤ c|g(n)|. Likewise, f (n) = Ω (g(n)) or f (n) & g(n) means that there exists a constant c > 0 such that |f (n)| ≥ c |g(n)|, f (n)  g(n) means that there exist constants c1 , c2 > 0 such that (n) c1 |g(n)| ≤ |f (n)| ≤ c2 |g(n)|, and f (n) = o(g(n)) means that limn→∞ fg(n) = 0. Any mention of C, Ci , c, ci for i ∈ N refers to some positive universal constants whose value may change from line to line. For a square symmetric matrix M , the minimum eigenvalue is denoted by λmin (M ). Logarithms are base e. 3 3.1 Numerics Non-Gaussian covariates In this section we first study the sensitivity of our result to the Gaussianity assumption on the design matrix. To this end, we consider a high dimensional binary regression set up with a Bernoulli design matrix. We i.i.d. simulate n = 4000 i.i.d. observations (yi , Xi ) with yi ∼ Bernoulli(1/2), and Xi generated independent of yi , such that each entry takes on values in {1, −1} w.p. 1/2. At each trial, we fit a logistic regression model to the data and obtain the classical, Bartlett corrected and adjusted p-values (using the rescaling factor τ∗2 /b∗ ). Figure 4 plots the histograms for the pooled p-values, obtained across 400 trials. 14 It is instructive to compare the histograms to that obtained in the Gaussian case (Figure 1). The classical and Bartlett corrected p-values exhibit similar deviations from uniformity as in the Gaussian design case, whereas our adjusted p-values continue to have an approximate uniform distribution. We test for deviations from uniformity using a formal chi-squared goodness of fit test as in Section 2.3.2. For the Bartlett corrected p-values, the chi-squared statistic turns out to be 5885, with a p-value 0. For the adjusted p-values,the chi-squared statistic is 24.1024, with a p-value 0.1922.4 Once again, the Bartlett correction fails to provide valid p-values whereas the adjusted p-values are consistent with a uniform distribution. These findings indicate that the distribution of the LLR statistic under the i.i.d. Bernoulli design is in agreement to the rescaled χ21 derived under the Gaussian design in Theorem 1, suggesting that the distribution is not too sensitive to the Gaussianity assumption. Estimates of p-value probabilities for our method are provided in Table 2. P{p-value ≤ 5%} P{p-value ≤ 1%} P{p-value ≤ 0.5%} P{p-value ≤ 0.1%} P{p-value ≤ 0.05%} P{p-value ≤ 0.01%} Adjusted 5.0222%(0.0412%) 1.0048%(0.0174%) 0.5123%(0.0119%) 0.1108%(0.005%) 0.0521%(0.0033%) 0.0102%(0.0015%) Table 2: Estimates of p-value probabilities with estimated Monte Carlo standard errors in parentheses under i.i.d. Bernoulli design. 3.2 Quality of approximations for finite sample sizes In the rest of this section, we report some numerical experiments which study the applicability of our theory in finite sample setups. Validity of tail approximation The first experiment explores the efficacy of our correction for extremely small p-values. This is particularly important in the context of multiple comparisons, where practitioners care about the validity of exceedingly small p-values. To this end, the empirical cumulative distribution of the adjusted p-values is estimated under a standard Gaussian design with n = 4000, p = 1200 and 4.8 × 105 p-values. The range [0.1/p, 12/p] is divided into points which are equi-spaced with a distance of 1/p between any two consecutive points. The estimated empirical CDF at each of these points is represented in blue in Figure 5. The estimated CDF is in near-perfect agreement with the diagonal, suggesting that the adjusted p-values computed using the rescaled chi-square distribution are remarkably close to a uniform, even when we zoom in at very small resolutions as would be the case when applying Bonferroni-style corrections. Moderate sample sizes The final experiment studies the accuracy of our asymptotic result for moderately large samples. This is especially relevant for applications where the sample sizes are not too large. We repeat our numerical experiments with n = 200, p = 60 for i.i.d. Gaussian design, and 4.8 × 105 p-values. The empirical CDF for these p-values are estimated and Figure 6 shows that the adjusted p-values are nearly uniformly distributed even for moderate sample sizes such as n = 200. 4 Preliminaries This section gathers a few preliminary results that will be useful throughout the paper. We start by collecting some facts regarding i.i.d. Gaussian random matrices. 4 Recall our earlier footnote about the use of a χ2 test. 15 0.0100 ● ●● ● ● ●● ●● ● ●● ●● ● ●● ●● ● ●● ● ●● ●● ● ● ●● ●● ● ●● ●● ● ●● ●● ●● ●● ● ● ● ●● ●● ●● ●● ● ● ●● ● ● ●● ●● ● ● ●● ●● ●● ●● ● ●● ●● ●● ●● ● ● ●● ●● ● ●● ●● ● ● Empirical cdf 0.0075 0.0050 0.0025 0.0000 0.000 0.002 0.004 0.006 0.008 0.010 t Figure 5: Empirical CDF of adjusted pvalues for logistic regression when β = 0, n = 4000, p = 1200. Here, the blue points represent the empirical CDF (t vs. the fraction of p-values below t), and the red line is the diagonal. 1.00 Empirical cdf 0.75 0.50 0.25 0.00 ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ● ●● ●● ●● ●● ● ●● ●● ●● ●● ● ● ●● 0.00 0.25 0.50 0.75 1.00 t Figure 6: Empirical CDF of adjusted pvalues for logistic regression when β = 0, n = 200, p = 60. Here, the blue points represent the empirical CDF (t vs. the fraction of p-values below t), and the red line is the diagonal. 16 Lemma 2. Let X = [X1 , X2 , . . . Xn ]> be an n × p matrix with i.i.d. standard Gaussian entries. Then  P kX > Xk ≤ 9n ≥ 1 − 2 exp(−n/2); (41) √  √ P sup1≤i≤n kXi k ≤ 2 p ≥ 1 − 2n exp(−( p − 1)2 /2). Proof: This is a straighforward application of [51, Corollary 5.35] and the union bound. (42)  Lemma 3. Suppose X is an n × p matrix with pentries i.i.d N (0, 1), then there exists a constant 0 such √ that whenever 0 ≤  ≤ 0 and 0 ≤ t ≤ 1 −  − p/n, !  r 2 √ 1X p > λmin 1−− Xi Xi − t , ∀S ⊆ [n] with |S| = (1 − )n (43) ≥ n n i∈S     2 with probability exceeding 1 − 2 exp − (1−)t − H () n . Here, H() = − log  − (1 − ) log(1 − ). 2  Proof: See Appendix A.1. The above facts are useful in establishing an eigenvalue lower bound on the Hessian of the log-likelihood function. Specifically, recall that Xn  ∇2 `(β) = ρ00 Xi> β Xi Xi> , (44) i=1 and the result is this: Lemma 4 (Likelihood Curvature Condition). Suppose that p/n < 1 and that ρ00 (·) ≥ 0. Then there exists a constant 0 such that whenever 0 ≤  ≤ 0 , with probability at least 1 − 2 exp (−nH ()) − 2 exp (−n/2), the matrix inequality !2 ! r r √ p H() 1 2 00 ∇ `(β)  inf −2 I (45) ρ (z) 1−− 3kβk n n 1− z:|z|≤ √ holds simultaneously for all β ∈ Rp .  Proof: See Appendix A.2. The message of Lemma 4 is this: take  > 0 to be a sufficiently small constant. Then 1 2 ∇ `(β)  ω(kβk) I n for some non-increasing and positive function ω(·) independent of n. This is a generalization of the strong convexity condition. 5 5.1 When is the MLE bounded? Phase transition In Section 2.2, we argued that the MLE is at infinity if we have less than two observations per dimension or κ > 1/2. In fact, a stronger version of the phase transition phenemonon occurs in the sense that kβ̂k = O(1) as soon as κ < 1/2. This is formalized in the following theorem. 17 Theorem 4 (Norm Bound Condition). Fix any small constant  > 0, and let β̂ be the MLE for a model with effective link satisfying the conditions from Section 2.3.3. (i) If p/n ≥ 1/2 + , then kβ̂k = ∞  with probability exceeding 1 − 4 exp −2 n/8 . (ii) There exist universal constants c1 , c2 , C2 > 0 such that if p/n < 1/2 − c1 3/4 , then5 kβ̂k < 4 log 2 2 with probability at least 1 − C2 exp(−c2 2 n). These conclusions clearly continue to hold if β̂ is replaced by β̃ (the MLE under the restricted model obtained on dropping the first predictor). The rest of this section is devoted to proving this theorem. As we will see later, the fact that kβ̂k = O(1) is crucial for utilizing the AMP machinery in the absence of strong convexity. 5.2 Proof of Theorem 4 As in Section 2.5.1, we assume ỹi ≡ 1 throughout this section, and hence the MLE reduces to Xn minimizeβ∈Rp `0 (β) := ρ(−Xi> β). i=1 5.2.1 (46) Proof of Part (i) Invoking [3, Theorem I] yields that if  δ ({Xβ | β ∈ Rp }) + δ Rn+ ≥ (1 + ) n, or equivalently, if p/n ≥ 1/2 + , then   P {Xβ | β ∈ Rp } ∩ Rn+ 6= {0} ≥ 1 − 4 exp −2 n/8 . As is seen in Section 2.2, kβ̂k = ∞ when {Xβ | β ∈ Rp } ∩ Rn+ 6= {0}, establishing Part (i) of Theorem 4. 5.2.2 Proof of Part (ii) We now turn to the regime in which p/n ≤ 1/2 − O(3/4 ), where 0 <  < 1 is any fixed constant. Begin by observing that the least singular value of X obeys √ (47) σmin (X) ≥ n/4 2  with probability at least 1 − 2 exp − 21 34 − √12 n (this follows from Lemma 3 using  = 0). Then for any β ∈ Rp obeying Xn  `0 (β) = ρ −Xj> β ≤ n log 2 = `0 (0) (48) j=1 and 5 When kβk ≥ 4 log 2 , 2 Xi ∼ N (0, Σ) for a general Σ  0, one has kΣ1/2 β̂k . 1/2 with high probability. 18 (49) we must have n X  max −Xj> β, 0 =  (a) −Xj> β ≤ X j: Xj> β<0 j=1 X  (b) ρ −Xj> β ≤ n log 2; j: Xj> β<0 (a) follows since t ≤ ρ(t) and (b) is a consequence of (48). Continuing, (47) and (49) give √ kXβk √ n log 2 ≤ 4 n log 2 ≤ 2 nkXβk. kβk This implies the following proposition: if the solution β̂—which necessarily satisfies `0 (β̂) ≤ `0 (0)—has 2 norm exceeding kβ̂k ≥ 4 log 2 , then X β̂ must fall within the cone n o Xn √ max {−uj , 0} ≤ 2 nkuk . A := u ∈ Rn (50) j=1 2 Therefore, if one wishes to rule out the possibility of having kβ̂k ≥ 4 log 2 , it suffices to show that with high probability, {Xβ | β ∈ Rp } ∩ A = {0} . (51) This is the content of the remaining proof. We would like to utilize tools from conic geometry [3] to analyze the probability of the event (51). Note, however, that A is not convex, while the theory developed in [3] applies only to convex cones. To bypass the non-convexity issue, we proceed in the following three steps:  1. Generate a set of N = exp 22 p closed convex cones {Bi | 1 ≤ i ≤ N } such that it forms a cover of A with probability exceeding 1 − exp −Ω(2 p) .  √ 3 √  2. Show that if p < 21 − 2 2 4 − 2H(2 ) n and if n is sufficiently large, then ( 1 P {{Xβ | β ∈ R } ∩ Bi = 6 {0}} ≤ 4 exp − 8 p  √ 3 √ p 1 − 2 2 4 − 10H(2 ) − 2 n 2 ) n for each 1 ≤ i ≤ N . 3. Invoke the union bound to reach P {{Xβ | β ∈ Rp } ∩ A 6= {0}} ≤ P {{Bi | 1 ≤ i ≤ N } does not form a cover of A} + N X P {{Xβ | β ∈ Rp } ∩ Bi 6= {0}} i=1  ≤ exp −Ω(2 p) , where we have used the fact that  2 ) √ √ 3 1 1 p P {{Xβ | β ∈ Rp } ∩ Bi 6= {0}} ≤ 4N exp − − 2 2 4 − 10H(2 ) − n 8 2 n i=1 ( ! )  2 √ 3 √ 1 1 p 2 < 4 exp − − 2 2 4 − 10H(2 ) − − 2 n 8 2 n  < 4 exp −2 n .  2 √ 3 √ Here, the last inequality holds if 21 − 2 2 4 − 10H(2 ) − np > 242 , or equivalently, np < 12 − √ 3 √ √ 2 2 4 − 10H(2 ) − 24. ( N X 19 √ √ 3 √ Taken collectively, these steps establish the following claim: if np < 12 − 2 2 4 − 10H(2 ) − 24, then    4 log 2 P kβ̂k > < exp −Ω(2 n) , 2  thus establishing Part (ii) of Theorem 4. We defer the complete details of the preceding steps to Appendix D. Asymptotic `2 error of the MLE 6 This section aims to establish Theorem 2, which characterizes precisely the asymptotic squared error of the MLE β̂ under the global null β = 0. As described in Section 2.5.1, it suffices to assume that β̂ is the solution to the following problem Xn minimizeβ∈Rp ρ(−Xi> β). (52) i=1 In what follows, we derive the asymptotic convergence of kβ̂k under the assumptions from our main theorem. Theorem 5. Under the assumptions of Theorem 1, the solution β̂ to (52) obeys lim kβ̂k2 =a.s. τ∗2 . n→∞ (53) Theorem 5 is derived by invoking the AMP machinery [6, 7, 32]. The high-level idea is the following: in order to study β̂, one introduces an iterative algorithm (called AMP) where a sequence of iterates β̂ t is formed at each time t. The algorithm is constructed so that the iterates asymptotically converge to the MLE in the sense that lim lim kβ̂ t − β̂k2 =a.s. 0. (54) t→∞ n→∞ On the other hand, the asymptotic behavior (asymptotic in n) of β̂ t for each t can be described accurately by a scalar sequence {τt }—called state evolution (SE)—following certain update equations [6]. This, in turn, provides a characterization of the `2 loss of β̂. Further, in order to prove Theorem 2, one still needs to justify (a) the existence of a solution to the system of equations (23) and (24), (b) and the existence of a fixed point for the iterative map governing the SE sequence updates. We will elaborate on these steps in the rest of this section. 6.1 State evolution We begin with the SE sequence {τt } introduced in [18]. Starting from some initial point τ0 , we produce two sequences {bt } and {τt } following a two-step procedure. • For t = 0, 1, . . .: – Set bt to be the solution in b to   κ = E Ψ0 (τt Z; b) ; (55) – Set τt+1 to be 2 τt+1 =  1  2 E (Ψ (τt Z; bt )) . κ 20 (56) 10.0 7.5 7.5 ν(τ2) ν(τ2) 10.0 5.0 2.5 0.0 0.0 5.0 2.5 2.5 5.0 τ2 0.0 7.5 (a) logistic regression 0 1 2 τ2 3 4 (b) probit regression Figure 7: The variance map for both the logistic and the probit models when κ = 0.3: (blue line) variance map V(τ 2 ) as a function of τ 2 ; (red line) diagonal. Suppose that for given any τ > 0, the solution in b to (55) with τt = τ exists and is unique, then one can denote the solution as b(τ ), which in turn allows one to write the sequence {τt } as 2 τt+1 = V(τt2 ) with the variance map  1  2 E Ψ (τ Z; b(τ )) . (57) κ As a result, if there exists a fixed point τ∗ obeying V(τ∗2 ) = τ∗2 and if we start with τ0 = τ∗ , then by induction, V(τ 2 ) = τt ≡ τ∗ and bt ≡ b∗ := b(τ∗ ), t = 0, 1, . . . Notably, (τ∗ , b∗ ) solves the system of equations (23) and (24). We shall work with this choice of initial condition throughout our proof. The preceding arguments hold under two conditions: (i) the solution to (24) exists and is unique for any τt > 0; (ii) the variance map (57) admits a fixed point. To verify these two conditions, we make two observations. • Condition (i) holds if one can show that the function G(b) := E [Ψ0 (τ Z; b)] , b>0 (58) is strictly monotone for any given τ > 0, and that limb→0 G(b) < κ < limb→∞ G(b). • Since V(·) is a continuous function, Condition (ii) becomes self-evident once we show that V(0) > 0 and that there exists τ > 0 obeying V(τ 2 ) < τ 2 . The behavior of the variance map is illustrated in Figure 7 for the logistic and probit regression when κ = 0.3. One can in fact observe that the fixed point is unique. For other values of κ, the variance map shows the same behavior. In fact, the aforementioned properties can be proved for a certain class of effective links, as summarized in the following lemmas. In particular, they can be shown for the logistic and the probit models. 21 Lemma 5. Suppose the effective link ρ satisfies the following two properties: (a) ρ0 is log-concave. (b) For any fixed τ > 0 and any fixed z, bρ00 (proxbρ (τ z)) → ∞ when b → ∞. Then for any τ > 0, the function G(b) defined in (58) is an increasing function in b (b > 0), and the equation G(b) = κ has a unique positive solution.  Proof: See Appendix B. Lemma 6. Suppose that 0 < κ < 1/2 and that ρ = log(1 + et ) or ρ = − log Φ(−t). Then (i) V(0) > 0; (ii) V(τ 2 ) < τ 2 for some sufficiently large τ 2 .  Proof: See Appendix C and the supplemental material [47]. Remark 1. A byproduct of the proof is that the following relations hold for any constant 0 < κ < 1/2: • In the logistic case,  2  limτ →∞ V (τ2 ) τ  lim τ →∞ b(τ ) τ = x2 P{Z>x}+E[Z 2 1{0<Z<x} ] P{0<Z<x} ; x=Φ−1 (κ+0.5) = Φ−1 (κ + 0.5). • In the probit case, lim b(τ ) = τ →∞ 2κ 1 − 2κ and V(τ 2 ) = 2κ. τ →∞ τ 2 lim (59) Remark 2. Lemma 6 is proved for the two special effective link functions, the logistic and the probit cases. However, the proof sheds light on general conditions on the effective link that suffice for the lemma to hold. Such general sufficient conditions are also discussed in the supplemental material [47]. 6.2 AMP recursion In this section, we construct the AMP trajectory tracked by two sequences {β̂ t (n) ∈ Rp } and {η t (n) ∈ Rn } for t ≥ 0. Going forward we suppress the dependence on n to simplify presentation. Picking β̂ 0 such that lim kβ̂ 0 k2 = τ02 = τ∗2 n→∞ and taking η −1 = 0 and b−1 = 0, the AMP path is obtained via Algorithm 1, which is adapted from the algorithm in [18, Section 2.2]. 22 Algorithm 1 Approximate message passing. For t = 0, 1, · · · : 1. Set  η t = X β̂ t + Ψ η t−1 ; bt−1 ; (60) κ = E [Ψ0 (τt Z; b)] , (61) 2. Let bt be the solution to where τt is the SE sequence value at that time. 3. Set  1 β̂ t+1 = β̂ t − X > Ψ η t ; bt . p (62) Here, Ψ(·) is applied in an entrywise manner, and Ψ0 (., .) denotes derivative w.r.t the first variable. As asserted by [18], the SE sequence {τt } introduced in Section 6.1 proves useful as it offers a formal procedure for predicting operating characteristics of the AMP iterates at any fixed iteration. In particular it assigns predictions to two types of observables: observables which are functions of the β̂ t sequence and those which are functions of η t . Repeating identical argument as in [18, Theorem 3.4], we obtain lim kβ̂ t k2 =a.s. τt2 ≡ τ∗2 , n→∞ 6.3 t = 0, 1, . . . . (63) AMP converges to the MLE We are now in position to show that the AMP iterates {β̂ t } converge to the MLE in the large n and t limit. Before continuing, we state below two properties that are satisfied under our assumptions. • The MLE β̂ obeys lim kβ̂k < ∞ n→∞ (64) almost surely. • And there exists some non-increasing continuous function 0 < ω (·) < 1 independent of n such that   1 2 P ∇ ` (β)  ω (kβk) · I, ∀β ≥ 1 − c1 e−c2 n . (65) n In fact, the norm bound (64) follows from Theorem 4 together with Borel-Cantelli, while the likelihood curvature condition (65) is an immediate consequence of Lemma 4. With this in place, we have: Theorem 6. Suppose (64) and (65) hold. Let (τ∗ , b∗ ) be a solution to the system (23) and (24), and assume that limn→∞ kβ̂ 0 k2 = τ∗2 . Then the AMP trajectory as defined in Algorithm 1 obeys lim lim kβ̂ t − β̂k =a.s. 0. t→∞ n→∞ Taken collectively, Theorem 6 and Eqn. (63) imply that lim kβ̂k =a.s. lim lim kβ̂ t k =a.s. τ∗ , n→∞ t→∞ n→∞ thus establishing Theorem 5. In addition, an upshot of these theorems is a uniqueness result: Corollary 2. The solution to the system of equations (23) and (24) is unique. 23 (66) Proof: When the AMP trajectory β̂ t is started with the initial condition from Theorem 6, limn→∞ kβ̂k2 =a.s. τ∗2 . This holds for any τ∗ such that (τ∗ , b∗ ) is a solution to (23) and (24). However, since the MLE problem is strongly convex and hence admits a unique solution β̂, this implies that τ∗ must be unique, which together with the monotonicity of G(·) (cf. (58)) implies that b∗ is unique as well.  Proof of Theorem 6: To begin with, repeating the arguments in [18, Lemma 6.9] we reach lim lim kβ̂ t+1 − β̂ t k2 =a.s. 0; t→∞ n→∞ (67) 1 t+1 kη − η t k2 =a.s. 0. (68) n To show that the AMP iterates converge to the MLE, we shall analyze the log-likelihood function. Recall from Taylor’s theorem that >    E 1 D β̂ − β̂ t ∇2 ` β̂ t + λ(β̂ − β̂ t ) β̂ − β̂ t `(β̂) = `(β̂ t ) + ∇`(β̂ t ), β̂ − β̂ t + 2 holds for some 0 < λ < 1. To deal with the quadratic term, we would like to control the Hessian of the likelihood at a point between β̂ and β̂ t . Invoking the likelihood curvature condition (65), one has D E 1  n o `(β̂ t ) ≥ `(β̂) ≥ `(β̂ t ) + ∇`(β̂ t ), β̂ − β̂ t + nω max kβ̂k, kβ̂ t k kβ̂ − β̂ t k2 (69) 2 with high probability. Apply Cauchy-Schwarz to yield that with exponentially high probability, lim lim t→∞ n→∞ kβ̂ − β̂ t k ≤ 1 1 2 2 n o ∇`(β̂ t ) ≤ ∇`(β̂ t ) ,   t n n t ω kβ̂k ω kβ̂ k ω max kβ̂k, kβ̂ k where the last inequality follows since 0 < ω(·) < 1 and ω(·) is non-decreasing. It remains to control k∇`(β̂ t )k. The identity Ψ(z; b∗ ) = z − proxb∗ ρ (z) and (60) give  proxb∗ ρ η t−1 = X β̂ t + η t−1 − η t . (70) 0 In addition, substituting Ψ (z; b) = bρ (proxρb (z)) into (62) yields    p t (β̂ − β̂ t−1 ) = −X > ρ0 proxb∗ ρ (η t−1 ) = −X > ρ0 X β̂ t + η t−1 − η t . b∗ We are now ready to bound k∇`(β̂ t )k. Recalling that      ∇`(β̂ t ) = X > ρ0 (X > β̂ t ) = X > ρ0 X β̂ t + η t−1 − η t + X > ρ0 (X > β̂ t ) − ρ0 X β̂ t + η t−1 − η t and that supz ρ00 (z) < ∞, we have     ∇`(β̂ t ) ≤ −X > ρ0 X β̂ t + η t−1 − η t + kXk ρ0 X β̂ t + η t−1 − η t − ρ0 (X β̂ t )   p t t−1 00 kβ̂ − β̂ k + kXk sup ρ (z) kη t−1 − η t k. ≤ b∗ z This establishes that with probability at least 1 − c1 e−c2 n ,     2 p 1    kβ̂ − β̂ t k ≤  kβ̂ t − β̂ t−1 k + sup ρ00 (z) kXkkη t−1 − η t k . (71) b∗ n n z ω kβ̂k ω kβ̂ t k √ Using (42) together with Borel-Cantelli yields limn→∞ kXk/ n < ∞ almost surely. Further, it follows from (63) that limn→∞ kβ̂ t k is finite almost surely as τ∗ < ∞. These taken together with (64), (67) and (68) yield lim lim kβ̂ − β̂ t k =a.s. 0 (72) t→∞ n→∞  as claimed. 24 7 Likelihood ratio analysis This section presents the analytical details for Section 2.5.2, which relates the log-likelihood ratio statistic Λi with β̂i . Recall from (35) that the LLR statistic for testing β1 = 0 vs. β1 6= 0 is given by n Λ1 = >  3   1X 1 X̃ β̃ − X β̂ Dβ̂ X̃ β̃ − X β̂ + ρ000 (γi ) X̃i> β̃ − Xi> β̂ , 2 6 i=1 where    ρ00 X1> β̂ (73)    Dβ̂ :=   .. .  ρ00 Xn> β̂      (74) and γi lies between Xi> β̂ and X̃i> β̃. The asymptotic distribution of Λ1 claimed in Theorem 3 immediately follows from the result below, whose proof is the subject of the rest of this section. Theorem 7. Let (τ∗ , b∗ ) be the unique solution to the system of equations (23) and (24), and define G̃ = 1 > X̃ Dβ̃ X̃ n and α̃ = 1 Tr(G̃−1 ). n (75) Suppose p/n → κ ∈ (0, 1/2) . Then (a) the log-likelihood ratio statistic obeys P 2Λ1 − pβ̂12 /α̃ → 0; (76) (b) and the scalar α̃ converges, P α̃ → b∗ . 7.1 (77) More notations and preliminaries Before proceeding, we introduce some notations that will be used throughout. For any matrix X, denote by Xij and X·j its (i, j)-th entry and jth column, respectively. We denote an analogue r = {ri }1≤i≤n (resp. r̃ = {r̃i }1≤i≤n ) of residuals in the full (resp. reduced) model by   ri := −ρ0 Xi> β̂ and r̃i := −ρ0 X̃i> β̃ . (78) As in (74), set   Dβ̃ :=  ρ00 X̃1> β̃  .. . ρ00 X̃n> β̃      and Dβ̂,b̃ :=  ρ00 (γ1∗ )   .. . ρ 00 (γn∗ ),  , (79) where γi∗ is between Xi> β̂ and Xi> b̃, and b̃ is to be defined later in Section 7.2. Further, as in (75), introduce the Gram matrices G := 1 > X Dβ̂ X n and Gβ̂,b̃ = 1 > X Dβ̂,b̃ X. n (80) Let G̃(i) denote the version of G̃ without the term corresponding to the ith observation, that is, G̃(i) = 1X ρ00 (X̃j> β̃)X̃j X̃j> . j:j6=i n 25 (81) Additionally, let β̂[−i] be the MLE when the ith observation is dropped and let G[−i] be the corresponding Gram matrix, G[−i] = 1X ρ00 (Xj> β̂[−i] )Xj Xj> . j:j6=i n (82) Further, let β̃[−i] be the MLE when the first predictor and ith observation are removed, i.e. X β̃[−i] := arg min ρ(X̃j> β). β∈Rp−1 j:j6=i Below G̃[−i] is the corresponding version of G̃, G̃[−i] = 1X ρ00 (X̃j> β̃[−i] )X̃j X̃j> . j:j6=i n (83) For these different versions of G, their least eigenvalues are all bounded away from 0, as asserted by the following lemma. Lemma 7. There exist some absolute constants λlb , C, c > 0 such that P(λmin (G) > λlb ) ≥ 1 − Ce−cn . Moreover, the same result holds for G̃, Gβ̂,b̃ , G̃(i) , G[−i] and G̃[−i] for all i ∈ [n]. Proof: This result follows directly from Lemma 2, Lemma 4, and Theorem 4.  Throughout the rest of this section, we restrict ourselves (for any given n) to the following event: An := {λmin (G̃) > λlb } ∩ {λmin (G) > λlb } ∩ {λmin (Gβ̂,b̃ ) > λlb } ∩ {∩ni=1 λmin (G̃(i) ) > λlb } ∩ {∩ni=1 λmin (G̃[−i] ) > λlb } ∩ {∩ni=1 λmin (G[−i] ) > λlb }. (84) By Lemma 7, An arises with exponentially high probability, i.e. P(An ) ≥ 1 − exp(−Ω(n)). 7.2 (85) A surrogate for the MLE In view  of (73), the main step in controlling Λ1 consists of characterizing the differences X β̂ − X̃ β̃ or 0 β̂ − . Since the definition of β̂ is implicit and not amenable to direct analysis, we approximate β̂ by β̃ a more amenable surrogate b̃, an idea introduced in [19–21]. We collect some properties of the surrogate which will prove valuable in the subsequent analysis. To begin with, our surrogate is     0 1 b̃ = + b̃1 , (86) −G̃−1 w β̃ where G̃ is defined in (80), w := 1 Xn 1 ρ00 (X̃i> β̃)Xi1 X̃i = X̃ > Dβ̃ X·1 , i=1 n n and b̃1 is a scalar to be specified later. This vector is constructed in the hope that ( β̂1 ≈ b̃1 , β̂ ≈ b̃, or equivalently, β̂2:p − β̃ ≈ −b̃1 G̃−1 w, 26 (87) (88) where β̂2:p contains the 2nd through pth components of β̂. Before specifying b̃1 , we shall first shed some insights into the remaining terms in b̃. By definition, " #     > > > X D X X D X̃ X·1 Dβ̃ X·1 nw> 0 ·1 ·1 ·1 2 > β̃ β̃ ∇ ` = X Dβ̃ X = . = β̃ X̃ > Dβ̃ X·1 X̃ > Dβ̃ X̃ nw nG̃ Employing the first-order approximation of ∇`(·) gives        0 0 0 ∇2 ` β̂ − ≈ ∇`(β̂) − ∇` . β̃ β̃ β̃ (89)   0 are β̂ also very close to each other. Therefore, taking the 2nd through pth components of (89) and approximating them by zero give   h i 0 w, G̃ β̂ − ≈ 0. β̃ Suppose β̂2:p is well approximated by β̃. Then all but the first coordinates of ∇`(β̃) and ∇` This together with a little algebra yields β̂2:p − β̃ ≈ −β̂1 G̃−1 w ≈ −b̃1 G̃−1 w, which coincides with (88). In fact, for all but the 1st entries, b̃ is constructed by moving β̃ one-step in the direction which takes it closest to β̂. Next, we come to discussing the scalar b̃1 . Introduce the projection matrix H := I − and define b̃1 as b̃1 := 1 1/2 1/2 D X̃ G̃−1 X̃ > Dβ̃ , n β̃ > X·1 r̃ , 1/2 1/2 > X·1 Dβ̃ HDβ̃ X·1 (90) (91) where r̃ comes from (78). In fact, the expression b̃1 is obtained through similar (but slightly more complicated) first-order approximation as for b̃2:p , in order to make sure that b1 ≈ β̂1 ; see [21, Pages 14560-14561] for a detailed description. We now formally justify that the surrogate b̃ and the MLE β̂ are close to each other. Theorem 8. The MLE β̂ and the surrote b̃ (86) obey kβ̂ − b̃k . n−1+o(1) , (92) |b̃1 | . n−1/2+o(1) , (93) sup |Xi> b̃ − X̃i> β̃| . n−1/2+o(1) (94) and 1≤i≤n with probability tending to one as n → ∞.  Proof: See Section 7.4. The global accuracy (92) immediately leads to a coordinate-wise approximation result between β̂1 and b̃1 . 27 Corollary 3. With probability tending to one as n → ∞, √ n|b̃1 − β̂1 | . n−1/2+o(1) . (95) Another consequence from Theorem 8 is that the value Xi> β̂ in the full model and its counterpart X̃i> β̃ in the reduced model are uniformly close. Corollary 4. The values Xi> β̂ and X̃i> β̃ are uniformly close in the sense that sup Xi> β̂ − X̃i> β̃ . n−1/2+o(1) (96) 1≤i≤n holds with probability approaching one as n → ∞. Proof: Note that sup Xi> β̂ − X̃i> β̃ ≤ 1≤i≤n sup Xi> (β̂ − b̃) + sup Xi> b̃ − X̃i> β̃ . 1≤i≤n 1≤i≤n The second term in the right-hans side is upper bounded by n−1/2+o(1) with probability 1 − o(1) according to Theorem 8. Invoking Lemma 2 and Theorem 8 and applying Cauchy-Schwarz inequality yield that the first term is O(n−1/2+o(1) ) with probability 1 − o(1). This establishes the claim.  7.3 Analysis of the likelihood-ratio statistic We are now positioned to use our surrogate b̃ to analyze the likelihood-ratio statistic. In this subsection we establish Theorem 7(a). The proof for Theorem 7(b) is deferred to Appendix I. Recall from (35) that n 2Λ1 = (X̃ β̃ − X β̂)> Dβ̂ (X̃ β̃ − X β̂) + 1 X 000 ρ (γi )(X̃i> β̃ − Xi> β̂)3 . 3 i=1 {z } | :=I3 000 To begin with, Corollary 4 together with the assumption supz ρ (z) < ∞ implies that I3 . n−1/2+o(1) with probability 1 − o(1). Hence, I3 converges to zero in probability. Reorganize the quadratic term as follows:  2 X (X̃ β̃ − X β̂)> Dβ̂ (X̃ β̃ − X β̂) = ρ00 (Xi> β̂) Xi> β̂ − X̃i> β̃ i = X = X h i2 ρ00 (Xi> β̂) Xi> (β̂ − b̃) + (Xi> b̃ − X̃i> β̃) i ρ00 (Xi> β̂)(Xi> (β̂ − b̃))2 + 2 X ρ00 (Xi> β̂)Xi> (β̂ − b̃)(Xi> b̃ − X̃i> β̃) i i + X ρ 00 (Xi> β̂) Xi> b̃ 2 − X̃i> β̃ . (97) i We control each of the three terms in the right-hand side of (97). • Since supz ρ00 (z) < ∞, the first term in (97) is bounded by X X ρ00 (Xi> β̂)(Xi> (β̂ − b̃))2 . ||β̃ − b̃||2 Xi Xi> i i with probability 1 − o(1), by an application of Theorem 8 and Lemma 2. 28 . n−1+o(1) • From the definition of b̃, the second term can be upper bounded by   p X X 1 ≤ |b̃1 | · kβ̂ − b̃k · Xi Xi> · 1 + w> G̃−2 w 2 ρ00 (Xi> β̂)(β̂ − b̃)> Xi Xi> b̃1 −1 i −G̃ w i 1 . n− 2 +o(1) with probability 1 − o(1), where the last line follows from a combination of Theorem 8, Lemma 2 and the following lemma. Lemma 8. Let G̃ and w be as defined in (80) and (87), respectively. Then   P w> G̃−2 w . 1 ≥ 1 − exp(−Ω(n)). (98)  Proof: See Appendix E. • The third term in (97) can be decomposed as X ρ00 (Xi> β̂)(Xi> b̃ − X̃i> β̃))2 i = X = X  X ρ00 (Xi> β̂) − ρ00 (X̃i> β̃) (Xi> b̃ − X̃i> β̃))2 + ρ00 (X̃i> β̃)(Xi> b̃ − X̃i> β̃)2 i i  ρ000 (γ̃i )(Xi> β̂ − X̃i> β̃) Xi> b̃ − X̃i> β̃ i 2 + X  2 ρ00 (X̃i> β̃) Xi> b̃ − X̃i> β̃ (99) i for some γ̃i between Xi> β̂ and X̃i> β̃. From Theorem 8 and Corollary 4, the first term in (99) is O(n−1/2+o(1) ) with probability 1 − o(1). Hence, the only remaining term is the second. In summary, we have 2Λ1 − X  2 P → 0, ρ00 (X̃i> β̃) Xi> b̃ − X̃i> β̃ (100) i | {z =v > X > Dβ̃ Xv }  where v := b̃1  1 according to (86). On simplification, the quadratic form reduces to −G̃−1 w  >   v > X > Dβ̃ Xv = b̃21 X·1 − X̃ G̃−1 w Dβ̃ X·1 − X̃ G̃−1 w   > > = b̃21 X·1 Dβ̃ X·1 − 2X·1 Dβ̃ X̃ G̃−1 w + w> G̃−1 X̃ > Dβ̃ X̃ G̃−1 w   > = b̃21 X·1 Dβ̃ X·1 − nw> G̃−1 w ! 1/2 > 1/2 2 1 = nb̃1 X·1 Dβ̃ HDβ̃ X·1 , |n {z } :=ξ recalling the definitions (80), (87), and (90). Hence, the log-likelihood ratio 2Λ1 simplifies to nb̃21 ξ + oP (1) on An . Finally, rewrite v > X > Dβ̃ Xv as n(b̃21 − β̂12 )ξ + nβ̂12 ξ. To analyze the first term, note that 1 n|b̃21 − β̂12 | = n|b̃1 − β̂1 | · |b̃1 + β̂1 | ≤ n|b̃1 − βˆ1 |2 + 2n|b̃1 | · |b̃1 − β̂1 | . n− 2 +o(1) 29 (101) with probability 1 − o(1) in view of Theorem 8 and Corollary 3. It remains to analyze ξ. Recognize that X·1 1/2 1/2 is independent of Dβ̃ HDβ̃ . Applying the Hanson-Wright inequality [27, 44] and the Sherman-MorrisonWoodbury formula (e.g. [26]) leads to the following lemma: Lemma 9. Let α̃ = 1 −1 ), n Tr(G̃ where G̃ = 1 > n X̃ Dβ̃ X̃. Then one has 1 > 1/2 p−1 1/2 − α̃ X·1 Dβ̃ HDβ̃ X·1 . n−1/2+o(1) n n (102) with probability approaching one as n → ∞.  Proof: See Appendix F. In addition, if one can show that α̃ is bounded away from zero with probability 1 − o(1), then it is seen from Lemma 9 that p P ξ− → 0. (103) nα̃ To justify the above claim, we observe that since ρ00 is bounded, λmax (G̃) . λmax (X̃ > X̃)/n . 1 with exponentially high probability (Lemma 2). This yields α̃ = Tr(G̃−1 )/n & p/n with probability 1 − o(1). On the other hand, on An one has α̃ ≤ p/(nλmin (G̃)) . p/n. Hence, it follows that ξ = Ω(1) with probability 1 − o(1). Putting this together with (101) gives the approximation v > X > Dβ̃ Xv = nβ̂12 ξ + o(1). (104) Taken collectively (100), (103) and (104) yields the desired result P 2Λ1 − pβ̂12 /α̃ → 0. 7.4 Proof of Theorem 8 This subsection outlines the main steps for the proof of Theorem 8. To begin with, we shall express the difference β̂ − b̃ in terms of the gradient of the negative log-likelihood function. Note that ∇`(β̂) = 0, and hence Xn ∇`(b̃) = ∇`(b̃) − ∇`(β̂) = Xi [ρ0 (Xi> b̃) − ρ0 (Xi0 β̂)] i=1 Xn = ρ00 (γi∗ )Xi Xi> (b̃ − β̂), i=1 where γi∗ is between Xi> β̂ and Xi> b̃. Recalling the notation introduced in (80), this can be rearranged as b̃ − β̂ = 1 −1 G ∇`(b̃). n β̂,b̃ Hence, on An , this yields kβ̂ − b̃k ≤ k∇`(b̃)k . λlb n   0 The next step involves expressing ∇`(b̃) in terms of the difference b̃ − . β̃ 30 (105) Lemma 10. On the event An (84), the negative log-likelihood evaluated at the surrogate b̃ obeys    n X  00 ∗  0 00 > > ∇`(b̃) = ρ (γi ) − ρ (X̃i β̃) Xi Xi b̃ − , β̃ i=1 where γi∗ is some quantity between Xi> b̃ and X̃i> β̃. Proof: The proof follows exactly the same argument as in the proof of [20, Proposition 3.11], and is thus omitted.    0 The point of expressing ∇`(b̃) in this way is that the difference b̃ − is known explicitly from the β̃ definition of b̃. Invoking Lemma 10 and the definition (86) allows one to further upper bound (105) as kβ̂ − b̃k . 1 ∇`(b̃) n . sup ρ00 (γi∗ ) − ρ00 (X̃i> β̃) i . sup Xi> b̃ − X̃i> β̃ |ρ000 |∞ i   n 1X 0 Xi Xi> b̃ − β̃ n i=1 p 1 Xn Xi Xi> · |b̃1 | 1 + w> G̃−2 w i=1 n . |b̃1 | sup Xi> b̃ − X̃i> β̃ (106) i with probability at least 1 − exp(−Ω(n)). The last inequality here comes from our assumption that supz |ρ000 (z)| < ∞ together with Lemmas 2 and 8. In order to bound (106), we first make use of the definition of b̃ to reach sup Xi> b̃ − X̃i> β̃ = |b̃1 | sup |Xi1 − X̃i> G̃−1 w|. i (107) i The following lemma provides an upper bound on supi |Xi1 − X̃i> G̃−1 w|. Lemma 11. With G̃ and w as defined in (80) and (87),   > −1 o(1) P sup Xi1 − X̃i G̃ w ≤ n ≥ 1 − o(1). (108) 1≤i≤n  Proof: See Appendix G. In view of Lemma 11, the second term in the right-hand side of (107) is bounded above by no(1) with high probability. Thus, in both the bounds (106) and (107), it only remains to analyze the term b̃1 . To this end, we control the numerator and the denominator of b̃1 separately. > • Recall from the definition (91) that the numerator of b̃1 is given by X·1 r̃ and that r̃ is independent > of X·1 . Thus, conditional on X̃, the quantity X·1 r̃ is distributed as a Gaussian with mean zero and variance Xn 2 σ2 = ρ0 (X̃i> β̃) . i=1 0 Since |ρ (x)| = O(|x|), the variance is bounded by Xn  σ 2 . β̃ > X̃i X̃i> β̃ . nkβ̃k2 . n i=1 (109) with probability at least 1 − exp(−Ω(n))), a consequence from Theorem 4 and Lemma 2. Therefore, with probability 1 − o(1), we have 1 > √ X·1 r̃ . no(1) . (110) n 31 • We now move on to the denominator of b̃1 in (91). In the discussion following Lemma 9 we showed 1/2 1 > 1/2 n X·1 Dβ̃ HDβ̃ X·1 = Ω(1) with probability 1 − o(1). Putting the above bounds together, we conclude   1 P |b̃1 | . n− 2 +o(1) = 1 − o(1). (111) Substitution into (106) and (107) yields kβ̂ − b̃k . n−1+o(1) and sup Xi> b̃ − X̃i> β̃ . n−1/2+o(1) i with probability 1 − o(1) as claimed. 8 Discussion In this paper, we derived the high-dimensional asymptotic distribution of the LLR under our modelling assumptions. In particular, we showed that the LLR is inflated vis a vis the classical Wilks’ approximation and that this inflation grows as the dimensionality κ increases. This inflation is typical of high-dimensional problems, and one immediate practical consequence is that it explains why classically computed p-values are completely off since they tend to be far too small under the null hypothesis. In contrast, we have shown in our simulations that our new limiting distribution yields reasonably accurate p-values in finite samples. Having said this, our work raises a few important questions that we have not answered and we conclude this paper with a couple of them. • We expect that our results continue to hold when the covariates are not normally distributed, see Section 3 for some numerical evidence in this direction. To be more precise, we expect the same limiting distribution to hold when the variables are simply sub-Gaussian. If this were true, then this would imply that our rescaled chi-square has a form of universal validity. • The major limitation of our work is arguably the fact that our limiting distribution holds under the global null; that is, under the assumption that all the regression coefficients vanish. It is unclear to us how the distribution would change in the case where the coefficients are not all zero. In particular, would the limiting distribution depend upon the unknown values of these coefficients? Are there assumptions under which it would not? Suppose for instance that we model the regression coefficients as i.i.d. samples from the mixture model (1 − )δ0 + Π? , where 0 <  < 1 is a mixture parameter, δ0 is a point mass at zero and Π? is a distribution with vanishing mass at zero. Then what would we need to know about  and Π? to compute the asymptotic distribution of the LLR under the null? Acknowledgements E. C. was partially supported by the Office of Naval Research under grant N00014-16-1-2712, and by the Math + X Award from the Simons Foundation. Y. C. and P. S. are grateful to Andrea Montanari for his help in understanding AMP and [18]. Y. C. thanks Kaizheng Wang and Cong Ma for helpful discussion about [20], and P. S. thanks Subhabrata Sen for several helpful discussions regarding this project. E. C. would like to thank Iain Johnstone for a helpful discussion as well. 32 A A.1 Proofs for Eigenvalue Bounds Proof of Lemma 3 p √ Fix  ≥ 0 sufficiently small. For any given S ⊆ [n] obeying |S| = (1 − )n and 0 ≤ t ≤ 1 −  − p/n it follows from [51, Corollary 5.35] that ! r 2  √ √ 2 1 p p 1X √ > λmin < Xi Xi |S| − p − t n = 1−− −t n n n i∈S    2  2 n . Taking the union bound over all possible holds with probability at most 2 exp − t 2|S| = 2 exp − (1−)t 2 subsets S of size (1 − )n gives ( 1 λmin n P ∃S ⊆ [n] with |S| = (1 − )n s.t. ! X Xi Xi> <  √ r 1−− i∈S p −t n 2 )    n (1 − ) t2 n 2 exp − (1 − )n 2   2 (1 − ) t n , ≤ 2 exp nH () − 2  ≤ where the last line is a consequence of the inequality A.2 n (1−)n  ≤ enH() [16, Example 11.1.3]. Proof of Lemma 4 Define  SB (β) := i : |Xi> β| ≤ Bkβk for any B > 0 and any β. Then n X  ρ00 Xi> β Xi Xi> X  i=1  ρ00 Xi> β Xi Xi>  i∈SB (β) inf z:|z|≤Bkβk ρ00 (z) X Xi Xi> . i∈SB (β) If one also has |SB (β) | ≥ (1 − )n (for  ≥ 0 sufficiently small), then this together with Lemma 3 implies that r  2 n √  1 X 00 p ρ Xi> β Xi Xi>  inf ρ00 (z) 1−− −t I n i=1 n z:|z|≤Bkβk     2 with probability at least 1 − 2 exp − (1−)t − H () n . 2 Thus if we can ensure that with high probability, |SB (β) | ≥ (1 − )n holds simultaneously for all β, then we are done. From Lemma 2 we see that n1 X > X ≤ 9 with probability exceeding 1 − 2 exp (−n/2). On this event, 2 kXβk ≤ 9nkβk2 , ∀β. (112) On the other hand, the definition of SB (β) gives 2 kXβk ≥ X 2 Xi> β i∈S / B (β)   |SB (β)| B 2 kβk2 . ≥ n − |SB (β)| (Bkβk) = n 1 − n 2  Taken together, (112) and (113) yield  |SB (β)| ≥ 1− 9 B2 33  n, ∀β (113) with probability at least 1−2 exp(−n/2). Therefore, with probability 1−2 exp(−n/2), S3/√ (β) ≥ (1 − ) n q holds simultaneously for all β. Putting the above results together and setting t = 2 H() 1− give n X ρ 00 Xi> β  Xi Xi>  00 ρ (z) inf z:|z|≤ i=1 √ r 1−− 3kβk √  !2 r p H() −2 I n 1− simultaneously for all β with probability at least 1 − 2 exp (−nH ()) − 2 exp (−n/2). B Proof of Lemma 5 Applying an integration by parts leads to Z ∞ 1 E [Ψ0 (τ Z; b)] = Ψ0 (τ z; b)φ(z)dz = Ψ(τ z; b)φ(z) τ −∞ Z 1 ∞ Ψ(τ z; b)φ0 (z)dz = − τ −∞ with φ(z) = √1 2π ∞ −∞ − 1 τ Z ∞ Ψ(τ z; b)φ0 (z)dz −∞ exp(−z 2 /2). This reveals that 0 G (b) = =  Z Z ρ0 proxbρ (τ z) 1 ∞ ∂Ψ(τ z; b) 0 1 ∞  φ0 (z)dz − φ (z)dz = − τ −∞ ∂b τ −∞ 1 + bρ00 proxbρ (τ z)   ! Z ρ0 proxbρ (−τ z) ρ0 proxbρ (τ z) 1 ∞ −  φ0 (z)dz, τ 0 1 + xρ00 proxbρ (−τ z) 1 + xρ00 proxbρ (τ z) (114) where the second identity comes from [18, Proposition 6.4], and the last identity holds since φ0 (z) = −φ0 (−z). Next, we claim that (a) The function h (z) := ρ0 (z) 1+bρ00 (z) is increasing in z; (b) proxbρ (z) is increasing in z. These two claims imply that ρ0 proxbρ (−τ z)  1 + bρ00 proxbρ (−τ z) −  ρ0 proxbρ (τ z)  < 0, 1 + bρ00 proxbρ (τ z) ∀z > 0, which combined with the fact φ0 (z) < 0 for z > 0 reveals sign ρ0 proxbρ (−τ z)   ρ0 proxbρ (τ z) −  1 + bρ00 proxbρ (−τ z) 1 + bρ00 proxbρ (τ z) ! ! 0 φ (z) = 1, ∀z > 0. In other words, the integrand in (114) is positive, which allows one to conclude that G0 (b) > 0. We then move on to justify (a) and (b). For the first, the derivative of h is given by h0 (z) = ρ00 (z) + b(ρ00 (z))2 − bρ0 (z)ρ000 (z) 2 (1 + bρ00 (z)) . Since ρ0 is log concave, this directly yields (ρ00 )2 −ρ0 ρ000 > 0. As ρ00 > 0 and b ≥ 0, the above implies h0 (z) > 0 ∂proxbρ (z) for all z. The second claim follows from ≥ 1+bkρ1 00 k∞ > 0 (cf. [18, Equation (56)]). ∂z 34 It remains to analyze the behavior of G in the limits when b → 0 and b → ∞. From [18, Proposition 6.4], G(b) can also be expressed as   1 G(b) = 1 − E . 1 + bρ00 (proxbρ (τ Z)) Since ρ00 is bounded and the integrand is at most 1, the dominated convergence theorem gives lim G(b) = 0. b→0 When b → ∞, bρ00 (proxbρ (τ z)) → ∞ for a fixed z. Again by applying the dominated convergence theorem, lim G(b) = 1. b→∞ It follows that limb→0 G(b) < κ < limb→∞ G(b) and, therefore, G(b) = κ has a unique positive solution. Remark 3. Finally, we show that the logistic and the probit effective links obey the assumptions of Lemma 5. We work with a fixed τ > 0. • A direct computation shows that ρ0 is log-concave for the logistic model. For the probit, it is well-known that the reciprocal of the hazard function (also known as Mills’ ratio) is strictly log-convex [4]. • To check the other condition, recall that the proximal mapping operator satisfies bρ0 (proxbρ (τ z)) + proxbρ (τ z) = τ z. (115) For a fixed z, we claim that if b → ∞, proxbρ (τ z) → −∞. To prove this claim, we start by assuming that this is not true. Then either proxbρ (τ z) is bounded or diverges to ∞. If it is bounded, the LHS above diverges to ∞ while the RHS is fixed, which is a contradiction. Similarly if proxbρ (τ z) diverges to ∞, the left-hand side of (115) diverges to ∞ while the right-hand side is fixed, which cannot be true as well. Further, when b → ∞, we must have proxbρ (τ z) → −∞, bρ0 (proxbρ (τ z)) → ∞, such that the difference of these two is τ z. Observe that for the logistic, ρ00 (x) = ρ0 (x)(1 − ρ0 (x)) and for the probit, ρ00 (x) = ρ0 (x)(ρ0 (x) − x) [45]. Hence, combining the asymptotic behavior of proxbρ (τ z) and bρ0 (proxbρ (τ z)), we obtain that bρ00 (proxbρ (τ z)) diverges to ∞ in both models when b → ∞. C C.1 Proof of Lemma 6 Proof of Part (i) Recall from [18, Proposition 6.4] that " # 1  . κ = E [Ψ (τ Z; b(τ ))] = 1 − E 1 + b(τ )ρ00 proxb(τ )ρ (τ Z) 0 If we denote c := proxbρ (0), then b(0) is given by the following relation: 1−κ= 1 1 + b(0)ρ00 (c) =⇒ b(0) = κ >0 ρ00 (c)(1 − κ) as ρ00 (c) > 0 for any given c > 0. In addition, since ρ0 (c) > 0, we have V(0) = Ψ(0, b(0))2 (a) b(0)2 ρ0 (c)2 = > 0, κ κ where (a) comes from (20). 35 (116) C.2 Proof of Part (ii) We defer the proof of this part to the supplemental materials [47]. D Proof of Part (ii) of Theorem 4 As discussed in Section 5.2.2, it suffices to (1) construct a set {Bi | 1 ≤ i ≤ N } that forms a cover of the cone A defined in (50), and (2) upper bound P {{Xβ | β ∈ Rp } ∩ Bi 6= {0}}. In what follows, we elaborate on these two steps.  • Step 1. Generate N = exp 22 p i.i.d. points z (i) ∼ N (0, p1 Ip ), 1 ≤ i ≤ N , and construct a collection of convex cones     z (i) p u, (i) Ci := u ∈ R ≥ kuk , 1 ≤ i ≤ N. kz k In words, Ci consists of all directions that have nontrivial positive correlation with z (i) . With high probability, this collection {Ci | 1 ≤ i ≤ N } forms a cover of Rp , a fact which is an immediate consequence of the following lemma.  Lemma 12. Consider any given constant 0 <  < 1, and let N = exp 22 p . Then there exist  some positive universal constants c5 , C5 > 0 such that with probability exceeding 1 − C5 exp −c5 2 p , N X 1{hx,z(i) i≥kxkkz(i) k} ≥ 1 i=1 holds simultaneously for all x ∈ Rp . With our family {Ci | 1 ≤ i ≤ N } we can introduce     n  (i) X √ z Bi := Ci ∩ u ∈ Rn | max {−uj , 0} ≤  n u, (i) ,  kz k  1 ≤ i ≤ N, (117) j=1 which in turn forms a cover of the nonconvex cone A defined in (50). DTo justifyE this, note that for (i) any u ∈ A, one can find i ∈ {1, · · · , N } obeying u ∈ Ci , or equivalently, u, kzz(i) k ≥ kuk, with high probability. Combined with the membership to A this gives n X   √ √ z (i) max {−uj , 0} ≤ 2 nkuk ≤  n u, (i) , kz k j=1 indicating that u is contained within some Bi . • Step 2. We now move on to control P {{Xβ | β ∈ Rp } ∩ Bi 6= {0}}. If the statistical dimensions of the two cones obey δ (Bi ) < n − δ ({Xβ | β ∈ Rp }) = n − p, then an application of [3, Theorem I] gives (  2 ) 1 n − δ ({Xβ | β ∈ Rp }) − δ (Bi ) p √ P {{Xβ | β ∈ R } ∩ Bi 6= {0}} ≤ 4 exp − 8 n ( ) 2 (n − p − δ(Bi )) ≤ 4 exp − . (118) 8n It then comes down to upper bounding δ(Bi ), which is the content of the following lemma. 36 Lemma 13. Fix  > 0. When n is sufficiently large, the statistical dimension of the convex cone Bi defined in (117) obeys   √ 3 √ 1 4 δ(Bi ) ≤ (119) + 2 2 + 10H(2 ) n, 2 where H(x) := −x log x − (1 − x) log(1 − x). Substitution into (118) gives P {{Xβ | β ∈ Rp } ∩ Bi 6= {0}}   2  √ 3 √    1 4 − 10H(2   − 2 2 ) n − p 2 ≤ 4 exp −   8n   (  2 ) √ 3 √ p 1 1 4 − 2 2 − 10H(2 ) − n . = 4 exp − 8 2 n (120) Finally, we prove Lemmas 12-13 in the next subsections. These are the only remaining parts for the proof of Theorem 4. D.1 Proof of Lemma 12 To begin with, it is seen that all kz (i) k concentrates around 1. Specifically, apply [29, Proposition 1] to get r   2t t (i) 2 P kz k > 1 + 2 + ≤ e−t , p p and set t = 32 p to reach o n o n √ 2 P kz (i) k2 > 1 + 10 ≤ P kz (i) k2 > 1 + 2 3 + 62 ≤ e−3 p . Taking the union bound we obtain n o P ∃1 ≤ i ≤ N s.t. kz (i) k2 > 1 + 10 2 ≤ N e−3 p 2 = e− p . (121) Next, we note that it suffices to prove Lemma 12 for all unit vectors x. The following lemma provides a bound on z (i) , x for any fixed unit vector x ∈ Rp . Lemma 14. Consider any fixed unit vector x ∈ Rp and any given constant 0 <  < 1, and set N = exp 22 p . There exist positive universal constants c5 , c6 , C6 > 0 such that P )    7 2 7 1{hz(i) ,xi≥ 1 } ≤ exp (1 − o (1))  p ≤ exp −2 exp (1 − o (1)) 2 p . 2 4 4 i=1 (N X  (122) Recognizing that Lemma 12 is a uniform result, we need to extend Lemma 14 to all  x simultaneously, which we achieve via the standard covering argument. Specifically, one can find a set C := x(j) ∈ Rp | 1 ≤ j ≤ K p of unit vectors with cardinality K = 1 + 2p2 to form a cover of the unit ball of resolution p−2 [51, Lemma 5.2]; that is, for any unit vector x ∈ Rp , there exists a x(j) ∈ C such that kx(j) − xk ≤ p−2 . 37 Apply Lemma 14 and take the union bound to arrive at   N X 7 1{hz(i) ,x(j) i≥ 1 } ≥ exp (1 − o(1)) 2 p > 1, 1≤j≤K (123) 2 4 i=1     with probability exceeding 1−K exp −2 exp (1 − o(1)) 47 2 p ≥ 1−exp −2 (1 − o (1)) exp (1 − o(1)) 47 2 p . This guarantees that for each x(j) , one can find at least one z (i) obeying D E 1 z (i) , x(j) ≥ . 2  This result together with (121) yields that with probability exceeding 1 − C exp −c2 p , for some universal constants C, c > 0. E E D E D D E D ≥ z (i) , x(j) − kz (i) k · kx(j) − xk z (i) , x ≥ z (i) , x(j) − z (i) , x(j) − x 1  1 1 1 kz (i) k − 2 kz (i) k  − 2 kz (i) k ≥ √ 2 2 p p 1 + 10 1 kz (i) k ≥ 30 holds simultaneously for all unit vectors x ∈ Rp . Since  > 0 can be an arbitrary constant, this concludes the proof. ≥ Proof of Lemma 14: Without loss of generality, it suffices to consider x = e1 = [1, 0, · · · , 0]> . For any t > 0 and any constant ζ > 0, it comes from [2, Theorem A.1.4] that ( ) N  1 X √ √ 1{hz(i) ,e1 i<ζ } > (1 + t) Φ (ζ p) ≤ exp −2t2 Φ2 (ζ p) N . P N i=1 √  Setting t = 1 − Φ ζ p gives ( ) N   1 X √ √ √ 2 √ P 1{hz(i) ,e1 i<ζ } > (2 − Φ (ζ p)) Φ (ζ p) ≤ exp −2 (1 − Φ (ζ p)) Φ2 (ζ p) N . N i=1 Recall that for any t > 1, one has (t−1 − t−3 )φ(t) ≤ 1 − Φ(t) ≤ t−1 φ(t) which implies that   (1 + o (1)) ζ 2 p √ 1 − Φ (ζ p) = exp − . 2 Taking ζ = 12 , we arrive at √ √ (2 − Φ (ζ p)) Φ (ζ p) = √ 2 √ (1 − Φ (ζ p)) Φ2 (ζ p) =    1 1 − exp − (1 + o (1)) ζ 2 p = 1 − exp − (1 + o (1)) 2 p , 4    1 1 exp − (1 + o (1)) ζ 2 p = exp − (1 + o (1)) 2 p  . 4 N This justifies that (N ( )  ) N X 1 2 1 X √ √ P 1{hz(i) ,e1 i≥ 1 } ≤ N exp − (1 + o (1))  p =P 1 (i) > (2 − Φ (ζ p)) Φ (ζ p) 2 4 N i=1 {hz ,e1 i<ζ } i=1     1 2 ≤ exp −2 exp − (1 + o (1))  p N 4    7 = exp −2 exp (1 − o (1)) 2 p 4  as claimed. 38 D.2 Proof of Lemma 13 First of all, recall from the definition (17) that     h i 2 2 2 2 δ(Bi ) = E kΠBi (g)k = E kgk − min kg − uk = n − E min kg − uk u∈Bi u∈Bi   2 ≤ n − E min kg − uk , u∈Di where g ∼ N (0, In ), and Di is a superset of Bi defined by n o Xn √ Di := u ∈ Rn | max {−uj , 0} ≤  nkuk . (124) j=1 Recall from the triangle inequality that kg − uk ≥ kuk − kgk > kgk = kg − 0k, ∀u : kuk > 2kgk. Since 0 ∈ Di , this implies that arg min kg − uk ≤ 2kgk, u∈Di revealing that    2 E min kg − uk = E u∈Di 2  kg − uk min . u∈Di ,kuk≤2kgk In what follows, it suffices to look at the set of u’s within Di obeying kuk ≤ 2kgk, which verify Xn √ √ max {−uj , 0} ≤  nkuk ≤ 2 nkgk. (125) j=1 It is seen that kg − uk2 ≥ X 2 (gi − ui ) = ≥ gi2 + i:gi <0,ui ≥0 ≥ X i:gi <0, − i:gi <0, − X i:gi <0, ui >− √ X + i:gi <0, − i:gi <0, ui ≤− √ n (gi − ui ) n kgk<ui <0 gi2 − 2ui gi √  n kgk<ui <0 X i:gi <0, − 2ui gi . √ (126) n kgk<ui <0 1. Regarding the first term of (126), we first recognize that r Pn   P √ max {−ui , 0}  i: ui <0 |ui | i | ui ≤ − kgk ≤ p  = i=1 p  ≤ 2 n, n n kgk n kgk where the last inequality follows from the constraint (125). As a consequence, X X X gi2 ≥ gi2 − gi2 √ √  i:gi <0 i:gi <0, ui >− 2 (gi − ui )   kgk 2 √ gi2 − n kgk n kgk<ui <0    X + √ X gi2 + i:gi <0,ui ≥0 ≥ X  i:gi <0,ui ≥0 X i:gi <0 X    n kgk i:ui ≤− X ≥ i:gi <0 39 gi2 − n kgk max √ S⊆[n]: |S|=2 n X i∈S gi2 . 2. Next, we turn to the second term of (126), which can be bounded by v  u u X X u  ui gi ≤ u u2i   t √ √ i:gi <0, − n kgk<ui <0 i:gi <0, − ≤ v u u t √ i:gi <0, − ! i:− ≤ n kgk<ui <0  X n kgk<ui <0 v ur u  t kgk n · kgk2 |ui | i:ui <0 ! X n kgk<ui <0 ! X |ui | √ max  gi2  · kgk2 ≤ |ui | √ 3 2 4 kgk2 , i:ui <0 where the last inequality follows from the constraint (125). Putting the above results together, we have X 2 kg − uk ≥ gi2 − i:gi <0 √ S⊆[n]: |S|=2 n for any u ∈ Di obeying kuk ≤ 2kgk, whence    X 2 ≥ E gi2 − E min kg − uk u∈Di i:gi <0  = X max √ 3 1 − 2 2 4 2 √ 3 gi2 − 2 2 4 kgk2 i∈S max √ S⊆[n]: |S|=2 n X  √ 3 gi2 − 2 2 4 kgk2  i∈S # "  n−E max √ S⊆[n]: |S|=2 n X gi2 . (127) i∈S √ Finally, it follows from [29, Proposition 1] that for any t > 2 n, ( ) ) ( X X p 2 2 P gi ≥ 5t ≤ P gi ≥ |S| + 2 |S|t + 2t ≤ e−t , i∈S i∈S which together with the union bound gives ( ) X 2 P max √ gi ≥ 5t ≤ S⊆[n]: |S|=2 n i∈S ( X √ S⊆[n]: |S|=2 n P ) X gi2 ≥ 5t  √  ≤ exp H 2  n − t . i∈S This gives " E # max √ S⊆[n]: |S|=2 n X gi2 Z = P 0 i∈S ≤ ( ∞ ) max √ S⊆[n]: |S|=2 n √  5H 2  n + √  < 10H 2  n, Z X gi2 ≥ t dt i∈S ∞   √  1 exp H 2  n − t dt √ 5 5H (2 )n for any given  > 0 with the proviso that n is sufficiently large. This combined with (127) yields     √ 3 √ 1 2 4 E min kg − uk ≥ − 2 2 − 10H(2 ) n u∈Di 2 as claimed. 40 (128) E Proof of Lemma 8 Throughout, we shall restrict ourselves on the event An as defined in (84), on which G̃  λlb I. Recalling the definitions of G̃ and w from (80) and (87), we see that w> G̃−2 w = ≤ −2 1 > X̃ Dβ̃ X̃ X̃ > Dβ̃ X·1 n  −2 1 1 > D X̃ X̃ Dβ̃ X̃ X̃ > Dβ̃ . n β̃ n 1 > X D X̃ n2 ·1 β̃ > X·1 n 2  1/2 If we let the singular value decomposition of √1n Dβ̃ X̃ be U ΣV > , then a little algebra gives Σ  and  −2 1 1/2 1 0 1/2 D X̃ X̃ Dβ̃ X̃ X̃ > Dβ̃ = U Σ−2 U >  λ−1 lb I. n β̃ n (129) √ λlb I Substituting this into (129) and using the fact kX·1 k2 . n with high probability (by Lemma 2), we obtain w> G̃−2 w . 1 kX·1 k2 . 1 nλL with probability at least 1 − exp(−Ω(n)). F Proof of Lemma 9 Throughout this and the subsequent sections, we consider Hn and Kn to be two diverging sequences with the following properties:   Hn = o (n ) , Kn = o (n ) , n2 exp −c1 Hn2 = o(1), n exp −c2 Kn2 = o(1), (130) for any constants ci > 0, i = 1, 2 and any  > 0. This lemma is an analogue of [20, Proposition 3.18]. We modify and adapt the proof ideas to establish the result in our setup. Throughout we shall restrict ourselves to the event An , on which G̃  λlb I. Due to independence between X·1 and {Dβ̃ , H}, one can invoke the Hanson-Wright inequality [44, Theorem 1.1] to yield P !  1 > 1/2 1  1/2 1/2 1/2 > t H, Dβ̃ X D HDβ̃ X·1 − Tr Dβ̃ HDβ̃ n ·1 β̃ n      2 t t  ≤ 2 exp −c min ,  K24 D 1/2 HD 1/2 2 K 2 D 1/2 HD 1/2  n n F β̃ β̃ β̃ β̃      2 t t , ≤ 2 exp −c min ,  K 4 D 1/2 HD 1/2 2 K 2 D 1/2 HD 1/2  n n β̃ β̃ β̃ β̃ √ 1/2 1/2 where k.kF denotes the Frobenius norm. Choose t = C 2 Dβ̃ HDβ̃ Hn / n with C > 0 a sufficiently large constant, and take Hn to be as in (130). Substitution into the above inequality and unconditioning 41 give  P   1 > 1/2 1  1/2 1 2 1/2 1/2 1/2 1/2 √ C Hn kDβ̃ HDβ̃ k X D HDβ̃ X·1 − Tr Dβ̃ HDβ̃ > n ·1 β̃ n n    4 2 √  C Hn C 2 nHn , = C exp −cHn2 = o(1), ≤ 2 exp −c min K4 K2 (131) for some universal constants C, c > 0. 1/2 1/2  We are left to analyzing Tr Dβ̃ HDβ̃ . Recall from the definition (90) of H that 1/2 1/2 Dβ̃ HDβ̃ = Dβ̃ − 1 D X̃ G̃−1 X̃ > Dβ̃ , n β̃ and, hence, Tr   1/2 1/2 Dβ̃ HDβ̃ = n X ρ 00 (X̃i> β̃) i=1 ρ00 (X̃i> β̃)2 > −1 X̃i G̃ X̃i − n ! . (132) This requires us to analyze G̃−1 carefully. To this end, recall that the matrix G̃(i) defined in (81) obeys G̃(i) = G̃ − 1 00 > ρ (X̃ β̃)X̃i X̃i> . n Invoking Sherman-Morrison-Woodbury formula (e.g. [26]), we have G̃ −1 = G̃−1 (i) − ρ00 (X̃i> β̃) −1 G̃(i) X̃i X̃i> G̃−1 (i) n ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n 1+ It follows that X̃i> G̃−1 X̃i = X̃i> G̃−1 (i) X̃i − . ρ00 (X̃i> β̃) 2 (Xi> G̃−1 (i) X̃i ) n 1+ ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n (133) , which implies that X̃i> G̃−1 (i) X̃i X̃i> G̃−1 X̃i = 1+ ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n . (134) The relations (132) and (134) taken collectively reveal that n  1X 1  1/2 1/2 = Tr Dβ̃ HDβ̃ n n i=1 1 + ρ00 (X̃i β̃) ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n . (135) We shall show that the trace above is close to Tr(I − H) up to some factors. For this purpose we analyze the latter quantity in two different ways. To begin with, observe that 1/2 ! 1/2 Tr(I − H) = Tr Dβ̃ X̃ G̃−1 X̃ > Dβ̃ n = Tr(G̃G̃−1 ) = p − 1. (136) On the other hand, it directly follows from the definition of H and (134) that the ith diagonal entry of H is given by 1 Hi,i = . ρ00 (X̃i> β̃) > G̃−1 X̃ 1+ X̃ i i (i) n 42 Applying this relation, we can compute Tr(I − H) analytically as follows: Tr(I − H) = X i = 1+ X ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n 1+ 1 n Tr  − ρ00 (X̃i> β̃)α̃ ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n ρ00 (X̃i> β̃)α̃Hi,i + X ρ00 (X̃i> β̃) i where α̃ := (137) ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n X ρ00 (X̃i> β̃)α̃ + i = ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n 1+ i  1 > −1 n X̃i G̃(i) X̃i − α̃ ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n  , (138)  G̃−1 . 1/2 1/2  Observe that the first quantity in the right-hand side above is simply α̃Tr Dβ̃ HDβ̃ denote 1 ηi = X̃i> G̃−1 (i) X̃i − α̃. n . For simplicity, (139) Note that G̃(i)  0 on An and that ρ00 > 0. Hence the denominator in the second term in (138) is greater than 1 for all i. Comparing (136) and (138), we deduce that  p−1 1 X 00 > 1  1/2 1/2 − Tr Dβ̃ HDβ̃ α̃ ≤ sup |ηi | · |ρ (X̃i β̃)| . sup |ηi | (140) n n n i i i on An . It thus suffices to control supi |ηi |. The above bounds together with Lemma (85) and the proposition below complete the proof. Proposition 1. Let ηi be as defined in (139). Then there exist universal constants C1 , C2 , C3 > 0 such that     C1 Kn2 Hn √ ≥ 1 − C2 n2 exp −c2 Hn2 − C3 n exp −c3 Kn2 P sup |ηi | ≤ n i − exp (−C4 n (1 + o(1))) = 1 − o(1), where Kn , Hn are diverging sequences as specified in (130) Proof of Proposition 1: Fix any index i. Recall that β̃[−i] is the MLE when the 1st predictor and ith observation are removed. Also recall the definition of G̃[−i] in (83). The proof essentially follows three steps. First, note that X̃i and G̃[−i] are independent. Hence, an application of the Hanson-Wright inequality [44] yields that    !   2 1  −1  t 1 > −1 t  X̃i G̃[−i] X̃i − Tr G̃[−i] > t G̃[−i] ≤ 2 exp −c min , P  K24 G̃−1 2 K 2 G̃−1  n n [−i] n [−i] F n      2 t t . ≤ 2 exp −c min ,  K 4 G̃−1 2 K 2 G̃−1  n [−i] n [−i] √ We choose t = C 2 G̃−1 [−i] Hn / n, where C > 0 is a sufficiently large constant. Now marginalizing gives  P  1 > −1 1  H √n X̃i G̃[−i] X̃i − Tr G̃−1 > C 2 G̃−1 [−i] [−i] n n n 43    ≤ 2 exp −c min  ≤ 2 exp −C 0 Hn2 ,  √ C 4 Hn2 C 2 nHn , K4 K2 where C 0 > 0 is a sufficiently large constant. On An , the spectral norm G̃−1 (i) is bounded above by λlb for all i. Invoking (85) we obtain that there exist universal constants C1 , C2 , C3 > 0 such that    1 > −1 1  −1  Hn P sup X̃i G̃[−i] X̃i − Tr G̃[−i] > C1 √ ≤ C2 n exp −C3 Hn2 . (141) n n n i   −1 > −1 > −1 The next step consists of showing that Tr G̃−1 [−i] (resp. X̃i G̃[−i] X̃i ) and Tr G̃(i) (resp. X̃i G̃(i) X̃i ) are uniformly close across all i. This is established in the following lemma. Lemma 15. Let G̃(i) and G̃[−i] be defined as in (81) and (83), respectively. Then there exist universal constants C1 , C2 , C3 , C4 , c2 , c3 > 0 such that  Kn2 Hn 1 > −1 1 > −1 P sup X̃i G̃(i) X̃i − X̃i G̃[−i] X̃i ≤ C1 √ n n n i   = 1 − C2 n2 exp −c2 Hn2 − C3 n exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1), (142)     1  Kn2 Hn 1 −1 √ − ≤ C Tr G̃ P sup Tr G̃−1 1 (i) [−i] n n n i   2 2 = 1 − C2 n exp −c2 Hn − C3 n exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1), (143) where Kn , Hn are diverging sequences as defined in (130). This together with (141) yields that   1 Kn2 Hn 1 −1 √ X̃ − > C Tr( G̃ ) P sup X̃i> G̃−1 i 1 (i) (i) n n n i   ≤ C2 n2 exp −c2 Hn2 + C3 n exp −c3 Kn2 + exp (−C4 n (1 + o(1))) . (144)   1 −1 The final ingredient is to establish that n1 Tr G̃−1 are uniformly close across i. (i) and n Tr G̃ Lemma 16. Let G̃ and G̃(i) be as defined in (80) and (81), respectively. Then one has     1 −1 − Tr G̃ ≤ P Tr G̃−1 ≥ 1 − exp (−Ω(n)) . (i) λlb (145)  This completes the proof. Proof of Lemma 15: For two invertible matrices A and B of the same dimensions, the difference of their inverses can be written as A−1 − B −1 = A−1 (B − A)B −1 . Applying this identity, we have   −1 −1 G̃−1 − G̃ = G̃ G̃ − G̃ G̃−1 [−i] (i) (i) [−i] (i) [−i] . From the definition of these matrices, it follows directly that   1 X  00 ρ X̃j> β̃[−i] − ρ00 X̃j> β̃ X̃j X̃j> . G̃[−i] − G̃(i) = n (146) j:j6=i As ρ000 is bounded, by the mean-value theorem, it suffices to control the differences Xj> β̃[−i] − X̃j> β̃ uniformly across all j. This is established in the following lemma, the proof of which is deferred to Appendix H. 44 Lemma 17. Let β̂ be the full model MLE and β̂[−i] be the MLE when the ith observation is dropped. Let qi be as described in Lemma 18 and Kn , Hn be as in (130). Then there exist universal constants C1 , C2 , C3 , C4 , c2 , c3 > 0 such that ! Kn2 Hn > > P sup Xj β̂[−i] − Xj β̂ ≤ C1 √ n j6=i   ≥ 1 − C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1), (147)   Kn2 Hn P sup |Xi> β̂ − proxqi ρ (Xi> β̂[−i] )| ≤ C1 √ n i   2 ≥ 1 − C2 n exp −c2 Hn − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1). (148) Invoking this lemma, we see that the spectral norm of (146) is bounded above by some constant times Kn2 Hn X √ X̃j X̃j> /n n j:j6=i with high probability as specified in (147). From Lemma 2, the spectral norm here is bounded by some constant with probability at least 1 − c1 exp(−c2 n). These observations together with (85) and the fact that on An the minimum eigenvalues of G̃(i) and G̃[−i] are bounded by λlb yield that     Kn2 Hn −1 √ ≤ C − G̃ P G̃−1 ≥ 1 − C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) . 1 (i) [−i] n This is true for any i. Hence, taking the union bound we obtain   Kn2 Hn −1 √ ≤ C − G̃ P sup G̃−1 1 (i) [−i] n i   ≥ 1 − C2 n2 exp −c2 Hn2 − C3 n exp −c3 Kn2 − exp (−C4 n (1 + o(1))) . (149) In order to establish the first result, note that sup i 1 kX̃i k2 −1 > −1 sup kG̃−1 X̃i> G̃−1 X̃ − X̃ G̃ X̃ ≤ sup i i i (i) − G̃[−i] k. (i) [−i] n n i i To obtain the second result, note that sup i p−1 1 1 −1 Tr(G̃−1 ) − Tr(G̃−1 ) ≤ sup kG̃−1 (i) [−i] (i) − G̃[−i] k. n n n i  Therefore, combining (149) and Lemma 2 gives the desired result. Proof of Lemma 16: We restrict ourselves to the event An throughout. Recalling (133), one has −1 Tr(G̃−1 )= (i) ) − Tr(G̃ ρ00 (X̃i> β̃) n 1+ X̃i> G̃−2 (i) X̃i ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n . In addition, on An we have   1 1 > −2 > −1 X̃i> G̃−1 X̃ − X̃ G̃ X̃ = X̃ G̃ G̃ − λ I G̃−1 i i lb (i) i (i) (i) (i) X̃i ≥ 0. λlb λlb i (i) Combining these results and recognizing that ρ00 > 0, we get −1 Tr(G̃−1 ) ≤ (i) ) − Tr(G̃ ρ00 (X̃i> β̃) n 1+ 1 > −1 λlb X̃i G̃(i) X̃i ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n ≤ 1 λlb (150)  as claimed. 45 G Proof of Lemma 11 Again, we restrict ourselves to the event An on which G̃  λlb I. Note that X̃i> G̃−1 w = 1 > −1 > X̃ G̃ X̃ Dβ̃ X·1 . n i Note that {G̃, X̃} and X·1 are independent. Conditional on X̃, the left-hand side is Gaussian with mean zero and variance n12 X̃i> G̃−1 X̃ > Dβ̃2 X̃ G̃−1 X̃i . The variance is bounded above by 1 > −1 > 2 1 X̃ G̃ X̃ Dβ̃ X̃ G̃−1 X̃i ≤ sup ρ00 (X̃i> β̃) · 2 X̃i> G̃−1 X̃ > Dβ̃ X̃ G̃−1 X̃i n2 i n i 1 1 = sup ρ00 (X̃i> β̃) · X̃i> G̃−1 X̃i . kX̃i k2 n i n 2 σX := (151) In turn, Lemma 2 asserts that n−1 kX̃i k2 is bounded by a constant with high probability. As a result, applying Gaussian concentration results [49, Theorem 2.1.12] gives |X̃i> G̃−1 w| . Hn  with probability exceeding 1 − C exp −cHn2 , where C, c > 0 are universal constants. In addition, supi |Xi1 | . Hn holds with probability exceeding 1 − C exp −cHn2 . Putting the above results together, applying the triangle inequality |Xi1 − X̃i> G̃−1 w| ≤ |Xi1 | + |X̃i> G̃−1 w|, and taking the union bound, we obtain  P( sup |Xi1 − X̃i> G̃−1 w| . Hn ) ≥ 1 − Cn exp −cHn2 = 1 − o(1). 1≤i≤n H Proof of Lemma 17 The goal of this section is to prove Lemma 17, which relates the full-model MLE β̂ and the MLE β̂[−i] . To this end, we establish the key lemma below. Lemma 18. Suppose β̂[−i] denote the MLE when the ith observation is dropped. Further let G[−i] be as in (82), and define qi and b̂ as follows: 1 > −1 X G Xi ; n i [−i]    1 0 > b̂ = β̂[−i] − G−1 X ρ prox X β̂ . i [−i] q ρ i i n [−i] qi = (152) Suppose Kn , Hn are diverging sequences as in (130). Then there exist universal constants C1 , C2 , C3 > 0 such that   Kn2 Hn P kβ̂ − b̂k ≤ C1 ≥ 1 − C2 n exp(−c2 Hn2 ) − C3 exp(−c3 Kn2 ) − exp(−C4 n(1 + o(1))); (153) n P sup j6=i Xj> β̂[−i] − Xj> b̂ Kn Hn ≤ C1 √ n !   ≥ 1 − C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) . (154) 46 The proof ideas are inspired by the leave-one-observation-out approach of [20]. We however emphasize once more that the adaptation of these ideas to our setup is not straightforward and crucially hinges on Theorem 4, Lemma 7 and properties of the effective link function. Proof of Lemma 18: Invoking techniques similar to that for establishing Lemma 7, it can be shown that n 1 X 00 ∗ ρ (γi )Xi Xi>  λlb I n i=1 (155) with probability at least 1 − exp(Ω(n)), where γi∗ is between Xi> b̂ and Xi> β̂. Denote by Bn the event where (155) holds. Throughout this proof, we work on the event Cn := An ∩ Bn , which has probability 1 − exp (−Ω(n)). As in (105) then, 1 ∇`(b̂) . (156) kβ̂ − b̂k ≤ nλlb Next, we simplify (156). To this end, recall the defining relation of the proximal operator bρ0 (proxbρ (z)) + proxbρ (z) = z, which together with the definitions of b̂ and qi gives   Xi> b̂ = proxqi ρ Xi> β̂[−i] . (157) Now, let `[−i] denote the negative log-likelihood function when the ith observation is dropped, and hence   ∇`[−i] β̂[−i] = 0. Expressing ∇`(b̂) as ∇`(b̂) − ∇`[−i] β̂[−i] , applying the mean value theorem, and using the analysis similar to that in [20, Proposition 3.4], we obtain  i  1 1 X h 00 ∗ ∇`(b̂) = ρ (γj ) − ρ00 (Xj> β̂[−i] ) Xj Xj> b̂ − β̂[−i] , (158) n n j:j6=i where γj∗ is between Xj> b̂ and Xj> β̂[−i] . Combining (156) and (158) leads to the upper bound kβ̂ − b̂k ≤ 1 λlb    1 X 1 −1 Xj Xj> · sup ρ00 (γj∗ ) − ρ00 Xj> β̂[−i] · G[−i] Xi · ρ0 proxqi ρ (Xi> β̂[−i] ) . (159) n n j6=i j:j6=i We need to control each term in the right-hand side. To start with, the first term is bounded by a universal constant with probability 1 − exp(−Ω(n)) (Lemma 2). For the second term, since γj∗ is between Xj> b̂ and Xj> β̂[−i] and kρ000 k∞ < ∞, we get sup ρ00 (γj∗ ) − ρ00 (Xj> β̂[−i] ) ≤ kρ000 k∞ kXj> b̂ − Xj> β̂[−i] k (160) j6=i   1 > −1 Xj G[−i] Xi ρ0 proxqi ρ Xi> β̂[−i] n   1 0 > ≤ kρ000 k∞ sup Xj> G−1 X · ρ prox (X β̂ ) . i [−i] qi ρ i [−i] n j6=i ≤ kρ000 k∞ (161) (162) Given that {Xj , G[−i] } and Xi are independent for all j 6= i, conditional on {Xj , G[−i] } one has   > −2 Xj> G−1 X ∼ N 0, X G X . i j j [−i] [−i] In addition, the variance satisfies |Xj> G−2 [−i] Xj | ≤ 47 kXj k2 .n λ2lb (163) with probability at least 1 − exp(−Ω(n)). Applying standard Gaussian concentration results [49, Theorem 2.1.12], we obtain    1 ≥ C H ≤ C2 exp −c2 Hn2 + exp (−C3 n (1 + o(1))) . P √ Xj> G−1 X (164) 1 n i [−i] p By the union bound P 1 √ sup Xj> G−1 [−i] Xi ≤ C1 Hn p j6=i !  ≥ 1 − nC2 exp −c2 Hn2 − exp (−C3 n (1 + o(1))) . (165) Consequently,   1 sup ρ00 (γj∗ ) − ρ00 (Xj> β̂[−i] ) . sup kXj> b̂ − Xj> β̂[−i] k . √ Hn ρ0 proxqi ρ (Xi> β̂[−i] ) . n j6=i j6=i In addition, the third term in the right-hand side of (159) can be upper bounded as well since 1 1 1 q > −2 |Xi G[−i] Xi | . √ kG−1 X k = i [−i] n n n (166) (167) with high probability.   It remains to bound ρ0 proxqi ρ (Xi> β̂[−i] ) . To do this, we begin by considering ρ0 (proxcρ (Z)) for any constant c > 0 (rather than a random variable qi ). Recall that for any constant c > 0 and any Z ∼ N (0, σ 2 ) with finite variance, the random variable ρ0 (proxcρ (Z)) is sub-Gaussian. Conditional on β̂[−i] , one has  Xi> β̂[−i] ∼ N 0, kβ̂[−i] k2 . This yields !# "     C32 Kn2 0 > P ρ proxcρ (Xi β̂[−i] ) ≥ C1 Kn ≤ C2 E exp − kβ̂[−i] k2  ≤ C2 exp −C3 Kn2 + C4 exp (−C5 n) (168) for some constants C1 , C2 , C3 , C4 , C5 > 0 sincekβ̂[−i] k is bounded with high probability (see Theorem 4). ∂prox (z) bρ ≤ 0 by [18, Proposition 6.3]. Hence, in order to move over from the above concenNote that ∂b tration result established for a fixed constant c to the random variables qi , it suffices to establish a uniform lower bound for qi with high probability. Observe that for each i, qi ≥ kXi k2 1 n G[−i] ≥ C∗ with probability 1 − exp(−Ω(n)), where C ∗ is some universal constant. On this event, one has       ρ0 proxqi ρ Xi> β̂[−i] ≤ ρ0 proxC ∗ ρ Xi> β̂[−i] . This taken collectively with (168) yields     P ρ0 (proxqi ρ (Xi> β̂[−i] )) ≤ C1 Kn ≥ P ρ0 (proxC ∗ ρ (Xi> β̂[−i] )) ≤ C1 Kn  ≥ 1 − C2 exp −C3 Kn2 − C4 exp (−C5 n) . (169) (170) This controls the last term. To summarize, if {Kn } and {Hn } are diverging sequences satisfying the assumptions in (130), combining (159) and the bounds for each term in the right-hand side finally gives (153). On the other hand, combining (165) and (170) yields (154).  48 With the help of Lemma 18 we are ready to prove Lemma 17. Indeed, observe that Xj> (β̂[−i] − β̂) ≤ Xj> (b̂ − β̂) + Xj> (β̂[−i] − b̂) , and hence by combining Lemma 2 and Lemma 18, we establish the first claim (147). The second claim (148) follows directly from Lemmas 2, 18 and (157). I Proof of Theorem 7(b)  This section proves that the random sequence α̃ = Tr G̃−1 /n converges in probability to the constant b∗ defined by the system of equations (23) and (24). To begin with, we claim that α̃ is close to a set of auxiliary random variables {q̃i } defined below. Lemma 19. Define q̃i to be q̃i = 1 > −1 X̃ G̃ X̃i , n i [−i] where G̃[−i] is defined in (83). Then there exist universal constants C1 , C2 , C3 , C4 , c2 , c3 > 0 such that   Kn2 Hn P sup |q̃i − α̃| ≤ C1 √ n i   ≥ 1 − C2 n2 exp c2 Hn2 − C3 n exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1), where Kn , Hn are as in (130). Proof: This result follows directly from Proposition 1 and equation (142).   A consequence is that proxq̃i ρ Xi> β̂[−i]    becomes close to proxα̃ρ Xi> β̂[−i] . Lemma 20. Let q̃i and α̃ be as defined earlier. Then one has       Kn3 Hn P sup proxq̃i ρ Xi> β̂[−i] − proxα̃ρ Xi> β̂[−i] ≤ C1 √ n i   2 2 ≥ 1 − C2 n exp −c2 Hn − C3 n exp −c3 Kn2 − exp (−C4 n (1 + o(1))) = 1 − o(1), (171) where Kn , Hn are as in (130).   The key idea behind studying proxα̃ρ Xi> β̂[−i] is that it is connected to a random function δn (·) defined below, which happens to be closely related to the equation (24). In fact,  we will show that δn (α̃) converges in probability to 0; the proof relies on the connection between proxα̃ρ Xi> β̂[−i] and the auxiliary quantity   proxq̃i ρ Xi> β̂[−i] . The formal results is this: Proposition 2. For any index i, let β̂[−i] be the MLE obtained on dropping the ith observation. Define δn (x) to be the random function n δn (x) := p 1X 1    . −1+ n n i=1 1 + xρ00 prox > xρ Xi β̂[−i] P Then one has δn (α̃) → 0. 49 (172) Furthermore, the random function δn (x) converges to a deterministic function ∆(x) defined by   1 ∆(x) = κ − 1 + EZ , 1 + xρ00 (proxxρ (τ∗ Z)) (173) where Z ∼ N (0, 1), and τ∗ is such that (τ∗ , b∗ ) is the unique solution to (23) and (24). P Proposition 3. With ∆(x) as in (173), ∆(α̃) → 0. In fact, one can easily verify that   ∆(x) = κ − E Ψ0 (τ∗ Z; x) , (174) and hence by Lemma 5, the solution to ∆(x) = 0 is exactly b∗ . As a result, putting the above claims together, we show that α̃ converges in probability to b∗ . It remains to formally prove the preceding lemmas and propositions, which is the goal of the rest of this section. Proof of Lemma 20: By [18, Proposition 6.3], one has ∂proxbρ (z) ρ0 (x) =− ∂b 1 + bρ00 (x) , x=proxbρ (z) which yields     sup proxq̃i ρ Xi> β̂[−i] − proxα̃ρ Xi> β̂[−i] i   0 ρ (x) = sup   · |q̃i − α̃| 1 + qα̃,i ρ00 (x) x=prox > β̂ i X [−i] qα̃,i ρ i   ≤ sup ρ0 proxqα̃,i (Xi> β̂[−i] ) · sup |q̃i − α̃|, i (175) i where qα̃,i is between q̃i and α̃. Here, the last inequality holds since qα̃,i , ρ00 ≥ 0. In addition, just as in the proof of Lemma 18, one can show that qi is bounded below by some constant √ C ∗ > 0 with probability 1 − exp(−Ω(n)). Since qα̃,i ≥ min{q̃i , α̃}, on the event supi |q̃i − α̃| ≤ C1 Kn2 Hn / n, which happens with high probability (Lemma 19), qα̃,i ≥ Cα for some universal constant Cα > 0. Hence, by an argument similar to that establishing (170), we have      P sup ρ0 proxqα̃,i Xi> β̂[−i] ≥ C1 Kn i   ≤ C2 n2 exp −c2 Hn2 + C3 n exp −c3 Kn2 + exp (−C4 n (1 + o(1))) .  This together with (175) and Lemma 19 concludes the proof. Proof of Proposition 2: To begin with, recall from (136) and (137) that on An , n ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n p−1 X = n i=1 1 + ρ00 (X̃i> β̃) n n X̃i> G̃−1 (i) X̃i =1− 50 1X n i=1 1 + 1 ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n . (176) Using the fact that 1 1+x − 1 1+y ≤ |x − y| for x, y ≥ 0, we obtain n 1X n i=1 1 + n 1 ρ00 (X̃i> β̃) X̃i> G̃−1 (i) X̃i n − 1X 1 00 n i=1 1 + ρ (X̃i> β̃)α̃ n ≤ 1 X 00 > 1 1 > −1 00 ρ (X̃i β̃) X̃i> G̃−1 (i) X̃i − α̃ ≤ kρ k∞ sup n X̃i G̃(i) X̃i − α̃ n i=1 n i Kn2 Hn = kρ00 k∞ sup |ηi | ≤ C1 √ , n i with high probability (Proposition 1). This combined with (176) yields ! n p−1 Kn2 Hn 1X 1 ≥ C1 √ P −1+ n n i=1 1 + ρ00 (X̃i> β̃)α̃ n   ≤ C2 n2 exp −c2 Hn2 + C3 n exp −c3 Kn2 + exp (−C4 n (1 + o(1))) . Pn Pn 1 1 1 The above bound concerns n1 i=1 1+ρ00 (X̃ > β̃)α̃ , and it remains to relate it to n i=1 1+ρ00 (prox (X̃ > β̃ ))α̃ . α̃ρ i i To this end, we first get from the uniform boundedness of ρ000 and Lemma 17 that     Kn2 Hn P sup ρ00 (X̃i> β̃) − ρ00 proxq̃i ρ (X̃i> β̃[−i] ) ≥ C1 √ n i ≤ C2 n exp(−c2 Hn2 ) + C3 exp(−c3 Kn2 ) + exp(−C4 n(1 + o(1))). (177) Note that n n 1 1 1X 1X − > 00 00 n i=1 1 + ρ (X̃i β̃)α̃ n i=1 1 + ρ (proxα̃ρ (X̃i> β̃[−i] ))α̃   ≤ |α̃| sup ρ00 (X̃i> β̃) − ρ00 proxα̃ρ (X̃i> β̃[−i] ) i n        o ≤ |α̃| sup ρ00 X̃i> β̃ − ρ00 proxq̃i ρ (X̃i> β̃[−i] ) + ρ00 proxq̃i ρ (X̃i> β̃[−i] ) − ρ00 proxα̃ρ (X̃i> β̃[−i] ) . i By the bound (177), an application of Lemma 20, and the fact that α̃ ≤ p/(nλlb ) (on An ), we obtain ! n 1X 1 Kn3 Hn p −1+ P  ≥ C1 √ n n i=1 1 + ρ00 proxα̃ρ (Xi> β̂[−i] ) α̃ n    ≤ C2 n2 exp − c2 Hn2 + C3 n exp − c3 Kn2 + exp − C4 n(1 + o(1)) . P This establishes that δn (α̃) → 0.  Proof of Proposition 3: Note that since 0 < α ≤ p/(nλlb ) := B on An , it suffices to show that P sup |δn (x) − ∆(x)| → 0. x∈[0,B] We do this by following three steps. Below, M > 0 is some sufficiently large constant. 1. First we truncate the random function δn (x) and define δ̃n (x) = n X p  −1+ n 00 prox i=1 1 + xρ 51 1  xρ Xi> β̂[−i] 1{kβ̂[−i] k≤M }  . P The first step is to show that supx∈[0,B] δ̃n (x) − δn (x) → 0. We stress that this truncation does not arise in [20], and we keep track of the truncation throughout the rest of the proof.   P 2. Show that supx∈[0,B] δ̃n (x) − E δ̃n (x) → 0.   P 3. Show that supx∈[0,B] E δ̃n (x) − ∆(x) → 0. 1 1 − 1+z | ≤ |y−z| for any y, z > 0 and that To argue about the first step, observe that | 1+y Proposition 6.3]. Then ∂proxcρ (x) ∂x ≤ 1 [18, |δn (x) − δ̃n (x)| ≤ |x| · kρ000 k∞ · sup Xi> β̂[−i] − Xi> β̂[−i] 1{kβ̂[−i] k≤M } . i For a sufficiently large constant M > 0, P(kβ̂[−i] k ≥ M ) ≤ exp(−Ω(n)) by Theorem 4. Hence, for any  > 0, !    > P sup |δn (x) − δ̃n (x)| ≥  ≤ P sup Xi β̂[−i] 1{kβ̂[−i] k≥M } ≥ Bkρ000 k∞ i x∈[0,B] ≤ n   X P kβ̂[−i] k ≥ M = o(1), (178) i=1 establishing Step 1. To argue about Step 2, note that for any x and z, n δ̃n (x) − δ̃n (z) ≤ 1 1X 1      −  n i=1 1 + xρ00 prox > 1 + zρ00 proxzρ Xi> β̂[−i] 1{kβ̂[−i] k≤M } xρ Xi β̂[−i] 1{kβ̂[−i] k≤M } n       1X xρ00 proxxρ Xi> β̂[−i] 1{kβ̂[−i] k≤M } − zρ00 proxzρ Xi> β̂[−i] 1{kβ̂[−i] k≤M } n i=1   n 0 ρ (x) 1 X  00 kρ k∞ |x − z| + |z| · kρ000 k∞ ≤  |x − z| n i=1 1 + z̃ρ00 (x) x=prox X > β̂[−i] 1 z̃ρ i {kβ̂[−i] k≤M } ! n    1X 0 > 00 000 ρ proxz̃ρ Xi β̂[−i] 1{kβ̂[−i] k≤M } ≤ |x − z| kρ k∞ + |z| · kρ k∞ , n i=1 ≤ where z̃ ∈ (x, z). Setting Yn := kρ00 k∞ + Bkρ000 k∞    1 Xn ρ0 proxz̃ρ Xi> β̂[−i] 1{kβ̂[−i] k≤M } , i=1 n then for any , η > 0 we have ! P sup x,z∈(0,B],|x−z|≤η |δ̃n (x) − δ̃n (z)| ≥    η  ≤ E[Yn ] ≤ ηC1 (), ≤ P Yn ≥ η  (179) where C1 () is some function independent of n. The inequality (179) is an analogue of [20, Lemma 3.24]. We remark that the truncation is particularly important here in guaranteeing that E[Yn ] < ∞. Set   Gn (x) := E δ̃n (x) , 52 and observe that   i  h  . Gn (x) − Gn (z) ≤ |x − z| kρ00 k∞ + |z|kρ000 k∞ E ρ0 proxz̃ρ Xi> β̂[−i] 1{kβ̂[−i] k≤M } A similarly inequality applies to ∆(x) in which Xi> β̂[−i] 1{kβ̂[−i] k≤M } is replaced by τ∗ Z. In either case, |Gn (x) − Gn (z)| ≤ C2 η sup |∆(x) − ∆(z)| ≤ C3 η sup and x,z∈(0,B],|x−z|≤η (180) x,z∈(0,B],|x−z|≤η for any η > 0. For any 0 > 0, set K = max{C1 (0 ), C2 }. Next, divide [0, B] into finitely many segments [0, x1 ), [x1 , x2 ), . . . , [xK−1 , xK := B] such that the length of each segment is η/K for any η > 0. Then for every x ∈ [0, B], there exists l such that |x − xl | ≤ η/K. As a result, for any x ∈ [0, B], sup sup δ̃n (x) − δ̃n (xl ) + sup δ̃n (xl ) − Gn (xl ) . x,xl ∈(0,B],|x−xl |≤η/K 1≤l≤k δ̃n (x) − Gn (x) ≤ η + x∈(0,B] Now fix δ > 0,  > 0. Applying the above inequality gives ! P sup |δ̃n (x) − Gn (x)| ≥ δ x∈(0,B] ! δ−η ≤P sup |δ̃n (x) − δ̃n (xl )| ≥ 2 x,xl ∈(0,B],|x−xl |≤η/K   δ−η + P sup |δ̃n (xl ) − Gn (xl )| ≥ 2 1≤l≤k     η δ−η δ−η ≤ C1 + P sup |δ̃n (xl ) − Gn (xl )| ≥ . K 2 2 1≤l≤k (181) Choose η < min{/2, δ}, K = max{C1 ( δ−η 2 ), C2 }. Then the first term in the right-hand side is at most /2. Furthermore, suppose one can establish that for any fixed x, P |δ̃n (x) − Gn (x)| → 0. (182) Since the second term in the right-hand side is a supremum over finitely many points, there exists an integer N such that for all n ≥ N , the second term is less than or equal to /2. Hence, for all n ≥ N , right-hand side is at most , which proves Step 2. Thus, it remains to prove (182) for any fixed x ≥ 0. We do this after the analysis of Step 3. We argue about Step 3 in a similar fashion and letting K = max{C2 , C3 }, divide (0, B] into segments of length η/K. For every x ∈ (0, B] there exists xl such that |x − xl | ≤ η/K. Then |Gn (x) − ∆(x)| ≤ |Gn (x) − Gn (xl )| + |Gn (xl ) − ∆(xl )| + |∆(xl ) − ∆(x)| ≤ 2η + |Gn (xl ) − ∆(xl )|, =⇒ sup |Gn (x) − ∆(x)| ≤ 2η + sup |Gn (xl ) − ∆(xl )|. 1≤l≤k [0,B] Hence, it suffices to show that for any fixed x, |Gn (x) − ∆(x)| → 0. To this end, observe that for any fixed x, |Gn (x) − ∆(x)|  p  ≤ − κ + EX  n 1 + xρ00 prox  1  xρ X1> β̂[−1] 1{kβ̂[−1] k≤M } 53   − EZ " 1 + xρ00 1  proxxρ (τ∗ Z) # . Additionally, X1> β̂[−1] 1{kβ̂[−1] k≤M } = kβ̂[−1] k1{kβ̂[−1] k≤M } Z̃, P where Z̃ ∼ N (0, 1). Since kβ̂[−1] k1{kβ̂[−1] k≤M } → τ∗ , by Slutsky’s theorem, X1> β̂[−1] 1{kβ̂[−1] k≤M } converges weakly to τ∗ Z̃. Since t 7→ 1/(1 + xρ”(proxxρ (t))) is bounded, one directly gets P Gn (x) − ∆(x) → 0 for every x. Finally, we establish (182). To this end, we will prove instead that for any given x, L δn (x) − Gn (x) →2 0. Define Mi := Xi> β̂[−i] 1{kβ̂[−i] k≤M } Then δn (x) − Gn (x) = 1 n Pn i=1 and f (Mi ) := 1 + xρ00 " # 1 1  −E  . proxxρ (Mi ) 1 + xρ00 proxxρ (Mi ) f (Mi ). Hence, for any x ∈ [0, B], n   1 X  2 1 X  E f (Mi ) + 2 E f (Mi )f (Mj ) 2 n i=1 n i6=j  2   E f (M1 ) n(n − 1)  = + E f (M1 )f (M2 ) . n n2 Var[δn (x)] =   The first term in the right-hand side is at most 1/n. Hence, it suffices to show that E f (M1 )f (M2 ) → 0. Let β̂[−12] be the MLE when the 1st and 2nd observations are dropped. Define  1 X 00  > 1 ρ Xj β̂[−12] Xj Xj> , G[−12] := q2 := X2> G−1 [−12] X2 , n n j6=1,2     1 0 > b̂[−1] := β̂[−12] + G−1 X −ρ prox X β̂ . 2 [−12] q2 ρ 2 n [−12] By an application of Lemma 18,     K 2 Hn ≤ C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n(1 + o(1))) . (183) P β̂[−1] − b̂[−1] ≥ C1 n n Also, by the triangle inequality, X1> (β̂[−1] − β̂[−12] ) ≤ X1> (β̂[−1] − b̂[−1] ) +     1 0 > X1> G−1 −ρ prox X β̂ . X q2 ρ 2 [−12] [−12] 2 n Invoking Lemma 2, (183), and an argument similar to that leading to (170) and (164), we obtain     Kn2 Hn > P X1 β̂[−1] − β̂[−12] ≥ C1 √ n   ≤ C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) . The event {kβ̂[−1] k ≤ M } ∩ {kβ̂[−12] k ≤ M } occurs with probability at least 1 − C exp(−cn). Hence, one obtains     Kn2 Hn > P X1 β̂[−1] 1kβ̂[−1] k≤M − β̂[−12] 1kβ̂[−12] k≤M ≤ C1 √ n   ≥ C2 n exp −c2 Hn2 − C3 exp −c3 Kn2 − exp (−C4 n (1 + o(1))) . (184) 54 A similar statement continues to hold with X1 replaced by X2 and β̂[−1] replaced by β̂[−2] . Some simple computation yields that kf 0 k∞ is bounded by some constant times |x|. By the mean value theorem and the fact that kf k∞ ≤ 1,     f (M1 )f (M2 ) − f X1> β̂[−12] 1{kβ̂[−12] k≤M } f X2> β̂[−12] 1{kβ̂[−12] k≤M }   n ≤ kf k∞ f (M1 ) − f X1> β̂[−12] 1{kβ̂[−12] k≤M }  o + f (M2 ) − f X2> β̂[−12] 1{kβ̂[−12] k≤M } ≤ C|x| · X1> β̂[−1] 1{kβ̂[−1] k≤M } − X1> β̂[−12] 1{kβ̂[−12] k≤M } + |x| · X2> β̂[−2] 1{kβ̂[−2] k≤M } − X2> β̂[−12] 1{kβ̂[−12] k≤M } . Consequently,     P f (M1 )f (M2 ) − f X1> β̂[−12] 1{kβ̂[−12] k≤M } f X2> β̂[−12] 1{kβ̂[−12] k≤M } → 0. As kf k∞ ≤ 1, this implies convergence in L1 . Thus, it simply suffices to show that h    i E f X1> β̂[−12] 1{kβ̂[−12] k≤M } f X2> β̂[−12] 1{kβ̂[−12] k≤M } → 0. Denote the design matrix on dropping the first and second row as X[−12] . Note that conditional on X[−12] , X1> β̂[−12] 1{kβ̂[−12] k≤M } and X2> β̂[−12] 1{ kβ̂[−12] k ≤ M } are independent and have distribution   N 0, kβ̂[−12] k2 1{kβ̂[−12] k≤M } . Using this and by arguments similar to [20, Lemma 3.23], one can show that " E e  i tX1> β̂[−12] 1{kβ̂ [−12] k≤M } +wX2> β̂[−12] 1{kβ̂  # [−12] k≤M } itX1> β̂[−12] 1{kβ̂ −E e [−12] k≤M }    iwX2> β̂[−12] 1{kβ̂ k≤M } [−12] E e → 0. (185) On repeated application of the multivariate inversion theorem for obtaining densities from characteristic functions, we get that h    i E f X1> β̂[−12] 1{kβ̂[−12] k≤M } f X2> β̂[−12] 1{kβ̂[−12] k≤M } h  i h  i − E f X1> β̂[−12] 1{kβ̂[−12] k≤M } E f X2> β̂[−12] 1{kβ̂[−12] k≤M } → 0. Since f is centered, this completes the proof.  References [1] Alan Agresti and Maria Kateri. Categorical data analysis. Springer, 2011. [2] Noga Alon and Joel H Spencer. The probabilistic method (3rd edition). John Wiley & Sons, 2008. [3] Dennis Amelunxen, Martin Lotz, Michael B McCoy, and Joel A Tropp. Living on the edge: Phase transitions in convex programs with random data. Information and Inference, page iau005, 2014. 55 [4] Árpád Baricz. Mills’ ratio: monotonicity patterns and functional inequalities. Journal of Mathematical Analysis and Applications, 340(2):1362–1370, 2008. [5] Maurice S Bartlett. Properties of sufficiency and statistical tests. Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, pages 268–282, 1937. [6] Mohsen Bayati and Andrea Montanari. The dynamics of message passing on dense graphs, with applications to compressed sensing. IEEE Transactions on Information Theory, 57(2):764–785, 2011. [7] Mohsen Bayati and Andrea Montanari. The LASSO risk for Gaussian matrices. IEEE Transactions on Information Theory, 58(4):1997–2017, 2012. [8] Peter J Bickel and JK Ghosh. A decomposition for the likelihood ratio statistic and the bartlett correction–a bayesian argument. The Annals of Statistics, pages 1070–1090, 1990. [9] Stéphane Boucheron and Pascal Massart. A high-dimensional Wilks phenomenon. Probability theory and related fields, 150(3-4):405–433, 2011. [10] George Box. A general distribution theory for a class of likelihood criteria. Biometrika, 36(3/4):317–346, 1949. [11] Emmanuel Candès, Yingying Fan, Lucas Janson, and Jinchi Lv. Panning for gold: Model-free knockoffs for high-dimensional controlled variable selection. arXiv preprint arXiv:1610.02351, 2016. [12] Herman Chernoff. On the distribution of the likelihood ratio. The Annals of Mathematical Statistics, pages 573–578, 1954. [13] Gauss M Cordeiro. Improved likelihood ratio statistics for generalized linear models. Journal of the Royal Statistical Society. Series B (Methodological), pages 404–413, 1983. [14] Gauss M Cordeiro and Francisco Cribari-Neto. An introduction to Bartlett correction and bias reduction. Springer, 2014. [15] Gauss M Cordeiro, Franciso Cribari-Neto, Elisete CQ Aubin, and Silvia LP Ferrari. Bartlett corrections for one-parameter exponential family models. Journal of Statistical Computation and Simulation, 53(34):211–231, 1995. [16] Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012. [17] Francisco Cribari-Neto and Gauss M Cordeiro. On bartlett and bartlett-type corrections francisco cribari-neto. Econometric reviews, 15(4):339–367, 1996. [18] David Donoho and Andrea Montanari. High dimensional robust M-estimation: Asymptotic variance via approximate message passing. Probability Theory and Related Fields, pages 1–35, 2013. [19] Noureddine El Karoui. Asymptotic behavior of unregularized and ridge-regularized high-dimensional robust regression estimators: rigorous results. arXiv preprint arXiv:1311.2445, 2013. [20] Noureddine El Karoui. On the impact of predictor geometry on the performance on high-dimensional ridge-regularized generalized robust regression estimators. Probability Theory and Related Fields, pages 1–81, 2017. [21] Noureddine El Karoui, Derek Bean, Peter J Bickel, Chinghway Lim, and Bin Yu. On robust regression with high-dimensional predictors. Proceedings of the National Academy of Sciences, 110(36):14557– 14562, 2013. [22] Jianqing Fan and Jiancheng Jiang. Nonparametric inference with generalized likelihood ratio tests. Test, 16(3):409–444, 2007. 56 [23] Jianqing Fan and Jinchi Lv. Nonconcave penalized likelihood with NP-dimensionality. IEEE Transactions on Information Theory, 57(8):5467–5484, 2011. [24] Jianqing Fan, Chunming Zhang, and Jian Zhang. Generalized likelihood ratio statistics and Wilks phenomenon. Annals of statistics, pages 153–193, 2001. [25] Yingying Fan, Emre Demirkaya, and Jinchi Lv. Nonuniformity of p-values can occur early in diverging dimensions. https://arxiv.org/abs/1705.03604, May 2017. [26] William W Hager. Updating the inverse of a matrix. SIAM review, 31(2):221–239, 1989. [27] David L. Hanson and Farroll T. Wright. A bound on tail probabilities for quadratic forms in independent random variables. The Annals of Mathematical Statistics, 42(3):1079–1083, 1971. [28] Xuming He and Qi-Man Shao. On parameters of increasing dimensions. Journal of Multivariate Analysis, 73(1):120–135, 2000. [29] Daniel Hsu, Sham Kakade, and Tong Zhang. A tail inequality for quadratic forms of subgaussian random vectors. Electron. Commun. Probab, 17(52):1–6, 2012. [30] Peter J Huber. Robust regression: asymptotics, conjectures and Monte Carlo. The Annals of Statistics, pages 799–821, 1973. [31] Peter J Huber. Robust statistics. Springer, 2011. [32] Adel Javanmard and Andrea Montanari. State evolution for general approximate message passing algorithms, with applications to spatial coupling. Information and Inference, page iat004, 2013. [33] DN Lawley. A general method for approximating to the distribution of likelihood ratio criteria. Biometrika, 43(3/4):295–303, 1956. [34] Erich L Lehmann and Joseph P Romano. Testing statistical hypotheses. Springer Science & Business Media, 2006. [35] Hua Liang, Pang Du, et al. Maximum likelihood estimation in logistic regression models with a diverging number of covariates. Electronic Journal of Statistics, 6:1838–1846, 2012. [36] Enno Mammen. Asymptotics with increasing dimension for robust regression with applications to the bootstrap. The Annals of Statistics, pages 382–400, 1989. [37] Peter McCullagh and James A Nelder. Generalized linear models. Monograph on Statistics and Applied Probability, 1989. [38] Lawrence H Moulton, Lisa A Weissfeld, and Roy T St Laurent. Bartlett correction factors in logistic regression models. Computational statistics & data analysis, 15(1):1–11, 1993. [39] Neal Parikh and Stephen Boyd. 1(3):127–239, 2014. Proximal algorithms. Foundations and Trends in Optimization, [40] Stephen Portnoy. Asymptotic behavior of M-estimators of p regression parameters when p2 /n is large. i. consistency. The Annals of Statistics, pages 1298–1309, 1984. [41] Stephen Portnoy. Asymptotic behavior of M-estimators of p regression parameters when p2 /n is large; ii. normal approximation. The Annals of Statistics, pages 1403–1417, 1985. [42] Stephen Portnoy. Asymptotic behavior of the empiric distribution of m-estimated residuals from a regression model with many parameters. The Annals of Statistics, pages 1152–1170, 1986. 57 [43] Stephen Portnoy et al. Asymptotic behavior of likelihood methods for exponential families when the number of parameters tends to infinity. The Annals of Statistics, 16(1):356–366, 1988. [44] Mark Rudelson, Roman Vershynin, et al. Hanson-Wright inequality and sub-gaussian concentration. Electron. Commun. Probab, 18(82):1–9, 2013. [45] Michael R Sampford. Some inequalities on mill’s ratio and related functions. The Annals of Mathematical Statistics, 24(1):130–132, 1953. [46] Vladimir Spokoiny. Penalized maximum likelihood estimation and effective dimension. arXiv preprint arXiv:1205.0498, 2012. [47] Pragya Sur, Yuxin Chen, and Emmanuel Candès. Supplemental materials for “the likelihood ratio test in high-dimensional logistic regression is asymptotically a rescaled chi-square”. http: // statweb. stanford. edu/ ~candes/ papers/ supplement_ LRT. pdf , 2017. [48] Cheng Yong Tang and Chenlei Leng. Penalized high-dimensional empirical likelihood. Biometrika, pages 905–919, 2010. [49] Terence Tao. Topics in random matrix theory, volume 132. American Mathematical Society Providence, RI, 2012. [50] A. W. Van der Vaart. Asymptotic statistics, volume 3. Cambridge university press, 2000. [51] Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. Compressed Sensing: Theory and Applications, pages 210 – 268, 2012. [52] Samuel S Wilks. The large-sample distribution of the likelihood ratio for testing composite hypotheses. The Annals of Mathematical Statistics, 9(1):60–62, 1938. [53] Ting Yan, Yuanzhuang Li, Jinfeng Xu, Yaning Yang, and Ji Zhu. High-dimensional Wilks phenomena in some exponential random graph models. arXiv preprint arXiv:1201.0058, 2012. 58
7cs.IT
Design of an intermediate representation for query languages Internship report Romain Vernoux, supervised by Kim Nguyễn (VALS team, LRI) arXiv:1607.04197v1 [cs.PL] 14 Jul 2016 July 15, 2016 Contents 1 Introduction 1 2 Notations and conventions 3 3 Architecture 3 4 QIR calculus 4.1 QIR data model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 QIR operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 QIR expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 5 6 5 QIR evaluation 5.1 QIR reduction rules . . . . . . . . . 5.2 A measure for “good” output plans . 5.3 An exhaustive reduction strategy . . 5.4 A heuristic-based reduction strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8 8 10 11 6 Experiments 18 6.1 Example of code factorization: analytics queries . . . . . . . . . . . . . . . . . . . 18 6.2 Example of fragment grouping: dynamic queries . . . . . . . . . . . . . . . . . . . 20 6.3 Example of incompatibility: caching . . . . . . . . . . . . . . . . . . . . . . . . . 21 7 Related work 21 8 Conclusion and future work 23 Appendices 24 A References 24 B Internship timeline 25 C Formal definition of occurences 25 D Proofs 26 E Estimation of the heuristic fuel value 30 F Source code and other resources 30 1 Introduction This internship is part of a joint collaboration between Laurent Daynes at Oracle Labs, Giuseppe Castagna and Julien Lopez (also a MPRI student) at PPS and Kim Nguyễn and myself at LRI. Each of these three groups worked on different aspects of the project and synchronized during regular meetings. In this report, I will do my best to focus on my contribution and explain only the necessary of the other parts of the project. I will use “I” to emphasize my work and “we” in formal definitions and technical sections. The general context Data oriented applications, usually written in a high-level, general-purpose programming language (such as Java, Ruby, or JavaScript) interact with databases through a very coarse interface. Informally, the text of a query is built on the application side (either via plain string concatenation or through an abstract notion of statement) and shipped to the database. After its evaluation, the results are then serialized and sent back to the “application-code” where they are translated in the application language datatypes. Such roundtrips represent a significant part of the application running time. Moreover, this programming model prevents one from using richer query constructs, such as user-defined functions (UDF). UDFs are functions defined by the application developer, most of the time in a language more expressive than the query language, and used in a query (e.g., in a filter condition of a SQL query). While some databases also possess a “server-side” language for this purpose (e.g., PL/SQL in Oracle Database and PL/pgSQL in PostgreSQL), its integration with the very-optimized query execution engine is still minimal, resulting in notoriously slow query evaluations. The alternative is to evaluate UDFs in the application runtime, leading to additional application-database roundtrips and even poorer performance[8][7]. These problems, often refered to as language-integrated query issues, are in no way specific to relational databases and also affect the so-called NoSQL databases, which now all provide some form of declarative query language. In this setting, Oracle Labs is developing Truffle[14], a framework for representing dynamic languages programs and functions as abstract syntax tree (AST) nodes with particular evaluation rules, and Graal[14], a just-in-time (JIT) compiler written in Java, leveraging Oracle’s experience from the Java JIT compiler and achieving high performance in evaluating Truffle nodes. A proof of concept, in the form of a full-blown JavaScript runtime prototype written entirely in Truffle and open-source projects for Ruby, R and Python runtimes[14], is already available. In principle, this framework could enable to efficiently evaluate UDFs written in high-level dynamic languages directly inside a database embedding a Java Virtual Machine (such as Oracle DB[15], Cassandra[11] or Hive[16]), thus bridging the aforementioned impedence mismatch gap, considerably decreasing the cost of roundtrips between query and UDFs evaluation, and providing the right level of abstraction for a deep integration in the database query optimization process. The research problem Language-integrated queries and impedence mismatch were already research topics in the 1980s[1], although they have received increased attention with the popularization of web applications. Various solutions have already been proposed in the past[4] and constant demand for this matter has for instance lead Microsoft to include LINQ[12]–a framework integrating Microsoft SQL Server querying primitives in C#, among other languages–in .NET 3.5, and to continually add new features in the subsequent releases. In our opinion, the imperfections of the existing solutions and the new perspectives opened by the Truffle/Graal project justified a reinvestigation of this (still trending) topic. Furthermore, taking in consideration the wide adoption of NoSQL databases, special care should be taken to propose a solution that is not specific to relational databases, and to the extent of our knowledge 1 such work has not been done yet. Thus, the problematic of the QIR project is articulated around the following questions: 1. How to draw the line between application code that should be evaluated in the application runtime, in the database native query processor and in the application language runtime embedded in the database? 2. How to represent queries in a way that is agnostic of the application language (for reusability) and the target database (to support relational and non-relational ones)? 3. How to rewrite this query representation to present an efficient query to the database? 4. How to translate this query representation to the database native language? 5. How to evaluate application (Truffle) code inside the database? Although I took part in discussions revolving around all these questions (cf. Section 3), my internship was centered on questions 2 and 3. Questions 1 and 4 were investigated at PPS and question 5 at Oracle Labs. My contribution A review of existing language-integrated query frameworks (cf. Appendix F) and results from a previous internship[13] highlighted that existing database query languages (including SQL) share high-level querying primitives (e.g., filtering, joins, aggregation) that can be represented by operators, but differ widely regarding the semantics of their expression language. In order to represent queries in an application language- and database-agnostic manner (question 2 above), I designed a small calculus, dubbed “QIR” for Query Intermediate Representation, expressive enough to capture querying capabilities offered by mainstream languages. QIR contains expressions, corresponding to a small extension of the pure lambda-calculus, and operators to represent usual querying primitives (Section 4). In the effort to send efficient queries to the database (question 3 above), I abstracted the idea of “good” query representations in a measure on QIR terms. Then, I designed an evaluation strategy rewriting QIR query representations into “better” ones (Section 5). Arguments supporting its validity As an abstraction layer between application languages and databases, QIR guarantees the robustness of the entire framework regarding changes in these two tiers. But to provide formal evidence of the relevance of my solutions, I wrote an optimality proof for my evaluation strategy on a particular subset of QIR terms, with respect to the aforementioned measure (Theorem 6). Additionally, I implemented a prototype of the QIR evaluation strategy and ran experiments showing that (i) the measure captures well the idea of “good” queries, (ii) rewritings have a low cost while enabling considerable speedup opportunities for the database and (iii) the evaluation strategy outputs optimal results well outside the scope of the QIR subset captured by the optimality proof (Section 6). Summary and future work The ability to evaluate snippets from the application code inside the database opened new perspectives on the language-intergrated query problems. My approach allows a complete separation between application language and target database considerations, and to this extent is an interesting contribution even outside the scope of our project. Future work includes testing this concept with more combinations of application languages and databases, and observing the impact of such an architecture on real-world web applications. 2 2 Notations and conventions Trees In this document, we will use an infix parenthesis notation for trees. The tree leaves are represented by their name and a tree rooted at a node N with n children S1 , . . . , Sn is denoted by N (r1 , . . . , rn ) where ri is the representation of the subtree rooted at node Si . For instance, if a tree T is composed of a node N which has two children P and Q such that Q has one child R, we will write T as N (P, Q(R)). Contexts Contexts are trees in which some subtrees have been removed and replaced by “holes”. A hole is denoted by []. For instance, a context C can be obtained by removing the subtree rooted at Q in T and will be denoted by N (P, []). Context holes can be filled with arbitrary subtrees. If a context C contains one hole, C[S] corresponds to the tree C where the hole has been replaced by the tree S. For instance, if C = N (P, []) then T = C[Q(R)]. This definition generalizes to contexts with n holes using the C[S1 , . . . , Sn ] notation. Notice that in this case, the context holes are ordered using a prefix (depth-first, left-to-right) traversal of the tree, which corresponds to the left-to-right order while reading the tree notation we use in this document. For instance, if C = N ([], Q([])) then T = C[P, R]. List comprehensions Similarly to sets and the {x | P } notation for set comprehensions, we use the [x | P ] notation for list comprehensions. List comprehensions are order-preserving, that is, a list [f (x) | x ∈ L] respects the order of L if L is a list. In this document, we will use them to build the list of a node’s children in a tree. For instance, 0([x + 1 | x ∈ [1, 2, 3]]) will stand for the tree 0(2, 3, 4). A node with an empty children list will be considered to be a leaf. Proofs For space reasons, some proofs have been moved to the Appendices. When no proof is given directly below a lemma or a theorem, it can be found in Appendix D. 3 Architecture Query language In this Section, I present the global architecture of the project and quickly describe the purpose of the modules I did not work on. Application language ① Translation to QIR Oracle ② QIR evaluation QIR Truffle PPS LRI Capabilities DSL ③ Translation to native queries Native queries Truffle ④ Query evaluation Since the beginning of my internship, I took part in the design of the global architecture of the project, whose current state is illustrated in Figure 1. It works as follows. Figure 1: Architecture 1. Queries specified in the application language (possibly augmented with a special syntax for querying primitives) are detected in the application code. We refer to the result of this detection as the query boundary : code outside this boundary will be translated to Truffle nodes and evaluated in the application runtime, whereas code inside this boundary will be evaluated by the database. Inside the boundary, query parts that can be expressed in QIR are mapped to QIR constructs, and the remaining is propagated as Truffle nodes. This translation phase also maps the application language data model to the QIR data model. For now, we make the assumption that a same construct has identical semantics in the application language and in QIR (e.g., tuple navigations such as user.name return the same result in JavaScript and in QIR, and Ruby integers behave like QIR integers), and we allow a lossy translation when this is not the case. The QIR constructs will be described in Section 4. The translation phase, designed at PPS, was not the point of my internship 3 and will not be further described. To understand the remaining of this document, you can safely assume that query boundaries are specified by the application developer with a quote/antiquote syntax as in [3]. For example, in the following code snippet (written in an imaginary application language in which queries are specified using a SQL-like syntax), 1 f ( i d ) := i d = 1 ; 2 r e s u l t := null ; 3 <@ %r e s u l t := s e l e c t ∗ from db( " ads " ) as t where %f ( t . i d ) ) @>; 4 f o r t in r e s u l t do . . . the <@ @> quotes delimit the query boundary, whereas the % antiquote annotate identifiers bound outside the query boundary. During the application execution, the f and result assignments are evaluated in the application runtime, the quoted code is translated to a QIR expression containing a Truffle reference %f and the dependencies of this quoted code (i.e., the Truffle definition of f) are passed, along with the QIR code, to the next module in order to be evaluated in the database. 2. QIR constructs are partially evaluated within the framework. The goal of this rewriting pass is to feed the database with queries that can be easily optimized by its query optimizer. This module relies on a formal description of the operators that the database can natively evaluate, in order to progressively “improve” the query representation with local reductions. Providing this description through a well-defined API is the first role of the “Capabilities DSL” (domain-specific language), thus maintaining the nice abstraction over the choice of target database. The partial evaluation of QIR expressions will be described in Section 5. This Capabilities DSL and description mechanism, designed at PPS, was not the point of my internship and will not be further described. To understand the remaining of this document, you can safely assume that it is an API providing information such as This database supports filters, but not joins and a filter is compatible if the filter condition has the shape λt. t.attr = x and if x is a constant value, but not if x is a free variable. 3. After the rewriting pass, QIR expressions that can be expressed in the database native query language are mapped to native query constructs, and the remaining is translated to Truffle nodes. This translation phase also maps the QIR data model to the database data model. As in step 1, we make the assumption that a same construct has identical semantics in QIR and in the database query language, and we allow a lossy translation when this is not the case. Providing a way to translate compatible QIR operators into constructs of the database query language through a well-defined API is the second role of the Capabilities DSL, thus maintaining again the abstraction over the choice of target database. For the same reason as above, you can simply assume that this API provides a method mapping natively supported operators (according to the Capabilities DSL) to the corresponding query string in the database query language. 4. Native queries go through the database optimizer before their evaluation in the database query processor. Such queries may contain references to Truffle definitions for three reasons: (i) the query in the application language was refering to an identifier defined outside the query boundary, (ii) the quoted application code contained features that could not be translated into QIR, and (iii) the query representation in QIR contained features that could not be translated into the database query language. In all these cases, the Truffle runtime embedded in the database is called by the query processor to evaluate the code corresponding to these references. The result of the query is then returned to the host language. This backward translation maps database native data values to the QIR values (using again the Capabilities DSL translation API), then QIR values to the application language data model. Again, this evaluation mechanism, designed at Oracle Labs, was not the point of my internship and will not be further described in this document. This architecture has the advantage of interleaving an abstraction layer, composed of QIR and Truffle, between the application layer and the database layer. Beyond added cleanliness, 4 this means that no work has to be done on existing database layer modules to support a new application language, and no work has to be done on existing application layer modules to support a new database. 4 QIR calculus For the architecture described in Section 3 to work, QIR constructs have to be simple enough to be mapped to as many mainstream application language constructs and database language constructs as possible, but also expressive enough to represent interesting queries. To design a QIR calculus satisfying these requirements, I first reviewed existing languageintegrated query frameworks (cf. Appendix F), work that I had for the most part already done in a previous internship on a similar area[13]. I observed that existing database query languages all share high-level querying primitives (e.g., filtering, joins, aggregation), even though they support these features to various degrees. Moreover, the corresponding language constructs are almost always only a thin language layer hiding to various extents an algebra of operators inspired by the relational algebra. I also noticed the tension between database languages with a declarative descriptions of queries and application languages in which queries are built imperatively. Therefore, in order to represent queries in a manner agnostic of the application and database languages, I designed QIR as a small extension of the pure lambda-calculus, made of (i) expressions, i.e., variables, lambdas, applications, constants, functions (conditionals, arithmetic operations, etc.) as well as list/tuple constructors and destructors, and (ii) operators, i.e., constructors representing the common querying primitives mentioned above. Thus, queries built imperatively in the application code can easily be translated to expressions manipulating operators whereas declarative queries correspond more to trees of operators, and one can go from the first representation to the second by partially evaluating the corresponding QIR term. The remaining of this section is a formal description of the QIR calculus. 4.1 QIR data model QIR data objects are called values. The following grammar describes their syntax (for future use in this document) and hierarchy. hValuei ::= hNumber i | hStringi | hBool i hNumber i ::= h64-bit IEEE 754 i hStringi ::= hUTF-16 i hBool i ::= true | false For now, the QIR data model only contains the necessary for a proof of concept. It will have to be extended with more primitive types for our framework to be used in real-world applications. 4.2 QIR operators Operators represent computation on database tables. Each operator has children expressions (in parentheses) and configuration expressions (in subscript). As in the relational algrebra, children provide the operator input tables whereas configurations describe the computation on table elements. The following grammar describes their syntax (for future use in this document) and hierarchy. hOperator i ::= ScanhExpr i () | SelecthExpr i (hExpr i) | LimithExpr i (hExpr i) | GrouphExpr i,hExpr i (hExpr i) | ProjecthExpr i (hExpr i) | SorthExpr i (hExpr i) | JoinhExpr i (hExpr i, hExpr i) 5 These operators represent the following database computations: • Scantable () outputs the list (in a non-deterministic order) of elements in the target database table denoted by the expression table. • Selectf ilter (input) outputs the list of elements v in the list corresponding to input such that f ilter v reduces to true. • Projectf ormat (input) outputs the list of elements corresponding to f ormat v, with v ranging in the list corresponding to input. • Sortcomp (input) outputs the list of elements v in the list corresponding to input ordered according to comp v ascending. • Limitlimit (input) outputs the limit first elements of the list corresponding to input. • Groupeq,agg (input) outputs the list of elements corresponding to agg g for each group g in the partition of the elements v in the list corresponding to input, according to eq v. • Joinf ilter (input1 , input2 ) outputs the join of the elements v1 in the list corresponding to input1 and the elements v2 in the list corresponding to input2 , such that f ilter v1 v2 reduces to true. For the same reason as above, QIR operators are still limited. Nervertheless, they already capture a consequent part of the relational algebra. 4.3 QIR expressions QIR expressions are the core of the QIR calculus. The following grammar describes their syntax (for future use in this document) and hierarchy. hExpr i hLambdai ::= | | | | | | | | | | hVariablei hLambdai hApplicationi hConstanti hValueConsi hValueDestr i hValueFuni hBuiltinFuni hDataRef i hTruffleNodei hOperator i hTupleConsi ::= ‘tnil’ | ‘tcons’ hStringi hExpr i hExpr i hValueDestr i ::= hListDestr i | hTupleDestr i hListDestr i hTupleDestr i ::= ‘tdestr’ hExpr i hStringi hValueFuni ::= ‘λ’ hVariablei ‘.’ hExpr i hApplicationi ::= hExpr i hExpr i hConstanti ::= hValuei ::= ‘-’ hExpr i | hExpr i ‘and’ hExpr i | ‘if’ hExpr i ‘then’ hExpr i ‘else’ hExpr i | ... hBuiltinFuni ::= ‘avg’ hExpr i | ... hValueConsi ::= hListConsi | hTupleConsi hListConsi ::= ‘destr’ hExpr i hExpr i hExpr i hDataRef i ::= ‘nil’ | ‘cons’ hExpr i hExpr i ::= ‘db.table_name’ hTruffleNodei ::= ‘truffle<id>’ Lambda-abstractions (resp. applications, constants) represent functions (resp. function applications, constants) of the application language. The constructor for lists takes an expression for the head and an expression for the tail. Tables are represented by lists, since the output of queries might be ordered. Tuples are constructed as a list of mappings: the constructor for tuples takes a string for the mapping name, an expression for the mapping value and an expression for the tail of the mapping list. The list destructor has three arguments: the list to destruct, the term to return when the list is nil and a function with two arguments λh.λt.M to treat the case when the list has a head and a tail. The tuple destructor has two arguments: the tuple to destruct and the attribute name of the value to return. Finally, built-in functions represent 6 common database functions (such as aggregation) for easier recognition and translation into native languages. The formal definition of expression reductions is given in Section 5. In this document, we will sometimes use the syntactic sugar let x = M in N for (λx. N )M but the let . . . in constructor is not part of the expression language. Similarly, we will sometimes use the notation t.attr for tdestr t "attr", not x for if x then false else true and let rec x = M in N as a shortcut for the application of a fixpoint combinator. 5 QIR evaluation As discussed in the beginning of Section 4, the purpose of the QIR partial evaluation mechanism is to transform the QIR representation of a query written in the (possibly imperative) style of the application language into a QIR representation of the same query that is easier to translate to the database native language and offers more optimization opportunities to its optimizer. Today’s databases use a tree of algebra operators (plan) to represent computation. Optimizations consist in commuting operators in the plan or applying local tree rewritings. The plan evaluation usually corresponds to (a variation of) a bottom-up evaluation of each operator, where a particular implementation is chosen for each operator for best performance. Therefore, for a same computation, such database engines benefit from working on a large, single plan instead of multiple small plans using the result of each other, since (i) more optimizations become available, (ii) more statistics can be gathered to pick the best implementation for each operator and (iii) no intermediate result needs to be materialized and transferred. Consider the following example of query (written in an imaginary application language in which queries are specified using a SQL-like syntax). 1 r e s u l t := null ; 2 <@ u s e r s := db( " u s e r s " ) ; ads := db( " ads " ) ; 3 f i l t e r ( x , y ) := ( x . i d = y . u s e r i d ) and ( y . timestamp > 1 2 3 4 ) ; 4 p r e t t i f y ( s ) := . . . ; 5 %r e s u l t = s e l e c t p r e t t i f y ( name ) as u_name , d e s c r as a_descr 6 from u s e r s as u , ads as a where f i l t e r ( u , a ) @> 7 f o r t in r e s u l t do . . . The quoted code contains a query as well as the definition of two UDFs: filter, which is a quite simple filter function and prettify, which contains application languages features that cannot be translated to QIR. A direct translation of the quoted code to QIR would be as follows. 1 2 3 4 5 let users = db.users in let ads = db.ads in let f ilter = λx. λy. (tdestr x "id") = (tdestr y "userid") and (tdestr y "timestamp" > 1234) in let prettif y = truffle<0> in Projectλt. tcons "u_name" (prettif y (tdestr t "name")) (tcons "a_descr" (tdestr t "descr") tnil) ( Joinλu. λa. f ilter u a (Scanusers (), Scanads ())) Notice that the definition of prettify had to be translated to Truffle nodes (not shown here) and is represented in the QIR code by a Truffle reference. Assuming that the target database can only natively evaluate operators (e.g., SQL), the direct translation of the above QIR code to the database language would lead to a query in which all operators issue calls to UDFs, greatly impacting performances. Moreover, with no information about filter, the database optimizer could not decide to push the selection timestamp > 1234 below the join or choose an index-based implementation for the join. In fact, a better QIR representation for this query is as follows. 1 2 Projectλt. tcons "u_name" (truffle<0> (tdestr t "name")) (tcons "a_descr" (tdestr t "descr") tnil) ( Joinλu. λa. (tdestr u "id") = (tdestr a "userid") and (tdestr a "timestamp">1234) (Scandb.users (), Scandb.ads ())) This second version can be obtained from the first by a reduction of the QIR code. As we will see later in this section, applying classical reduction strategies (e.g., call-by-value, call-by-name, lazy evaluation) until a normal form is reached does not satisfy our requirements, since contracting 7 some redexes might scatter parts of a same query. Instead, we will characterize the shape of “good” QIR code with a measure on QIR expressions in Section 5.2, then investigate reduction strategies guided by this measure in Sections 5.3 and 5.4. 5.1 QIR reduction rules In this section, I formally define the reduction of QIR expressions, then state two useful properties on the QIR calculus equipped with this reduction. Definition 1. The capture-avoiding variable substitution in QIR expressions (cf. Section 4.3) is defined as in the pure lambda-calculus. The substitution of a variable x in e1 by an expression e2 is denoted e1 {e2 /x}. Definition 2. The reduction rules for QIR expressions consist in the β-reduction rule augmented with the δ-reduction rules for destructors and ρ-reduction rules for primitive types. (λx. e1 ) e2 →β e1 {e2 /x} destr nil enil econs destr (cons ehead etail ) enil econs tdestr (tcons "name1" eval1 etail ) "name1" tdestr (tcons "name1" eval1 etail ) "name2" →δ →δ →δ →δ enil econs ehead etail eval1 tdestr etail "name2" if true then e1 else e2 if false then e1 else e2 true and e1 false and e1 ... →ρ →ρ →ρ →ρ e1 e2 true e1 In this document, we will use the notation → for the relation →β ∪ →δ ∪ →ρ and talk about redexes for β-redexes, δ-redexes and ρ-redexes indifferently. Furthermore, we will denote by →n the n-step reduction relation and by →∗ the reflexive, transitive closure of →. Theorem 1. QIR with the reduction rules of Definition 2 satisfies the Church-Rosser property. As we will see in the following sections, this is an important property, since it allows us to apply any reduction strategy while preserving the semantics of the input expression. Consequently, extending QIR with non-confluent constructs (e.g., side-effects) would require significant work. Theorem 2. QIR with the reduction rules of Definition 2 verifies the Standardization theorem, that is, if an expression e has a normal form, it can be obtained from e by reducing successively its leftmost outermost redex. 5.2 A measure for “good” output plans In this Section, I formally define the measure characterizing “good” QIR expressions. Definition 3. Supported operators are operators that are supported by the database, according to the mechanism discussed in Section 3. Definition 4. Supported expressions are expressions that are supported by the database inside operator configurations, according to the mechanism discussed in Section 3. Definition 5. An operator is called compatible if it is supported and has supported expressions as configuration. Any other operator or expression that is not an operator is called incompatible. Note that the compatibility of an operator is independent of the compatibility of its children. 8 Definition 6. Let e be an expression and F a context. We say that F is a fragment if either e = C[t(t1 , . . . , ti−1 , F [e1 , . . . , en ], ti+1 , . . . , tj )] or e = F [e1 , . . . , en ], where: • C is a one-hole context with arbitrary expressions • t is an incompatible j-ary expression • F is a n-hole context made only of compatible operators • t1 , . . . , ti−1 , ti+1 , . . . , tj and F [e1 , . . . , en ] are the j children of t • e1 , . . . , en are incompatible expressions C t F e1 … … en Figure 2: A fragment F This definition is illustrated in Figure 2. Definition 7. Let e be an expression. We define Op (e) as the number of operators in e, Comp (e) as the number of compatible operators in e and Frag (e) as the number of fragments in e. Definition 8. Let e be an expression. We define the measure for good output expressions as the pair M (e) = (Op (e) − Comp (e) , Frag (e)). Moreover, expressions are ordered using the lexicographical order on this measure. The intuition about this measure is as follows. We want to consider reduction chains for which the measure decreases, that is, reductions e →∗ e0 verifying one of the following conditions. • Op (e0 ) − Comp (e0 ) < Op (e) − Comp (e) • Op (e0 ) − Comp (e0 ) = Op (e) − Comp (e) and Frag (e0 ) < Frag (e) When a reduction transforms an incompatible operator into a compatible operator, the measure Op (e) − Comp (e) decreases. For instance, in Example 1, Op (e) − Comp (e) = 2 − 1 = 1 (since f is a variable, it is not supported by the database) and Op (e0 ) − Comp (e0 ) = 2 − 2 = 0. Example 1. e →∗ let f = λx. x = 2 in Selectλt.f (t.id) (Scane1 ()) →∗ Selectλt. e0 t.id=2 (Scane1 ()) When a reduction inlines operators as children of other operators, Op (e) − Comp (e) stays the same (since no operator is created nor modified) and Frag (e) decreases. For instance, in Examples 2 and 3, Op (e) − Comp (e) = Op (e0 ) − Comp (e0 ) = 2 − 2 = 0, Frag (e) = 2 and Frag (e0 ) = 1. Example 2. →∗ →∗ Selectλt. e0 t.id=2 (Scane1 ()) →∗ ∗ t.id=2 (x) in f (Scane1 ()) → Selectλt. e0 t.id=2 (Scane1 ()) e let x = Scane1 () in Selectλt. t.id=2 (x) Example 3. e let f = λx. Selectλt. In the infinite recursion of Example 4, unfolding one step of recursion does not change the measure, which hints that the plan is not getting better. Example 4. e let rec f = λx. Selectλt. f (Scane1 ()) e0 let rec f = λx. Selectλt. t.id=2 (f x) in →∗ Select λt. t.id=2 (f (Scane1 ())) →∗ t.id=2 (f x) in This intuition generalizes well to binary operators, with which a reduction can duplicate operators (e.g., Example 5). If all duplicated operators are compatible, Op (e) − Comp (e) stays the same (since the duplicated operators are compatible) therefore it is a good reduction if the 9 number of fragments decreases. In this case, the database will get a bigger plan in which it can perform optimizations (such as caching). Conversely, if a duplicated operator is incompatible, Op (e) − Comp (e) increases, meaning that the reduction should not happen. In this situation, this operator should in fact be evaluated once in memory and its result cached to be reused multiple times during the expression evaluation. For instance, in Example 5, if e1 is supported, Op (e) − Comp (e) = 3 − 3 = 0, Op (e0 ) − Comp (e0 ) = 5 − 5 = 0, Frag (e) = 2 and Frag (e0 ) = 1, and if e1 is not supported, Op (e) − Comp (e) = 3 − 2 = 1, Op (e0 ) − Comp (e0 ) = 5 − 3 = 2. Example 5. e let x = Selecte1 (Scane2 ()) in Joinλt1.λt2. t1.id=t2.name (x, x) e0 Joinλt1.λt2. t1.id=t2.name (Selecte1 (Scane2 ()), →∗ Select (Scan ())) e1 e2 →∗ Lemma 1. The measure M of Definition 8 induces a well-founded order on expressions. 5.3 An exhaustive reduction strategy Given the measure M described in Section 5.2 and an expression e, the question is now to find a reduced term e0 such that e →∗ e0 and M (e0 ) is minimal. During my internship, I first designed and implemented the exhaustive reduction strategy presented formally in this section. Definition 9. Let e be an expression. We denote by Rdxs (e) the set of redexes in e, and for r ∈ Rdxs (e), we write e →r e0 to state that e0 can be obtained from e in one reduction step by contracting r. Definition 10. Let e be an expression. We recursively define Red0 (e) as the singleton {e} and 00 0 0 0 00 ∀n S > 0, Redn (e) = {e | e ∈ Redn−1 (e) , r ∈ Rdxs (e ) , e →r e }. We write 0 Reds (e) to denote n∈N Redn (e). Finally we define MinReds (e) as the set argmine0 ∈Reds(e) M (e ). Notice that for some expressions e (e.g., expressions containing recursions), Reds (e) and MinReds (e) may be infinite and an algorithm that iteratively constructs the Redn (e) may not terminate. Conversely, if e is strongly normalizing, Reds (e) and MinReds (e) are finite and such an algorithm terminates. In general, the parallel exploration of all redexes leads to a combinatorial explosion, and I will show in Section 6 that my implementation of this algorithm timeouts on moderately large expressions. Theorem 3. The reduction strategy of Definition 10 is exhaustive, i.e., ∀e, ∀e0 , e →∗ e0 ⇔ e0 ∈ Reds (e). Proof. (⇐) If e0 ∈ Reds (e) then ∃n ∈ N, e0 ∈ Redn (e). The proof follows an induction on n. If n = 0 then e = e0 therefore e →∗ e0 . For n > 0, we know that ∃e00 ∈ Redn−1 (e) , ∃r ∈ Rdxs (e00 ) , e00 →r e0 . Thus, e00 → e0 and by induction hypothesis e →∗ e00 therefore e →∗ e0 . (⇒) If e →∗ e0 then ∃n ∈ N, e →n e0 . The proof follows an induction on n. If n = 0 then e = e0 and e0 ∈ Red0 (e) ⊆ Reds (e). For n > 0, we know that ∃e00 , e →n−1 e00 → e0 . By induction hypothesis, e00 ∈ Reds (e) and ∃n0 ∈ N, e00 ∈ Redn0 (e). Therefore e0 ∈ Redn0 +1 (e) ⊆ Reds (e). Lemma 2. ∀e, MinReds (e) 6= ∅. Theorem 4. The reduction strategy of Definition 10 is optimal, i.e., ∀e, ∀e0 , e →∗ e0 ⇒ e0 ∈ MinReds (e) ∨ ∃e00 ∈ MinReds (e) , M (e00 ) < M (e0 ). Proof. Suppose that e →∗ e0 . Using Theorem 3 we know that e0 ∈ Reds (e). Using Lemma 2, we know that MinReds (e) = 6 ∅ and we denote by Mmin the measure M of the elements of MinReds (e). Then, either M (e0 ) = Mmin and e0 ∈ MinReds (e) by definition, or M (e0 ) > Mmin and using again Lemma 2 we can find e00 ∈ MinReds (e) , M (e00 ) < M (e0 ). As discussed above, this reduction strategy is not realistic in terms of complexity for a direct implementation and may not even terminate in some cases. Nevertheless, Theorem 4 states that it can be used as a yardstick to discuss the optimality of other reduction strategies. 10 5.4 A heuristic-based reduction strategy Given the conclusion of Section 5.3, I started working on a more efficient evaluation strategy. In this section, I formally describe an efficient, always-terminating heuristic, corresponding to a partial exploration of the possible reductions, then give proofs of its properties. This heuristic-based reduction strategy supposes the existence of an integer constant Φ representing the “fuel” that can be consumed by the reduction. It consists of two main passes. The first pass tries to reduce redexes that could make operators compatible by assuming that (i) operators with free variables in their configuration have few chances to be compatible and (ii) reducing redexes inside operator configurations increases the odds of making an operator compatible. The second pass tries to decrease the number of fragments by reducing redexes inside the children expressions of the operators. Both passes guarantee that the measure of the global expression always decreases after a number of reduction steps bounded by Φ. For readability purposes, I first describe the search space tree explored by the heuristic then define the result of the algorithm as a particular expression in this search space. The actual implementation corresponds to a depth-first exploration of the search space, with decision points and back-tracking. Definition 11. Let e be an expression. We define its operator contexts OpContexts (e) as the set of contexts {C[] | e = C[op], op is an operator}. Definition 12. Let e be an expression and C[] an operator context in OpContexts (e). We define the free variables of a configuration ConfigFVars (e, C[]) as the list of variables [v | e = C[opC 0 [v] (. . .)], v is a free variable in C 0 [v]] sorted using a depth-first left-to-right traversal of C 0 [v]. Definition 13. Let e be an expression and C[] an operator context in OpContexts (e). We define the redexes of a configuration ConfigRdxs (e, C[]) as the list of redexes [r | e = C[opC 0 [r] (. . .)], r is a redex] sorted using a depth-first left-to-right traversal of C 0 [v]. Definition 14. Let e be an expression and C[] an operator context in OpContexts (e). We define the children expressions Children (e, C[]) as the list of expressions [ci | e = C[op... (c1 , . . . , cn )]]. Definition 15. The following three definitions are mutually recursive and therefore presented together in this document. Let e be an expression and e0 a subexpression of e. We define HMakeRedex (e, e0 ) as • e00 , such that e →r e00 , if e0 is already a redex r • HMakeRedex (e, e00 ) if e0 = (e00 e1 ), e0 = destr e00 e1 e2 , e0 = tdestr e00 s, e0 = if e00 then e1 else e2 , e0 = e00 and (true/false) or e0 = (true/false) and e00 (and similarily for other ρ-redexes). • HInlineVar (e, v) if e0 is a variable v • None otherwise Let e be an expression and e0 a subexpression of e. We define HContractLam (e, e0 ) as • HMakeRedex (e, e00 ) where e = C[e00 ], if e = C[e0 e1 ], e = C[e1 e0 ], e = C[destr e0 e1 e2 ], e = C[destr e1 e0 e2 ], e = C[destr e1 e2 e0 ], e = C[tdestr e0 s], e = C[if e1 then e0 else e2 ] or e = C[if e1 then e2 else e0 ] • HContractLam (e, e00 ) where e = C[e00 ], if e = C[λv. e0 ], e = C[cons e0 e1 ], e = C[cons e1 e0 ], e = C[tcons s e0 e1 ] or e = C[tcons s e1 e0 ] • None otherwise Let e be an expression and v a variable in e. We define the inlining HInlineVar (e, v) as • None if v is free in e • HContractLam (e, l), where l is the λ binding v in e, otherwise 11 HMakeRedex (e, e0 ) corresponds to (i) contracting e0 if e0 is already a redex and (ii) contracting a necessary redex in order for e0 to become a redex, otherwise. HContractLam (e, e0 ) corresponds to (i) contracting the redex containing e0 if e0 is already part of a redex and (ii) contracting a necessary redex in order for e0 to become part of a redex, otherwise. HInlineVar (e, v) corresponds to contracting a necessary redex in order to eventually substitute v by its definition. Consider for instance the expression e given in Example 6. To go towards the inlining of the variable tl in the configuration of the Scan operator, the heuristic calls HInlineVar (e, tl), which tries to contract the binding lambda by calling HContractLam (e, λtl. Scanf tl ()). This lambda cannot be contracted before the lambda above it, and therefore HContractLam (e, λhd. λtl. . . .) is called recursively. Again, this lambda cannot be contracted before the head destr, but this requires its first child expression to be reduced to a cons. This is the reason why the heuristic recursively calls HMakeRedex (e, (λx. x) (cons . . .)), which contracts its argument redex. Example 6. e destr ((λx. x) (cons 1 (cons 2 nil))) false (λhd. λtl. Scanf tl ()) e0 destr (cons 1 (cons 2 nil)) → false (λhd. λtl. Scanf tl ()) → Definition 16. Let e be an expression, C[] an operator context in OpContexts (e), V = [v ∈ ConfigFVars (e, C[]) | HInlineVar (e, v) = 6 None] and R = ConfigRdxs (e, C[]). We define the onestep reduction of the operator configuration HOneRedConfig (e, C[]) as • HInlineVar (e, v) such that v is the first element of L, if L is non empty • e0 , such that e →r e0 and r is the first element of R, if R is non empty • None otherwise This means that for a given operator, the heuristic first tries to find a free variable that can be inlined, then if there is no such variable, it reduces the configuration using a leftmost outermost (call-by-name) reduction strategy, and finally if there is no redex to reduce, it returns None. In the following definitions, we will describe (search space) trees of expressions using the notations given in Section 2. Definition 17. Let e be an expression, C[] an operator context in OpContexts (e), φ an integer and e0 = HOneRedConfig (e, C[]). We define HRedConfigφ (e, C[]) as • e() if φ = 0 or if e0 = None • e0 ([HRedConfigΦ (e0 , op) | op ∈ OpContexts (e0 ) ]) if M (e0 ) < M (e) • e([HRedConfigφ−1 (e0 , op) | op ∈ OpContexts (e0 ) ]) otherwise Definition 18. Let e be an expression. The search space HConfigSSΦ (e) after the first pass is defined as e([HRedConfigΦ (e, op) | op ∈ OpContexts (e) ]). HConfigSSΦ (e) corresponds to the recursive exploration of the search space tree for reductions in configurations, with the guarantee that search space subtrees in which the measure does not decrease have a depth bounded by Φ. Definition 19. Let e be an expression. The result expression HConfigΦ (e) of the first pass is defined as follows. First, the rewrite rule x(s1 , . . . , si , x(), si+2 , sn ) → x(s1 , . . . , si , si+2 , sn ) is applied on HConfigSSΦ (e) as much as possible. Then, the leftmost leaf is chosen. The rewrite rule corresponds to pruning search space subtrees in HConfigSSΦ (e) that failed to reach an expression with smaller measure, whereas taking the leftmost leaf is a heuristic decision corresponding to never backtrack to expressions with larger measure than the current candidate (for performance reasons). Definition 20. Let e be an expression, C[] an operator context in OpContexts (e) and L = [c ∈ Children (e, C[]) | HMakeRedex (e, c) = 6 None]. We define the one-step reduction of the operator children HOneRedChild (e, C[]) as 12 • HMakeRedex (e, c) such that c is the first element of L, if L is non empty • None otherwise This means that for a given operator, the heuristic tries to find a child expression that can be reduced (using a call-by-name reduction strategy) in order to regroup fragments, and if there is no such child, it returns None. Definition 21. Let e be an expression, C[] an operator context in OpContexts (e), φ an integer and e0 = HOneRedChild (e, C[]). We define HRedChildφ (e, C[]) as • e() if φ = 0 or if e0 = None • e0 ([HRedChildΦ (e0 , op) | op ∈ OpContexts (e0 ) ]) if M (e0 ) < M (e) • e([HRedChildφ−1 (e0 , op) | op ∈ OpContexts (e0 ) ]) otherwise Definition 22. Let e be an expression. The search space HChildrenSSΦ (e) after the second pass is defined as e([HRedChildΦ (e, op) | op ∈ OpContexts (e) ]). HChildrenSSΦ (e) corresponds to the recursive exploration of the search space tree for reduction in children, with the guarantee that search space subtrees in which the measure does not decrease have a depth bounded by Φ. Definition 23. Let e be an expression. The result expression HChildrenΦ (e) of the second pass is defined as follows. First, the rewrite rule x(s1 , . . . , si , x(), si+2 , sn ) → x(s1 , . . . , si , si+2 , sn ) is applied on HChildrenSSΦ (e) as much as possible. Then, the leftmost leaf is chosen. Similarly to Definition 19, the rewrite rule corresponds to pruning search space subtrees in HChildrenSSΦ (e) that failed to reach an expression with smaller measure, whereas taking the leftmost leaf is a heuristic decision. Definition 24. Let e be an expression. The result expression HMinRedΦ (e) of the heuristic reduction is defined as HChildrenΦ (HConfigΦ (e)). Figure 3 illustrates the construction of the two search spaces (cf. Definitions 18 and 22) leading to the computation of HMinRedΦ (e). Dots and stars represent expressions considered by the heuristic as a possible reduction of their parent, but stars correspond to the special case where the measure of the expression is smaller than the measure of its parent, i.e., when the heuristic made progress. We will now continue towards a proof of termination of this reduction strategy (Theorem 5). Definition 25. Considering an expression with subexpressions as a tree with subtrees, we define a traversal of an expression as follows, starting from the head expression: • for a nullary expression, visit this expression. • for λx. e1 , cons e1 e2 and tcons s e1 e2 , visit this expression then traverse the children from left to right (e1 then e2 . . . then en ). • for other n-ary expressions (e.g., (e1 e2 ), destr e1 e2 e3 , etc.), traverse the children from left to right (e1 then e2 . . . then en ), then visit the expression. We denote by TraversalPos (e, e0 ) the position of a subexpression e0 in this traversal of e. TraversalPos (e, .) actually induces a well-founded order on the locations of the subexpressions that are arguments of the recursive calls to HInlineVar (., .), HMakeRedex (., .) and HContractLam (., .) made by the heuristic. It will be used in inductions in some of the following proofs. 13 destr 16 … … ( … … λx 1 x 2 HConfigSSФ HMinRedФ … … false 9 ) 8 cons 5 2 6 … HChildrenSSФ λtl 11 cons 3 1 4 λhd 10 nil 7 Scan 15 ( f 12 Figure 3: HMinRedΦ (e) and the search spaces HConfigSSΦ (e) and HChildrenSSΦ (HConfigΦ (e)) ) 14 tl 13 Figure 4: Example of expression traversal For example, consider again the expression e from Example 6 and its traversal given in Figure 4. Remember the chain of recursive calls made by the heuristic (HInlineVar (e, tl), which calls HContractLam (e, λtl. Scanf tl ()), which calls HContractLam (e, λhd. λtl. . . .), which indirectly calls HMakeRedex (e, (λx. x) (cons . . .)), which finally contracts this redex) and notice that TraversalPos (e, tl) > TraversalPos (e, λtl. Scanf tl ()) > TraversalPos (e, λhd. λtl. . . .) > TraversalPos (e, (λx. x) (cons . . .)). Lemma 3. For all expression e the following properties hold. • For a variable e0 in e, HInlineVar (e, e0 ) returns None or contracts a redex. • For a subexpression e0 in e, HMakeRedex (e, e0 ) returns None or contracts a redex. • For a subexpression e0 in e, HContractLam (e, e0 ) returns None or contracts a redex. These three properties not only show that the objects used to describe the heuristic are well defined, but also mean that correct implementations of HInlineVar (., .), HMakeRedex (., .) and HContractLam (., .) terminate. Lemma 4. For all expression e, the search space HConfigSSΦ (e) (resp. HChildrenSSΦ (e)) has bounded size. Theorem 5. This reduction strategy always terminates, that is, for an input expression e, it always considers a finite number of expressions e0 such that e →∗ e0 in order to find HMinRedΦ (e). Proof. Using Lemma 4, this reduction strategy only considers a finite number of expressions e1 such that e →∗ e1 in order to find HConfigΦ (e), then using Lemma 4 again, it only considers a finite number of expressions e2 such that HConfigΦ (e) →∗ e2 in order to find HChildrenΦ (HConfigΦ (e)) = HMinRedΦ (e). We will now continue towards a proof that under some hypotheses this reduction strategy is complete, that is, it returns an optimal result for a big enough fuel value (Theorem 6). In the following proofs, we will need a way to track subexpressions of an expression and understand how they are duplicated, erased or simply moved across successive reductions of the main expression. Borrowing an idea used in [2] to define residuals, we annotate all subexpressions of the original expression with unique identifiers, simply propagate such identifiers along reductions without altering them, and reason on identifiers in the final expression. Definition 26. Let e0 be a QIR expression, e a subexpression of e0 and en a QIR expression such that e0 →∗ en . We define Occurences (en , e) as the set of subexpressions of en with the same identifiers as e when identifiers are propagated along the reduction chain e0 →∗ en . For instance, the QIR reduction (λx. λy. f x x) z z → (λy. f z z) z → f z z can be annotated as follows: (λ1 x. λ2 y. f 3 x4 x5 ) z 6 z 7 → (λ2 y. f 3 z 6 z 6 ) z 7 → f 3 z 6 z 6 . 14 One can see, just by looking at identifiers, that the first z variable produced both z variables of the final expression: it has two occurences in the final expression. The other one disappeared: it has no occurence in the final expression. A more formal definition of Occurences (en , e) is given in Appendix C. The following definitions use the Occurences (., .) notation but do not depend on the internals of its definition. Definition 27. Let e be an expression, e0 a subexpression of e and r a redex such that e →r e00 and Occurences (e00 , e0 ) = ∅. Borrowing a concept from [2], we say that r erases e0 if e0 is not part of the redex r, that is if e0 is a subexpression of an expression e00 such that one of the following conditions holds. • r = (λx. e1 ) e00 and x is not free in e1 • r = if true then e1 else e00 00 • r = destr nil e1 e • r = if false then e00 else e1 • r = destr (cons . . .) e00 e1 • r = true and e00 (and similarly for other 00 • r = tdestr (tcons "s1" e1 e ) "s1" ρ-redexes) • r = tdestr (tcons "s1" e00 e1 ) "s2" Definition 28. Let e be an expression, e0 a subexpression of e and r a redex such that e →r e00 and Occurences (e00 , e0 ) = ∅. We say that r consumes e0 if e0 is part of the redex r, that is if one of the following conditions holds. • r = tdestr e0 s • r = e0 0 • r = if e0 then e1 else e2 • r = (e e1 ) 0 • r = e0 and e1 (and similarly for other • r = (λv. e1 ) e2 and e is the variable v free in e1 ρ-redexes) • r = destr e0 e1 e2 Lemma 5. Let e be an expression, e0 a subexpression of e and r a redex in e. If e →r e00 and Occurences (e00 , e0 ) = ∅, then r either consumes or erases e0 . Definition 29. Let e be an expression, e0 a subexpression of e and r a redex in e such that e →r e00 , we say that r duplicates e0 if |Occurences (e00 , e0 ) | > 1. Definition 30. Let e0 be an expression and e0 a subexpression of e0 . We say that e0 cannot be erased (resp. consumed, duplicated) if there is no reduction chain e0 →r1 . . . →rn en such that rn erases (resp. consumes, duplicates) an element of Occurences (en−1 , e0 ). Lemma 6. Let e be an expression and e0 a subexpression of e. The following properties hold. • If e0 is a variable v and if HInlineVar (e, v) returns None then e0 cannot be consumed. • If HMakeRedex (e, e0 ) returns None then e0 cannot be consumed. • If HContractLam (e, e0 ) returns None then e0 cannot be consumed. Definition 31. We say that an expression e has the fixed operators property if no operator in e can be erased or duplicated. Remember that the definition of compatible operators (Definitions 3, 4 and 5) depends on an arbitrary external module describing the capabilities of the target database (cf. Section 3). The following restriction allows us to reason on this module. Definition 32. We say that a database verifies the stable compatibility property if, given an expression e, an operator op in {op | C[] ∈ OpContexts (e) , e = C[op]} such that op is compatible and an expression e0 such that e →∗ e0 , each operator op0 ∈ Occurences (op, e0 ) is also compatible. This last definition should hold for a realistic database and an accurate description of its capabilities. Indeed, it basically says that if an operator is compatible, any reduction either does not affect the operator or helps the database by simplifying its configuration. Lemma 7. Let e be an expression with fixed operators and r a redex in e. For a database with stable compatibility, if e →r e0 then M (e0 ) ≤ M (e). 15 Lemma 8. Let e be a weakly-normalizing expression with fixed operators. For a database with stable compatibility, the normal form of e has minimal measure. Lemma 9. Let e be a weakly-normalizing expression with fixed operators, emin an expression in MinReds (e) and e0 an expression such that e →∗ e0 and Op (e0 ) − Comp (e0 ) = Op (emin ) − Comp (emin ). For a database with stable compatibility, an operator is compatible in emin if and only if it is compatible in e0 . Theorem 6. For databases with stable compatibility, the reduction strategy of Definition 24 is complete on strongly-normalizing expressions with fixed operators. That is, for a database with stable compatibility, given a strongly-normalizing input expression e with fixed operators, there exists a fuel value Φ such that HMinRedΦ (e) ∈ MinReds (e). Proof. Remember from Definition 10 that all expressions in MinReds (e) have same (minimal) measure. Using Lemma 8, we know that the normal form eN of e is in MinReds (e). Let Mmin be its measure. Consider now eh = HMinRedΦ (e). Using Theorem 4, we know that eh ∈ MinReds (e) or M (eh ) > Mmin and we want to prove that the latter cannot happen. Suppose to the contrary that M (eh ) > Mmin . Using the definition of M (cf. Definition 8), this means that one of the two following statements holds. • Op (eh ) − Comp (eh ) is greater than the first component of Mmin • Op (eh ) − Comp (eh ) is equal to the first component of Mmin and Frag (eh ) is greater than the second component of Mmin We will prove that none of these cases can happen. • Suppose that Op (eh ) − Comp (eh ) is greater than the first component of Mmin . Since e has the fixed operators property, there is a one-to-one correspondance between the operators of eN and eh . Therefore, we know that Comp (eh ) < Comp (eN ) and there exists an operator op in e such that Occurences (eh , op) = {oph }, Occurences (eN , op) = {opN }, opN is compatible and oph is not compatible. Let ch (resp. cN ) be the configuration of oph (resp. opN ). The question now is to understand how the first pass of the heuristic-based algorithm (cf. Definition 19) could fail to make op compatible. Remember Lemma 3 telling that HInlineVar (., .) and HMakeRedex (., .) either contract a redex or return None, and keep in mind that such reductions maintain a single instance of ch in the reduced forms of eh (fixed operator hypothesis). Since e is strongly-normalizing, this means that there is a fuel value Φ allowing the heuristic to make enough calls to HInlineVar (., .) on the free variables of ch in order to get to an expression e0h = C 0 [opc0h (. . .)] such that (i) there is no free variable in c0h or (ii) calls to HInlineVar (e0h , .) return None for every free variable of c0h . Continuing from this point, since e is strongly-normalizing, e0h and c0h are also strongly normalizing. Thus, Theorem 2 tells that there is a fuel value Φ allowing the heuristic to reduce all redexes of c0h and reach a normal form c00h and an expression e00h = C 0 [opc00h (. . .)]. Since we supposed that the heuristic failed to make op compatible, this means that c00h is different from cN . Using Theorem 1 (confluence), we know there is reduction e00h →∗ eN . Since the redexes contracted in this chain cannot erase nor duplicate operators (fixed operator hypothesis), the reduction chain can only affect c00h in the following ways. – Substitute free variables in c00h . This cannot happen: by hypothesis, either (i) there is no free variable in c0h and therefore in c00h or (ii) calls to HInlineVar (e0h , .) return None for every free variable of c0h and using Lemma 6, such a variable cannot be consumed. – Reduce redexes located inside c00h . This cannot happen since c00h is in normal form. – Leave c00h untouched. This leads to a contradiction: c00h is equal to cN . Therefore, there is a fuel value such that the heuristic makes op compatible. Now, taking the maximum of the required values of Φ to make each operator compatible, there exists a value of Φ such that Op (eh ) − Comp (eh ) is equal to the first component of Mmin . • Suppose now that Op (eh ) − Comp (eh ) is equal to the first component of Mmin and Frag (eh ) is greater than the second component of Mmin . Since e has the fixed operators property, there is a one-to-one correspondance between the operators of eN and eh . Using Lemma 9, we know that there exists an operator op in e such that Occurences (eh , op) = {oph }, 16 Occurences (eN , op) = {opN }, opN and oph are both compatible, opN has a compatible child operator cN and the child expression ch of oph is incompatible (i.e., not a compatible operator). The question now is to understand how the second pass of the heuristic-based algorithm (cf. Definition 23) could fail to reduce ch to a compatible operator. Remember Lemma 3 telling that HMakeRedex (., .) either contracts a redex or returns None, and keep in mind that such reductions maintain a single instance of oph in the reduced forms of eh (fixed operator hypothesis). Since e is strongly-normalizing, this means that there is a fuel value Φ allowing the heuristic to make enough calls to HMakeRedex (., .) on ch in order to get to an expression e0h = C 0 [op... (. . . , c0h , . . .)] such that calls to HMakeRedex (c0h , .) returns None. Since we supposed that the heuristic failed to reduce ch to a compatible operator, this means that the head of c0h is different from the head of cN (which is a compatible operator). Using Lemma 6, c0h cannot be consumed, and as the child expression of an operator that cannot be erased, c0h cannot be erased either. According to Lemma 5 this contradicts the confluence theorem telling that e0h →∗ eN . Therefore, there is a fuel value such that the heuristic reduces ch to a compatible operator. Now, taking the maximum of the required values of Φ to reduce the children of all operators, there exists a value of Φ such that Frag (eh ) is equal to the second component of Mmin . We also conjecture that the result of Theorem 6 still holds for weakly-normalizing expressions. Conjecture 1. For databases with stable compatibility, the reduction strategy of Definition 24 is complete on weakly-normalizing expressions with fixed operators. That is, for a database with stable compatibility, given a weakly-normalizing input expression e with fixed operators, there exists a fuel value Φ such that HMinRedΦ (e) ∈ MinReds (e). See Appendix D for an intuition of why this holds and the current state of the proof. We will now explain why none of the remaining hypotheses can be removed. Stable compatiblity Consider a database for which the Scan operator is compatible if its configuration has more than two free variables. Obviously, it would not have the stable compatibility property, since inlining the definition of these variables could reduce the number of free variables in the configuration. Take now expression e from Example 7. Since the heuristic tries to inline variables before reducing redexes in the configurations, it will never consider expression e0 , which is the only element of MinReds (e). Example 7. (λt. Scan(λx. x=x) e t ()) 1 →∗ →∗ (λt. Scanλx. e0 t=t ()) 1 For the next counterexamples, we will suppose a simplistic database capabilities description, for which all operators are compatible as long as there is no free variable in their configuration (such a database would have the stable compatibility property). Non-normalizing expressions Consider expression e from Example 8. Obviously, it is nonnormalizing because of the Ω = (λx. x x) (λx. x x) in the configuration. Since the heuristic applies a call-by-name reduction strategy on the configurations once all free variables are inlined, it will consume all the fuel on Ω and never consider e0 , which is the only element of MinReds (e). Example 8. e Scan((λx. x x) (λx. x x)) ((λx. 1) y) () →∗ →∗ Scan((λx. x x) (λx. x e0 x)) 1 () Operator erasure Consider expression e from Example 9. Obviously, the Scanx () operator can be erased. Since the heuristic tries to inline variables in configurations, reduce configurations then regroup fragments, it will never consider e0 , which is the only element of MinReds (e). Example 9. e if false then Scanx () else Scandb.table () →∗ →∗ Scandb.table () 17 e0 Operator duplication Consider expression e from Example 10. Obviously, the Scanz operator can be duplicated. The heuristic will try to inline y in the configuration of the two Join operators, which requires to inline x first. Since this two-step reduction decreases the measure and because the heuristic chooses the leftmost leaf of the configuration search space, e0 will never be considered although it is the only element of MinReds (e). Example 10. e (λx. λy. Joinif false then y else true ( Scandb.table (), Joinif false then y else )) Scanz () false E H SN P FO Figure 5: Situation summary →∗ e0 (λx. λy. Jointrue ( ∗ Scan (x, x) → db.table (), Jointrue (x, x) true )) Scanz () false Figure 5 sums up the situation. In this Venn diagram, E stands for the set of all QIR expressions, SN for the set of strongly-normalizing QIR expressions, F O for the set of QIR expression with fixed operators, H for the set of QIR expressions on which the heuristic returns an optimal result and P for the set of QIR expressions for which I proved that the heuristic returns such a result. As I will show in Section 6, H is larger than P : in fact the heuristic returns optimal results on all our real-world use cases. In Appendix E, I discuss how the fuel value Φ can be estimated by analyzing the QIR code. Though, an implementation of a module doing such an estimation is future work, and for now, Φ has to be set by the developer. 6 Experiments In this section, I present real-world use cases and show how the QIR evaluation strategies discussed in Section 5 perform on these examples. In the following experiments, the target database language is SQL and for conciseness, I never show the application code but rather quickly describe the applications themselves. The provided timings have been measured on my personal laptop (Core i5 M450 @2.4GHz, 8Go RAM). Although my setup is not precise enough for fine-grained performance comparison, it enables an order of magnitude analysis and delivers interesting results. 6.1 Example of code factorization: analytics queries Consider the following analytics query written in SQL and freely inspired by the TPC-H benchmark. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SELECT l _ r e t u r n f l a g AS r e t u r n _ f l a g , l _ l i n e s t a t u s AS l i n e _ s t a t u s , SUM( l _ e x t e n d e d _ p r i c e ) AS sum_base_price , SUM( l _ e x t e n d e d _ p r i c e ∗ ( 1 − l _ d i s c o u n t ) ) AS sum_disc_price , SUM( l _ e x t e n d e d _ p r i c e ∗ ( 1 − l _ d i s c o u n t ) ∗ ( 1 + l_tax ) ) AS sum_charge , SUM( l _ e x t e n d e d _ p r i c e ) ∗ 0 . 7 5 AS sum_real_cost , SUM( l _ e x t e n d e d _ p r i c e ) ∗ 0 . 2 5 AS sum_margin , AVG( l _ e x t e n d e d _ p r i c e ) AS avg_base_price , AVG( l _ e x t e n d e d _ p r i c e ∗ ( 1 − l _ d i s c o u n t ) ) AS avg_disc_price , AVG( l _ e x t e n d e d _ p r i c e ∗ ( 1 − l _ d i s c o u n t ) ∗ ( 1 + l_tax ) ) AS avg_charge , AVG( l _ e x t e n d e d _ p r i c e ) ∗ 0 . 7 5 AS avg_real_cost , AVG( l _ e x t e n d e d _ p r i c e ) ∗ 0 . 2 5 AS avg_margin FROM db . l i n e i t e m GROUP BY l _ r e t u r n _ f l a g , l _ l i n e s t a t u s ORDER BY l _ r e t u r n _ f l a g , l _ l i n e s t a t u s 18 Notice in particular the many common expressions that are used to compose the aggregation functions of the query. To factorize code and increase the maintainability of the code, the application developer might want to define these expressions only once and reuse them throughout the query. For better readability, he might also store subexpressions in variables instead of writing the query in one block. The direct translation of this kind of code to QIR would lead to the following query representation (remember that in QIR, as opposed to SQL’s strange syntax, aggregations functions belong to the configuration of the Group operator). 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 /∗ C o n s t r u c t s t h e l i s t o f p r o j e c t e d a t t r i b u t e s ∗/ let project_list = λtup. let real_cost = 0.75 in let margin = 0.25 in let return_f lag = tdestr tup "l_returnflag" in let line_status = tdestr tup "l_linestatus" in let sum_base_price = tdestr tup "sum_base_price" in let sum_disc_price = tdestr tup "sum_disc_price" in let sum_charge = tdestr tup "sum_charge" in let avg_base_price = tdestr tup "avg_base_price" in let avg_disc_price = tdestr tup "avg_disc_price" in let avg_charge = tdestr tup "avg_charge" in tcons "return_flag" return_f lag ( tcons "line_status" line_status ( tcons "sum_base_price" sum_base_price ( tcons "sum_disc_price" sum_disc_price ( tcons "sum_charge" sum_charge ( tcons "sum_real_cost" (sum_base_price ∗ real_cost) ( tcons "sum_margin" (sum_base_price ∗ margin) ( tcons "avg_base_price" avg_base_price ( tcons "avg_disc_price" avg_disc_price ( tcons "avg_charge" avg_charge ( tcons "avg_real_cost" (avg_base_price ∗ real_cost) ( tcons "avg_margin" (avg_base_price ∗ margin) ( tnil)))))))))))) in /∗ C o n s t r u c t s t h e l i s t o f g r o u p i n g / s o r t i n g a t t r i b u t e s ∗/ let group_sort_attr = λtup. cons (tdestr tup "l_returnflag") ( cons (tdestr tup "l_linestatus") ( tnil)) in /∗ C o n s t r u c t s t h e a g g r e g a t e f u n c t i o n s ∗/ let group_agg = λtup. let extended_price = tdestr tup "l_extended_price" in let discount = tdestr tup "l_discount" in let tax = tdestr tup "l_tax" in let disc_price = extended_price ∗ (1 − discount) in let charge = disc_price ∗ (1 + tax) in tcons "sum_base_price" (sum extended_price) ( tcons "sum_disc_price" (sum disc_price) ( tcons "sum_charge" (sum charge) ( tcons "avg_base_price" (avg extended_price) ( tcons "avg_disc_price" (avg disc_price) ( tcons "avg_charge" (avg charge) ( tnil)))))) in /∗ Main q u e r y ∗/ Projectproject_list (Sortgroup_sort_attr (Groupgroup_sort_attr,group_agg (Scandb.lineitem ()))) On this example, my implementation of the exhaustive reduction strategy does not terminate in reasonable time due to a combinatorial explosion. Nevertheless, it eventually finds the reduced expression with minimal measure, i.e the original expression with all definitions and common 19 expressions inlined. On the other hand, my implementation of the heuristic-based strategy quickly finds the same result for a fuel value Φ ≥ 11 (timings are given in Table 1). Furthermore, the reduced expression is a direct translation of the SQL query above, which represents an argument in favor of the measure described in Section 5.2 and used by both reduction strategies. 6.2 Example of fragment grouping: dynamic queries Consider now a simple website on which users can read small ads from people selling furniture, cars, etc. and in particular a page to browse through the offers. This page would consist mainly in a form with (i) a dropdown menu to optionally sort ads by date or price, (ii) a set of checkboxes to filter by category and (iii) an integer field with a default value to specify the number of results to display on the page. The corresponding query, fetching the results, would have to be built dynamically depending on the presence of filters and ordering. The following QIR code is a possible query representation of this logic, in which we assume that variables is_sorted, sort_attr, cat_list and limit are provided by the application context and encode the presence of a sorting attribute, the list of selected categories and the number of results to display. 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 28 29 30 31 /∗ R e c u r s i v e l y c o n s t r u c t s a l i s t o f OR o f t h e s e l e c t e d c a t e g o r i e s ∗/ let make_cat_f ilter = λcat_list. λtup. let rec aux = λf ilter. λcat_list. destr cat_list f ilter (λhd. λtl. aux ((tdestr tup "category" = hd) or f ilter) tl) in let aux2 = λcat_list. destr cat_list nil (λhd. λtl. aux (tdestr tup "category" = hd) tl) in aux2 cat_list in /∗ C o n s t r u c t s t h e o r d e r i n g a t t r i b u t e s ∗/ let make_order = λattr. λtup. if attr = "price" then cons (tdestr tup "price") nil else if attr = "date" then cons (tdestr tup "timestamp") nil else nil in /∗ C o n s t r u c t s t h e l i s t o f p r o j e c t e d a t t r i b u t e s ∗/ let project_list = λtup. tcons "title" (tdestr tup "title") ( tcons "description" (tdestr tup "description") ( tnil)) in /∗ Base t a b l e ∗/ let ads = Scandb.ads () in /∗ A f t e r c a t e g o r y f i l t e r s ∗/ let ads_f iltered = destr cat_list ads (λhd. λtl. Selectmake_cat_f ilter /∗ A f t e r ( o p t i o n a l ) o r d e r i n g ∗/ let ads_ordered = if is_sorted then Sortmake_order cat_list (ads)) sort_attr (ads_f iltered) in else ads_f iltered in /∗ Main q u e r y ∗/ Projectproject_list (Limitlimit (ads_ordered)) On this example, my implementation of the exhaustive reduction strategy does not terminate, since one can obtain infinitely many distinct reductions of the original expression by unfolding the recursive call of aux in make_cat_filter. Conversely, my implementation of the heuristic-based strategy quickly finds the result expression with minimal measure (timings are given in Table 1). For instance, with cat_list set to nil, is_sorted set to false and limit set to 20 the result found with Φ ≥ 15 is Projectλt. tcons "title" (tdestr t "title") (tcons "description" (tdestr t "description") tnil) ( Limit20 (Scandb.ads ())) 20 And with cat_list set to cons "housing" (cons "cars" nil), is_sorted set to true, sort_attr set to date and limit set to 30 the result found with Φ ≥ 24 is Projectλt. tcons "title" (tdestr t "title") (tcons "description" (tdestr t "description") tnil) ( Limit30 (Sortλt. cons (tdestr t "timestamp") nil ( Selectλt. tdestr t "category"="cars" or tdestr t "category"="housing" (Scandb.ads ())))) Again, the result expression corresponds clearly to a SQL query, and this is a second example of the effectiveness of the measure described in Section 5.2. 6.3 Example of incompatibility: caching Following on the previous example, consider a page on which an admin can detect if an unexperienced user has published the same ad twice. Assume there is a function unexperienced(user_id) outside the query boundary, telling if a user is unexperienced. This function would be translated into a Truffle dependency, and represented in the QIR code by a Truffle reference truffle<0>. The following QIR code could correspond to the query used by the page. 1 2 3 4 5 6 7 8 9 10 11 12 13 /∗ C o n s t r u c t s t h e l i s t o f p r o j e c t e d a t t r i b u t e s ∗/ let project_list = λtup. tcons "user_id" (tdestr tup "user_id") tnil in /∗ C o n s t r u c t s t h e j o i n c o n d i t i o n ∗/ let join_cond = λtup1. λtup2. (tdestr tup1 "title" = tdestr tup2 "title") and not (tdestr tup1 "ad_id" = tdestr tup2 "ad_id") in /∗ U n e x p e r i e n c e d u s e r s ∗/ let ads_unex_users = Selectλtup. truffle<0> (tdestr tup "user_id") (Scandb.ads ()) in /∗ Main q u e r y ∗/ Projectproject_list (Joinjoin_cond (ads_unex_users, ads_unex_users)) This is one example of situation where reducing a redex (e.g., inlining ads_unex_users) is not beneficial for the database. In this case, both the implementations of the exhaustive strategy and of the heuristic-based strategy (for Φ ≥ 1) quickly return the correct answer (timings are given in Table 1), that is let ads_f rom_unex_users = Selectλtup. truffle<0> (tdestr tup "user_id") (Scandb.ads ()) in Projecttcons "user_id" (tdestr tup "user_id") tnil ( Join(tdestr tup1 "title"=tdestr tup2 "title") and not (tdestr tup1 "ad_id"=tdestr tup2 "ad_id") ( ads_f rom_unex_users, ads_f rom_unex_users)) This corresponds to a computation where the Truffle runtime embedded in the database evaluates once ads_unex_users, stores the result on the database storage then passes the main query to the database engine. Once again this is an example of the effectiveness of the measure described in Section 5.2. Experiment Red. strategy Timing Optimal result Section 6.1 Exh. Heur. 56.63s 6ms X X Section 6.2 (1) Exh. Heur. 7ms X Section 6.2 (2) Exh. Heur. 7ms X Section 6.3 Exh. Heur. 5ms 4ms X X Table 1: Timings of experiments from Sections 6.1, 6.2 and 6.3 7 Related work As stated in the introduction, traditional data-oriented application frameworks, such as PHP with the MySQL extension or Java with the JDBC driver, construct queries in the application code 21 using string concatenation or statements, with the aforementioned impedence mismatch issue. Object-relational mappings (ORM), such as criteria queries in Hibernate and ActiveRecord in Ruby on Rails, offer a syntactic abstraction to represent querying primitives with constructs of the application language, and provide features to automatically handle translations from the application language data model to the database data model an vice versa. Although they solve part of the problem, these solutions restrict the application code sent to the database to the provided querying primitives. This results in numerous application-database roundtrips when a function of the application code (a UDF) is called from inside a query, and forms a well-known performance bottleneck[8][7]. A recent contribution[5] focuses on analyzing the application code surrounding querying primitives to translate it into the database language when possible, and inline it in the query. But this detection is based on a list of handcrafted patterns in which the choices of application language and database are hardcoded assumptions. More advanced solutions include the Forward project[6] (on which I was working last year) and Microsoft LINQ[12]. Forward offers as application language SQL++, a declarative extension of SQL tailored for web programming, and evaluates with an in-memory query processor language features not supported by the database. Although the similarities between database and application languages in terms of data models and querying primitives enable a seamless integration of queries in the application language, this framework fails to push to the database application code snippets containing unsupported features, and therefore does not fully solves the UDF performance problem. Compared to this contribution, the QIR framework offers the choice of the application language, a clean isolation of this application language from the rest of the framework, formal semantics for operators and expressions, allowing a precise description of how queries integrated in the application code are detected, translated and optimized, as well as the possibility to evaluate any application code in the database, regardless of its capabilities. LINQ integrates querying primitives for Microsoft SQL server in the application languages part of the .NET framework (e.g., C#, F#, Visual Basic). Similarly to ORMs, it provides automatic mechanisms to translate from the application language data model to the database data model an the other way around. Since LINQ has no released specification, we rely on the formal description and optimality proofs of T-LINQ[3] to compare our contribution. This approach adds to the application language a small language of expressions similar to QIR’s (variables, lambdas, applications, list and tuples) as well as a quotation/antiquotation system (to define the boundary between application code to evaluate in the application runtime and in the database query processor). Querying primitives correspond to patterns in application code (e.g., a Scan corresponds to a for loop and a Select to an if conditional. The translation to SQL includes a rewriting phase corresponding to successive iterations, on the application code AST, of the β-reduction and ad-hoc rules on these patterns. Although T-LINQ successfully gathers application code around the querying primitives and reduces it to produce efficient queries, it can only rely on the SQL capabilities of the database (i.e., there is no equivalent of the Truffle runtime inside the database). Thus, this framework only targets a limited number of application language and a single database, and conflates the three following issues: detection of the query boundary, optimization of the query representation and translation of QIR into the database language. This fact is particularly observable in the restrictions enforced on expressions inside quotes (i.e., to be sent to the database): quoted expressions have to be reductible to expressions supported by the database. Compared to this contribution, the QIR framework offers a clean separation between application language, query representation and database language. Moreover, it does not impose restrictions on application code that can be send to the database. One notices that, although they start from different architecture assumptions and use different proof ideas, Theorem 6 ended up requiring hypotheses similar to the restrictions necessary to the optimality proof of T-LINQ[3], hinting that such assumptions are reasonable. Nevertheless, while T-LINQ cannot handle expressions outside this scope (indeed, no example from Section 6 can be reproduced in T-LINQ), the QIR heuristic can still produce (good) results on them, thanks to the embedded Truffle runtime. Looking at T-LINQ examples in [3], one can easily spot the differences between 22 the two frameworks: examples 1-4 and 6-7 can easily be reproduced in QIR and similar examples have already been given in this document, examples 5 and 8-9 contain nesting and unnesting operators and use ad-hoc reduction rules to rewrite them into a flat relational algebra (which we do not want to engage into, as a design choice), and examples 10-13 have to use the application language for features such as recursion, whereas QIR offers them natively. 8 Conclusion and future work The ability to evaluate snippets from the application code inside the database opened new perspectives on the language-intergrated query problems. We introduced Query Intermediate Representation (QIR), an abstraction layer between application language and database language, that can be used to represent queries. QIR comes with a rewriting strategy transforming queries written in a natural way in the application code into queries heavily optimizable by the database. Such rewritings are guided by a notion of “good” queries abstracted away in a measure on QIR expressions. Moreover, we produced formal proofs and experiments based on our QIR prototype showing that the QIR framework causes a minimal overhead while enabling a considerable speedup of query evaluation. Nevertheless, as explained in Section 3, we made the assumption that a same construct has identical semantics in the applicaton language, QIR and the database language (e.g., a tuple navigation user.name returns the same result in JavaScript, QIR and SQL), and we allow a lossy translation from a language to another when this is not the case (in fact, exisiting frameworks have the same limitation). This issue, which extends to discrepancies in the data model (e.g., JavaScript integers and Cassandra integers might be different), could be fixed by introducing more abstraction in the QIR data model. On a different matter, the rewriting heuristic presented in Section 5 uses a fuel value that has to be set by the developer. This obligation could become a simple option if we provide a module “guessing” what fuel value to set, using the estimation logic discussed at the end of Section 5 and described in Appendix E. These ideas are future work. We also plan to try our framework with more combinations of application languages and databases, then measure the impact of such an architecture on real-world large-scale web applications. 23 Appendices A References [1] Malcolm P. Atkinson and O. Peter Buneman. Types and persistence in database programming languages. ACM Comput. Surv., 19(2):105–170, June 1987. [2] Henk P Barendregt. The Lambda Calculus: Its Syntax and Semantics, revised ed., vol. 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1984. [3] James Cheney, Sam Lindley, and Philip Wadler. A practical theory of language-integrated query. SIGPLAN Not., 48(9):403–416, September 2013. [4] James Cheney, Sam Lindley, and Philip Wadler. Language-integrated query using comprehension syntax: state of the art, open problems, and work in progress. report, University of Edinburg, 2014. [5] Alvin Cheung, Samuel Madden, Armando Solar-Lezama, Owen Arden, and Andrew C Myers. Using program analysis to improve database applications. IEEE Data Eng. Bull., 37(1):48–59, 2014. [6] Yupeng Fu, Kian Win Ong, and Yannis Papakonstantinou. Declarative ajax web applications through SQL++ on a unified application state. In Proceedings of the 14th International Symposium on Database Programming Languages (DBPL 2013), August 30, 2013, Riva del Garda, Trento, Italy., 2013. [7] Yupeng Fu, Kian Win Ong, Yannis Papakonstantinou, and Romain Vernoux. Holistic Data Access Optimization for Analytics Reports. report, Department of Computer Science, UC San Diego, 2013. [8] George Giorgidze, Torsten Grust, Tom Schreiber, and Jeroen Weijers. Haskell boards the ferry. In Implementation and Application of Functional Languages, pages 1–18. Springer, 2011. [9] Delia Kesner, Carlos Lombardi, and Alejandro Ríos. A standardisation proof for algebraic pattern calculi. In Proceedings 5th International Workshop on Higher-Order Rewriting, HOR 2010, Edinburgh, UK, July 14, 2010., pages 58–72, 2010. [10] Jan Willem Klop, Vincent van Oostrom, and Roel C. de Vrijer. Lambda calculus with patterns. Theor. Comput. Sci., 398(1-3):16–31, 2008. [11] Avinash Lakshman and Prashant Malik. Cassandra: a decentralized structured storage system. Operating Systems Review, 44(2):35–40, 2010. [12] Erik Meijer, Brian Beckman, and Gavin Bierman. Linq: Reconciling object, relations and xml in the .net framework. In Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data, SIGMOD ’06, pages 706–706, New York, NY, USA, 2006. ACM. [13] Kian Win Ong, Yannis Papakonstantinou, and Romain Vernoux. The SQL++ semistructured data model and query language: A capabilities survey of sql-on-hadoop, nosql and newsql databases. CoRR, abs/1405.3631, 2014. [14] Oracle. Graal/truffle overview. http://www.oracle.com/technetwork/oracle-labs/ program-languages/overview/", accessed July 21, 2015. [15] Oracle Database. https://www.oracle.com/database/index.html. 24 [16] Ashish Thusoo, Joydeep Sen Sarma, Namit Jain, Zheng Shao, Prasad Chakka, Ning Zhang, Suresh Anthony, Hao Liu, and Raghotham Murthy. Hive - a petabyte scale data warehouse using Hadoop. In ICDE, pages 996–1005, 2010. B Internship timeline The Gantt diagram of Figure 6 describes the use of my time during this internship. In addition to the elements presented in this report, I had the opportunity to present my work at Oracle Labs in July. It was a very interesting experience, a good presentation exercice and a chance to organize my results before writing this report. Weeks 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Introduction to Truffle Related work QIR calculus QIR reduction strategies Prototype implementation Proofs Talk at Oracle Labs Internship report Weekly meetings Figure 6: Internship timeline C Formal definition of occurences Definitions 33 and 34 correspond to a formalization of the concept of occurences presented quickly in Definition 26. Definition 33. We define the language QIR* as the language of QIR constructs (cf. Section 4) in which integer identifiers can be attached to each subexpression and reductions are extended accordingly. Non-exhaustively, this means that id • QIR* operators contain Scane1 (), Scanid e1 (), Selecte1 (e2 ), Selecte1 (e2 ), etc. • QIR* expressions contain x, xid , λx. e1 , λid x. e1 , (e1 e2 ), (e1 e2 )id , true, trueid etc. • xid {e1 /x} = e1 , x{e1 /x} = e1 0 0 • (λid x. e1 ) e2 → e1 {e2 /x}, destrid (consid e1 e2 ) e3 e4 → e4 e1 e2 , trueid andid e1 → true, etc. where id, id0 are integer identifiers and the ei are QIR* expressions. Let e be a QIR expression and e1 a subexpression of e. We denote by ?(e) the QIR* expression in which a unique identifier is attached to each subexpression of e. There is a one-to-one correspondance between the subexpressions of e and the subexpressions of ?(e), thus we will also denote by ?sub (e1 ) the subexpression of ?(e) corresponding to e1 . Let e0 be a QIR* expression and e01 a subexpression of e0 . We denote by ?−1(e0 ) the QIR expression in which all identifers are removed from e0 . There is a one-to-one correspondance between the 0 subexpressions of e0 and the subexpressions of ?−1(e0 ), thus we will also denote by ?−1 sub(e1 ) the subexpression of ?−1(e0 ) corresponding to e01 . Let e0 be a QIR* expression and e01 a subexpression of e0 . We denote by ExprId (e0 , e01 ) the identifier of e01 in e0 , if it has one (it is not defined otherwise). 25 Lemma 10. Let e0 be a QIR expression and e00 a QIR* expression such that ?−1(e00 ) = e0 . Any QIR reduction chain e0 →r1 . . . →rn en can be simulated by the QIR* reduction chain 0 e00 →r10 . . . →rn0 e0n such that, for all 1 ≤ i ≤ n, ?−1(e0i ) = ei and ?−1 sub(ri ) = ri . Definition 34. Let e0 be a QIR expression, e a subexpression of e0 and en a QIR expression such that e0 →∗ en . Using Lemma 10 and the fact that ?−1(?(e0 )) = e0 , we know that this QIR reduction chain can be simulated by a QIR* reduction chain e00 →∗ e0n starting from e00 = ?(e0 ). This 0 0 0 0 0 way, we define Occurences (en , e) as the set {?−1 sub(e ) | e is a subexpression of en , ExprId (en , e ) = ExprId (?(e0 ) , ?sub (e))}. For instance, the QIR reduction (λx. λy. f x x) z z → (λy. f z z) z → f z z can be simulated by the QIR* reduction (λ1 x. λ2 y. f 3 x4 x5 ) z 6 z 7 → (λ2 y. f 3 z 6 z 6 ) z 7 → f 3 z 6 z 6 . One can see, just by looking at identifiers, that the first z variable produced both z variables of the final expression: it has two occurences in the final expression. The other one disappeared: it has no occurence in the final expression. D Proofs Theorem 1. QIR with the reduction rules of Definition 2 satisfies the Church-Rosser property. Proof. Encoding (i) integer (resp. boolean, string) values and functions in the lambda-calculus (Church encoding), (ii) operators, built-in functions, Truffle nodes, Data references, nil, cons, tnil and tcons with constructors and (iii) destr and tdestr with (linear) pattern-matching, QIR can be transposed in a lambda-calculus with patterns[10] which satisfies the Church-Rosser property and for which the β, δ and ρ reduction rules of Definition 2 are compatible. Theorem 2. QIR with the reduction rules of Definition 2 verifies the Standardization theorem, that is, if an expression e has a normal form, it can be obtained from e by reducing successively its leftmost outermost redex. Proof. With the same encoding as in the proof of Theorem 1, QIR can be transposed in a lambda-calculus with patterns[9] in which the Standardization theorem holds and for which the β, δ and ρ reduction rules of Definition 2 are compatible. Lemma 1. The measure M of Definition 8 induces a well-founded order on expressions. Proof. The order induced by M is a lexicographical order on the natural order of positive integers, which is well-founded, and the lexicographical order preserves well-foundness. Lemma 2. ∀e, MinReds (e) 6= ∅. Proof. Since e ∈ Red0 (e) ⊆ Reds (e), we know that Reds (e) = 6 ∅. Moreover, the order induced by M is well-founded (Lemma 1) therefore M has a minimum on Reds (e) and MinReds (e) is non-empty. Lemma 3. For all expression e the following properties hold. • For a variable e0 in e, HInlineVar (e, e0 ) returns None or contracts a redex. • For a subexpression e0 in e, HMakeRedex (e, e0 ) returns None or contracts a redex. • For a subexpression e0 in e, HContractLam (e, e0 ) returns None or contracts a redex. Proof. The proof follows an induction on TraversalPos (e, e0 ). • If e0 is free in e then HInlineVar (e, e0 ) returns None. Otherwise, let l be the lambda binding e0 . HInlineVar (e, e0 ) corresponds to HContractLam (e, l), and since TraversalPos (e, l) < TraversalPos (e, e0 ), the induction hypothesis yields the result. 26 • If e0 is a redex, HMakeRedex (e, e0 ) contracts this redex. If e0 = (e00 e1 ), e0 = destr e00 e1 e2 , e0 = tdestr e00 s or e0 = if e00 then e1 else e2 (and similarly for other ρ-redexes), HMakeRedex (e, e0 ) corresponds to HMakeRedex (e, e00 ), and since TraversalPos (e, e00 ) < TraversalPos (e, e0 ) and the induction hypothesis yields the result. If e0 is a variable, HMakeRedex (e, e0 ) corresponds to HInlineVar (e, e0 ) and we proved the result above. Otherwise, HMakeRedex (e, e0 ) returns None. • We denote by e00 the parent expression of e0 . If e00 = (e0 e1 ), e00 = destr e0 e1 e2 , e00 = tdestr e0 s or e00 = if e0 then e1 else e2 (and similarly for other ρ-redexes), HContractLam (e, e0 ) corresponds to HMakeRedex (e, e00 ) which either contracts e00 and we are done, or corresponds to HMakeRedex (e, e0 ) and we proved the result above. If e00 = (e1 e0 ), e00 = destr e1 e0 e2 , e00 = destr e1 e2 e0 , e00 = if e1 then e0 else e2 or e00 = if e1 then e2 else e0 (and similarly for other ρ-redexes), HContractLam (e, e0 ) corresponds to HMakeRedex (e, e1 ) and since TraversalPos (e, e1 ) < TraversalPos (e, e0 ), the induction hypothesis yields the result. If e00 = λx. e0 , e00 = cons e0 e1 , e00 = cons e1 e0 , e00 = tcons s e0 e1 , e00 = tcons s e1 e0 , HContractLam (e, e0 ) corresponds to HContractLam (e, e00 ) and since TraversalPos (e, e00 ) < TraversalPos (e, e0 ), the induction hypothesis yields the result. Otherwise, HContractLam (e, e0 ) returns None. Lemma 4. For all expression e, the search space HConfigSSΦ (e) (resp. HChildrenSSΦ (e)) has bounded size. Proof. Each recursive call to HRedConfigφ (e, C[]) (resp. HRedChildφ (e, C[])) is well defined (corollary of Lemma 3) and is such that the pair (M (e), φ) decreases. Using lemma 1 it is easy to prove that the lexicographical order induced by this pair is also well-founded, therefore the search space has bounded depth. Moreover, any expression has a bounded number of operators and operator contexts therefore each node in the search space has a bounded number of children. Lemma 10. Let e0 be a QIR expression and e00 a QIR* expression such that ?−1(e00 ) = e0 . Any QIR reduction chain e0 →r1 . . . →rn en can be simulated by the QIR* reduction chain 0 e00 →r10 . . . →rn0 e0n such that, for all 1 ≤ i ≤ n, ?−1(e0i ) = ei and ?−1 sub(ri ) = ri . Proof. The proof follows an induction on n. For n = 0, the result is trivial. For n > 0, contracting 0 0 the redex r10 such that ?−1 sub(r1 ) = r1 yields a QIR* expression e1 . It is easy to prove by case −1 0 analysis on r1 that ? (e1 ) = e1 . By induction hypothesis, the remaining of the reduction chain e1 →∗ en can be simulated by e01 →∗ e0n , which means that the entire chain e0 →∗ en can be simulated by e00 →∗ e0n . Lemma 5. Let e be an expression, e0 a subexpression of e and r a redex in e. If e →r e00 and Occurences (e00 , e0 ) = ∅, then r either consumes or erases e0 . Proof. By case analysis on r. All cases are similar therefore we will only write the proof for r = (λx.e1 ) e2 . By hypothesis, there is a context C[] such that e = C[r]. Then we do a case analysis on the position of e0 in e. We know that e0 cannot be a subexpression of C, otherwise Occurences (e00 , e0 ) 6= ∅. For the same reason, we also know that e0 is not a subexpression of e1 other than the free variable x. If e0 = r, if e0 = λx.e1 or if e0 is the variable x free in e1 , then e is consumed. Otherwise, e0 is a subexpression of e2 and x is not free in e1 (since Occurences (e00 , e0 ) = ∅), and in this case e0 is erased. Lemma 6. Let e be an expression and e0 a subexpression of e. The following properties hold. • If e0 is a variable v and if HInlineVar (e, v) returns None then e0 cannot be consumed. • If HMakeRedex (e, e0 ) returns None then e0 cannot be consumed. • If HContractLam (e, e0 ) returns None then e0 cannot be consumed. Proof. The proof follows an induction on TraversalPos (e, e0 ). 27 • Suppose that HInlineVar (e, v) returns None. If v is free in e then by definition it cannot be consumed. Otherwise, denoting by l the lambda binding v, this means that HContractLam (e, l) returns None. Since TraversalPos (e, l) < TraversalPos (e, v), the induction hypothesis tells that l cannot be consumed and (by definition of the consumption of a variable) neither can e0 . • Suppose that HMakeRedex (e, e0 ) returns None. If e0 is a variable, this implies that HInlineVar (e, e0 ) returns None and we proved the result above. If e0 is a redex, this is absurd (HMakeRedex (e, e0 ) cannot return None). If e0 = (e00 e1 ), e0 = destr e00 e1 e2 , e0 = tdestr e00 s or e0 = if e00 then e1 else e2 (and similarly for other ρ-redexes), this means that HMakeRedex (e, e00 ) returns None and since TraversalPos (e, e00 ) < TraversalPos (e, e0 ) the induction hypothesis tells that e00 cannot be consumed and (by definition of the consumption of the considered expressions for e0 ) neither can e0 . If e0 = λx. e1 , e0 = cons e1 e2 , e0 = tcons s e1 e2 , e0 = nil, e0 = tnil or if e0 is a constant (integer, boolean, etc.), by looking at all the call sites of HMakeRedex (., .) we know that the parent of e0 is such that e0 is in an ill-formed term (e.g., destr tnil e1 e2 ) and therefore cannot be consumed. The remaining possible expressions for e0 (e.g., Truffle nodes, Data references, operators, etc.) cannot be consumed in any expression. • Suppose that HContractLam (e, e0 ) returns None. We denote by e00 the parent expression of e0 . If e00 = (e0 e1 ), e00 = destr e0 e1 e2 , e00 = tdestr e0 s or e00 = if e0 then e1 else e2 (and similarly for other ρ-redexes), this means that HMakeRedex (e, e00 ) returns None, which in turn means that HMakeRedex (e, e0 ) returns None and we proved the result above. If e00 = (e1 e0 ), e00 = destr e1 e0 e2 , e00 = destr e1 e2 e0 , e00 = if e1 then e0 else e2 or e00 = if e1 then e2 else e0 (and similarly for other ρ-redexes), this means that HMakeRedex (e, e00 ) returns None, which in turn means that HMakeRedex (e, e1 ) returns None. Since TraversalPos (e, e1 ) < TraversalPos (e, e0 ), the induction hypothesis tells that e1 cannot be consumed and (by definition of the consumption of the considered expressions for e00 ) neither can e00 , which implies that e0 cannot be consumed either. If e00 = λx. e0 , e00 = cons e0 e1 , e00 = cons e1 e0 , e00 = tcons s e0 e1 , e00 = tcons s e1 e0 , this means that HContractLam (e, e00 ) returns None and since TraversalPos (e, e00 ) < TraversalPos (e, e0 ), the induction hypothesis tells that e00 cannot be consumed and (by definition of the consumption of the considered expressions for e0 ) neither can e0 . Similarly to above, the remaining expressions to consider for e00 either correspond to ill-formed expressions (that cannot be consumed) or expressions that can never be consumed. Lemma 7. Let e be an expression with fixed operators and r a redex in e. For a database with stable compatibility, if e →r e0 then M (e0 ) ≤ M (e). Proof. By case analysis on r. All cases are similar therefore we will only write the proof for r = (λx.e1 ) e2 . By hypothesis, there is a context C[] such that e = C[r]. Since e has fixed operators, there is a one-to-one correspondance between the operators of e and the operators of e0 . For each operator op in e, denoting by op0 the corresponding operator in e0 , the stable compatibility hypothesis tells us that if op is compatible, then op0 is also compatible. Since no redex can create operators, this implies that Op (e0 ) − Comp (e0 ) ≤ Op (e) − Comp (e). The only case to treat is when Op (e0 ) − Comp (e0 ) = Op (e) − Comp (e). Looking at the definition of fragments (cf. Definition 6), we see that there is only three ways to increase the number of fragments in e. • Duplicate an existing fragment. This cannot happen under the fixed operator hypothesis, since a fragment contains at least one operator. • Create a new fragment by making an incompatible operator compatible. This cannot happen either. Indeed, if r turns an incompatible operator into a compatible one, using the stable compatibility hypothesis, we know that all other compatible operators in e are still compatible in e0 which contradicts Op (e0 ) − Comp (e0 ) = Op (e) − Comp (e). • Split an existing fragment into at least two fragments. This again, cannot happen. Indeed, let F be a fragment in e = C[(λx.e1 ) e2 ]. By definition of a fragment, we only have to consider the following cases: 28 – if F is a subexpression of e2 or C[], it is intact in e0 . – if F is a subexpression of e1 , either x is not free in F and F is not affected by the reduction or x is in the configuration of some operators of F and (stable compatibility) these operators stay compatible after reduction and r cannot split F . – if r is in the fragment, it is necessarily in a configuration of an operator of the fragment which (stable compatibility) stays compatible after reduction, therefore r cannot split F. Lemma 8. Let e be a weakly-normalizing expression with fixed operators. For a database with stable compatibility, the normal form of e has minimal measure. Proof. Since e is weakly-normalizing, it has a normal form eN . Suppose, to the contrary, that there exists e0 such that e →∗ e0 and M (e0 ) < M (eN ). Using Theorem 1 (confluence) and the fact that eN is normal, we know there is a finite reduction chain e0 →∗ eN and applying Lemma 7 on each reduction of the chain leads to a contradiction. Lemma 9. Let e be a weakly-normalizing expression with fixed operators, emin an expression in MinReds (e) and e0 an expression such that e →∗ e0 and Op (e0 ) − Comp (e0 ) = Op (emin ) − Comp (emin ). For a database with stable compatibility, an operator is compatible in emin if and only if it is compatible in e0 . Proof. Using the fixed operator hypothesis, we know that there is a one-to-one correspondance between the operators of e and the operators in any reduced form of e. Therefore, Comp (e0 ) = Comp (emin ). Suppose, to the contrary, that there exists an operator op in e such that Occurences (e0 , op) = {op0 }, Occurences (emin , op) = {opmin }, op0 compatible and opmin not compatible. Using Theorem 1 (confluence), we know there is an expression e00 such that e0 →∗ e00 and emin →∗ e00 . Using the stable compatibility hypothesis, op is compatible in e00 and all operators compatible in emin stay compatible in e00 , which contradicts the minimality of the measure of emin . Suppose now, to the contrary, that there exists an operator op in e such that Occurences (e0 , op) = {op0 }, Occurences (emin , op) = {opmin }, op0 not compatible and opmin compatible. The minimality of emin tells that all operators compatible in e00 are also compatible in emin and the stable compatibility hypothesis tells that each operator compatible in e0 are still compatible in e00 , which contradicts the fact that Comp (e0 ) = Comp (emin ). Conjecture 1. For databases with stable compatibility, the reduction strategy of Definition 24 is complete on weakly-normalizing expressions with fixed operators. That is, for a database with stable compatibility, given a weakly-normalizing input expression e with fixed operators, there exists a fuel value Φ such that HMinRedΦ (e) ∈ MinReds (e). Looking at the proof of the theorem for strongly-normalizing expressions (Theorem 6), one notices that the strongly-normalizing hypothesis itself is only used three times: (i) to prove that iteratively calling HInlineVar (., .) on the free variables of an operator configuration terminates, (ii) to use Theorem 2 on an operator configuration and (iii) to prove that iteratively calling HMakeRedex (., .) on an operator child expression terminates. Case (ii) is not an issue, since Theorem 2 only requires the expression to be weakly-normalizing. Case (iii) can be dealt with using the fixed operator hypothesis: HMakeRedex (., .) contracts redex in the same order as the call-by-name reduction strategy and none of these redexes can be erased (because this would require to erase the parent operator), therefore Theorem 2 yields the result. The only remaining issue is case (i): HInlineVar (., .) reduces redexes in an order that cannot be compared with the call-by-name reduction strategy, therefore Theorem 2 cannot be used here. However, the intuition is that operator configurations in which one can inline variables infinitely have to be inside some kind of fixpoint, which is forbidden by the fixed operator hypothesis. 29 E Estimation of the heuristic fuel value For now, we assume that the fuel value (cf. Section 5.4) for the heuristic is empirically chosen by the developer. Nevertheless, one can give a simple estimate with the following reasoning. In usual QIR query representations, query fragments are not passed as function arguments and the tree of operators is almost already built. In this case, inlining a variable in a configuration is most of the time a single-step heuristic reduction (e.g., the inlining of x in let x = . . . in C[opC 0 [x] ]) or a multi-step heuristic reduction in which each step inlines a variable (e.g., the inlining of y in (λx. λy. C[opC 0 [x,y] ]) e1 e2 ). Thus, denoting by V the maximum (on all operators) number of variables to inline in a configuration, we can estimate that after V reduction steps all variables are inlined, and providing more fuel would not inline more variables. Furthermore, configuration are usually small pieces of code, that can reach a normal form in a few reduction steps. The most expensive configurations to reduce are then expressions containing recursions. Thus, denoting by R the maximum number of recursive calls and R0 the maximum number of reductions used inside a single recursive call, we can estimate that after RR0 reduction steps a configuration is in normal form, and providing more fuel would not enable to consider more reduced expressions of this configuration. Finally, children of operators are most of the time variables (e.g., let subquery = . . . in C[op(subquery)]) or conditionals (e.g., C[op(if c then subquery1 else subquery2 )]) and both can be reduced to an operator in a small number of heuristic reduction steps, denoted by C. Thus, since QIR operators have at most two children, we can estimate that after 2C reduction steps all the children of an operator are reduced to an operator, and providing more fuel would not enable to regroup more fragments. Therefore, given the two-pass behavior of the heuristic, we can estimate the fuel value required for a comprehensive exploration of the search space as max(V + RR0 , 2C). Looking back at the complex examples of Section 6, we can compare the aforementioned estimation (calculated by hand) to the fuel value Φ effectively required to reach the optimal result. Example 6.1 6.2 (1) 6.2 (2) 6.3 V 1 2 2 1 R 1 3 3 0 R0 10 8 8 0 C 0 2 2 1 max(V + RR0 , 2C) 11 26 26 1 Φ 11 24 15 1 Although using the Φ estimation would lead to the optimal result in all these cases, computing Φ requires to estimate the values for V , R, R0 and C, which is far from easy to automate (for R it corresponds to estimating in how many steps a recursive program terminates). Nevertheless, the Φ ≈ max(V + RR0 , 2C) formula can be useful to the application developer when setting Φ, since V , R, R0 and C correspond to characteristics indirectly observable in the application language, as opposed to the Φ black-box. F Source code and other resources The implementation source code and other resources mentioned in this document are available for download at http://vernoux.fr/data/internship-mpri/. This folder contains / integration_survey.xlsx .... Notes on existing language-integrated query frameworks qir_reduction. ............................................... Prototype source code 30 README.txt ............................................... Installation instructions src...................................................................Source code compat_sql.ml.....................................SQL capabilities description compat_sql.mli....................................Interface of compat_sql.ml lexer.mll...........................................Lexing of QIR expressions parser.mly.........................................Parsing of QIR expressions qir.ml.............................................QIR constructs and utilities qir.mli....................................................Interface of qir.ml qir_reduction.ml ............................ Measure and reduction strategies qir_reduction.mli.............................Interface of qir_reduction.ml reduce.ml..................Main program and command-line arguments parsing utils.ml..............................................................Utilities test.......................................................Test files and examples ads_view.txt............................Input of the experiment of Section 6.2 analytics.txt...........................Input of the experiment of Section 6.1 caching.txt ............................. Input of the experiment of Section 6.3 linq_1.txt................................Reproduction of an example from [3] linq_2.txt................................Reproduction of an example from [3] linq_xpath.txt...........................Reproduction of an example from [3] nesting_1.txt.......................................................Test case testchild_1.txt .................................................... Test case testchild_2.txt .................................................... Test case testchild_3.txt .................................................... Test case testconfig_1.txt ................................................... Test case testconfig_2.txt ................................................... Test case testconfig_3.txt ................................................... Test case testnoinline_1.txt.................................................Test case testnoinline_2.txt.................................................Test case testtpch_1.txt......................................................Test case 31
6cs.PL
Logical Methods in Computer Science Vol. 5 (2:12) 2009, pp. 1–30 www.lmcs-online.org Submitted Apr. 2, 2006 Published May 28, 2009 SIMULATING REACHABILITY USING FIRST-ORDER LOGIC WITH APPLICATIONS TO VERIFICATION OF LINKED DATA STRUCTURES ∗ TAL LEV-AMI a , NEIL IMMERMAN b , THOMAS W. REPS c , MOOLY SAGIV d , SIDDHARTH SRIVASTAVA e , AND GRETA YORSH f a,d,f b,e c School of Computer Science, Tel Aviv University e-mail address: [email protected], {msagiv,gretay}@post.tau.ac.il Department of Computer Science, University of Massachusetts, Amherst e-mail address: {immerman,siddharth}@cs.umass.edu Computer Science Department, University of Wisconsin, Madison e-mail address: [email protected] A BSTRACT. This paper shows how to harness existing theorem provers for first-order logic to automatically verify safety properties of imperative programs that perform dynamic storage allocation and destructive updating of pointer-valued structure fields. One of the main obstacles is specifying and proving the (absence) of reachability properties among dynamically allocated cells. The main technical contributions are methods for simulating reachability in a conservative way using first-order formulas—the formulas describe a superset of the set of program states that would be specified if one had a precise way to express reachability. These methods are employed for semiautomatic program verification (i.e., using programmer-supplied loop invariants) on programs such as mark-and-sweep garbage collection and destructive reversal of a singly linked list. (The mark-andsweep example has been previously reported as being beyond the capabilities of ESC/Java.) 1. I NTRODUCTION This paper explores how to harness existing theorem provers for first-order logic to prove reachability properties of programs that manipulate dynamically allocated data structures. The approach that we use involves simulating reachability in a conservative way using first-order formulas—i.e., the formulas describe a superset of the set of program states that would be specified if one had an accurate way to express reachability. 1998 ACM Subject Classification: F.3.1, F.4.1, F.3.2. Key words and phrases: First Order Logic, Transitive Closure, Approximation, Program Verification, Program Analysis. ∗ A preliminary version of this paper appeared in Automated Deduction - CADE-20, 20th International Conference on Automated Deduction, Tallinn, Estonia, July 22-27, 2005. a This research was supported by an Adams Fellowship through the Israel Academy of Sciences and Humanities. b,e Supported by NSF grants CCF-0514621,0541018,0830174. c Supported by ONR under contracts N00014-01-1-{0796,0708}. f Partially supported by the Israeli Academy of Science. l LOGICAL METHODS IN COMPUTER SCIENCE c DOI:10.2168/LMCS-5 (2:12) 2009 CC T. Lev-Ami, N. Immerman, T. Reps, M. Sagiv, S. Srivastava, and G. Yorsh Creative Commons 2 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH Automatically establishing safety and liveness properties of sequential and concurrent programs that permit dynamic storage allocation and low-level pointer manipulations is challenging. Dynamic allocation causes the state space to be infinite; moreover, a program is permitted to mutate a data structure by destructively updating pointer-valued fields of nodes. These features remain even if a programming language has good capabilities for data abstraction. Abstract-datatype operations are implemented using loops, procedure calls, and sequences of low-level pointer manipulations; consequently, it is hard to prove that a data-structure invariant is reestablished once a sequence of operations is finished [Hoa75]. In languages such as Java, concurrency poses yet another challenge: establishing the absence of deadlock requires establishing the absence of any cycle of threads that are waiting for locks held by other threads. Reachability is crucial for reasoning about linked data structures. For instance, to establish that a memory configuration contains no garbage elements, we must show that every element is reachable from some program variable. Other cases where reachability is a useful notion include • Specifying acyclicity of data-structure fragments, i.e., from every element reachable from node n, one cannot reach n • Specifying the effect of procedure calls when references are passed as arguments: only elements that are reachable from a formal parameter can be modified • Specifying the absence of deadlocks • Specifying safety conditions that allow establishing that a data-structure traversal terminates, e.g., there is a path from a node to a sink-node of the data structure. The verification of such properties presents a challenge. Even simple decidable fragments of firstorder logic become undecidable when reachability is added [GME99, IRR+ 04a]. Moreover, the utility of monadic second-order logic on trees is rather limited because (i) many programs allow nontree data structures, (ii) expressing the postcondition of a procedure (which is essential for modular reasoning) usually requires referring to the pre-state that holds before the procedure executes, and thus cannot, in general, be expressed in monadic second-order logic on trees—even for procedures that manipulate only singly-linked lists, such as the in-situ list-reversal program shown in Fig. 6, and (iii) the complexity is prohibitive. While our work was actually motivated by our experience using abstract interpretation – and, in particular, the TVLA system [LAS00, SRW02, RSW04] – to establish properties of programs that manipulate heap-allocated data structures, in this paper, we consider the problem of verifying data-structure operations, assuming that we have user-supplied loop invariants. This is similar to the approach taken in systems like ESC/Java [FLL+ 02], and Pale [MS01]. The contributions of the paper can be summarized as follows: Handling FO(TC) formulas using FO theorem provers. We want to use first-order theorem provers and we need to discuss the transitive closure of certain binary predicates, f . However, first-order theorem provers cannot handle transitive closure. We solve this conundrum by adding a new relation symbol ftc for each such f , together with first-order axioms that assure that ftc is interpreted correctly. The theoretical details of how this is done are presented in Section 3. The fact that we are able to handle transitive closure effectively and reasonably automatically is quite surprising. As explained in Section 3, the axioms that we add to control the behavior of the added predicates, ftc , must be sound but not necessarily complete. One way to think about this is that we are simulating a formula, χ, in which transitive closure occurs, with a pure first-order formula χ′ . If our axioms are not complete then we are allowing χ′ to denote more stores than χ does. The study of methods that are sound but potentially incomplete is motivated by the fact that abstraction [CC77] SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 3 can be an aid in the verification of many properties. In terms of logic, abstraction corresponds to using formulas that describe a superset of the set of program states that can actually arise. A definite answer about whether a property always holds can sometimes be obtained even when information has been lost because of abstraction. If χ′ is proven valid in FO then χ is also valid in FO(TC); however, if we fail to prove that χ′ is valid, it is still possible that χ is valid: the failure would be due to the incompleteness of the axioms, or the lack of time or space for the theorem prover to complete the proof. As we will see in Section 3, it is easy to write a sound axiom, T1 [f ], that is “complete” in the very limited sense that every finite, acyclic model satisfying T1 [f ] must interpret ftc as the reflexive, transitive closure of its interpretation of f . However, in practice this is not worth much because, as is well-known, finiteness is not expressible in first-order logic. Thus, the properties that we want to prove do not follow from T1 [f ]. We do prove that T1 [f ] is complete for positive transitive-closure properties (Proposition 3.2). The real difficulty lies in proving properties involving the negation of ftc , i.e., that a certain f -path does not exist. Induction axiom scheme. To solve the above problem, we add an induction axiom scheme. Although in general, there is no complete, recursively-enumerable axiomatization of transitive closure (Proposition 4.1), we have found, on the practical side, that on the examples we have tried, T1 plus induction allows us to automatically prove all of our desired properties. On the theoretical side, we prove that our axiomatization is complete for word models (Theorem 4.8). We think of the axioms that we use as aides for the first-order theorem prover that we employ (S PASS [WGR96]) to prove the properties in question. Rather than giving S PASS many instances of the induction scheme, our experience is that it finds the proof faster if we give it several axioms that are simpler to use than induction. As already mentioned, the hard part is to show that certain paths do not exist. Coloring axiom schemes. In particular, we use three axiom schemes, having to do with partitioning memory into a small set of colors. We call instances of these schemes “coloring axioms”. Our coloring axioms are simple, and are easily proved using S PASS (in under ten seconds) from the induction axioms. For example, the first coloring axiom scheme, NoExit[A, f ], says that if no f -edges leave color class, A, then no f -paths leave A. It turns out that the NoExit axiom scheme implies – and thus is equivalent to – the induction scheme. However, we have found in practice that explicitly adding other coloring axioms (which are consequences of NoExit) enables S PASS to prove properties that it otherwise fails at. We first assume that the programmer provides the colors by means of first-order formulas with transitive closure. Our initial experience indicates that the generated coloring axioms are useful to S PASS. In particular, it provides the ability to verify programs like the mark phase of a mark-andsweep garbage collector. This example has been previously reported as being beyond the capabilities of ESC/Java. TVLA also succeeds on this example; however our new approach provides verification methods that can in some instances be more precise than TVLA. Prototype implementation. Perhaps most exciting, we have implemented the heuristics for selecting colors and their corresponding axioms in a prototype using S PASS. We have used this to automatically choose useful color axioms and then verify a series of small heap-manipulating programs. We believe that the detailed examples presented here give convincing evidence of the promise of our methodology. Of course much further study is needed. Strengthening Nelson’s results. Greg Nelson considered a set of axiom schemes for reasoning about reachability in function graphs, i.e., graphs in which there is at most one f -edge leaving any node [Nel83]. He left open the question of whether his axiom schemes were complete for function 4 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH graphs. We show that Nelson’s axioms are provable from T1 plus our induction axioms. We also show that Nelson’s axioms are not complete: in fact, they do not imply NoExit. Outline. The remainder of the paper is organized as follows: Section 2 explains our notation and the setting; Section 3 fills in our formal framework, introduces the induction axiom scheme, and presents the coloring axiom schemes; Section 4 provides more detail about TC-completeness including a description of Nelson’s axioms, a proof that they are not TC-complete for the functional case, and a proof that our axiomatization is TC-complete for words; Section 5 presents our heuristics including the details of their successful use on a variety of examples; Section 6 describes the applicability of our methodology, relating it to the reasoning done in the TVLA system; Section 7 describes some related work; and Section 8 describes some conclusions and future directions. 2. P RELIMINARIES This section defines the basic notations used in this paper and the setting. 2.1. Notation. Syntax: A relational vocabulary τ = {p1 , p2 , . . . , pk } is a set of relation symbols, each of fixed arity. We use the letters u, v, and w (possibly with numeric subscript) for first-order variables. We write first-order formulas over τ with quantifiers ∀ and ∃, logical connectives ∧, ∨, →, ↔, and ¬, where atomic formulas include: equality, pi (v1 , v2 , . . . vai ), and TC[f ](v1 , v2 ), where pi ∈ τ is of arity ai and f ∈ τ is binary. Here TC[f ](v1 , v2 ) denotes the existence of a finite path of 0 or more f edges from v1 to v2 . A formula without TC is called a first-order formula. We use the following precedence of logical operators: ¬ has highest precedence, followed by ∧ and ∨, followed by → and ↔, and ∀ and ∃ have lowest precedence. Semantics: A model, A, of vocabulary τ , consists of a non-empty universe, |A|, and a relation pA over the universe interpreting each relation symbol p ∈ τ . We write A |= ϕ to mean that the formula ϕ is true in the model A. For Σ a set of formulas, we write Σ |= ϕ (Σ semantically implies ϕ) to mean that all models of Σ satisfy ϕ. 2.2. Setting. We are primarily interested in formulas that arise while proving the correctness of programs. We assume that the programmer specifies pre and post-conditions for procedures and loop invariants using first-order formulas with transitive closure on binary relations. The transformer for a loop body can be produced automatically from the program code. For instance, to establish the partial correctness with respect to a user-supplied specification of a program that contains a single loop, we need to establish three properties: First, the loop invariant must hold at the beginning of the first iteration; i.e., we must show that the loop invariant follows from the precondition and the code leading to the loop. Second, the loop invariant provided by the user must be maintained; i.e., we must show that if the loop invariant holds at the beginning of an iteration and the loop condition also holds, the transformer causes the loop invariant to hold at the end of the iteration. Finally, the postcondition must follow from the loop invariant and the condition for exiting the loop. In general, these formulas are of the form ψ1 [τ ] ∧ T r[τ, τ ′ ] → ψ2 [τ ′ ] SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 5 where τ is the vocabulary of the before state, τ ′ is the vocabulary of the after state,1 and T r is the transformer, which may use both the before and after predicates to describe the meaning of the module to be executed. If symbol f denotes the value of a predicate before the operation, then f ′ denotes the value of the same predicate after the operation. An interesting special case is the proof of the maintenance formula of a loop invariant. This has the form: LC[τ ] ∧ LI[τ ] ∧ T r[τ, τ ′ ] → LI[τ ′ ] Here LC is the condition for entering the loop and LI is the loop invariant. LI[τ ′ ] indicates that the loop invariant remains true after the body of the loop is executed. The challenge is that the formulas of interest contain transitive closure; thus, the validity of these formulas cannot be directly proven using a theorem prover for first-order logic. 3. A XIOMATIZATION OF T RANSITIVE C LOSURE The original formula that we want to prove, χ, contains transitive closure, which first-order theorem provers cannot handle. To address this problem, we replace χ by a new formula, χ′ , where all appearances of TC[f ] have been replaced by the new binary relation symbol, ftc . We show in this paper that from χ′ , we can often automatically generate an appropriate firstorder axiom, σ, with the following two properties: (1) if σ → χ′ is valid in FO, then χ is valid in FO(TC). (2) A theorem prover successfully proves that σ → χ′ is valid in FO. We now explain the theory behind this process. A TC model, A, is a model such that if f and ftc are in the vocabulary of A, then (ftc )A = (f A )⋆ ; i.e., A interprets ftc as the reflexive, transitive closure of its interpretation of f . A first-order formula ϕ is TC valid iff it is true in all TC models. We say that an axiomatization, Σ, is TC sound if every formula that follows from Σ is TC valid. Since first-order reasoning is sound, Σ is TC sound iff every σ ∈ Σ is TC valid. We say that Σ is TC complete if for every TC-valid ϕ, Σ |= ϕ. If Σ is TC complete and TC sound, then for all first-order ϕ, Σ |= ϕ ⇔ ϕ is TC valid Thus a TC-complete set of axioms proves exactly the first-order formulas, χ′ , such that the corresponding FO(TC) formula, χ, is valid. All the axioms that we consider are TC valid. There is no recursively enumerable TC-complete axiom system (Proposition 4.1). However, the axiomatization that we give does allow S PASS to prove all the desired properties on the examples that we have tried. We do prove that our axiomatization is TC complete for word models (Theorem 4.8). 1In some cases it is useful for the postcondition formula to refer to the original vocabulary as well. This way the postcondition can summarize some of the behavior of the transformer, e.g., summarize the behavior of an entire procedure. 6 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH 3.1. Some TC-Sound Axioms. We begin with our first TC axiom scheme. For any binary relation symbol, f , let, T1 [f ] ≡ ∀u, v . ftc (u, v) ↔ (u = v) ∨ ∃w . f (u, w) ∧ ftc (w, v) We first observe that T1 [f ] is “complete” in a very limited way for finite, acyclic graphs, i.e., T1 [f ] exactly characterizes the meaning of ftc for all finite, acyclic graphs. The reason that we say this is limited is that it does not give us a complete set of first-order axioms: as is well known, there is no first-order axiomatization of “finite”. Proposition 3.1. Any finite and acyclic model of T1 [f ] is a TC model. Proof. Let A |= T1 [f ] where A is finite and acyclic. Let a0 , b ∈ |A|. Assume that there is an f -path from a0 to b. Since A |= T1 [f ], it is easy to see that A |= ftc (a0 , b). Conversely, suppose that A |= ftc (a0 , b). If a0 = b, then there is a path of length 0 from a0 to b. Otherwise, by T1 [f ], there exists an a1 ∈ |A| such that A |= f (a0 , a1 ) ∧ ftc (a1 , b). Note that a1 6= a0 since A is acyclic. If a1 = b then there is an f -path of length 1 from a to b. Otherwise there must exist an a2 ∈ |A| such that A |= f (a1 , a2 ) ∧ ftc (a2 , b) and so on, generating a set {a1 , a2 , . . .}. None of the ai can be equal to aj , for j < i, by acyclicity. Thus, by finiteness, some ai = b. Hence A is a TC model. Let T1′ [f ] be the ← direction of T1 [f ]: T1′ [f ] ≡ ∀u, v . ftc (u, v) ← (u = v) ∨ ∃w . f (u, w) ∧ ftc (w, v) Proposition 3.2. Let ftc occur only positively in ϕ. If ϕ is TC valid, then T1′ [f ] |= ϕ. Proof. Suppose that T1′ [f ] 6|= ϕ. Let A |= T1′ [f ] ∧ ¬ϕ. Note that ftc occurs only negatively in ¬ϕ. Furthermore, since A |= T1′ [f ], it is easy to show by induction on the length of the path, that if there is an f -path from a to b in A, then A |= ftc (a, b). Define A′ to be the model formed from A by interpreting ftc in A′ as (f A )⋆ . Thus A′ is a TC model and it only differs from A by the fact ′ that we have removed zero or more pairs from (ftc )A to form (ftc )A . Because A |= ¬ϕ and ftc occurs only negatively in ¬ϕ, it follows that A′ |= ¬ϕ, which contradicts the assumption that ϕ is TC valid. Proposition 3.2 shows that proving positive facts of the form ftc (u, v) is easy; it is the task of proving that paths do not exist that is more subtle. Proposition 3.1 shows that what we are missing, at least in the acyclic case, is that there is no first-order axiomatization of finiteness. Traditionally, when reasoning about the natural numbers, this problem is mitigated by adding induction axioms. We next introduce an induction scheme that, together with T1 , seems to be sufficient to prove any property we need concerning TC. Notation: In general, we will use F to denote the set of all binary relation symbols, f , such that TC[f V] occurs in a formula we are considering. If ϕ[f ] is a formula in which f occurs, let ϕ[F ] = f ∈F ϕ[f ]. Thus, for example, T1 [F ] is the conjunction of the axiom T1 [f ] for all binary relation symbols, f , under consideration. Definition 3.3. For any first-order formulas Z(u), P (u), and binary relation symbol, f , let the induction principle, IND[Z, P, f ], be the following first-order formula: (∀w . Z(w) → P (w)) ∧ (∀u, v . P (u) ∧ f (u, v) → P (v)) → ∀u, w . Z(w) ∧ ftc (w, u) → P (u) In order to explain the meaning of IND and other axioms it is important to remember that we are trying to write axioms, Σ, that are, SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 7 • TC valid, i.e., true in all TC models, and • useful, i.e., all models of Σ are sufficiently like TC models that they satisfy the TC-valid properties we want to prove. To make the meaning of our axioms intuitively clear, in this section we will say, for example, that “y is ftc -reachable from x” to mean that ftc (x, y) holds. Later, we will assume that the reader has the idea and just say “reachable” instead of “ftc -reachable”. The intuitive meaning of the induction principle is that if every zero point satisfies P , and P is preserved when following f -edges, then every point ftc -reachable from a zero point satisfies P . Obviously this principle is TC valid, i.e., it is true for all structures such that ftc = f ⋆ . As an easy application of the induction principle, consider the following cousin of T1 [f ], T2 [f ] ≡ ∀u, v . ftc (u, v) ↔ (u = v) ∨ ∃w . ftc (u, w) ∧ f (w, v) The difference between T1 and T2 is that T1 requires that each path represented by ftc starts with an f edge and T2 requires the path to end with an f edge. It is easy to see that neither of T1 [f ], T2 [f ] implies the other. However, in the presence of the induction principle they do imply each other. For example, it is easy to prove T2 [f ] from T1 [f ] using IND[Z, P, f ] where Z(v) ≡ v = u and P (v) ≡ u = v ∨ ∃w . ftc (u, w) ∧ f (w, v). Here, for each u we use IND[Z, P, f ] to prove by induction that every v reachable from u satisfies the right-hand side of T2 [f ]. Another useful axiom scheme provable from T1 plus IND is the transitivity of reachability: Trans[f ] ≡ ∀u, v, w . ftc (u, w) ∧ ftc (w, v) → ftc (u, v) 3.2. Coloring Axioms. We next describe three TC-sound axioms schemes that are not implied by T1 [F ] ∧ T2 [F ], and are provable from the induction principle. We will see in the sequel that these coloring axioms are very useful in proving that paths do not exist, permitting us to verify a variety of algorithms. In Section 5, we will present some heuristics for automatically choosing particular instances of the coloring axiom schemes that enable us to prove our goal formulas. The first coloring axiom scheme is the NoExit axiom scheme: (∀u, v . A(u) ∧ ¬A(v) → ¬f (u, v)) → ∀u, v . A(u) ∧ ¬A(v) → ¬ftc (u, v) for any first-order formula A(u), and binary relation symbol, f , NoExit[A, f ] says that if no f -edge leaves color class A, then no point outside of A is ftc -reachable from A. Observe that although it is very simple, NoExit[A, f ] does not follow from T1 [f ] ∧ T2 [f ]. Let G1 = (V, f, ftc , A) be a model consisting of two disjoint cycles: V = {1, 2, 3, 4}, f = {h1, 2i, h2, 1i, h3, 4i, h4, 3i}, and A = {1, 2}. Let ftc have all 16 possible pairs. Thus G1 satisfies T1 [f ] ∧ T2 [f ] but violates NoExit[A, f ]. Even for acyclic models, NoExit[A, f ] does not follow from T1 [f ] ∧ T2 [f ] because there are infinite models in which the implication does not hold (Proposition 4.7). NoExit[A, f ] follows easily from the induction principle: if no f -edges leave A, then induction tells us that everything ftc -reachable from a point in A satisfies A. Similarly, NoExit[A, f ] implies the induction axiom, IND[Z, A, f ], for any formula Z. The second coloring axiom scheme is the GoOut axiom: for any first-order formulas A(u), B(u), and binary relation symbol, f , GoOut[A, B, f ] says that if the only f -edges leaving color class A are to B, then any ftc -path from a point in A to a point not in A must pass through B. (∀u, v . A(u) ∧ ¬A(v) ∧ f (u, v) → B(v)) → ∀u, v . A(u) ∧ ¬A(v) ∧ ftc (u, v) → ∃w . B(w) ∧ ftc (u, w) ∧ ftc (w, v) 8 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH To see that GoOut[A, B, f ] follows from the induction principle, assume that the only f -edges out of A enter B. For any fixed u in A, we prove by induction that any point v ftc -reachable from u is either in A or has a predecessor, b in B, that is ftc -reachable from u. The third coloring axiom scheme is the NewStart axiom, which is useful in the context of dynamically changing graphs: for any first-order formula A(u), and binary relation symbols f and g, think of f as the previous edge relation and g as the current edge relation. NewStart[A, f, g] says that if there are no new edges between A nodes, then any new path, i.e., gtc but not ftc , from A must leave A to make its change: (∀u, v . A(u) ∧ A(v) ∧ g(u, v) → f (u, v)) → ∀u, v . gtc (u, v) ∧ ¬ftc (u, v) → ∃w . ¬A(w) ∧ gtc (u, w) ∧ gtc (w, v) NewStart[A, f, g] follows from the induction principle by a proof that is similar to the proof of GoOut[A, B, f ]. 3.2.1. Linked Lists. The spirit behind our consideration of the coloring axioms is similar to that found in a paper of Greg Nelson’s in which he introduced a set of reachability axioms for a functional predicate, f , i.e., there is at most one f edge leaving any point [Nel83]. Nelson asked whether his axiom schemes are complete for the functional setting. We remark that Nelson’s axiom schemes are provable from T1 plus our induction principle. However, Nelson’s axiom schemes are not complete: we constructed a functional graph that satisfies Nelson’s axioms but violates NoExit[A, f ] (Proposition 4.7). At least one of Nelson’s axiom schemes seems orthogonal to our coloring axioms and may be useful in certain proofs. Nelson’s fifth axiom scheme states that the points reachable from a given point are linearly ordered. The soundness of the axiom scheme is due to the fact that f is functional. We make use of a simplified version of Nelson’s ordering axiom scheme: Let Func[f ] ≡ ∀u, v, w . f (u, v) ∧ f (u, w) → v = w; then, Order[f ] ≡ Func[f ] → ∀u, v, w . ftc (u, v) ∧ ftc (u, w) → ftc (v, w) ∨ ftc (w, v) 3.2.2. Trees. When working with programs manipulating trees, we have a fixed set of selectors Sel and transitive closure is performed on the down relation, defined as _ ∀v1 , v2 . down(v1 , v2 ) ↔ s(v1 , v2 ) s∈Sel Trees have no sharing (i.e., the down relation is injective), thus a similar axiom to Order[f ] is used: ∀u, v, w . downtc (v, u) ∧ downtc (w, u) → downtc (v, w) ∨ downtc (w, v) Another important property of trees is that the subtrees below distinct children of a node are disjoint. We use the following axioms to capture this, where s1 6= s2 ∈ Sel: ∀v, v1 , v2 , w . ¬(s1 (v, v1 ) ∧ s2 (v, v2 ) ∧ downtc (v1 , w) ∧ downtc (v2 , w)) SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 9 4. O N TC-C OMPLETENESS In this section we consider the concept of TC-Completeness in detail. The reader anxious to see how we use our methodology is encouraged to skim or skip this section. We first show that there is no recursively enumerable TC-complete set of axioms. Proposition 4.1. Let Γ be an r.e. set of TC-valid first-order sentences. Then Γ is not TC-complete. Proof. By the proof of Corollary 9, page 11 of [IRR+ 04a], there is a recursive procedure that, given any Turing machine Mn as input, produces a first-order formula ϕn in a vocabulary τn such that ϕn is TC-valid iff Turing machine, Mn , on input 0 never halts. The vocabulary τn consists of the two binary relation symbols, E, Etc , constant symbols, a, d, and some unary relation symbols. It follows that if Γ were TC-complete, then it would prove all true instances of ϕn and thus the halting problem would be solvable. Proposition 4.1 shows that even in the presence of only one binary relation symbol, there is no r.e. TC-complete axiomatization. In [Avr03], Avron gives an elegant finite axiomatization of the natural numbers using transitive closure, a successor relation and the binary function symbol, “+”. Furthermore, he shows that multiplication is definable in this language. Since the unique TC-model for Avron’s axioms is the standard natural numbers it follows that: Corollary 4.2. Let Γ be an arithmetic set of TC-valid first-order sentences over a vocabulary including a binary relation symbol and a binary function symbol (or a ternary relation symbol). Then Γ is not TC-complete. In Proposition 3.1 we showed that any finite and acyclic model of T1 [f ] is a TC model. This can be strengthened to Proposition 4.3. Any finite model of T1 plus IND is a TC-model. Proof. Let A be a finite model of T1 plus IND. Let f be a binary relation symbol, and let a, b be elements of the universe of A. Since A |= T1 , if there is an f path from a to b then A |= ftc (a, b). Conversely, suppose that there is no f path from a to b. Let Ra be the set of elements of the universe of A that are reachable from a. Let k = |Ra |. Since A is finite we may use existential quantification to name exactly all the elements of Ra : x1 , . . . , xk . We can then define the color class: C(y) ≡ y = x1 ∨ · · · ∨ y = xk . Then we can prove using IND, or equivalently NoExit, that no vertex outside this color class is reachable from a, i.e., A |= ¬ftc (a, b). Thus, as desired, A is a TC-model. 4.1. More About TC-Completeness. Even though there is no r.e. set of TC-complete axioms in general, there are TC-complete axiomatizations for certain interesting cases. Let Σ be a set of formulas. We say that ψ is TC-valid wrt Σ iff every TC-model of Σ satisfies ψ. Let Γ be TC-sound. We say that Γ is TC-complete wrt Σ iff Γ ∪ Σ ⊢ ψ for every ψ that is TC-valid wrt Σ. We are interested in whether T1 plus IND is TC-complete with respect to interesting theories, Σ. Since TC[s](a, b) asserts the existence of a finite s-path from a to b, we can express that a structure is finite by writing the formula: Φ ≡ Func[s] ∧ ∃x∀y . stc (x, y). Observe that every TCmodel that satisfies Φ is finite. Thus, if we are in a setting – as is frequent in logic – where we may add a new binary relation symbol, s, then finiteness is TC-expressible. 10 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH Proposition 4.4. Let Σ be a finite set of formulas, and Γ an r.e., TC-complete axiomatization wrt Σ in a language where finiteness is TC-expressible. Then finite TC-validity for Σ is decidable. Proof. Let Φ be a formula as above that TC-expresses finiteness. Let ψ be any formula. If ψ is not finite TC-valid wrt Σ, then we can find a finite TC model of Σ where ψ is false. If ψ is finite TC-valid, then Γ ∪ Σ ⊢ Φ → ψ, and we can find this out by systematically generating all proofs from Γ. From Proposition 4.4 we know that we must restrict our search for cases of TC-completeness to those where finite TC-validity is decidable. In particular, since the finite theory of two functional relations is undecidable, e.g., [IRR+ 04a], we know that, Corollary 4.5. There are no r.e. TC-valid axioms for the functional case even if we restrict to at most two binary relation symbols. 4.2. Nelson’s Axioms. Our idea of considering transitive-closure axioms is similar in spirit to the approach that Nelson takes [Nel83]. To prove some program properties, he introduces a set of reachability axiom schemes for a functional predicate, f . By “functional” we mean that f is a partial function: Func[f ] ≡ ∀u, v, w . f (u, v) ∧ f (u, w) → v = w. We remark that Nelson’s axiom schemes are provable from T1 plus our induction principle. At least two of his schemes may be useful for us to add in our approach. Nelson asked whether his axioms are complete for the functional setting. It follows from Corollary 4.5 that the answer is no. We prove below that Nelson’s axioms do not prove NoExit. f Nelson’s basic relation symbols are ternary. For example, he writes “u → v” to mean that there x x (u, v), where, for is an f -path from u to v that follows no edges out of x. We encode this as, ftc x each parameter x we add a new relation symbol, f , together with the assertion: ∀u, v . f x (u, v) ↔ f (u, v) ∧ (u 6= x). Nelson also includes a notation for modifying the partial function f . He writes, (p) fq for the partial function that agrees with f everywhere except on argument p where it has value q. Nelson’s eighth axiom scheme asserts a basic consistency property for this notation. In our (p) translation we simply assert that fq (u, v) ↔ (u 6= p ∧ f (u, v)) ∨ (u = p ∧ v = q). When we translate Nelson’s eighth axiom scheme the result is tautological, so we can safely omit it. Using our translation, Nelson’s axiom schemes are the following. x (u, v) ↔ (u = v) ∨ ∃z . (f x (u, z) ∧ f x (z, v)) (N1) ftc tc x (u, v) ∧ f x (v, w) → f x (u, w) (N2) ftc tc tc x (u, v) → f (u, v) (N3) ftc tc y z (u, y) → f z (u, x) (N4) ftc (u, x) ∧ ftc tc y x (u, y) (N5) ftc (u, x) → ftc (u, x) ∨ ftc y z (u, y) → f z (x, y) (N6) ftc (u, x) ∧ ftc tc x (u, v) (N7) f (x, u) ∧ ftc (u, v) → ftc These axiom schemes can be proved using appropriate instances of T1 and the induction principle. Just as we showed in Proposition 3.1 that any finite and acyclic model of T1 [f ] is a TC model, we have that, Proposition 4.6. Any finite and functional model of Nelson’s axioms is a TC-model. SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 11 Proof. Consider any finite and function model, M. We claim that for each f and x ∈ |M|, x )M = ((f x )M )⋆ . If there is an f x path from u to v, then it follows from repeated uses of (ftc x holds. (N1) that ftc If there is no f x path from u to v and u is not on an f -cycle, then using (N1) we can follow x does not hold. f -edges from u to the end and prove that ftc x If there is no f path from u to v and u is on an f -cycle containing x, then using (N1) we can x (u, v) does not hold. follow f -edges from u to x to prove that ftc Finally, if there is no f path from u to v and u is on an f -cycle, suppose for the sake of a x (u, v) must contradiction that ftc (u, v) holds. Let x be the predecessor of u on the cycle. By N7, ftc hold. However, this contradicts the previous paragraph. Axiom schemes (N5) and (N7) may be useful for us to assert when f is functional. (N5) says that the points reachable from u are totally ordered in the sense that if x and y are both reachable from u, then in the path from u either x comes first or y comes first. (N7) says that if there is an edge from x to u and a path from u to v, then there is a path from u to v that does not go through x. This implies the useful property that no vertex not on a cycle is reachable from a vertex on the cycle. We conclude this section by proving the following, Proposition 4.7. Nelson’s axioms do not imply NoExit. 0 , f 1 , f 2 , . . . , f ∞ , A) such that V = N ∪ {∞}, the Proof. Consider the structure G = (V, f, ftc , ftc tc tc tc set of natural numbers plus a point at infinity. Let A = N, i.e., the color class A is interpreted as all points except ∞. Define f = {hu, u + 1i | u ∈ N}, i.e., there is an edge from every natural number to its successor, but ∞ is isolated. However, let ftc = {hu, vi | u ≤ v}, i.e., G believes that there is k = {hu, vi|u ≤ v ∧ (k < a path from each natural number to infinity. Similarly, for each k ∈ V , ftc u ∨ v ≤ k)}. It is easy to check that G satisfies all of Nelson’s axioms. The problem is that G |= ¬NoExit[A, f ]. It follows that Nelson’s axioms do not entail NoExit[A, f ]. This is another proof that they are not TC complete. 4.3. TC-Completeness for Words. In this subsection, we prove that T1 plus IND is TC-complete for words. For any alphabet, Σ, let the vocabulary of words over Σ be vocab(Σ) = h0, max; s2 , s2tc , Pσ1 : σ ∈ Σi . The domain of a word model is an ordered set of positions, and the unary relation Pσ (x) expresses the presence of symbol σ at position x. s is the successor relation over positions, and stc is its transitive closure. The constants 0 and max represent the first and last positions in the word. A simple axiomatization of words is AΣw , the conjunction of the following four statements: (A1) ∀x . (¬s(x, 0) ∧ ¬s(max, x) ∧ (x 6= 0 → ∃y . s(y, x)) ∧ (x 6= max → ∃y . s(x, y))) (A2) ∀xyz . ((s(x, y) ∧ s(x, z)) ∨ (s(y, x) ∧ s(z, x))) → y = z (A3) ∀x . stc (0, x) ∧ stc (x, max) _ ^ (A4) ∀x . (Pσ (x) ∧ ¬Pτ (x)) σ∈Σ τ 6=σ In particular, observe that a TC-model of AΣw is exactly a Σ word. Let Γ = IND ∪ {T1 }. We wish to prove the following: Theorem 4.8. Γ is TC-complete wrt AΣw . 12 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH We first note that Γ ∪ {AΣw } implies acyclicity: ∀xy . s(x, y) → ¬stc (y, x). The proof using induction proceeds as follows: in the base case, there is no loop at 0. Inductively, suppose there is no loop starting at x, s(x, y) holds, but there is a loop at y, i.e., ∃z . s(y, z) ∧ stc (z, y). Then by T1 and IND we know ∃x′ . stc (z, x′ ) ∧ s(x′ , y), and stc (y, x′ ). (A2) asserts that the in-degree of s is 1, which means x′ = x and we have a contradiction: stc (y, x). In order to prove Theorem 4.8, we need to show that if ϕ is true in all TC models of Γ ∪ {AΣw }, i.e., in all words, then Γ ∪ {AΣw } ⊢ ϕ. By the completeness of first-order logic it suffices to show that Γ ∪ {AΣw } |= ϕ. We prove the contrapositive of this in Lemma 4.10. In order to do so, we first construct a DFA Dϕ that has some desirable properties. Lemma 4.9. For any ϕ ∈ L(vocab(Σ)) we can build a DFA Dϕ = (Qϕ , Σ, δϕ , q1 , Fϕ ), satisfying the following properties: (1) The states q1 , q2 , . . . qn of Dϕ are first-order definable as formulas q11 , q21 , . . . qn1 , where intuitively qi (x) will mean that Dϕ is in state qi after reading symbols at word positions 0, 1, . . . , x. (2) The transition function δϕ of Dϕ is captured by the first-order definitions of the states. That is, for all i ≤ n, Γ ∪ AΣw semantically implies the following two formulas for every state qi : _ (a) qi (0) ↔ Pσ (0). σ∈Σ,δϕ (q1 ,σ)=qi  (b) ∀u, v . s(u, v) → qi (v) ↔ _  (Pσ (v) ∧ qj (u)) . σ∈Σ,δϕ (qj ,σ)=qi (3) Γ ∪ {AΣw } |= ϕ ↔ F (max), where F (u) ≡ _ qi (u). qi ∈Fϕ Proof. We prove properties 1, 2, and 3 while constructing Dϕ and the first-order definitions of its states by induction on the length of ϕ. The reward is that we get a generalized form of the McNaughton-Papert [MP71] construction that works on non-standard models. Some subformulas of ϕ may have free variables, e.g., x, y. In the inductive step considering such subformulas, we expand the vocabulary of the automaton to Σ′ = {x, ǫ} × {y, ǫ} × Σ. We write Pσ (u) ∧ (x = u) ∧ (y 6= u) to mean that at position u, symbol σ occurs, as does x, but not y. Note: Since every structure gives a unique value to each variable, x, we are only interested in strings in which x occurs at exactly one position. For the following induction, let B be any model of Γ ∪ {AΣw }. For the intermediate stages of induction where some variables may occur freely, we assume that B interprets these free variables. We prove that the formulas of properties 2 and 3 must hold in B at each step of the induction. Base cases: ϕ is either Pσ (x), x = y, s(x, y), or stc (x, y). ϕ = Pσ (x): The automaton for Pσ (x) and its state definitions are shown in Fig 1. State predicate q1 (v) q2 (v) q3 (v) Definition ¬stc (x, v) stc (x, v) ∧ Pσ (x) stc (x, v) ∧ ¬Pσ (x) Table 1: DPσ (x) Figure 1: DPσ (x) SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 13 Properties 2 and 3 can be verified as follows: For property 2b, suppose that B |= s(u, v). We must show that B |= q2 (v) iff one of two rules leading to state q2 holds. These two rules correspond to the edge from q1 (if x = v), and the self loop on q2 (if x 6= v). Suppose B |= q2 (v) ∧ (v = x). Expanding the definition of q2 , we get B |= stc (x, v) ∧ Pσ (x) ∧ (v = x). But this means B |= ¬stc (x, u) since B |= Γ ∪ {AΣw } and we have acyclicity. Therefore, we have B |= q1 (u) by definition of q1 , and we get the desired conclusion, B |= q1 (u) ∧ Pσ (v). The case corresponding to x 6= v is also easy, and relies on the fact that B |= stc (x, v) ∧ s(u, v) ∧ (x 6= v) → stc (x, u). In other words, if q2 (v) holds and x 6= v, then q2 holds at v’s predecessor too. This proves one direction of property 2b for state q2 . The other direction for q2 , and the proofs for other states proceed similarly. The proof for 2a is similar. For property 3, we need to show that B |= Pσ (x) ↔ q2 (max). This can be verified easily from the definition of q2 . ϕ = (x = y) or s(x, y): The automata and their state definitions for ϕ = (x = y) and ϕ = s(x, y) are shown in Figs 2 and 3. Properties 2 and 3 can be verified easily for these definitions. State predicate q1 (v) q2 (v) q3 (v) Definition ¬stc (x, v) (x = y) ∧ stc (x, v) (x 6= y) ∧ stc (x, v) Table 2: Dx=y Figure 2: Dx=y State predicate q1 (v) q2 (v) q3 (v) q4 (v) Definition ¬stc (x, v) x=v s(x, y) ∧ stc (y, v) stc (x, v) ∧ (x 6= v)∧ ¬s(x, y) Table 3: Ds(x,y) Figure 3: Ds(x,y) ϕ = stc (x, y): The automaton for ϕ = stc (x, y), and its state definitions are shown in Fig 4. We provide a sketch of the proof of property 2b for state q3 . Proofs for other states follow using similar arguments. Suppose B |= q3 (v) ∧ s(u, v). Expanding the definition of q3 (v), we get B |= stc (x, y) ∧ stc (y, v) ∧ s(u, v). There are two possibilities: v 6= y and v = y, corresponding to the loop on state q3 , and the incoming edges from q2 or q1 . Suppose v = y. Now we have two further cases, x = y and x 6= y. 14 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH State predicate Definition q1 (v) ¬stc (x, v) q2 (v) stc (x, v)∧ ¬(stc (x, y) ∧ stc (y, v)) q3 (v) stc (x, y) ∧ stc (y, v) Table 4: Dstc (x,y) Figure 4: Dstc (x,y) If x = y = v, we get B |= ¬stc (x, u), or B |= q1 (u) ∧ s(u, x) ∧ (x = y = v), denoting the appropriate transition from state q1 . On the other hand, if B |= (x 6= y), we need to show that q3 was reached via q2 . Expanding the definition of q3 (v) we have B |= stc (x, y)∧stc (y, v). Since y = v, we get B |= stc (x, u)∧s(u, y). But by definition of q2 , this means B |= q2 (u). Thus, we have B |= q2 (u) ∧ s(u, v) ∧ v = y, the appropriate transition rule for moving from state q2 to q3 . For this direction of property 2b, the only remaining case is y 6= v. In this case, it is easy to prove that we entered state q3 at y, and looped thereafter using the appropriate transition for the loop. For the reverse direction, we need to prove that if a transition rule is applicable at a position then the corresponding next state must hold at the next position. This is easily verified using the state-definitions. Property 2 for other states follows by similar arguments. Property 3 can also be verified easily using the definition of q3 . Inductive steps: ϕ is either ϕ1 ∧ ϕ2 , or ¬ψ, or ∃x . ψ(x). ϕ = ϕ1 ∧ϕ2 : Inductively we have Dϕ1 and Dϕ2 with final state definitions qf1 and qf2 respectively. To construct Dϕ , we perform the product construction: let qi be state definitions of Dϕ1 and qi′ those of Dϕ2 . Then the state definitions of Dϕ are qhi,ji, and we have qhi,ji(u) ≡ qi (u) ∧ qj′ (u). The accepting states are _ qhf1 ,f2 i (u). Fϕ1 ∧ϕ2 (u) ≡ f1 ∈F1 ∧f2 ∈F2 Property 1 holds because we are still in first-order. Property 2 follows because we are just performing logical transliterations of the standard DFA conjunction operation. Property 3 follows from the fact that we already have B |= F1 (max) ↔ ϕ1 and B |= F2 (max) ↔ ϕ2 , and from the definition of Fϕ1 ∧ϕ2 . ϕ = ¬ψ: In this case, we take the complement of Dψ which is easy because our automata are deterministic. Let the final state of Dψ be F ′ . Dϕ has the same state definitions as ψ, but its final state definition is F (u) ≡ ¬F ′ (u). It is easy to see that properties 1, 2 and 3 hold in this case. ϕ = ∃x . ψ(x): Inductively we have Dψ = ({q1 , . . . , qn }, Σ × {x, ǫ}, δψ , q1 , Fψ ). First we transform Dψ to an NFA Nϕ = ({p1 , . . . , pn , p′1 , . . . , p′n }, Σ, δ, p1 , F ), where F = ′ {pi |qi ∈ Fψ } and δ(pi , σ) = {pj , p′k |δψ (qi , σ ∧ ¬x) = qj , δψ (qi , σ ∧ x) = qk }. Thus Nϕ no longer sees x’s. Instead, it guesses the one place that x might occur, and that is where the transition from pi to p′i occurs. (See Fig. 5) Let pi (u) ≡ ∃x . ¬stc (x, u) ∧ qi (u); p′i (u) ≡ ∃x . stc (x, u) ∧ qi (u). SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 15 Figure 5: N∃x . Pσ (x) Define Dϕ to be the DFA equivalent to Nϕ using the subset construction. Let S0 = {pi0 , p′j |j ∈ J0 }, S1 = {pi1 , p′j |j ∈ J1 } be two states of Dϕ . (Note that each reachable state of Dϕ has exactly one element of {p1 , . . . , pn }.) Observe that in a “run” of Nϕ on B, we can be in state pi at position u iff B |= pi (u) and we can be in state p′i of u iff B |= p′i (u). Thus, the first-order formula capturing state S0 is ^ ^ ¬p′j (u) p′j (u) ∧ S0 (u) ≡ pi0 ∧ j∈J0 j ∈J / 0 Conditions 2 and 3 for Dϕ thus follow by these conditions for Dψ , which hold by inductive assumption. For example, if δϕ (S0 , σ) = S1 , then δψ (pi0 , σ ∧ ¬x) = pi1 , and j ∈ J1 iff δψ (qi0 , σ ∧ x) = qj or δψ (qj0 , σ ∧ ¬x) = qj for some j0 ∈ J0 . Thus, we have inductively constructed the Dϕ and proved that it satisfies properties 1, 2, and 3. Lemma 4.9 tells us that for any model B of Γ ∪ {AΣw }, B |= ϕ iff B |= Fϕ (max). In other words, B |= ϕ iff B “believes” that there is a path from the start state to some qf in Fϕ . As a part of the next lemma, we use induction to prove that this implies that there actually must be a path in Dϕ from the start state to some qf in Fϕ . Lemma 4.10. Suppose B |= Γ ∪ {AΣw } ∪ {ϕ}. Then, there exists a word, w0 , such that its corresponding word model, B0 , satisfies ϕ. Proof. By Lemma 4.9, we can construct Dϕ , and we have B |= Fϕ (max). So B “believes” that there is a path to some qf ∈ Fϕ . Suppose there is no such path in Dϕ . Let C denote the disjunction of all states that are truly reachable from the start state in Dϕ . This situation can be expressed as follows: ∀u, v . C(u) ∧ s(u, v) → C(v). But this is exactly the premise for the axiom scheme NoExit, which must hold since B |= Γ. Therefore, we have B |= ∀u, v . C(v) ∧ stc (u, v) → C(v). This implies some accepting state qf should be in C, because B |= ∀u . stc (u, max) ∧ Fϕ (max), and we get a contradiction. Therefore, there has to be a real path from the start state to a final state qf in Dϕ . This implies that the DFA Dϕ accepts some standard word, w0 . Let B0 be the word model corresponding to w0 . Thus B0 |= Fϕ (max), and therefore by Lemma 4.9 B0 |= ϕ as desired. 16 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH Node reverse(Node x){ [0] Node y = null; [1] while (x != null){ [2] Node t = x.next; [3] x.next = y; [4] y = x; [5] x = t; [6] } [7] return y; } Figure 6: A simple Java-like implementation of the in-place reversal of a singly linked list. 5. H EURISTICS FOR U SING THE C OLORING A XIOMS This section presents heuristics for using the coloring axioms. Toward that end, it answers the following questions: • How can the coloring axioms be used by a theorem prover to prove χ? (Section 5.2) • When should a specific instance of a coloring axiom be given to the theorem prover while trying to prove χ? (Section 5.4) • What part of the process can be automated? (Section 5.5) We first present a running example (more examples are described in Section 5.6 and used in later sections to illustrate the heuristics). We then explain how the coloring axioms are useful, describe the search space for useful axioms, give an algorithm for exploring this space, and conclude by discussing a prototype implementation we have developed that proves the example presented and others. 5.1. Reverse Specification. The heuristics described in Sections 5.2–5.4 are illustrated on problems that arise in the verification of partial correctness of a list reversal procedure. Other examples proven using this technique can be found in Section 5.6. The procedure reverse, shown in Fig. 6, performs in-place reversal of a singly linked list, destructively updating the list. The precondition requires that the input list be acyclic and unshared (i.e., each heap node is pointed to by at most one heap node). For simplicity, we assume that there is no garbage. The postcondition ensures that the resulting list is acyclic and unshared. Also, it ensures that the nodes reachable from the formal parameter on entry to reverse are exactly the nodes reachable from the return value of reverse at the exit. Most importantly, it ensures that each edge in the original list is reversed in the returned list. The specification for reverse is shown in Fig. 7. We use unary predicates to represent program variables and binary predicates to represent data-structure fields. Fig. 7(a) defines some shorthands. To specify that a unary predicate z can point to a single node at a time and that a binary predicate f of a node can point to at most one node (i.e., f is a partial function), we use unique[z] and f unc[f ] . To specify that there are no cycles of f -fields in the graph, we use acyclic[f ]. To specify that the graph does not contain nodes shared by f -fields, (i.e., nodes with 2 or more incoming f fields), we use unshared[f ]. To specify that all nodes in the graph are reachable from z1 or z2 by following f -fields, we use total[z1 , z2 , f ]. Another helpful shorthand is rx,f (v) which specifies that v is reachable from the node pointed to by x using f -edges. SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 17 The precondition of the reverse procedure is shown in Fig. 7(b). We use the predicates xe and ne to record the values of the variable x and the next field at the beginning of the procedure. The precondition requires that the list pointed to by x be acyclic and unshared. It also requires that unique[z] and f unc[f ] hold for all unary predicates z that represent program variables and all binary predicates f that represent fields, respectively. For simplicity, we assume that there is no garbage, i.e., all nodes are reachable from x. The post-condition is shown in Fig. 7(c). It ensures that the resulting list is acyclic and unshared. Also, it ensures that the nodes reachable from the formal parameter x on entry to the procedure are exactly the nodes reachable from the return value y at the exit. Most importantly, we wish to show that each edge in the original list is reversed in the returned list (see Eq. (5.9)). A loop invariant is given in Fig. 7(d). It describes the state of the program at the beginning of each loop iteration. Every node is in one of two disjoint lists pointed to by x and y (Eq. (5.10)). The lists are acyclic and unshared. Every edge in the list pointed to by x is exactly an edge in the original list (Eq. (5.12)). Every edge in the list pointed to by y is the reverse of an edge in the original list (Eq. (5.13)). The only original edge going out of y is to x (Eq. (5.14)). The transformer is given in Fig. 7(e), using the primed predicates n′ , x′ , and y ′ to describe the values of predicates n, x, and y, respectively, at the end of the iteration. 5.2. Proving Formulas using the Coloring Axioms. All the coloring axioms have the form A ≡ PA → CA , where PA and CA are closed formulas. We call PA the axiom’s premise and CA the axiom’s conclusion. For an axiom to be useful, the theorem prover will have to prove the premise (as a subgoal) and then use the conclusion in the proof of the goal formula χ. For each of the coloring axioms, we now explain when the premise can be proved, how its conclusion can help, and give an example. NoExit. The premise PNoExit [C, f ] states that there are no f -edges exiting color class C. When C is a unary predicate appearing in the program, the premise is sometimes a direct result of the loop invariant. Another color that will be used heavily throughout this section is reachability from a unary predicate, i.e., unary reachability, formally defined in Eq. (5.6). Let us examine two cases. PNoExit [rx,f , f ] is immediate from the definition of rx,f and the transitivity of ftc . PNoExit [rx,f , f ′ ] actually states that there is no f -path from x to an edge for which f ′ holds but f does not, i.e., a change in f ′ with respect to f . Thus, we use the absence of f -paths to prove the absence of f ′ -paths. In many cases, the change is an important part of the loop invariant, and paths from and to it are part of the specification. A sketch of the proof by refutation of PNoExit [rx′ ,n , n′ ] that arises in the reverse example is given in Fig. 8. The numbers in brackets are the stages of the proof. (1) The negation of the premise expands to: ∃u1 , u2 , u3 . x′ (u1 ) ∧ ntc (u1 , u2 ) ∧ ¬ntc (u1 , u3 ) ∧ n′ (u2 , u3 ) (2) Since u2 is reachable from u1 and u3 is not, by T2 , we have ¬n(u2 , u3 ). (3) By the definition of n′ in the transformer, the only edge in which n differs from n′ is out of x (one of the clauses generated from Eq. (5.15) is ∀v1 , v2 . ¬n′ (v1 , v2 )∨ n(v1 , v2 )∨ x(v1 )) . Thus, x(u2 ) holds. (4) By the definition of x′ it has an incoming n edge from x. Thus, n(u2 , u1 ) holds. The list pointed to by x must be acyclic, whereas we have a cycle between u1 and u2 ; i.e., we have a contradiction. Thus, PNoExit [rx′ ,n , n′ ] must hold. CNoExit [C, f ] states there are no f paths (ftc edges) exiting C. This is useful because proving the absence of paths is the difficult part of proving formulas with TC. 18 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH def unique[z] = ∀v1 , v2 .z(v1 ) ∧ z(v2 ) → v1 = v2 def f unc[f ] = ∀v1 , v2 , v.f (v, v1 ) ∧ f (v, v2 ) → v1 = v2 def acyclic[f ] = ∀v1 , v2 .¬f (v1 , v2 ) ∨ ¬TC[f ](v2 , v1 ) (a) def unshared[f ] = ∀v1 , v2 , v.f (v1 , v) ∧ f (v2 , v) → v1 = v2 def total[z1 , z2 , f ] = ∀v.∃w.(z1 (w) ∨ z2 (w)) ∧ TC[f ](w, v) def rx,f (v) = ∃w . x(w) ∧ TC[f ](w, v) (5.1) (5.2) (5.3) (5.4) (5.5) (5.6) def − (v) = ∃w . x(w) ∧ TC[f ](v, w) rx,← f (5.7) def (b) pre = total[xe, xe, ne] ∧ acyclic[ne] ∧ unshared[ne] ∧ unique[xe] ∧ f unc[ne] (c) post = total[y, y, n] ∧ acyclic[n] ∧ unshared[n] ∧ ∀v1 , v2 .ne(v1 , v2 ) ↔ n(v2 , v1 ) (d) LI[x, y, n] = total[x, y, n] ∧ ∀v.(¬rx,n (v) ∨ ¬ry,n (v)) ∧ acyclic[n] ∧ unshared[n] unique[x] ∧ unique[y] ∧ f unc[n] ∧ ∀v1 , v2 .(rx,n (v1 ) → (ne(v1 , v2 ) ↔ n(v1 , v2 ))) ∧ ∀v1 , v2 .(ry,n (v2 ) ∧ ¬y(v1 ) → (ne(v1 , v2 ) ↔ n(v2 , v1 ))) ∧ ∀v1 , v2 , v.y(v1 ) → (x(v2 ) ↔ ne(v1 , v2 )) def def (5.8) (5.9) (5.10) (5.11) (5.12) (5.13) (5.14) def (e) T = ∀v.(y ′ (v) ↔ x(v)) ∧ ∀v.(x′ (v) ↔ ∃w.x(w) ∧ n(w, v)) ∧ ∀v1 , v2 .n′ (v1 , v2 ) ↔ ((n(v1 , v2 ) ∧ ¬x(v1 )) ∨ (x(v1 ) ∧ y(v2 ))) (5.15) Figure 7: Example specification of reverse procedure: (a) shorthands, (b) precondition pre, (c) postcondition post, (d) loop invariant LI[x, y, n], (e) transformer T (effect of the loop body). n[4] x′ [1] { ntc [1] @ABC @ABC / GFED / GFED u2 o u1 K KK¬ntc [1] n′ [1] ss KK ss KK% ysss @ABC GFED u3 i ¬n[2] x[3] Figure 8: Proving PNoExit [rx,n , n′ ]. GoOut. The premise PGoOut [A, B, f ] states that all f edges going out of color class A, go to B. When A and B are unary predicates that appear in the program, again the premise sometimes holds as a direct result of the loop invariant. An interesting special case is when B is defined as SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 19 ∃w . A(w) ∧ f (w, v). In this case the premise is immediate. Note that in this case the conclusion is provable also from T1 . However, from experience, the axiom is very useful for improving performance (2 orders of magnitude when proving the acyclic part of reverse’s postcondition). CGoOut [A, B, f ] states that all paths out of A must pass through B. Thus, under the premise PGoOut [A, B, f ], if we know that there is a path from A to somewhere outside of A, we know that there is a path to there from B. In case all nodes in B are reachable from all nodes in A, together with the transitivity of ftc this means that the nodes reachable from B are exactly the nodes outside of A that are reachable from A. For example, CGoOut [y ′ , y, n′ ] allows us to prove that only the original list pointed to by y is reachable from y ′ (in addition to y ′ itself). NewStart. The premise PNewStart [C, g, h] states that all g edges between nodes in C are also h edges. This can mean the iteration has not added edges or has not removed edges according to the selection of h and g. In some cases, the premise holds as a direct result of the definition of C and the loop invariant. CNewStart [C, g, h] means that every g path that is not an h path must pass outside of C. Together with CNoExit [C, g], it proves there are no new paths within C. For example, in reverse the NewStart scheme can be used as follows. No outgoing edges were added to nodes reachable from y. There are no n or n′ edges from nodes reachable from y to nodes not reachable from y. Thus, no paths were added between nodes reachable from y. Since the list pointed to by y is acyclic before the loop body, we can prove that it is acyclic at the end of the loop body. We can see that NewStart allows the theorem prover to reason about paths within a color, and the other axioms allow the theorem prover to reason about paths between colors. Together, given enough colors, the theorem prover can often prove all the facts that it needs about paths and thus prove the formula of interest. 5.3. The Search Space of Possible Axioms. To answer the question of when we should use a specific instance of a coloring axiom when attempting to prove the target formula, we first define the search space in which we are looking for such instances. The axioms can be instantiated with the colors defined by an arbitrary unary formula (one free variable) and one or two binary predicates. First, we limit ourselves to binary predicates for which TC was used in the target formula. Now, since it is infeasible to consider all arbitrary unary formulas, we start limiting the set of colors we consider. The initial set of colors to consider are unary predicates that occur in the formula we want to prove. Interestingly enough, these colors are enough to prove that the postcondition of mark and sweep is implied by the loop invariant, because the only axiom we need is NoExit[marked, f ]. An immediate extension that is very effective is forward and backward reachability from unary predicates, as defined in Eq. (5.6) and Eq. (5.7), respectively. Instantiating all possible axioms from the unary predicates appearing in the formula and their unary forward reachability predicates, allows us to prove reverse. For a list of the axioms needed to prove reverse, see Fig. 9. Other examples are presented in Section 5.6. Finally, we consider Boolean combinations of the above colors. Though not used in the examples shown in this paper, this is needed, for example, in the presence of sharing or when splicing two lists together. All the colors above are based on the unary predicates that appear in the original formula. To prove the reverse example, we needed x′ as part of the initial colors. Table 5 gives a heuristic for finding the initial colors we need in cases when they cannot be deduced from the formula, and how it applies to reverse. 20 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH NoExit[rx′ ,n , n′ ] GoOut[x, x′ , n] NoExit[rx′ ,n′ , n] GoOut[x, y, n′ ] NoExit[ry,n , n′ ] NoExit[ry,n′ , n] NewStart[rx′ ,n , n, n′ ] NewStart[rx′ ,n′ , n, n′ ] NewStart[ry,n , n, n′ ] NewStart[ry,n′ , n, n′ ] NewStart[rx′ ,n , n′ , n] NewStart[rx′ ,n′ , n′ , n] NewStart[ry,n , n′ , n] NewStart[ry,n′ , n′ , n] Figure 9: The instances of coloring axioms used in proving reverse. Group Roots[f] StartChange[f,g] EndChange[f,g] (a) Criteria All changes are reachable from one of the colors using ftc All edges for which f and g differ start from a node in these colors All edges for which f and g differ end at a node in these colors Group Roots[n] Roots[n′ ] StartChange[n, n′ ] EndChange[n, n′ ] (b) Colors x(v), y(v) x′ (v), y ′ (v) x(v) y(v), x′ (v) Table 5: (a) Heuristic for choosing initial colors. (b) Results of applying the heuristic on reverse. An interesting observation is that the initial colors we need can, in many cases, be deduced from the program code. As in the previous section, we have a good way for deducing paths between colors and within colors in which the edges have not changed. The program usually manipulates fields using pointers, and can traverse an edge only in one direction. Thus, the unary predicates that represent the program variables (including the temporary variables) are in many cases what we need as initial colors. 5.4. Exploring the Search Space. When trying to automate the process of choosing colors, the problem is that the set of possible colors to choose from is doubly-exponential in the number of initial colors; giving all the axioms directly to the theorem prover is infeasible. In this section, we define a heuristic algorithm for exploring a limited number of axioms in a directed way. Pseudocode for this algorithm is shown in Fig. 10. The operator ⊢ is implemented as a call to a theorem prover. Because the coloring axioms have the form A ≡ PA → CA , the theorem prover must prove PA or the axiom is of no use. Therefore, the pseudocode works iteratively, trying to prove PA from the current ψ ∧ Σ, and if successful it adds CA to Σ. The algorithm tries colors in increasing levels of complexity. BC(i, C) gives all the Boolean combinations of the predicates in C up to size i. After each iteration we try to prove the goal formula. Sometimes we need the conclusion of one axiom to prove the premise of another. The NoExit axioms are particularly useful for proving PNewStart . Therefore, we need a way to order instantiations so that axioms useful for proving the premises of other axioms are acquired first. The ordering we chose is based on phases: First, try to instantiate axioms from the axiom scheme GoOut. Second, try to instantiate axioms from the axiom scheme NoExit. Finally, try to instantiate axioms from the axiom scheme NewStart. For NewStart[c, f, g] to be useful, we need to be able SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 21 explore(Init, χ) { Let χ = ψ → ϕ Σ := {Trans[f ], Order[f ] | f ∈ F } Σ := Σ ∪ {T1 [f ], T2 [f ] | f ∈ F } C := {rc,f (v) | c ∈ Init, f ∈ F } C := C ∪ Init i := 1 forever { C ′ := BC(i, C) // Phase 1 foreach f ∈ F, cs 6= ce ∈ C ′ if Σ ∧ ψ ⊢ PGoOut [cs , ce , f ] Σ := Σ ∪ {CGoOut [cs , ce , f ]} // Phase 2 foreach f ∈ F, c ∈ C ′ if Σ ∧ ψ ⊢ PNoExit [c, f ] Σ := Σ ∪ {CNoExit [c, f ]} // Phase 3 foreach CNoExit [c, f ] ∈ Σ, g 6= f ∈ F if Σ ∧ ψ ⊢ PNewStart [c, f, g] Σ := Σ ∪ {CNewStart [c, f, g]} if Σ ∧ ψ ⊢ ϕ return SUCCESS i := i + 1 } } Figure 10: An iterative algorithm for instantiating the axiom schemes. Each iteration consists of three phases that augment the axiom set Σ to show that there are either no incoming f -paths or no outgoing f -paths from c. Thus, we only try to instantiate such an axiom when either PNoExit [c, f ] or PNoExit [¬c, f ] has been proven. 5.5. Implementation. The algorithm presented here was implemented using a Perl script and the S PASS theorem prover [WGR96] and used successfully to verify the example programs of Section 5.1 and Section 5.6. The method described above can be optimized. For instance, if CA has already been added to the axioms, we do not try to prove PA again. These details are important in practice, but have been omitted for brevity. When trying to prove the different premises, S PASS may fail to terminate if the formula that it is trying to prove is invalid. Thus, we limit the time that S PASS can spend proving each formula. It is possible that we will fail to acquire useful axioms this way. 5.6. Further Examples. This section shows the code (Fig. 11) and the complete specification of two additional examples: appending two linked lists, and the mark phase of a simple mark and sweep garbage collector. 22 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH Node append(Node x, Node y) { [0] Node last = x; [1] if (last == null) [2] return y; [3] while (last.next != null) { [4] last = last.next; [5] } [6] last.next = y; [7] return x; } (a) void mark(NodeSet root, NodeSet marked) { [0] Node x; [1] if(!root.isEmpty()){ [2] NodeSet pending = new NodeSet(); [3] pending.addAll(root); [4] marked.clear(); [5] while (!pending.isEmpty()) { [6] x = pending.selectAndRemove(); [7] marked.add(x); [8] if (x.car != null && [9] !marked.contains(x.car)) [10] pending.add(x.car); [11] if (x.cdr != null && [12] !marked.contains(x.cdr)) [13] pending.add(x.cdr); } } } (b) Figure 11: A simple Java-like implementation of (a) the concatenation procedure for two singlylinked lists; (b) the mark phase of a mark-and-sweep garbage collector. 5.6.1. Specification of append. The specification of append (see Fig. 11(a)) is given in Fig. 12. The specification includes procedure’s pre-condition, a transformer of the procedure’s body effect, and the procedure’s post-condition. The pre-condition (Fig. 12(a)) states that the lists pointed to by x and y are acyclic, unshared and disjoint. It also states there is no garbage. The post condition (Fig. 12(b)) states that after the procedure’s execution, the list pointed to by x′ is exactly the union of the lists pointed to by x and y. Also, the list is still acyclic and unshared. The transformer is given in Fig. 12(c). The result of the loop in the procedure’s body is summarized as a formula defining the last variable. The only change to n is the addition of an edge between last and y. The coloring axioms needed to prove append are given in Fig. 13. SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 23 def (a) pre = acyclic[n] ∧ unshared[n] ∧ unique[x] ∧ unique[y] ∧ f unc[n] ∧ (∀v.¬rx,n (v) ∨ ¬ry,n (v)) ∧ ∀v.rx,n (v) ∨ ry,n (v) (5.16) def (b) post = acyclic[n′ ] ∧ unshared[n′ ] ∧ unique[x′ ] ∧ unique[last] ∧ f unc[n′ ] ∧ (∀v . rx′ ,n′ (v) ↔ (rx,n (v) ∨ ry,n (v))) ∧ ∀v1 , v2 . n′ (v1 , v2 ) ↔ n(v1 , v2 ) ∨ (last(v1 ) ∧ y(v2 )) (5.17) T is the conjunction of the following formulas: (c) ∀v.x′ (v) ∀v.last(v) ↔ ↔ ∃v. ′ ∀v1 , v2 .n (v1 , v2 ) ↔ x(v) rx,n (v) ∧ ∀u.¬n(v, u) last(v) n(v1 , v2 ) ∨ (last(v1 ) ∧ y(v2 )) (5.18) (5.19) (5.20) (5.21) Figure 12: Example specification of append procedure: (a) precondition pre, (b) postcondition post, (c) transformer T (effect of the procedure body). NoExit[ry,n , n′ ] GoOut[last, y, n′ ] NewStart[rx,n , n, n′ ] NewStart[rx,n , n′ , n] NewStart[ry,n , n, n′ ] NewStart[ry,n , n′ , n] Figure 13: The instances of coloring axioms used in proving append. 5.6.2. Specification of the mark phase. Another example proven is the mark phase of a mark-andsweep sequential garbage collector, shown in Fig. 11(b). The example goes beyond the reverse example in that it manipulates a general graph and not just a linked list. Furthermore, as far as we know, ESC/Java [FLL+ 02] was not able prove its correctness because it could not show that unreachable elements were not marked. Note that the axiom needed to prove this property is NoExit, which we have shown to be beyond the power of Nelson’s axiomatization. The loop invariant of mark is given in Fig. 14(a). The first disjunct of the formula holds only in the first iteration, when only the nodes in root are pending and nothing is marked. The second holds from the second iteration on. Here, the nodes in root are marked or pending (they start as pending, and the only way to stop being pending is to become marked). No node is both marked and pending (because the procedure checks if the node is marked before adding it to pending). All nodes that are marked or pending are reachable from the root set (we start with only the root nodes as pending, and after that only nodes that are neighbors of pending nodes became pending; furthermore, only pending nodes may become marked). There are no edges between marked nodes and nodes that are neither marked nor pending (because when we mark a node we add all its neighbors to pending, unless they are marked already). Our method succeeded in proving the loop invariant in Fig. 14(a) using only the positive axioms. The post-condition of mark is given in Fig. 14(b). To prove it, we had to use the fact that there are no edges between marked and unmarked nodes (i.e, there are no pending nodes at the end 24 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH (a) (b) ((∀v . root(v) ↔ pending(v)) ∧ (∀v . ¬ marked(v))) ∨ ((∀v . root(v) → marked(v) ∨ pending(v)) ∧ (∀v . ¬pending(v) ∨ ¬marked(v)) ∧ (∀v . pending(v) ∨ marked(v) → rroot,f (v)) ∧ (∀v1 , v2 . marked(v1 ) ∧ ¬marked(v2 ) ∧ ¬pending(v2 ) → ¬f (v1 , v2 ))) ∀v . marked(v) ↔ rroot,f (v) (5.22) (5.23) (5.24) (5.25) (5.26) (5.27) (5.28) Figure 14: Example specification of mark procedure: (a) The loop invariant of mark, (b) The postcondition of mark. of the loop). Thus, we instantiate the axiom NoExit[marked, f ], and this is enough to prove the post-condition. 6. A PPLICABILITY OF THE C OLORING A XIOMS The coloring axioms are applicable to a wide variety of verification problems. To demonstrate this, we describe the reasoning done by the TVLA system and how it can be simulated using the coloring axioms. TVLA is based on the theory of abstract interpretation [CC79] and specifically on canonical abstraction [SRW02]. TVLA has been successfully used to analyze a large verity of small but intricate heap manipulating programs (see e.g., [LAS00, BLARS07]), including the verification of several algorithms (see e.g., [LARSW00, LRS06]). Furthermore, the axioms described in this paper have been used to integrate S PASS as the reasoning engine behind the TVLA system. The integrated system is used to perform backward analysis on heap manipulating programs as described in [LASR07]. In [SRW02], logical structures are used to represent the concrete stores of the program, and FO(TC) is used to specify the concrete transformers. This provides great flexibility in what programming-language constructs the method can handle. For the purpose of this section, we assume that the vocabulary used is fixed and always contains equality. Furthermore, we assume that the transformer cannot change the universe of the concrete store. Allocation and deallocation can be easily modeled by using a designated unary predicate that holds for the allocated heap cells. Similarly, we assume that the universe of the concrete store is non-empty. Abstract stores are represented as finite 3valued logical structures. We shall explain the meaning of a structure S by describing the formula γ b(S) to which it corresponds. The individuals of a 3-valued logical structure are called abstract nodes. We use an auxiliary unary predicate for each abstract node to capture the concrete nodes that are mapped to it. For an abstract structure with universe {node1 , . . . , noden }, let {a1 , . . . an } be the corresponding unary predicates. For each k-ary predicate p in the vocabulary, each k-tuple hnode1 , . . . , nodek i in the abstract structure (called an abstract tuple) can have one of the following truth values {0, 1, 21 } as follows: SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 25 • The truth value 1 means that the predicate p universally holds for all of the concrete tuples mapped to this abstract tuple, i.e., ∀v1 , . . . , vk . a1 (v1 ) ∧ . . . ∧ ak (vk ) → p(v1 , . . . , vk ) (6.1) • The truth value 0 means that the predicate p universally does not hold, for all of the concrete tuples mapped to this abstract tuple, i.e., ∀v1 , . . . , vk . a1 (v1 ) ∧ . . . ∧ ak (vk ) → ¬p(v1 , . . . , vk ) (6.2) 1 2 • The truth value means that we have no information about this abstract tuple, and thus the value of the predicate p is not restricted. We use a designated set of unary predicates called abstraction predicates to control the distinctions among concrete nodes that can be made in an abstract element, which also places a bound on the size of abstract elements. For each abstract node nodei , Ai denotes the set of abstraction predicates for which nodei has the truth value 1, and Ai denotes the set of abstraction predicates for which nodei has the truth value 0. Every pair nodei , nodej of different abstract nodes either we require that the abstract nodes in the structure represent Ai ∩Aj 6= ∅ or Ai ∩Aj 6= ∅. In addition, W all the concrete nodes, i.e., ∀v . i ai (v). Thus, the abstract nodes form a bounded partition of the concrete nodes. Finally, each node must represent at least one concrete node, i.e., ∃v . ai (v). The vocabulary may contain additional predicates called derived predicates, which are explicitly defined from other predicates using a formula in FO(TC). These derived predicates help the precision of the analysis by recording correlations not captured by the universal information. Some of the unary derived predicates may also be abstraction predicates, and thus can induce finergranularity abstract nodes. We say that S1 ⊑ S2 if there is a total mapping m between the abstract nodes of S1 and the abstract nodes of S2 such that S2 represents all of the concrete stores that S1 represents when considering each abstract node of S2 as a union of the abstract nodes of S1 mapped to it by m. Formally, b γ (S1 ) ∧ ψm → γ b(S2 ) where ^ ψm = ∀v . ai (v) → a′j (v) nodei ∈ S1 m(nodei ) = node′j The order is extended to sets using the induced Hoare order (i.e., XS1 ⊑ XS2 if for each element S1 ∈ XS1 there exists an element S2 ∈ XS2 such that S1 ⊑ S2 ). In the original TVLA implementation [LAS00] the abstract transformer is computed by a three step process: • First, a heuristic is used to perform case splits by refining the partition induced by the abstraction predicates. This process is called Focus. • Second, the formulas comprising the concrete transformer are used to conservatively approximate the effect of the concrete transformer on all the represented memory states. Update formulas are either handwritten or derived using finite differencing [RSL03]. • Third, a constraint solver called Coerce is used to improve the precision of the abstract element by taking advantage of the inter-dependencies between the predicates dictated by the defining formulas of the derived predicates and constraints of the programming language semantics. Most of the logical reasoning performed by TVLA is first order in nature. The transitive-closure reasoning is comprised of three parts: (1) The update formulas for derived predicates based on transitive closure use first-order formulas to update the transitive-closure relation, as explained in Section 6.1. 26 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH (2) The Coerce procedure relates the definition of the edge relation with its transitive closure by performing Kleene evaluation (see below). (3) Handwritten axioms are given to Coerce to allow additional transitive-closure reasoning. They are usually written once and for all per data-structure analyzed by the system. To compare the transitive-closure reasoning of TVLA and the coloring axioms presented in this paper, we concentrate on programs that manipulate singly-linked lists and trees, although the basic argument holds for other data-structures analyzed by TVLA as well. The handwritten axioms used by TVLA for these cases are all covered by the axioms described in Section 3.2. The issue of update formulas is covered in detail in Section 6.1. A detailed description of Kleene evaluation is beyond the scope of this paper and can be found in [SRW02]. Kleene evaluation of transitive closure is equivalent to applying transitivity to infer the existence of paths, and finding a subset of the partition that has no outgoing edges to infer the absence of paths. The latter is equivalent to applying the NoExit axiom on the formula that defines the appropriate partition. 6.1. Precise Update. Maintenance of transitive closure through updates in the underlying relation is required for the verification of heap-manipulating programs. In general, it is not possible to update transitive closure for arbitrary change using first-order-logic formulas. Instead, we limit the discussion to unit changes (i.e., the addition or removal of a single edge). Work in descriptive dynamic complexity [PI97, Hes03] and database theory [DS95] gives first-order update formulas to unit changes in several classes of graphs, including functional graphs and acyclic graphs. We demonstrate the applicability of the proposed axiom schemes by showing how they can be used to prove the precise update formula for unit changes in several classes of graphs. 6.1.1. Edge addition. We refer to the edge relation before the update by e and the edge relation after the update by e′ . Adding an edge from s to t can be formulated as ∀v1 , v2 . e′ (v1 , v2 ) ↔ (e(v1 , v2 ) ∨ (s(v1 ) ∧ t(v2 ))). The precise update formula for this change is ∃vs , vt . s(vs ) ∧ t(vt ) ∧ ∀v1 , v2 . e′tc (v1 , v2 ) ↔ (etc (v1 , v2 ) ∨ (etc (v1 , vs ) ∧ etc (vt , v2 ))) We have used S PASS to prove the validity of this update formula using the color axioms described in this paper. The basic colors needed are rt,e , i.e., forward reachability from the target of − the new edge, and rs,← e , i.e., backward reachability from the source of the new edge. The axioms instantiated in the proof are given in Table 6(a). 6.1.2. Edge removal. There is no known precise formula for updating the transitive closure of a general graph. For general acyclic graphs, Dong and Su [DS95] give a precise update formula that is beyond the scope of this work. For functional graphs, Hesse [Hes03] gives precise update formulas based on either an auxiliary binary relation, or by using a ternary relation to describe paths in the graph that pass through each node. Without these additions, it is not possible to give precise update formulas in the presence of cyclicity. When limiting the discussion to acyclic graphs in which between any two nodes there is at most one path (such as acyclic functional graphs and trees) it is possible to give a simple precise update formula. As before, let s be the source of the edge to be removed and t be the target of the edge. The formula for removing an edge is ∀v1 , v2 . e′ (v1 , v2 ) ↔ (e(v1 , v2 ) ∧ ¬(s(v1 ) ∧ t(v2 ))). SIMULATING REACHABILITY USING FIRST-ORDER LOGIC NewStart[true, e, e′ ] ′ − NewStart[rt,e ∧ ¬rs,← e , e , e] ′ − NewStart[¬rt,e ∧ rs,← e , e , e] ′ NewStart[¬rt,e , e , e] ′ − NewStart[¬rs,← e , e , e] ′ − NoExit[¬rs,← e ,e ] ′ NoExit[rt,e , e ] (a) NewStart[true, e′ , e] NewStart[rt,e , e, e′ ] ′ − NewStart[rs,← e , e, e ] NewStart[¬rt,e , e, e′ ] ′ − NewStart[¬rs,← e , e, e ] ′ − NoExit[rs,← e ,e ] (b) 27 NewStart[true, e′ , e] NewStart[rt,e , e, e′ ] ′ − NewStart[rs,← e , e, e ] NewStart[¬rt,e , e, e′ ] ′ − NewStart[¬rs,← e , e, e ] ′ NoExit[¬rt,e , e ] (c) Table 6: Axioms instantiated for the proof of the precise update formula of: (a) adding an edge to a general graph, (b) removing an edge from an acyclic functional graph, and (c) removing an edge from a tree. The precise update formula for this change is ∃vs , vt . s(vs ) ∧ t(vt ) ∧ ∀v1 , v2 . e′tc (v1 , v2 ) ↔ (etc (v1 , v2 ) ∧ ¬(etc (v1 , vs ) ∧ etc (vt , v2 ))). We have used S PASS to prove the validity of this update formula for the case of acyclic func− tional graphs and the case of trees. As in edge addition, rt,e and rs,← e are used as the basic colors. The axioms instantiated in the proof are given in Table 6(b) and Table 6(c). 7. R ELATED W ORK Shape Analysis. This work was motivated by our experience with TVLA [LAS00, SRW02], which is a generic system for abstract interpretation [CC77]. The TVLA system is more automatic than the methods described in this paper since it does not rely on user-supplied loop invariants. However, the techniques presented in the present paper are potentially more precise due to the use of full first-order reasoning. It can be shown that the NoExit scheme allows us to infer reachability at least as precisely as evaluation rules for 3-valued logic with Kleene semantics. In the future, we hope to develop an efficient non-interactive theorem prover that enjoys the benefits of both approaches. An interesting observation is that the colors needed in our examples to prove the formula are the same unary predicates used by TVLA to define its abstraction. This similarity may, in the future, help us find better ways to automatically instantiate the required axioms. In particular, inductive logic programming has recently been used to learn formulas to use in TVLA abstractions [LRS05], which holds out the possibility of applying similar methods to further automate the approach of the present paper. Decidable Logics. Decidable logics can be employed to define properties of linked data structures: Weak monadic second-order logic has been used in [EMS00, MS01] to define properties of heap-allocated data structures, and to conduct Hoare-style verification using programmer-supplied loop invariants in the PALE system [MS01]. A decidable logic called Lr (for “logic of reachability expressions”) was defined in [BRS99]. Lr is rich enough to express the shape descriptors studied in [SRW98] and the path matrices introduced in [Hen90]. More recent decidable logics include Logic of Reachable Patterns [YRS+ 06] and a decision procedure for linked data structures that can handle singly linked lists [BR06]. The present paper does not develop decision procedures, but instead suggests methods that can be used in conjunction with existing theorem provers. Thus, the techniques are incomplete and the theorem provers need not terminate. However, our initial experience is that the extra flexibility gained by the use of first-order logic with transitive closure is promising. For example, we can prove 28 T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH the correctness of imperative destructive list-reversal specified in a natural way and the correctness of mark and sweep garbage collectors, which are beyond the scope of Mona and Lr . Indeed, in [IRR+ 04b], we have tried to simulate existing data structures using decidable logics and realized that this can be tricky because the programmer may need to prove a specific simulation invariant for a given program. Giving an inaccurate simulation invariant causes the simulation to be unsound. One of the advantages of the technique described in the present paper is that soundness is guaranteed no matter which axioms are instantiated. Moreover, the simulation requirements are not necessarily expressible in the decidable logic. Other First-Order Axiomatizations of Linked Data Structures. The closest approach to ours that we are aware of was taken by Nelson as we describe in Section 4. This also has some follow-up work by Leino and Joshi [Lei98]. Our impression from their write-up is that Leino and Joshi’s work can be pushed forward by using our coloring axioms. A more recent work by Lahiri and Qadeer [LQ06] uses first-order axiomatization. This work can be seen as a specialization of ours to the case of (cyclic) singly linked lists. Dynamic Maintenance of Transitive Closure. Another orthogonal but promising approach to transitive closure is to maintain reachability relations incrementally as we make unit changes in the data structure. It is known that in many cases, reachability can be maintained by first-order formulas [DS95, PI97] and even sometimes by quantifier-free formulas [Hes03]. Furthermore, in these cases, it is often possible to automatically derive the first-order update formulas using finite differencing [RSL03]. 8. C ONCLUSION This paper reports on our proposal of a new methodology for using off-the-shelf first-order theorem provers to reason about reachability in programs. We have explored many of the theoretical issues as well as presenting examples that, while still preliminary, suggest that this is indeed a viable approach. As mentioned earlier, proving the absence of paths is the difficult part of proving formulas with TC. The promise of our approach is that it is able to handle such formulas effectively and reasonably automatically, as shown by the fact that it can successfully handle the programs described in Section 5 and the success of the TVLA system, which uses similar transitive-closure reasoning. Of course, much further work is needed including the following: • Exploring other heuristics for identifying color classes. • Exploring variations of the algorithm given in Fig. 10 for instantiating coloring axioms. • Exploring the use of additional axiom schemes, such as two of the schemes from [Nel83], which are likely to be useful when dealing with predicates that are partial functions. Such predicates arise in programs that manipulate singly-linked or doubly-linked lists—or, more generally, data structures that are acyclic in one or more “dimensions” [HHN92] (i.e., in which the iterated application of a given field selector can never return to a previously visited node). • Additional work should be done on the theoretical power of T1 +IND and related axiomatizations of transitive closure. We conjecture, for example, that T1 + IND is TC-complete for trees. Acknowledgements. Thanks to Aharon Abadi and Roman Manevich for interesting suggestions. Thanks to Viktor Kuncak for useful conversations including his observation and proof of Proposition 4.4. SIMULATING REACHABILITY USING FIRST-ORDER LOGIC 29 R EFERENCES [Avr03] A. Avron. Transitive closure and the mechanization of mathematics. In Thirty Five Years of Automating Mathematics, pages 149–171. Kluwer Academic Publishers, 2003. [BLARS07] I. Bogudlov, T. Lev-Ami, T. Reps, and M. Sagiv. Revamping tvla: Making parametric shape analysis competitive. In CAV, 2007. [BR06] J. Bingham and Z. Rakamaric. A logic and decision procedure for predicate abstraction of heapmanipulating programs. In VMCAI, pages 207–221, 2006. [BRS99] M. Benedikt, T. Reps, and M. Sagiv. A decidable logic for describing linked data structures. In European Symp. On Programming, pages 2–19, March 1999. [CC77] Patrick Cousot and Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In POPL ’77: Proceedings of the 4th ACM SIGACTSIGPLAN symposium on Principles of programming languages, pages 238–252. ACM Press, 1977. [CC79] P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Symp. on Princ. of Prog. Lang., pages 269–282, New York, NY, 1979. ACM Press. [DS95] G. Dong and J. Su. Incremental and decremental evaluation of transitive closure by first-order queries. Inf. & Comput., 120:101–106, 1995. [EMS00] J. Elgaard, A. Møller, and M.I. Schwartzbach. Compile-time debugging of C programs working on trees. In European Symp. On Programming, pages 119–134, 2000. [FLL+ 02] C. Flanagan, K.R.M. Leino, M. Lillibridge, G. Nelson, J.B. Saxe, and R. Stata. Extended static checking for java. In SIGPLAN Conf. on Prog. Lang. Design and Impl., 2002. [GME99] E. Grädel, M.Otto, and E.Rosen. Undecidability results on two-variable logics. Archive of Math. Logic, 38:313–354, 1999. [Hen90] L. Hendren. Parallelizing Programs with Recursive Data Structures. PhD thesis, Cornell Univ., Ithaca, NY, Jan 1990. [Hes03] W. Hesse. Dynamic Computational Complexity. PhD thesis, Department of Computer Science, UMass, Amherst, July 2003. [HHN92] L. Hendren, J. Hummel, and A. Nicolau. Abstractions for recursive pointer data structures: Improving the analysis and the transformation of imperative programs. In SIGPLAN Conf. on Prog. Lang. Design and Impl., pages 249–260, New York, NY, June 1992. ACM Press. [Hoa75] C.A.R. Hoare. Recursive data structures. Int. J. of Comp. and Inf. Sci., 4(2):105–132, 1975. [IRR+ 04a] N. Immerman, A. Rabinovich, T. Reps, M. Sagiv, and G. Yorsh. The boundary between decidability and undecidability of transitive closure logics. In CSL’04, 2004. [IRR+ 04b] N. Immerman, A. Rabinovich, T. Reps, M. Sagiv, and G. Yorsh. Verification via structure simulation. In Proc. Computer-Aided Verif., pages 281–294, 2004. [LARSW00] T. Lev-Ami, T. Reps, M. Sagiv, and R. Wilhelm. Putting static analysis to work for verification: A case study. In ISSTA 2000: Proc. of the Int. Symp. on Software Testing and Analysis, pages 26–38, 2000. [LAS00] T. Lev-Ami and M. Sagiv. TVLA: A system for implementing static analyses. In Static Analysis Symp., pages 280–301, 2000. [LASR07] T. Lev-Ami, M. Sagiv, and T. Reps. Backward analysis for inferring quantified preconditions. Submitted for publication, 2007. [Lei98] R. Leino. Recursive object types in a logic of object-oriented programs. Nordic J. of Computing, 5:330–360, 1998. [LQ06] S. K. Lahiri and S. Qadeer. Verifying properties of well-founded linked lists. In POPL, pages 115–126, 2006. [LRS05] A. Loginov, T. Reps, and M. Sagiv. Abstraction refinement via inductive learning. In Proc. Computer-Aided Verif., 2005. [LRS06] A. Loginov, T. Reps, and M. Sagiv. Automatic verification of the Deutsch-Schorr-Waite tree-traversal algorithm. In SAS, 2006. [MP71] R. McNaughton and S. Papert. Counter-Free Automata. MIT Press, 1971. [MS01] A. Møller and M.I. Schwartzbach. The pointer assertion logic engine. In SIGPLAN Conf. on Prog. Lang. Design and Impl., pages 221–231, 2001. [Nel83] G. Nelson. Verifying reachability invariants of linked structures. In Symp. on Princ. of Prog. Lang., pages 38–47, 1983. [PI97] S. Patnaik and N. Immerman. Dyn-FO: A parallel, dynamic complexity class. Journal of Computer and System Sciences, 55(2):199–209, October 1997. 30 [RSL03] [RSW04] [SRW98] [SRW02] [WGR96] [YRS+ 06] T. LEV-AMI, N. IMMERMAN, T. REPS, M. SAGIV, S. SRIVASTAVA, AND G. YORSH T. Reps, M. Sagiv, and A. Loginov. Finite differencing of logical formulas for static analysis. In European Symp. On Programming, pages 380–398, 2003. T. Reps, M. Sagiv, and R. Wilhelm. Static program analysis via 3-valued logic. In CAV, pages 15–30, 2004. M. Sagiv, T. Reps, and R. Wilhelm. Solving shape-analysis problems in languages with destructive updating. Trans. on Prog. Lang. and Syst., 20(1):1–50, January 1998. M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. Trans. on Prog. Lang. and Syst., 2002. Christoph Weidenbach, Bernd Gaede, and Georg Rock. Spass & flotter version 0.42. In CADE-13: Proceedings of the 13th International Conference on Automated Deduction, pages 141–145. Springer-Verlag, 1996. G. Yorsh, A. Rabinovich, M. Sagiv, A. Meyer, and A. Bouajjani. A logic of reachable patterns in linked data-structures. In FOSSACS, 2006. 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
1 3D Object Dense Reconstruction from a Single Depth View arXiv:1802.00411v1 [cs.CV] 1 Feb 2018 Bo Yang, Stefano Rosa, Andrew Markham, Niki Trigoni, Hongkai Wen* Abstract—In this paper, we propose a novel approach, 3D-RecGAN++, which reconstructs the complete 3D structure of a given object from a single arbitrary depth view using generative adversarial networks. Unlike existing work which typically requires multiple views of the same object or class labels to recover the full 3D geometry, the proposed 3D-RecGAN++ only takes the voxel grid representation of a depth view of the object as input, and is able to generate the complete 3D occupancy grid with a high resolution of 2563 by recovering the occluded/missing regions. The key idea is to combine the generative capabilities of autoencoders and the conditional Generative Adversarial Networks (GAN) framework, to infer accurate and fine-grained 3D structures of objects in high-dimensional voxel space. Extensive experiments on large synthetic datasets and real-world Kinect datasets show that the proposed 3D-RecGAN++ significantly outperforms the state of the art in single view 3D object reconstruction, and is able to reconstruct unseen types of objects. Index Terms—3D Reconstruction, Shape Completion, Shape inpainting, Single Depth View, Adversarial Learning, Conditional GAN. F 1 I NTRODUCTION T O reconstruct the complete and precise 3D geometry of an object is essential for many graphics and robotics applications, from AR/VR [1] and semantic understanding, to robot grasping [2] and obstacle avoidance. Classic approaches use the off-the-shelf low-cost depth sensing devices such as Kinect and RealSense cameras to recover the 3D shape of an object from captured depth images. Those approaches typically require multiple depth images from different viewing angles of an object to estimate the complete 3D structure [3] [4] [5]. However, in practice it is not always feasible to scan all surfaces of an object before reconstruction, which leads to incomplete 3D shapes with occluded regions and large holes. In addition, acquiring and processing multiple depth views require more computing power, which is not ideal in many applications that require real-time performance. In this paper, we aim to tackle the problem of estimating the complete 3D structure of an object using a single depth view. This is a very challenging task, since the partial observation of the object (i.e. a depth image from one viewing angle) can be theoretically associated with an infinite number of possible 3D models. Traditional reconstruction approaches typically use interpolation techniques such as plane fitting, Laplacian hole filling [6] [7], or Poisson surface estimation [8] [9] to infer the underlying 3D structure. However, they can only recover very limited occluded or missing regions, e.g. small holes or gaps due to quantization artifacts, sensor noise and insufficient geometry information. Interestingly, humans are surprisingly good at solving such ambiguity by implicitly leveraging prior knowledge. • • Bo Yang, Stefano Rosa, Andrew Markham and Niki Trigoni are with the Department of Computer Science, University of Oxford, UK. E-mail:{bo.yang,stefano.rosa,andrew.markham,niki.trigoni}@cs.ox.ac.uk Corresponding to Hongkai Wen, who is with the Department of Computer Science, University of Warwick, UK. E-mail: [email protected] For example, given a view of a chair with two rear legs occluded by front legs, humans are easily able to guess the most likely shape behind the visible parts. Recent advances in deep neural networks and data driven approaches show promising results in dealing with such a task. In this paper, we aim to acquire the complete and highresolution 3D shape of an object given a single depth view. By utilizing the high performance of 3D convolutional neural nets and large open datasets of 3D models, our approach learns a smooth function to map a 2.5D view to a complete and dense 3D shape. In particular, we train an end-to-end model which estimates full volumetric occupancy from a single 2.5D depth view of an object. While state-of-the-art deep learning approaches [10] [11] [2] for 3D shape reconstruction from a single depth view achieve encouraging results, they are limited to very small resolutions, typically at the scale of 323 voxel grids. As a result, the learnt 3D structure tends to be coarse and inaccurate. However, to increase the 3D shape resolution without sacrificing recovery accuracy is challenging, as even a slightly higher resolution would exponentially increase the search space of potential 2.5D to 3D mapping functions, resulting in difficulties in convergence of neural nets. Recently, deep generative models achieve impressive success in modeling complex high-dimensional data distributions, among which Generative Adversarial Networks (GANs) [12] and Variational Autoencoders (VAEs) [13] emerge as two powerful frameworks for generative learning, including image and text generation [14] [15], and latent space learning [16] [17]. In the past few years, a number of works [18] [19] [20] [21] applied such generative models to learn latent space to represent 3D object shapes, in order to solve simple discriminative tasks such as new image generation, object classification, recognition and shape retrieval. In this paper, we propose 3D-RecGAN++, a novel model that combines a skip-connected 3D autoencoder with adversarial learning to generate a complete and fine-grained 3D 2 structure conditioned on a single 2.5D view. Particularly, our model firstly encodes the 2.5D view to a low-dimensional latent space vector which implicitly represents general 3D geometric structures, then decodes it back to recover the most likely full 3D shape. The rough 3D shape is then fed into a conditional discriminator which is adversarially trained to distinguish whether the coarse 3D structure is plausible or not. The autoencoder is able to approximate the corresponding shape, while the adversarial training tends to add fine details to the estimated shape. To ensure the final generated 3D shape corresponds to the input single partial 2.5D view, adversarial training of our model is based on a conditional GAN [22] instead of random guessing. The above novel and efficient network design excels the competing approaches [2] [11] [23], which either use a single fully connected layer [2], a low capacity decoder [11], or the multi-stage and inefficient LSTMs [23] to estimate the full 3D shapes. Our contributions are as follows: (1) We propose a novel generative model to reconstruct the complete and accurate 3D structure using a single arbitrary depth view. Particularly, our model takes a simple occupancy grid map as input without requiring object class labels or any annotations, while predicting a compelling shape within a high resolution of 2563 voxel grid. By drawing on both autoencoder and GAN, our approach is end-to-end trainable with high level of generality. To the best of our knowledge, this is the first work that reconstructs such high resolution of 3D shapes using a single view. (2) We exploit conditional GAN during training to refine the 3D shape estimated by the autoencoder. Our contribution here is that we use the mean value of a latent vector feature, instead of a single scalar, as the output of the discriminator to stabilize GAN training. (3) We conduct extensive experiments for single category and multi-category object reconstruction, outperforming the state of the art. Importantly, our approach is also able to generalize to previously unseen object categories. At last, our model also performances robustly on real-world dataset collected by Kinect, after being trained purely on synthetic datasets. (4) To the best of our knowledge, there are no good open datasets which have the ground truth for occluded/missing parts and holes for each 2.5D view in real world scenarios. We therefore contribute our real world testing dataset to the community. A preliminary version of this work has been published in ICCV 2017 workshops [24]. Our code and data are available at: https://github.com/Yang7879/3D-RecGAN-extended 2 R ELATED W ORK We review different pipelines for 3D reconstruction or shape completion. Both conventional geometry based techniques and the state of the art deep learning based approaches are covered. (1) 3D Model/Shape Completion. [25] uses plane fitting to complete small missing regions, while [26] [27] [28] [29] [30] apply shape symmetry to fill in holes. Although these methods show good results, relying on predefined geometric regularities fundamentally limits the structure space to hand-crafted shapes. Besides, these approaches are likely to fail when missing or occluded regions are relatively big. Another similar fitting pipeline is to leverage database priors. Given a partial shape input, [31] [32] [33] [34] [35] [36] try to retrieve an identical or most likely 3D model and align it with the partial scan. However, these approaches explicitly assume the database contains identical or very similar shapes, thus being unable to generalize to novel objects or categories. (2) Multiple RGB/Depth Images Reconstruction. Traditionally, 3D dense reconstruction requires a collection of RGB images [37]. Geometric shape is recovered by dense feature extraction and matching [38], or by directly minimizing reprojection errors [39] from color images. Recently, [40] [41] [42] [43] [44] [45] leverage deep neural nets to learn the 3D shape from multiple RGB images. However, resolution of the recovered occupancy shape is usually up to a small scale of 323 . With the advancement of depth sensors, depth images are also used to recover the object shape. Classic approaches usually fuse multiple depth images through iterative closest point (ICP) algorithms [3] [46] [47], while recent work [48] learns the 3D shape using deep neural nets from multiple depth views. (3) Single RGB Image Reconstruction. Predicting a complete 3D object model from a single view is a longstanding and extremely challenging task. When reconstructing a specific object category, model templates can be used. For example, morphable 3D models are exploited for face recovery [49] [50]. This concept was extended to reconstruct simple objects in [51]. For general and complex object reconstruction from a single RGB image, recent works [52] [53] [54] aim to infer 3D shapes using multiple RGB images for weak supervision. However, the training procedure of [54] is two stage rather than end-to-end, while [53] uses a simple autoencoder instead of designing sophisticated learning frameworks for shape learning, and [52] still requires 3D shape priors for constraints. Shape prior knowedge is also required in [55] [56] [57]. To recover high resolution 3D shapes, [58] [59] use Octree representation, while [60] proposed an inverse discrete cosine transform (IDCT) technique. Lin et al. [61] designed a pseudo-renderer to predict dense 3D shapes, while [62] sequentially estimates 2.5D sketches and dense 3D shapes from a single RGB image. (4) Single Depth View Reconstruction. The task of reconstruction from a single depth view is to complete the occluded 3D structures behind the visible parts. 3D ShapeNets [10] is among the early work using deep neural nets to estimate 3D shapes from a single depth view. Firman et al. [63] trained a random decision forest to infer unknown voxels. Originally designed for shape denoising, VConvDAE [1] can also be used for shape completion. To facilitate robotic grasping, Varley et al. proposed a neural network to infer the full 3D shape from a single depth view in [2]. However, all these approaches are only able to generate low resolution voxel grids which are less than 403 and unlikely to capture fine geometric details. Recent works [11] [64] [23] [65] can infer higher resolution 3D shapes. However, 3DEPN [11] relies on a shape database to synthesize higher resolution shapes after learning a small 323 voxel grid from a depth view, while SSCNet [64] requires strong voxel-level annotations for supervised scene completion and semantic 3 true full 3D shape concat up-sampling y concat U-net loss real reconstruction decoder x encoder fake reconstruction input 2.5D view conditional discriminator Fig. 2: Overview of the network architecture for training. Fig. 1: t-SNE embeddings of 2.5D partial views and 3D complete shapes of multiple object categories. label prediction. Both [23] and [65] are originally designed for shape inpainting instead of directly reconstructing the complete 3D structure from a partial depth view. The recent 3D-PRNN [66] predicts simple shape primitives using RNNs, but the estimated shapes do not have finer geometric details. (5) Deep Generative Frameworks. Deep generative frameworks, such as VAEs [13] and GANs [12], have achieved impressive success in image super-resolution [67], image generation [15], text to image synthesis [68], etc. Recently, [69] [70] [71] [21] applied generative networks for 3D structure generation. However, most of them generate 3D shapes from random noise instead of reconstructing structures from a specific single image. 3 3.1 3D-R EC GAN++ Overview Our method aims to estimate a complete and dense 3D structure of an object, which only takes an arbitrary single 2.5D depth view as input. The output 3D shape is automatically aligned with the corresponding 2.5D partial view. To achieve this task, each object model is represented in a high resolution 3D voxel grid. We use the simple occupancy grid for shape encoding, where 1 represents an occupied cell and 0 an empty cell. Specifically, the input 2.5D partial view, denoted as x, is a 643 occupancy grid, while the output 3D shape, denoted as y , is a high resolution 2563 probabilistic voxel grid. The input partial shape is directly calculated from a single depth image given camera parameters. We use the ground truth dense 3D shape with aligned orientation as same as the input partial 2.5D depth view to supervise our network. To generate ground truth training and evaluation pairs, we virtually scan 3D objects from ShapeNet [72]. Figure 1 is the t-SNE visualization [73] of partial 2.5D views and the corresponding full 3D shapes for multiple general chair and bed models. Each green dot represents the t-SNE embedding of a 2.5D view, whilst a red dot is the embedding of the corresponding 3D shape. It can be seen that multiple categories inherently have similar 2.5D to 3D mapping relationships. Essentially, our neural network is to learn a smooth function, denoted as f , which maps green dots to red dots as close as possible in high dimensional space as shown in Equation 1. The function f is parametrized by convolutional layers in general.   3 y = f (x) x ∈ Z 64 , where Z = {0, 1} (1) input 2.5D view x encoder decoder up-sampling y U-net Fig. 3: Overview of the network architecture for testing. After generating training pairs, we feed them into our network. The first part of our network loosely follows the idea of an autoencoder with the U-net architecture [74]. The skip-connected autoencoder serves as an initial coarse generator which is followed by an up-sampling module to further generate a high resolution 3D shape within a 2563 voxel grid. This whole generator aims to learn a correlation between partial and complete 3D structures. With the supervision of complete 3D labels, the generator is able to learn a function f and infer a reasonable 3D shape given a brand new partial 2.5D view. In the testing phase, however, the results tend to be grainy and without fine details. To address this issue, in the training phase, the reconstructed 3D shape from the generator is further fed into a conditional discriminator to verify its plausibility. In particular, a partial 2.5D input view is paired with its corresponding complete 3D shape, which is called the ‘real reconstruction’, while the partial 2.5D view is paired with its corresponding output 3D shape from generator, which is called the ‘fake reconstruction’. The discriminator aims to discriminate all ‘fake reconstruction’ from ‘real reconstruction’. In the original GAN framework [12], the task of the discriminator is to simply classify real and fake input, but its Jensen-Shannon divergence-based loss function is difficult to converge. The recent WGAN [75] leverages Wasserstein distance with weight clipping as a loss function to stabilize the training procedure, whilst the extended work WGAN-GP [76] further improves the training process using a gradient penalty with respect to its input. In our 3DRecGAN++, we apply WGAN-GP as the loss function of our conditional discriminator, which guarantees fast and stable convergence. The overall network architecture for training is shown in Figure 2, while the testing phase only needs the well trained generator as shown in Figure 3. Overall, the main challenge of 3D reconstruction from an arbitrary single view is to generate new information including filling the missing and occluded regions from unseen views, while keeping the estimated 3D shape corresponding to the specific input 2.5D view. In the training phase, our 3D-RecGAN++ firstly leverages a skip-connected autoencoder together with an up-sampling module to generate a reasonable ‘fake reconstruction’ within a high resolution occupancy grid, then applies adversarial learning to refine the ‘fake reconstruction’ to make it as similar to ‘real reconstruction’ by jointly updating parameters of the generator. 4 In the testing phase, given a novel 2.5D view as input, the jointly trained generator is able recover a full 3D shape with satisfactory accuracy, while the discriminator is no longer used. 3.2 Architecture Figure 4 shows the detailed architecture of our proposed 3DRecGAN++. It consists of two main networks: the generator as in Figure 4a and the discriminator as in Figure 4b. The generator consists of a skip-connected autoencoder and an up-sampling module. Unlike the vanilla GAN generator which generates data from arbitrary latent distributions, our 3D-RecGAN++ generator synthesizes data from latent distributions of 2.5D views. Particularly, the encoder has five 3D convolutional layers, each of which has a bank of 4x4x4 filters with strides of 1x1x1, followed by a leaky ReLU activation function and a max pooling layer with 2x2x2 filters and strides of 2x2x2. The number of output channels of max pooling layer starts with 64, doubling at each subsequent layer and ends up with 512. The encoder is lastly followed by two fully-connected layers to embed semantic information into a latent space. The decoder is composed of 5 symmetric up-convolutional layers which are followed by ReLU activations. Skip-connections between encoder and decoder guarantee propagation of local structures of the input 2.5D view. The skip-connected autoencoder is followed by the up-sampling module which simply consists of two layers of up-convolutional layers as detailed in Figure 4a. This simple yet efficient up-sampling module directly upgrades the output 3D shape to a high resolution of 2563 without requiring complex network design and operations. It should be noted that without the two fully connected layers and skip-connections, the vanilla autoencoder would be unable to learn reasonable complete 3D structures as the latent space is limited and the local structure is not preserved. Without the efficient up-sampling module, it is unable to finally generate high resolution 3D shapes. Although a more complicated and dedicated network design could also output 2563 shapes, it would be unlikely to be effectively trained on a single GPU because of the extremely high computation consumption for high resolution 3D shape generation. The loss function and optimization methods are described in Section 3.3. The discriminator aims to distinguish whether the estimated 3D shapes are plausible or not. Based on the conditional GAN, the discriminator takes both real reconstruction pairs and fake reconstruction pairs as input. Particularly, it consists of six 3D convolutional layers, the first of which concatenates the generated 3D shape (i.e. a 2563 voxel grid) and the input 2.5D partial view (i.e. a 643 voxel grid) which is reshaped as a 256x256x4 tensor. The reshaping process is done straightforwardly using Tensorflow ‘tf.reshape()’. Basically, this is to inject the condition information with a matched tensor dimension, and then leave the network itself to learn useful features from this condition input. Each convolutional layer has a bank of 4x4x4 filters with strides of 2x2x2, followed by a ReLU activation function except for the last layer which is followed by a sigmoid activation function. The number of output channels of the convolutional layers starts with 8, doubling at each subsequent layer and ends up with 256. At the early stage of GAN training, the high dimensional real and fake distributions may not overlap, then the discriminator can separate them perfectly using a single scalar output, which is theoretically analyzed in [77]. In our experiments, the original WGAN-GP always crashes in the early 3 epochs due to the extremely high dimensionality (i.e. 2563 + 643 dimensions). To stabilize it, we propose to use mean feature (i.e. mean of a vector feature) for discriminator. As the mean vector feature captures more information from the input overall, it is more difficult for the discriminator to easily distinguish whether the mean feature is from fake or real input. This enables useful information to backpropagate to the generator. A theoretical study of the mean feature matching method for GAN is in [78]; mean feature matching is also applied in [79] to stabilize GAN. Therefore, our discriminator is to distinguish the distributions of mean feature of fake and real reconstructions, while the generator is trained to make the two distributions of mean feature as similar as possible. We apply WGAN-GP as loss functions for our modified mean feature matching. 3.3 Objectives The objective function of our 3D-RecGAN++ includes two main parts: an object reconstruction loss `ae for the generator; the objective function `gan for the conditional GAN. (1) `ae For the generator, inspired by [80], we use modified binary cross-entropy loss function instead of the standard version. The standard binary cross-entropy weights both false positive and false negative results equally. However, most of the voxel grid tends to be empty, so the network easily gets a false positive estimation. In this regard, we impose a higher penalty on false positive results than on false negatives. Particularly, a weight hyper-parameter α is assigned to false positives, with (1-α) for false negative results, as shown in Equation 2. `ae  N  1 X = −αy¯i log(yi )−(1−α)(1− y¯i ) log(1−yi ) (2) N i=1 where y¯i is the target value {0,1} of a specific ith voxel in the ground truth voxel grid ȳ , and yi is the corresponding estimated value (0,1) in the same voxel from the autoencoder output y . We calculate the mean loss over the total N voxels in the whole voxel grid. (2) `gan For the discriminator, we leverage the state of the art WGAN-GP loss functions. Unlike the original GAN loss function which presents an overall loss for both real and fake inputs, we separately represent the loss function `ggan in Equation 3 for generating fake reconstruction pairs and `dgan in Equation 4 for discriminating fake and real reconstruction pairs. Detailed definitions and derivation of the loss functions can be found in [75] [76], but we modify them for our conditional GAN settings.   `ggan = −E D(y|x) (3)     `dgan = E D(y|x) − E D(ȳ|x)  2  +λE ∇ŷ D(ŷ|x) 2 − 1 (4) 43 conv lrelu 2 maxpool 43 conv lrelu 23 maxpool 3 x 43 conv lrelu 2 maxpool 3 x 643 43 conv lrelu 3 323 2 maxpool16 3 43 conv 43 conv 3 lrelu 83 lrelu 4 3 512 channels 2 maxpool 256 channels 23 maxpool 128 channels 43 deconv relu 43 deconv relu 43 deconv 43 deconv 3 43 deconv relu 4 3 16 512 channels relu 32 dense 256 channels relu relu 128 channels 32768 64 channels reshape 43 deconv relu 43 deconv relu 3 flatten 64 channels 1 channel 43 conv 43 conv lrelu lrelu 3 2 maxpool 23 maxpool dense dense relu relu 2000 dense 32768 flatten relu 4 deconv relu reshape 43 3 43 deconv relu 3 deconv8 relu y 643 16 channels concat 323 643 64 channels 1 channel 163 128 channels 43 43 concat 2000 83 83 163 512 channels 256 channels 256 channels 512 channels concat 128 channels 32768 32768 323 64 channels concat concat concat concat 43 deconv relu 5 43 deconv relu 1283 y 2563 8 channels 1 channel up-sampling module 643 16 channels 1283 2563 8 channels 1 channel up-sampling module concat concat concat (a) Generator for 3D shape estimation from a single depth view. y 2563 1 channel x reshape 2563 1 channel x 643 1 channel 256x256x4 reshape 43 conv lrelu y fake reconstruction real fake reconstruction reconstruction 43 conv lrelu 256x256x260 643 real reconstruction 256x256x4 1 channel 3 4 conv lrelu 128x128x130 8 channels 43 conv lrelu 43 conv lrelu 43 conv lrelu 43 conv lrelu flatten loss 4x4x5 8x8x943 conv 43 conv 16x16x17 43 conv 43 conv 32x32x33 lrelu 64 channels 128 channels 256 channels lrelu lrelu lrelu 32 channels flatten 20480 16 channels loss 64x64x65 1 channel 1 channel ground truth 1 channel 43 conv lrelu 256x256x260 128x128x130 8 channels 64x64x65 16 channels 32x32x33 32 channels 16x16x17 8x8x9 64 channels 4x4x5 128 channels 256 channels 20480 1 channel 3 256 1 channel ground truth (b) Discriminator for 3D shape refinement. 3 256of 3D-RecGAN++, showing the two main building blocks. Note that, although these are shown Fig. 4: Detailed architecture 1 channel as two separate modules, they are trained end-to-end. where ŷ = ȳ + (1 − )y,  ∼ U [0, 1], x is the input partial depth view, y is the corresponding output of autoencoder, ȳ is the corresponding ground truth. λ controls the trade-off between optimizing the gradient penalty and the original objective in WGAN. For the generator in our 3D-RecGAN++ network, there are two loss functions, `ae and `ggan , to optimize. As we discussed in Section 3.1, minimizing `ae tends to learn the overall 3D shapes, whilst minimizing `ggan estimates more plausible 3D structures conditioned on input 2.5D views. To minimize `dgan is to improve the performance of discriminator to distinguish fake and real reconstruction pairs. To jointly optimize the generator, we assign weights β to `ae and (1 − β) to `ggan . Overall, the loss functions for generator and discriminator are as follows: 3.4 `g = β`ae + (1 − β)`ggan (5) `d = `dgan (6) Training We adopt an end-to-end training procedure for the whole network. To simultaneously optimize both generator and discriminator, we alternate between one gradient decent step on discriminator and then one step on generator. For the WGAN-GP, λ is set as 10 for gradient penalty as in [76]. α ends up as 0.85 for our modified cross entropy loss function, while β is 0.2 for the joint loss function `g . The Adam solver [81] is used for both discriminator and generator with a batch size of 4. The other three Adam parameters are set to default values. Learning rate is set to 0.0001 for the discriminator and 0.0005 for the generator in all epochs. As we do not use dropout or batch normalization, the testing phase is exactly the same as the training stage. The whole network is trained on a single Titan X GPU from scratch. 3.5 Data Synthesis For the task of 3D dense reconstruction from a single depth view, obtaining a large amount of training data is an obstacle. Existing real RGB-D datasets for surface reconstruction suffer from occlusions and missing data and there is no ground truth of complete and high resolution 2563 3D shapes for each single view. The recent work 3D-EPN [11] synthesizes data for 3D object completion, but their map encoding scheme is the complicated TSDF which is different from our network requirement. To tackle this issue, we use the ShapeNet [72] database to generate a large amount of training and testing data with synthetically rendered depth images and the corresponding complete 3D shape ground truth. Particularly, a subset of object categories is selected for our experiments. For each category, we generate training data from around 220 CAD models, while synthesizing testing data from around 40 CAD models. For each CAD model, we create a virtual depth camera to scan it from 125 different angles, 5 uniformly sampled views for each of roll, pitch and yaw space. For each virtual scan, both a depth image and the corresponding complete 3D voxelized structure are generated with regard to the same camera angle. That depth image is simultaneously transformed to a partial 2.5D voxel grid using virtual camera parameters. Then a pair of partial 2.5D view and the complete 3D shape is synthesized. Overall, 6 around 20K training pairs and 4K testing pairs are generated for each 3D object category. All data are produced in Blender. Besides the large quantity of synthesized data, we also collect real world data in order to test the proposed network. We use a Microsoft Kinect camera to manually scan a set of common objects, such as chairs, tables, etc., from multiple angles. Then, we use ElasticFusion [47] to reconstruct the full 3D shapes of the objects, as well as the camera pose in each scan. The 3D objects are manually segmented from the background. We then extract ground truth information by aligning the full 3D objects with the partial 2.5D views. It should be noted that, due to noise and quantization artifacts of low-cost RGB-D sensors, and the inaccuracy of the algorithm, the full 3D ground truth is not 100% accurate. 4 E VALUATION In this section, we evaluate our 3D-RecGAN++ with comparison to the state of the art approaches and an ablation study to fully investigate the proposed network. 4.1 Metrics To evaluate the performance of 3D reconstruction, we consider the mean Intersection-over-Union (IoU) between predicted 3D voxel grids and their ground truth. The IoU for an individual voxel grid is formally defined as follows:  PN  I(yi > p) ∗ I(y¯i ) h IoU = P i=1 i N i=1 I I(yi > p) + I(y¯i ) where I(·) is an indicator function, yi is the predicted value at the ith voxel, y¯i is the corresponding ground truth, p is the threshold for voxelization, N is the total number of voxels in a whole voxel grid. In all our experiments, p is set as 0.5. If the predicted value is over 0.5, it is more likely to be occupied from the probabilistic aspect. The higher the IoU value, the better the reconstruction of a 3D model. 4.2 Competing Approaches We compare against three state of the art deep learning based approaches for single depth view reconstruction. We also compare against the generator alone in our network, i.e. without the GAN, named as 3D-RecAE for short. (1) 3D-EPN. In [11], Dai et al. proposed a neural network to reconstruct the 3D shape up to a 323 voxel grid, after which a high resolution shape is retrieved from an existing 3D shape database. For fair comparison, we only compared with their neural network performance. Besides, occupancy grid representation is used for the network training the testing. (2) Varley et al. In [2], a network was designed to complete the 3D shape from a single 2.5D depth view for robot grasping. The output of their network is a 403 voxel grid. (3) Han et al. In [23], a global structure inference network and a local geometry refinement network are proposed to complete a high resolution shape from a noisy shape. The network is not originally designed for single depth view reconstruction, but its output shape is up to a 2563 voxel grid and is comparable to our network. For fair comparison, the same occupancy grid representation is used for their network. It should be noted that their network involves many convoluted designs, yet the training procedure is extremely slow and inefficient due to many LSTMs involved. (4) 3D-RecAE. As for our 3D-RecGAN++, we remove the discriminator and only keep the generator to infer 3D complete shape from a single depth view. This comparison illustrates the benefits from adversarial learning. 4.3 Single-category Results (1) Results. All networks are separately trained and tested on four different categories with the same network configurations. To fairly compare the IoU between different approaches, we down sample all results of 2563 voxel grids to 323 using max pooling with a stride of 8 along the three axes. Table 1 shows the IoU comparison of all methods on 323 voxel grids, while Table 2 shows the IoU comparison of [23] and our approaches on higher resolution of voxel grids. Figure 5 shows the qualitative results of single category reconstruction. In this paper, the meshgrid function in Matlab is used to plot all 3D shapes for better visualization. (2) Analysis. The proposed 3D-RecGAN++ significantly outperforms the competing approaches in terms of the IoU at both lower (323 voxel grids) and higher resolutions (2563 voxel grids). The 3D shapes generated by our 3DRecGAN++ are much more visually compelling than others in terms of the shape accuracy and the geometrical details. TABLE 1: Per-category IoU (323 voxel grids). 3D-EPN [11] Varley et al. [2] Han et al. [23] 3D-RecAE (ours) 3D-RecGAN++ (ours) bench 0.758 0.653 0.611 0.800 0.806 chair 0.739 0.619 0.524 0.790 0.793 coach 0.834 0.818 0.505 0.858 0.868 table 0.772 0.678 0.615 0.808 0.821 TABLE 2: Per-category IoU (up to 2563 voxel grids). Han et al. [23] (643 ) Han et al. [23] (1283 ) Han et al. [23] (2563 ) 3D-RecAE (ours) (643 ) 3D-RecAE (ours) (1283 ) 3D-RecAE (ours) (2563 ) 3D-RecGAN++ (ours) (643 ) 3D-RecGAN++ (ours) (1283 ) 3D-RecGAN++ (ours) (2563 ) 4.4 bench 0.544 0.492 0.417 0.733 0.669 0.552 0.745 0.683 0.564 chair 0.469 0.432 0.389 0.736 0.693 0.622 0.741 0.699 0.628 coach 0.483 0.469 0.431 0.832 0.812 0.722 0.844 0.825 0.733 table 0.560 0.524 0.476 0.759 0.715 0.644 0.772 0.730 0.659 Multi-category Results (1) Results. All networks are also trained and tested on multiple categories without being given any class labels. The networks are trained on four categories: {bench, chair, coach, table}; and then tested separately on an individual category. Table 3 shows the IoU comparison of all methods on the resolution of 323 voxel grids, while Table 4 shows the IoU comparison of [23] and our methods on higher resolution of voxel grids. Figure 6 shows the qualitative results of all approaches on multiple categories. (2) Analysis. The proposed 3D-RecGAN++ significantly outperforms the state of the art by a large margin in all categories which are trained together on a single model. 7 2.5D input (643) 3D-EPN Varley et al. Han et al. Besides, the performance of our network trained on multiple categories, does not degrade compared with training the network on individual categories. This confirms that our network has enough capacity and capability to learn diverse features from multiple categories. TABLE 3: Multi-category IoU (323 voxel grids). 3D-EPN [11] Varley et al. [2] Han et al. [23] 3D-RecAE (ours) 3D-RecGAN++ (ours) 4.5 3D-RecAE 3D-RecGAN++ Ground Truth (2563) (403) (2563) (2563) (323) Fig. 5: Qualitative results of per-category reconstruction from different approaches. bench 0.758 0.681 0.531 0.789 0.806 chair 0.734 0.630 0.512 0.767 0.784 coach 0.843 0.823 0.469 0.850 0.863 table 0.772 0.691 0.596 0.795 0.806 Cross-category Results (1) Results. To further investigate the generality of networks, we train all networks on {bench, chair, coach, table}, and then test them on another 6 totally different categories: {airplane, car, faucet, guitar, gun, monitor}. For each of the 6 categories, it has 4625 single arbitrary views from random selected 37 objects for testing, which is the same data size as used in the previous {bench, chair, coach, table}. Table 5 (2563) TABLE 4: Multi-category IoU (up to 2563 voxel grids). Han et al. [23] (643 ) Han et al. [23] (1283 ) Han et al. [23] (2563 ) 3D-RecAE (ours) (643 ) 3D-RecAE (ours) (1283 ) 3D-RecAE (ours) (2563 ) 3D-RecGAN++ (ours) (643 ) 3D-RecGAN++ (ours) (1283 ) 3D-RecGAN++ (ours) (2563 ) bench 0.453 0.408 0.364 0.719 0.653 0.537 0.741 0.679 0.562 chair 0.451 0.416 0.390 0.710 0.665 0.595 0.730 0.688 0.618 coach 0.442 0.427 0.398 0.825 0.804 0.715 0.838 0.819 0.728 table 0.534 0.496 0.458 0.741 0.695 0.623 0.753 0.710 0.638 shows the IoU comparison of all approaches on 323 voxel grids, while Table 6 shows the IoU comparison of [23] and our approaches on higher resolution of voxel grids. Figure 7 shows the qualitative results of all methods on 6 unseen categories. We further evaluate the generality of our 3D-RecGAN++ on a specific category. Particularly, we conduct four groups of experiments. In the first group, we train our 3DRecGAN++ on bench, then separately test on the remaining 3 categories: {chair, coach, table}. In the second group, the 8 2.5D input (643) 3D-EPN Varley et al. Han et al. 3D-RecAE 3D-RecGAN++ Ground Truth (323) (403) (2563) (2563) (2563) Fig. 6: Qualitative results of multi-category reconstruction from different approaches. TABLE 5: Cross-category IoU (323 voxel grids). airplane 3D-EPN [11] 0.667 Varley et al. [2] 0.524 Han et al. [23] 0.466 3D-RecAE (ours) 0.670 3D-RecGAN++ (ours) 0.683 car 0.723 0.069 0.414 0.805 0.802 faucet 0.683 0.025 0.431 0.723 0.731 guitar 0.753 0.041 0.448 0.762 0.769 gun monitor 0.742 0.715 0.065 0.051 0.401 0.585 0.725 0.722 0.739 0.738 TABLE 6: Cross-category IoU (up to 2563 voxel grids). Han et al. [23] (643 ) Han et al. [23] (1283 ) Han et al. [23] (2563 ) 3D-RecAE (ours) (643 ) 3D-RecAE (ours) (1283 ) 3D-RecAE (ours) (2563 ) 3D-RecGAN++ (ours) (643 ) 3D-RecGAN++ (ours) (1283 ) 3D-RecGAN++ (ours) (2563 ) airplane car faucet guitar gun monitor 0.373 0.372 0.356 0.341 0.296 0.517 0.318 0.350 0.319 0.286 0.245 0.470 0.248 0.299 0.284 0.225 0.198 0.414 0.602 0.774 0.678 0.700 0.665 0.661 0.547 0.745 0.645 0.643 0.605 0.614 0.365 0.557 0.520 0.413 0.381 0.529 0.615 0.769 0.687 0.709 0.682 0.680 0.559 0.740 0.653 0.651 0.625 0.633 0.379 0.555 0.529 0.424 0.399 0.547 network is trained on chair and separately tested on {bench, coach, table}. Similarly, another two groups of experiments are conducted. Basically, this experiment is to investigate how well our approach learns features from one category (2563) and then generalizes to a different category, and vice versa. Table 7 shows the cross-category IoU of our 3D-RecGAN++ trained on individual category over 2563 voxel grids. (2) Analysis. The proposed 3D-RecGAN++ achieves much higher IoU across the unseen categories than competing approaches. Our network not only learns rich features from different object categories, but also is able to generalize well to completely new types of categories. This implies that our network may learn geometric relationships such as lines, planes, curves which are common across various object categories. It can be also observed that our model trained on bench tends to be more general than others, because bench is likely to have more general features to be learned, while simple categories such as coach are unlikely to consist of many general features that are shared across different categories. 4.6 Real-world Experiment Results (1) Results. Lastly, in order to evaluate the domain adaptation capability of the networks, we train all networks on synthesized data of categories {bench, chair, coach, table}, 9 2.5D input (643) 3D-EPN Varley et al. Han et al. 3D-RecAE 3D-RecGAN++ Ground Truth (323) (2563) (2563) (403) (2563) Fig. 7: Qualitative results of cross-category reconstruction from different approaches. TABLE 7: Cross-category IoU of 3D-RecGAN++ trained on individual category (2563 voxel grids). Group 1 (trained on bench) Group 2 (trained on chair) Group 3 (trained on coach) Group 4 (trained on table) bench – 0.482 0.387 0.477 chair 0.510 – 0.460 0.495 coach 0.549 0.509 – 0.449 table 0.592 0.549 0.401 – and then test them on real-world data collected by a Microsoft Kinect camera. The real-world data were collected in different environments, including offices, homes, and outdoor university parks, as shown in Figure 8. Compared to synthesized data, real-world partial 2.5D views are noisier and largely incomplete. For each object, we randomly selected 20 different 2.5D depth views for testing. Table 8 shows the IoU performance of all approaches using 323 voxel grids, while Table 9 compares the IoU of [23] and (2563) our approaches on higher resolutions. Figure 9 shows some qualitative results for all methods. (2) Analysis. There are two reasons why the IoU is significantly lower compared with testing on the synthetic dataset. First, the ground truth objects obtained from ElasticFusion are empty rather than solid, and are only occupied on the surface. However, all networks predict dense and solid voxel grids, so the interior of bulky objects like couches is not matching. Secondly, the input 2.5D depth view from real world dataset is noisy and incomplete, due to the limitation of the RGB-D sensor (e.g., reflective surfaces, outdoor light). In many cases, the input 2.5D view does not capture the whole object and only contains a small part of the object, which also leads to failure cases (e.g. the 6th row in Figure 9) and a lower IoU scores overall. However, our proposed network is still able to reconstruct reasonable 3D dense shapes given the noisy and incomplete 2.5D input 10 Fig. 8: Real world objects for reconstruction. depth views, while the competing algorithms (e.g. Varley et al.) are not robust to real world noise and unable to generate compelling results. TABLE 8: Real-world multi-category IoU (323 voxel grids). 3D-EPN [11] Varley et al. [2] Han et al. [23] 3D-RecAE (ours) 3D-RecGAN++ (ours) bench 0.350 0.043 0.291 0.352 0.347 chair 0.273 0.0.008 0.240 0.295 0.297 coach 0.173 0.038 0.159 0.199 0.201 table 0.246 0.009 0.228 0.268 0.268 TABLE 9: Real-world multi-category IoU (up to 2563 voxel grids). Han et al. [23] (643 ) Han et al. [23] (1283 ) Han et al. [23] (2563 ) 3D-RecAE (ours) (643 ) 3D-RecAE (ours) (1283 ) 3D-RecAE (ours) (2563 ) 3D-RecGAN++ (ours) (643 ) 3D-RecGAN++ (ours) (1283 ) 3D-RecGAN++ (ours) (2563 ) 4.7 bench 0.184 0.117 0.070 0.231 0.145 0.071 0.230 0.147 0.074 chair 0.148 0.092 0.045 0.178 0.096 0.032 0.174 0.097 0.032 coach 0.101 0.067 0.040 0.107 0.055 0.024 0.109 0.057 0.025 table 0.126 0.069 0.031 0.148 0.071 0.024 0.146 0.069 0.023 Impact of Adversarial Learning (1) Results. In all above experiments, the proposed 3DRecGAN++ tends to outperform the ablated network 3DRecAE which does not include the adversarial learning of GAN part. In all visualization of experiment results, the 3D shapes from 3D-RecGAN++ are also more compelling than 3D-RecAE. To further investigate how the adversarial learning improves the final 3D results comparing with 3DRecAE, we calculate the mean precision and recall from the above multi-category experiment results. Table 10 shows the mean precision of 3D-RecGAN++ and 3D-RecAE on individual categories using the network trained on multiple categories, while Table 11 shows the mean recall. (2) Analysis. It can be seen that the results of 3DRecGAN++ have much higher precision scores than 3DRecAE, which means 3D-RecGAN++ has much less false positive estimations, while 3D-RecAE tends to estimate much more false positives. Therefore, the estimated 3D shapes from 3D-RecAE are likely to be ’fatter’ and ’bigger’, while 3D-RecGAN++ tends to output ’thinner’ shapes with much more shape details being exposed. Both 3DRecGAN++ and 3D-RecAE can achieve extremely high recall scores (i.e. above 0.9), although 3D-RecGAN++ has lower recall scores compared with 3D-RecAE. This means both 3D-RecGAN++ and 3D-RecAE are capable of estimating almost all of the object shapes without too many false negatives. In other words, the ground truth 3D shape tends to be a subset of the estimated shape result. TABLE 10: Multi-category mean precision (up to 2563 voxel grids). 3D-RecAE (323 ) 3D-RecAE (643 ) 3D-RecAE (1283 ) 3D-RecAE (2563 ) 3D-RecGAN++ (323 ) 3D-RecGAN++ (643 ) 3D-RecGAN++ (1283 ) 3D-RecGAN++ (2563 ) bench 0.823 0.755 0.688 0.564 0.856 0.798 0.737 0.608 chair 0.802 0.746 0.700 0.626 0.832 0.781 0.739 0.663 coach 0.868 0.843 0.822 0.730 0.888 0.866 0.847 0.751 table 0.825 0.773 0.727 0.651 0.845 0.797 0.755 0.676 TABLE 11: Multi-category mean recall (up to 2563 voxel grids). 3D-RecAE (323 ) 3D-RecAE (643 ) 3D-RecAE (1283 ) 3D-RecAE (2563 ) 3D-RecGAN++ (323 ) 3D-RecGAN++ (643 ) 3D-RecGAN++ (1283 ) 3D-RecGAN++ (2563 ) bench 0.952 0.939 0.930 0.921 0.934 0.915 0.900 0.887 chair 0.945 0.935 0.929 0.924 0.931 0.918 0.908 0.902 coach 0.978 0.975 0.974 0.972 0.968 0.964 0.961 0.959 table 0.956 0.947 0.940 0.935 0.946 0.934 0.925 0.918 Overall, with regard to experiments on per-category, multi-category, and cross-category experiments, our 3DRecGAN++ outperforms others by a large margin, although all other approaches can reconstruct reasonable shapes. In terms of the generality, Varley et al. [2] and Han et al. [23] are inferior because [2] uses a single fully connected layers, instead of 3D ConvNets, for shape generation which is unlikely to be general for various shapes, and [23] applies LSTMs for shape blocks generation which is inefficient and 11 2.5D input (643) 3D-EPN Varley et al. Han et al. unable to learn general 3D structures. However, our 3DRecGAN++ is superior thanks to the generality of simple yet efficient 3D autoencoder and the 3D convolutional discriminator. Besides, the 3D-RecAE tends to over estimate the 3D shape, while the adversarial learning of 3D-RecGAN++ is likely to remove the over-estimated parts, so as to leave the estimated shape to be clearer with more shape details. 5 3D-RecAE 3D-RecGAN++ Ground Truth (2563) (2563) (323) (2563) (403) Fig. 9: Qualitative results of real world objects reconstruction from different approaches. D ISCUSSION Although our 3D-RecGAN++ achieves the state of the art performance in 3D object reconstruction from a single depth view, it has limitations. Firstly, our network takes the volumetric representation of a single depth view as input, instead of taking a raw depth image. Therefore, a preprocessing of raw depth images is required for our network. However, in many application scenarios such as robot grasping, such preprocessing would be trivial and straightforward given the depth camera parameters. Secondly, the input depth view of our network only contains a clean object information without cluttered background. One possible solution is to leverage an existing segmentation algorithm such as Mask-RCNN [82] to clearly segment the target object instance from the raw depth view. 6 (2563) C ONCLUSION In this work, we proposed a novel framework 3DRecGAN++ that reconstructs the full 3D structure of an object from an arbitrary depth view. By leveraging the generalization capabilities of autoencoders and generative adversarial networks, our 3D-RecGAN++ predicts dense and accurate 3D structures with fine details, outperforming the state of the art in single-view shape completion for individual object category. We further tested our network’s ability to reconstruct multiple categories without providing any object class labels during training or testing, and it showed that our network is still able to predict precise 3D shapes. Besides, we investigated the network’s reconstruction performance on unseen categories, our proposed approach can also predict satisfactory 3D structures. Finally, our model is robust to real world noisy data and can infer accurate 3D shapes although the model is purely trained on synthesized data. This confirms that our network has the capability of learning general 3D latent features of the objects, rather than simply fitting a function for the training datasets, and the adversarial learning of 3D-RecGAN++ learns to add geometric details for estimated 3D shapes. In summary, our network only requires a single depth view to recover a dense and complete 3D shape with fine details. 12 R EFERENCES [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] [28] [29] A. Sharma, O. Grau, and M. Fritz, “VConv-DAE : Deep Volumetric Shape Learning Without Object Labels,” ECCV, 2016. J. Varley, C. Dechant, A. Richardson, J. Ruales, and P. Allen, “Shape Completion Enabled Robotic Grasping,” IROS, 2017. R. A. Newcombe, S. Izadi, O. Hilliges, D. Molyneaux, D. Kim, A. J. Davison, P. Kohli, J. Shotton, S. Hodges, and A. Fitzgibbon, “KinectFusion: Real-time dense surface mapping and tracking,” ISMAR, 2011. M. Nießner, M. Zollhöfer, S. Izadi, and M. Stamminger, “Real-time 3D reconstruction at scale using voxel hashing,” ACM Transactions on Graphics, vol. 32, no. 6, pp. 1–11, 2013. F. Steinbrucker, C. Kerl, J. Sturm, and D. Cremers, “Large-Scale Multi-Resolution Surface Reconstruction from RGB-D Sequences,” ICCV, 2013. A. Nealen, T. Igarashi, O. Sorkine, and M. Alexa, “Laplacian Mesh Optimization,” SIGGRAPH, 2006. W. Zhao, S. Gao, and H. Lin, “A robust hole-filling algorithm for triangular mesh,” The Visual Computer, vol. 23, no. 12, pp. 987–997, 2007. M. Kazhdan, M. Bolitho, and H. Hoppe, “Poisson Surface Reconstruction,” Symposium on Geometry Processing, 2006. M. Kazhdan and H. Hoppe, “Screened poisson surface reconstruction,” ACM Transactions on Graphics, vol. 32, no. 3, pp. 1–13, 2013. Z. Wu, S. Song, A. Khosla, F. Yu, L. Zhang, X. Tang, and J. Xiao, “3D ShapeNets: A Deep Representation for Volumetric Shapes,” CVPR, 2015. A. Dai, C. R. Qi, and M. Nießner, “Shape Completion using 3DEncoder-Predictor CNNs and Shape Synthesis,” CVPR, 2017. I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. WardeFarley, S. Ozair, A. Courville, and Y. Bengio, “Generative Adversarial Nets,” NIPS, 2014. D. P. Kingma and M. Welling, “Auto-Encoding Variational Bayes,” ICLR, 2014. Z. Hu, Z. Yang, X. Liang, R. Salakhutdinov, and E. P. Xing, “Controllable Text Generation,” ICML, 2017. T. Karras, T. Aila, S. Laine, and J. Lehtinen, “Progressive Growing of GANs for Improved Quality, Stability, and Variation,” ICLR, 2018. X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel, “InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets,” NIPS, 2016. T. D. Kulkarni, W. F. Whitney, P. Kohli, and J. B. Tenenbaum, “Deep Convolutional Inverse Graphics Network,” NIPS, 2015. E. Grant, P. Kohli, and M. V. Gerven, “Deep Disentangled Representations for Volumetric Reconstruction,” ECCV Workshops, 2016. R. Girdhar, D. F. Fouhey, M. Rodriguez, and A. Gupta, “Learning a Predictable and Generative Vector Representation for Objects,” ECCV, 2016. H. Huang, E. Kalogerakis, and B. Marlin, “Analysis and synthesis of 3D shape families via deep-learned generative models of surfaces,” Computer Graphics Forum, vol. 34, no. 5, pp. 25–38, 2015. J. Wu, C. Zhang, T. Xue, W. T. Freeman, and J. B. Tenenbaum, “Learning a Probabilistic Latent Space of Object Shapes via 3D Generative-Adversarial Modeling,” NIPS, 2016. M. Mirza and S. Osindero, “Conditional Generative Adversarial Nets,” arXiv, 2014. X. Han, Z. Li, H. Huang, E. Kalogerakis, and Y. Yu, “HighResolution Shape Completion Using Deep Neural Networks for Global Structure and Local Geometry Inference,” ICCV, 2017. B. Yang, H. Wen, S. Wang, R. Clark, A. Markham, and N. Trigoni, “3D Object Reconstruction from a Single Depth View with Adversarial Learning,” ICCV Workshops, 2017. A. Monszpart, N. Mellado, G. J. Brostow, and N. J. Mitra, “RAPter: Rebuilding Man-made Scenes with Regular Arrangements of Planes,” ACM Transactions on Graphics, vol. 34, no. 4, pp. 1–12, 2015. N. J. Mitra, L. J. Guibas, and M. Pauly, “Partial and Approximate Symmetry Detection for 3D Geometry,” SIGGRAPH, 2006. M. Pauly, N. J. Mitra, J. Wallner, H. Pottmann, and L. J. Guibas, “Discovering structural regularity in 3D geometry,” ACM Transactions on Graphics, vol. 27, no. 3, p. 1, 2008. I. Sipiran, R. Gregor, and T. Schreck, “Approximate Symmetry Detection in Partial 3D Meshes,” Computer Graphics Forum, vol. 33, no. 7, pp. 131–140, 2014. P. Speciale, M. R. Oswald, A. Cohen, and M. Pollefeys, “A Symmetry Prior for Convex Variational 3D Reconstruction,” ECCV, 2016. [30] S. Thrun and B. Wegbreit, “Shape from symmetry,” ICCV, 2005. [31] Y. M. Kim, N. J. Mitra, D.-M. Yan, and L. Guibas, “Acquiring 3D Indoor Environments with Variability and Repetition,” ACM Transactions on Graphics, vol. 31, no. 6, 2012. [32] Y. Li, A. Dai, L. Guibas, and M. Nießner, “Database-Assisted Object Retrieval for Real-Time 3D Reconstruction,” Computer Graphics Forum, vol. 34, no. 2, pp. 435–446, 2015. [33] L. Nan, K. Xie, and A. Sharf, “A Search-Classify Approach for Cluttered Indoor Scene Understanding,” ACM Transactions on Graphics, vol. 31, no. 6, pp. 1–10, 2012. [34] T. Shao, W. Xu, K. Zhou, J. Wang, D. Li, and B. Guo, “An interactive approach to semantic modeling of indoor scenes with an RGBD camera,” ACM Transactions on Graphics, vol. 31, no. 6, pp. 1–11, 2012. [35] Y. Shi, P. Long, K. Xu, H. Huang, and Y. Xiong, “Data-driven contextual modeling for 3d scene understanding,” Computers & Graphics, vol. 55, pp. 55–67, 2016. [36] J. Rock, T. Gupta, J. Thorsen, J. Gwak, D. Shin, and D. Hoiem, “Completing 3D Object Shape from One Depth Image,” CVPR, 2015. [37] R. Hartley and A. Zisserman, Multiple View Geometry in Computer Vision. Cambridge University Press, 2004. [38] R. A. Newcombe, S. J. Lovegrove, and A. J. Davision, “DTAM: Dense Tracking and Mapping in Real-time,” ICCV, 2011. [39] S. Baker and I. Matthews, “Lucas-Kanade 20 Years On : A Unifying Framework : Part 1,” International Journal of Computer Vision, vol. 56, no. 3, pp. 221–255, 2004. [40] C. B. Choy, D. Xu, J. Gwak, K. Chen, and S. Savarese, “3DR2N2: A Unified Approach for Single and Multi-view 3D Object Reconstruction,” ECCV, 2016. [41] X. Di, R. Dahyot, and M. Prasad, “Deep Shape from a Low Number of Silhouettes,” ECCV, 2016. [42] Z. Lun, M. Gadelha, E. Kalogerakis, S. Maji, and R. Wang, “3D Shape Reconstruction from Sketches via Multi-view Convolutional Networks,” 3DV, 2017. [43] D. J. Rezende, S. M. A. Eslami, S. Mohamed, P. Battaglia, M. Jaderberg, and N. Heess, “Unsupervised Learning of 3D Structure from Images,” NIPS, 2016. [44] A. Kar, C. Häne, and J. Malik, “Learning a Multi-View Stereo Machine,” NIPS, 2017. [45] M. Ji, J. Gall, H. Zheng, Y. Liu, and L. Fang, “SurfaceNet: An Endto-end 3D Neural Network for Multiview Stereopsis,” ICCV, 2017. [46] T. Whelan, J. McDonald, M. Kaess, M. Fallon, H. Johannsson, and J. J. Leonard, “Kintinuous: Spatially Extended Kinectfusion,” RSS Workshops, 2012. [47] T. Whelan, S. Leutenegger, R. F. Salas-moreno, B. Glocker, and A. J. Davison, “ElasticFusion : Dense SLAM Without A Pose Graph,” RSS, 2015. [48] G. Riegler, A. O. Ulusoy, H. Bischof, and A. Geiger, “OctNetFusion: Learning Depth Fusion from Data,” 3DV, 2017. [49] V. Blanz and T.Vetter, “Face Recognition based on Fitting a 3D Morphable Model,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 25, no. 9, pp. 1063–1074, 2003. [50] P. Dou, S. K. Shah, and I. A. Kakadiaris, “End-to-end 3D face reconstruction with deep neural networks,” CVPR, 2017. [51] A. Kar, S. Tulsiani, J. Carreira, and J. Malik, “Category-specific object reconstruction from a single image,” CVPR, 2015. [52] J. Gwak, C. B. Choy, M. Chandraker, A. Garg, and S. Savarese, “Weakly supervised 3D Reconstruction with Adversarial Constraint,” arXiv, 2017. [53] S. Tulsiani, T. Zhou, A. A. Efros, and J. Malik, “Multi-view Supervision for Single-view Reconstruction via Differentiable Ray Consistency,” CVPR, 2017. [54] X. Yan, J. Yang, E. Yumer, Y. Guo, and H. Lee, “Perspective Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision,” NIPS, 2016. [55] C. Kong, C.-H. Lin, and S. Lucey, “Using Locally Corresponding CAD Models for Dense 3D Reconstructions from a Single Image,” CVPR, 2017. [56] A. Kurenkov, J. Ji, A. Garg, V. Mehta, J. Gwak, C. Choy, and S. Savarese, “DeformNet: Free-Form Deformation Network for 3D Shape Reconstruction from a Single Image,” NIPS, 2017. [57] J. K. Murthy, G. V. S. Krishna, F. Chhaya, and K. M. Krishna, “Reconstructing Vechicles from a Single Image : Shape Priors for Road Scene Understanding,” ICRA, 2017. [58] H. Christian, S. Tulsiani, and J. Malik, “Hierarchical Surface Prediction for 3D Object Reconstruction,” 3DV, 2017. 13 [59] M. Tatarchenko, A. Dosovitskiy, and T. Brox, “Octree Generating Networks: Efficient Convolutional Architectures for Highresolution 3D Outputs,” ICCV, 2017. [60] A. Johnston, R. Garg, G. Carneiro, I. Reid, and A. v. d. Hengel, “Scaling CNNs for High Resolution Volumetric Reconstruction from a Single Image,” ICCV Workshops, 2017. [61] C.-H. Lin, C. Kong, and S. Lucey, “Learning Efficient Point Cloud Generation for Dense 3D Object Reconstruction,” AAAI, 2018. [62] J. Wu, Y. Wang, T. Xue, X. Sun, W. T. Freeman, and J. B. Tenenbaum, “MarrNet: 3D Shape Reconstruction via 2.5D Sketches,” NIPS, 2017. [63] M. Firman, O. M. Aodha, S. Julier, and G. J. Brostow, “Structured Prediction of Unobserved Voxels From a Single Depth Image,” CVPR, 2016. [64] S. Song, F. Yu, A. Zeng, A. X. Chang, M. Savva, and T. Funkhouser, “Semantic Scene Completion from a Single Depth Image,” CVPR, 2017. [65] W. Wang, Q. Huang, S. You, C. Yang, and U. Neumann, “Shape Inpainting using 3D Generative Adversarial Network and Recurrent Convolutional Networks,” ICCV, 2017. [66] C. Zou, E. Yumer, J. Yang, D. Ceylan, and D. Hoiem, “3D-PRNN: Generating Shape Primitives with Recurrent Neural Networks,” ICCV, 2017. [67] C. Ledig, L. Theis, F. Huszar, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi, “Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network,” CVPR, 2017. [68] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee, “Generative Adversarial Text to Image Synthesis,” ICML, 2016. [69] M. Gadelha, S. Maji, and R. Wang, “3D Shape Induction from 2D Views of Multiple Objects,” 3DV, 2017. [70] E. Smith and D. Meger, “Improved Adversarial Systems for 3D Object Generation and Reconstruction,” CoRL, 2017. [71] A. A. Soltani, H. Huang, J. Wu, T. D. Kulkarni, and J. B. Tenenbaum, “Synthesizing 3D Shapes via Modeling Multi-View Depth Maps and Silhouettes with Deep Generative Networks,” CVPR, 2017. [72] A. X. Chang, T. Funkhouser, L. Guibas, P. Hanrahan, Q. Huang, Z. Li, S. Savarese, M. Savva, S. Song, H. Su, J. Xiao, L. Yi, and F. Yu, “ShapeNet: An Information-Rich 3D Model Repository,” arXiv, 2015. [73] L. v. d. Maaten and G. Hinton, “Visualizing Data using t-SNE,” Journal of Machine Learning Research, vol. 9, no. Nov, pp. 2579–2605, 2008. [74] O. Ronneberger, P. Fischer, and T. Brox, “U-Net : Convolutional Networks for Biomedical Image Segmentation,” MICCAI, 2015. [75] M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein GAN,” ICML, 2017. [76] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. Courville, “Improved Training of Wasserstein GANs,” NIPS, 2017. [77] M. Arjovsky and L. Bottou, “Towards Principled Methods for Training Generative Adversarial Networks,” ICLR, 2017. [78] Y. Mroueh, T. Sercu, and V. Goel, “McGAN: Mean and Covariance Feature Matching GAN,” ICML, 2017. [79] J. Bao, D. Chen, F. Wen, H. Li, and G. Hua, “CVAE-GAN: FineGrained Image Generation through Asymmetric Training,” ICCV, 2017. [80] A. Brock, T. Lim, J. M. Ritchie, and N. Weston, “Generative and Discriminative Voxel Modeling with Convolutional Neural Networks,” NIPS Workshops, 2016. [81] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” ICLR, 2015. [82] K. He, G. Gkioxari, P. Dollar, and R. Girshick, “Mask R-CNN,” ICCV, 2017.
1cs.CV
arXiv:1704.02043v2 [math.AG] 9 Nov 2017 COMMENSURATING ACTIONS OF BIRATIONAL GROUPS AND GROUPS OF PSEUDO-AUTOMORPHISMS SERGE CANTAT AND YVES DE CORNULIER A BSTRACT. Pseudo-automorphisms are birational transformations acting as regular automorphisms in codimension 1. We import ideas from geometric group theory to study groups of birational transformations, and prove that a group of birational transformations that satisfies a fixed point property on CAT(0) cubical complexes is birationally conjugate to a group acting by pseudo-automorphisms on some non-empty Zariski-open subset. We apply this argument to classify groups of birational transformations of surfaces with this fixed point property up to birational conjugacy. 1. I NTRODUCTION 1.1. Birational transformations and pseudo-automorphisms. Let X be a quasiprojective variety, over an algebraically closed field k. Denote by Bir(X) the group of birational transformations of X and by Aut(X) the subgroup of (regular) automorphisms of X. For the affine space of dimension n, automorphisms are invertible transformations f : Ank → Ank such that both f and f −1 are defined by polynomial formulas in affine coordinates: f (x1 , . . . , xn ) = (f1 , . . . , fn ), f −1 (x1 , . . . , xn ) = (g1 , . . . , gn ) with fi , gi ∈ k[x1 , . . . , xn ]. Similarly, birational transformations of Ank are given by rational formulas, i.e. fi , gi ∈ k(x1 , . . . , xn ). Birational transformations may contract hypersurfaces. Roughly speaking, pseudo-automorphisms are birational transformations that act as automorphisms in codimension 1. Precisely, a birational transformation f : X 99K X is a pseudoautomorphism if there exist Zariski-open subsets U and V in X such that X r U and X r V have codimension ≥ 2 and f induces an isomorphism from U to V. The pseudo-automorphisms of X form a group, which we denote by Psaut(X). For instance, all birational transformations of Calabi-Yau manifolds are pseudoautomorphisms; and there are examples of such manifolds for which Psaut(X) is Date: November 9, 2017. 2010 Mathematics Subject Classification. Primary 14E07, Secondary 14J50, 20F65. 1 COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 2 infinite while Aut(X) is trivial (see [10]). Pseudo-automorphisms are studied in Section 2. Definition 1.1. Let Γ ⊂ Bir(X) be a group of birational transformations of an irreducible projective variety X. We say that Γ is pseudo-regularizable if there exists a triple (Y, U, ϕ) where (1) Y is a projective variety and ϕ : Y 99K X is a birational map; (2) U is a dense Zariski open subset of Y ; (3) ϕ−1 ◦ Γ ◦ ϕ yields an action of Γ by pseudo-automorphisms on U. More generally if α : Γ → Bir(X) is a homomorphism, we say that it is pseudoregularizable if α(Γ) is pseudo-regularizable. One goal of this article is to use rigidity properties of commensurating actions, a purely group-theoretic concept, to show that many group actions are pseudoregularizable. In particular, we exhibit a class of groups for which all actions by birational transformations on projective varieties are pseudo-regularizable. 1.2. Property (FW). The class of groups we shall be mainly interested in is characterized by a fixed point property appearing in several related situations, for instance for actions on CAT(0) cubical complexes. Here, we adopt the viewpoint of commensurated subsets. Let Γ be a group, and Γ × S → S an action of Γ on a set S. Let A be a subset of S. One says that Γ commensurates A if the symmetric difference γ(A)4A = (γ(A) r A) ∪ (A r γ(A)) is finite for every element γ of Γ. One says that Γ transfixes A if there is a subset B of S such that A4B is finite and B is Γ-invariant: γ(B) = B, for every γ in Γ. A group Γ has Property (FW) if, given any action of Γ on any set S, all com√ mensurated subsets of S are automatically transfixed. For instance, SL 2 (Z[ 5]) and SL 3 (Z) have Property (FW), but non-trivial free groups do not share this property. Property (FW) is discussed in Section 3. Let us mention that among various characterizations of Property (FW) (see [11]), one is: every combinatorial action of Γ on a CAT(0) cube complex fixes some cube. Another, for Γ finitely generated, is that all its infinite Schreier graphs are oneended. 1.3. Pseudo-regularizations. Let X be a projective variety. The group Bir(X) does not really act on X, because there are indeterminacy points; it does not act on the set of hypersurfaces either, because some of them may be contracted. As COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 3 ˜ we shall explain, one can introduce the set Hyp(X) of all irreducible and reduced 0 hypersurfaces in all birational models X 99K X (up to a natural identification). Then there is a natural action of the group Bir(X) on this set, given by strict transforms. The rigorous construction of this action follows from a general categorical framework, which is developed in Section 4. Moreover, this action commensurates the subset Hyp(X) of hypersurfaces of X. This construction leads to the following result. Theorem A. Let X be a projective variety over an algebraically closed field. Let Γ be a subgroup of Bir(X). If Γ has Property (FW), then Γ is pseudo-regularizable. There is also a relative version of Property (FW) for pairs of groups Λ ≤ Γ, which leads to a similar pseudo-regularization theorem for the subgroup Λ: this is discussed in Section 6.4, with applications to distorted birational transformations. Remark 1.2. Theorem A provides a triple (Y, U, ϕ) such that ϕ conjugates Γ to a group of pseudo-automorphisms on the open subset U ⊂ Y . There are two extreme cases for the pair (Y, U) depending on the size of the boundary Y r U. If this boundary is empty, Γ acts by pseudo-automorphisms on a projective variety Y . If the boundary is ample, its complement U is an affine variety, and then Γ actually acts by regular automorphisms on U (see Section 2.4). Thus, in the study of groups of birational transformations, pseudo-automorphisms of projective varieties and regular automorphisms of affine varieties deserve specific attention. 1.4. Classification in dimension 2. In dimension 2, pseudo-automorphisms do not differ much from automorphisms; for instance, Psaut(X) coincides with Aut(X) if X is a smooth projective surface. Thus, for groups with Property (FW), Theorem A can be used to reduce the study of birational transformations to the study of automorphisms of quasi-projective surfaces. Combining results of Danilov and Gizatullin on automorphisms of affine surfaces with a theorem of Farley on groups of piecewise affine transformations of the circle, we will be able to prove the following theorem. Theorem B. Let X be a smooth, projective, and irreducible surface, over an algebraically closed field. Let Γ be an infinite subgroup of Bir(X). If Γ has Property (FW), there is a birational map ϕ : Y 99K X such that (1) Y is the projective plane P2 , a Hirzebruch surface Fm with m ≥ 1, or the product of a curve C by the projective line P1 . If the characteristic of the field is positive, Y is the projective plane P2k . COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 4 (2) ϕ−1 ◦ Γ ◦ ϕ is contained in Aut(Y ). Remark 1.3. The group Aut(Y ) has finitely many connected components for all surfaces Y listed in Assertion (1) of Theorem B. Thus, changing Γ into a finite index subgroup Γ0 , one gets a subgroup of Aut(Y )0 . Here Aut(Y )0 denotes the connected component of the identity of Aut(Y ); this is an algebraic group, acting algebraically on Y . Example 1.4. Groups with Kazhdan Property (T) satisfy Property (FW). Thus, Theorem B extends Theorem A of [8] and the present article offers a new proof of that result. √ Theorem B can also be applied to the group SL 2 (Z[ d]), where d ≥ 2 is a nonsquare positive integer. Thus, every action of this group on a projective surface by birational transformations is conjugate to an action by regular automorphisms on P2k , the product of a curve C by the projective line P1k , or a Hirzebruch surface. Moreover, in this case, Margulis’ superrigidity theorem can be combined with Theorem B to get a more precise result, see §10. Remark 1.5. In general, for a variety X one can ask whether Bir(X) transfixes Hyp(X), or equivalently is pseudo-regularizable. For a surface X, this holds precisely when X is not birationally equivalent to the product of the projective line with a curve. See §7.1 for more precise results. 1.5. Acknowledgement. This work benefited from interesting discussions with Jérémy Blanc, Vincent Guirardel, Vaughan Jones, Christian Urech, and Junyi Xie. 2. P SEUDO - AUTOMORPHISMS This preliminary section introduces useful notation for birational transformations and pseudo-automorphisms, and presents a few basic results. 2.1. Birational transformations. Let X and Y be two irreducible and reduced algebraic varieties over an algebraically closed field k. Let f : X 99K Y be a birational map. Choose dense Zariski open subsets U ⊂ X and V ⊂ Y such that f induces an isomorphism fU,V : U → V . Then the graph Gf of f is defined as the Zariski closure of {(x, fU,V (x)) : x ∈ U } in X × Y ; it does not depend on the choice of U and V . The graph Gf is an irreducible variety; both projections u : Gf → X and v : Gf → Y are birational morphisms and f = v ◦ u−1 . We shall denote by Ind(f ) the indeterminacy set of the birational map f . COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 5 Theorem 2.1 (Theorem 2.17 in [23]). Let f : X 99K Y be a rational map, with X a normal variety and Y a projective variety. Then the indeterminacy set of f has codimension ≥ 2. Example 2.2. The transformation of the affine plane (x, y) 7→ (x, y/x) is birational, and its indeterminacy locus is the line {x = 0}: this set of co-dimension 1 is mapped “to infinity”. If the affine plane is compactified by the projective plane, the transformation becomes [x : y : z] 7→ [x2 : yz : xz], with two indeterminacy points. Assume that X is normal; in particular, it is smooth in codimension 1. The jacobian determinant Jac(f )(x) is defined in local coordinates, on the smooth locus of X, as the determinant of the differential dfx ; Jac(f ) depends on the coordinates, but its zero locus does not. The zeroes of Jac(f ) form a hypersurface of the smooth part of X; the zero locus of Jac(f ) will be defined as the Zariski closure of this hypersurface in X. The exceptional set of f is the subset of X along which f is not a local isomorphism onto its image; by a corollary of Zariski’s main theorem, it coincides with the union of Ind(f ), the zero locus of Jac(f ), and additional parts which are contained in the singular locus of X and have therefore codimension ≥ 2. Its complement is the largest open subset on which f is a local isomorphism (see [33, 36], for instance). The total transform of a subset Z ⊂ X is denoted by f∗ (Z). If Z is not contained in Ind(f ), we denote by f◦ (Z) its strict transform, defined as the Zariski closure of f (Z r Ind(f )). We say that a hypersurface W ⊂ Z is contracted if it is not contained in the indeterminacy set and the codimension of its strict transform is larger than 1. 2.2. Pseudo-isomorphisms. A birational map f : X 99K Y is a pseudo-isomorphism if one can find Zariski open subsets U ⊂ X and V ⊂ Y such that (i) f realizes a regular isomorphism from U to V and (ii) X r U and Y r V have codimension ≥ 2. Pseudo-isomorphisms from X to itself are called pseudo-automorphisms (see § 1.2). The set of pseudo-automorphisms of X is a subgroup Psaut(X) of Bir(X). Example 2.3. Start with the standard birational involution σn : Pnk 99K Pnk which is defined in homogeneous coordinates by σn [x0 : . . . : xn ] = [x−1 : . . . : x−1 ]. 0 Q n Blow-up the (n + 1) vertices of the simplex ∆n = {[x0 : . . . : xn ]; xi = 0}; this provides a smooth rational variety Xn together with a birational morphism COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 6 π : Xn → Pnk . Then, π −1 ◦ σn ◦ π is a pseudo-automorphism of Xn , and is an automorphism if n ≤ 2. Proposition 2.4. Let f : X 99K Y be a birational map between two (irreducible, reduced) normal algebraic varieties. Assume that the codimension of the indeterminacy sets of f and f −1 is at least 2. Then, the following properties are equivalent: (1) The birational maps f and f −1 do not contract any hypersurface. (2) The jacobian determinants of f and f −1 do not vanish on the regular loci of X r Ind(f ) and Y r Ind(f −1 ) respectively. (3) For every smooth point q ∈ X r Ind(f ), f is a local isomorphism from a neighborhood of q to a neighborhood of f (q), and the same holds for f −1 . (4) The birational map f is a pseudo-isomorphism from X to Y . Proof. Denote by g be the inverse of f . If the Jacobian determinant of f vanishes at some (smooth) point of X r Ind(f ), then it vanishes along a hypersurface V ⊂ X. If (1) is satisfied, the image of V is a hypersurface W in Y , and we can find a point p ∈ V r Ind(f ) such that f (p) is not an indeterminacy point of g. Since the product of the jacobian determinant of f at p and of g at f (p) must be equal to 1, we get a contradiction. Thus (1) implies (2), and (2) is equivalent to (1). Now, assume that (2) is satisfied. Then f does not contract any positive dimensional subset of X reg r Ind(f ): f is a quasi-finite map from X reg r Ind(f ) to its image, and so is g. Zariski’s main theorem implies that f realizes an isomorphism from X reg r Ind(f ) to Y r Ind(g) (see [33], Prop. 8.57). Thus, (2) implies (4) and (3). By assumption, Ind(f ) and Ind(g) have codimension ≥ 2; thus, (3) implies (2). Since (4) implies (1), this concludes the proof.  Example 2.5. Let X be a smooth projective variety with trivial canonical bundle KX . Let Ω be a non-vanishing section of KX , and let f be a birational transformation of X. Then, f ∗ Ω extends from X r Ind(f ) to X and determines a new section of KX ; this section does not vanish identically because f is dominant, hence it does not vanish at all because KX is trivial. As a consequence, Jac(f ) does not vanish, f is a pseudo-automorphism of X, and Bir(X) = Psaut(X). We refer to [10, 16] for families of Calabi-Yau varieties with an infinite group of pseudo-automorphisms. 2.3. Projective varieties. Proposition 2.6 (see [5]). Let f : X 99K Y be a pseudo-isomorphism between two normal projective varieties. Then (1) the total transform of Ind(f ) by f is equal to Ind(f −1 ); COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 7 (2) f has no isolated indeterminacy point; (3) if dim(X) = 2, then f is a regular isomorphism. Proof. Let p ∈ X be an indeterminacy point of the pseudo-isomorphism f : X 99K Y . Then f −1 contracts a subset C ⊂ Y of positive dimension on p. Since f and f −1 are local isomorphisms on the complement of their indeterminacy sets, C is contained in Ind(f −1 ). The total transform of a point q ∈ C by f −1 is a connected subset of X that contains p and has dimension ≥ 1. This set Dq is contained in Ind(f ) because f is a local isomorphism on the complement of Ind(f ); since p ∈ Dq ⊂ Ind(f ), p is not an isolated indeterminacy point. This proves Assertions (1) and (2). The third assertion follows from the second one because indeterminacy sets of birational transformations of projective surfaces are finite sets.  Let W be a hypersurface of X, and let f : X 99K Y be a pseudo-isomorphism. The divisorial part of the total transform f∗ (W ) coincides with the strict transform f◦ (W ). Indeed, f∗ (W ) and f◦ (W ) coincide on the open subset of Y on which f −1 is a local isomorphism, and this open subset has codimension ≥ 2. Recall that the Néron-Severi group NS(X) is the free abelian group of codimension 1 cycles modulo cycles which are numerically equivalent to 0. Its rank is finite and is called the Picard number of X. Theorem 2.7. The action of pseudo-isomorphisms on Néron-Severi groups is functorial: (g ◦ f )∗ = g∗ ◦ f∗ for all pairs of pseudo-isomorphisms f : X 99K Y and g : Y 99K Z. If X is a normal projective variety, the group Psaut(X) acts linearly on the Néron-Severi group NS(X); this provides a morphism Psaut(X) → GL (NS(X)). The kernel of this morphism is contained in Aut(X) and contains Aut(X)0 as a finite index subgroup. As a consequence, if X is projective the group Psaut(X) is an extension of a discrete linear subgroup of GL (NS(X)) by an algebraic group. Proof. The first statement follows from the equality f∗ = f◦ on divisors. The second follows from the first. To study the kernel K of the linear representation Psaut(X) → GL (NS(X)), fix an embedding ϕ : X → Pm k and denote by H the m polarization given by hyperplane sections in Pk . For every f in K, f∗ (H) is an ample divisor, because its class in NS(X) coincides with the class of H. Now, a theorem of Matsusaka and Mumford implies that f is an automorphism of X (see COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 8 [25] exercise 5.6, and [32]). To conclude, note that Aut(X)0 has finite index in the kernel of the action of Aut(X) on NS(X) (see [31, 27]).  2.4. Affine varieties. The group Psaut(Ank ) coincides with the group Aut(Ank ) of polynomial automorphisms of the affine space Ank : this is a special case of the following proposition. Proposition 2.8. Let Z be an affine variety. If Z is factorial, the group Psaut(Z) coincides with the group Aut(Z). Proof. Fix an embedding Z → Am k . Rational functions on Z are restrictions of m rational functions on Ak . Thus, every birational transformation f : Z → Z is given by rational formulas f (x1 , . . . , xm ) = (f1 , . . . , fm ) where each fi is a rational function pi ∈ k(x1 , . . . , xm ); fi = qi here, pi and qi are relatively prime polynomial functions. Since the local rings OZ,x are unique factorization domains, we may assume that the hypersurfaces WZ (pi ) = {x ∈ Z; pi (z) = 0} and WZ (qi ) = {x ∈ Z; qi (z) = 0} have no common components. Then, the generic point of WZ (qi ) is mapped to infinity by f . Since f is a pseudo-isomorphism, WZ (qi ) is in fact empty; but if qi does not vanish on Z, f is a regular map.  3. G ROUPS WITH P ROPERTY (FW) 3.1. Commensurated subsets and cardinal definite length functions (see [11]). Let G be a group, and G × S → S an action of G on a set S. Let A be a subset of S. As in the Introduction, one says that G commensurates A if the symmetric difference A4gA is finite for every element g ∈ G. One says that G transfixes A if there is a subset B of S such that A4B is finite and B is G-invariant: gB = B for every g in G. If A is transfixed, then it is commensurated. Actually, A is transfixed if and only if the function g 7→ #(A4gA) is bounded on G. A group G has Property (FW) if, given any action of G on a set S, all commensurated subsets of S are automatically transfixed. More generally, if H is a subgroup of G, then (G, H) has relative Property (FW) if every commensurating action of G is transfixing in restriction to H. This means that, if G acts on a set S and commensurates a subset A, then H transfixes automatically A. The case H = G is Property (FW) for G. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 9 We refer to [11] for a detailed study of Property (FW). The next paragraphs present the two main sources of examples for groups with Property (FW) or its relative version, namely Property (T) and distorted subgroups. Remark 3.1. Property (FW) should be thought of as a rigidity property. To illustrate this idea, consider a group K with Property (PW); by definition, this means that K admits a commensurating action on a set S, with a commensurating subset C such that the function g 7→ #(C4gC) has finite fibers. If G is a group with Property (FW), then, every homomorphism G → K has finite image. 3.2. Property (FW) and Property (T). One can rephrase Property (FW) as follows: G has Property (FW) if and only if every isometric action on an “integral Hilbert space” `2 (X, Z) has bounded orbits, where X is any discrete set. A group has Property (FH) if all its isometric actions on Hilbert spaces have fixed points. More generally, a pair (G, H) of a group G and a subgroup H ⊂ G has relative Property (FH) if every isometric G-action on a Hilbert space has an H-fixed point. Thus, the relative Property (FH) implies the relative Property (FW). By a theorem of Delorme and Guichardet, Property (FH) is equivalent to Kazhdan’s Property (T) for countable groups (see [13]). Thus, Property (T) implies Property (FW). Kazhdan’s Property (T) is satisfied by lattices in semisimple Lie groups all of whose simple factors have Property (T), for instance if all simple factors have real rank ≥ 2. For example, SL 3 (Z) satisfies Property (T). Property (FW) is actually conjectured to hold for all irreducible lattices in semisimple Lie groups of real rank ≥ 2, such as SL 2 (R)k for k ≥ 2. (here, irreducible means that the projection of the lattice modulo every simple factor is dense.) This is known in the case of a semisimple Lie group admitting at least one noncompact simple factor with Kazhdan’s Property (T), for instance in SO (2, 3) × SO (1, 4), which admits irreducible lattices (see [12]). 3.3. Distortion. Let G be a group. An element g of G is distorted in G if there exists a finite subset Σ of G generating a subgroup hΣi containing g, such that limn→∞ n1 |g n |Σ = 0; here, |g|Σ is the length of g with respect to the set Σ. If G is finitely generated, this condition holds for some Σ if and only if it holds for every finite generating subset of G. For example, every finite order element is distorted. Example 3.2. Let K be a field. The distorted elements of SL n (K) are exactly the virtually unipotent elements, that is, those elements whose eigenvalues are all roots of unity; in positive characteristic, these are elements of finite order. By results of COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 10 Lubotzky, Mozes, and Raghunathan (see [29, 28]), the same characterization holds √ in the group SL n (Z), as soon as n ≥ 3; it also holds in SL n (Z[ d]) when n ≥ 2 and d ≥ 2 is not a perfect square. In contrast, in SL 2 (Z), every element of infinite order is undistorted. Lemma 3.3 (see [11]). Let G be a group, and H a finitely generated abelian subgroup of G consisting of distorted elements. Then, the pair (G, H) has relative Property (FW). This lemma provides many examples. For instance, if G is any finitely generated nilpotent group and G0 is its derived subgroup, then (G, G0 ) has relative Property (FH); this result is due to Houghton, in a more general formulation encompassing polycyclic groups (see [11]). Bounded generation by distorted unipotent elements can also be used to obtain nontrivial examples of groups with √ Property (FW), including√the above examples SL n (Z) for n ≥ 3, and SL n (Z[ d]). The case of SL 2 (Z[ d]) is particularly interesting because it does not have Property (T). 3.4. Subgroups of PGL 2 (k) with Property (FW). If a group G acts on a tree T by graph automorphisms, then G acts on the set E of directed edges of T (T is non-oriented, so each edge gives rise to a pair of opposite directed edges). Let Ev be the set of directed edges pointing towards a vertex v. Then Ev 4Ew is the set of directed edges lying in the segment between v and w; it is finite of cardinality 2d(v, w), where d is the graph distance. The group G commensurates the subset Ev for every v, and #(Ev 4gEv ) = 2d(v, gv). As a consequence, if G has Property (FW), then it has Property (FA) in the sense that every action of G on a tree has bounded orbits. This argument can be combined with Proposition 5.B.1 of [11] to obtain the following lemma. Lemma 3.4 (See [11]). Let G be a group with Property (FW), then all finite index subgroups of G have Property (FW), and hence have Property (FA). Conversely, if a finite index subgroup of G has Property (FW), then so does G. On the other hand, Property (FA) is not stable by taking finite index subgroups. Lemma 3.5. Let k be an algebraically closed field and Λ be a subgroup of GL 2 (k). (1) Λ has a finite orbit on the projective line if and only if it is virtually solvable, if and only if its Zariski closure does not contain SL 2 . (2) Assume that all finite index subgroups of Λ have Property (FA) (e.g., Λ has Property FW). If the action of Λ on the projective line preserves a nonempty, finite set, then Λ is finite. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 11 The proof of the first assertion is standard and omitted. The second assertion follows directly from the first one. In what follows, we denote by Z ⊂ Q the ring of algebraic integers (in some fixed algebraic closure Q of Q). Theorem 3.6 (Bass [2]). Let k be an algebraically closed field. (1) If k has positive characteristic, then GL 2 (k) has no infinite subgroup with Property (FA). (2) Suppose that k has characteristic zero and that Γ ⊂ GL 2 (k) is a countable subgroup with Property (FA), and is not virtually abelian. Then Γ acts irreducibly on k2 , and is conjugate to a subgroup of GL 2 (Z). If moreover Γ ⊂ GL 2 (K) for some subfield K ⊂ k containing Q, then we can choose the conjugating matrix to belong to GL 2 (K). On the proof. The original statement [2, Theorem 6.5] yields this statement, except the last fact, and assumes that Γ is contained in GL 2 (M ) with M a finitely generated field. The latter condition is actually automatic: indeed, being a countable group with Property (FA), Γ is finitely generated [35, §6, Th. 15], and one can choose K to be the field generated by entries of a finite generating subset. For the last assertion, we have Γ ∪ BΓB −1 ⊂ GL 2 (K) for some B ∈ GL 2 (k) such that BΓB −1 ⊂ GL 2 (Z); we claim that this implies that B ∈ k∗ GL 2 (K). First, since Γ is absolutely irreducible, this implies that BM2 (K)B −1 ⊂ M2 (K). The conclusion follows from Lemma 3.7 below, which can be of independent interest.  Lemma 3.7. Let K ⊂ L be fields. Then the normalizer {B ∈ GL 2 (L) : BM2 (K)B −1 ⊂ M2 (K)} is reduced to L∗ GL 2 (K) = {λA : λ ∈ L∗ , A ∈ GL 2 (K)}. Proof. Write   b 1 b2 B= . b3 b4 Since BAB −1 ∈ M2 (K) for the three elementary matrices A ∈ {E11 , E12 , E21 }, we deduce by a plain computation that bi bj /bk b` ∈ K for all 1 ≤ i, j, k, ` ≤ 4 such that bk b` 6= 0. In particular, for all indices i and j such that bi and bj are nonzero, the quotient bi /bj = bi bj /b2j belongs to K. It follows that B ∈ L∗ GL 2 (K).  Corollary 3.8. Let k be an algebraically closed field. Let C be a projective curve over k, and let k(C) be the field of rational functions on the curve C. Let Γ be an infinite subgroup of PGL 2 (k(C)). If Γ has Property (FA), then COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 12 (1) the field k has characteristic 0; (2) there is an element of PGL 2 (k(C)) that conjugates Γ to a subgroup of PGL 2 (Z) ⊂ PGL 2 (k(C)).  4. A CATEGORAL LIMIT CONSTRUCTION The purpose of this section is to describe a general categorical construction, which can be used to construct various actions of groups of birational transformations, such as Manin’s construction of the Picard-Manin space (see [30, 8]), as well as the commensurating action which is the main construction of this paper. A closely related construction is performed by V. Jones in [24] to construct representations of Thompson’s groups, although it does not directly apply here. 4.1. Categories of projective varieties. Here, in a category C, arrows between any two objects X and Y are assumed to form a set HomC (X, Y ). Recall that a category is small if its objects form a set, and is essentially small if it is equivalent to a small category, or equivalently if there is a subset of the collection of objects meeting every isomorphism class. A subcategory C of a category D is full if all arrows of D between objects of C are also arrows of C. Example 4.1. Our main example will be the following. Fix an algebraically closed field k. Let V = Vk be the category whose objects are irreducible (reduced) projective k-varieties and whose arrows are birational morphisms. Let V ] be the category with the same objects, but whose arrows are birational maps. Similarly, one can consider the category VN of irreducible (reduced) normal projective varieties, with arrows given by birational morphisms, and the category VN ] with the same objects but whose arrows are all birational maps. By construction, VN is a full subcategory of V, which is a subcategory of V ] . 4.2. Relative thinness and well-cofiltered categories. Given a category C and an object X ∈ Ob(C), let us define the category CX whose objects are pairs (Y, f ) with Y ∈ Ob(C) and f ∈ HomC (Y, X), and whose arrows (Y, f ) → (Z, g) are given by arrows u ∈ HomC (Y, Z) such that g ◦ u = f . A category is thin if there is at most one arrow between any two objects. Let us say that a category is relatively thin if the category CX is thin for all X ∈ Ob(X). Example 4.2. A category in which every arrow is invertible is relatively thin, and so are all its subcategories. This applies to the categories of Example 4.1: the category Vk] of birational maps between irreducible projective varieties, and to its subcategory Vk , and similarly to VN ]k and its subcategory VN k . COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 13 Recall that a category is cofiltered if it satisfies the following two properties (a) and (b): (a) for any pair of objects X1 , X2 , there exists an object Y with arrows X1 ← Y → X2 ; (b) for any pair of objects X, Y and arrows u1 , u2 : X → Y , there exists an object W and an arrow w : W → X such that u1 ◦ w = u2 ◦ w. Note that (b) is automatically satisfied when the category is thin. We say that a category C is well-cofiltered if it is relatively thin and for every object X ∈ Ob(C), the category CX is cofiltered (note that we do not require C to be cofiltered). Example 4.3. Coming again to the categories of Example 4.1, the category Vk is essentially small and well-cofiltered. It is relatively thin, as mentioned in Example 4.2. To show that (Vk )X is cofiltered, consider two birational morphisms f1 : X1 → X and f2 : X2 → X, and denote by h the composition f2−1 ◦ f1 . The graph Gh is a projective subvariety of X1 × X2 . One can compose the projection of Gh onto X1 with f1 (resp. onto X2 with f2 ) to get a birational morphism Gh → X; this birational morphism is an object in (Vk )X that dominates f1 : X1 → X and f2 : X2 → X, as in property (a). The full subcategory VN k of Vk enjoys the same properties. When k has characteristic zero, the resolution of indeterminacies implies that its full subcategory of non-singular varieties (and birational morphisms) is also well-cofiltered. 4.3. Filtering inductive limits. 4.3.1. We shall say that a category E admits filtering inductive limits if for every small, thin and cofiltered category D and every contravariant functor F : D → E, the colimit of F exists (and then it also exists when “small” is replaced with “essentially small”). For example, the category of sets and the category of groups admit filtering inductive limits (see [36], § 1.4, for colimits). 4.3.2. Let us consider an essentially small category C, a category E admitting filtering inductive limits, and a contravariant functor F : C → E; we denote the functor F by X 7→ FX on objects and u 7→ Fu on arrows. Assume that C is wellcofiltered. Then, for every object X ∈ Ob(C), we can restrict the functor F to CX and take the colimit F̃X of this restriction F : CX → E. Roughly speaking, F̃X is the inductive limit in E of all FY for Y ∈ CX . So, for every arrow u : Y → X in C, there is an arrow in E, φu : FY → F̃X in E; and for every arrow v : Z → Y in CX , COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 14 the following diagram commutes FO Z Fv FY φu◦v φu / ! F̃X . The colimits F̃X satisfy a universal property. To describe it, consider an object E ∈ Ob(E), together with arrows ψY : FY → E for all Y ∈ CX , and assume that for every arrow v : Z → Y in CX we have the relation ψZ ◦ Fv = ψY . Then, there exists a unique arrow ψ : F̃X → E in E such that for every (Y, u) ∈ Ob(CX ) the following diagram commutes: F̃X O ψ Fu / >E ψY FY . This construction provides a bijection ΦX from the inductive limit lim ←−Y ∈CX HomE (FY , E) to Hom(F̃X , E) whose reciprocal bijection maps an element ψ ∈ Hom(F̃X , E) to the family of arrows (ψ ◦ Fu )(Y,u)∈CX . 4.3.3. We can now define the covariant functor α associated to F . At the level of objects, α maps X ∈ Ob(C) to the limit F̃X . Let us now describe α at the level of arrows. If we fix (Y, u) ∈ Ob(CX ), the family of arrows (φu◦v : FZ → F̃X )(Z,v)∈Ob(CY ) corresponds under ΦY to an arrow αu : F̃Y → F̃X . For every (Z, v) ∈ Ob(CY ), the following diagram commutes F̃OY φv αu / F̃ = X (4.1) φu◦v FZ , and this characterizes the arrow αu . If (W, w) ∈ CY , the uniqueness readily proves that αu◦w = αu ◦ αw , that is, X 7→ F̃X , u 7→ αu is a covariant functor C → E, denoted α, and called the relative colimit functor associated to F . 4.3.4. Note that the previous diagram can be essentially rewritten in the form of the commutative square on the left of the next equation. The commutative diagram on the right only refers to u; it is obtained by composing the left diagram with the COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 15 map Fu and by using the equalities φv ◦ Fv = φidY and φu ◦ Fu = φidX . αu F̃OY / φv F̃X O Fv / F̃X O φidY φu FZ o αu F̃OY φidX FY o FY (4.2) Fu FX . Lemma 4.4. Suppose that C is well-cofiltered. Then α maps arrows of C to invertible arrows (i.e. isomorphisms) of E. Proof. Fix (Y, u) ∈ CX . The proof consists in constructing a map, and then show that it is the inverse map of αu . Consider (S, s) ∈ Ob(CX ). By assumption, in C we can find a commutative diagram as the one on the left of the following equation; hence, in E we obtain the diagram on the right, where g = φx ◦ Fw by definition. Y o u  Xo x D  s Fx FOY w φx FD O Fw Fu S, / Fs FX / / F̃ = Y g FS . A priori g depends on the choice of (D, x, w); let us show that it only depends on (u, s) and, for that purpose, let us denote g temporarily by g = gD (x, w being implicit). First consider the case of a commutative diagram as the one on the left in the next equation; in E, this diagram induces the diagram depicted on the right, where everything not involving gD or gD0 is commutative. Y `o x x0 q D0 u D Fx FOY Fx0 ~ w ! Fu  v Fq /4 F̃ <D Y φx 0 F a  S, φx FO = D Fw D0 w0 Xo / Fs FX Fw0 / gD ,gD0 FS , Thus, by definition gD0 = φx0 ◦ Fw0 = φx ◦ Fq ◦ Fw0 = φx ◦ Fw = gD . Now consider, more generally two objects D0 and D00 and four arrows forming a diagram in CX : YO o D00 / D0  S; COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 16 we have to show that gD0 = gD00 . Since C is well-cofiltered, CX is thin and cofiltered, and we can complete the previous diagram into the one on the left of the following equation. Since this diagram is in CX which is a thin category, it is commutative; which means that if we complete it with both composite arrows D → Y and both composite arrows D → S, the resulting arrows coincide; the resulting diagram, on the right of the equation, is a commutative one. DO 0 DO 0 Y a } ! D > Y ao S }  D / ! > S  D00 ; D00 ; Using the previous case, we deduce gD0 = gD = gD00 . Thus, we have seen that gD does not depend on the choice of D; we now write it as gu,s . In particular, when S ∈ (CX )Y , we can choose D = S (and w the identity); we thus deduce that gu,s = φx (where s = u ◦ x). x w Consider (T, t) ∈ CS and choose D ∈ Ob(CX ) with Y ← D → T in CX . Then we have the diagram in E FOY Fx / FD O φx Fw FO T gu,s◦t Ft FX Fs / ! / F̃ > Y gu,s FS , where the left rectangle is commutative as well as the upper right triangle; since by definition gu,s = φx ◦ Ft◦w = φx ◦ Fw ◦ Ft = gu,s◦t ◦ Ft , the lower right triangle is also commutative. So the family (gs : FS → F̃Y )(S,s)∈Ob(CX ) defines an element gu : F̃X → F̃Y . Namely, for every (S, s) ∈ Ob(CX ) the following diagram commutes F̃X O φs FS , and gu is characterized by this property. gu / F̃ > Y gu,s COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 17 We now combine this with the map αu , and make use of the same notation as the one in Equations (4.1) and (4.2). When S = Z (so s = u ◦ v, gu,s = φv ), we obtain the commutative diagram. F̃Y a αu / gu F̃X O φs φv / F̃ = Y φv FZ , Since this holds for all (Z, v) ∈ (CX )Y , the universal property of F̃Y implies that gu ◦ αu is the identity of F̃Y . On the other hand, turning back to the notation of the beginning of the proof, both triangles in the following diagram are commutative αu F̃OY φx / F̃O = X φu◦x FD o Fw φs FS ; since gu,s = φx ◦ Fw , this implies that the right triangle of the following diagram is commutative, the left-hand triangle from above also being commutative F̃X a gu / F̃OY αu / F̃ = X gu,s φs φs FS . Since this holds for all (S, s) ∈ CX , by the universal property of F̃X , we obtain that αu ◦ gu is the identity of F̃X . This ends the proof that αu is invertible.  4.4. Good right-localization and extensions. Given a category D with a subcategory C with the same objects, we say that (C, D) is a good right-localization if (i) every arrow u : X → Y in D admits an inverse u−1 : Y → X and (ii) every arrow in D can be decomposed as g ◦ f −1 where f and g are arrows of C. Lemma 4.5. Let (C, D) be a good right-localization. Then C is well-cofiltered. Proof. Clearly any category in which all arrows are invertible is relatively thin. It follows that D and its subcategory C are relatively thin. Now consider a pair of objects (Y, u) and (Z, v) of CX . Then v −1 ◦ u is an arrow of D (because all arrows s t are invertible in D), and it can be decomposed as Y ← W → Z, with s and t arrows of C. By definition v ◦ t = u ◦ s determines an arrow W → X; endowing W with the resulting composite arrow to X, the arrows s and t become arrows in CX .  COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 18 Lemma 4.6. Let (C, D) be a good right-localization, and let E be another category. Consider a (covariant) functor β from C to the category E mapping every arrow to an invertible arrow of E. Then β has a unique extension to a functor from the category D to the category E. Proof. The uniqueness is clear. For the existence, consider an arrow u in D. We wish to map u to β(g) ◦ β(f )−1 , where u = g ◦ f −1 . We have to prove that this does not depend on the choice of (f, g). Thus write u = g1 ◦ f1−1 = g2 ◦ f2−1 . Since CX is well-cofiltered (Lemma 4.5), we can produce a diagram as follows in C, where the left “square” and the whole square are commutative: f1 X` ~ YO 1 h1 g1 Z f2  h2 Y > 2 g2 X2 Then the right square is also commutative: indeed g1 ◦ h1 = (g1 ◦ f1−1 ) ◦ (f1 ◦ h1 ) = (g2 ◦ f2−1 ) ◦ (f2 ◦ h2 ) = g2 ◦ h2 . Then β(g1 ) ◦ β(f1 )−1 = β(g1 ) ◦ β(h1 ) ◦ β(h1 )−1 ◦ β(f1 )−1 = β(g1 ◦ h1 ) ◦ β(f1 ◦ h1 )−1 = β(g2 ◦ h2 ) ◦ β(f2 ◦ h2 )−1 = β(g2 ) ◦ β(h2 ) ◦ β(h2 )−1 ◦ β(f2 )−1 = β(g2 ) ◦ β(f2 )−1 ; hence we can define without ambiguity β(u) = β(g) ◦ β(f )−1 . We have to prove β(v) ◦ β(u) = β(v ◦ u) for any arrows u, v of D. This already holds for u, v arrows of C. Write u = g ◦ f −1 , v = j ◦ h−1 with f , g, h, and j arrows of C. Write h−1 ◦ g = t ◦ s−1 with s, t arrows of C. Then g ◦ s = h ◦ t, so β(g) ◦ β(s) = β(g ◦ s) = β(h ◦ t) = β(h) ◦ β(t), which can be rewritten β(h)−1 ◦ β(g) = β(t) ◦ β(s)−1 . In turn, we get β(v ◦ u) = β(j ◦ h−1 ◦ g ◦ f −1 ) = β(j ◦ t ◦ s−1 ◦ f −1 ) = β(j ◦ t) ◦ β(f ◦ s)−1 = β(j) ◦ β(t) ◦ β(s)−1 ◦ β(f )−1 = β(j) ◦ β(h)−1 ◦ β(g) ◦ β(f )−1 = β(v) ◦ β(u).  Combining Lemmas 4.4, 4.5 and 4.6, we deduce: Proposition 4.7. Consider a good right-localization (C, D) and a category E admitting filtering inductive limits. Let F be a contravariant functor from C to E. Then the relative colimit functor α, defined by X 7→ F̃X = − lim →Y →X F (Y ), u 7→ αu , COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 19 has a unique extension to a covariant functor from D to E.  5. I RREDUCIBLE HYPERSURFACES Let X be a normal projective variety. In this chapter, we make use of the categorical construction of Section 4.3 to define an action of Bir(X) on the set of all irreducible hypersurfaces in all “models” Y → X of X. We also sketch an application to the construction of Picard-Manin spaces in Section 5.5. 5.1. Localizations in categories of projective varieties. Consider the categories V, V ] , VN , and VN ] from examples 4.1 and 4.3. Proposition 5.1. Let k be an algebraically closed field. (1) The categories V and VN are well-cofiltered (as defined in §4.2). (2) The pairs (V, V ] ) (VN , VN ] ) are good right-localizations of categories (as defined in §4.4). Proof. Property (1) follows from Example 4.3. Let us now prove the second property. Clearly, every arrow in V ] is invertible. Let f : X 99K X 0 be a birational g0 g map. The graph Gf is an irreducible variety, both projections X ← Gf → X 0 are g g0 birational morphisms and f = g 0 ◦ g −1 . Since f = g 0 ◦ g −1 with X ← Gf → X 0 , we deduce that (V, V ] ) is a good right-localization. For VN , we only need to compose with the normalization map Y → Gf to get the result (see [36], §9.7).  To spare the reader from going into too much category theory, let us state explicitly Proposition 4.7 in this case: Corollary 5.2. Let E be a category admitting filtering inductive limits. Consider a contravariant functor F from VN to the category E. Then the covariant functor α, ] X 7→ F̃X = − lim →Y →X F (Y ), u 7→ αu has a unique extension to a functor from VN to E.  5.2. The functor of irreducible hypersurfaces. Let us construct the functor to which we will apply Corollary 5.2. For X ∈ V, define Hyp(X) as the set of irreducible and reduced hypersurfaces of X. Proposition 5.3. Let f : Y → X be a birational morphism between two irreducible projective varieties (an arrow in V). (1) The number of T ∈ Hyp(Y ) such that f (T ) is not a hypersurface is finite (these T are precisely the hypersurfaces contracted by f ). COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 20 (2) For every S ∈ Hyp(X), the number of S 0 ∈ Hyp(Y ) such that f (S 0 ) = S is positive and finite. (3) If X is normal, this number is equal to 1, and the unique preimage S 0 of S is the strict transform f ◦ (S) = (f −1 )◦ (S). In particular, S 7→ S 0 = f ◦ (S) is injective and its image has finite complement: this complement Hyp(Y ) r f ◦ (Hyp(X)) is the set of hypersurfaces T that are contracted by f . Proof. Let U ⊂ Y be a Zariski-dense open subset on which f induces an isomorphism onto its image. Let F be the complement of U . (1) If f (T ) is not a hypersurface, then T ⊂ F . So T is one of the irreducible components of F , which leaves finitely many possibilities. (2) Since Y is projective, f is surjective, and hence f (T ) = S, where T = −1 f (S); T is a proper subvariety. Then at least one irreducible component T 0 of T satisfies f (T 0 ) = S, and conversely, every S 0 ∈ Hyp(Y ) such that f (S 0 ) = S has to be an irreducible component of T , hence there are finitely many of them. (3) We now use Theorem 2.1: since X is normal and Y is projective, the indeterminacy set Ind(f −1 ) ⊂ X has codimension ≥ 2. Hence the strict transform (f −1 )◦ (S) of S is well-defined and is equal to f −1 (X r Ind(f −1 ). The total transform of S by f −1 may contain additional components of codimension 1, but all of them are contracted into Ind(f −1 ), which has codimension 2 (hence are not equal to S). This proves that S 0 = (f −1 )◦ (S). Since f (S 0 ) = S, the map f ◦ := (f −1 )◦ is injective. Moreover, by construction, its image is made of hypersurfaces which are not contained in f −1 (Ind(f )). Since every element T ∈ Hyp(Y ) which is not contracted coincides with f ◦ (f (T )), the image of f ◦ is in fact equal to the complement of the set of contracted hypersurfaces.  From Proposition 5.3, the map X 7→ Hyp(X) defines a contravariant functor from VN to the category of sets, mapping an arrow f : Y → X to the (injective) map f ◦ : Hyp(X) → Hyp(Y ). If F denoted the functor Hyp as in Section 4.3, then we would have FX = Hyp(X) ˜ and Ff = f ◦ . For X in the category VN , define Hyp(X) as the filtering inductive limit ˜ Hyp(X) = lim −→Y →X Hyp(Y ). ˜ By construction, X 7→ Hyp(X) is a covariant functor from VN to the category of sets. By Corollary 5.2, it has a unique extension to a functor from VN ] to the ˜ category of sets. The image of an object Y ∈ VN ] is denoted Hyp(Y ), and the COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 21 image of an arrow f : Y 99K Y 0 , that is of a birational map between two normal projective varieties Y and Y 0 , is denoted by f• . By construction, f• is a bijection 0 ˜ ˜ from Hyp(Y ) to Hyp(Y ). For an arrow u in VN , i.e. a birational morphism u : Y → X between two normal projective varieties, we rewrite the commutative square on the right of Equation (4.2) as u• ˜ ˜ Hyp(Y ) ∼ / Hyp(X) O O iY ? Hyp(Y ) o u◦ ? iX ? _ Hyp(X). The two injections iX and iY will simply be viewed as inclusions in what follows. So the bijection u−1 • extends the injection which is given by the strict trans◦ form u . Since the image of u◦ has finite complement, the symmetric difference Hyp(Y )4u−1 • (Hyp(X)) is finite. This latter property passes to inverses and compositions; hence, for every birational map v : X 99K X 0 between normal irreducible projective varieties, the symmetric difference Hyp(X)4v•−1 (Hyp(X 0 )) is finite. To give a more precise statement, let us introduce the following notation: given a birational map v : X 99K X 0 between normal irreducible projective varieties, define exc(v) by exc(v) = # {S ∈ Hyp(X); v contracts S} . This is the number of contracted hypersurfaces S ∈ Hyp(X) by v. Proposition 5.4. Let v : X 99K X 0 be a birational transformation between normal irreducible projective varieties. Let S be an element of Hyp(X). (1) If S ∈ (v −1 )◦ Hyp(X 0 ), then v• (S) = v◦ (S) ∈ Hyp(X 0 ). (2) If S ∈ / (v −1 )◦ Hyp(X 0 ), then v◦ (S) has codimension ≥ 2 (i.e. v contracts 0 ˜ S), and v• (S) is an element of Hyp(X ) r Hyp(X 0 ). (3) The symmetric difference v• (Hyp(X))4Hyp(X 0 ) contains exc(v)+exc(v −1 ) elements. Proof. Let U be the complement of Ind(v) in X 0 . Since, by Theorem 2.1, Ind(v) has codimension ≥ 2, no S ∈ Hyp(X) is contained in Ind(v). Let us prove (1). When v is a birational morphism the assertion follows from Proposition 5.3. To deal with the general case, write v = g ◦ f −1 where f : Y → X and g : Y → X 0 are birational morphisms from a normal variety Y . Since f is a birational morphism, f • (S) = f ◦ (S) ⊂ Hyp(Y ); since S is not contracted by v, g• (f ◦ (S)) = g◦ (f ◦ (S)) ∈ Hyp(X 0 ). Thus, v• (S) = g• (f • (S)) coincides with the strict transform v◦ (S) ∈ Hyp(X 0 ). COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 22 Now let us prove (2), assuming thus that S ∈ / (v −1 )◦ Hyp(X 0 ). Let S 00 ∈ Hyp(Y ) be the hypersurface (f −1 )• (S) = (f −1 )◦ (S). Then f (S 00 ) = S. If g◦ (S 00 ) is a hypersurface S 0 , then (v −1 )◦ (S 0 ) = S, contradicting S ∈ / (v −1 )◦ Hyp(X 0 ). Thus, g contracts S 00 onto a subset S 0 ⊂ X 0 of codimension ≥ 2. Since S 0 = v◦ (S), assertion (2) is proved. Assertion (3) follows from the previous two assertions.  Example 5.5. Let g be a birational transformation of Pnk of degree d, meaning that g ∗ (H) ' dH where H denotes a hyperplane of Pnk , or equivalently that g is defined by n + 1 homogeneous polynomials of the same degree d without common factor of positive degree. The exceptional set of g has degree (n+1)(d−1); as a consequence, excPnk (g) ≤ (n+1)(d−1). More generally, if H is a polarization of X, then excX (g) is bounded from above by a function that depends only on the degree degH (g) := (g ∗ H) · H dim(X)−1 . ˜ 5.3. Action of Bir(X) on Hyp(X). Let us now restrict the functor f 7→ f• to the elements of Bir(X). The existence of this functor and Proposition 5.4 give the following theorem. Theorem 5.6. Let X be a normal projective variety. The group Bir(X) acts faith˜ fully by permutations on the set Hyp(X) via the homomorphism  ˜ Bir(X) → Perm(Hyp(X)) g 7→ g• ˜ This action commensurates the subset Hyp(X) of Hyp(X): for every g ∈ Bir(X), |g• (Hyp(X))4Hyp(X)| = exc(g) + exc(g −1 ). The only thing that has not been proven yet is the fact that the homomorphism ˜ f ∈ Bir(X) 7→ Perm(Hyp(X)) is injective. But the kernel of this homomorphism is made of birational transformations f such that f◦ (W ) = W for every irreducible hypersurface W of X. Since X is projective, one can embed X in some projective space Pm k ; then, every point of X(k) is the intersection of finitely many irreducible hyperplane sections of X: since all these sections are fixed by f , every point is fixed by f , and f is the identity. 5.4. Products of varieties. Let X, Y be irreducible, normal projective varieties. We consider the natural embedding of Bir(X) into Bir(X × Y ), given by the birational action f · (x, y) = (f (x), y), f ∈ Bir(X). There is a natural injection jY of Hyp(X) into Hyp(X × Y ), given by S 7→ S × Y , which naturally extends to an COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 23 ˜ ˜ injection of Hyp(X) into Hyp(X × Y ); this inclusion is Bir(X)-equivariant. The following proposition will be applied to Corollary 6.7. Proposition 5.7. Let a group Γ act on X by birational transformations. Then Γ ˜ ˜ transfixes Hyp(X) in Hyp(X) if and only if it transfixes Hyp(X ×Y ) in Hyp(X ×Y ). More precisely, the subset Hyp(X × Y ) r jY (Hyp(X)) is Bir(X)-invariant. Proof. The reverse implication is immediate, since any restriction of a transfixing action is transfixing. The direct implication follows from the latter statement, which we now prove. Consider S ∈ Hyp(X × Y ) r jY (Hyp(X)). This means that S is an irreducible hypersurface of X × Y whose projection to X is surjective. Now, for γ ∈ Bir(X), γ induces an isomorphism between open dense subset U, V of X, and hence between U × Y and V × Y ; in particular, γ does not contract S. This shows that γ stabilizes Hyp(X × Y ) r jY (Hyp(X)).  5.5. Manin’s construction. Instead of looking at the functor X 7→ Hyp(X) from the category of normal projective varieties to the category of sets, one can consider the Néron-Severi functor X 7→ NS(X) from the category of smooth projective varieties to the category of abelian groups. In characteristic zero, or for surfaces in arbitrary characteristic, the resolution of singularities shows that smooth projective varieties, together with birational morphisms, form a good right localization of the category of smooth projective varieties with birational maps between them. Thus, one ˜ can construct a functor, the relative colimit of Néron-Severi groups, X 7→ NS(X) ˜ ˜ that maps birational maps X 99K Y to group isomorphisms NS(X) → NS(Y ). In dimension 2, this construction is known as the Picard-Manin space (see [8, 30]). One may also replace NS(X) by other cohomology groups if they behave contravariantly with respect to birational morphisms (see [7] for instance). 6. P SEUDO - REGULARIZATION OF BIRATIONAL TRANSFORMATIONS ˜ In this section, we make use of the action of Bir(X) on Hyp(X) to characterize and study groups of birational transformations that are pseudo-regularizable, in the sense of Definition 1.1. As before, k is an algebraically closed field. 6.1. An example. Consider the birational transformation f (x, y) = (x + 1, xy) of P1k × P1k . The vertical curves Ci = {x = −i}, i ∈ Z, are exceptional curves for the cyclic group Γ = hf i: each of these curves is contracted by an element of Γ onto a point, namely f◦i+1 (Ci ) = (1, 0). Let ϕ : Y 99K P1k × P1k be a birational map, and let U be a non-empty open subset of Y . Consider the subgroup ΓY := ϕ−1 ◦ Γ ◦ ϕ of Bir(Y ). If i is large enough, COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 24 ϕ◦−1 (Ci ) is an irreducible curve Ci0 ⊂ Y , and these curves Ci0 are pairwise distinct, so that most of them intersect U. For positive integers m, f i+m maps Ci onto (m, 0), and (m, 0) is not an indeterminacy point of ϕ−1 if m is large. Thus, ϕ−1 ◦ f m ◦ ϕ contracts Ci0 , and ϕ−1 ◦ f m ◦ ϕ is not a pseudo-automorphism of U. This argument proves the following lemma. Lemma 6.1. Let X be the surface P1k ×P1k . Let f : X 99K X be defined by f (x, y) = (x + 1, xy), and let Γ be the subgroup generated by f ` , for some ` ≥ 1. Then the cyclic group Γ is not pseudo-regularizable. This shows that Theorem A requires an assumption on the group Γ. More generally, consider a subgroup Γ ⊂ Bir(X) such that Γ (a) contracts a family of hypersurfaces Wi ⊂ X whose union is Zariski dense (b) the union of the family of strict transforms f◦ (Wi ), for f ∈ Γ contracting Wi , form a subset of X whose Zariski closure has codimension at most 1. Then, Γ cannot be pseudo-regularized. 6.2. Characterization of pseudo-Isomorphisms. Recall that f• denotes the bi0 ˜ ˜ jection Hyp(X) → Hyp(X ) which is induced by a birational map f : X 99K X 0 . Also, for any nonempty open subset U ⊂ X, we define Hyp(U ) = {H ∈ Hyp(X) : H ∩ U 6= ∅}; it has finite complement in Hyp(X). Proposition 6.2. Let f : X 99K X 0 be a birational map between normal projective varieties. Let U ⊂ X and U 0 ⊂ X 0 be two dense open subsets. Then, f induces a pseudo-isomorphism U → U 0 if and only if f• (Hyp(U )) = Hyp(U 0 ). Proof. If f restricts to a pseudo-isomorphism U → U 0 , then f maps every hypersurface of U to a hypersurface of U 0 by strict transform. And (f −1 )◦ is an inverse for f◦ : Hyp(U ) → Hyp(U 0 ). Thus, f• (Hyp(U )) = f◦ (Hyp(U ) = Hyp(U 0 ). Let us now assume that f• (Hyp(U )) = Hyp(U 0 ). Since X and X 0 are normal, Ind(f ) and Ind(f −1 ) have codimension ≥ 2 (Theorem 2.1). Let fU,U 0 be the birational map from U to U 0 which is induced by f . The indeterminacy set of fU,U 0 is contained in the union of the set Ind(f ) ∩ U and the set of points x ∈ U r Ind(f ) which are mapped by f in the complement of U 0 ; this second part of Ind(fU,U 0 ) has codimension 2, because otherwise there would be an irreducible hypersurface W in U which would be mapped in X 0 r U 0 , contradicting the equality f• (Hyp(U )) = Hyp(U 0 ). Thus, the indeterminacy set of fU,U 0 has codimension ≥ 2. Changing f in its inverse f −1 , we see that the indeterminacy set of fU−10 ,U : U 0 99K U 0 has codimension ≥ 2 too. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 25 If fU,U 0 contracted an irreducible hypersurface W ⊂ U onto a subset of U 0 of codimension ≥ 2, then f• (W ) would not be contained in Hyp(U 0 ) (it would corre0 ˜ spond to an element of Hyp(X )rHyp(X 0 ) by Proposition 5.4). Thus, fU,U 0 satisfies the first property of Proposition 2.4 and, therefore, is a pseudo-isomorphism.  6.3. Characterization of pseudo-regularization. Let X be a (irreducible, reduced) normal projective variety. Let Γ be a subgroup of Bir(X). Assume that the action ˜ ˜ of Γ on Hyp(X) fixes (globally) a subset A ⊂ Hyp(X) such that |A4Hyp(X)| < +∞. In other words, A is obtained from Hyp(X) by removing finitely many hypersur˜ faces Wi ∈ Hyp(X) and adding finitely many hypersurfaces Wj0 ∈ Hyp(X) r 0 Hyp(X). Each Wj comes from an irreducible hypersurface in some model πj : Xj → X, and there is a model π : Y → X that covers all of them (i.e. π ◦ πj−1 is a morphism from Y to Xj for every j). Then, π ◦ (A) is a subset of Hyp(Y ). Changing X into Y , A into π ◦ (A), and Γ into π −1 ◦ Γ ◦ π, we may assume that (1) A = Hyp(X) r {E1 , . . . , E` } where the Ei are ` distinct irreducible hypersurfaces of X, ˜ (2) the action of Γ on Hyp(X) fixes the set A. In what follows, we denote by U the non-empty Zariski open subset X r ∪i Ei and by ∂X the boundary X r U = E1 ∪ · · · ∪ E` ; ∂X is considered as the boundary of the compactification X of U. Lemma 6.3. The group Γ acts by pseudo-automorphisms on the open subset U. If U is smooth and there is an ample divisor D whose support coincides with ∂X, then Γ acts by automorphisms on U. In this statement, we say that the support of a divisor D coincides with ∂X if P D = i ai Ei with ai > 0 for every 1 ≤ i ≤ `. Proof. Since A = Hyp(U) is Γ-invariant, Proposition 6.2 shows that Γ acts by pseudo-automorphisms on U. Since D is an ample divisor, some positive multiple mD is very ample, and the complete linear system |mD| provides an embedding of X in a projective space. The divisor mD corresponds to a hyperplane section of X in this embedding, and the open subset U is an affine variety because the support of D is equal to ∂X. Proposition 2.8 concludes the proof of the lemma.  ˜ By Theorem 5.6, every subgroup of Bir(X) acts on Hyp(X) and commensu˜ rates Hyp(X). If Γ transfixes Hyp(X), there is an invariant subset A of Hyp(X) COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 26 for which A4Hyp(X) is finite. Thus, one gets the following characterization of pseudo-regularizability (the converse being immediate). Theorem 6.4. Let X be a normal projective variety over an algebraically closed field k. Let Γ be a subgroup of Bir(X). Then Γ transfixes the subset Hyp(X) of ˜ Hyp(X) if and only if Γ is pseudo-regularizable. Of course, this theorem applies directly when Γ ⊂ Bir(X) has property (FW) because Theorem 5.6 shows that Γ commensurates Hyp(X). Remark 6.5. Assuming char(k) = 0, we may work in the category of smooth varieties (see Example 4.3 and § 5.5). As explained in Remark 1.2 and Lemma 6.3, there are two extreme cases, corresponding to an empty or an ample boundary B = ∪i Ei . If U = Y , Γ acts by pseudo-automorphisms on the projective variety Y . As explained in Theorem 2.7, Γ is an extension of a subgroup of GL (NS(Y )) by an algebraic group (which is almost contained in Aut(Y )0 ). If U is affine, Γ acts by automorphisms on U. The group Aut(U) may be huge (for instance if U is the affine space), but there are techniques to study groups of automorphisms that are not available for birational transformations. For instance Γ is residually finite and virtually torsion free if Γ is a group of automorphisms generated by finitely many elements (see [3]). 6.4. Distorted elements. Theorem 6.4 may be applied when Γ has Property (FW), or for pairs (Λ, Γ) with relative Property (FW). Here is one application: Corollary 6.6. Let X be an irreducible projective variety. Let Γ be a distorted cyclic subgroup of Bir(X). Then Γ is pseudo-regularizable. The contraposition is useful to show that some elements of Bir(X) are undistorted. Let us state it in a strong “stable” way. Corollary 6.7. Let X be a normal irreducible projective variety and let f be an element of Bir(X) such that the cyclic group hf i does not transfix Hyp(X) (i.e., f is not pseudo-regularizable). Then the cyclic subgroup hf i is undistorted in Bir(X), and more generally for every irreducible projective variety, the cyclic subgroup hf × IdY i is undistorted in Bir(X × Y ). The latter consequence indeed follows from Proposition 5.7. This can be applied to various examples, such as those in Example 7.9. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 27 7. I LLUSTRATING RESULTS 7.1. Surfaces whose birational group is transfixing. If X is a projective curve, Bir(X) always transfixes Hyp(X), since it acts by automorphisms on a smooth model of X. We now consider the same problem for surfaces, starting with the following result, which holds in arbitrary dimension. Proposition 7.1. Let X be a normal irreducible variety of positive dimension over an algebraically closed field k. Then Bir(X × P1 ) does not transfix Hyp(X × P1 ). Proof. We can suppose that X is affine and work in the model X × A1 . For ϕ a nonzero regular function on X, define a regular self-map f of X × A1 by f (x, t) = (x, ϕ(x)t). Denoting by Z(ϕ) the zero set of ϕ, we remark that f induces an automorphism of the open subset (X r Z(ϕ)) × A1 . In particular, it induces a permutation of Hyp((X r Z(ϕ)) × A1 ). Moreover, since f contracts the complement Z(ϕ) × A1 to the subset Z(ϕ) × {0}, which has codimension ≥ 2, its action ˜ on Hyp(X × A1 ) maps the set of codimension 1 components of Z(ϕ) × A1 outside M = Hyp(X × A1 ). Therefore M r f −1 (M ) is the set of irreducible components of Z(ϕ) × A1 . Its cardinal is equal to the number of irreducible components of Z(ϕ). When ϕ varies, this number is unbounded; hence, Bir(X × A1 ) does not transfix Hyp(X × A1 ).  Varieties that are birational to the product of a variety and the projective line are said to be ruled. Proposition 7.1 states that for any ruled irreducible projective variety Y of dimension ≥ 2, Bir(Y ) does not transfix Hyp(Y ). The converse holds for surfaces, by the following theorem. Theorem 7.2. Let k be an algebraically closed field. Let X be an irreducible normal projective surface over k. The following are equivalent: (1) (2) (3) (4) Bir(X) does not transfix Hyp(X); the Kodaira dimension of X is −∞; X is ruled; there is no irreducible projective surface Y that is birationally equivalent to X, and such that Bir(Y ) = Aut(Y ). Proof. The equivalence between (2) and (3) is classical (see [1]). The group Aut(Y ) ˜ fixes Hyp(Y ) ⊂ Hyp(Y ), hence (1) implies (4). If the Kodaira dimension of X is ≥ 0, then X has a unique minimal model X0 , and Bir(X0 ) = Aut(X0 ). Thus, (4) implies (2). Finally, Proposition 7.1 shows that (3) implies (1).  COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 28 Theorem 7.3. Let X be an irreducible projective surface over an algebraically closed field k. The following are equivalent: (1) some finitely generated subgroup of Bir(X) does not transfix Hyp(X); (2) some cyclic subgroup of Bir(X) does not transfix Hyp(X); (3) • k has characteristic 0, and X is birationally equivalent to the product of the projective line with a curve of genus 0 or 1, or • k has positive characteristic, and X is a rational surface. Example 7.4. Let k be an algebraically closed field that is not algebraic over a finite field. Let t be an element of infinite order in the multiplicative group k∗ . Then the birational transformation g of P2k given, in affine coordinates, by (x, y) 7→ (tx + 1, xy) does not transfix Hyp(P2k ). Indeed, it is easy to show that the hypersurface C = {x = 0} satisfies, for n ∈ Z, f n (C) ∈ Hyp(P2k ) if and only if n ≤ 0. Example 7.5. The example of non-transfixing element in Example 7.4 works under a small restriction on k. Here is an example over an arbitrary algebraically closed field k. Let L and L0 be two lines in P2k intersecting transversally at a point q. Let f be a birational transformation of P2k that contracts L0 onto q and fixes the line L. For instance, in affine coordinates, the monomial map (x, y) 7→ (x, xy) contracts the y-axis onto the origin, and fixes the x-axis. Assume that there is an open neighborhood U of q such that f does not contract any curve in U except the line L0 . Let C be an irreducible curve that intersects L and L0 transversally at q. Then, for every n ≥ 1, the strict transform f◦n (C) is an irreducible curve, and the order of tangency of this curve with L goes to infinity with n. Thus, the degree of f◦n (C) goes to infinity too and the f◦n (C) form an infinite sequence in Hyp(P2k ). Now, assume that C is contracted by f −1 onto a point p, p ∈ / Ind(f ), and p is −1 −m fixed by f . Then, for every m ≥ 1, f• (C) is not in Hyp(P2k ). This shows that the orbit of C under the action of f• intersects Hyp(P2k ) and its complement 2 2 n −m ˜ Hyp(P k ) r Hyp(Pk ) on the infinite sets {f◦ (C) ; n ≥ 1} and {f• (C) ; m ≥ 1}. In particular, f does not transfix Hyp(P2k ). Since such maps exist over every algebraically closed field k, this example shows that property (2) of Theorem 7.3 is satisfied for every rational surface X. Proof. Trivially (2) implies (1). Suppose that (3) holds and let us prove (2). The case X = P1 × P1 is already covered by Lemma 6.1 in characteristic zero, and by the previous example in positive characteristic. The case X = C × P1 in characteristic zero, where C is an elliptic curve, is similar. To see it, fix a point t0 ∈ C and a rational function ϕ on C COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 29 that vanishes at t0 . Then, since k has characteristic zero, one can find a translation s of C of infinite order such that the orbit {sn (t0 ) : n ∈ Z} does not contain any other zero or pole of ϕ (here we use that the characteristic of k is 0). Consider the birational transformation f ∈ Bir(X) given by f (t, x) = (s(t), ϕ(t)x). Let H be the hypersurface {t0 } × C. Then for n ∈ Z, we have (f• )n H ∈ Hyp(X) if and only if n ≤ 0. Hence the action of the cyclic group hf i does not transfix Hyp(X). Let us now prove that (1) implies (3). Applying Theorem 7.2, and changing X to a birationally equivalent surface if necessary, we assume that X = C × P1 for some (smooth irreducible) curve C. We may now assume that the genus of C is ≥ 2, or ≥ 1 in positive characteristic, and we have to show that every finitely generated group Γ of Bir(X) transfixes Hyp(X). Since the genus of C is ≥ 1, the group Bir(X) preserves the fibration X → C; this gives a surjective homomorphism Bir(X) → Aut(C). Now let us fully use the assumption on C: if its genus is ≥ 2, then Aut(C) is finite; if its genus is 1 and k has positive characteristic, then Aut(C) is locally finite1, and in particular the projection of Γ on Aut(C) has a finite image. Thus the kernel of this homomorphism intersects Γ in a finite index subgroup Γ0 . It now suffices to show that Γ0 transfixes Hyp(X). Every f ∈ Γ0 has the form f (t, x) = (t, ϕt (x)) for some rational map t 7→ ϕt from C to PGL 2 ; define Uf ⊂ C as the open and dense subset on which ϕγ is regular: by definition, f restricts to an automorphism of Uf × P1 . Let S be a finite generating subset of Γ0 , and let US be the intersection of the open subsets Ug , for g ∈ S. Then Γ0 acts by automorphisms on US × P1 and its action on Hyp(X) fixes the subset Hyp(US ). Hence Γ transfixes Hyp(X).  It would be interesting to obtain characterizations of the same properties in dimension 3 (see Question 11.2). 7.2. Transfixing Jonquières twists. Let X be an irreducible normal projective surface and π a morphism onto a smooth projective curve C with rational connected fibers. Let Birπ (X) be the subgroup of Bir(X) permuting the fibers of π. Since C is a smooth projective curve, the group Bir(C) coincides with Aut(C) and we get a canonical homomorphism rC : Birπ (X) → Aut(C). The main examples to keep in mind are provided by P1 ×P1 , Hirzebruch surfaces, and C × P1 for some genus 1 curve C, π being the first projection. Let Hypπ (X) denote the set of irreducible curves which are contained in fibers ˜ π (X) = Hypπ (X) t (Hyp(X) ˜ ˜ of π, and define Hyp r Hyp(X)), so that Hyp(X) = 1 Every finitely generated subgroup is finite. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 30 ˜ π (X) t (Hyp(X) r Hypπ (X)). An irreducible curve H ⊂ X is an element of Hyp Hyp(X) r Hypπ (X) if and only if its projection π(H) coincides with C; this curves are said to be transverse to π. ˜ ˜ π (X) t (Hyp(X) r Hypπ (X)) Proposition 7.6. The decomposition Hyp(X) = Hyp is Birπ (X)-invariant. Proof. Let H ⊂ X be an irreducible curve which is transverse to π. Since Birπ (X) acts by automorphisms on C, H can not be contracted by any element of Birπ (X); more precisely, for every g ∈ Birπ (X), g• (H) is an element of Hyp(X) which is transverse to π. Thus the set of transverse curves is Birπ (X)-invariant.  This proposition and the proof of Theorem 7.3 lead to the following corollary. Corollary 7.7. Let G be a subgroup of Birπ (X). If π maps the set of indeterminacy points of the elements of G into a finite subset of C, then G transfixes Hyp(X). In the case of cyclic subgroups, we establish a converse under the mild assumption of algebraic stability. Recall that a birational transformation f of a smooth projective surface is algebraically stable if the forward orbit of Ind(f −1 ) does not intersect Ind(f ). By [14], given any birational transformation f of a surface X, there is a birational morphism u : Y → X, with Y a smooth projective surface, such that fY := u−1 ◦ f ◦ u is algebraically stable. If π : X → C is a fibration, as above, and f is in Birπ (X), then fY preserves the fibration π ◦ u. Thus, we may always assume that X is smooth and f is algebraically stable after a birational conjugacy. Proposition 7.8. Let X be a smooth projective surface, and π : X → C a rational fibration. If f ∈ Birπ (X) is algebraically stable, then f transfixes Hyp(X) if, and only if the orbit of π(Ind(f )) under the action of rC (f ) is finite.  For X = P1 × P1 , the reader can check (e.g., conjugating a suitable automorphism) that the proposition fails without the algebraic stability assumption. Proof. Denote by A ⊂ Aut(C) the subgroup generated by rC (f ). Consider a fiber F ' P1 which is contracted to a point q by f . Then, there is a unique indeterminacy point p of f on F . If the orbit of π(q) under the action of A is infinite, the orbit of q under the action of f is infinite too. Set qn = f n−1 (q) for n ≥ 1 (so that q1 = q); this sequence of points is well defined because f is algebraically stable: for every n ≥ 1, f is a local isomorphism from a neighborhood of qn to a neighborhood ˜ of qn+1 . Then, the image of F in Hyp(X) under the action of f n is an element COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 31 ˜ of Hyp(X) r Hyp(X): it is obtained by a finite number of blow-ups above qn . Since the points qn form an infinite set, the images of F form an infinite subset of ˜ Hyp(X) r Hyp(X). Together with the previous corollary, this argument proves the proposition.  Example 7.9. Consider X = P1 × P1 , with π(x, y) = x (using affine coordinates). Start with fa (x, y) = (ax, xy), for some non-zero parameter a ∈ k. The action of rC (fa ) on C = P1 fixes the images 0 and ∞ of the indeterminacy points of fa . Thus, ˜ fa transfixes Hyp(X) by Corollary 7.7. Now, consider ga (x, y) = (ax, (x + 1)y). Then, the orbit of −1 under multiplication by a is finite if and only if a is a root of unity; thus, if a is not a root of unity, ga does not transfix Hyp(X). Section 6.1 provides more examples of that kind. 8. B IRATIONAL TRANSFORMATIONS OF SURFACES I From now on, we work in dimension 2: X, Y , and Z will be smooth projective surfaces over the algebraically closed field k. (In dimension 2, the resolution of singularities is available in all characteristics, so that we can always assume the varieties to be smooth.) 8.1. Regularization. In this section, we refine Theorem 6.4, in order to apply results of Danilov and Gizatullin. Recall that a curve C in a smooth surface Y has normal crossings if each of its singularities is a simple node with two transverse tangents. In the complex case, this means that C is locally analytically equivalent to {xy = 0} (two branches intersecting transversally) in an analytic neighborhood of each of its singularities. Theorem 8.1. Let X be a smooth projective surface, defined over an algebraically closed field k. Let Γ be a subgroup of Bir(X) that transfixes the subset Hyp(X) of ˜ Hyp(X). There exists a smooth projective surface Z, a birational map ϕ : Z 99K X and a dense open subset U ⊂ Z such that, writing the boundary ∂Z := Z r U as a finite union of irreducible components Ei ⊂ Z, 1 ≤ i ≤ `, the following properties hold: (1) The boundary ∂Z is a curve with normal crossings. (2) The subgroup ΓZ := ϕ−1 ◦ Γ ◦ ϕ ⊂ Bir(Z) acts by automorphisms on the open subset U. (3) For all i ∈ {1, . . . , `} and g ∈ ΓZ , the strict transform of Ei under the action of g on Z is contained in ∂Z: either g◦ (Ei ) is a point of ∂Z or g◦ (Ei ) is an irreducible component Ej of ∂Z. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 32 (4) For all i ∈ {1, . . . , `}, there exists an element g ∈ ΓZ that contracts Ei to a point g◦ (Ei ) ∈ ∂Z. In particular, Ei is a rational curve. (5) The pair (Z, U) is minimal for the previous properties, in the following sense: if one contracts a smooth curve of self-intersection −1 in ∂Z, then the boundary stops to be a normal crossing divisor. Before starting the proof, note that the boundary ∂Z may a priori contain an irreducible rational curve E with a node. Proof. We apply Theorem 6.4 (which works in positive characteristic too, because X is a surface), and get a birational morphism ϕ0 : Y0 → X and an open subset U0 of Y0 that satisfy properties (1) and (3), except that we only know that the action of Γ0 := ϕ−1 0 ◦ Γ ◦ ϕ0 on U0 is by pseudo-automorphisms (not yet by automorphisms). We shall progressively modify the triple (Y0 , U0 , ϕ0 ) to obtain a surface Z with properties (1) to (5). Step 1.– First, we blow-up the singularities of the curve ∂Y0 = Y0 r U0 to get a boundary that is a normal crossing divisor. This replaces the surface Y0 by a new one, still denoted Y0 . This modification adds new components to the boundary ∂Y0 but does not change the fact that Γ0 acts by pseudo-automorphisms on U0 . Let `0 be the number of irreducible components of Y0 r U0 . Step 2.– Consider a point q in U0 , and assume that there is a curve Ei of ∂Y0 that is contracted to q by an element g ∈ Γ0 ; fix such a g, and denote by D the union of the curves Ej such that g◦ (Ej ) = q. By construction, g is a pseudoautomorphism of U0 . The curve D does not intersect the indeterminacy set of g, since otherwise there would be a curve C containing q that is contracted by g −1 . And D is a connected component of ∂Y0 , because otherwise g maps one of the Ej to a curve that intersects U0 . Thus, there are small neighborhoods W of D and W 0 of q such that W ∩ ∂Y0 = D and g realizes an isomorphism from W r D to W 0 r {q}, contracting D onto the smooth point q ∈ Y0 . As a consequence, there is a birational morphism π1 : Y0 → Y1 such that (1) Y1 is smooth (2) π1 contracts D onto a point q1 ∈ Y1 (3) π1 is an isomorphism from Y0 r D to Y1 r {q1 }. In particular, π1 (U0 ) is an open subset of Y1 and U1 = π1 (U0 ) ∪ {q1 } is an open neighborhood of q1 in Y1 . Then, Γ1 := π1 ◦ Γ0 ◦ π1−1 acts birationally on Y1 , and by pseudo-automorphisms on U1 . The boundary ∂Y1 = Y1 r U1 contains `1 irreducible components, with COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 33 `1 < `0 (the difference is the number of components of D), and is a normal crossing divisor because D is a connected component of ∂Y0 . Repeating this process, we construct a sequence of surfaces πk : Yk−1 → Yk and open subsets πk (Uk−1 ) ⊂ Uk ⊂ Yk such that the number of irreducible components of ∂Yk = Yk r Uk decreases. After a finite number of steps (at most `0 ), we may assume that Γk ⊂ Bir(Yk ) does not contract any boundary curve onto a point of the open subset Uk . On such a model, Γk acts by automorphisms on Uk . We fix such a model, which we denote by the letters Y , U, ∂Y , ϕ. The new birational map ϕ : Y 99K X is the composition of ϕ0 with the inverse of the morphism Y0 → Yk . On such a model, properties (1) and (2) are satisfied. Moreover, (3) follows from (2). We now modify Y further to get property (4). Step 3.– Assume that the curve Ei ⊂ Y r U is not contracted by Γ. Let F be the orbit of Ei : F = ∪g∈Γ g◦ (Ei ); this curve is contained in the boundary ∂Y of the open subset U. Changing U into U 0 = U ∪ (F r ∂Y r F ), the group Γ also acts by pseudo-automorphisms on U 0 . This operation decreases the number ` of irreducible components of the boundary. Thus, combining steps 2 and 3 finitely many times, we reach a model that satisfies Properties (1) to (4). We continue to denote it by Y . Step 4.– If the boundary ∂Y contains a smooth (rational) curve Ei of self-intersection −1, it can be blown down to a smooth point q by a birational morphism π : Y → Y 0 ; the open subset U is not affected, but the boundary ∂Y 0 has one component less. If Ei was a connected component of ∂Y , then U 0 = π(U) ∪ {q} is a neighborhood of q and one replaces U by U 0 , as in step 2. Now, two cases may happen. If the boundary ∂Y 0 ceases to be a normal crossing divisor, we come back to Y and do not apply this surgery. If ∂Y 0 has normal crossings, we replace Y by this new model. In a finite number of steps, looking successively at all (−1)-curves and iterating the process, we reach a new surface Z on which all five properties are satisfied.  Remark 8.2. One may also remove property (5) and replace property (1) by (1’) The Ei are rational curves, and none of them is a smooth rational curve with self-intersection −1. But doing so, we may lose the normal crossing property. To get property (1’), apply the theorem and argue as in step 4. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 34 8.2. Constraints on the boundary. We now work on the new surface Z given by Theorem 8.1. Thus, Z is the surface, Γ the subgroup of Bir(Z), U the open subset on which Γ acts by automorphisms, and ∂Z the boundary of U. Proposition 8.3 (Gizatullin, [17] § 4). There are four possibilities for the geometry of the boundary ∂Z = Z r U. (1) (2) (3) (4) ∂Z is empty. ∂Z is a cycle of rational curves. ∂Z is a chain of rational curves. ∂Z is not connected; it is the disjoint union of finitely many smooth rational curves of self-intersection 0. Moreover, in cases (2) and (3), the open subset U is the blow-up of an affine surface. Thus, there are four possibilities for ∂Z, which we study successively. We shall start with (1) and (4) in sections 8.3 and 8.4. Then case (3) is dealt with in Section 8.5. Case (2) is slightly more involved: it is treated in Section 9. Before that, let us explain how Proposition 8.3 follows from Section 5 of [17]. First, we describe the precise meaning of the statement, and then we explain how the original results of [17] apply to our situation. The boundary and its dual graph .– Consider the dual graph GZ of the boundary ∂Z. The vertices of GZ are in one to one correspondence with the irreducible components Ei of ∂Z. The edges correspond to singularities of ∂Z: each singular point q gives rise to an edge connecting the components Ei that determine the two local branches of ∂Z at q. When the two branches correspond to the same irreducible component, one gets a loop of the graph GZ . We say that ∂Z is a chain of rational curves if the dual graph is of type A` : ` is the number of components, and the graph is linear, with ` vertices. Chains are also called zigzags by Gizatullin and Danilov. We say that ∂Z is a cycle if the dual graph is isomorphic to a regular polygon with ` vertices. There are two special cases: when ∂Z is reduced to one component, this curve is a rational curve with one singular point and the dual graph is a loop (one vertex, one edge); when ∂Z is made of two components, these components intersect in two distinct points, and the dual graph is made of two vertices with two edges between them. For ` = 3, 4, . . ., the graph is a triangle, a square, etc. Gizatullin’s original statement.– To describe Gizatullin’s article, let us introduce some useful vocabulary. Let S be a projective surface, and C ⊂ S be a curve; C is a union of irreducible components, which may have singularities. Assume that COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 35 S is smooth in a neighborhood of C. Let S0 be the complement of C in S, and let ι : S0 → S be the natural embedding of S0 in S. Then, S is a completion of S0 : this completion is marked by the embedding ι : S0 → S, and its boundary is the curve C. Following [17] and [18, 19], we only consider completions of S0 by curves (i.e. S rι(S0 ) is of pure dimension 1), and we always assume S to be smooth in a neighborhood of the boundary. Such a completion is (i) simple if the boundary C has normal crossings; (ii) minimal if it is simple and minimal for this property: if Ci ⊂ C is an exceptional divisor of the first kind then, contracting Ci , the image of C is not a normal crossing divisor anymore. Equivalently, Ci intersects at least three other components of C. Equivalently, if ι0 : S0 → S 0 is another simple completion, and π : S → S 0 is a birational morphism such that π ◦ ι = ι0 , then π is an isomorphism. If S is a completion of S0 , one can blow-up boundary points to obtain a simple completion, and then blow-down some of the boundary components Ci to reach a minimal completion. Now, consider the group of automorphisms of the open surface S0 . This group Aut(S0 ) acts by birational transformations on S. An irreducible component Ei of the boundary C is contracted if there is an element g of Aut(S0 ) that contracts Ei : g◦ (Ei ) is a point of C. Let E be the union of the contracted components. In [17], Gizatullin proves that E satisfies one of the four properties stated in Proposition 8.3; moreover, in cases (2) and (3), E contains an irreducible component Ei with Ei2 > 0 (see Corollary 4, Section 5 of [17]). Thus, Proposition 8.3 follows from the properties of the pair (Z, U, Γ): the open subset U plays the role of S0 , and Z is the completion S; the boundary ∂Z is the curve C: it is a normal crossing divisor, and it is minimal by construction. Since every component of ∂Z is contracted by at least one element of Γ ⊂ Aut(U), ∂Z coincides with Gizatullin’s curve E. The only thing we have to prove is the last sentence of Proposition 8.3, concerning the structure of the open subset U. First, let us show that E = ∂Z supports an effective divisor D such that D2 > 0 and D·F ≥ 0 for every irreducible curve. To do so, fix an irreducible component E0 of ∂Z with positive self-intersection. Assume that ∂Z is a cycle, and list cyclically the other irreducible components: E1 , E2 , ..., up to Em , with E1 and Em intersecting E0 . First, one defines a1 = 1. Then, one chooses a2 > 0 such that a1 E1 + a2 E2 intersects positively E1 , then a3 > 0 such that a1 E1 + a2 E2 + a3 E3 intersects P positively E1 and E2 , ..., up to m i=1 ai Ei that intersects all components Ei , 1 ≤ COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 36 i ≤ m − 1 positively. Since E02 > 0 and E0 intersects Em , one can find a coefficient a0 for which the divisor m X D= ai Ei i=0 2 satisfies D > 0 and D · Ei > 0 for all Ei , 0 ≤ i ≤ m. This implies that D intersects every irreducible curve F non-negatively. Thus, D is big and nef (see [26], Section 2.2). A similar proof applies when ∂Z is a zigzag. Let W be the subspace of NS(X) spanned by classes of curves F with D · F = 0. Since D2 > 0, Hodge index theorem implies that the intersection form is negative definite on W . Thus, Mumford-Grauert contraction theorem provides a birational morphism τ : Z → Z 0 that contracts simultaneously all curves F with class [F ] ∈ W and is an isomorphism on Z rF ; in particular, τ is an isomorphism from a neighborhood V of ∂Z onto its image τ (V) ⊂ Z 0 . The modification τ may contract curves that are contained in U, and may create singularities for the new open subset U 0 = τ (U), but does not modify Z near the boundary ∂Z. Now, on Z 0 , the divisor D0 = τ∗ (D) intersects every effecitve curve positively and satisfies (D0 )2 > 0. Nakai-Moishezon criterion shows that D0 is ample (see [26], Section 1.2.B); consequently, there is an embedding of Z 0 into a projective space and a hyperplane section H of Z 0 for which Z 0 r H coincides with U 0 . This proves that U is a blow-up of the affine (singular) surface U 0 . 8.3. Projective surfaces and automorphisms. In this section, we (almost always) assume that Γ acts by regular automorphisms on a projective surface X. This corresponds to case (1) in Proposition 8.3. Our goal is the special case of Theorem B which is stated below as Theorem 8.8. We shall assume that Γ has property (FW) in some of the statements (this was not a hypothesis in Theorem thm:FWregularization-surfaces). We may, and shall, assume that X is smooth. We refer to [1, 4, 20] for the classification of surfaces and the main notions attached to them. 8.3.1. Action on the Néron-Severi group. The intersection form is a non-degenerate quadratic form qX on the Néron-Severi group NS(X), and Hodge index theorem asserts that its signature is (1, ρ(X) − 1), where ρ(X) denotes the Picard number, i.e. the rank of the lattice NS(X) ' Zρ . The action of Aut(X) on the Néron-Severi group NS(X) provides a linear representation preserving the intersection form qX . This gives a morphism Aut(X) → O (NS(X); qX ). COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 37 Fix an ample class a in NS(X) and consider the hyperboloid HX = {u ∈ NS(X) ⊗Z R; qX (u, u) = 1 and qX (u, a) > 0}. This set is one of the two connected components of {u; qX (u, u) = 1}. With the riemannian metric induced by (−qX ), it is a copy of the hyperbolic space of dimension ρ(X) − 1; the group Aut(X) acts by isometries on this space (see [9]). Proposition 8.4. Let X be a smooth projective surface. Let Γ be a subgroup of Aut(X). If Γ has Property (FW), its action on NS(X) fixes a very ample class, the image of Γ in O (NS(X); qX ) is finite, and a finite index subgroup of Γ is contained in Aut(X)0 . Proof. The image Γ∗ of Γ is contained in the arithmetic group O (NS(X); qX ). The Néron-Severi group NS(X) is a lattice Zρ and qX is defined over Z. Thus, O (NS(X); qX ) is a standard arithmetic group in the sense of [6], § 1.1. The main results of [6] imply that the action of Γ∗ on the hyperbolic space HX has a fixed point. Let u be such a fixed point. Since qX is negative definite on the orthogonal complement u⊥ of u in NS(X), and Γ∗ is a discrete group acting by isometries on it, we deduce P that Γ∗ is finite. If a is a very ample class, the sum γ∈Γ∗ γ ∗ (a) is an invariant, very ample class. The kernel K ⊂ Aut(X) of the action on NS(X) contains Aut(X)0 as a finite index subgroup. Thus, if Γ has Property (FW), it contains a finite index subgroup that is contained in Aut(X)0 .  8.3.2. Non-rational surfaces. In this paragraph, we assume that the surface X is not rational. The following proposition classifies subgroups of Bir(X) with Property (FW); in particular, such a group is finite if the Kodaira dimension of X is non-negative (resp. if the characteristic of k is positive). Recall that we denote by Z ⊂ Q the ring of algebraic integers. Proposition 8.5. Let X be a smooth, projective, and non-rational surface, over the algebraically closed field k. Let Γ be an infinite subgroup of Bir(X) with Property (FW). Then k has characteristic 0, and there is a birational map ϕ : X 99K C × P1k that conjugates Γ to a subgroup of Aut(C × P1k ). Moreover, there is a finite index subgroup Γ0 of Γ such that ϕ ◦ Γ0 ◦ ϕ−1 , is a subgroup of PGL 2 (Z), acting on C × P1k by linear projective transformations on the second factor. Proof. Assume, first, that the Kodaira dimension of X is non-negative. Let π : X → X0 be the projection of X on its (unique) minimal model (see [20], Thm. V.5.8). COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 38 The group Bir(X0 ) coincides with Aut(X0 ); thus, after conjugacy by π, Γ becomes a subgroup of Aut(X0 ), and Proposition 8.4 provides a finite index subgroup Γ0 ≤ Γ that is contained in Aut(X0 )0 . Note that Γ0 inherits Property (FW) from Γ. If the Kodaira dimension of X is equal to 2, the group Aut(X0 )0 is trivial; hence Γ0 = {IdX0 } and Γ is finite. If the Kodaira dimension is equal to 1, Aut(X0 )0 is either trivial, or isomorphic to an elliptic curve, acting by translations on the fibers of the Kodaira-Iitaka fibration of X0 (this occurs, for instance, when X0 is the product of an elliptic curve with a curve of higher genus). If the Kodaira dimension is 0, then Aut(X0 )0 is also an abelian group (either trivial, or isomorphic to an abelian surface). Since abelian groups with Property (FW) are finite, the group Γ0 is finite, and so is Γ. We may now assume that the Kodaira dimension kod(X) is negative. Since X is not rational, then X is birationally equivalent to a product S = C × P1k , where C is a curve of genus g(C) ≥ 1. Denote by k(C) the field of rational functions on the curveC. We fix a local coordinate x on C and denote the elements of k(C) as functions a(x) of x. The semi-direct product Aut(C) n PGL 2 (k(C)) acts on S by birational transformations of the form   a(x)y + b(x) 1 , (x, y) ∈ C × Pk 7→ f (x), c(x)y + d(x) and Bir(S) coincides with this group Aut(C) n PGL 2 (k(C)); indeed, the first projection π : S → C is equivariant under the action of Bir(S) because every rational map P1k → C is constant. Since g(C) ≥ 1, Aut(C) is virtually abelian. Property (FW) implies that there is a finite index, normal subgroup Γ0 ≤ Γ that is contained in PGL 2 (k(C)). By Corollary 3.8, every subgroup of PGL 2 (k(C)) with Property (FW) is conjugate to a subgroup of PGL 2 (Z) or a finite group if the characteristic of the field k is positive. We may assume now that the characteristic of k is 0 and that Γ0 ⊂ PGL 2 (Z) is infinite. Consider an element g of Γ; it acts as a birational transformation on the surface S = C × P1k , and it normalizes Γ0 : g ◦ Γ0 = Γ0 ◦ g. Since Γ0 acts by automorphisms on S, the finite set Ind(g) is Γ0 -invariant. But a subgroup of PGL 2 (k) with Property (FW) preserving a non-empty, finite subset of P1 (k) is a finite group. Thus, Ind(g) must be empty. This shows that Γ is contained in Aut(S).  COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 39 8.3.3. Rational surfaces. We now assume that X is a smooth rational surface, that Γ ≤ Bir(X) is an infinite subgroup with Property (FW), and that Γ contains a finite index, normal subgroup Γ0 that is contained in Aut(X)0 . Recall that a smooth surface Y is minimal if it does not contain any smooth rational curve of the first kind, i.e. with self-intersection −1. Every exceptional curve of the first kind E ⊂ X is determined by its class in NS(X) and is therefore invariant under the action of Aut(X)0 . Contracting such (−1)-curves one by one, we obtain the following lemma. Lemma 8.6. There is a birational morphism π : X → Y onto a minimal rational surface Y that is equivariant under the action of Γ0 ; Y does not contain any exceptional curve of the first kind and Γ0 becomes a subgroup of Aut(Y )0 . Let us recall the classification of minimal rational surfaces and describe their groups of automorphisms. First, we have the projective plane P2k , with Aut(P2k ) = PGL 3 (k) acting by linear projective transformations. Then comes the quadric P1k × P1k , with Aut(P1k × P1k )0 = PGL 2 (k) × PGL 2 (k) acting by linear projective transformations on each factor; the group of automorphisms of the quadric is the semidirect product of PGL 2 (k) × PGL 2 (k) with the group of order 2 generated by the permutation of the two factors, η(x, y) = (y, x). Then, for each integer m ≥ 1, the Hirzebruch surface Fm is the projectivization of the rank 2 bundle O ⊕ O(m) over P1k ; it may be characterized as the unique ruled surface Z → P1k with a section C of self-intersection −m. Its group of automorphisms is connected and preserves the ruling. This provides a homomorphism Aut(Fm ) → PGL 2 (k) that describes the action on the base of the ruling, and it turns out that this homomorphism is surjective. If we choose coordinates for which the section C intersects each fiber at infinity, the kernel Jm of this homomorphism acts by transformations of type (x, y) 7→ (x, αy + β(x)) where β(x) is a polynomial function of degree ≤ m. In particular, Jm is solvable. In other words, Aut(Fm ) is isomorphic to the group (GL 2 (k)/µm ) n Wm where Wm is the linear representation of GL 2 (k) on homogeneous polynomials of degree m in two variables, and µm is the kernel of this representation: it is the subgroup of GL 2 (k) given by scalar multiplications by roots of unity of order dividing m. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 40 Lemma 8.7. Given the above conjugacy π : X → Y , the subgroup π ◦ Γ ◦ π −1 of Bir(Y ) is contained in Aut(Y ). Proof. Assume that the surface Y is the quadric P1k × P1k . Then, according to Theorem 3.6, Γ0 is conjugate to a subgroup of PGL 2 (Z) × PGL 2 (Z). If g is an element of Γ, its indeterminacy locus is a finite subset Ind(g) of P1k × P1k that is invariant under the action of Γ0 , because g normalizes Γ0 . Since Γ0 is infinite and has Property (FW), this set Ind(g) is empty (Lemma 3.5). Thus, Γ is contained in Aut(P1k × P1k ). The same argument applies for Hirzebruch surfaces. Indeed, Γ0 is an infinite subgroup of Aut(Fm ) with Property (FW). Thus, up to conjugacy, its projection in PGL 2 (k) is contained in PGL 2 (Z). If it were finite, a finite index subgroup of Γ0 would be contained in the solvable group Jm , and would therefore be finite too by Property (FW); this would contradict |Γ0 | = ∞. Thus, the projection of Γ0 in PGL (Z) is infinite. If g is an element of Γ, Ind(g) is a finite, Γ0 -invariant subset, and by looking at the projection of this set in P1k one deduces that it is empty (Lemma 3.5). This proves that Γ is contained in Aut(Fm ). Let us now assume that Y is the projective plane. Fix an element g of Γ, and assume that g is not an automorphism of Y = P2 ; the indeterminacy and exceptional sets of g are Γ0 invariant. Consider an irreducible curve C in the exceptional set of g, together with an indeterminacy point q of g on C. Changing Γ0 in a finite index subgroup, we may assume that Γ0 fixes C and q; in particular, Γ0 fixes q, and permutes the tangent lines of C through q. But the algebraic subgroup of PGL 3 (k) preserving a point q and a line through q does not contain any infinite group with Property (FW) (Lemma 3.5). Thus, again, Γ is contained in Aut(P2k ).  8.3.4. Conclusion, in Case (1). Putting everything together, we obtain the following particular case of Theorem B. Theorem 8.8. Let X be a smooth projective surface over an algebraically closed field k. Let Γ be an infinite subgroup of Bir(X) with Property (FW). If a finite index subgroup of Γ is contained in Aut(X), there is a birational morphism ϕ : X → Y that conjugates Γ to a subgroup ΓY of Aut(Y ), with Y in the following list: (1) Y is the product of a curve C by P1k , the field k has characteristic 0, and a finite index subgroup Γ0Y of ΓY is contained in PGL 2 (Z), acting by linear projective transformations on the second factor; (2) Y is P1k × P1k , the field k has characteristic 0, and ΓY is contained in PGL 2 (Z) × PGL 2 (Z); (3) Y is a Hirzebruch surface Fm and k has characteristic 0; COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 41 (4) Y is the projective plane P2k . In particular, Y = P2k if the characteristic of k is positive. Remark 8.9. Denote by ϕ : X → Y the birational morphism given by the theorem. Changing Γ in a finite index subgroup, we may assume that it acts by automorphisms on both X and Y . If Y = C × P1 , then ϕ is in fact an isomorphism. To prove this fact, denote by ψ the inverse of ϕ. The indeterminacy set Ind(ψ) is ΓY invariant because both Γ and ΓY act by automorphisms. From Lemma 3.5, applied to Γ0Y ⊂ PGL 2 (k), we deduce that Ind(ψ) is empty and ψ is an isomorphism. The same argument implies that the conjugacy is an isomorphism if Y = P1k × P1k or a Hirzebruch surface Fm , m ≥ 1. Now, if Y is P2k , ϕ is not always an isomorphism. For instance, SL 2 (C) acts on P2k with a fixed point, and one may blow up this point to get a new surface with an action of groups with Property (FW). But this is the only possible example, i.e. X is either P2k , or a single blow-up of P2k (because Γ ⊂ PGL 3 (C) can not preserve more than one base point for ϕ−1 without loosing Property (FW)). 8.4. Invariant fibrations. We now assume that Γ has Property (FW) and acts by automorphisms on U ⊂ X, and that the boundary ∂X = X rU is the union of ` ≥ 2 pairwise disjoint rational curves Ei ; each of them has self-intersection Ei2 = 0 and is contracted by at least one element of Γ. This corresponds to the fourth possibility in Gizatullin’s Proposition 8.3. Since Ei · Ej = 0, the Hodge index theorem implies that the classes ei = [Ei ] span a unique line in NS(X), and that [Ei ] intersects non-negatively every curve. From Section 8.3.2, we may, and do assume that X is a rational surface. In particular, the Euler characteristic of the structural sheaf is equal to 1: χ(OX ) = 1, and Riemann-Roch formula gives E12 − KX · E1 + 1. 2 The genus formula implies KX ·E1 = −2, and Serre duality shows that h2 (X, E1 ) = h0 (X, KX −E1 ) = 0 because otherwise −2 = (KX −E1 )·E1 would be non-negative (because E1 intersects non-negatively every curve). From this, we obtain h0 (X, E1 ) − h1 (X, E1 ) + h2 (X, E1 ) = h0 (X, E1 ) = h1 (X, E1 ) + 2 ≥ 2. Since E12 = 0, we conclude that the space H 0 (X, E1 ) has dimension 2 and determines a fibration π : X → P1k ; the curve E1 , as well as the Ei for i ≥ 2, are fibers of π. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 42 If f is an automorphism of U and F ⊂ U is a fiber of π, then f (F ) is a (complete) rational curve. Its projection π(f (F )) is contained in the affine curve P1k r ∪i π(Ei ) and must therefore be reduced to a point. Thus, f (F ) is a fiber of π and f preserves the fibration. This proves the following lemma. Lemma 8.10. There is a fibration π : X → P1k such that (1) every component Ei of ∂X is a fiber of π, and U = π −1 (V) for an open subset V ⊂ P1k ; (2) the generic component of π is a smooth rational curve; (3) Γ permutes the fibers of π: there is a morphism ρ : Γ → PGL 2 (k) such that π ◦ f = ρ(f ) ◦ π for every f ∈ Γ. The open subset V ( P1k is invariant under the action of ρ(Γ); hence ρ(Γ) is finite by Property (FW) and Lemma 3.5. Let Γ0 be the kernel of this morphism. Let ϕ : X 99K P1k × P1k be a birational map that conjugates the fibration π to the first projection τ : P1k × P1k → P1k . Then, Γ0 is conjugate to a subgroup of PGL 2 (k(x)) acting on P1k × P1k by linear projective transformations of the fibers of τ . From Corollary 3.8, a new conjugacy by an element of PGL 2 (k(x)) changes Γ0 in an infinite subgroup of PGL 2 (Z). Then, as in Sections 8.3.2 and 8.3.3 we conclude that Γ becomes a subgroup of PGL 2 (Z) × PGL 2 (Z), with a finite projection on the first factor. Proposition 8.11. Let Γ be an infinite group with Property (FW), with Γ ⊂ Aut(U), and U ⊂ Z as in case (4) of Proposition 8.3. There exists a birational map ψ : Z 99K P1k × P1k that conjugates Γ to a subgroup of PGL 2 (Z) × PGL 2 (Z), with a finite projection on the first factor. 8.5. Completions by zigzags. Two cases remain to be studied: ∂Z can be a chain of rational curves (a zigzag in Gizatullin’s terminology) or a cycle of rational curves (a loop in Gizatullin’s terminology). Cycles are considered in Section 9. In this section, we rely on difficult results of Danilov and Gizatullin to treat the case of chains of rational curves (i.e. case (3) in Proposition 8.3). Thus, in this section (i) ∂X is a chain of smooth rational curves Ei (ii) U = X r ∂X is an affine surface (singularities are allowed) (iii) every irreducible component Ei is contracted to a point of ∂X by at least one element of Γ ⊂ Aut(U) ⊂ Bir(X). In [18, 19], Danilov and Gizatullin introduce a set of “standard completions” of the affine surface U. As in Section 8.2, a completion (or more precisely a “marked COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 43 completion”) is an embedding ι : U → Y into a complete surface such that ∂Y = Y r ι(U) is a curve (this boundary curve may be reducible). Danilov and Gizatullin only consider completions for which ∂Y is a chain of smooth rational curves and Y is smooth in a neighborhood of ∂Y ; the surface X provides such a completion. Two completions ι : U → Y and ι0 : U → Y 0 are isomorphic if the birational map ι0 ◦ι−1 : Y → Y 0 is an isomorphism; in particular, the boundary curves are identified by this isomorphism. The group Aut(U) acts by pre-composition on the set of isomorphism classes of (marked) completions. Among all possible completions, Danilov and Gizatullin distinguish a class of “standard (marked) completions”, for which we refer to [18] for a definition. There are elementary links (corresponding to certain birational mappings Y 99K Y 0 ) between standard completions, and one can construct a graph ∆U whose vertices are standard completions; there is an edge between two completions if one can pass from one to the other by an elementary link. Example 8.12. A completion is m-standard, for some m ∈ Z, if the boundary curve ∂Y is a chain of n + 1 consecutive rational curves E0 , E1 , . . ., En (n ≥ 1) such that E02 = 0, E12 = −m, and Ei2 = −2 if i ≥ 2. Blowing-up the intersection point q = E0 ∩ E1 , one creates a new chain starting by E00 with (E00 )2 = −1; blowing down E00 , one creates a new (m + 1)-standard completion. This is one of the elementary links. Standard completions are defined by constraints on the self-intersections of the components Ei . Thus, the action of Aut(U) on completions permutes the standard completions; this action determines a morphism from Aut(U) to the group of isometries (or automorphisms) of the graph ∆U (see [18]): Aut(U) → Iso (∆U ). Theorem 8.13 (Danilov and Gizatullin, [18, 19]). The graph ∆U of all isomorphism classes of standard completions of U is a tree. The group Aut(U) acts by isometries of this tree. The stabilizer of a vertex ι : U → Y is the subgroup G(ι) of automorphisms of the complete surface Y that fix the curve ∂Y . This group is an algebraic subgroup of Aut(Y ). The last property means that G(ι) is an algebraic group that acts algebraically on Y . It coincides with the subgroup of Aut(Y ) fixing the boundary ∂Y ; the fact that it is algebraic follows from the existence of a G(ι)-invariant, big and nef divisor which is supported on ∂Y (see the last sentence of Proposition 8.3). COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 44 The crucial assertion in this theorem is that ∆U is a simplicial tree (typically, infinitely many edges emanate from each vertex). There are sufficiently many links to assure connectedness, but not too many in order to prevent the existence of cycles in the graph ∆U . Corollary 8.14. If Γ is a subgroup of Aut(U) that has the fixed point property on trees, then Γ is contained in G(ι) ⊂ Aut(Y ) for some completion ι : U → Y . If Γ has Property (FW), it has Property (FA) (see Section 3.4). Thus, if it acts by automorphisms on U, Γ is conjugate to the subgroup G(ι) of Aut(Y ), for some zigzag-completion ι : U → Y . Theorem 8.8 of Section 8.3.3 implies that the action of Γ on the initial surface X is conjugate to a regular action on P2k , P1k ×P1k or Fm , for some Hirzebruch surface Fm . This action preserves a curve, namely the image of the zigzag into the surface Y . The following examples list all possibilities, and conclude the proof of Theorem B in the case of zigzags (i.e. case (3) in Proposition 8.3). Example 8.15. Consider the projective plane P2k , together with an infinite subgroup Γ ⊂ Aut(P2k ) that preserves a curve C and has Property (FW). Then, C must be a smooth rational curve: either a line, or a smooth conic. If C is the line “at infinity”, then Γ acts by affine transformations on the affine plane P2k r C. If the curve is the conic x2 + y 2 + z 2 = 0, Γ becomes a subgroup of PO3 (k). Example 8.16. When Γ is a subgroup of Aut(P1k × P1k ) that preserves a curve C and has Property (FW), then C must be a smooth curve because Γ has no finite orbit (Lemma 3.5). Similarly, the two projections C → P1k being equivariant with respect to the morphisms Γ → PGL 2 (k), they have no ramification points. Thus, C is a smooth rational curve, and its projections onto each factor are isomorphisms. In particular, the action of Γ on C and on each factor are conjugate. From these conjugacies, one deduces that the action of Γ on P1k × P1k is conjugate to a diagonal embedding γ ∈ Γ 7→ (ρ(γ), ρ(γ)) ∈ PGL 2 (k) × PGL 2 (k) preserving the diagonal. Example 8.17. Similarly, the group SL 2 (k) acts on the Hirzebruch surface Fm , preserving the zero section of the fibration π : Fm → P1k . This gives examples of groups with Property (FW) acting on Fm and preserving a big and nef curve C. Starting with one of the above examples, one can blow-up points on the invariant curve C, and then contract C, to get examples of zigzag completions Y on which Γ acts and contracts the boundary ∂Y . COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 45 9. B IRATIONAL TRANSFORMATIONS OF SURFACES II In this section, U is a (normal, singular) affine surface with a completion X by a cycle of ` rational curves. Every irreducible component Ei of the boundary ∂X = X r U is contracted by at least one automorphism of U. Our goal is to classify subgroups Γ of Aut(U) ⊂ Bir(X) that are infinite and have Property (FW): in fact, we shall show that no such group exists. This ends the proof of Theorem B since all the other possibilities of Proposition 8.3 have been dealt with in the previous section. Example 9.1. Let (A1k )∗ denote the complement of the origin in the affine line A1k ; it is isomorphic to the multiplicative group Gm over k. The surface (A1k )∗ × (A1k )∗ is an open subset in P2k whose boundary is the triangle of coordinate lines {[x : y : z]; xyz = 0}. Thus, the boundary is a cycle of length ` = 3. The group of automorphisms of (A1k )∗ × (A1k )∗ is the semi-direct product GL 2 (Z) n (Gm (k) × Gm (k)); it does not contain any infinite group with Property (FW). 9.1. Resolution of indeterminacies. Let us order cyclically the irreducible components Ei of ∂X, so that Ei ∩ Ej 6= ∅ if and only if i − j = ±1(mod `). Blowing up finitely many singularities of ∂X, we may assume that ` = 2m for some integer m ≥ 1; in particular, every curve Ei is smooth. (With such a modification, one may a priori create irreducible components of ∂X that are not contracted by the group Γ.) Lemma 9.2. Let f be an automorphism of U and let fX be the birational extension of f to the surface X. Then (1) Every indeterminacy point of fX is a singular point of ∂X, i.e. one of the intersection points Ei ∩ Ei+1 . (2) Indeterminacies of fX are resolved by inserting chains of rational curves. Property (2) means that there exists a resolution of the indeterminacies of fX , given by two birational morphisms  : Y → X and π : Y → X with f ◦  = π, such that π −1 (∂X) = −1 (X) is a cycle of rational curves. Some of the singularities of ∂X have been blown-up into chains of rational curves to construct Y . Proof. Consider a minimal resolution of the indeterminacies of fX . It is given by a finite sequence of blow-ups of the base points of fX , producing a surface Y and two birational morphisms  : Y → X and π : Y → X such that fX = π ◦ −1 . COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 46 π  f F IGURE 1. A blow-up sequence creating two (red) branches. No branch of this type appears for minimal resolution. Since the indeterminacy points of fX are contained in ∂X, all necessary blow-ups are centered on ∂X. The total transform F = ∗ (∂X) is a union of rational curves: it is made of a cycle, together with branches emanating from it. One of the assertions (1) and (2) fails if and only if F is not a cycle; in that case, there is at least one branch. Each branch is a tree of smooth rational curves, which may be blown-down onto a smooth point; indeed, these branches come from smooth points of the main cycle that have been blown-up finitely many times. Thus, there is a birational morphism η : Y → Y0 onto a smooth surface Y0 that contracts the branches (and nothing more). The morphism π maps F onto the cycle ∂X, so that all branches of F are contracted by π. Thus, both  and π induce (regular) birational morphisms 0 : Y0 → X and π0 : Y0 → X. This contradicts the minimality of the resolution.  Let us introduce a family of surfaces πk : Xk → X. First, X1 = X and π1 is the identity map. Then, X2 is obtained by blowing-up the ` singularities of ∂X1 ; X2 is a compactification of U by a cycle ∂X2 of 2` = 2m+1 smooth rational curves. Then, X3 is obtained by blowing up the singularities of ∂X2 , and so on. In particular, ∂Xk is a cycle of 2k−1 ` = 2m+k−1 curves. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 47 Denote by Dk the dual graph of ∂Xk : vertices of Dk correspond to irreducible components Ei of ∂Xk and edges to intersection points Ei ∩ Ej . A simple blow-up (of a singular point) modifies both ∂Xk and Dk locally as follows F IGURE 2. Blowing-up one point. ˜ The group Aut(U) acts on Hyp(X) and Lemma 9.2 shows that its action stabilizes ˜ the subset B of Hyp(X) defined as n o ˜ B = C ∈ Hyp(X) : ∃k ≥ 1, C is an irreducible component of ∂Xk . In what follows, we shall parametrize B in two distinct ways by rational numbers. 9.2. Farey and dyadic parametrizations. Consider an edge of the graph D1 , and identify this edge with the unit interval [0, 1]. Its endpoints correspond to two adjacent components Ei and Ei+1 of ∂X1 , and the edge corresponds to their intersection q. Blowing-up q creates a new vertex (see Figure 2). The edge is replaced by two adjacent edges of D2 with a common vertex corresponding to the exceptional divisor and the other vertices corresponding to (the strict transforms of) Ei and Ei+1 ; we may identify this part of D2 with the segment [0, 1], the three vertices with {0, 1/2, 1}, and the two edges with [0, 1/2] and [1/2, 1]. Subsequent blow-ups may be organized in two different ways by using either a dyadic or a Farey algorithm (see Figure 3). In the dyadic algorithm, the vertices are labelled by dyadic numbers m/2k . The vertices of Dk+1 coming from an initial edge [0, 1] of D1 are the points {n/2k ; 0 ≤ n ≤ 2k } of the segment [0, 1]. We denote by Dyad(k) the set of dyadic numbers n/2k ∈ [0, 1]; thus, Dyad(k) ⊂ Dyad(k + 1). We shall say that an interval [a, b] is a standard dyadic interval if a and b are two consecutive numbers in Dyad(k) for some k. In the Farey algorithm, the vertices correspond to rational numbers p/q. Adjacent vertices of Dk coming from the initial segment [0, 1] correspond to pairs of rational numbers (p/q, r/s) with ps − qr = ±1; two adjacent vertices of Dk give birth to a new, middle vertex in Dk+1 : this middle vertex is (p + r)/(q + s) (in the dyadic COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 48 algorithm, the middle vertex is the “usual” euclidean middle). We shall say that an interval [a, b] is a standard Farey interval if a = p/q and b = r/s with ps − qr = −1. We denote by Far(k) the finite set of rational numbers p/q ∈ [0, 1] that is given by the k-th step of Farey algorithm; thus, Far(1) = {0, 1} and Far(k) is a set of 2k+1 rational numbers p/q with 0 ≤ p ≤ q. (One can check that 1 ≤ q ≤ Fib(k), with Fib(k) the k-th Fibonacci number.) 0/1 0/1 1/1 0/1 1/1 0/1 1/3 1/1 0/1 1/3 1/1 0/1 1/2 0/1 0/1 1/4 1/3 1/2 1/3 1/2 2/5 3/5 3/4 1/1 1/2 1/4 1/2 1/4 1/8 1/1 3/4 1/2 3/8 1/1 3/4 5/8 1/1 7/8 F IGURE 3. On the left, the Farey algorithm. On the right, the dyadic one. By construction, the graph D1 has ` = 2m edges. The edges of D1 are in one to one correspondance with the singularities qj of ∂X1 . Each edge determines a subset Bj of B; the elements of Bj are the curves C ⊂ ∂Xk (k ≥ 1) such that πk (C) contains the singularity qj determined by the edge. Using the dyadic algorithm (resp. Farey algorithm), the elements of Bj are in one-to-one correspondence with dyadic (resp. rational) numbers in [0, 1]. Gluing these segments cyclically together one gets a circle S1 , together with a nested sequence of subdivisions in `, 2`, . . ., 2k−1 `, . . . intervals; each interval is a standard dyadic interval (resp. standard Farey interval) of one of the initial edges . Since there are ` = 2m initial edges, we may identify the graph D1 with the circle S1 = R/Z = [0, 1]/0'1 and the initial vertices with the dyadic numbers in Dyad(m) modulo 1 (resp. with the elements of Far(m) modulo 1). Doing this, the vertices of Dk are in one to one correspondence with the dyadic numbers in Dyad(k + m − 1) (resp. in Far(k + m − 1)). Remark 9.3. (a).– By construction, the interval [p/q, r/s] ⊂ [0, 1] is a standard Farey interval if and only if ps − qr = −1, iff it is delimited by two adjacent elements of Far(m) for some m. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 49 (b).– If h : [x, y] → [x0 , y 0 ] is a homeomorphism between two standard Farey intervals mapping rational numbers to rational numbers and standard Farey intervals to standard Farey intervals, then h is the restriction to [x, y] of a unique linear projective transformation with integer coefficients:   at + b a b , for some element of PGL 2 (Z). h(t) = c d ct + d (c).– Similarly, if h is a homeomorphism mapping standard dyadic intervals to intervals of the same type, then h is the restriction of an affine dyadic map u h(t) = 2m t + n , with m, n ∈ Z. 2 In what follows, we denote by GFar the group of self-homeomorphisms of S1 = R/Z that are piecewise PGL 2 (Z) mapping with respect to a finite decomposition of the circle in standard Farey intervals [p/q, r/s]. In other words, if f is an element of GFar , there are two partitions of the circle into consecutive intervals Ii and Ji such that the Ii are intervals with rational endpoints, h maps Ii to Ji , and the restriction f : Ii → Ji is the restriction of an element of PGL 2 (Z) (see [34], §1.5.1). Theorem 9.4. Let U be an affine surface with a compactification U ⊂ X such that ∂X := X r U is a cycle of smooth rational curves. In the Farey parametrization of ˜ the set B ⊂ Hyp(X) of boundary curves, the group Aut(U) acts on B as a subgroup of GFar . Remark 9.5. There is a unique orientation preserving self-homeomorphism of the circle that maps Dyad(k) to Far(k) for every k. This self-homeomorphism conjugates GFar to the group GDya of self-homeomorphisms of the circle that are piecewise affine with respect to a dyadic decomposition of the circle, with slopes in ±2Z , and with translation parts in Z[1/2]. Using the parametrization of B by dyadic numbers, the image of Aut(U) becomes a subgroup of GDya . Remark 9.6. The reason why we keep in parallel the dyadic and Farey viewpoints is the following: the Farey viewpoint is more natural for algebraic geometers (this is related to toric –i.e. monomial– maps and appears clearly in [21]), while the dyadic viewpoint is more natural to geometric group theorists, because this is the classical setting used in the study of Thompson groups (see [34], §1.5). Proof. Lemma 9.2 is the main ingredient. Consider the action of the group Aut(U) on the set B. Let f be an element of Aut(U) ⊂ Bir(X). Consider an irreducible curve E ∈ B, and denote by F its image: F = f• (E) is an element of B by COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 50 Lemma 9.2. There are integers k and l such that E ⊂ ∂Xk and F ⊂ ∂Xl . Replacing Xk by a higher blow-up Xm → X, we may assume that flm := πl−1 ◦ f ◦ πm is regular on a neighborhood of the curve E (Lemma 9.2). Let qk be one of the two singularities of ∂Xm that are contained in E, and let E 0 be the second irreducible component of ∂Xm containing q. If E 0 is blown down by flm , its image is one of the two singularities of ∂Xl contained in F (by Lemma 9.2). Consider the smallest integer n ≥ l such that ∂Xn contains the strict transform F 0 = f• (E 0 ); in Xn , the curve F 0 is adjacent to the strict transform of F (still denoted F ), and f is a local isomorphism from a neighborhood of q in Xm to a neighborhood of q 0 := F ∩ F 0 in Xn . Now, if one blows-up q, the exceptional divisor D is mapped by f• to the exceptional divisor D0 obtained by a simple blow-up of q: f lifts to a local isomorphism from a neighborhood of D to a neighborhood of D0 , the action from D to D0 being given by the differential dfq . The curve D contains two singularities of ∂Xm+1 , which can be blown-up too: again, f lifts to a local isomorphism if one blow-ups the singularities of ∂Xn+1 ∩ D0 . We can repeat this process indefinitely. Let us now phrase this remark differently. The point q determines an edge of Dm , hence a standard Farey interval I(q). The point q 0 determines an edge of Dn , hence another standard Farey interval I(q 0 ). Then, the points of B that are parametrized by rational numbers in I(q) are mapped by f• to rational numbers in I(q 0 ) and this map respects the Farey order: if we identify I(q) and I(q 0 ) to [0, 1], f• is the restriction of a monotone map that sends Far(k) to Far(k) for every k. Thus, on I(q), f• is the restriction of a linear projective transformation with integer coefficients (see Remark 9.3-(b)). This shows that f• is an element of GFar .  9.3. Conclusion. Consider the group G∗Dya of self-homeomorphisms of the circle S1 = R/Z that are piecewise affine with respect to a finite partition of R/Z into dyadic intervals [xi , xi+1 [ with xi in Z[1/2]/Z for every i, and satisfy h(t) = 2mi t + ai with mi ∈ Z and ai ∈ Z[1/2] for every i. This group is known as the Thompson group of the circle, and is isomorphic to the group G∗Far of orientation-preserving self-homeomorphisms in GFar (defined in §9.2). Theorem 9.7 (Farley, Hughes [15, 22]). Every subgroup of G∗Dya (and hence of GFar ) with Property (FW) is a finite cyclic group. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 51 Indeed fixing a gap in an earlier construction of Farley [15]2, Hughes proved [22] that GFar has Property PW, in the sense that it admits a commensurating action whose associated length function is a proper map (see also Navas’ book [34]). This implies the conclusion, because every finite group of orientation-preserving selfhomeomorphisms of the circle is cyclic. Thus, if Γ is a subgroup of Aut(U) with Property (FW), it contains a finite index ˜ subgroup Γ0 that acts trivially on the set B ⊂ Hyp(X). This means that Γ0 extends as a group of automorphisms of X fixing the boundary ∂X. Since ∂X supports a big and nef divisor, Γ0 contains a finite index subgroup Γ1 that is contained in Aut(X)0 . Note that Γ1 has Property (FW) because it is a finite index subgroup of Γ. It preserves every irreducible component of the boundary curve ∂X, as well as its singularities. As such, it must act trivially on ∂X. When we apply Theorem 8.8 to Γ1 , the conjugacy ϕ : X → Y can not contract ∂X, because the boundary supports an ample divisor. Thus, Γ1 is conjugate to a subgroup of Aut(Y ) that fixes a curve pointwise. This is not possible if Γ1 is infinite (see Theorem 8.8 and the remarks following it). We conclude that Γ is finite in case (2) of Proposition 8.3. √ 10. B IRATIONAL ACTIONS OF SL 2 (Z[ d]) We develop here Example 1.4. If k is an algebraically closed field of characteristic√0, therefore containing Q, we denote by σ1 and σ2 the distinct embeddings √ of Q( d) into k. Let j1 and j2 be the resulting embeddings of SL 2 (Z[ d]) into SL 2 (k), and j = j1 × j2 the resulting embedding into G = SL 2 (k) × SL 2 (k). √ Theorem 10.1. Let Γ be a finite index subgroup of SL 2 (Z[ d]). Let X be an irreducible projective surface over an algebraically closed field k. Let α : Γ → Bir(X) be a homomorphism with infinite image. Then k has characteristic zero, and there exist a finite index subgroup Γ0 of Γ and a birational map ϕ : Y 99K X such that (1) Y is the projective plane P2 , a Hirzebruch surface Fm , or C × P1 for some curve C; (2) ϕ−1 α(Γ)ϕ ⊂ Aut(Y ); 2 The gap in Farley’s argument lies in Prop. 2.3 and Thm. 2.4 of [15]. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 52 (3) there is a unique algebraic homomorphism β : G → Aut(Y ) such that ϕ−1 α(γ)ϕ = β(j(γ)) for every γ ∈ Γ0 . Theorem B ensures that the characteristic of k is 0 and that (1) and (2) are satisfied. If Y is P2 or a Hirzebruch surface Fm , then Aut(Y ) is a linear algebraic group. If Y is a product C × P1 , a finite index subgroup of Γ preserves the projection onto P1 , so that it acts via an embedding into the linear algebraic group Aut(P1 ) = PGL 2 (k). When k has positive characteristic, Y is the projective plane, and the Γ-action is given by a homomorphism Γ → PGL 3 (k). Then we use the fact that for any n, every homomorphism f : Γ → GL n (k) has finite image. Indeed, it is well-known that GL n (k) has no infinite order distorted elements: elements of infinite order have some transcendental eigenvalue and the conclusion easily follows. Since Γ has an exponentially distorted cyclic subgroup, f has infinite kernel, and infinite normal subgroups of Γ have finite index (Margulis normal subgroup theorem). On the other hand, in characteristic zero we conclude the proof of Theorem 10.1 with the following lemma. √ d). Consider the embedding j Lemma 10.2. Let k be any field extension of Q( √ of SL 2 (Z[ d]) into G = SL 2 (k) × SL 2 (k) given by the standard embedding into the left-hand SL 2 and its Galois conjugate in the right-hand√SL 2 . Then for every linear algebraic group H and homomorphism f : SL 2 (Z[ d]) → H(k), there exists a unique homomorphism f¯ : G → H of k-algebraic groups such that the homomorphisms f and f˜ ◦ j coincide on some finite index subgroup of Γ. Proof. The uniqueness is a consequence of Zariski density of the image of j. Let us prove the existence. Zariski density allows to reduce to the case when H = SL n . First, the case k = R is given by Margulis’ superrigidity, along with the fact that every continuous real representation of SL n (R) is algebraic. The case of fields containing R immediately follows, √ and in turn it follows for subfields of overfields  of R (as soon as they contain Q( d)). 11. O PEN PROBLEMS 11.1. Regularization and Calabi-Yau varieties. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 53 Question 11.1. Let Γ be a group with Property (FW). Is every birational action of Γ regularizable ? Here regularizable is defined in the same way as pseudoregularizable, but assuming that the action on U is by automorphisms (instead of pseudo-automorphisms). A particular case is given by Calabi-Yau varieties, in the strict sense of a simply connected complex projective manifold X with trivial canonical bundle and hk,0 (X) = 0 for 0 < k < dim(X). For such a variety the group Bir(X) coincides with Psaut(X). One can then ask (1) whether every infinite subgroup Γ of Psaut(X) with property (FW) is regularizable on some birational model Y of X (without restricting the action to a dense open subset), and (2) what are the possibilities for such a group Γ. 11.2. Transfixing birational groups. Question 11.2. For which irreducible projective varieties X (1) Bir(X) does not transfix Hyp(X)? (2) some finitely generated subgroup of Bir(X) does not transfix Hyp(X)? (3) some cyclic subgroup of Bir(X) does not transfix Hyp(X). We have the implications: X is ruled ⇒ (3) ⇒ (2) ⇒ (1). In dimension 2, we have: ruled ⇔ (1) /⇒(2) ⇔ (3) (see §7.1). It would be interesting to find counterexamples to these equivalences in higher dimension, and settle each of the problems raised in Question 11.2 in dimension 3. 11.3. The affine space. The group of affine transformations of A3C contains SL 3 (C), and this group contains many subgroups with Property (FW). In the case of surfaces, Theorem B shows that groups of birational transformations with Property (FW) are contained in algebraic groups, up to conjugacy. The following question asks whether this type of theorem may hold for Aut(A3C ). Question 11.3. Does there exist an infinite subgroup of Aut(A3C ) with Property (FW) that is not conjugate to a group of affine transformations of A3C ? 11.4. Length functions. Recall that a length function ` on a group G is quasigeodesic if there exists M > 0 such that for every n ≥ 1 and every g ∈ G with −1 `(g) ≤ n, there exist 1 = g0 , g1 , . . . , gn = g in G such that `(gi−1 gi ) ≤ M for all i. −1 Equivalently G, endowed with the distance (g, h) 7→ `(g h), is quasi-isometric to a connected graph. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 54 Question 11.4. Given an irreducible variety X, is the length function g ∈ Bir(X) 7→ |Hyp(X)4gHyp(X)| quasi-geodesic? In particular, what about X = P2 and the Cremona group Bir(P2 )? R EFERENCES [1] Wolf P. Barth, Klaus Hulek, Chris A. M. Peters, and Antonius Van de Ven. Compact complex surfaces, volume 4 of Ergebnisse der Mathematik und ihrer Grenzgebiete. Springer-Verlag, Berlin, second edition, 2004. [2] Hyman Bass. Groups of integral representation type. Pacific J. Math., 86(1):15–51, 1980. [3] Hyman Bass and Alexander Lubotzky. Automorphisms of groups and of schemes of finite type. Israel J. Math., 44(1):1–22, 1983. [4] Arnaud Beauville. Surfaces algébriques complexes. Société Mathématique de France, Paris, 1978. Avec une sommaire en anglais, Astérisque, No. 54. [5] Eric Bedford and Kyounghee Kim. Dynamics of (pseudo) automorphisms of 3-space: periodicity versus positive entropy. Publ. Mat., 58(1):65–119, 2014. [6] Nicolas Bergeron, Frédéric Haglund, and Daniel T. Wise. Hyperplane sections in arithmetic hyperbolic manifolds. J. Lond. Math. Soc. (2), 83(2):431–448, 2011. [7] Sébastien Boucksom, Charles Favre, and Mattias Jonsson. Valuations and plurisubharmonic singularities. Publ. Res. Inst. Math. Sci., 44(2):449–494, 2008. [8] Serge Cantat. Sur les groupes de transformations birationnelles des surfaces. Annals Math., (174), 2011. [9] Serge Cantat. Dynamics of automorphisms of compact complex surfaces. In Frontiers in Complex Dynamics: In celebration of John Milnor’s 80th birthday, volume 51 of Princeton Math. Series, pages 463–514. Princeton University Press, 2014. [10] Serge Cantat and Keiji Oguiso. Birational automorphism groups and the movable cone theorem for Calabi-Yau manifolds of Wehler type via universal Coxeter groups. Amer. J. Math., 137(4):1013–1044, 2015. [11] Yves Cornulier. Group actions with commensurated subsets, wallings and cubings. ArXiv 1302.5982, (1):1–71, 2015. [12] Yves Cornulier. Irreducible lattices, invariant means, and commensurating actions. Math. Z., 279(1-2):1–26, 2015. [13] Pierre de la Harpe and Alain Valette. La propriété (T ) de Kazhdan pour les groupes localement compacts (avec un appendice de Marc Burger). Astérisque, (175):158, 1989. With an appendix by M. Burger. [14] J. Diller and C. Favre. Dynamics of bimeromorphic maps of surfaces. Amer. J. Math., 123(6):1135–1169, 2001. [15] Daniel S. Farley. Proper isometric actions of Thompson’s groups on Hilbert space. Int. Math. Res. Not., (45):2409–2414, 2003. [16] M. J. Fryers. The movable fan of the horrocks-mumford quintic. unpublished manuscript, arXiv:math/0102055, pages 1–20, 2001. [17] M. H. Gizatullin. Invariants of incomplete algebraic surfaces that can be obtained by means of completions. Izv. Akad. Nauk SSSR Ser. Mat., 35:485–497, 1971. [18] M. H. Gizatullin and V. I. Danilov. Automorphisms of affine surfaces. I. Izv. Akad. Nauk SSSR Ser. Mat., 39(3):523–565, 703, 1975. [19] M. H. Gizatullin and V. I. Danilov. Automorphisms of affine surfaces. II. Izv. Akad. Nauk SSSR Ser. Mat., 41(1):54–103, 231, 1977. COMMENSURATING ACTIONS OF BIRATIONAL GROUPS 55 [20] Robin Hartshorne. Algebraic geometry. Springer-Verlag, New York, 1977. Graduate Texts in Mathematics, No. 52. [21] John H. Hubbard and Peter Papadopol. Newton’s method applied to two quadratic equations in C2 viewed as a global dynamical system. Mem. Amer. Math. Soc., 191(891):vi+146, 2008. [22] Bruce Hughes. Local similarities and the haagerup property. with an appendix by daniel s. farley. Groups Geom. Dyn., 3(2):299–315, 2009. [23] Shigeru Iitaka. Algebraic geometry: an introduction to the birational geometry of algebraic varieties, volume 76. Springer, 1982. [24] Vaughan FR Jones. A no-go theorem for the continuum limit of a periodic quantum spin chain. arXiv preprint arXiv:1607.08769, 2016. [25] János Kollár, Karen E. Smith, and Alessio Corti. Rational and nearly rational varieties, volume 92 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 2004. [26] Robert Lazarsfeld. Positivity in algebraic geometry. I, volume 48 of Ergebnisse der Mathematik und ihrer Grenzgebiete. 3. Folge. A Series of Modern Surveys in Mathematics. Springer-Verlag, Berlin, 2004. Classical setting: line bundles and linear series. [27] David I. Lieberman. Compactness of the Chow scheme: applications to automorphisms and deformations of Kähler manifolds. In Fonctions de plusieurs variables complexes, III (Sém. François Norguet, 1975–1977), volume 670 of Lecture Notes in Math., pages 140–186. Springer, Berlin, 1978. [28] Alexander Lubotzky, Shahar Mozes, and M. S. Raghunathan. The word and Riemannian metrics on lattices of semisimple groups. Inst. Hautes Études Sci. Publ. Math., (91):5–53 (2001), 2000. [29] Alexander Lubotzky, Shahar Mozes, and MS Raghunathan. Cyclic subgroups of exponential growth and metrics on discrete groups. Comptes Rendus Académie des Sciences Paris Série 1, 317:735–740, 1993. [30] Yu. I. Manin. Cubic forms, volume 4 of North-Holland Mathematical Library. North-Holland Publishing Co., Amsterdam, second edition, 1986. Algebra, geometry, arithmetic, Translated from the Russian by M. Hazewinkel. [31] T. Matsusaka. Polarized varieties, fields of moduli and generalized Kummer varieties of polarized abelian varieties. Amer. J. Math., 80:45–82, 1958. [32] T. Matsusaka and D. Mumford. Two fundamental theorems on deformations of polarized varieties. Amer. J. Math., 86:668–684, 1964. [33] J. S. Milne. Algebraic geometry. preprint, http://www.jmilne.org/math/CourseNotes/AG.pdf, pages 1–221, 2017. [34] Andrés Navas. Groups of circle diffeomorphisms. Chicago Lectures in Mathematics. University of Chicago Press, Chicago, IL, spanish edition, 2011. [35] Jean-Pierre 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. [36] Ravi Vakil. The Rising see, Foundations of Algebraic Geometry. webpage of the author, math216.wordpress.com, 2017. U NIV R ENNES , CNRS, IRMAR - UMR 6625, F-35000 R ENNES CNRS AND U NIV LYON , U NIV C LAUDE B ERNARD LYON 1, I NSTITUT C AMILLE J ORDAN , 43 BLVD . DU 11 NOVEMBRE 1918, F-69622 V ILLEURBANNE E-mail address: [email protected] E-mail address: [email protected]
4math.GR
Predictive Second Order Sliding Control of Constrained Linear Systems with Application to Automotive Control Systems arXiv:1802.01617v1 [cs.SY] 5 Feb 2018 Mohammad Reza Amini† , Mahdi Shahbakhti‡, and Jing Sun† Abstract— This paper presents a new predictive second order sliding controller (PSSC) formulation for setpoint tracking of constrained linear systems. The PSSC scheme is developed by combining the concepts of model predictive control (MPC) and second order discrete sliding mode control. In order to guarantee the feasibility of the PSSC during setpoint changes, a virtual reference variable is added to the PSSC cost function to calculate the closest admissible set point. The states of the system are then driven asymptotically to this admissible setpoint by the control action of the PSSC. The performance of the proposed PSSC is evaluated for an advanced automotive engine case study, where a high fidelity physics-based model of a reactivity controlled compression ignition (RCCI) engine is utilized to serve as the virtual test-bed for the simulations. Considering the hard physical constraints on the RCCI engine states and control inputs, simultaneous tracking of engine load and optimal combustion phasing is a challenging objective to achieve. The simulation results of testing the proposed PSSC on the high fidelity RCCI model show that the developed predictive controller is able to track desired engine load and combustion phasing setpoints, with minimum steady state error, and no overshoot. Moreover, the simulation results confirm the robust tracking performance of the PSSC during transient operations, in the presence of engine cyclic variability. I. INTRODUCTION Feasibility and stability of model predictive control (MPC) scheme for a tracking control problem, where the desired trajectory changes, are challenging to be guaranteed. Addition of a virtual reference, as an extra optimization variable, to the cost function of the MPC has been proposed in the literature [1]–[3] to solve this issue. This approach is similar to the so-called command governor technique [4] for tracking problem of constrained linear systems, in which a nonlinear low-pass filter of the reference is added (the output of the filter can be seen as the virtual reference) to ensure the admissible evolution of the system to the reference. For the proposed approach in [1]–[3], an additional term in the cost function of the MPC reflects the difference between the original and the virtual references. Moreover, an augmented space consisting of the original system’s states and the virtual reference, is used to formulate a terminal invariant set to guarantee the persistent feasibility of the constrained optimization problem, which is then utilized to prove the asymptotic stability of model predictive controllers [3], [5]. The disadvantage of this approach is the increased complex† M. R. Amini and J. Sun are with the Department of Naval Architecture and Marine Engineering, University of Michigan, Ann Arbor, MI 48109 USA. ({mamini,jingsun}@umich.edu) ‡ M. Shahbakhti is with the Department of Mechanical EngineeringEngineering Mechanics, Michigan Technological University, Houghton, MI 49931 USA. ([email protected]) ity of the invariant set computation due to extra variable introduced to the optimization problem. Sliding mode control (SMC) is proven to be a robust and computationally efficient solution for tracking problems of linear and nonlinear systems with a great deal of uncertainty [6]. The key feature of SMC is converting a high dimensional tracking control problem into a lower dimensional stabilization control problem. On the other side, conventional SMCs do not consider the constraints on the states and inputs of the system. This is because the control input of the SMC is mainly calculated based on the present information of the system, and information from future events is not considered in the controller formulation. A novel combination of MPC and first order discrete SMC (DSMC) has been proposed in [7] to handle state and input constraints within the sliding controller by taking into account the future information via a receding horizon sliding control (RHSC) scheme. The concept of second order DSMC has been proposed in the authors’ previous works [8], [9], where the asymptotic stability of the second order sliding mode controller is also proven. The main advantage of a second order DSMC in comparison with the first order controller is its enhanced smoothness in the tracking, and improved response to upcoming changes [8]–[10]. This is due to the fact that in a second order DSMC, in addition to the sliding variable, its derivative is also driven to zero [11]. The second order DSMC provides fast and computationally efficient tracking performance [12], [13]. However, as mentioned earlier, the constraints on the states and inputs of the system can not be incorporated in the controller design, which may cause saturation in the controller system [7]. Therefore, formulating the second order sliding controller in a predictive scheme, not only preserves the key features of the sliding control and MPC, but also allows for handling the input and state constraints within the sliding controller formulation [14]. In this paper, a novel predictive second order sliding controller (PSSC) is presented. The proposed PSSC enables handling of the constraint on the inputs and states by direct inclusion of the future information. Moreover, the PSSC ensures asymptotic tracking of any admissible piecewise setpoints, or the closest admissible setpoint, if the target trajectory is not admissible. The performance of the proposed PSSC is evaluated for control of an advanced automotive engine including a Reactivity Controlled Compression Ignition (RCCI). RCCI technology offers significantly higher fuel conversion efficiency compared to conventional automotive engines through creating optimum heat release shape by exploiting reactivity gradients inside the combustion chamber. RCCI typically runs with lean air-fuel mixture, and has low combustion temperature, resulting in much lower NOx and PM engineout emissions, compared to conventional engines [15]. On the other side, simultaneous combustion phasing and engine load control is hard to achieve due to the strong nonlinearity and internal coupling in the dynamics of RCCI engines, specifically during the transients. It will be shown in this paper that the PSSC is able to handle the coupling within the RCCI engine to achieve simultaneous engine load and combustion phasing tracking, with consideration of the constraints on the control signals during the engine transient operation. The main contribution of this paper includes the first development of a predictive second order sliding controller (PSSC) for tracking of constrained linear systems. The PSSC is formulated with respect to a novel invariant sliding domain to ensure feasibility and stability of the controller. Moreover, this paper presents the first application of a predictive sliding controller for simultaneous load and combustion phasing tracking in RCCI engines. II. D ISCRETE S ECOND O RDER S LIDING C ONTROL A linear multi-input multi-output system can be represented by the following discrete-time state space equations: x(k + 1) = Ax(k) + Bu(k), (1) y(k) = Cx(k), (2) where x ∈ Rn , u ∈ Rm , y ∈ Rm are the state, input, and output of the linear system, respectively. A ∈ Rn×n , B ∈ Rn×m , C ∈ Rm×n are the system matrices. Moreover, it is assumed that the state and input of the linear system in Eq. (1) are constrained: x ∈ X ⊆ Rn , u ∈ U ⊆ Rm . X and U sets are restricted to have the origin in their interior and be polyhedral [5]. The control objective is to drive the output of the system (y) to its desired value (yd ) in the presence of the state and input constraints. To this end, an error function (e) is defined: e(k) = y(k) − y d (k) (3) and the control objective is set to drive e to zero. Here, the first order sliding function (s) definition of a linear system with relative degree of d1 , · · · , dm from [5] is adopted to define the second order sliding function (ξ), which will be used later to formulate the predictive sliding controller. Moreover, it is assumed that the linear system in Eq. (1) is minimum-phase [16]. The first order sliding variable can be defined with respect to Eq. (3) as follows:   s1 (k)   s(k) =  ...  = (4) sm (k)  α1,0 e1 (k) + α1,1 e1 (k + 1) + · · · + α1,l1 e1 (k + l1 )   ..   . αm,0 em (k) + αm,1 em (k + 1) + · · · + αm,lm em (k + lm )  6 0, i = 1, · · · , m. By where li = di − 1, and αi,li = substituting Eq. (3) into Eq. (4), s can be simplified as: s(k) = Gx(k) − H(k) where:  l1 P j (5)  α1,j A   c1   j=0   . ,  .. G=    lm P  j cm αm,j A (6) j=0  α1,0 yd,1 (k) + · · · + α1,l1 yd,1 (k + l1 )   .. H(k) =   (7) . αm,0 yd,m (k) + · · · + αm,lm yd,m (k + lm )  where ci , i = 1, · · · , m is the ith row of C. The interesting point about Eq. (6) is that ci Aj B = 0, i = 1, · · · , m, j = 1, · · · , li [5]. Therefore no term containing B appears in Eq. (6). If ci Aj B 6= 0, then the ith output of the system has a relative degree less than di , which violates the initial statement of assuming the ith output to have a relative degree of di , thus ci Aj B = 0. In the discrete time, the second order sliding variable (ξ(k)) is defined with respect to Eq. (4) as follows [9], [10]: ξ(k) = s(k + 1) + βs(k) (8) where β ∈ Rm×m , which manipulates the rate of state convergence to the sliding manifold, is chosen such that all the eigenvalues are inside the unit circle [8]. The equivalent control input of the second order sliding controller is achieved by solving the following equality [9]: ξ(k + 1) = ξ(k) = 0. (9) Applying Eq. (9) leads to the following equivalent control input (ueq (k)) of the second order DSMC: ueq (k) = (10)    −1 −(GB) GA + βG x(k) − H(k + 1) + βH(k) . Eq. (10) calculates a vector of control input signals (u) based on the model matrices, current states (x), and also current and future information of the desired trajectories (yd,i (k), · · · , yd,i (k+li +1), i = 1, · · · , m). Moreover, since it is assumed that the system in Eq. (1) has a relative degree of d1 , · · · , dm , the existence of (GB)−1 is ensured [5], [16]. III. P REDICTIVE S ECOND O RDER S LIDING C ONTROL In this section, a novel combination of the second order sliding controller with MPC, as the predictive second order sliding control (PSSC) scheme is presented for constrained linear system tracking. To this end, following the procedure proposed in [1], [5], first a terminal invariant second order sliding domain is calculated. Next, this invariant set is used as extended terminal constraint to formulate the PSSC. In the first step, it is required to determine a terminal state feedback control law, based on the second order sliding control, in order to characterize the steady states and inputs [17]. Moreover, the reference output (y d ) in Eq. (3) is replaced with a virtual fixed but arbitrary reference (ỹ d ) to calculate the invariant second order sliding domain, according to the procedure in [1], [5]. By substituting ỹ d in Eq. (3), the error becomes: ẽ(k) = y(k) − ỹ d . It was shown in [5] that substitution of ẽ(k) in Eq. (5) results in the following first order sliding function: s(k) = Gx(k) − H̃ ỹ d (11) where:  l1 P α1,j  j=0  H̃ =      .. . lm P j=0 αm,j        Thus, the second order sliding function becomes:  ξ(k) = Gx(k + 1) − H̃ ỹ d + β Gx(k) − H̃ ỹ d , (12) (24) Eventually, based on the vectors defined in Eq. (22)-(24), the PSSC, as a constrained finite-time control problem, is formulated: min kΞ(k + 1)k2 + kỹ d − y d (k)k1 X(k),U (k),ỹd subject to (13)   GA + βG x(k) − I + β H̃ ỹ d . (14) Eq. (14) can be written in the following form: ueq (k) = Kx(k) + Lỹ d (22) In a similar manner, the state and input vectors over the prediction horizon are defined as: X(k) = [x(k) · · · x(k + N )] (23) U (k) = [u(k) · · · u(k + N − 1)] and, the equivalent control input from Eq. (10) is calculated as:   ueq (k) = −(GB)−1 for the PSSC, as follows: Ξ(k + 1) = [ξ(k + 1) · · · ξ(k + N )]. (15) where, K = −(GB)−1 (GA + βG) and L = (GB)−1 (I + β)H̃. It can be seen from Eq. (15) that the equivalent control input has two terms, the standard state feedback term (Kx), and Lỹ d , which accounts for changes in the reference. In the second step, ueq from Eq. (15) is used as a terminal control input to determine the invariant set for tracking. To this end, the equivalent control input from Eq. (15) is plugged into Eq. (1): x(k + 1) = (A + BK)x(k) + BLỹ d . (16) The state (x) and ỹ d vectors are then augmented (w = [x⊺ ỹ ⊺d ]⊺ ) with respect to Eq. (15) to define the equivalent dynamic [1], [18] of the linear system in Eq. (1): w(k + 1) = Aeq w(k) (17) s(i) = Gx(i) − H̃ ỹ d , i=k+1,··· ,k+N ξ(i) = s(i + 1) + βs(i), i=k+1,··· ,k+N −1 x(i + 1) = Ax(i) + Bu(i), i=k,··· ,k+N −1 x(i) ∈ X , u(i) ∈ U, i=k,··· ,k+N −1 [x⊺ (k + N ) ỹ ⊺d ]⊺ ∈ T (25) ỹ d in Eq. (25) is now an optimization variable which is chosen by the PSCC optimization algorithm. Moreover, kỹ d − y d (k)k1 is an offset cost in order to account for the deviation of ỹ d from y d [1], [5]. It should be noted that the concept of second order sliding mode control is utilized to calculate the invariant set, via the equivalent control input ueq from Eq. (15), as a terminal constraint in the formulation of the PSSC. Moreover, in the absence of the constraints, and assuming a prediction horizon of N =1, the PSSC becomes the ideal second order DSMC. The feasibility and stability analysis of the proposed PSSC in Eq. (25) can be proven by exploiting the results from [1], [5], [17], with respect to the calculated invariant second order sliding domain from Eq. (20). This analysis is skipped here, as it is out of the scope of this paper. The next section centers on illustration of the PSSC for a challenging automotive control problem. IV. C ASE S TUDY: RCCI E NGINE C ONTROL where:  A + BK = 0m×n  BL . I m×m and, the projected domain of T (Eq. (20)) on the original state space (x) is called Z: Z = projx (T ). (21) An RCCI engine, with highly nonlinear and internally coupled dynamics is chosen for the case study in this paper. The RCCI is a promising engine technology with challenging control design issues. Its performance is sensitive to operating conditions, and the combustion can become unstable if not controlled properly. Moreover, the engine, as a nonlinear dynamic plant, is subject to actuator and state constraints. These features make the RCCI engine an appropriate candidate for evaluating the proposed PSSC, as it can be designed based on a linear structure, and be implemented on the nonlinear plant while enforcing the physical constraints. A. Predictive Controller Formulation In this section, the formulation of a predictive second order sliding controller (PSSC) is presented by incorporating the calculated invariant second order sliding domain for tracking from Eq. (20). The second order sliding variable from Eq. (13) over an N -step prediction horizon is constructed A. High Fidelity Physics-Based RCCI Model A high fidelity physics-based RCCI engine model from [19], [20] is used to evaluate the performance of the proposed PSSC. The model is developed, and has been experimentally validated, to predict start of combustion (SOC), crank angle for 50% fuel burnt (CA50), and indicated mean Aeq (18) Moreover, the state and input constraints can be re-written for the augmented system in Eq. (17) as: Weq = {w : [I n×n 0n×m ]w ∈ X , [K L]w ∈ U} (19) Finally, the invariant set (T ) is calculated as: T = {w : Akeq w ∈ Weq , ∀k ≥ 0 } (20) effective pressure (IMEP). The details of the high fidelity physics-based RCCI dynamic model, specifications of the RCCI engine (4-cylinder 2-liter GM engine), and experimental validation results of the model are available in [19]. The highly nonlinear nature of the physics-based RCCI model makes it difficult to use in the design of linear controllers. Thus, in order to design the PSSC for CA50 and IMEP tracking, first the high fidelity model is linearized around an operation point. The linearized model has four states in the state space: x = [CA50 Tsoc Psoc IM EP ]⊺ (26) where Psoc and Tsoc are pressure and temperature at SOC. The output vector (y) of the linear model is: y = [CA50 IM EP ]⊺ (27) and the control input vector is: u = [SOI F Q]⊺ (28) where, FQ is the total injected fuel quantity, and SOI is the start of injection. Since CA50 and IMEP are the only measurable outputs of the RCCI model, a Kalman filter is designed to estimate the Psoc and Tsoc , with respect to the linearized model [19]. The Kalman filter is updated every cycle based on the outputs of the high fidelity RCCI model. Finally, the PSSC is formulated to track the desired setpoints of IMEP and CA50 as shown in Fig. 1. Since both outputs of the linearized model have a relative degree of one with respect to either of the inputs, the vector of the first order sliding function is defined as follows:   CA50(k) − CA50target (k) s(k) = (29) IM EP (k) − IM EPtarget (k) and, the second order sliding function is calculated with respect to Eq. (8). The PSSC simulations on the RCCI model are performed in MATLAB® /SIMULINK® by using YALMIP [21] for formulating the optimization problem. The predication horizon is set to N =5 engine cycles. Fig. 1. Schematic of the designed predictive second order sliding controller for adjusting RCCI combustion phasing (CA50) and load (IMEP). B. Predictive Sliding Control of the RCCI Engine Figs. 2 shows the performance of the proposed PSSC and the second order DSMC in tracking variable CA50 and IMEP trajectories, where the high fidelity physics-based RCCI model is considered as the plant according to Fig. 1. The constraints on the control inputs are selected to avoid unstable combustion. The matrix (β) of the second order Fig. 2. CA50 and IM EP control using PSSC and second order DSMC. Plant: High Fidelity Model. Operating conditions: P R= 20, Tin = 333.1 K, Pin = 95 kPa, Ne = 1000 RP M , F Qmin =15 mg/cycle. sliding vector is the same for the PSSC and the second order DSMC. However, there are fundamental differences between the tracking performances of these two controllers. Since the original reference (yd ) is feasible, the admissible reference (ỹd ) is the same as yd . Thus, it is expected that by applying the second order DSMC to the physics-based RCCI model, the controller shows smooth and offset-free performance. However, Fig. 2-a and b show that overshoots occur during the early 10 cycles of the RCCI engine operation. Moreover, there are steady state errors in CA50 and IMEP tracking, specifically at higher CA50, and higher loads (IMEP). This deviation in the second order DSMC performance can be explained with respect to the error in the linearization process of the highly nonlinear physics-based RCCI model around specific operation point. By comparing the second order DSMC with PSSC in Fig. 2-a and b, it can be observed that the PSSC reacts to the upcoming changes in the reference trajectories faster than the second order DSMC. This is due to the fact that the PSSC takes into account the future information via the receding horizon strategy. By changing the constraints on the control signals, the performance of the tracking controller is considerably affected, as the reference trajectories may not be feasible anymore. Fig. 3 shows the influence of changing the operation bound of F Qmin from 15 mg/cycle in Fig. 2, to 19 mg/cycle. Due to the change in the control input constraint, the lower IMEP level is not reachable. Since the second order DSMC does not consider the future information and cannot handle the constraints on the control input, the calculated F Q signal saturates (Fig. 3-d), which results in a steady state error in IMEP tracking (Fig. 3-b). On the other hand, the proposed PSSC calculates the feasible (ỹd ) with respect to actual references (yd ). Based on the calculated feasible CA50 and IMEP references, the PSSC puts the efforts to reach the desired trajectories with Fig. 3. CA50 and IM EP control using PSSC and second order DSMC. Operating conditions: P R= 20, Tin = 333.1 K, Pin = 95 kPa, Ne = 1000 RP M , F Qmin =19 mg/cycle. lower steady state errors, and with no overshoots, compared to the second order DSMC. The better performance of the PSSC in tracking is due to its awareness of the reachable references, despite the error in the linearized RCCI model, and also the early reaction to the upcoming changes in the desired trajectories. The optimization algorithm of the PSSC determines the feasible reference (ỹd ), and provides a baseline to compare the behavior of the second order DSMC with the PSSC. The tracking results in Fig. 3 show that while the PSSC tracks the feasible IMEP reference accurately, the tracking performance for CA50 is not affected due to the constraint on the F Q, and the small steady state error is because of the error in the RCCI model linearizion. On the other side, because of the linearizion process error, and the saturation in the control signal of the second order DSMC, both CA50 and IMEP tracking are affected, and steady state errors can be seen for both references, specifically at higher loads (IMEP). Additionally, it can be observed that overshoots happen during the first 10 cycles of the second order DSMC operation, while the PSSC provides overshoot-free performance for both desired trajectories. The states of the RCCI engine are highly coupled. Thus, maintaining one of the outputs at a constant level, while the other output is set to follow a variable reference is challenging to achieve. For example, it is common to maintain an optimum CA50, while IMEP is changing. In order to evaluate the PSSC performance during these specific operating conditions, the simulations are performed for two different scenarios. In the first case, the objective is to maintain a constant CA50, while the desired IMEP is changing (Fig. 4a1−4 ). In the second case, it is desired to change CA50, while IMEP needs to be at a constant level of 600 kP a (Fig. 4-b1−4 ). This represents situations on the RCCI engine that CA50 needs to be changed due to engine-out emission constraint, or pressure rise rate constraint. It can be observed in Fig. 4 that despite the large over shoot at the be beginning of the engine operation from the second order DSMC, both PSSC and DSMC show acceptable IMEP tracking results (Fig. 4-a2 ). However, Fig. 4-a1 depicts that the DSMC is not able to maintain CA50 at the desired level, and there is an average error of 2 CAD for reference CA50 tracking from the second order DSMC. On the other side, the PSSC shows better CA50 tracking results with an average tracking error of 0.5 CAD. Similarly in Fig. 4-b, the PSSC outperforms the second order DSMC in maintaining the desired IMEP, while tracking the desired CA50 accurately. Specifically, it can be seen that the second order DSMC fails to keep IMEP at 600 kP a when the reference CA50 drops to 6 CAD at the 41th engine cycle. Additionally, the predictive controller does not have the large overshoots and steady state error as those seen in the second order DSMC. Finally, in order to evaluate the PSSC under the RCCI engine cyclic variability and measurement noise, the PSCC is studied in Fig. 5 for tracking the same CA50 and IMEP trajectories evaluated in Fig. 4. It can be observed that under the introduced measurement noise and cyclic variability, the PSSC is able to achieve the desired loads (IMEP), while maintaining CA50 at a constant level (Fig. 5-a1,2 ). Similarly, Fig. 5-b1,2 illustrates good PSSC performance with average tracking errors of 11.4 kPa and 0.4 CAD in maintaining the engine at a constant IMEP, while desired CA50 changes. V. S UMMARY AND C ONCLUSIONS A new formulation of a predictive sliding controller based on the concept of second order sliding mode, in combination with MPC, was presented in this paper for tracking of constrained linear systems. A virtual reference, as the admissible reference, was added to the cost function of the predictive controller to account for the changes in the setpoint. Since inclusion of the virtual reference requires computation of a terminal set to guarantee the feasibility of the proposed predictive second order sliding controller (PSSC), an extended invariant second order sliding domain was calculated based on the augmented state space of the system states and the virtual reference. The performance of the proposed PSSC was demonstrated in a multi-input multi-output structure for a highly nonlinear and internally coupled RCCI engine tracking problem. An experimentally validated physics-based model of an RCCI engine was used to design and assess the proposed PSSC for simultaneous load (IMEP) and combustion phasing (CA50) tracking under hard constraints on the control inputs of the engine. Comparing to the second order DSMC, the proposed PSSC showed better tracking results, with minimum steady state error, and no overshoot for different tracking scenarios. Moreover, the simulation results confirm the robustness of the PSSC under measurement noise and the engine cyclic variability. ACKNOWLEDGMENT Dr. Andreas Hansen from University of California, Berkeley, and Mr. Akshat Raut from Michigan Tech are gratefully acknowledged for their technical comments during the course of this study. Fig. 4. CA50 and IM EP control using PSSC and second order DSMC for maintaining (a) constant CA50, and (b) constant IM EP . Operating conditions: P R= 20, Tin = 333.1 K, Pin = 95 kPa, Ne = 1000 RP M , F Qmin =15 mg/cycle (a1 ) CA50 [o aTDC] 12 10 10 8 Reference (yd ) PSSC (Constant CA50) 6 5 4 (a2 ) 600 IMEP [kPa] (b1 ) 15 14 (b2 ) 700 Reference (yd ) PSSC (Constant IMEP) 650 550 600 500 550 450 500 0 50 100 0 Engine Cycle No. 50 100 Engine Cycle No. Fig. 5. CA50 and IM EP control using PSSC under measurement noise and cyclic variability for (a) constant CA50, and (b) constant IM EP . Operating conditions: P R= 20, Tin = 333.1 K, Pin = 95 kP a, Ne =1000 RP M , cyclic variability of 2o for CA50, and 25 kP a for IM EP , based on the RCCI engine experimental data in [19]. R EFERENCES [1] D. Limón, I. Alvarado, T. Alamo, and E.F. Camacho. MPC for Tracking Piecewise Constant References for Constrained Linear Systems. Automatica, 44(9):2382–2387, 2008. [2] A. Ferramosca, D. Limón, I. Alvarado, T. Alamo, and E.F. Camacho. MPC for Tracking with Optimal Closed-loop Performance. Automatica, 45(8):1975–1978, 2009. [3] A. Ferramosca, D. Limón, I. Alvarado, T. Alamo, F. Castaño, and E.F. Camacho. Optimal MPC for Tracking of Constrained Linear Systems. International Journal of Systems Science, 42(8):1265–1276, 2011. [4] E. Garone, S. Di Cairano, and I. Kolmanovsky. Reference and command governors for systems with constraints: A ssurvey on theory and applications. Automatica, 75:306–328, 2017. [5] A. Hansen, Y. Li, and J.K. Hedrick. Invariant Sliding Domains for Constrained Linear Receding Horizon Tracking Control. IFAC Journal of Systems and Control, 2:12–17, 2017. [6] J.-J.E. Slotine and W. Li. “Applied Nonlinear Control”. Prentice-hall Englewood Cliffs, NJ, Chapters 7 & 8, 1991. [7] A. Hansen and J. Hedrick. Receding Horizon Sliding Control for Linear and Nonlinear Systems. ACC, 2015. Chicago, IL, USA. [8] M. R. Amini, M. Shahbakhti, and S. Pan. MIMO First and Second Order Discrete Sliding Mode Controls of Uncertain Linear Systems Under Implementation Imprecisions. ASME DSCC, 2017. Tysons Corner, VA, USA. [9] M. R. Amini, M. Shahbakhti, S. Pan, and J. K. Hedrick. Discrete Adaptive Second Order Sliding Mode Controller Design with Application to Automotive Control Systems with Model Uncertainties. ACC, 2017. Seattle, WA, USA. [10] M. Mihoub, A. Nouri, and R. Abdennour. Real-Time Application of Discrete Second Order Sliding Mode Control to a Chemical Reactor. Control Engineering Practice, 17(9):1089–1095, 2009. [11] T. Salgado-Jimenez, J. Spiewak, P. Fraisse, and B. Jouvencel. A Robust Control Algorithm for AUV: Based on a High Order Sliding Mode. OCEANS’04. MTTS/IEEE TECHNO-OCEAN’04, 2004. Kobe, Japan. [12] H. Sira-Ramirez. Structure at Infinity, Zero Dynamics and Normal Forms of Systems Undergoing Sliding Motions. International Journal of Systems Science, 21(4):665–674, 1990. [13] M.R. Amini, M. Shahbakhti, S. Pan, and K. Hedrick. Bridging the Gap Between Designed and Implemented Controllers via Adaptive Robust Discrete Sliding Mode Control. Control Eng. Practice, 59:1–15, 2017. [14] A. Mozaffari, N.L. Azad, A. Hansen, and J.K. Hedrick. A Receding Horizon Sliding Controller for Automotive Engine Coldstart: Design and Hardware-in-the-Loop Testing with an Echo State Network HighFidelity Model. Asian Journal of Control, 18(4):1219–1238, 2016. [15] D.A. Splitter, R.M. Hanson, S.L. Kokjohn, and R.D. Reitz. Improving Engine Performance by Optimizing Fuel Reactivity with a Dual Fuel PCCI Strategy. Conference on Thermo and Fluid Dynamic Processes in Diesel Engines, 2010. Valencia, Spain. [16] A.V. Kraev, A.I. Rogovskii, and V.V. Fomichev. On a Generalization of Relative Degree. Differential Equations, 50(8):1122–1127, 2014. [17] D. Limon, I. Alvarado, T. Alamo, and E.F. Camacho. MPC for Tracking of Piece-Wise Constant References for Constrained Linear Systems. 16th Triennial World Congress, 2005. Prague, Czech Rep. [18] S. Spurgeon. Hyperplane Design Techniques for Discrete-Time Variable Structure Control Systems. Int. J. of Control, 55(2):445–456, 1992. [19] A. Raut, M. Bidarvatan, H. Borhan, and M. Shahbakhti. Closed-Loop Combustion Control of an RCCI Engine. ACC, 2018. Milwaukee, WI, USA. [20] N.N.T. Kondipati, J.K. Arora, M. Bidarvatan, and M. Shahbakhti. Modeling, Design and Implementation of a Closed-Loop Combustion Controller for an RCCI Engine. ACC, 2017. Seattle, WA, USA. [21] J. Lofberg. YALMIP: A toolbox for modeling and optimization in MATLAB. In 2004 IEEE Int. Symp. on Computer Aided Control Sys. Design. IEEE, 2004. New Orleans, LA, USA.
3cs.SY
ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES FOR REGULAR LOCAL RINGS arXiv:1703.00756v1 [math.AC] 2 Mar 2017 MONIREH SEDGHI, KAMAL BAHMANPOUR AND REZA NAGHIPOUR† Abstract. Let a denote an ideal in a regular local (Noetherian) ring R and let N be a finitely generated R-module with support in V (a). The purpose of this paper is to show that all homomorphic images of the R-modules ExtjR (N, Hai (R)) have only finitely many associated primes, for all i, j ≥ 0, whenever dim R ≤ 4 or dim R/a ≤ 3 and R contains a field. In addition, we show that if dim R = 5 and R contains a field, then the R-modules ExtjR (N, Hai (R)) have only finitely many associated primes, for all i, j ≥ 0. 1. Introduction In the present paper we continue the study of the finiteness properties of local cohomology modules for regular local rings. An interesting problem in commutative algebra is determining when the set of associated primes of the i-th local cohomology module Hai (R) of a Noetherian ring R with support in an ideal a of R, is finite. This question was raised by Huneke in [11] at the Sundance Conference in 1990. Examples given by A. Singh [25] (in the non-local case) and M. Katzman [16] (in the local case) show there exist local cohomology modules of Noetherian rings with infinitely many associated primes. However, in recent years there have been several results showing that this conjecture is true in many situations. The first result were obtained by Huneke and Sharp. In fact, Huneke and Sharp [12] (in the case of positive characteristic) have shown that, if R is a regular local ring containing a field, then Hai (R) has only finitely many associated primes for all i ≥ 0. Subsequently, G. Lyubeznik in [13] and [14] showed this result for unramified regular local rings of mixed characteristic and in characteristic zero. Further, Lyubeznik posed the following conjecture: Conjecture. If R is a regular ring and a an ideal of R, then the local cohomology modules Hai (R) have finitely many associated prime ideals for all i ≥ 0. While this conjecture remains open in this generality, several nice results are now available, see [3, 10, 19]. In lower dimensional cases, Marley in [19] showed that the set of associated prime ideals of the local cohomology modules Hai (M) is finite if R is a local ring Key words and phrases. Associated prime, cofinite module, local cohomology, minimax module, regular ring, weakly Laskerian module. 2010 Mathematics Subject Classification: 13D45, 14B15, 13H05. This research was in part supported by a grant from Azarbaijan Shahid Madani University (No. 217/d/917). † Corresponding author: e-mail: [email protected] (Reza Naghipour). 1 2 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR of dimension d and a an ideal of R, M is a finitely generated R-module, in the following cases: (1) d ≤ 3; (2) d ≤ 4 and R has an isolated singularity; (3) d = 5 and R is an unramified regular local ring and M is torsion-free. For a survey of recent developments on finiteness properties of local cohomology modules, see Lyubezniks interesting paper [15]. The purpose of this paper is to provide some results concerning the set of associated primes of the local cohomology modules for a regular local ring, that almost results are extensions of Marley’s results on local cohomology modules over the strong ring (i.e. the regular local ring containing a field). Namely, we show that, for a finitely generated module N over a regular local ring R with support in V (a), the R-modules ExtjR (N, Hai (R)) are weakly Laskerian, for all i, j ≥ 0, whenever dim R ≤ 4 or dim R/a ≤ 3 and R contains a field. In addition, we show that if dim R = 5, then, for all i, j ≥ 0, the R-module ExtjR (N, Hai (R)) has only finitely many associated primes, when R contains a field. We say that an R-module M is said to be weakly Laskerian if the set of associated primes of any quotient module of M is finite [6]. Our main result in Section 2 is to establish some finiteness results of local cohomology modules for a regular local ring R with respect to an ideal a with dim R/a ≤ 3. More precisely, we prove the following. Theorem 1.1. Let R be a regular local ring containing a field with dim R = d ≥ 3, and let a be an ideal of R such that dim R/a ≤ 3. Then ExtjR (R/a, Hai (R)) is weakly Laskerian, for all i, j ≥ 0. The result of Theorem 1.1 is proved in Section 2. Pursuing this point of view further, we obtain the following consequence of Theorem 1.1, which is an extension of Marley’s result in [19]. Corollary 1.2. Let R be a regular local ring of dimension d ≤ 4 containing a field and a an ideal of R. Then, for any finitely generated R-module N with Supp(N) ⊆ V (a), the R-module ExtnR (N, Hai (R)) is weakly Laskerian, for all integers n, i ≥ 0. It will be shown in Section 3 that the subjects of Section 2 can be used to prove a finiteness result of local cohomology modules for a regular local ring of dimension 5. In fact, we will generalize the main result of Marley for a regular local ring of dimension 5. More precisely, we shall show that: Theorem 1.3. Let R be a regular local ring containing a field with dim R = 5 and let a be an ideal of R. Then the set AssR ExtnR (N, Hai (R)) is finite, for each finitely generated R-module N with support in V (a) and for all integers n, i ≥ 0. The proof of Theorem 1.3 is given in Section 3. The following proposition will be one of our main tools for proving Theorem 1.3. Proposition 1.4. Let R be a regular local ring of dimension d, and let a be an ideal of R with height a = 1. Then the set AssR ExtiR (N, Ha1(R)) is finite for each finitely generated R-module N with support in V (a) and for all integers i ≥ 0. As a consequence of Theorem 1.3 we derive the following result. ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 3 Theorem 1.5. Let R be a regular local ring containing a field such that dim R ≤ 5, and let a be an ideal of R. Then, for all integers n, i ≥ 0 and any finitely generated R-module N with support in V (a), the set AssR ExtnR (N, Hai (R)) is finite. Finally, in this section we will show that, if M is a finitely generated module over a regular local ring R with dim R ≤ 4, then for any finitely generated R-module N with support in V (a), the R-module ExtnR (N, Hai (M)) is weakly Laskerian, for all integers i, n ≥ 0. In particular the set AssR Hai (M) is finite, for all integers i, n ≥ 0. Hartshorne [9] introduced the notion of a cofinite module, answering in negative a question of Grothendieck [8, Exposé XIII, Conjecture 1.1]. In fact, Grothendieck asked if the modules HomR (R/a, Hai (M)) always are finitely generated for any ideal a of R and any finitely generated R-module M. This is the case when a = m, the maximal ideal in a local ring, since the modules Hmi (M) are Artinian. Hartshorne defined an R-module M to be a-cofinite if the support of M is contained in V (a) and ExtiR (R/a, M) is finitely generated for all i ≥ 0. In [26], H. Zöschinger, introduced an interesting class of minimax modules, and he has in [26, 27] given many equivalent conditions for a module to be minimax. An R-module N is said to be a minimax module, if there is a finitely generated submodule L of N, such that N/L is Artinian. The class of minimax modules thus includes all finitely generated and all Artinian modules. Also, an R-module M is called a-cominimax if the support of M is contained in V (a) and ExtiR (R/a, M) is minimax for all i ≥ 0. The concept of the a-cominimax modules is introduced in [2]. Throughout this paper, R will always be a commutative Noetherian ring with non-zero identity and a will be an ideal of R. For an R-module M, the i-th local cohomology module of M with respect to a is defined as Hai (M) = lim ExtiR (R/an , M). −→ n≥1 We refer the readers to [7] and [5] for more details on local cohomology. We shall use Min(a) to denote the set of all minimal primes of a. For each R-module L, we denote by AsshR L the set {p ∈ AssR L : dim R/p = dim L}. Also, for any ideal b of R, we denote {p ∈ Spec R : p ⊇ b} by V (b). Finally, for any ideal c of R, the radical of c, denoted by Rad(c), is defined to be the set {x ∈ R : xn ∈ c for some n ∈ N}. For any unexplained notation and terminology we refer the readers to [5] and [21]. 2. Finiteness of local cohomology modules for ideals of small dimension The purpose of this section is to study the finiteness properties of local cohomology modules for a regular local ring R with respect to an ideal a of R with dim R/a ≤ 3. The main goal is Theorem 2.7, which plays a key role in Section 3. This result extends a main result of T. Marley [19]. The following lemmas and proposition will be needed in the proof of Theorem 2.7. Theorem 2.1. (Huneke-Sharp and Lyubeznik). Let (R, m) be a regular local ring containing a field. Then for each ideal a of R and all integers i ≥ 0, the set of associated primes of the local cohomology modules Hai (R) are finite. 4 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR Proof. See [12, 13, 14].  Lemma 2.2. Let (R, m) be a regular local ring containing a field with dim R = d ≥ 3. Let p1 , . . . , pn be prime ideals of R such that dim R/pi = 3 for all i = Tn1, . . . , n. Then d j Ha (R) = 0 and Supp(Ha (R)) is finite, for j = d − 1, d − 2, where a := i=1 pi . Proof. It follows easily from Lichtenbaum-Hartshorne and Grothendieck’s vanishing theorems that Had (R) = 0, Supp(Had−1 (R)) ⊆ {m} and for each q ∈ Supp(Had−2 (R)) we have dim R/q ≤ 1. Therefore dim Supp(Had−2 (R)) ≤ 1, and so Supp(Had−2 (R)) ⊆ AsshR Had−2 (R) ∪ {m}. Now it follows from Lemma 2.1 that Supp(Had−2 (R)) is a finite set, as required.  Corollary 2.3. Let (R, m) and a be as in Lemma 2.2. Then ExtiR (R/a, Haj (R)) is a weakly Laskerian R-module for all i ≥ 0 and for j = d − 1, d − 2. Proof. The result follows easily from Lemma 2.2.  The next lemma was proved by Melkersson for a-cofiniteness. The proof given in [22, Proposition 3.11] can be easily carried for weakly Laskerian modules. Lemma 2.4. Let R be a Noetherian ring, a an ideal of R, and M an R-module such that ExtiR (R/a, M) is a weakly Laskerian R-module for all i. If t is a non-negative integer such that the R-module ExtiR (R/a, Haj (M)) is weakly Laskerian, for all i and all j 6= t, then this is the case also when j = t. Proposition 2.5. Let (R, m) be a regular local ring containing a field with dim R = d ≥ 3. Let pT 1 , . . . , pn be prime ideals of R such that dim R/pi = 3, for all i = 1, . . . , n, and let a := ni=1 pi . Then ExtiR (R/a, Haj (R)) is a weakly Laskerian R-module for all i, j ≥ 0. Proof. If Hai (R) 6= 0, then it follows from Lemma 2.2 and [5, Theorems 6.1.2 and 6.2.7] that i ∈ {d −3, d −2, d −1}. Whence, the assertion follows from Corollary 2.3 and Lemma 2.4.  The next result was proved by Kawasaki for finitely generated modules. The proof given in [17, Lemma 1] can be easily carried for weakly Laskerian modules. Lemma 2.6. Let R be a Noetherian ring, T an R-module, and a an ideal of R. Then the following conditions are equivalent: (i) ExtnR (R/a, T ) is weakly Laskerian for all n ≥ 0. (ii) For any finitely generated R-module N with support in V (a), ExtnR (N, T ) is weakly Laskerian for all n ≥ 0. We now are prepared to prove the main theorem of this section, which shows that when R is a regular local ring contains a field and a an ideal of R such that dim R/a ≤ 3, then all homomorphic images of the R-modules ExtjR (R/a, Hai (R)) have only finitely many associated primes. Theorem 2.7. Let (R, m) be a regular local ring containing a field with dim R = d ≥ 3, and let a be an ideal of R such that dim R/a ≤ 3. Then the R-module ExtjR (R/a, Hai (R)) is weakly Laskerian, for all i, j ≥ 0. ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 5 Proof. In view of [4, Corollaries 2.7 and 3.2], we may assume that dim R/a = 3. Then we have grade a = d − 3. Hence, by virtue of [5, Theorems 6.1.2 and 6.2.7], Hai (R) = 0, whenever i 6∈ {d−3, d−2, d−1}. Moreover, by [23, Corollary 3.3], the set Supp(Had−1 (R)) is finite, in view of Proposition 2.5, it is enough for us to show that the R-module ExtjR (R/a, Had−3(R)) is weakly Laskerian. To this end, let X := {p ∈ Min(a) | height p = d − 3} and Y := {p ∈ Min(a) | height p ≥ d − 2}. T Then X 6= ∅. Set b = p∈X p. If Y = ∅, then Rad(a) = b, and so the assertion follows T from Proposition 2.5. Therefore we may assume that Y 6= ∅. Let c = p∈Y p. Then Rad(a) = b ∩ c and height c ≥ d − 2. Next, we show that height (b + c) ≥ d − 1. Suppose the contrary is true. Then there exists a prime ideal q of R such that b + c ⊆ q and height q = d − 2. Therefore there exist p1 ∈ X and p2 ∈ Y such that p1 + p2 ⊆ q. Since height p2 ≥ d − 2, it follows that q = p2 , and so p1 & p2 , which is a contradiction (note that p1 , p2 ∈ Min(a)). Consequently, grade (b + c) ≥ d − 1 and grade c ≥ d − 2. Therefore, it follows from [5, Theorem 6.2.7], that d−3 d−2 Hb+c (R) = 0 = Hb+c (R) and Hcd−3 (R) = 0. It now follows from Rad(a) = b ∩ c and the Mayer-Vietoris sequence (see [5, Theorem 3.2.3]), that Had−3 (R) ∼ = Hbd−3 (R), and so by Proposition 2.5, the R-module j ExtR (R/b, Had−3(R)) is weakly Laskerian, for all j ≥ 0. On the other hand, since dim R/(b + c) ≤ 1, it is easy to see that V (b + c) = AsshR R/(b + c) ∪ {m}. Now, as Supp(ExtiR (R/c, Hbd−3(R))) ⊆ V (b + c), it follows that ExtiR (R/c, Hbd−3(R)) is a weakly Laskerian R-module, for all i ≥ 0. Also, as Supp(ExtiR (R/b + c, Hbd−3 (R))) ⊆ V (b + c), analogous to the preceding, we see that the R-module ExtiR (R/b + c, Hbd−3(R)) is also weakly Laskerian for all i ≥ 0. Now, the exact sequence 0 −→ R/ Rad(a) −→ R/b ⊕ R/c −→ R/b + c −→ 0, induces the long exact sequence · · · −→ ExtiR (R/b, Had−3 (R)) ⊕ ExtiR (R/c, Had−3(R)) −→ ExtiR (R/ Rad(a), Had−3 (R)) −→ ExtiR (R/b + c, Had−3(R)) −→ · · · , which shows that the R-module ExtiR (R/ Rad(a), Had−3 (R)) is weakly Laskerian, for all i ≥ 0, and so it follows from Lemma 2.6 that, the R-module ExtiR (R/a, Had−3(R)) is weakly Laskerian, for all i ≥ 0, as required.  6 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR Corollary 2.8. Let (R, m) be a regular local ring of dimension d ≥ 3 containing a field, and let a be an ideal of R such that dim R/a ≤ 3. Then, for any finitely generated Rmodule N with Supp(N) ⊆ V (a), the R-module ExtnR (N, Hai (R)) is weakly Laskerian, for all integers n, i ≥ 0. Proof. The result follows from Theorem 2.7 and Lemma 2.6.  Corollary 2.9. Let (R, m) be a regular local ring of dimension d ≤ 4 containing a field, and a an ideal of R. Then, for any finitely generated R-module N with Supp(N) ⊆ V (a), the R-module ExtnR (N, Hai (R)) is weakly Laskerian, for all integers n, i ≥ 0. Proof. Since R is regular local, so dim R/a = 4 if and only if a = 0. Thus, the assertion is clear in the case of dim R/a = 4. Moreover, the case dim R/a = 3 follows from Corollary 2.8. Also, the case dim R/a = 2 follows from [4, Theorem 3.1] and Lemma 2.4. Finally, if dim R/a ≤ 1, then the assertion follows from [4, Theorem 2.6] and [17, Lemma 1].  3. Finiteness of local cohomology modules for regular local rings of small dimension It will be shown in this section that the subjects of the previous section can be used to prove the finiteness of local cohomology modules for a regular local ring R with dim R = 5. The main result is Theorem 3.4. The following proposition will serve to shorten the proof of that theorem. The following easy lemma will be used in Proposition 3.2. f g Lemma 3.1. Let R be a Noetherian ring and let M ′ −→ M −→ M ′′ be an exact sequence of R-modules such that M ′ is weakly Laskerian and M ′′ has only finitely many associated primes. Then M has only finitely many associated primes. Proof. The assertion follows from the exact sequence 0 −→ M ′ /Im g −→ M −→ Im g −→ 0, by applying [21, Theorem 6.3].  Proposition 3.2. Let (R, m) be a d-dimensional regular local ring, and a an ideal of R such that height a = 1. Then the set AssR ExtiR (N, Ha1 (R)) is finite, for each finitely generated R-module N with support in V (a) and for all integers i ≥ 0. Proof. Let X := {p ∈ Min(a) | height p = 1} and Y := {p ∈ Min(a) | height p ≥ 2}. T Then X 6= ∅. Let b = p∈X p. Since R is a UFD, it follows from [21, Exercise 20.3] that b is a principal ideal, and so there is an element x ∈ R such that b = Rx. Hence, if Y = ∅, then Rad(a) = Rx, and so it follows from [18, Theorem 1] that, the R-module ExtiR (N, Ha1(R)) is finitely generated. Thus the set AssR ExtiR (N, Ha1 (R)) is T finite. Therefore, we may assume that Y 6= ∅. Then Rad(a) = Rx ∩ c, where c = p∈Y p. It is easy to see that height c ≥ 2 and height (b + c) ≥ 3. Whence, by using the Mayer-Vietoris sequence it yields that Ha1 (R) ∼ = Hb1 (R). Therefore, by [18, Theorem 1], the R-module 1 Ha (R) is b-cofinite. ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 7 On the other hand, according to Artin-Rees lemma, there exists a positive integer n such that bn N ∩ Γb (N) = 0 = cn N ∩ Γc (N). We claim that bn N ∩ cn N = 0. To this end, suppose that q ∈ AssR (bn N ∩ cn N). Then q = (0 :R y), for some y(6= 0) ∈ bn N ∩ cn N. As Supp(N) ⊆ V (a), it follows that a ⊆ q, and so b ∩ c ⊆ q. Thus b ⊆ q or c ⊆ q, and so y ∈ Γb (N) or y ∈ Γc (N). Furthermore, since y ∈ bn N ∩ cn N, it follows that y = 0, which is a contradiction. Now, since bn N ∩ cn N = 0, the exact sequence 0 −→ N −→ N/bn N ⊕ N/cn N −→ N/(bn + cn )N −→ 0, induces the long exact sequence · · · −→ ExtiR (N/bn N, Ha1(R)) ⊕ ExtiR (N/cn N, Ha1 (R)) −→ ExtiR (N, Ha1 (R)) n n 1 −→ Exti+1 R (N/(b + c )N, Ha (R)) −→ · · · . Since Ha1 (R) is b-cofinite and (†) Supp(N/(bn + cn )N) ⊆ Supp(N/bn N) ⊆ V (b), it follows from [17, Lemma 1] that the R-modules ExtiR (N/bn N, Ha1 (R)) and ExtiR (N/(bn + cn )N, Ha1(R)) are finitely generated for all i ≥ 0. Next, let T := N/cn N and we show that ExtiR (T, Ha1 (R)) is also b-cofinite for all i ≥ 0. To do this, since Supp(Γb (T )) ⊆ V (b) it follows from [17, Lemma 1] that the R-module ExtiR (Γb (T ), Ha1(R)) is finitely generated for each i ≥ 0. Hence it is enough to show that the R-module ExtiR (T /Γb (T ), Ha1(R)) is finitely generated. As T /Γb (T ) is b-torsion-free, we therefore make the additional assumption that T is a b-torsion-free R-module. Then in view of [5, Lemma 2.11], x is a non-zerodivisor on T , and so the exact sequence x 0 −→ T −→ T −→ T /xT −→ 0 induces the long exact sequence x · · · −→ ExtiR (T /xT, Ha1 (R)) −→ ExtiR (T, Ha1 (R)) −→ ExtiR (T, Ha1 (R)) 1 −→ Exti+1 R (T /xT, Ha (R)) −→ · · · . (††) Since Supp(T /xT ) ⊆ V (b) it follows from [17, Lemma 1] that ExtiR (T /xT, Ha1 (R)) is a finitely generated R-module, for all i ≥ 0, (note that b = Rx). Consequently, it follows from the exact sequence (††) that the R-modules (0 :ExtiR (T,Ha1 (R)) x) and ExtiR (T, Ha1(R))/xExtiR (T, Ha1 (R)) are finitely generated and hence b-cofinite. Therefore it follows from Melkersson’s result [22, Corollary 3.4] that the R-module ExtiR (T, Ha1 (R)) is b-cofinite for all i ≥ 0. Now, let Ω := ExtiR (N/bn N, Ha1 (R)) ⊕ ExtiR (N/cn N, Ha1 (R)). Then for every finitely generated submodule L of Ω the R-module Ω/L is also b-cofinite, and so the set AssR Ω/L is finite. Now, it follows from the exact sequence (†) and Lemma 3.1 that the set 8 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR AssR ExtiR (N, Ha1 (R)) is finite, as required.  The next lemma was proved in [1] in the case R is local. The proof given in [1, Lemma 2.5] can be easily carried over Noetherian rings, so that we omit the proof. Lemma 3.3. Let R be a Noetherian ring, x an element of R and a an ideal of R such that a ⊆ Rad(Rx). Then, for any finitely generated R-module M, the R-homomorphism x Haj (M) −→ Haj (M) is an isomorphism, for each j ≥ 2. We are now ready to state and prove the main theorem of this section. Theorem 3.4. Let (R, m) be a five-dimensional regular local ring containing a field and a an ideal of R. Then the set AssR ExtnR (N, Hai (R)) is finite, for each finitely generated R-module N with support in V (a) and for all integers n, i ≥ 0. Proof. Since dim R/a = 5 if and only if a = 0, the assertion is clear in this case. Hence we consider the case when dim R/a ≤ 4. If dim R/a ≤ 3, then the result follows from the proof of Corollary 2.8. Therefore, we may assume that dim R/a = 4. Then height(a) = 1 and in view of the Lichtenbaum-Hartshorne vanishing theorem Ha5 (R) = 0. Whence Hai (R) = 0 whenever i 6∈ {1, 2, 3, 4}. Also, since by [23, Corollary 3.3], the set Supp(Ha4 (R)) is finite, it follows from Supp(ExtnR (N, Ha4 (R))) ⊆ Supp(Ha4 (R)) that the set AssR ExtnR (N, Ha4 (R)) is also finite. Consequently, in view of Proposition 3.2, we may consider the cases i = 2, 3. Case 1. i = 2. Suppose that X := {p ∈ Min(a) | height p = 1} and Y := {p ∈ Min(a) | height p ≥ 2}. T T Then X 6= ∅ and Y 6= ∅. Let b = p∈X p and c = p∈Y p. Since R is a UFD, it follows from [21, Ex. 20.3] that b is a principal ideal, and so there is an element x ∈ R such that b = Rx. Moreover, Rad(a) = Rx ∩ c, height c ≥ 2, and in view of Proposition 3.2, 1 1 ∼ 1 module. As we have S Ha (R) = Hb (R). Thus, by [18, Theorem 1], Ha (R) is a b-cofinite S c 6⊆ p∈X p, it follows that there is an element y ∈ c such that y 6∈ p∈X p. Now, in view of [24, Corollary 3.5], there exists the exact sequence 1 1 2 0 2 0 −→ HRy (HRx (R)) −→ HRx+Ry (R) −→ HRy (HRx (R)) −→ 0, 2 1 1 2 and so HRx+Ry (R) ∼ (HRx (R)), (note that HRx (R) = 0). = HRy Using again [24, Corollary 3.5], to show that there exists the exact sequence 1 2 0 0 −→ HRy (Ha1 (R)) −→ Ha+Ry (R) −→ HRy (Ha2 (R)) −→ 0, (†) and so it follows from Ha1 (R) ∼ = Hb1 (R) that H 1 (H 1 (R)) ∼ (R). = H 1 (H 1(R)) = H 1 (H 1 (R)) ∼ = H2 Ry a Ry b Ry Rx Also, since xy ∈ Rad(a), it follows that the R-module using Lemma 3.3, it is easy to see that the R-module Rx+Ry Ha2 (R) Ha2 (R) is R(yx)-torsion. Hence is Ry-torsion. That is ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 9 0 HRy (Ha2 (R)) = Ha2 (R). Consequently, from the exact sequence (†) we get the following exact sequence, 2 2 0 −→ HRx+Ry (R) −→ Ha+Ry (R) −→ Ha2 (R) −→ 0. (††) Furthermore, in view of Proposition 3.2, there exists a positive integer n such that the sequence 0 −→ N −→ N/bn N ⊕ N/cn N −→ N/(bn + cn )N −→ 0 is exact, and so we obtain the long exact sequence · · · −→ ExtiR (N/bn N, Ha2(R)) ⊕ ExtiR (N/cn N, Ha2 (R)) −→ ExtiR (N, Ha2 (R)) n n 2 −→ Exti+1 R (N/(b + c )N, Ha (R)) −→ · · · . (†††) Since Supp(N/(bn + cn )N) ⊆ Supp(N/bn N) ⊆ V (b), it follows from Lemma 3.3 that ExtjR (N/bn N, Ha2 (R)) = 0 = ExtjR (N/(bn + cn )N, Ha2 (R)), for all j ≥ 0. Whence, the exact sequence (†††) implies that j Extj (N, H 2(R)) ∼ = Ext (N/cn N, H 2(R)). R a R a Next, it is easy to see that height(Rx + Ry) = 2, and so height(a + Ry) = 2. Thus dim R/(a + Ry) = 3, and hence as Supp(N/cn N) ⊆ V (c) ⊆ V (a + Ry), 2 it follows from Corollary 2.8 that the R-module ExtjR (N/cn N, Ha+Ry (R)) is weakly Laskerian, for all j ≥ 0. Also, as grade(Rx + Ry) = 2, it follows from [5, Theorem 3.3.1] and [22, Proposition 2 3.11] that, the R-module HRx+Ry (R) is Rx+Ry-cofinite. Now, by modifying the argument 2 of the proof of Proposition 3.2, one can see that the R-module ExtjR (N/cn N, HRx+Ry (R)) j n 2 is Rx-cofinite for all j ≥ 0. In particular, AssR ExtR (N/c N, HRx+Ry (R)) is a finite set, for all j ≥ 0. Moreover, from the exact sequence (††), we deduce the long exact sequence 2 · · · −→ ExtjR (N/cn N, Ha+Ry (R)) −→ ExtjR (N/cn N, Ha2 (R)) n 2 −→ Extj+1 R (N/c N, HRx+Ry (R)) −→ · · · . Now using Lemma 3.1 and the above long exact sequence induced, it follows from the isomorphism j ExtjR (N, Ha2(R)) ∼ = ExtR (N/cn N, Ha2(R)), that the set AssR ExtjR (N, Ha2(R)) is finite. Case 2. i = 3. Let X 6= ∅, Y 6= ∅ and y be as in the case 1. Then using the same argument, it follows from Lemma 3.3 that the R-modules Ha2 (R) and Ha3 (R) are Ry-torsion. Thus 0 1 (Ha3 (R)) = Ha3 (R). HRy (Ha2 (R)) = 0 and HRy 10 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR Therefore, using the exact sequence 1 3 0 0 −→ HRy (Ha2 (R)) −→ Ha+Ry (R) −→ HRy (Ha3 (R)) −→ 0, (†) 3 (see [24, Corollary 3.5]), we obtain that Ha3(R) ∼ (R). = Ha+Ry Moreover, it follows easily from the exact sequence 0 −→ N −→ N/bn N ⊕ N/cn N −→ N/(bn + cn )N −→ 0, that j ExtjR (N, Ha3(R)) ∼ = ExtR (N/cn N, Ha3(R)), 3 for all j ≥ 0. Hence, for all j ≥ 0 the R-module ExtjR (N/cn N, Ha+Ry (R)) is weakly j n 3 Laskerian, and so ExtR (N/c N, Ha (R)) is also a weakly Laskerian R-module. Therefore ExtjR (N, Ha3(R)) is a weakly Laskerian R-module, and hence it has finitely many associated primes, as required.  Theorem 3.5. Let (R, m) be a regular local ring containing a field such that dim R ≤ 5, and let a be an ideal of R. Then, for all integers n, i ≥ 0 and any finitely generated R-module N with support in V (a), the set AssR ExtnR (N, Hai (R)) is finite. Proof. The assertion follows from Corollary 2.8 and Theorem 3.4.  The final theorem of this section shows that if R is a regular local ring with dim R ≤ 4, then the R-module Hai (M) has finitely many associated primes, for all i ≥ 0 and for any finitely generated M over R. Recall that, an R-module L is called an a-cominimax module [2] if Supp(L) ⊆ V (a) and ExtiR (R/a, L) is minimax, for all i ≥ 0. Theorem 3.6. Let (R, m) be a regular local ring such that dim R ≤ 4. Suppose that a is an ideal of R and M a finitely generated R-module. Then for all integers i, j ≥ 0, the R-module Extj (R/a, Hai (M)) is weakly Laskerian. Proof. If dim R ≤ 3, then by virtue of [1, Theorem 2.12], the R-modules Hai (M) are acominimax, and so the R-module Extj (R/a, Hai (M)) is weakly Laskerian. Hence we may assume that dim R = 4. Now if dim R/a = 4, then a = 0 and so the result holds. Also, case dim R/a ≤ 2 follows from [4, Corollary 3.2]. Hence we may assume that dim R/a = 3. Then we have heigth(a) = 1. On the other hand, if dim M ≤ 2 then in view of [4, Corollary 2.7] and [22, Proposition 5.1], the R-module Hai (M) is a-cofinite, and so the result is clear. Also, in the case of dim M = 3, the assertion follows from [22, Proposition 5.1], [23, Corollary 3.3], the Grothendieck Vanishing Theorem and Lemma 2.4. Therefore we may assume that dim M = 4. Then in view of [22, Proposition 5.1], [23, Corollary 3.3], the Grothendieck Vanishing Theorem and Lemma 2.4, it is enough to show that the R-module Extj (R/a, Ha2(M)) is weakly Laskerian, for all j ≥ 0. To this end, let X := {p ∈ Min(a) | height p = 1} and Y := {p ∈ Min(a) | height p ≥ 2}. ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 11 T Then X 6= ∅. Let b = p∈X p. If Y = ∅ then Rad(a) = b, and so Ha2 (M) = 0, as required. Therefore we may assume that Y 6= ∅. ThenTRad(a) = b ∩ c, height c ≥ 2, and in view of Theorem 2.7, height (b + c) ≥ 3, where c = p∈Y p. Now, since Rad(a) = b ∩ c, in view of the Mayer-Vietoris sequence the sequence f g 2 3 Hb+c (M) −→ Hc2 (M) −→ Ha2 (M) −→ Hb+c (M) (†) is exact. Since dim R/(b + c) ≤ 1 we have V (b + c) = Min(b + c), and so as i Supp(Hb+c (M)) ⊆ V (b + c), i it follows that the set Supp(Hb+c (M)) is finite, for i = 2, 3. Therefore, it follows from the exact sequence (†) that the R-modules Ker f and Im g are weakly Laskerian. Thus, as dim R/c ≤ 2 it follows from [4, Corollary 3.3] that the R-module ExtiR (R/c, Hc2 (M)/Ker f ) is weakly Laskerian for all i ≥ 0. Now, the exact sequence 0 −→ Hc2 (M)/Ker f −→ Hc2 (M) −→ Im g −→ 0, induces the long exact sequence ExtiR (R/c, Hc2 (M)/Ker f ) −→ ExtiR (R/c, Hc2(M)) −→ ExtiR (R/c, Im g), for all i ≥ 0. Consequently, in view of Lemma 2.12, ExtiR (R/c, Hc2(M)) is a weakly Laskerian R-module. Finally, by using the exact sequence 0 −→ R/ Rad(a) −→ R/b ⊕ R/c −→ R/b + c −→ 0, we get the long exact sequence · · · −→ ExtiR (R/b + c, Ha2 (M)) −→ ExtiR (R/b ⊕ R/c, Ha2(M)) 2 −→ ExtiR (R/ Rad(a), Ha2(M)) −→ Exti+1 R (R/b + c, Ha (M)) −→ · · · . Now, by applying Lemma 2.10, we obtain that ExtiR (R/b + c, Ha2(M)) = 0 = ExtiR (R/b, Ha2(M)), for each i ≥ 0, and therefore ExtiR (R/ Rad(a), Ha2(M)) ∼ = ExtiR (R/c, Ha2 (M)), for each i ≥ 0. Hence, the R-module ExtiR (R/ Rad(a), Ha2 (M)) is weakly Laskerian, for each i ≥ 0. Thus, it follows from Lemma 2.6 that, the R-module ExtiR (R/a, Ha2(M)) is also weakly Laskerian, for all i ≥ 0, and this completes the proof.  We end this section with a result which is a generalization of Corollary 2.8. Corollary 3.7. Let the situation be as in Theorem 3.6. Then for any finitely generated R-module N with support in V (a), the R-module ExtjR (N, Hai (M)) is weakly Laskerian, for all integers i, j ≥ 0. In particular the set AssR ExtjR (N, Hai (M)) is finite, for all integers i, j ≥ 0. Proof. The assertion follows from Theorem 3.6 and Lemma 2.6.  12 M. SEDGHI, K. BAHMANPOUR AND R. NAGHIPOUR Acknowledgments The authors are deeply grateful to the referee for a very careful reading of the manuscript and many valuable suggestions in improving the quality of the paper. We also would like to thank from the Azarbaijan Shahid Madani University for the financial support (No. 217/d/917). References [1] N. Abazari and K. Bahmanpour, On the finiteness of Bass numbers of local cohomology modules, J. Alg. Appl. 10 (2011), 783-791. [2] J. A’zami, R. Naghipour and B. Vakili, Finiteness properties of local cohomology modules for aminimax modules, Proc. Amer. Math. Soc. 137 (2009), 439-448. [3] K. Bahmanpour and R. Naghipour, Associated primes of local cohomology modules and Matlis duality, J. Algebra. 320 (2008), 2632-2641. [4] K. Bahmanpour and R. Naghipour, Cofiniteness of local cohomology modules for ideals of small dimension, J. Algebra. 321 (2009), 1997-2011. [5] M.P. Brodmann and R.Y. Sharp, Local cohomology; an algebraic introduction with geometric applications, Cambridge University Press, Cambridge, 1998. [6] K. Divaani-Aazar and A. Mafi, Associated primes of local cohomology modules, Proc. Amer. Math. Soc. 133 (2005), 655-660. [7] A. Grothendieck, Local cohomology, Notes by R. Hartshorne, Lecture Notes in Math. 862, Springer, New York, 1966. [8] A. Grothendieck, Cohomologie local des faisceaux coherents et théorémes de lefschetz locaux et globaux (SGA2), North-Holland, Amsterdam, 1968. [9] R. Hartshorne, Affine duality and cofiniteness, Invent. Math. 9 (1970), 145-164. [10] M. Hellus, On the associated primes of a local cohomology module, J. Algebra. 237 (2001), 406419. [11] C. Huneke, Problems on local cohomology, Free resolutions in commutative algebra and algebraic geometry, Res. Notes Math. 2(1992), 93-108. [12] C. Huneke and R.Y. Sharp, Bass numbers of local cohomology module, Trans. Amer. Math. Soc. 339 (1993), 765-779. [13] G. Lyubeznik, Finiteness properties of local cohomology modules (an application of D-modules to commutative algebra), Invent. Math. 113 (1993), 41-55. [14] G. Lyubeznik, Finiteness properties of local cohomology modules for regular local rings of mixed chartacteristic: the unramified case, Comm. Algebra, 28 (2000), 5867-5882. [15] G. Lyubeznik, A partial survey of local cohomology, local cohomology and its applications, Lectures Notes in Pure and Appl. Math. 226 (2002), 121-154. [16] M. Katzman, An example of an infinite set of associated primes of a local cohomology module, J. Algebra 252 (2002), 161-166. [17] K.I. Kawasaki, On the finiteness of Bass numbers of local cohomology modules, Proc. Amer. Math. Soc. 124 (1996), 3275-3279. [18] K.I. Kawasaki, Cofiniteness of local cohomology modules for principal ideals, Bull. London Math. Soc. 30 (1998), 241-246. [19] T. Marley, The associated primes of local cohomology modules over rings of small dimension, Manuscripta Math. 104 (2001), 519-525. [20] T. Marley and J.C. Vassilev, Cofiniteness and associated primes of local cohomology modules, J. Algebra 256 (2002), 180-193. [21] H. Matsumura, Commutative ring theory, Cambridge Univ. Press, Cambridge, UK, 1986. [22] L. Melkersson, Modules cofinite with respect to an ideal, J. Algebra, 285 (2005), 649-668. [23] R. Naghipour and M. Sedghi, A characterization of Cohen-Macaulay modules and local cohomology, Arch. Math. 87 (2006), 303-308. ON THE FINITENESS PROPERTIES OF LOCAL COHOMOLOGY MODULES 13 [24] P. Schenzel, Proregular sequences, local cohomology and completion, Math. Scand. 92 (2003), 161180. [25] A.K. Singh, P-torsion elements in local cohomology modules, Math. Res. Lett. 7 (2000), 165-176. [26] H. Zöschinger, Minimax modules, J. Algebra, 102 (1986), 1-32. [27] H. Zöschinger, Ü ber die maximalbedingung für radikalvolle untermoduln, Hokkaido Math. J. 17 (1988), 101-116. Department of Mathematics, Azarbaijan Shahid Madani University, 53714-161, Tabriz, Iran. E-mail address: m [email protected] E-mail address: [email protected] Department of Mathematics, Faculty of Mathematical Sciences, University of Mohaghegh Ardabili, 56199-11367, Ardabil, Iran. E-mail address: [email protected] Department of Mathematics, University of Tabriz, 51666-16471, Tabriz, Iran. E-mail address: [email protected] E-mail address: [email protected]
0math.AC
Derivative coordinates for analytic tree fractals and fractal engineering Henk Mulder [email protected] Abstract We introduce an alternative coordinate system based on derivative polar and spherical coordinate functions and construct a root-to-canopy analytic formulation for tree fractals. We develop smooth tree fractals and demonstrate the equivalence of their canopies with iterative straight lined tree fractals. We then consider implementation and application of the analytic formulation from a computational perspective. Finally we formulate the basis for concatenation and composition of fractal trees as a basis for fractal engineering of which we provide some examples. 1. Introduction Tree fractals are objects of interest and fascination but surprisingly, we have seen only limited application of tree fractals as foundations for systems and engineering. One notable exception are L-systems as a model for botanical structures such as plants and trees [1]. The preponderance of such fractals in nature [2] would suggest that as scientists and engineers we are missing an opportunity for efficient system design. One of the limitations of tree fractals is in their construction. In one form or another, they are mostly iteratively constructed, i.e. the systematic branching and stacking of geometric primitives such as straight line segments [3]. Such composed structures hamper our ability to analyze them effectively. What if we had an analytical function that represented an entire tree fractal? This question has motived the research presented here and has resulted in exactly such a function. In this paper we present an analytic formulation of tree fractals and a foundation of derivative coordinates that underpins them. We then use that formulation to derive some initial results including a formal description of fractal engineering. 1 2. Derivative coordinate functions Theorem 1 Let a parametric path 𝑝(𝑠) for 𝑝: ℝ ↦ ℝ2 be defined by a pair of Cartesian coordinate functions (𝑥(𝑠), 𝑦(𝑠)) for 𝑥, 𝑦: ℝ ↦ ℝ then 𝑝 may be expressed as a function of a pair of derivative 𝜕𝑟 𝜕𝜑 coordinate functions ( , ) for 𝑟, 𝜑: ℝ ↦ ℝ , that represent the relative polar coordinates at a point 𝜕𝑠 𝜕𝑠 (𝑥, 𝑦) on 𝑝. The path 𝑝 is then given by: 𝜕𝑟 𝜕𝜑 ∫ cos (∫ 𝜕𝑠 𝑑𝑠) 𝑑𝑠 𝑥(𝑠) 𝑝(𝑠) = ( ) = ( 𝜕𝑠 ) 𝜕𝑟 𝜕𝜑 𝑦(𝑠) ∫ sin (∫ 𝑑𝑠) 𝑑𝑠 𝜕𝑠 𝜕𝑟 𝜕𝜑 and ( , 𝜕𝑠 𝜕𝑠 (1) 𝜕𝑠 ) are defined as 2 𝜕𝑟 𝜕𝑠 (𝜕𝜑 )=( 𝜕𝑠 √(𝜕𝑥) + (𝜕𝑦) 𝜕𝑠 𝜕𝑠 𝜕 tan−1 𝜕𝑦 𝜕𝑥 ⁄ 𝜕𝑠 𝜕𝑠 2 ). (2) 𝜕𝑠 Notation. In this paper we will see a lot of partial derivatives and to facilitate in line equations, from here on we will represent these with the del operator ∇ and we remind ourselves that unless otherwise indicated, 𝜕𝑟 these are all 1-dimensional derivatives with respect to s, i.e. ∇r = where 𝑟: ℝ ↦ ℝ. So (1) becomes 𝜕𝑠 𝑝(𝑠) = ( 𝑥(𝑠) ∫ ∇r cos(∫ ∇φ 𝑑𝑠) 𝑑𝑠 )=( ) 𝑦(𝑠) ∫ ∇r sin(∫ ∇φ 𝑑𝑠) 𝑑𝑠 (3) and (2) ∇r √(∇x)2 + (∇y)2 ( )=( ) ∇φ ∇ tan−1 ∇y/∇x (4) We will refer to ∇r as the radial derivative coordinate and to ∇φ as the angular derivative coordinate. We may refer to the derivative coordinates functions (∇r, ∇φ) simply as derivative coordinates, suggesting derivative coordinate values for a specific value of the parametric variable 𝑠. We will favor the Euler form of (3) for most of this paper, 𝑝(𝑠) = 𝑥(𝑠) + iy(s) = ∫ ∇r exp(∫ i∇φ 𝑑𝑠) 𝑑𝑠 (5) but when developing the n-dimensional forms where n > 2, we will revert to the trigonometric form. 2 Proof. Substitute (4) into (3), noting that the integrals cancel out the derivatives with respect to the same 𝑥(𝑠) 𝑥(𝑠) variable s, we find that ( )=( ).  𝑦(𝑠) 𝑦(𝑠) The derivative coordinates (∇r, ∇φ) are purposefully written as derivatives since geometrically they describe how a path evolves with respect to a point on the path, i.e. the relative radial and angular evolution. For that reason we do not evaluate the integral ∫ ∇φ 𝑑𝑠 = φ to remind ourselves that ∇φ is our coordinate, and not φ. However, there are two cases when these integrals are interesting in their own right. Corollary 1.1 Let a parametric path 𝑝(𝑠) be represented by derivative coordinates functions (𝛻𝑟, 𝛻𝜑) and the path equation ∫ 𝛻𝑟 𝑒𝑥𝑝(∫ 𝑖𝛻𝜑 𝑑𝑠) 𝑑𝑠, then the path length 𝑙 between two points at 𝑠1 and 𝑠2 is 𝑠 𝑙 = ∫𝑠 2 ∇r 𝑑𝑠. (6) 1 Proof. The derivative coordinate ∇r in (4) is defined as ∇r = √(∇x)2 + (∇y)2 , i.e. the differential arc 𝑠 length of 𝑝 at point (𝑥(𝑠), 𝑦(𝑠)), it follows that the arc length from 𝑠1 and 𝑠2 is ∫𝑠 2 ∇r 𝑑𝑠.  1 Corollary 1.2 Let a parametric path 𝑝(𝑠) be represented by derivative coordinates functions (𝛻𝑟, 𝛻𝜑) and the path equation ∫ 𝛻𝑟 𝑒𝑥𝑝(∫ 𝑖𝛻𝜑 𝑑𝑠) 𝑑𝑠, then the absolute angle ∆𝛷 between the tangent lines at two points at 𝑠1 and 𝑠2 is 𝑠 ∆Φ = ∫𝑠 2 ∇φ 𝑑𝑠 (7) 1 𝜕𝑦 𝜕𝑥 Proof. From the definition (2) we note that ∫ ∇φ 𝑑𝑠 = tan−1 / . By eliminating s we find the anti𝜕𝑠 𝜕𝑠 derivative Φ = tan−1 follows that 𝑠2 . 𝜕𝑦 𝜕𝑥 𝑠2 ∫𝑠 ∇φ 𝑑𝑠 = 1 which is the angle of the tangent at 𝑠 on the path 𝑝 with respect to x-axis. It Φ2 − Φ1 , i.e. the absolute angle ∆Φ between the tangent lines at points 𝑠1 and  We will extend the path formulation of Theorem 1 to the third dimension. Corollary 1.3. Let a parametric path 𝑝(𝑠) for 𝑝: ℝ ↦ ℝ3 be defined by the Cartesian coordinate functions (𝑥(𝑠), 𝑦(𝑠), 𝑧(𝑠)) for 𝑥, 𝑦, 𝑧: ℝ ↦ ℝ then 𝑝 may be expressed as a function of a triple of derivative coordinate functions, (𝛻𝑟(𝑠), 𝛻𝜑(𝑠), 𝛻𝜓(𝑠)) for 𝑟, 𝜑, 𝜓: ℝ ↦ ℝ that represent the relative spherical coordinates at a point (𝑥, 𝑦, 𝑧) on 𝑝. The path 𝑝 is then given by: ∫ ∇r cos(∫ ∇φ 𝑑𝑠) sin(∫ ∇𝜓 𝑑𝑠) 𝑑𝑠 𝑥(𝑠) 𝑝(𝑠) = (𝑦(𝑠)) = ( ∫ ∇r sin(∫ ∇φ 𝑑𝑠) sin(∫ ∇𝜓 𝑑𝑠) 𝑑𝑠 ) 𝑧(𝑠) ∫ ∇r cos(∫ ∇𝜓 𝑑𝑠) 𝑑𝑠 and (𝛻𝑟(𝑠), 𝛻𝜑(𝑠), 𝛻𝜓(𝑠)) are defined as 3 (8) √(∇𝑥)2 + (∇𝑦)2 + (∇𝑧)2 ∇r (∇φ) = ( ) ∇tan−1 ∇𝑦/∇𝑥 ∇𝜓 −1 2 2 2 ∇cos ∇𝑧/√(∇𝑥) + (∇𝑦) + (∇𝑧) (9) Proof. (9) and (10) are the standard spherical coordinate system. Substitution of (9) into (10) verifies that both spherical and Cartesian forms are equal.  More generally, we can extend this to any higher dimension. Corollary 1.4. Let a parametric path 𝑝(𝑠), 𝑝: ℝ ↦ ℝ𝑛 for 𝑛 > 3 be defined by Cartesian coordinate functions (𝑥𝑖 (𝑠)|4 ≤ 𝑖 ≤ 𝑛, 𝑖 ∈ ℕ) where 𝑥𝑖 : ℝ ↦ ℝ then 𝑝 may be expressed as a function of derivative coordinate functions, (𝛻𝑣𝑖 |4 ≤ 𝑖 ≤ 𝑛, 𝑖 ∈ ℕ) where 𝑣𝑖 : ℝ ↦ ℝ represent the relative spherical coordinates on an n-sphere at a point (𝑥𝑖 |4 ≤ 𝑖 ≤ 𝑛, 𝑖 ∈ ℕ) on 𝑝. Proof. We will not give a formal proof but note that as long as the relative evolution of a path p(s), locally within a hyper spherical coordinate system is unrestricted, then the integral of the relative evolution will describe any path p(s) for p: ℝ ↦ ℝ𝑛  3. Application of derivative coordinate functions in tree fractals This research was initiated with the purpose of finding an analytic formulation of tree fractals. Before we can demonstrate the use of derivative coordinate functions, we need to introduce a formulation for branches in tree fractals. If we accept, or define it to be as such, that √𝑥 2 has two solutions (𝑥, −𝑥) for 𝑥 ≠ 0 and one solution (0) for 𝑥 = 0, then 𝑓(𝑥) = √𝑥 2 is a multivalued function with a node point at 𝑥 = 0 where 𝑓(𝑥) is single valued. Taking this one step further, a function √sin2 (𝑥) is a multivalued function with node points at 𝑥 = 𝑛𝜋 for 𝑛 ∈ ℤ where 𝑓(𝑥) is single valued. When we integrate such a function, each time we get to a node where f(x) is single valued, the function becomes dual valued again, i.e. it forks. This is repeated at every node point and the repetitive forking creates a multivalued tree. This multivalued integral ∫ √sin2 (𝑥)𝑑𝑥 is shown below. 4 Image 2: multivalued integral of 𝑢̌(𝑠) Image 1: multivalued integral of √sin2 (𝑥) We could use such an analytic multivalued integral as a mechanism for tree branching however, we prefer to define a function that is linear. 1, −1 𝑠 ∉ 𝐵 Definition 2. We define a multivalued periodic unit function 𝑢̌(𝑠) such that 𝑢̌(𝑠) = { where 𝐵 0 𝑠∈𝐵 is a branch point set, 𝐵 = {𝑠𝑖 |∀𝑠𝑖 : 𝑖 ∈ ℕ, 𝑠 ∈ ℝ}. (9) The multivalued integral of the multivalued periodic unit function is shown in image 2. Theorem 2. Using suitable derivative functional coordinates where the angular coordinate 𝛻𝜑 is multiplied by the multivalued periodic unit function 𝑢̌(𝑠) with a branch point set 𝐵 = {𝑠𝑖 |∀𝑠𝑖 : 𝑖 ∈ ℕ, 𝑠 ∈ ℝ}, then any symmetric binary tree is described by the function 𝑝̌ (𝑠) = ∫ ∇r exp(∫ i𝑢̌∇φ 𝑑𝑠) 𝑑𝑠 (10) Notation. The “check” symbol over 𝑝̌ indicates that this is a tree function. It may be pronounced as p-tree. Proof. We will demonstrate that the tree is symmetric, binary and that the formulation can represent any tree. At each branch node 𝑝̌ (𝑠𝑖 ) where 𝑠𝑖 ∈ 𝐵, the direction of the two emanating branches is determined uniquely by the term 𝑢̌∇φ which has the multi-values ∇φ and -∇φ in between the branch points such that the respective branch paths 𝑝𝑎 and 𝑝𝑏 are given by: 𝑝(𝑠) = ∫ ∇r exp(∫ i∇φ 𝑑𝑠) 𝑑𝑠 and 5 (11) 𝑝(𝑠) = ∫ ∇r exp(− ∫ i∇φ 𝑑𝑠) 𝑑𝑠 (12) We note that the only difference between these paths 𝑝𝑎 and 𝑝𝑏 is in the direction of the rotation ∫ ∇φ 𝑑𝑠 and − ∫ ∇φ 𝑑𝑠 but not in the quantity. It follows that these two branches are symmetric. Since all branches are symmetric from the branch point from which they emanate and that at each branch point there are precisely two branches, it follows that the tree is symmetric and binary.  We note that at a branch point s𝑖 , the multivalued periodic unit function is single valued, i.e. 𝑢̌ = 0 and we shall consider that case in the following corollary. Corollary 2.1 A tree defined by Theorem 2, 𝑝̌ (𝑠) = ∫ 𝛻𝑟 𝑒𝑥𝑝(∫ 𝑖𝑢̌𝛻𝜑 𝑑𝑠) 𝑑𝑠 is continuous at every point of its domain 𝑠 ∈ ℝ, if and only if the derivative coordinates functions (𝛻𝑟, 𝛻𝜑) are continuous on 𝑟(𝑠), 𝜑(𝑠): ℝ ↦ ℝ. Proof. It is clear that the tree is continuous between consecutive tree nodes since at these intervals of the domain the path function 𝑝(𝑠) reduces to the path function of Theorem 1, 𝑝(𝑠) = ∫ ∇r exp(∫ i∇φ 𝑑𝑠) 𝑑𝑠. At the branch points 𝑠𝑖 , we consider the limits of the integral of the angular coordinates of the right branch 𝑝𝑎 from below and from above lim𝑠↑𝑠𝑖 ∫ ∇φ𝑎 𝑑𝑠 = lim𝑠↓𝑠𝑖 ∫ ∇φ𝑎 𝑑𝑠 (13) and for the left branch 𝑝𝑏 lims↑si ∫ ∇φ𝑏 ds = lims↓si ∫ −∇φ𝑏 ds (14) it follows that from (13) and (14) 𝑝𝑎 (𝑠𝑖 ) = 𝑝𝑏 (𝑠𝑖 ) at the branch points and thus a tree defined by Theorem 2 is continuous on its domain. (15)  Corollary 2.2 A tree defined by Theorem 2, 𝑝̌ (𝑠) = ∫ 𝛻𝑟 𝑒𝑥𝑝(∫ 𝑖𝑢̌𝛻𝜑 𝑑𝑠) 𝑑𝑠 is analytic and continuous on its entire domain 𝑠 ∈ ℝ if and only if the derivative coordinates functions (𝛻𝑟, 𝛻𝜑) are analytic and continuous on 𝑟(𝑠), 𝜑(𝑠): ℝ ↦ ℝ. Proof. Since by Corollary 2.1 a tree defined by Theorem 2, 𝑝̌ (𝑠) = ∫ ∇r exp(∫ i𝑢̌∇φ 𝑑𝑠) 𝑑𝑠 is continuous and (∇r, ∇φ) are analytic for 𝑟(𝑠), 𝜑(𝑠): ℝ ↦ ℝ, we note that we may write 𝑝̌ (𝑠) = 𝑓(∇r, ∇φ) (16) where f itself is a composite analytic function, it follows that a tree defined by Theorem 2 is analytic and continuous on 𝑟(𝑠), 𝜑(𝑠): ℝ ↦ ℝ.  6 Lemma 2.3. A symmetric binary tree is fully defined by any of its branch paths, from the root to any of its branch tips. Proof. Starting from root, after the first branch node, the binary branches are symmetric i.e. one defines the other and vice versa. This is the case for any two branches at a branch point. It follows that a symmetric binary tree fractal is fully defined by any of the paths that start at the root and end at a branch tip.  Notation. From here on, when referring to a tree, we are referring to a binary symmetric tree unless otherwise stated. Corollary 2.4 Theorem 2 may define any tree. Proof. By Lemma 2.3 we note that a tree is defined by any of its branch paths. If we select the branch path where 𝑢̌(𝑠) = 1 for all its nodes, then the path 𝑝 is given by: 𝑝(𝑠) = ∫ ∇r exp(∫ i∇φ 𝑑𝑠) 𝑑𝑠 (17) By Theorem 1 such a path function may represent any path 𝑝, it follows that Theorem 2 may describe any tree.  Corollary 2.5. Using suitable derivative functional coordinates (𝛻𝑣𝑖 |3 ≤ 𝑖 ≤ 𝑛, 𝑖 ∈ ℕ) where 𝑣𝑖 : ℝ ↦ ℝ where the directional coordinates 𝛻𝑣𝑖 are multiplied by the multivalued periodic unit function 𝑢̌𝑑 (𝑠) with a given branch set 𝐵𝑑 = {𝑠𝑖 |∀𝑠𝑖 : 𝑖 ∈ ℕ, 𝑠 ∈ ℝ}𝑑 for dimension 𝑑 ≥ 3, then any tree may be described by the higher dimensional path functions defined under Corollaries 1.3 and 1.4. Proof. We will not provide a proof but note that with addition that each additional dimension 𝑑 ≥ 3 we have added a corresponding multivalued periodic unit function 𝑢̌𝑑 (𝑠) with an associated branch point set 𝐵𝑑 = {𝑠𝑖 |∀𝑠𝑖 : 𝑖 ∈ ℕ, 𝑠 ∈ ℝ}𝑑 . With this addition, the argument of the proof of Theorem 2 can be shown to be valid for dimensions 𝑑 ≥ 3.  Lemma 2.6. A tree defined by Theorem 2 is bounded if the length of its branches is bounded over its domain 𝑠 ∈ ℝ. Proof. A tree defined by Theorem 2 is essentially an integral of free differential polar vectors. It is clear that if the integral of the angular coordinate ∫ ∇φ 𝑑𝑠 = 𝑐 for some constant c, then the path represented by 𝑢̌(𝑠) = 1 for all branches on this longest possible path is a straight line segment at angle c with respect to a Cartesian origin point. The length 𝑙 of this line segment is 𝑙 = ∫ ∇r 𝑑𝑠 (18) And the tree is bounded by a circle centered on the root with radius l. Therefore a tree as defined by Theorem 2 is bounded if ∫ ∇r 𝑑𝑠 is bounded.  In some cases we can be more precise than this and calculate the smallest boundary circle explicitly. 7 Lemma 2.7. A non-trivial tree defined by Theorem 2, i.e. where the derivative coordinates ∫ 𝛻𝑟 𝑑𝑠 ≠ 0 and ∫ 𝛻𝜑 𝑑𝑠 ≠ 𝑐 for some constant 𝑐, has a non-integer Hausdorff dimension that exceeds its topological dimension. Proof. We do not give a formal proof but note that the canopy of this tree is constructed from infinitely many non-trivial branches within a bounded area. It follows that the canopy of this tree is infinitely intricate. One may also note that regardless of the particular shape of the branches, their distinctness will increase a box count from generation to generation when assessing the specific Haussdorf dimension for this tree.  Theorem 3. A tree as defined by Theorem 2 is an exact self-similar fractal if the derivative coordinates satisfy the property that between any two consecutive parent and child branches defined by 𝑠𝑎𝑏 ∈ [𝑎. . 𝑏] and 𝑠𝑏𝑐 ∈ [𝑏. . 𝑐] where a,b,c are branch points, that the scaling between branch points is constant ∇r |𝑠=𝑏..𝑐 = 𝜌∇r |𝑠=𝑎..𝑏 and 0 < 𝜌 < 1 (19) and the directional change is equivalent ∇φ |𝑠=𝑏..𝑐 = ∇φ |𝑠=𝑎..𝑏 (20) 𝑠𝑖−1 − 𝑠𝑖 = 𝑐 for 𝑐 > 0 (21) and branch points 𝑠𝑖 are equidistant Proof. We will follow the characteristics of fractals outlined by Falconer [4]. By Lemma 2.7, the bounded binary symmetric tree has a Hausdorff dimension that exceeds its topological dimension. The conditions that ∇r |𝑠=𝑏..𝑐 = 𝜌∇r |𝑠=𝑎..𝑏 and ∇φ |𝑠=𝑏..𝑐 = ∇φ |𝑠=𝑎..𝑏 for consecutive parent and child branches ensures that parent and child are exactly self-similar. Finally, the definition of the tree by Theorem 2 is simple.  Corrolary 3.1. If either 𝛻𝑟 |𝑠=b..c = 𝜌𝛻𝑟 |𝑠=𝑎..𝑏 or 𝛻𝜑 |𝑠=b..c = 𝛻𝜑 |𝑠=𝑎..𝑏 , but not both, then a bounded binary symmetric tree formulated by Theorem 2 for the branch point set 𝐵 = {𝑠𝑖 |∀𝑠𝑖 : 𝑖 ∈ ℕ, 𝑠 ∈ ℝ} is quasy fractal. Proof. No formal proof is given but it is clear from the condition ∇r |𝑠=𝑏..𝑐 = 𝜌∇r |𝑠=𝑎..𝑏 or ∇φ |𝑠=𝑏..𝑐 = ∇φ |𝑠=𝑎..𝑏 , that some but not all fractal features are carried from branch to branch across the generations.  Remark 3.2. The conditions of Theorem 3 and Corollary 3.1 on the self-similarity across branch generations may be relaxed by allowing the sets 𝑠𝑎𝑏 and 𝑠𝑏𝑐 to be defined less rigidly between branch points but across arbitrary intervals of 𝑠 as long as these intervals are repeated ad infinitum. The resulting fractal will be exact self-similar. 8 4. Computational considerations 4.1 Calculating curves in ℝ𝒏 The definition of the derivate coordinate functions as an alternative representation of a curve in ℝ𝑛 simplifies the calculation of visual rendering of curves and objects in ℝ2 and ℝ3 , in particular when these curves are not available algebraically. Furthermore, the calculation of curves and objects in ℝ𝑛 , 𝑛 > 3 is also simplified. We recall that rendering curves and objects in computer graphics often involves drawing a point 𝑝2 at a given distance ∆𝑟 and rotation ∆𝜑 with respect to some point 𝑝1 such that the vector ∆𝒗(∆𝑟, ∆𝜑) = 𝑝2 − 𝑝1 . The usual approach is to translate (𝑻) 𝑝1 back to the origin, rotate (𝑹) it such that it is parallel to the 𝑥-axis and sometimes we may need to scale (𝑺) it back to unit length as well. Then we add the new line segment and reverse the transformations: re-scale (𝑺−𝟏 ), re-rotate (𝑹−𝟏 ), re-translate (𝑻−𝟏 ). 𝑝2 = (𝑝1 ∙ 𝑻 ⋅ 𝑹 ∙ 𝑺 + ∆𝒗) ∙ 𝑺−𝟏 ∙ 𝑹−𝟏 ∙ 𝑻−𝟏 (22) These transformations are typically done with matrices or quaternions which in particular for higher dimensions can add a computational complexity. A similar calculation for a curve in ℝ2 using derivate coordinate functions where ∆𝒗 = (∆𝑟, ∆𝜑), 𝑝1 = (𝑥1 , 𝑦1 ) and the direction at that point is Φ1 , then using Theorem 1: 𝑝2 (𝑠) = x2 + iy2 = ∫ ∇r exp(∫ i∇φ 𝑑𝑠) 𝑑𝑠 (23) which we implement as a Riemann sum 𝑝2 (𝑠) = x2 + iy2 = ∑ ∇r exp(∑ i∇φ ∆𝑠) ∆𝑠 (24) 𝑥 + ∆𝑟 cos(Φ1 + ∆𝜑) 𝑝2 = ( 1 ). 𝑦1 + ∆𝑟 sin(Φ1 + ∆𝜑) (25) to calculate the next point Arguably, all of the transformations represented by the matrices 𝑻, 𝑹, 𝑺 are embedded in equation (25). The inverse matrices are avoided by the integrals that ‘remember’ the position and direction of the curve at the last point. So what is the difference? This is exactly the point: the transformations are built into the equation that describes the path that we are calculating and we only have to concern ourselves with the derivate coordinate functions, not with transformations. 4.2 Tree fractals 4.2.1 Pseudo code for generating fractals An example of usage of an analytical formulation of a fractal by Theorem 3 is shown in the pseudo code below. 9 Initialize 1: 2: 3: 4: 5: 6: 7: set initial position 𝒑 = [0,0] set initial direction 𝛷 = 0 set path parametric variable 𝑠 = 0 set step increment ∆𝑠 = 11 ̌ [s] 2,3 read from a file, or calculate from a function into arrays ∇r[s], ∇𝜑[𝑠] and 𝑢 4 EvaluateFractal(𝑠, 𝛷 , 𝒑¸ 𝑢̌𝑟𝑖𝑔ℎ𝑡 ) // first right branch EvaluateFractal(𝑠, 𝛷 , 𝒑¸ 𝑢̌𝑙𝑒𝑓𝑡 ) // first left branch Function 𝛷𝑛𝑒𝑥𝑡 , 𝒑𝒏𝒆𝒙𝒕 =FractalEquation( ∇r, ∇𝜑, 𝒑𝒍𝒂𝒔𝒕 , 𝛷𝑙𝑎𝑠𝑡 ) 1: 𝛷𝑛𝑒𝑥𝑡 = 𝛷𝑙𝑎𝑠𝑡 + ∇𝜑 𝑥𝑙𝑎𝑠𝑡 2: [𝑦 ] = 𝑝𝑙𝑎𝑠𝑡 𝑙𝑎𝑠𝑡 𝑥𝑛𝑒𝑥𝑡 𝑥𝑙𝑎𝑠𝑡 + ∇r cos ∇𝜑 ∆𝑠 3: 𝒑𝒏𝒆𝒙𝒕 = [𝑦 ]=[ ] // refer equation (25) 𝑦𝑙𝑎𝑠𝑡 + ∇r sin ∇𝜑 ∆𝑠 𝑛𝑒𝑥𝑡 4: return 𝛷𝑛𝑒𝑥𝑡 , 𝒑𝒏𝒆𝒙𝒕 Recursive EvaluateFractal(𝒔, 𝜱𝒍𝒂𝒔𝒕 , 𝒑𝒍𝒂𝒔𝒕 ¸ 𝑢̌) 1: while s < smax ∧ 𝑢̌[𝑠] ≠ 0 do // test for eof and branch condition ̌ ∇𝜑[𝑠], 𝒑𝒍𝒂𝒔𝒕, 𝛷𝑙𝑎𝑠𝑡 ) 2: Φnext , 𝒑𝒏𝒆𝒙𝒕 =FractalEquation( ∇𝑟[𝑠], 𝑢 3: PlotLine(𝒑𝒍𝒂𝒔𝒕, 𝒑𝒏𝒆𝒙𝒕 ) // use a canvas or write to coordinate file for offline plotting 4: 𝒑𝒍𝒂𝒔𝒕 = 𝒑𝒏𝒆𝒙𝒕 5: 𝛷𝑙𝑎𝑠𝑡 = 𝛷𝑛𝑒𝑥𝑡 6: 𝑠 = 𝑠 + ∆𝑠 7: end while ̌ (𝑠) was 0 8: if 𝑠 < 𝑠𝑚𝑎𝑥 then // this implies that 𝑢 9: EvaluateFractal(𝑠, 𝛷𝑙𝑎𝑠𝑡 , 𝒑𝒍𝒂𝒔𝒕¸ 𝑢̌𝑟𝑖𝑔ℎ𝑡 [𝑠] // next right branch 10: EvaluateFractal(𝑠, 𝛷𝑙𝑎𝑠𝑡 , 𝒑𝒍𝒂𝒔𝒕¸ 𝑢̌𝑙𝑒𝑓𝑡 [𝑠] // next left branch 11: end if A rudimentary Javascript implementation of this program is available [6] as well as a more evolved Ruby implementation with accessory functions (refer section 4.2.4) for color, line width and transparency [7]. b b If another value for ∆𝑠 is chosen, note that ∫a ∇r 𝑑𝑠 and ∫a ∇φ 𝑑𝑠 for a branch from a to b, should remain invariant and ∇r and ∇φ will need to be scaled accordingly. 2 The multivalued periodic unit function 𝑢̌ is either 1 and -1, or it is 0. This may be implemented as an array with two columns 𝑢̌𝑟𝑖𝑔ℎ𝑡 and 𝑢̌𝑙𝑒𝑓𝑡 . When 𝑢̌ = 0, we may set both 𝑢̌𝑟𝑖𝑔ℎ𝑡 and 𝑢̌𝑙𝑒𝑓𝑡 to zero and for the purposes of a branch test agree that we can use either 𝑢̌𝑟𝑖𝑔ℎ𝑡 or 𝑢̌𝑙𝑒𝑓𝑡 . 3 In practice we will often implement a branch test based on intervals of s rather than 𝑢̌. In that case we define two constants 𝑢̌𝑟𝑖𝑔ℎ𝑡 = 1 and 𝑢̌𝑟𝑖𝑔ℎ𝑡 = −1. 4 Continuous tree fractals never have a trunk; that is an artifice of straight line tree fractals where a trunk is defined as an initial lone branch. 1 10 4.2.2 Examples of tree fractals The use of derivate coordinate functions in tree fractals allows us to introduce new features. We will substitute the traditional straight line segments by other line shapes, including analytic functions. For example, if we set ∇φ = c for some constant c such that for a branch from node s𝑎 to s𝑏 , the overall b 𝜋 2 𝑠⁄ ∆𝑠 angular change Φ = ∫a ∇φ 𝑑𝑠 = for any branch and ∇r = ( ) and position the branch points in 𝑠 at 3 3 equidistant intervals of length ∆𝑠, the fractal function p̌(s) of Theorem 3 will generate the fractal below (image 3) and the derivative coordinate functions ∇r and ∇φ and the absolute periodic unit function |𝑢̌(𝑠)| that were used to generate it (image 4) Image 3: Smooth fractal : Φ = 𝜋 3 2 and ∇r = ( ) 𝑠⁄ ∆𝑠 Image 4: corresponding ∇r, ∇φ and |𝑢̌(𝑠)| 3 For comparison, we generate a straight line fractal using the similar parameters that are only assigned at the branch points and zero elsewhere. So,  set ∇φ = c𝜑 for some constant c𝜑 at the branch points and ∇φ = 0 elsewhere whilst ensuring b that ∫a ∇φ 𝑑𝑠 =  𝜋 and 3 𝑠 2 ⁄∆𝑠 set ∇r = c𝑟 ( ) 3 for some constant c𝑟 at the branch points and ∇r = 0 elsewhere whilst b ∫a ∇r 𝑑𝑠 ensuring that is invariant with respect to the same integral in the preceding smooth fractal (Image 3). we will obtain the straight line fractal below that appears to have the same general form as the smooth fractal above. In Theorem 4 that follows, we will demonstrate the equivalence of their camopies under scaling, rotation and translation. 11 Image 5: Straight line fractal : Φ = 𝑠 2 ⁄∆𝑠 𝜋 3 and ∇r = Image 6: Corresponding ∇r, ∇φ and |𝑢̌(𝑠)| ( ) 3 It is worth pointing out that the fractals in images 3 and 5 are not the same size. The curvature of the smooth fractal in image 3 effectively shrinks the fractal compared to the straight lined fractal of image 5. The scale factor between these two fractals may be found by comparing the absolute distance of subsequent branch points 𝑠1 and 𝑠2 for these two fractals 𝑝̌𝐴 and 𝑝̌𝐵 . 𝑠𝑐𝑎𝑙𝑒 = 𝑝̌𝐴 (𝑠1 )−𝑝̌𝐴 (𝑠2 ) 𝑝̌𝐵 (𝑠1 )−𝑝̌𝐵 (𝑠2 ) (26) Theorem 4. If two tree fractals 𝑝̌𝐴 (𝑠) and 𝑝̌𝐵 (𝑠) are exact self-similar, with the respective derivative coordinate functions (𝛻𝑟𝐴 , 𝛻𝜑𝐴 ) and (𝛻𝑟𝐵 , 𝛻𝜑𝐵 ) then if between any consecutive branch points 𝑠1 and 𝑠2 the angular integral 𝑠 𝑠 1 1 2 2 ∫𝑠 ∇φ𝐴 𝑑𝑠 = ∫𝑠 ∇φ𝐵 𝑑𝑠 (27) and branch length 𝑠 𝑠 1 1 2 2 ∫𝑠 ∇r𝐴 𝑑𝑠 = c ∫𝑠 ∇r𝐵 𝑑𝑠 (28) for some constant 𝑐 then in the limit for 𝑠 → ∞, the canopies of these fractals are equivalent through scaling, translation and rotation. Proof. We consider two binary symmetric tree fractals with the respective derivative coordinate functions (∇r𝑎 , ∇φ𝑎 ) and (∇r𝑏 , ∇φ𝑏 ) then if we can demonstrate that with a suitable scaling, rotation and translation the corresponding node points between the two fractals are arbitrarily close at 𝑠 → ∞ then these fractals are equivalent through scaling, translation and rotation. 12 First we scale the fractal using (26) to ensure that at least for two subsequent nodes 𝑎, 𝑏 the absolute distance between these two nodes is equivalent. Since by (26) and (27) and the fact that both of these fractals are exact self-similar, we are sure that the distance between any subsequent pair of corresponding nodes on the two fractals is equivalent. By virtue of the fact that total angular change (27) between branch nodes is equivalent and that absolute distance between consecutive branch nodes is as well, we can rotate and translate one fractal such that symmetry lines between the branches overlap with the other. As shown in image 7 there remains a distance 𝑑 between corresponding branch points. Image 7: Distance between corresponding nodes on two similar fractals Due to the exact self-similar property (19) we know that 𝑑2 = 𝑑1 𝜌 and 0 < 𝜌 < 1 (28) Since the branch points 𝑠i are equidistant (21) when 𝑠 → ∞, the node generations 𝑖 → ∞ and the distance d between two corresponding nodes on fractals 𝑝̌𝐴 (𝑠) and 𝑝̌𝐵 (𝑠) is d = lim𝑖→∞ 𝑑1 𝜌𝑖 (29) Since 0 < 𝜌 < 1 it follows that 𝑑 = 0. Hence the canopies are equivalent through scaling, translation and rotation.  4.2.3 Branch point programming Binary trees and tree fractals In the previous example we stated that the branch points in 𝑠 were at equidistant intervals. Using Theorem 2, we can introduce branch points arbitrarily to create different trees. Below is a tree that has the same derivative coordinate functions as the fractal in Image 3 but with arbitrary branch points along s. 13 Image 8: Smooth fractal : Φ = 𝜋 3 2 and ∇r = ( ) 𝑠⁄ ∆𝑠 Image 9: Corresponding ∇r, ∇φ and |𝑢̌(𝑠)| 3 It may appear that this tree has lost its self-similarity, however this branch point pattern may well repeat itself so the tree may still be qualitative fractal. This is why we will sometimes refer to such trees as fractal. n-ary trees and tree fractals In practice, we do not have to limit ourselves to binary trees. We may create n-ary trees and fractals or we can create trees with different numbers of branches at different generations of branch points. The theorems 1,2 3 and their corollaries may be adapted to include these cases but we will not do so in this paper. When implementing such mixed n-ary trees and fractals, which may be in higher dimensions the programming of branch points and their relationship with the number of branches, the appropriate derivative coordinate functions and dimensional direction a systematic approach is advised. For some applications where the branch geometry of primary interest an L-system grammar can be used very effectively [1]. Other applications, such as in engineering, a modular approach that focuses on sub trees may be more suitable. 4.2.4 Accessory functions Theorems 1,2 and 3 are useful formulations for mathematical analysis. For applications in engineering they are useful for creating and optimizing tree and fractal structures or even architectures. In such practical environments we need to extend the model of derivative coordinate functions to include other features than a tree or fractal skeleton. Definition 4.1. We define a set of derivative accessory functions 𝛻𝑏𝑖 for 𝑐𝑖 : ℝ ↦ ℝ𝑛 , 𝑖, 𝑛 ∈ ℕ and 𝑛 > 0 in which we include the derivative coordinate functions and a set of non-derivative accessory functions 𝑏𝑗 for 𝑐𝑗 : ℝ ↦ ℝ𝑘 , 𝑗, 𝑘 ∈ ℕ and 𝑘 > 0 to enhance the formulation of a tree or fractal defined in theorem 2. The set of derivative accessory functions is: 𝐶(𝑠) = {∇𝑟, ∇𝜑, ∇𝑏0 ⋯ ∇𝑏𝑛 , 𝑐0 ⋯ 𝑐𝑘 } 14 (29) The accessory functions, together with the fractal function 𝑝̌ (𝑠), specify the enhanced fractal 𝑃̌ (𝑠) = {𝑝̌ (𝑠), 𝐶(𝑠)}. (30) Derivative vs non-derivative accessory functions Here we have defined derivative functions to ensure that they are dependent on their relative values, or history, rather than an absolute dependence on 𝑠. We may need this for line width, tube diameter and other relative accessory functions. We also have non-derivative functions that allow us to control absolute accessory functions. This may include color and material for example. Static accessory functions The accessory functions are typically used to describe additional features. For graphical rendering this may be line width, color, transparency or any other aspect that is required. We may see accessory functions that define a type of material, a finish etc. Interdependent accessory functions Accessory functions may be interdependent. If we have an accessory function that represents the water pressure in a system of fractal pipes, than it will depend on the size of the pipes which would be another accessory function. Dynamic accessory functions In modelling we can also create accessory functions that are dynamical parameters such as temperature, flow or torque etc. Sensory accessory functions Accessory functions may also depend on external parameters. One interesting example is an accessory function that measures the distance from the tree or fractal to a perimeter. This quantity can then be used to adjust the angular derivative coordinate function ∇𝜑 such that it bends a branch away from or towards the perimeter. 4.2.5 Fractal engineering We are now in a position to formally define a process for engineering trees and fractals. We aim to concatenate trees such that all of their properties, whether geometric or otherwise connect without undesired discontinuities. Theorem 5. Two trees 𝑃̌1 and 𝑃̌2 as defined by Theorem 2 may be concatenated to create a tree 𝑃̌ with preservation of continuity by sequencing their accessory functions: 𝑃̌ = 𝑃̌1 ≪ 𝑃̌2 ⟹ (31) 𝑃̌ = {𝑝̌ (𝑠), C1 (s1 ) + C2 (s2 )} (32) For the domain 𝑠 = {𝑠1 ∪ 𝑠2 } is continuous and {𝑠1 ∩ 𝑠2 } = ∅. 15 Proof. It is sufficient to note that the derivative accessory functions, including the coordinate functions are specified as derivatives and that in evaluating their absolute function values, these derivative functions are integrated over their derivative variable 𝑠. As long as we ensure that the integration constants ℎ1 and ℎ2 for the definite integral of each derivate accessory function ∇𝑏1 and ∇𝑏2 is such that the resulting primitives 𝑏1 (𝑠) + ℎ1 = 𝑏2 (𝑠) + ℎ1 , then concatenation will be smooth for each accessory function. The non-derivative accessory functions do not required to connect smoothly since they represent absolute properties.  Example of fractal engineering Starting with two well-known curves, a smooth Koch curve based on the straight lined fractal with 𝑠 −1 𝑜 parameters ∇r = (α) ⁄∆𝑠 where 𝛼 = 𝑜 and Φ = 144 , a “golden fractal” by Tara D. Taylor[5] 2 cos 144 Image 10: Smooth Koch curve and a smooth H-fractal Image 11: Smooth H-fractal we can concatenate the accessory functions: 16 H-fractal Koch curve Image 11: concatenated derivative coordinate functions we obtain an engineered hybrid. Image 12: Concatenated (hybrid) H-Koch fractal Modular design in fractal engineering Theorem 4 opens up the door towards modular design in fractal engineering. All engineering disciplines have in common that systems and structures are created from subsystems and substructures. Componentization is at the core of engineering. Theorem 5 allows us to create trees by adding up sub-trees. There is no limit to this process we can use it to create low level structures that gradually become more useful as they combine into larger structures. As yet, engineers have not found many applications for fractal structures, but this is likely a matter of maturity in design thinking. Below are some examples of engineered fractals and trees. The first example (Image 13) shows the use of sub systems, wheels and brackets. These subsystems in turn have subsystems in the form of cogs and spokes. 17 Image 13: Fractal system (sculpture) created from subsystems (wheels) The second example of an engineered tree with a degree of fractal symmetry is shown below. The accessory functions of this object are a sequence of smooth functions, giving an organic impression. Note that the five forms share a root whose transparency accessory function renders it invisible. Although there is no use of subsystems in this tree, it is clear that elements of it could be reused as subsystems. Image 14: Tree system (organic object) created from other sequenced forms (organs) 18 Such engineered fractals and trees created from components, suggest the opportunity for component libraries and tools for combining them. Genetic Fractals [8] experimented with a rudimentary library and programming language for creating such structures. 4.2.6 Applications From an engineering perspective, fractals are a solution in search of a problem. Probably we will find many such problems in time. At present, the author has focused on two applications. Computer Graphics The use of derivative coordinates and the analytic fractal formulation is a powerful and simple approach to drawing and animating all manner of tree fractals in two or more dimensions. As with most fractals we see, there is an artistic incentive in this. The smooth nature of these fractals, combined with creativity allows us to explore new forms and ideas. The image below shows a hybrid tree fractal that has 4 branches at the root, followed by 2 branches, 3 branches and a series of 6 branches. The accessory functions include color, branch width and transparency. Image 15: Two dimensional hybrid tree fractal The following image was adapted from an animation of a rotating four dimensional tree [9], i.e. it has branches into the second, third and fourth dimension consecutively. 19 Image 16: Four dimensional tree fractal projected into three dimensional space 3D Design and 3D Printing It is a small step to take three dimensional design into a 3D printing environment. There are some technical hurdles such as the need to convert the structure and its features into a triangulated mesh and a suitable file format such as STL. 3D printing itself has its limitations in printing resolution and choice and mixing of materials. More importantly, and perhaps more fundamentally, the popularization of 3D printing has to overcome the 3D design obstacle. Traditional manufacturing relies on professional designers and sophisticated design tools for the creation of meaningful designs. The limitations of design tools suitable for non-professionals restrict 3D designs to simplistic and childlike quality. Although a lot of progress is made by the 3D design industry [10], non-professionals are not fully equipped yet to manipulate non-trivial geometrical forms in three dimensions on two dimensional screens. The modular approach of Theorem 4 introduces a one dimensional paradigm for 3D design. We need not concern ourselves with coordinates and rotations in three dimensions, we only have to decide how to sequence subcomponents (a one dimensional activity) and the tree formulation of Theorem 2 will take care of the complexities. The example below shows a 3D printed tree fractal whose branches bend and curl [11]. 20 Image 17: 3D printed tree designed with the tree formulation of Theorem 3. [image and 3D printing credit: PrintaBit.ch] The last example below shows the wind blades of a hypothetical wind turbine where the wing ribs are a subsystem of the overall tree object. As the tree is evaluated, an algorithm calculates the triangular surface meshes required for 3D printers. Image 18: design for wind blades with triangular mesh for 3D printing 21 5. Conclusion 5.1 Summary We reviewed the analytic foundation of derivative coordinates in Theorem 1 that allows us to construct any path in n-dimensional space. We then created a model for branching using a multivalued unit function that allowed us to extend Theorem 1 to Theorem 2, i.e. an analytic formulation for binary symmetric trees, including smooth trees. Theorem 3 summarized the conditions for using this formulation for exact selfsymmetric tree fractals. Using these formulations we reviewed the computational advantages of using derivative coordinates and the tree and fractal formulations over traditional constructions using matrices. We then looked at a few examples of fractals created with this approach and demonstrated equivalence between straight lined tree fractals and fractals in Theorem 4. We extended the model by introducing derivative accessory functions that allow us to model additional features that we find in engineered systems, such as materials, finishes etc. This led to Theorem 5 that allows us to do fractal engineering, i.e. building tree and fractal structures from components whilst ensuring structural integrity and continuity. Finally we reviewed a few applications of the theory in computer graphics and 3D printing. 5.2 Directions for further research It would seem that there are a number of directions that the theory presented here can be further developed. Three areas appear to stand out. Analysis of smooth trees and fractals Evidently, the ability to use analytical tools on the analytic formulation of trees and fractals should allow us to explore existing and new features of tree fractals analytically rather than numerically. Development of complex fractal structures in engineering The use of fractal structures in engineering is still in its infancy. The analytic formulation of such structures will allow us to marry structure with structural analysis and dynamics. Use of derivative coordinates in mathematics Derivative coordinates are independent from an absolute coordinate system. Beyond the use in trees and fractals, they may be used in any system with localized behavior. 6. References [1] Aristid Lindemayer, Przemyslaw Prusinkiewicz. The algorithmic beauty of plants. Springer-Verlag New York, 1990 Benoit B. Mandelbrot. The fractal geometry of nature. W. H. Freeman and Company, (1982) Benoit B. Mandelbrot, Michael Frame. The canopy and shortest path of a self-contacting fractal tree. The Mathematical Intelligencer, (1999) [2] [3] 22 [4] [5] [6] [7] [8] [9] [10] [11] Kenneth Falconer. Fractal Geometry: Mathematical Foundations and Applications. John Wiley & Sons, Ltd, 2003 Tara D Taylor, Finding gold in the forest: self-contacting symmetric binary fractal trees and the golden ratio. Talk at joint AMS/MAA meeting, pp17-19, 2007 Smooth tree fractal explorer. http://www.geneticfractals.com/gf/GeneticFractalssmoothTreeFractalExplorer.html 2D genetic fractals maker’s guide. http://geneticfractals.org/2d-genetic-fractals-makers-guide/ 3D design concept. http://geneticfractals.com/index.php Animation of four dimensional hyper tree. https://www.youtube.com/watch?v=nCdaLnlHa8w Autodesk design apps. http://www.123dapp.com/ 3D printed tree fractal. http://www.nyce.ly/artworks/shadow-tree-ombrier-i 23
5cs.CE
IRRATIONAL BEHAVIOR OF ALGEBRAIC DISCRETE VALUATIONS arXiv:1311.6047v2 [math.AC] 10 Jun 2014 SOUMYA DEEPTA SANYAL 1. Introduction In this paper, we discuss the behavior of algebraic discrete valuations dominating a two dimensional normal (Noetherian) local domain (R, mR ). To a valuation ν of the quotient field K = QF (R) of R, we associate a valuation ring Vν = {f ∈ K | ν(f ) ≥ 0}. This ring is quasi-local, with maximal ideal mν = {f ∈ K | ν(f ) > 0}. We say that the valuation ν dominates (R, mR ) if Vν ⊃ R and R ∩ mν = mR . We say that the valuation ν is discrete if its value group is order isomorphic to Z. In this case Vν is Noetherian, and thus is local. For n ∈ Z≥0 , let In = {f ∈ R | ν(f ) ≥ n}. The questions we address in this paper are: what is ℓR (R/In ) for n ≫ 0? How close is it to being a polynomial? What is n) ? Is this limit well behaved? limn→∞ ℓR (R/I n2 There are two types of discrete valuations ν dominating R. The first case is that ν is divisorial, i.e., the residue field extension Vν /mν : R/mR is transcendental. By Abhyankar’s inequality (Theorem 1 of [1]) it follows that the residue field extension given by a divisorial valuation ν dominating a normal local domain of dimension two is of transcendence degree exactly one. The second case is that ν is algebraic, i.e., the residue field extension Vν /mν : R/mR is algebraic. In the divisorial case, it is known by work of Cutkosky and Srinivas in [5] that when R is excellent and equicharacteristic of dimension 2, ℓR (R/In ) can be written as a quadratic polynomial Q(n) plus a bounded function σ(n) for n ≫ 0. They further show that if R/mR has characteristic zero, or is finite, then σ(n) is periodic for n ≫ 0 and they give an example to show that there exist R, ν with characteristic R/mR > 0 such that σ(n) is not eventually periodic. Finally, in their Example 6, they give an example of a divisorial valun) is an irrational number. ation ν dominating a 3 dimensional ring such that limn→∞ ℓR (R/I n3 The analysis in dimension two of [5] left open the remaining case that ν is an algebraic discrete valuation. In the case that Vν /mν is finite over R/mR , everything is well behaved. In section 3 of this paper, we prove the following Theorem 1.1 and Corollary 1.2: Theorem 1.1. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . Then there exist c, b ∈ Z such that ℓR (R/In ) = cn + b for n ≫ 0, where c = |Vν /mν : R/mR |. 1 Corollary 1.2. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . Then ℓR (R/In ) = 0. n→∞ n2 lim In section 4 of this paper, we show in Theorems 4.11 and 4.19, and Corollary 4.20, that when we consider infinite algebraic residue field extensions, we have a more interesting result: Theorem 1.3. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that the function ℓR (R/In ) cannot be written as a quasi-polynomial plus a bounded function for large integers n. We remind the reader that a quasi-polynomial in the indeterminate n is an expression of the form ad (n)nd + ad−1 (n)nd−1 + · · · + a1 (n)n + a0 (n), where d is the degree of the quasipolynomial, and the coefficients ad (n), ad−1 (n), . . . , a1 (n), a0 (n) are periodic functions of n. Theorem 1.4. Let C ∈ R ∩ [0, 21 ] be given. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that each of the functions ℓR (R/In ) and ℓR (In /In+1 ) is not a quasi-polynomial plus a bounded function for large integers n and such that limn→∞ ℓR (Inn/In+1 ) = C and n) limn→∞ ℓR (R/I = C2 . n2 Corollary 1.5. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that each of the functions ℓR (R/In ) and ℓR (In /In+1 ) is not a quasi-polynomial plus a bounded function for large n) are irrational integers n and such that each of limn→∞ ℓR (Inn/In+1 ) and limn→∞ ℓR (R/I n2 (even transcendental) positive numbers. Next, we discuss some questions that arise from the methods used in this paper. Since {In } is a graded family of mR -primary ideals in the two dimensional local ring R, the limit ℓR (R/In ) n→∞ n2 is known to exist in equicharacteristic regular local rings by Mustata [10], and they exist in arbitrary regular local rings (even analytically irreducible local rings) by Cutkosky [2] and [3]. In light of these results, we may ask the following question: lim Question 1.6. Which numbers C are realizable as limits ℓR (R/In ) lim n→∞ n2 from an algebraic discrete valuation on a regular local ring R of dimension two? 2 In this paper, we show that all the numbers in the real interval [0, 41 ] are realizable as limits. Since I1 = mR , and I1n ⊂ In for all n, by comparison with the Hilbert-Samuel multiplicity we have the upper bound ℓR (R/In ) 1 e(R) = . ≤ 2 n→∞ n 2 2 In all of our examples, we have the stronger result that lim ℓR (In /In+1 ) n→∞ n (1) lim exists, and every number in the real interval [0, 12 ] can be obtained as a limit. Thus we may ask the following question: Question 1.7. Does limn→∞ ℓR (Inn/In+1 ) always exist for an algebraic discrete valuation dominating a regular local ring of dimension two? It is known that this limit does not generally exist if {In } is a filtration of mR -primary ideals (Theorem 4.6 of [4]), so a positive answer to Question 1.7 would use special properties of the valuation ideals In . Now we briefly discuss the methods used in this paper. In constructing our examples, we make use of an algorithm of [7] that generalizes an algorithm of [11] for constructing generating sequences of valuations. The algorithm in [7] is valid in arbitrary two dimensional regular local rings. This technique of generating sequences is also used in [8] and [9] to find stable toric forms of extensions of associated graded rings along a valuation in finite defectless extensions of algebraic function fields of dimension two. We take as our ground field k = L ({σi }), where L is an arbitrary field and {σi }i∈Z+ is a set of algebraically independent elements over L. We take for our ring R := k[[x, y]] and inductively define a generating sequence of our valuation, {Pi }i≥0 ⊂ R by P0 = x, P1 = y, and Pi+1 = Pi2 − σi x2ri for i ≥ 1. Provided that the ri ∈ N are such that r0 = 1 and ri+1 > 2ri for i ≥ 1, the algorithm ensures that there exists a unique discrete valuation ν of QF (R) dominating R, such that ν(Pi ) = ri for i ∈ N. The residue field of √ ν is naturally isomorphic to k({ σi }). L In the associated graded algebra s≥0 Is /Is+1 , the lengths of the graded components Is /Is+1 are given by the number of distinct monomials in the generators {Pi } that have value equal to s. That is, a k-basis of Is /Is+1 is: (2) Bs = {[P0n0 P1n1 · · · Pini ] | i ∈ N, n0 , . . . , ni ∈ N, nj ∈ {0, 1} for 1 ≤ j ≤ i, and n0 + n1 r1 + · · · + ni ri = s}. 3 By multiplying basis elements through by an element of suitable ν-value in R and checking linear independence conditions, we show that ℓR (Is /Is+1 ) is a non-decreasing function of s. By choosing the ν-values ri of the generators, we can control the growth of ℓR (Is /Is+1 ). By imposing a combinatorial condition on the sequence {ri }, that ri+1 > r0 + r1 + · · · + ri for all i ≥ 0, we can ensure that there is a partition of R≥0 of the form {[ak , bk )}k∈Z>0 , such that on every interval [ak , bk ), the function ℓR (Is /Is+1 ) is constant, and takes on distinct values for every k. This part of the construction already shows that the Hilbert function is highly non-polynomial. Next, we show that for these examples, the limit n) as a consequence. existence of ℓR (R/I n2 ℓR (In /In+1 ) n exists, and deduce the The construction places the set of multiplicities (0, 14 ] in bijective correspondence with [0, ∞). This is done by specifying the values of ri+1 − (2ri + 1). More precisely, to construct the valuation to have multiplicity B ∈ (0, 14 ], we set the difference ri+1 − (2ri + 1) 1 to be equal to the coefficient of 2i−1 in the 2-adic expansion of B2 − 2. For the remaining case, taking ri+1 −(2ri +1) = 2i−1 for i ≥ 0 gives an example where the multiplicity is 0. 2. Notation Let N denote the set {0, 1, 2, . . . } and Z+ denote the set {1, 2, 3, . . . }. Suppose that ν is a discrete valuation dominating a local ring (R, mR ). Let In = {f ∈ R | ν(f ) ≥ n}. If f ∈ In , denote by [f ] its image in In /In+1 . If r, s ∈ N, [x] ∈ Ir /Ir+1 and [y] ∈ Is /Is+1 , denote by [x] · [y] their product (x + Ir+1 )(y + Is+1 ) ∈ Ir+s /Ir+s+1 in the associated graded ring ⊕n∈N In /In+1 . In particular if c ∈ R/mR , we will write c · [x] ∈ Ir /Ir+1 . Also, if c ∈ R/mR and [d] ∈ Vν /mν , then c · [d] = (c + mR )(d + mν ) ∈ Vν /mν . If R/mR ∼ = k ⊂ R, then ℓR (Is /Is+1 ) = dimR/mR (Is /Is+1 ). In this case (which applies to this paper), we will use the two notations interchangeably. Finally, we let Γν = {ν(f ) | f ∈ QF (R) \ {0}} and S R (ν) = {ν(f ) | f ∈ R \ {0}} ⊂ Γν denote the value group of ν and the value semigroup of ν respectively. 3. Results for finite residue field extensions In this section, we prove Theorem 1.1 and Corollary 1.2 from the introduction. Lemma 3.1. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ). Let n ∈ N. Suppose that dimR/mR (In /In+1 ) = r. Then for all k ∈ S R (ν), we have that dimR/mR (In+k /In+k+1 ) ≥ r. Proof. Suppose that e1 , . . . , er are elements of In \ In+1 such that [e1 ] , . . . , [er ] form a basis for In /In+1 over R/mR . Let k ∈ S R (ν) be given. Then there exists g ∈ R such that ν(g) = k. Hence ge1 , . . . , ger are elements of In+k \ In+k+1 with nonzero residues [ge1 ] , . . . , [ger ] in In+k /In+k+1 . 4 P Suppose that ri=1 ci [gei ] = P [0] in In+k /In+k+1 P Pr , where ci ∈ R/mR for 1 ≤ i ≤ r. Then r r ν( c ge ) > n + k. Thus ν( c e ) = ν( i=1 i i i=1 ci gei ) − ν(g) > n + k − k = n, whence Pr i=1 i i i=1 ci [ei ] = [0] in In /In+1 . Since [e1 ] , . . . , [er ] formed a basis for In /In+1 , we must have ci = 0 for all 1 ≤ i ≤ r. Hence [ge1 ] , . . . , [ger ] are linearly independent over R/mR , and so dimR/mR (In+k /In+k+1 ) ≥ r.  Lemma 3.2. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ). There exists n0 ∈ N such that n ∈ S R (ν) for all n ≥ n0 . Proof. Since ν is a valuation of the quotient field of R, S R (ν) = {ν(f ) | f ∈ R \ {0}} generates Γν . To see this, let fg ∈ K ∗ , with f, g ∈ R \ {0}. Then ν( fg ) = ν(f ) − ν(g). Hence, any element of Γν is the difference of two elements in S R (ν). In particular, since Γν = Z, there exist t, u ∈ S R (ν) such that t − u = 1. If u = 0, then t = 1, S R (ν) = N and the lemma follows by taking n0 = 0. Suppose that u > 0 and let i ∈ N. Then there exist k, r ∈ N such that i = ku + r, 0 ≤ r < u, by the division algorithm. Hence u2 + i = tr + u(u + k − r) ∈ S R (ν). Thus for all n ≥ u2 , n ∈ S R (ν). Thus the lemma follows by taking n0 = u2 .  Lemma 3.3. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . For all n ∈ N, dimR/mR (In /In+1 ) ≤ |V /mν : R/mR |. Proof. Let r = |V /mν : R/mR |, and let f1 , . . . fr+1 be elements h iin In \ In+1 such that fr+1 [f1 ], . . . , [fr+1 ] are distinct elements of In /In+1 . Then [1], . . . , f1 form distinct nonzero residues hin iV /mν . Hence there exist ci ∈ R/mR for 1 ≤ i ≤ r + 1, not all zero, such that Pr+1 Pr+1 fi Pr+1 Pr+1 fi i=1 ci f1 = [0]. Thus ν( i=1 ci f1 ) > 0, and so ν( i=1 ci fi ) > n. Hence i=1 ci [fi ] = [0], and [f1 ], . . . , [fr+1 ] are linearly dependent over R/mR . Thus dimR/mR (In /In+1 ) ≤ r.  Proposition 3.4. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . There exists n1 ∈ N such that for all n ≥ n1 , dimR/mR (In /In+1 ) = |V /mν : R/mR |. Proof. Let |V /mν : R/mR | = r. For 1 ≤ i ≤ r − 1, there exist elements αi ∈ V \ mν , such that the elements [1] , [α1 ] , . . . , [αr−1 ] form a basis for V /mν over R/mR . For 1 ≤ i ≤ r − 1, we may write αi = fgii , where fi , gi ∈ R and ν(fi ) = ν(gi ) = ni . Next, define Qr−1 Pr−1 g = i=1 gi . Then g ∈ R, and ν(g) = i=1 ni =: N . Further, for all 1 ≤ i ≤ r − 1, Q P gfi gαi = gi = fi · j6=i gj , so that gαi ∈ R, and in particular, ν(gαi ) = ν(fi ) + j6=i ν(gj ) = P ni + j6=i nj = N . Thus g ∈ IN \ IN +1 and gαi ∈ IN \ IN +1 for 1 ≤ i ≤ r − 1. In particular, [g] and the elements [gαi ] for 1 ≤ i ≤ r − 1 are nonzero elements of IN /IN +1 . Pr−1 Suppose that c0 [g] + i=1 ci [gαi ] = [0] in IN /IN +1 , where ci ∈ R/mR for 0 ≤ i ≤ r − 1. Pr−1 Pr−1 Pr−1 Then ν(c0 g + i=1 ci gαi ) > N , whence ν(c0 + i=1 ci αi ) = ν(c0 g + i=1 ci gαi ) − ν(g) > Pr−1 N − N = 0, so that c0 [1] + i=1 ci [αi ] = [0] in V /mν . Hence cj = 0 for 0 ≤ j ≤ r − 1, 5 and so [g] and the elements [gαi ], 1 ≤ i ≤ r − 1 are linearly independent over R/mR in IN /IN +1 . Thus dimR/mR (IN /IN +1 ) ≥ r. By Lemma 3.3, dimR/mR (IN /IN +1 ) = r, and so dimR/mR (IN /IN +1 ) = |V /mν : R/mR |. Finally, suppose that n0 is as in Lemma 3.2. Then for all n ≥ n0 , we have that n ∈ S R (ν). Hence dimR/mR (IN +n /IN +n+1 ) = |V /mν : R/mR | for all n ≥ n0 , by Lemma 3.1 and Lemma 3.3. Thus the lemma follows by taking n1 = N + n0 .  Now we prove Theorem 1.1 and Corollary 1.2 from the introduction. We remind the reader of their statements: Theorem 3.5. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . Then there exist c, b ∈ Z such that ℓR (R/In ) = cn + b for n ≫ 0, where c = |V /mν : R/mR |. Corollary 3.6. Suppose that ν is an algebraic discrete valuation dominating a local domain (R, mR ), and that Vν /mν is finite over R/mR . Then ℓR (R/In ) = 0. n→∞ n2 lim Proof. In Proposition 3.4 we have shown that there exists n1 ∈ N such that ℓR (In /In+1 ) = c for n ≥ n1 , where c = |V /mν : R/mR |. Observe that ℓR (R/In ) = k=n−1 X ℓR (Ik /Ik+1 ). k=0 Hence for n ≥ n1 , we have ℓR (R/In ) = k=n 1 −1 X ℓR (Ik /Ik+1 ) + k=0 k=n−1 X ℓR (Ik /Ik+1 ) k=n1 and hence ℓR (R/In ) = k=n 1 −1 X k=0 Thus ℓR (R/In ) = cn + ℓR (Ik /Ik+1 ) + [n − n1 ]c. "k=n −1 1 X k=0 # ℓR (Ik /Ik+1 ) − n1 c . This proves Theorem 1.1. Dividing both sides by n2 and taking the limit as n → ∞ gives Corollary 1.2.  6 4. Main Results In this section we prove results for algebraic residue field extensions of infinite degree. Lemma 4.1. Let k = L ({σi }), where L is a field and {σi }i∈Z+ is a set of algebraically √ independent elements over L. Let αi = σi for i ∈ Z+ . Let R be the power series ring R := k[[x, y]]. Define elements Pi ∈ R by P0 = x, P1 = y, and Pi+1 = Pi2 − σi x2ri for i ≥ 1. Suppose that ri ∈ N are such that r0 = 1 and ri+1 > 2ri for i ≥ 1. Then there exists a unique valuation ν of the quotient field of R which dominates R, such that ν(Pi ) = ri for i ∈ N. ν has the property that {Pi } satisfies the conclusions of Theorem 4.2. of [7]. The residue field of ν is naturally isomorphic to k({αi }). We can take Ui = xri for i ≥ 1 in 4) of Theorem 4.2. of [7], and then we obtain that   Pi αi = r xi for i ≥ 1. Proof. Let βi = ri for i ∈ N. Theorem 1.1 [7] and its proof give the existence of a valuation ν associated to the {βi }i∈N and {αi }i∈Z+ , which dominates R. The proof (from the middle of page 21 of [7]) determines ν by constructing a sequence of polynomials which are a generating sequence determining the valuation ν. Now the sequence of polynomials are in fact the generating sequence associated to ν by the algorithm of Theorem 4.2 [7]. If we start the generating sequence with x and y, and we take the Ui in the construction to be xri (which is consistent with the construction), we have that the generating sequence constructed in the proof of Theorem 1.1 is in fact the {Pi }, and the algorithm of Theorem 4.2 produces the generating sequence {Pi }.  Remark 4.2. In the choice of the sequence {ri }i∈N determining the valuation ν in Lemma 4.1, the condition that ri+1 > 2ri for all i ≥ 1 is necessary for the conclusions of Lemma 4.1, by the use of the algorithm of [7]. Lemma 4.3. A k-basis of Is /Is+1 is (3) Bs = {[P0n0 P1n1 · · · Pini ] | i ∈ N, n0 , . . . , ni ∈ N, nj ∈ {0, 1} for 1 ≤ j ≤ i, and n0 + n1 r1 + · · · + ni ri = s}. Proof. We first show that the distinct elements of Bs are linearly independent over k. Let us fix an enumeration {γh } of the monomials (4) {P0n0 P1n1 · · · Pini | i ∈ N, n0 , . . . , ni ∈ N, nj ∈ {0, 1} for 1 ≤ j ≤ i, and n0 + n1 r1 + · · · + ni ri = s}. 7 Observe that {[γh ]} is an enumeration of the elements of Bs . By construction, ν(γ1 ) = ν(γh ) = s for all h. Furthermore, the exponent i-tuples (n0 , . . . , ni ) associated to the monomials γh are distinct for distinct h. P Suppose now that therePis an equation ch [γh ] = 0 in Is /Is+1 , with ch ∈ k. Then P P ν( ch γh ) > s, and so ν( ch γγh1 ) = ν( ch γh ) − ν(γ1 ) > s − s = 0. Thus we have an P γh equation ch [ γ1 ] = 0 in Vν /mν . Now Theorem 4.2 (2) of [7] states that the {[ γγh1 ]} are linearly independent over k. Thus we must have had ch = 0 for all h, and so the elements of Bs were linearly independent over k. Next, by reducing equation (36) modulo Is+1 in the proof of Theorem of 1.1 in [7], we see that the elements of Bs generate Is /Is+1 over k. Whence Bs is a k-basis for Is /Is+1 .  Definition 4.4. Let θ ∈ R≥0 ∪ {∞}. 1. If θ < ∞, then define an associated sequence {ej }j≥2 as follows: define e2 ∈ N so that e22 ≤ θ < e22+1 , and define for every j ≥ 3, ej ∈ {0, 1} such that 0 ≤ P 1 1 θ − e2 21 − · · · − ej 2j−1 < 2j−1 . Further, for every j ≥ 2, define Rj := θ − jk=2 ek 21−k . 2. If θ = ∞, then define an associated sequence {ej }j≥2 by ej = 2j−1 for every j ≥ 2. P Notice in this case that ij=2 ej 21−j = i − 1. In the sequel, we will have the following assumptions. We assume θ ∈ R≥0 ∪ {∞} given, and we define the sequence {ri }i≥0 inductively by (5) r0 = 1, r1 = 1, and ri+1 = 2ri + 1 + ei+1 for all i ≥ 1. Then the general term ri is given by the formula (6) r0 = 1 and ri = 2i − 1 + for i ≥ 1, where {ej } is as in Definition 4.4. i X ek 2i−k , k=2 Lemma 4.5. With our assumption (5), we have that 1. ri+1 > 2ri for all i ≥ 1, 2. 2ri > r0 + · · · + ri for all i ≥ 2, Proof. Since ri+1 = 2ri +1+ei+1 > 2ri for all i ≥ 1 by construction, the first claim follows. We verify the second claim by induction. By (5), r2 = 3 + e2 > 2 = r0 + r1 , and the second claim holds for the case i = 2. 8 Now suppose that i > 2, and that the second claim holds for the case k = i−1. We have that 2ri = ri + ri > ri + (r0 + · · · + ri−1 ), the last inequality by the inductive statement. Hence the second claim holds for all i ≥ 2.  By the first claim of Lemma 4.5, the sequence {ri } defined by (5) satisfies the assumptions of Lemma 4.1. Let ν be the valuation defined by Lemma 4.1 with the sequence {ri } defined by (5). Remark 4.6. In the sequel, we will have inductively chosen the sequence {ri }i∈Z+ such that ri+1 ≥ max(2ri , r0 + r1 + · · · + ri ) + 1. Lemma 4.7. For any i ∈ Z≥1 , let s ∈ (r0 + r1 + · · · + ri , ri+1 ). Then dimk (Is /Is+1 ) = 2i . Proof. Define the following function: N0 (i, s, n1 , . . . , ni ) = s − (n1 r1 + · · · + ni ri ), where n1 , . . . , ni ∈ {0, 1}, as in Lemma 4.3. Since s > r1 + · · · + ri ≥ n1 r1 + · · · + ni ri , N0 (i, s, n1 , . . . , ni ) is nonnegative. Note that for any choice of n1 , . . . , ni , we have that N (i,s,n1 ,...,ni ) n1 N0 (i, s, n1 , . . . , ni ) + n1 r1 + · · · + ni ri = s, so that [P0 0 P1 · · · Pini ] ∈ Bs . Furthermore, since rj > s for j > i by Lemma 4.5, we have that n0 + n1 r1 + · · · + nj−1 rj−1 + nj rj 6= s for any choice of j ≥ i + 1 and n0 , n1 , . . . , nj−1 , nj ∈ N with nj > 0. Thus the elements of Bs are precisely the following: N0 (i,s,n1 ,...,ni ) {[P0 P1n1 · · · Pini ] | n1 , . . . , ni ∈ {0, 1}}. Whence dimk (Is /Is+1 ) = 2i .  Lemma 4.8. Let {ri }i≥0 ⊂ Z≥0 be a sequence, let max(2r2 , r0 +r1 +r2 ) = 2r2 > r0 +r1 +r2 , and let ri+1 > max(2ri , r0 +· · ·+ri ) for i ≥ 2. Then max(2ri , r0 +· · ·+ri ) = 2ri > r0 +. . . ri for all i ≥ 2. Proof. The case i = 2 is given by hypothesis. Now suppose that the statement holds for some k ≥ 2. Then 2rk+1 = rk+1 + rk+1 > rk+1 + max(2rk , r0 + · · · + rk ) = rk+1 + 2rk > rk+1 + (r0 + · · · + rk ). Hence max(2rk+1 , r0 + · · · + rk+1 ) = 2rk+1 > r0 + · · · + rk+1 , and the result follows by induction.  Remark 4.9. Suppose {ri }i∈Z≥0 is constructed as in (6). Then ri+1 > max(2ri , r0 + · · · + ri ) for all i ≥ 2 and the conclusions of Lemma 4.8 hold. By Remark 4.6 and Lemma 4.8 9 it is enough to show that 2r2 = 6 + 2e2 > 5 + e2 = r0 + r1 + r2 . Lemma 4.10. For all i ∈ Z>0 we have that ri+1 − (r0 + · · · + ri ) ≥ i. P Pi i+1−j and Proof. From (6) we can deduce that ri+1 = 2i+1 − 1 + i+1 j=2 ej 2 j=0 rj = P P j i 2i+1 − 1 − i + j=2 k=2 ek 2j−k . Hence ri+1 − i X rj = i + j=0 and it is enough to show that i+1 X k=2 Pi+1 ek 2i+1−k − i+1−k k=2 ek 2 Suppose first that θ < ∞. We have that i+1 X k=2 ek 2i+1−k − = ei+1 + 2i i X k=2 − Pi j=2 j i X X j i X X ek 2j−k j=2 k=2 Pj j−k k=2 ek 2 ≥ 0. ek 2j−k j=2 k=2 ek 21−k − = ei+1 + 2i (θ − Ri ) − ≥ ei+1 + 2i (θ − Ri ) − i X 2j−1 j=2 i X j=2 i X j=2 j X ek 21−k k=2 2j−1 (θ − Rj ) 2j−1 (θ − Ri ) = ei+1 + 2i (θ − Ri ) − (2i − 2)(θ − Ri ) = ei+1 + 2(θ − Ri ) ≥ 0, the penultimate inequality since for all 1 ≤ j ≤ i, we have that θ − Rj ≤ θ − Ri . Suppose next that θ = ∞. We have that i+1 X i+1−k ek 2 k=2 i = ei+1 + 2 i X k=2 − 1−k ek 2 j i X X ek 2j−k j=2 k=2 − = ei+1 + 2i (i − 1) − ≥ ei+1 + 2i (i − 1) − 10 i X j=2 i X j=2 i X j=2 j−1 2 j X ek 21−k k=2 2j−1 (j − 1) 2j−1 (i − 1) = ei+1 + 2i (i − 1) − (2i − 2)(i − 1) = ei+1 + 2(i − 1) ≥ 0.  Theorem 4.11. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that the function α(n) = ℓR (In /In+1 ) is not a quasi-polynomial plus a bounded function for large integers n. Proof. Take R = k[[x, y]] and consider the valuation ν constructed by the generating sequence of Lemma 4.1, along with the associated function α(n) = ℓR (In /In+1 ). We will show that if ν has a generating sequence defined inductively by: ν(P0 ) = r0 = 1, ν(P1 ) = r1 = 1 and ν(Pi+1 ) = ri+1 where {ri } is defined by (5), then α(n) cannot be the sum of a quasipolynomial and a bounded function for large n. Suppose by way of contradiction that there exists n0 > 0 such that α(n) = A(n) + b(n), for n ≥ n0 , where A(n) = αd (n)nd + · · · + α1 (n)n + α0 (n), the αi (n) are periodic functions of integral period, s is their common integral period, and −M ≤ b(n) ≤ M is a bounded function. By defining b(n) = α(n) − A(n) for n ≤ n0 , we can take n0 to be 1. For each 0 ≤ p < s, consider the function Ap (t) := A(p + st) = αd (p + st)(p + st)d + · · · + α1 (p + st)(p + st) + α0 (p + st). The coefficients αd (p + st), . . . , α1 (p + st), α0 (p + st) are constant functions of t ∈ Z+ , and are each equal to αd (p), . . . , α1 (p), α0 (p), respectively. Expanding the powers of p + st shows that these are polynomials of degree ≤ d in t. Thus we may consider s (not necessarily distinct) polynomial functions of t ∈ Z+ : Ap (t) = αd (p)(p + st)d + · · · + α1 (p)(p + st) + α0 (p), and also s (not necessarily distinct) bounded functions of t ∈ Z+ : bp (t) = b(p + st), for 0 ≤ p < s. For each 0 ≤ p < s, define fp (t) := Ap (t) + bp (t). For any function ψ(t), define ∆t ψ(t) := ψ(t) − ψ(t − 1). Thus for all 0 ≤ p < s, ∆t fp (t) = ∆t Ap (t) + ∆t bp (t) = Ap (t) − Ap (t − 1) + bp (t) − bp (t − 1). The sequence {ri }i∈Z+ satisfies ri+1 − (r0 + · · · + ri ) ≥ i. Hence ri+1 > r0 + · · · + ri + 2s for all i sufficiently large. Then by Lemma 4.7, for each 0 ≤ p < s, ∆t fp (t) has infinitely many zeroes in N. Therefore for each 0 ≤ p < s, there is an infinite increasing sequence {tl }l∈N ⊂ N such that such that r0 + · · · + rl < p + (tl − 1)s < p + tl s < rl+1 and ∆t Ap (tl ) + ∆t bp (tl ) = 0; i.e.: ∆t Ap (tl ) = −∆t bp (tl ). Hence the sequence {∆t Ap (tl )}l∈N is bounded (by −2M and 2M ). 11 For each 0 ≤ p < s, ∆t Ap (t) is a polynomial, and is a continuous function on R. If ∆t Ap (t) is nonconstant, then either liml→∞ ∆t Ap (tl ) = ∞ or liml→∞ ∆t Ap (tl ) = −∞. Thus for each 0 ≤ p < s, ∆t Ap (t) is constant, and therefore Ap (t) is either constant or linear. For 0 ≤ p < s, write Ap (t) = mp t + cp . We cannot have mp ≤ 0 for any 0 ≤ p < s. By way of contradiction, suppose that mp′ ≤ 0. Recall that bp′ (t) = fp′ (t) − mp′ t − cp′ . By Lemma 4.7, and since ri+1 > r0 + · · · + ri + s for all i sufficiently large, we can find an increasing sequence {tk }k∈N such that r0 + · · · + rk < p′ + tk s < rk+1 and fp′ (tk ) = 2k hold for all k ≫ 0. Then for all k ≫ 0, we have bp′ (tk ) = 2k − mp′ tk + cp′ , and so letting k → ∞, we get that bp′ (tk ) → ∞, contradicting that bp′ (t) was bounded. Thus, all the mp > 0 for 0 ≤ p < s. Let 0 ≤ p < s be given. Then bp (t) = fp (t) − mp t − cp for t ∈ Z+ . Consider the subsequence {is,k }k∈N such that is,k = s(k + 1) + 1. Then by Lemma 4.10, ris,k +1 − (r0 + · · · + ris,k ) > s(k + 1). For each k ∈ N, define tk,max = max{t ∈ Z+ | p + st < ris,k +1 } and tk,min = min{t ∈ Z+ | p + st > r0 + · · · + ris,k }. Then fp (t) = 2is,k for tk,min ≤ t ≤ tk,max by Lemma 4.7, and tk,max − tk,min ≥ k. Thus for all k ∈ N, bp (tk,max ) − bp (tk,min ) = mp (tk,min − tk,max ) ≤ −kmp . Let N ∈ N be arbitrary and let k > mNp . Then bp (tk,max ) − bp (tk,min ) < −N . Now taking N > 2M contradicts that −M ≤ b(n) ≤ M was bounded, since if −M ≤ b(n) ≤ M , then −2M ≤ b(n1 ) − b(n0 ) ≤ 2M for any n0 , n1 ∈ Z+ . Thus we see that for this choice of the sequence {ri }i∈Z+ , α(n) cannot be written as a quasi-polynomial plus a bounded function. This proves the theorem.  Corollary 4.12. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that the function ℓR (R/In ) cannot be written as a quasi-polynomial plus a bounded function for large integers n. Proof. Let R and ν be as in the proof of Theorem 4.11, and suppose that ℓR (R/In ) = P l Q(n) + σ(n) for n ≫ 0, where Q(n) = l=d l=0 αl (n)n is a quasi-polynomial and σ(n) is a bounded function, say |σ(n)| ≤ M . Then we have that: ℓR (In /In+1 ) = ℓR (R/In+1 ) − ℓR (R/In ) = (Q(n + 1) − Q(n)) + (σ(n + 1) − σ(n)) Let s be the common integral period of the coefficients {αl (n)}0≤l≤d of Q(n). Then    p=d l=d   X X l  Q(n + 1) − Q(n) = αl (n + 1) − αp (n) np p p=0 l=p is also a quasi-polynomial with coefficients of integral period s. Further, −2M ≤ σ(n + 1) − σ(n) ≤ 2M is a bounded function. Thus ℓR (In /In+1 ) is a quasi-polynomial plus a bounded function, contradicting Theorem 4.11.  Proposition 4.13. Let α(n) = ℓR (In /In+1 ). Then the following recursive relation holds: for any n ∈ Z>0 , consider the unique i ∈ Z≥0 such that n ∈ [ri , ri+1 ). Then we have that α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )}. 12 Proof. Let n ∈ Z≥0 . Recall from Lemma 4.3 that a k-basis for In /In+1 is given by the set Bn = {[P0n0 P1n1 . . . Pini ] | i ≥ 0, nk ∈ Z≥0 for k ≥ 0, nk ∈ {0, 1} for 1 ≤ k ≤ i, n0 + i X nk rk = n}. k=1 Thus we may canonically identify the set Bn with the set of tuples (7) Bn ∼ = {(n0 , n1 , . . . , ni ) ∈ N × {0, 1}i | n0 + i X nk rk = n}. k=1 where i is the unique j ∈ Z≥0 such that n ∈ [rj , rj+1 ). Define Bn0 = {(n0 , n1 , . . . , ni ) ∈ Bn | ni = 0} and Bn1 = {(n0 , n1 , . . . , ni ) ∈ Bn | ni = 1}. 0 0 | = |B Let us first show that |Bm ri −1 |. Suppose that (n0 , n1 , . . . , ni ) ∈ Bn . Then Pi−1 Pi−1 Pi−1 n0 + j=1 nj rj = n. By Lemma 4.5, j=1 nj rj ≤ j=1 rj < ri ≤ n, hence n0 = Pi n − j=1 nj rj > n − ri ≥ 0 and so n0 − n + ri − 1 ≥ 0. Let us define a mapping λ : Bn0 → Bri −1 by λ((n0 , n1 , . . . , ni−1 , ni )) = (n0 − n + ri − 1, n1 , . . . , ni−1 ). Notice that λ is injective. For, suppose that λ((n0 , n1 , . . . , ni−1 , ni )) = (n0 − n + ri − 1, n1 , . . . , ni−1 ) = (n′0 − n + ri − 1, n′1 , . . . , n′i−1 ) = λ((n′0 , n′1 , . . . , n′i−1 , n′i )). By (7) for the case m = ri − 1 we have that nj = n′j for 1 ≤ j ≤ i, whence n0 = n′0 and λ is injective. Furthermore, if (n0 , n1 , . . . , ni−1 ) ∈ Bri −1 , then (n0 + n − ri + 1, n1 , . . . , ni−1 , 0) ∈ Bn and λ((n0 + n − ri + 1, n1 , . . . , ni−1 , 0)) = (n0 , n1 , . . . , ni−1 ), whence λ is surjective. Thus λ gives a bijection between the finite sets Bn0 and Bri −1 , and |Bn0 | = |Bri −1 |. Next, we shall show that |Bn1 | =  |Bri −1 | |Bn−ri | if n − ri ≥ ri if n − ri < ri P To this end, suppose that (n0 , n1 , . . . , ni−1 , ni = 1) ∈ Bn1 . Then n0 + i−1 j=1 rj nj = n − ri . 1 So, we have a (injective) mapping µ : Bn → Bn−ri , given by µ((n0 , n1 , . . . , ni−1 , ni = 1)) = (n0 , n1 , . . . , ni−1 ). We claim that if n − ri < ri , then µ is a bijection between Bn1 and Bn−ri , 0 . and if n − ri ≥ ri , then µ is a bijection between Bn1 and Bn−r i P Suppose that n − ri < ri . Then in any representation n − ri = n0 + ij=1 rj nj as in (7), we must have ni = 0. It follows that µ is onto. Similarly, if n − ri ≥ ri , we have that µ 0 0 maps bijectively onto Bri −1 via the map since n − ri < ri+1 . Further, Bn−r is onto Bn−r i i (n0 , n1 , . . . , ni−1 , ni = 0) → (n0 − n + 2ri − 1, n1 , . . . , ni−1 ). Notice next that by Lemma 3.1, if n − ri ≥ ri , then |Bn−ri | ≥ |Bri −1 |, and if n − ri < ri , then |Bn−ri | ≤ |Bri −1 |. Thus we obtain that |Bn1 | = min{|Bn−ri |, |Bri −1 |}. Hence the formula α(n) = α(ri − 1) + min{α(n − ri ), α(ri − 1)} holds. Lemma 4.14. For all i ≥ 2, the following holds: 13  1. If θ < ∞, then α(ri −1) ri 2. If θ = ∞, then α(ri −1) ri 1 = 2+θ + εi , where 0 < εi := Pi every i ≥ 1, Ri := θ − j=1 ej 2−j .) = εi , where 0 < εi := Ri +21−i . (2+θ)[2+θ−Ri −21−i ] (Recall that for 1 . 1+i−21−i Proof. Suppose first that θ < ∞. Observe that α(ri − 1) 2i−1 , = P ri 2i − 1 + ij=2 ej 2i−j by Lemma 4.7. Hence, α(ri − 1) = ri 2− 1 2i−1 + 1 Pi 1−j j=2 ej 2 , 1 , 2 − 2i−1 + (θ − Ri ) 1 , = Ri 1 (2 + θ)(1 − (2+θ)2 i−1 − 2+θ ) = = (1 − 1 1 (2+θ)2i−1 − Ri 2+θ ) 1 + ( (2+θ)2 i−1 + 1 (2+θ)2i−1 (2 + θ)(1 − − Ri 2+θ ) Ri 2+θ ) , 1 + εi . 2+θ Lastly, observe that for each i ≥ 2, 0 ≤ θ − Ri . Hence −21−i ≤ θ − Ri − 21−i , and 2− 21−i ≤ 2+ θ − Ri − 21−i . Hence 2+ θ − Ri − 21−i > 0. Further, Ri ≥ 0, so εi > 0 follows. = Next suppose that θ = ∞. Observe that by Lemma 4.7. α(ri − 1) 2i−1 , = P ri 2i − 1 + ij=2 ej 2i−j Hence, α(ri − 1) = ri 2− = 1 2i−1 + 1 Pi 1−j j=2 ej 2 , 1 , 2 − 2i−1 + (i − 1) 1 = 1 , 1 + i − 2i−1 1 = εi . 1 εi Observe that ε2 = 25 > 0. Suppose that i ≥ 3 is given, and εi−1 > 0. We have that 1 1 1 = εi−1 + (1 + 2i−1 > 0. Hence εi > 0 for i ∈ N by induction. ) > εi−1 14  Corollary 4.15. 1. Suppose that θ < ∞. Then for all i ≥ 2, limi→∞ εi = 0, and so limi→∞ α(rrii−1) = 2. Suppose that θ = ∞. Then for all i ≥ 2, so limi→∞ α(rrii−1) 1 2+θ . α(ri −1) ri α(ri −1) ri > 1 2+θ . Furthermore, > 0. Furthermore, limi→∞ εi = 0, and = 0. Proof. Suppose that θ < ∞. Then the first claim follows since εi > 0 and the second claim follows since 0 ≤ Ri < 21−i . Next, suppose that θ = ∞. Then the first claim follows since εi > 0 and the second 1 claim follows since 1 + i − 2i−1 > i.  1 )n for all n ≥ 0. Lemma 4.16. 1. Suppose that θ < ∞. Then we have that α(n) > ( 2+θ 2. Suppose that θ = ∞. Then we have that α(n) n > 0 for all n ≥ 1. Proof. First suppose that θ < ∞. 1 Observe first that if n = 0, then α(0) = 1 > ( 2+θ )0, and if n = 1, then α(1) = 2 > 1 > α(n) 1 2 2 2+θ (1). If n ∈ [r0 + r1 , r2 ) = [2, r2 ), then n = n ≥ r2 2 2 2 1 so α(n) n ≥ 3+e2 ≥ 3+2θ > 4+2θ = 2+θ . Hence the result = 2 3+e2 . By construction, e2 ≤ 2θ, holds for all n ∈ [0, r2 ). Let n ≥ 2 be given, and consider the unique i ∈ Z≥1 such that n ∈ [ri , ri+1 ). We will prove the result by induction on i. The case i = 1 has already been verified. Assume then that i ≥ 2. We will use the formula α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )}, and the observation that if (8) and α(ri − 1) >  1 2+θ   ri 1 (9) min{α(ri − 1), α(n − ri )} ≥ 2+θ then upon adding these two inequalities, we obtain   1 n. α(n) > 2+θ 15  (n − ri ), Observe that we already have (8) from Corollary 4.15. We now check (9). the inductive statement holds: that ri ≤ n < ri+1 , i ≥ 2,  Assume  1 and that α(m) > 2+θ m for all 0 ≤ m < ri . If n − ri < ri , then by Lemma 3.1, min{α(ri − 1), α(n − ri )} = α(n − ri ) >  1 2+θ  (n − ri ), so (9) holds and we are done. Suppose then that n − ri ≥ ri , in which case min{α(ri − 1), α(n − ri )} = α(ri − 1) by Lemma 3.1. Observe that since ri ≤ n < ri+1 , we have 0 ≤ n − ri ≤ ri+1 − 1 − ri , so that α(ri −1) α(ri −1) n−ri ≥ ri+1 −1−ri . We have i ri+1 − 1 − ri = 2 − 1 + so It follows that i X ej 2i−j + ei+1 , j=2 α(ri − 1) 2i−1 . ≥ P n − ri 2i − 1 + ij=2 ej 2i−j + ei+1 α(ri − 1) 1 ≥ n − ri 2 + θ − Ri + (ei+1 −1) 2i−1 −1 −1 1 ≤ 0, or equivalently, ei+1 ≤ Ri . But − 2i−1 ≤ and it suffices to show that −Ri + ei+1 2i−1 2i−1 ei+1 −1 1−i ≤ 0 since ei+1 ∈ {0, 1} for i ≥ 2, and 0 ≤ Ri ≤ 2 by construction. Hence 2i−1 α(ri − 1) 1 , ≥ n − ri 2+θ or min{α(ri − 1), α(n − ri )} = α(ri − 1) ≥ and (9) holds.  1 2+θ  (n − ri ) Thus the result follows. Finally, the result follows in the case θ = ∞ since for all n ≥ 1, we have α(n) ≥ 1, and 1 so α(n) n ≥ n > 0.  Lemma 4.17. Let α(n) = ℓR (In /In+1 ) and let ε > 0 be given. 1. Suppose θ < ∞. Then there exists N (ε) such that for all i ≥ N (ε) and all n ∈ [ri , ri+1 ), 1 + ε)n + α(rN (ε) − 1). we have that α(n) ≤ ( 2+θ 2. Suppose θ = ∞. Then there exists N (ε) such that for all i ≥ N (ε) and all n ∈ [ri , ri+1 ), we have that α(n) ≤ εn + α(rN (ε) − 1). 16 Proof. We first verify the result when θ < ∞. We will use the formula α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )}, and the observation that if (10) α(ri − 1) ≤ and (11) min{α(ri − 1), α(n − ri )} ≤    1 + ε ri 2+θ  1 + ε (n − ri ) + α(rN (ε) − 1), 2+θ then upon adding these two inequalities, we obtain   1 α(n) ≤ + ε n + α(rN (ε) − 1). 2+θ Observe that by Corollary 4.15, for every ε > 0, there exists N (ε) such that for all i ≥ 1 + ε, N (ε), εi < ε, where εi is as in Lemma 4.14. Thus for i ≥ N (ε), we have α(rrii−1) < 2+θ or (12) α(ri − 1) <   1 + ε ri . 2+θ Let i ≥ N (ε) and suppose that n − ri ≥ ri . Then (13) min{α(ri − 1), α(n − ri )} = α(ri − 1) <     1 1 + ε ri ≤ + ε (n − ri ). 2+θ 2+θ Thus adding (12) and (13) gives that     1 1 α(n) ≤ +ε n≤ + ε n + α(rN (ε) − 1) 2+θ 2+θ and hence the result for this case. Suppose next that i ≥ N (ε) and n − ri < ri . We will prove this case by an inductive argument. First assume that i = N (ε) for the base case. Then (14)  1 + ε (n − ri ), min{α(ri − 1), α(n − ri )} = α(n − ri ) ≤ α(rN (ε) − 1) ≤ α(rN (ε) − 1) + 2+θ 17  whence adding (12) and (14) gives that   1 + ε n + α(rN (ε) − 1) α(n) ≤ 2+θ and the result for the base case. Next, assume the inductive statement: that n − ri < ri , thati > N (ε) and that for all 1 N (ε) ≤ j < i, and all m ∈ [rj , rj+1 ), we have α(m) ≤ 2+θ + ε m + α(rN (ε) − 1). Since n − ri ∈ [rj , rj+1 ) for some j < i, we have by the inductive statement if j ≥ N (ε), (15) min{α(ri − 1), α(n − ri )} = α(n − ri ) ≤   1 + ε (n − ri ) + α(rN (ε) − 1), 2+θ and if j < N (ε), then α(n − ri ) ≤ α(rN (ε) − 1), and (15) still holds. Thus adding (12) and (15) gives that   1 + ε n + α(rN (ε) − 1) α(n) ≤ 2+θ and the result for the inductive step. Hence α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )} ≤ for n ≥ rN (ε) .   1 + ε n + α(rN (ε) − 1) 2+θ Next, we verify the result when θ = ∞. We will use the formula α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )}, and the observation that if (16) and (17) α(ri − 1) ≤ εri min{α(ri − 1), α(n − ri )} ≤ ε(n − ri ) + α(rN (ε) − 1), then upon adding these two inequalities, we obtain α(n) ≤ εn + α(rN (ε) − 1). 18 Observe that by Corollary 4.15, for every ε > 0, there exists N (ε) such that for all i ≥ N (ε), εi < ε, where εi is as in Lemma 4.14. Thus for i ≥ N (ε), we have α(rrii−1) < ε, or (18) α(ri − 1) < εri . Let i ≥ N (ε) and suppose that n − ri ≥ ri . Then (19) min{α(ri − 1), α(n − ri )} = α(ri − 1) < εri ≤ ε(n − ri ). Thus adding (18) and (19) gives that α(n) ≤ εn ≤ εn + α(rN (ε) − 1) and hence the result for this case. Suppose next that i ≥ N (ε) and n − ri < ri . We will prove this case by an inductive argument. First assume that i = N (ε) for the base case. Then (20) min{α(ri − 1), α(n − ri )} = α(n − ri ) ≤ α(rN (ε) − 1) ≤ α(rN (ε) − 1) + ε(n − ri ), whence adding (18) and (20) gives that and the result for the base case. α(n) ≤ εn + α(rN (ε) − 1) Next, assume the inductive statement: that n − ri < ri , that i > N (ε) and that for all N (ε) ≤ j < i, and all m ∈ [rj , rj+1 ), we have α(m) ≤ εm + α(rN (ε) − 1). Since n − ri ∈ [rj , rj+1 ) for some j < i, we have by the inductive statement if j ≥ N (ε), (21) min{α(ri − 1), α(n − ri )} = α(n − ri ) ≤ ε(n − ri ) + α(rN (ε) − 1), and if j < N (ε), then α(n − ri ) ≤ α(rN (ε) − 1), and (21) still holds. Thus adding (18) and (21) gives that α(n) ≤ εn + α(rN (ε) − 1) and the result for the inductive step. 19 Hence α(n) = α(ri − 1) + min{α(ri − 1), α(n − ri )} ≤ εn + α(rN (ε) − 1) for n ≥ rN (ε) .  Corollary 4.18. Let α(n) = ℓR (In /In+1 ). α(n) n limn→∞ α(n) n 1. Suppose θ < ∞. Then limn→∞ 2. Suppose θ = ∞. Then = 1 2+θ . = 0. Proof. First suppose θ < ∞. Dividing both sides of the formula in Lemma 4.17(a) by n, 1 we see that for all ε > 0, we have that lim supn→∞ α(n) n ≤ 2+θ + ε. Hence lim sup n→∞ α(n) 1 ≤ . n 2+θ Now by Lemma 4.16(a), we see that lim inf n→∞ 1 α(n) ≥ . n 2+θ Hence the result follows. Next suppose θ = ∞. Dividing both sides of the formula in Lemma 4.17(b) by n, we see that for all ε > 0, we have that lim supn→∞ α(n) n ≤ ε. Hence lim sup n→∞ α(n) ≤ 0. n Now by Lemma 4.16(b), we see that lim inf n→∞ α(n) ≥ 0. n Hence the result follows.  Theorem 4.19. Let C ∈ R ∩ [0, 12 ] be given. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that each of the functions ℓR (R/In ) and ℓR (In /In+1 ) is not a quasi-polynomial plus a bounded function for large integers n and such that limn→∞ ℓR (Inn/In+1 ) = C and n) = C2 . limn→∞ ℓR (R/I n2 Proof. If 0 < C ≤ 12 , then let θ = C1 − 2 < ∞, and if C = 0, then let θ = ∞. In either case, let {ej } be the associated sequence given by Definition 4.4, let the sequence {ri }i∈N be given by (5), and let ν be the valuation associated to {ri } by Lemma 1. We have proved the first claim in Corollary 4.12. When 0 < C ≤ 12 , we have limn→∞ we have limn→∞ α(n) n α(n) n = 1 2+θ = C by Corollary 4.18(a). When C = 0, = 0 = C by Corollary 4.18(b). Thus the second claim holds. Pn−1 ℓR (Ij /Ij+1 ) = ℓR (R/I1 ) + j=1 ℓR (Ij /Ij+1 ). Hence Pn−1 Pn−1 ℓR (R/I1 ) + j=1 ℓR (Ij /Ij+1 ) ℓR (R/I1 ) ℓR (R/In ) j=1 ℓR (Ij /Ij+1 ) = = + . n2 n2 n2 n2 Notice that ℓR (R/In ) = Pn−1 j=0 20 By Lemma 5.1 of [6], limn→∞ ℓR (R/In ) n2 = C 2 and the third claim holds.  Corollary 4.20. There exists a regular local ring (R, mR ) of dimension 2 and a discrete, rank 1 valuation ν of the quotient field of R dominating R, such that each of the functions ℓR (R/In ) and ℓR (In /In+1 ) is not a quasi-polynomial plus a bounded function for large n) are irrational integers n and such that each of limn→∞ ℓR (Inn/In+1 ) and limn→∞ ℓR (R/I n2 (even transcendental) positive numbers. Proof. Since the proof of Theorem 4.19 does not depend on whether C > 0 is rational, we may choose C ∈ (0, 12 ) \ Q in the first line of the proof of Theorem 4.19, and the result follows.  References [1] S. Abhyankar, ”On the valuations centered in a local domain”, Amer. J. Math. 78 (1956), 321-348. [2] S. D. Cutkosky, ”Multiplicities associated to graded families of ideals”, Algebra and Number Theory 7 (2013), 2059-2083, [3] S. D. Cutkosky, ”Multiplicities of graded families of linear series and ideals.”, arXiv:1301.5613 (2013). [4] S. D. Cutkosky, ”Asymptotic Multiplicities”, arXiv:1311.1432v1 (2013). [5] S. D. Cutkosky, V. Srinivas, ”On a problem of Zariski on dimensions of linear systems”, Annals of Math. 137 (1993), 531-559. [6] S. D. Cutkosky, K. Dalili, O. Kascheyeva, ”Growth of rank 1 valuation semigroups”, Communications in Algebra 38 (2010), 2768 - 2789. [7] S. D. Cutkosky, P.A.Vinh, ”Valuation semigroups of two dimensional local rings”, Proceedings of the London Math. Soc. 108 (2014), 350-384. [8] L. Ghezzi, H. T. Hà, O. Kashcheyeva, “Toroidalization of generating sequences in dimension two function fields”, Journal of Algebra 301(2) (2006), 838-866. [9] L. Ghezzi, O. Kashcheyeva, “Toroidalization of generating sequences in dimension two function fields of positive characteristic”, Journal of Pure and Applied Algebra 209(3) (2007), 631-649. [10] M. Mustata,“On multiplicities of graded sequences of ideals”, Journal of Algebra 256 (2002), 229-249. [11] M. Spivakovsky, “Valuations in function fields of surfaces,”, Amer. J. Math. 112 (1990), 107-156. 28 Mathematical Sciences Building, Department of Mathematics, University of Missouri, Columbia, MO 65211, USA E-mail address: [email protected] 21
0math.AC
SINGULAR DERIVED CATEGORIES OF Q-FACTORIAL TERMINALIZATIONS AND MAXIMAL MODIFICATION ALGEBRAS arXiv:1108.4518v3 [math.AG] 1 Apr 2014 OSAMU IYAMA AND MICHAEL WEMYSS Abstract. Let X be a Gorenstein normal 3-fold satisfying (ELF) with local rings which are at worst isolated hypersurface (e.g. terminal) singularities. By using the singular derived category Dsg (X) and its idempotent completion Dsg (X), we give necessary and sufficient categorical conditions for X to be Q-factorial and complete locally Q-factorial respectively. We then relate this information to maximal modification algebras(=MMAs), introduced in [IW2], by showing that if an algebra Λ is derived equivalent to X as above, then X is Q-factorial if and only if Λ is an MMA. Thus all rings derived equivalent to Q-factorial terminalizations in dimension three are MMAs. As an application, we extend some of the algebraic results in [BIKR] and [DH] using geometric arguments. Contents 1. Introduction 1 1.1. Overview 1 1.2. Results on Q-factoriality 2 1.3. Results on MMAs 3 1.4. Application to cAn singularities 3 1.5. Conjectures 4 2. Preliminaries 5 2.1. d-CY and d-sCY algebras 5 2.2. MM and CT modules 6 2.3. Homologically finite complexes 8 3. Singular derived categories and Q-factorial terminalizations 9 3.1. Singular derived categories of Gorenstein schemes with isolated singularities 9 3.2. Rigid-freeness and Q-factoriality 12 4. MMAs and NCCRs via tilting 13 4.1. The endomorphism ring of a tilting complex 13 4.2. Cohen–Macaulayness and crepancy 15 4.3. A counterexample in dimension four 18 5. cAn singularities via derived categories 19 5.1. Crepant modifications of cAn singularities 19 References 23 1. Introduction 1.1. Overview. The broader purpose of this work, in part a continuation of [IW2], is to understand (and run) certain aspects of the minimal model program (=MMP) in dimension three using categorical and noncommutative techniques. As part of the conjectural underlying picture, it is believed in dimension three (see 1.8 below) that the theory of noncommutative minimal models (=MMAs below) should ‘control’ the geometry of commutative minimal models (=Q-factorial terminalizations) in the same way noncommutative crepant resolutions (=NCCRs) control the geometry of crepant resolutions [V04b]. If this is to have any chance of being true, we must first be able to extend the well-known characterization of smoothness by the singular derived category to be zero to a characterization of Q-factoriality. This involves moving from smooth schemes to singular ones, 1 2 OSAMU IYAMA AND MICHAEL WEMYSS and it is unclear geometrically what form such a derived category characterization should take. However, from the noncommutative side, in the study of MMAs one homological condition, which we call ‘rigid-freeness’, completely characterizes when ‘maximality’ has been reached. The purpose of this paper is to show that this very same condition gives a necessary condition for a scheme with isolated Gorenstein singularities to be Q-factorial. If furthermore the singularities are hypersurfaces (e.g. Gorenstein terminal singularities) this condition is both necessary and sufficient. The ability of the noncommutative side to give new results purely in the setting of algebraic geometry adds weight to the conjectures outlined in §1.5 below. We now explain our results in more detail. 1.2. Results on Q-factoriality. We denote by CM R the category of CM (=maximal Cohen-Macaulay) R-modules, and by CM R its stable category (see §2). As in [O03, O09], we denote Dsg (X) := Db (coh X)/ per(X) (see §3.1 for more details). We call a functor F : T → T ′ an equivalence up to direct summands if it is fully faithful and any object s ∈ T ′ is isomorphic to a direct summand of F (t) for some t ∈ T . The first key technical result is the following. Note that the latter part on the idempotent completion also follows from work of Orlov [O09], and is well-known to experts [BK]. Theorem 1.1. (=3.2) Suppose that X is a Gorenstein scheme of dimension d satisfying (ELF) (see 3.2 for full details and explanation), with isolated singularities {x1 , . . . , xn }. Then there is a triangle equivalence n M CM OX,xi Dsg (X) ֒→ i=1 up to direct summands. Thus taking the idempotent completion gives a triangle equivalence n M bX,xi . CM O Dsg (X) ≃ i=1 Recall that a normal scheme X is defined to be Q-factorial if for every Weil divisor D, there exists n ∈ N for which nD is Cartier. If we can always take n = 1, we say that X is locally factorial. Note that these conditions are Zariski local, i.e. X is Q-factorial (respectively, locally factorial) if and only if OX,x is Q-factorial (respectively, factorial) for all closed points x ∈ X. It is well–known (and problematic) that, unlike smoothness, Q-factoriality cannot in general be checked complete locally. Thus we define X to be bX,x complete locally Q-factorial (respectively, complete locally factorial) if the completion O is Q-factorial (respectively, factorial) for all closed points x ∈ X. Now we recall a key notion from representation theory. Let T be a triangulated category with a suspension functor [1]. An object a ∈ T is called rigid if HomT (a, a[1]) = 0. We say that T is rigid-free if every rigid object in T is isomorphic to the zero object. Applying 1.1, we have the following result. Theorem 1.2. (=3.10, 3.11) Suppose that X is a normal 3-dimensional Gorenstein scheme over a field k, satisfying (ELF), with isolated singularities {x1 , . . . , xn }. (1) If Dsg (X) is rigid-free, then X is locally factorial. (2) If Dsg (X) is rigid-free, then X is complete locally factorial. (3) If OX,xi are hypersurfaces for all 1 ≤ i ≤ n, then the following are equivalent: (a) X is locally factorial. (b) X is Q-factorial. (c) Dsg (X) is rigid-free. (d) CM OX,x is rigid-free for all closed points x ∈ X. bX,xi are hypersurfaces for all 1 ≤ i ≤ n, then the following are equivalent: (4) If O (a) (b) (c) (d) X is complete locally factorial. X is complete locally Q-factorial. Dsg (X) is rigid-free. bX,x is rigid-free for all closed points x ∈ X. CM O Q-FACTORIAL TERMINALIZATIONS AND MMAS 3 Thus the technical geometric distinction between a Q-factorial and complete locally Q-factorial variety is explained categorically by the existence of a triangulated category in which there are no rigid objects, but whose idempotent completion has many. Note also that 1.2 demonstrates that by passing to the idempotent completion of Dsg (X) we lose information on the global geometry (see e.g. 2.13), and so thus should be avoided. 1.3. Results on MMAs. The homological characterization of rigid-freeness in 1.2 originated in the study of modifying and maximal modifying modules (see 2.6 for definitions). Recall that if M is a maximal modifying R-module, we say that EndR (M ) is a maximal modification algebra (=MMA). Proposition 1.3. (=2.14, 2.3) Suppose that R is normal, Gorenstein, equi-codimensional, 3-dimensional ring, and let M be a modifying R-module. Assume that EndR (M ) has only isolated singularities. Then EndR (M ) is an MMA if and only if the category Dsg (EndR (M )) is rigid-free. Throughout this paper we will use the word variety to mean • a normal integral scheme, of finite type over a field k, satisfying (ELF) (see §3.1). Recall that if X and Y are varieties, then a projective birational morphism f : Y → X is called crepant if f ∗ ωX = ωY (see §4 for more details). A Q-factorial terminalization of X is a crepant projective birational morphism f : Y → X such that Y has only Q-factorial terminal singularities. When Y is furthermore smooth, we call f a crepant resolution. Maximal modification algebras were introduced in [IW2] with the aim of generalizing NCCRs to cover the more general situation when crepant resolutions do not exist. Throughout this paper, we say that Y is derived equivalent to Λ if Db (coh Y ) is equivalent to Db (mod Λ). The following result ensures that all algebras derived equivalent to a variety Y above are of the form EndR (M ), which relate the geometry to NCCRs and MMAs. Theorem 1.4. (=4.5) Let Y → Spec R be a projective birational morphism between ddimensional varieties. Suppose that Y is derived equivalent to some ring Λ. If Λ ∈ ref R, then Λ ∼ = EndR (M ) for some M ∈ ref R. Using this, we have the following result, which explains the geometric origin of the definition of modifying modules: Theorem 1.5. Let f : Y → Spec R be a projective birational morphism between ddimensional Gorenstein varieties. Suppose that Y is derived equivalent to some ring Λ, then (1) (=4.14) f is crepant ⇐⇒ Λ ∈ CM R. (2) (=4.15) f is a crepant resolution ⇐⇒ Λ is an NCCR of R. In either case, Λ ∼ = EndR (M ) for some M ∈ ref R. We stress that 1.5(1) holds even if Y is singular. The following consequence of 1.2, 1.3 and 1.5 is one of our main results. Theorem 1.6. (=4.16) Let f : Y → Spec R be a projective birational morphism, where Y and R are both Gorenstein varieties of dimension three. Assume that Y has (at worst) isolated singularities {x1 , . . . , xn } where each OY,xi is a hypersurface. If Y is derived equivalent to some ring Λ, then the following are equivalent (1) f is crepant and Y is Q-factorial. (2) Λ is an MMA of R. In this situation, all MMAs of R have isolated singularities, and are all derived equivalent. As an important consequence, when k = C and Y has only terminal singularities and derived equivalent to some ring Λ, then Y is a Q-factorial terminalization of Spec R if and only if Λ is an MMA. See 4.17 for more details. 1.4. Application to cAn singularities. As an application of the above, we can extend some results of [BIKR] and [DH]. We let K denote an algebraically closed field of characteristic zero, and suppose that f1 , . . . , fn ∈ m := (x, y) ⊆ K[[x, y]] are irreducible polynomials, and let R := K[[u, v, x, y]]/(uv − f1 . . . fn ). 4 OSAMU IYAMA AND MICHAEL WEMYSS When K = C then R is a cAm singularity for m := ord(f1 . . . fn ) − 1 [BIKR, 6.1(e)]. Note that R is not assumed to be an isolated singularity, so f1 , . . . , fn are not necessarily pairwise distinct. For each element ω in the symmetric group Sn , define T ω := R ⊕ (u, fω(1) ) ⊕ (u, fω(1) fω(2) ) ⊕ . . . ⊕ (u, fω(1) . . . fω(n−1) ). Our next result generalizes [BIKR, 1.5] and [DH, 4.2], and follows more or less immediately from 1.6. This is stronger and more general since the results in [BIKR, DH] assume that R is an isolated singularity, and only study cluster tilting objects. Theorem 1.7. (=5.4) Let f1 , . . . , fn ∈ m := (x, y) ⊆ K[[x, y]] be irreducible polynomials and R = K[[u, v, x, y]]/(uv − f1 . . . fn ). Then (1) Each T ω (ω ∈ Sn ) is an MM R-module which is a generator. The endomorphism rings EndR (T ω ) have isolated singularities. (2) T ω is a CT R-module for some ω ∈ Sn ⇐⇒ T ω is a CT R-module for all ω ∈ Sn ⇐⇒ fi ∈ / m2 for all 1 ≤ i ≤ n. We remark that the proof of 1.7 also provides a conceptual geometric reason for the condition fi ∈ / m2 . We refer the reader to §5 for details. 1.5. Conjectures. One of the motivations for the introduction of MMAs is the following conjecture, which naturally generalizes conjectures of Bondal–Orlov and Van den Bergh: Conjecture 1.8. Suppose that R is a normal Gorenstein 3-fold over C, with only canonical (equivalently rational, since R is Gorenstein [R87, (3.8)]) singularities. Then (1) R admits an MMA. (2) All Q-factorial terminalizations of R and all MMAs of R are derived equivalent. A special case of 1.8 is the long–standing conjecture of Van den Bergh [V04b, 4.6], namely all crepant resolutions of Spec R (both commutative and non-commutative) are derived equivalent. The results in this paper (specifically 1.6) add some weight to 1.8. We note that 1.8 is true in some situations: Theorem 1.9. Suppose that R is a normal Gorenstein 3-fold over C whose Q-factorial terminalizations Y → Spec R have only one dimensional fibres (e.g. R is a terminal Gorenstein singularity, or a cAn singularity in §5). Then Conjecture 1.8 is true. Proof. The Q-factorial terminalizations are connected by a finite sequence of flops [K89], so they are derived equivalent by [C02]. By [V04a] there is a derived equivalence between Y and some algebra EndR (M ) with EndR (M ) ∈ CM R. Thus by 1.6 EndR (M ) is an MMA. On the other hand, we already know that MMAs are connected by tilting modules  [IW2, 4.14], so they are all derived equivalent. As it stands, the proof of 1.9 heavily uses the MMP. We believe that it should be possible to prove 1.9 (for more general situations) without using the MMP, instead building on the categorical techniques developed in this paper, and generalizing Van den Bergh’s [V04a] interpretation of Bridgeland–King–Reid [BKR]. Indeed, it is our belief and longterm goal to show that many of the results of the MMP come out of our categorical picture (along the lines of [B02], [BKR]), allowing us to both bypass some of the classifications used in the MMP, and also run some aspects of the MMP in a more efficient manner. Conventions. Throughout commutative rings are always assumed to be noetherian, and R will always denote a commutative noetherian ring. All modules will be left modules, so for a ring A we denote mod A to be the category of finitely generated left A-modules, and Mod A will denote the category of all left A-modules. Throughout when composing maps f g will mean f then g. Note that with these conventions HomR (M, X) is a EndR (M )module and HomR (X, M ) is a EndR (M )op -module. For M ∈ mod A we denote add M to be the full subcategory consisting of direct summands of finite direct sums of copies of M , and we denote proj A := add A to be the category of finitely generated projective A-modules. We say that M ∈ mod R is a generator if R ∈ add M . For an abelian category A, we denote by Db (A) the bounded derived category of A. If X is a scheme, OX,x will denote the localization of the structure sheaf at the closed bX,x the completion of OX,x at the unique maximal point x ∈ X. We will denote by O Q-FACTORIAL TERMINALIZATIONS AND MMAS 5 ideal. For us, locally will always mean Zariski locally, that is if we say that R has locally only isolated hypersurface singularities, we mean that each Rm is an isolated hypersurface singularity (or is smooth). When we want to discuss the completion, we will always refer to this as complete locally. Throughout, k will denote an arbitrary field. Rings and schemes will not be assumed to be finite type over k, unless specified. When we say ‘over k’ we mean ‘of finite type over k’. Acknowledgements. Thanks are due to Vanya Cheltsov, Anne-Sophie Kaloghiros, Raphael Rouquier and Ed Segal for many invaluable suggestions and discussions. 2. Preliminaries For a commutative noetherian local ring (R, m) and M ∈ mod R, recall that the depth of M is defined to be depthR M := inf{i ≥ 0 : ExtiR (R/m, M ) 6= 0}. We say that M ∈ mod R is maximal Cohen-Macaulay (or simply, CM ) if depthR M = dim R. Now let R be a (not necessarily local) commutative noetherian ring. We say that M ∈ mod R is CM if Mp is CM for all prime ideals p in R, and we say that R is a CM ring if R is a CM R-module. Denoting (−)∗ := HomR (−, R) : mod R → mod R, we say that X ∈ mod R is reflexive if the natural map X → X ∗∗ is an isomorphism. We denote ref R to be the category of reflexive R-modules, and we denote CM R to be the category of CM R-modules. Throughout this section, we stress our convention that commutative rings are always assumed to be noetherian, and R always denotes a commutative noetherian ring. 2.1. d-CY and d-sCY algebras. When dealing with singularities, throughout this paper we use the language of d-sCY algebras, introduced in [IR, §3]. Although technical, it provides the common language that links the commutative rings and the various noncommutative endomorphism rings that we will consider. To do this, let R be a commutative ring with dim R = d and let Λ be a module-finite R-algebra (i.e. an R-algebra which is a finitely generated LR-module). For any X ∈ mod Λ, denote by E(X) the injective hull of X, and put E := m∈Max R E(R/m). This gives rise to Matlis duality D := HomR (−, E). Note that if R is over an algebraically closed field k, then D coincides with Homk (−, k) on the category fl Λ by [O76, 1.1, 1.2]. We let Dbfl (Λ) denote all bounded complexes with finite length cohomology. Definition 2.1. For n ∈ Z, we call Λ n-Calabi-Yau (=n-CY) if there is a functorial isomorphism HomD(Mod Λ) (X, Y [n]) ∼ = D HomD(Mod Λ) (Y, X) for all X ∈ Dbfl (Λ) and Y ∈ Db (mod Λ). Similarly we call Λ singular n-Calabi-Yau (=nsCY) if the above functorial isomorphism holds for all X ∈ Dbfl (Λ) and Y ∈ Kb (proj Λ). We will use the following characterizations. Proposition 2.2. (1) [IR, 3.10] A commutative ring R is d-sCY (respectively, d-CY) if and only if R is Gorenstein (respectively, regular) and equi-codimensional, with dim R = d. (2) [IR, 3.3(1)] Let R be a commutative d-sCY ring and Λ a module-finite R-algebra which is a faithful R-module. Then Λ is d-sCY if and only if Λ ∈ CM R and HomR (Λ, R)m ∼ = Λm as Λm -bimodules for all m ∈ Max R. Suppose that R is a commutative d-sCY ring, and let Λ be a module-finite R-algebra which is d-sCY. We say that X ∈ mod Λ is maximal Cohen-Macaulay (or simply, CM ) if X ∈ CM R. We denote by CM Λ the category of CM Λ-modules. Then X ∈ mod Λ is CM if and only if ExtiR (X, R) = 0 for all i ≥ 1, which is equivalent to ExtiΛ (X, Λ) = 0 for all i ≥ 1 by the proof of [IR, 3.4(5)(i)]. We denote CM Λ to be the stable category, where we factor out by those morphisms which factor through projective Λ-modules. On the other hand, when Λ is a noetherian ring we denote Dsg (Λ) := Db (mod Λ)/ Kb(proj Λ) to be the singular derived category of Λ. Since any d-sCY algebra satisfies inj.dimΛ Λ = d and inj.dimΛop Λ = d by [IR, 3.1(6)(2)], we have the following equivalence by a standard theorem of Buchweitz [B86, 4.4.1(2)]. 6 OSAMU IYAMA AND MICHAEL WEMYSS Theorem 2.3. Suppose that R is a commutative d-sCY ring and Λ is a module-finite R-algebra which is d-sCY, then there is a triangle equivalence Dsg (Λ) ≃ CM Λ. By 2.3 we identify Dsg (Λ) and CM Λ in the rest of this paper. Now we recall two important notions. Definition 2.4. [A84] Let R be a commutative d-sCY ring and Λ is a module-finite Ralgebra which is d-sCY. (1) We say that Λ is non-singular if gl.dim Λ = d. (2) We say that Λ has isolated singularities if gl.dim Λp = dim Rp for all non-maximal primes p of R. Proposition 2.5. Suppose that R is a commutative d-sCY ring and Λ is a module-finite R-algebra which is d-sCY. Then (1) Λ is non-singular if and only if CM Λ = 0. (2) Λ has isolated singularities if and only if all Hom-sets in CM Λ are finite length Rmodules. Proof. These are well-known (e.g. [Y90, 3.3], [A84]), but for convenience of the reader we give the proof. (1) See for example [IW2, 2.17(1)⇔(3)]. (2) (⇒) Since HomCM Λ (X, Y ) ∼ = Ext1Λ (Ω−1 X, Y ) and Ω−1 X ∈ CM Λ, we know that SuppR HomCM Λ (X, Y ) consists of maximal ideals (e.g. [IW2, 2.6]). Thus the assertion follows. (⇐) Let p be a prime ideal of R with ht p < d and let X ∈ mod Λp . Certainly we can find Y ∈ mod Λ with Yp ∼ = X and so consider a projective resolution 0 → K → Pd−1 → . . . → P1 → P0 → Y → 0 in mod Λ. Since Λ ∈ CM R, by localizing and using the depth lemma we see that K ∈ CM R, i.e. K ∈ CM Λ. Consider 0 → ΩK → Pd → K → 0, (2.A) ∼ then since = HomCM Λ (ΩK, ΩK) has finite length, it is supported only on maximal ideals. Hence (2.A) splits under localization to p and so Kp is free. Thus  proj.dimΛp (X) < d. By Auslander–Buchsbaum, gl.dim Λp = dim Rp . Ext1Λ (K, ΩK) 2.2. MM and CT modules. Recall that M ∈ ref R gives an NCCR Λ := EndR (M ) of R if Λ ∈ CM R and gl.dim Λ = d [V04b]. In this case Λ is d-sCY by 2.8(2) below, and by definition Λ is non-singular. The following more general notions are quite natural from a representation theoretic viewpoint. Definition 2.6. [IW2] Let R be a d-sCY ring. Then (1) M ∈ ref R is called a rigid module if Ext1R (M, M ) = 0. (2) M ∈ ref R is called a modifying module if EndR (M ) ∈ CM R. (3) We say M ∈ ref R is a maximal modifying (=MM) module if it is modifying and further if M ⊕ Y is modifying for Y ∈ ref R, then Y ∈ add M . Equivalently, add M = {X ∈ ref R | EndR (M ⊕ X) ∈ CM R}. (4) We call M ∈ CM R a CT module if add M = {X ∈ CM R | HomR (M, X) ∈ CM R}. The following results will be used extensively. As in [IW2], if X ∈ mod R, we denote fl X to be the largest finite length sub-R-module of X. Lemma 2.7. [IW2, 2.7, 5.12] Suppose that R is a 3-sCY ring, and let M ∈ ref R. (1) If M is modifying, then fl Ext1R (M, M ) = 0. The converse holds if M ∈ CM R. (2) Assume that R is an isolated singularity. If M is modifying, then it is rigid. The converse holds if M ∈ CM R. Q-FACTORIAL TERMINALIZATIONS AND MMAS 7 Lemma 2.8. Suppose that R is a d-sCY normal domain, and M ∈ ref R. Let Λ = EndR (M ). Then (1) [IR, 2.4(3)] Λ ∼ = HomR (Λ, R) as Λ-bimodules. (2) [IW2, 2.22(2)] M is modifying if and only if Λ is d-sCY . We remark that the property CT can be checked complete locally [IW2, 5.5], that is cm is a CT R bm -module for all m ∈ Max R. In our M is a CT R-module if and only if M context in §3, this corresponds to the fact that a scheme X is non-singular if and only if complete locally it is non-singular. cm is In contrast, the property of being MM cannot be checked complete locally. If M b an MM Rm -module for all m ∈ Max R, then M is an MM R-module. However the converse is not true (see e.g. 2.13 below). This corresponds to the difference between Q-factorial and complete locally Q-factorial singularities in §3. We record here the following easy lemma, which shows the first link between modifying modules and factoriality. Proposition 2.9. Suppose R is 3-sCY normal domain, with isolated singularities. Consider the statements (1) R is an MM module. (2) Every modifying R-module is projective. (3) CM R is rigid-free. (4) R is locally factorial. (5) R is Q-factorial. Then we have (1) ⇔ (2) ⇔ (3) ⇒ (4) ⇒ (5). Proof. Since R is an isolated singularity, modifying modules are rigid by 2.7(2). (1)⇒(2) Let M ∈ ref R be any modifying module. Since R is MM, there exists an exact sequence f 0 → F1 → F0 → M with Fi ∈ add R such that f is a right (add R)-approximation, by [IW2, 4.12]. Then clearly f is surjective, and so we have proj.dimR (M ) ≤ 1. By [AG, 4.10], if proj.dimR (M ) = 1 then Ext1R (M, M ) 6= 0, a contradiction. Hence M is projective. (2)⇒(3) is clear, since HomCM R (M, M [1]) ∼ = Ext1R (M, M ). (3)⇒(1) Suppose that EndR (R⊕X) ∈ CM R for some X ∈ ref R. Then X = HomR (R, X) is a CM R-module which is a rigid object in CM R. Hence X is zero in CM R, i.e. X ∈ add R. (2)⇒(4) Since R is a normal domain, all members of the class group have R as endomorphism rings, and thus they are modifying R-modules. Hence every member of the class group is projective, so the result follows. (4)⇒(5) is clear.  Below we will use the following result from commutative algebra. Theorem 2.10. [D1, 3.1(1)] Let S be a regular local ring of dimension four containing a field k, and let R = S/(f ) be a hypersurface. If R is a Q-factorial isolated singularity, then the free modules are the only modifying modules. Proof. This is the equi-characteristic version of [D1, 3.1(1)], but since loc. cit. is in somewhat different language than used here, so we sketch Dao’s proof. Let N be a modifying R-module. Since R is isolated, N is rigid by 2.7(2). On the other hand, by [D2], N is a Tor-rigid R-module. These two facts imply, via a result of Jothilingham [J75, Main Theorem] (see also [D1, 2.4]), that N is a free R-module.  Now we have the following result, which strengthens 2.9. Theorem 2.11. Let R be a 3-sCY normal domain over k, which locally has only isolated hypersurface singularities. Then the following are equivalent: (1) R is an MM module. (2) Every modifying R-module is projective. (3) CM R is rigid-free. 8 OSAMU IYAMA AND MICHAEL WEMYSS (4) R is locally factorial. (5) R is Q-factorial. Proof. By 2.9 we only have to show (5)⇒(1). Suppose that M ∈ ref R with EndR (R ⊕ M ) ∈ CM R. Then for any m ∈ Max R we have EndRm (Rm ⊕ Mm ) ∈ CM Rm with Rm satisfying the assumptions of 2.10, hence Mm is a free Rm -module. Thus Mm ∈ add Rm  for all m ∈ Max R, so M ∈ add R [IW2, 2.26]. Remark 2.12. The corollary is false if we remove the isolated singularities assumption, since then (4) does not necessarily imply (1). An example is given by R = C[x, y, z, t]/(x2 + y 3 + z 5 ). Also, note that in the isolated singularity case it is unclear if the hypersurface assumption is strictly necessary; indeed Dao conjectures that 2.10 still holds in the case of complete intersections [D3, §4]. We remark that removing the hypersurface assumption in 2.11 would allow us to bypass the use of the classification of terminal singularities later. Example 2.13. Consider the element f = x2 + x3 + y 2 − uv in the ring C[u, v, x, y], and bm is not an MM R bm -module, set R := C[u, v, x, y]/(f ). Then R is an MM R-module, but R where m = (u, v, x, y). √ Proof. Since R has an isolated singularity only at m := (u, v, x, y) and x + 1 does not exist in Rm , we have that Rm is a factorial hypersurface singularity for all m ∈ Max R. Hence if M is a modifying R-module, then Mm is a free Rm -module for any m ∈ Max R by 2.10. Thus M is projective. √ bm is For the last statement, since x + 1 exists (and is a unit) in the completion, R bm ⊕ (u, x) is a modifying module.  isomorphic to C[[u, v, x, y]]/(uv − xy), for which R Now we give a general categorical criterion for a given modifying module to be maximal, generalizing 2.9. Proposition 2.14. Suppose that R is normal 3-sCY, let M be a modifying R-module and set Λ := EndR (M ). If M is an MM R-module, then CM Λ is rigid-free. Moreover the converse holds if Λ has isolated singularities. Proof. By [IW2, 4.8(1)], M is an MM R-module if and only if there is no non-zero object X ∈ CM Λ such that fl HomCM Λ (X, X[1]) = 0. This clearly implies CM Λ is rigid-free. By 2.5(2), the converse is true if Λ has isolated singularities.  Remark 2.15. We conjectured in [IW2] that in dimension three MMAs always have isolated singularities (see 4.16 for some evidence), so the key property from 2.14 is that the stable category of CM modules is rigid-free. Note that Λ := EndR (M ) ∈ CM R is an NCCR if and only if the stable category CM Λ is zero. Hence when passing from NCCRs to MMAs, the categories Dsg (Λ) ≃ CM Λ are no longer zero, but instead rigid-free. This motivates §3. 2.3. Homologically finite complexes. In this subsection we wish to consider the general setting of commutative rings, and so in particular the Krull dimension may at times be infinite. The following is based on some Danish handwritten notes of Hans-Bjørn Foxby. Theorem 2.16. Let R be a commutative ring (not necessarily of finite Krull dimension), let Λ be a module-finite R-algebra, and let M ∈ mod Λ. If proj.dimΛp (Mp ) < ∞ for all p ∈ Spec R, then proj.dimΛ (M ) < ∞. Proof. Take a projective resolution d d . . . → P1 →1 P0 →0 M → 0, of M with finitely generated projective R-modules Pi , and set K0 := Im d0 = M and Ki := Im di = Ker di−1 for i > 0. Now proj.dimΛ (M ) < n ⇐⇒ ExtnΛ (M, Kn ) = 0, and the right hand side is equivalent to the condition that SuppR ExtnΛ (M, Kn ) is empty. Localizing at p ∈ Spec R, we have proj.dimΛp (Mp ) ≥ n ⇐⇒ ExtnΛ (M, Kn )p = ExtnΛp (Mp , (Kn )p ) 6= 0 ⇐⇒ p ∈ SuppR ExtnΛ (M, Kn ). Q-FACTORIAL TERMINALIZATIONS AND MMAS 9 Since ExtnΛ (M, Kn ) is a finitely generated R-module, we have SuppR ExtnΛ (M, Kn ) = V (AnnR (ExtnΛ (M, Kn ))). For ease of notation set In = AnnR (ExtnΛ (M, Kn )), then proj.dimΛp (Mp ) ≥ n ⇐⇒ p ∈ V (In ). (2.B) In particular, we have a decreasing sequence V (I0 ) ⊇ V (I1 ) ⊇ V (I2 ) ⊇ . . . , so we have V (It ) = V (I ) = . . . for some t since the Spec R is noetherian by our assumpTt+1 ∞ tion. If p ∈ V (It ) = n=t V (In ), then proj.dimΛp (Mp ) = ∞ by (2.B), a contradiction. Consequently V (It ) = ∅, so we have ExttΛ (M, Kt ) = 0 and proj.dimΛ (M ) < t.  Corollary 2.17. Let R be a commutative ring and Λ a module-finite R-algebra. Then (1) For every p ∈ Spec R, the algebra Λp has only finitely many simple modules. (2) Let M ∈ mod Λ. Then proj.dimΛ (M ) < ∞ if and only if for all X ∈ mod Λ we have ExtjΛ (M, X) = 0 for j ≫ 0. Proof. (1) Λp is a module-finite Rp -algebra. There are only finitely many simple Λp modules since they are annihilated by pRp and hence they are modules over the finite dimensional (Rp /pRp )-algebra Λp /pΛp, which has only finitely many simple modules. (2) We only have to show ‘if’ part. For any p ∈ Spec R, we know that the localization functor (−)p : mod Λ → mod Λp is essentially surjective, and that the completion functor d : fl Λp → fl Λ b p is an equivalence since the completion does not change finite length (−) bp is the sum of all simple Λ b p -modules. modules. By (1) there exists X ∈ mod Λ such that X j The assumptions imply that there exists t ≥ 0 such that ExtΛ (M, X) = 0 for all j > t. cp , X bp ) = 0 for all j > t. This implies proj.dim b (M cp ) ≤ t since M cp has a Thus Extjb (M Λp Λp minimal projective resolution. Thus we have proj.dimΛp (Mp ) ≤ t by applying [IW2, 2.26, 2⇔4] to the t-th syzygy of M . By 2.16, it follows that proj.dimΛ (M ) < ∞.  Let T be a triangulated category with a suspension functor [1]. Recall that x ∈ T is called homologically finite if for all y ∈ T , HomT (x, y[i]) = 0 for all but finitely many i. The following is well-known under more restrictive hypothesis: Proposition 2.18. Let R be a commutative ring and Λ be a module-finite R-algebra. Then the homologically finite complexes in Db (mod Λ) are precisely Kb (proj Λ). Proof. Since every object in Kb (proj Λ) is homologically finite, we just need to show the converse. If X is homologically finite, replace X by its projective resolution (P, d). The truncation of P , namely τ≥i P , is quasi-isomorphic to X for small enough i. Fix such an i. Thus, if we can show that Ker(di ) has finite projective dimension, certainly it follows that X belongs to Kb (proj Λ). Now by the usual short exact sequence given by truncation, there is a triangle Q → X → Ker(di )[i] → Q[1] where Q ∈ Kb (proj Λ). Since the first two are homologically finite, so is Ker(di ). In particular, for all Y ∈ mod Λ, we have that ExtjΛ (Ker(di ), Y ) = 0 for large enough j. By 2.17(2), Ker(di ) has finite projective dimension, as required.  3. Singular derived categories and Q-factorial terminalizations 3.1. Singular derived categories of Gorenstein schemes with isolated singularities. Recall that a scheme X is called Gorenstein if OX,x is a Gorenstein local ring for all closed points x ∈ X. We say that a scheme X satisfies (ELF) if X is separated, noetherian, of finite Krull dimension, such that coh X has enough locally free sheaves (i.e. for all F ∈ coh X, there exists a locally free sheaf E and a surjection E ։ F ). This is automatic in many situations, for example if X is quasi–projective over a commutative noetherian ring [TT, 2.1.2(c), 2.1.3]. Definition 3.1. We say that F ∈ Qcoh X is locally free if X can be covered with open sets U for which each F |U is a (not necessarily finitely generated) free OX |U -module. 10 OSAMU IYAMA AND MICHAEL WEMYSS If F ∈ Qcoh X is locally free, then Fx is a free OX,x -module for all closed points x ∈ X. The converse is true if F ∈ coh X. As in [O03, §1] we consider • the full triangulated subcategory per(X) of Db (coh X) consisting of objects which are isomorphic to bounded complexes of finitely generated locally free sheaves in Db (coh(X)). • the full triangulated subcategory Lfr(X) of Db (Qcoh X) consisting of objects which are isomorphic to bounded complexes of locally free sheaves in Db (Qcoh(X)). Following Orlov [O03, O09], we denote Dsg (X) := Db (coh X)/ per(X) and DSG (X) := Db (Qcoh X)/ Lfr(X). Then the natural functor Dsg (X) → DSG (X) is fully faithful [O03, 1.13], and we regard Dsg (X) as a full subcategory of DSG (X). The aim of this subsection is to prove the following result, which plays a crucial role in this paper. Note that part (2) also follows from work of Orlov [O09], and is well-known to experts [BK]. Theorem 3.2. Suppose that X is a Gorenstein scheme of dimension d satisfying (ELF), with isolated singularities {x1 , . . . , xn }. Ln Ln (1) There is a triangle equivalence Dsg (X) → i=1 Dsg (OX,xi ) = i=1 CM OX,xi up to summands, given by F 7→ (Fx1 , . . . , Fxn ). Ln bX,xi . (2) Taking the idempotent completion gives a triangle equivalence Dsg (X) ≃ i=1 CM O Since a key role in our proof of Theorem 3.2 is played by the category DSG (X), we need to deal with infinitely generated modules. Let us start with recalling results by Gruson–Raynaud [GR] and Jensen [J70]. Proposition 3.3. Let R be a noetherian ring of finite Krull dimension and M ∈ Mod R. Then (1) FPD(R) := sup{proj.dim(M ) | M ∈ Mod R and proj.dimR (M ) < ∞} = dim R. (2) flat.dimR (M ) < ∞ implies proj.dimR (M ) < ∞. Proof. (1) is due to Bass and Gruson–Raynaud [GR, II.3.2.6] (see also [F77, 3.2]). (2) is due to Jensen [J70, Prop.6] (see also [F77, 3.3]).  We have the following immediate consequence. Lemma 3.4. Let R be a noetherian ring of finite Krull dimension. Then for any M ∈ Mod R, proj.dimRm (Mm ) < ∞ for all m ∈ Max R ⇐⇒ proj.dimR (M ) ≤ dim R. Proof. (⇐) is trivial (⇒) The hypothesis implies that proj.dimRp (Mp ) < ∞ for all p ∈ Spec R. Thus by 3.3(1), we have proj.dimRp (Mp ) ≤ dim Rp ≤ dim R for all p ∈ Spec R. In particular flat.dimRp (Mp ) ≤ dim R for all p ∈ Spec R. Now X ∈ Mod R is zero if Xp = 0 for all p ∈ Spec R. This implies flat.dimR (M ) ≤ dim R since Tor groups localize also for infinitely generated modules. By 3.3(2), M has finite projective dimension. Again by 3.3(1), we have proj.dimR (M ) ≤ dim R.  The following is easy: Lemma 3.5. Let R be a commutative noetherian ring of finite Krull dimension, then Kb (Free R) = Lfr(Spec R) = Kb (Proj R). Proof. We have natural inclusions Kb (Free R) ⊆ Lfr(Spec R) ⊆ Kb (Proj R) since every free module is clearly locally free, and further every locally free R-module is locally projective, thus projective by [GR, II.3.1.4(3)]. We only have to show Kb (Proj R) = Kb (Free R). The proof is similar to [R89, 2.2] — by the Eilenberg swindle, if P ∈ Proj R, there exists F ∈ Free R such that P ⊕ F is free. Hence from every object of Kb (Proj R) we can get to an object of Kb (Free R) by taking the direct sum with complexes of the form 0 → F → F → 0, which are zero objects in the homotopy category.  Corollary 3.6. Suppose that X satisfies (ELF). If F ∈ Qcoh X satisfies proj.dimOX,x (Fx ) < ∞ for all closed points x ∈ X, then F ∈ Lfr(X). 11 Q-FACTORIAL TERMINALIZATIONS AND MMAS Proof. Since X satisfies (ELF), membership of Lfr(X) can be checked locally (see [O03, 1.7, proof of 1.14]). Thus we only have to show F |U ∈ Lfr(U ) for each affine open subset U = Spec R of X. Since Fm is an Rm -module with finite projective dimension for all m ∈ Max R, we have F |U ∈ Kb (Proj R) by 3.4. By 3.5, we have F |U ∈ Lfr(U ), so the assertion follows.  We will also require the following well-known lemma, due to Orlov. If s is an object in a triangulated category T , we denote thickT (s) to be the smallest triangulated subcategory of T which is closed under direct summands and isomorphisms and contains s. Lemma 3.7. (Orlov) Suppose that X satisfies (ELF), and has only isolated singularities {x1 , . . . , xn }.LDenote the corresponding skyscraper sheaves by k1 , . . . , kn . Then Dsg (X) = n thickDsg (X) ( i=1 ki ). Proof. By assumption the singular locus consists of a finite number of closed points, hence is closed. It follows that Dsg (X) = thickDsg (X) (coh{x1 ,...,xn } X) by [C10, 1.2]. It is clear Ln that every coherent sheaf supported in {x1 , . . . , xn } belongs to thickDsg (X) ( i=1 ki ).  Now we are ready to prove 3.2. gi h For each xi , consider a morphism fi := (Spec OX,xi → Spec Ri →i X) where Spec Ri is some affine open subset of X containing xi . Let S := OX,x1 ⊕. . .⊕OX,xn and Y := Spec S. Then the collection of the fi induce a morphism ` f Y = ni=1 Spec OX,xi → X. The functor gi ∗ is just extension of scalars corresponding to a localization Ri → Rim , so gi ∗ is exact and preserves quasi-coherence. Further hi is an affine morphism (since X is separated), hence hi ∗ also is exact and preserves quasi-coherence. Hence each fi ∗ is exact and preserves quasi-coherence. Thus we have an adjoint pair f∗ Qcoh Y = Qcoh X n L Qcoh OX,xi i=1 f∗ which are explicitly given by f ∗ F = (Fx1 , . . . , Fxn ) and f∗ (G1 , . . . , Gn ) = These functors are exact, so induce an adjoint pair f∗ Db (Qcoh Y ) = Db (Qcoh X) n L i=1 f∗ Ln i=1 fi ∗ Gi . Db (Qcoh OX,xi ) in the obvious way. We will show f ∗ (Lfr(X)) ⊆ Lfr(Y ) and f∗ (Lfr(Y )) ⊆ Lfr(X), since this then induces an adjoint pair f∗ Ln DSG (X) DSG (Y ) = i=1 DSG (OX,xi ). f∗ by [O03, 1.2]. It is clear that f ∗ takes locally free sheaves to projective modules, and so f ∗ (Lfr(X)) ⊆ Lfr(Y ). On the other hand, each fi ∗ is an affine, flat morphism so fi ∗ OX,xi is a flat OX -module. Further, each fi ∗ preserves sums, so takes projective OX,xi -modules to flat OX -modules. Consequently, it follows that f∗ takes a projective S-module P to a sheaf f∗ (P ) for which f∗ (P )x is a flat OX,x -module for all closed points x ∈ X. By 3.3(2) we have proj.dimOX,x (f∗ (P )x ) < ∞ for all closed points x ∈ X, hence by 3.6 f∗ (P ) ∈ Lfr(X) holds. Thus we have f∗ (Lfr(Y )) ⊆ Lfr(X). Now denote the skyscraper sheaves in X corresponding to theL singular points x1 , . . . , xn n by k1 , . . . , kn . By 3.7 we know that Dsg (X) = thickDsg (X) ( i=1 ki ). This implies Ln Dsg (X) ⊆ thickDSG (X) ( i=1 ki ). Let α : 1 → f∗ ◦f ∗ be the unit. Since f∗ ◦f ∗ (ki ) = f∗ (0, . . . , 0, ki , 0, . . . , 0) = fL i ∗ ki = ki for all 1 ≤ i ≤ n, we have that α : 1 → f∗ ◦ f ∗ is an isomorphism on thickDSG (X) ( ni=1 ki ). Ln In particular f ∗ is fully faithful on thickDSG (X) ( i=1 ki ). Since f ∗ clearly takes Dsg (X) L to Dsg (Y ), and Dsg (X) ⊆ thickDSG (X) ( ni=1 ki ), we deduce that f∗ Dsg (X) −→ Dsg (Y ) 12 OSAMU IYAMA AND MICHAEL WEMYSS L is fully faithful. On the other hand, since Dsg (Y ) = thickDsg (Y ) (f ∗ ni=1 ki ) holds by 3.7, we have Dsg (Y ) = thickDsg (Y ) (f ∗ (Dsg (X))). This immediately implies that f ∗ : Dsg (X) → Dsg (Y ) is an equivalence up to direct summands (e.g. [N01, 2.1.39]). The first statement (1) in the theorem now follows from the well-known equivalence Dsg (OX,xi ) ≃ CM OX,xi due to Buchweitz [B86, 4.4.1]. The second statement (2) follows bX,xi [KMV, A.1]. from (1), since the idempotent completion of CM OX,xi is CM O  The first corollary of 3.2 is the following alternative proof of [O03, 1.24], which we will use later: Corollary 3.8. Suppose that X is a d-dimensional Gorenstein scheme over k, satisfying (ELF), with isolated singularities. Then all Hom-sets in Dsg (X) are finite dimensional k-vector spaces. Proof. By 3.2(1), it is enough to show that all Hom-sets in CM OX,xi are finite dimensional k-vector spaces. Since each OX,xi is isolated, all Hom-sets in CM OX,xi are finite length OX,xi -modules by 2.5(2). But each OX,xi is a localization of a finitely generated kalgebra, so by the Nullstellensatz its residue field is a finite extension of k. Thus the assertion follows.  3.2. Rigid-freeness and Q-factoriality. In this section we give our main result which characterizes the Q-factorial property in terms of the singular derived category, and then relate this to MMAs. Definition 3.9. Suppose that X is a Gorenstein scheme. We say that F ∈ coh X is a Cohen–Macaulay (=CM) sheaf if Fx is a CM OX,x -module for all closed points x ∈ X. Under the assumption that X is Gorenstein, F ∈ coh X is a CM sheaf if and only if Exti (F , OX )x (= ExtiOX,x (Fx , OX,x )) = 0 for all closed points x ∈ X and all i > 0. Thus F ∈ coh X is a CM sheaf if and only if Exti (F , OX ) = 0 for all i > 0. The following is a generalization of 2.9(3)⇒(4). Proposition 3.10. Suppose that X is a Gorenstein normal scheme satisfying (ELF), of dimension three which has only isolated singularities {x1 , . . . , xn }. If Dsg (X) is rigid-free, then X is locally factorial. Proof. We need to show that any reflexive sheaf G on X of rank one is locally free. For all closed points x ∈ X, we have a reflexive OX,x -module Gx of rank one. Since OX,x is a normal domain, we have EndOX,x (Gx ) = OX,x . Since OX,x is an isolated singularity, we have Ext1OX,x (Gx , Gx ) = 0 by 2.7(2). Since X satisfies (ELF), there exists an exact sequence 0 → K → V → G → 0 with a locally free sheaf V. Localizing at x, we have an exact sequence 0 → Kx → Vx → Gx → 0 (3.C) of OX,x -modules with a projective OX,x -module Vx . Since Gx ∈ ref OX,x , we have Kx ∈ CM OX,x . Since Ext1OX,x (Gx , Gx ) = 0, we have EndOX,x (Kx ) ∈ CM OX,x by applying [IW2, 4.10] to (3.C). Thus Ext1OX,x (Kx , Kx ) = 0 holds, again by 2.7(2). Since Kx ∈ CM OX,x , we have by 3.2(1) HomDsg (X) (K, K[1]) ∼ = n M i=1 Ext1OX,xi (Kxi , Kxi ) = 0. Since Dsg (X) is rigid-free by our assumption, we have K ∈ per(X). Thus Kx is a CM OX,x -module of finite projective dimension. By the Auslander–Buchsbaum equality, Kx has to be a projective OX,x -module. By (3.C), we have proj.dimOX,x Gx ≤ 1 for all x ∈ X. If proj.dimOX,x Gx = 1, then Ext1OX,x (Gx , Gx ) 6= 0 by [AG, 4.10], a contradiction. Thus Gx is a projective OX,x -module for all x ∈ X. Hence G is locally free.  Now we are ready to state our main result, which gives a relationship between factoriality of schemes and rigid-freeness of their singular derived categories. Q-FACTORIAL TERMINALIZATIONS AND MMAS 13 Theorem 3.11. Suppose that X is a normal 3-dimensional Gorenstein scheme over k, satisfying (ELF), with isolated singularities {x1 , . . . , xn }. (1) If OX,xi are hypersurfaces for all 1 ≤ i ≤ n, then the following are equivalent: (a) X is locally factorial. (b) X is Q-factorial. (c) Dsg (X) is rigid-free. (d) CM OX,x is rigid-free for all closed points x ∈ X. bX,xi are hypersurfaces for all 1 ≤ i ≤ n, then the following are equivalent: (2) If O (a) (b) (c) (d) X is complete locally factorial. X is complete locally Q-factorial. Dsg (X) is rigid-free. bX,x is rigid-free for all closed points x ∈ X. CM O Proof. (1) (a)⇒(b) is clear. (b)⇒(d) follows from 2.11(5)⇒(3). (d)⇒(c) follows from 3.2(1). (c)⇒(a) follows from 3.10. (2) The proof is identical to the proof in (1).  4. MMAs and NCCRs via tilting The aim of this section is to give explicit information on rings that are derived equivalent to certain varieties. Our main results (4.5, 4.14, 4.15 and 4.16) show a strong relationship between the crepancy of birational morphisms and the property that the rings are Cohen-Macaualy. In particular, we show that all algebras derived equivalent to Q-factorial terminalizations in dimension three are MMAs. Throughout this section, we continue to use the word variety to mean a normal integral scheme, of finite type over a field k, satisfying (ELF). Some of the results below remain true with weaker assumptions. If X is a variety, we denote DX := g ! k to be the dualizing complex of X [H66, Ch V §10], where g : X → Spec k is the structure morphism. If further X is CM of dimension d, we will always use ωX to denote DX [−d], and refer to it as the geometric canonical. Thus, although canonical modules and dualizing complexes are not unique, throughout this section ωX has a fixed meaning. Note that crepancy is defined with respect to this canonical, i.e. f : Y → X is called crepant if f ∗ ωX = ωY . 4.1. The endomorphism ring of a tilting complex. We call V ∈ per(Y ) a pretilting complex if HomD(Y ) (V, V[i]) = 0 for all i 6= 0, and a tilting complex if it is a pretilting complex satisfying thickD(Y ) (V) = per(Y ). If Y is derived equivalent to Λ, there exists a tilting complex V such that Λ ∼ = EndD(Y ) (V). The following two results are well-known. Lemma 4.1. Suppose that X is a scheme over a field k satisfying (ELF). Suppose that X is derived equivalent to some ring Λ, then (1) per(X) ≃ Kb (proj Λ). (2) Dsg (X) ≃ Dsg (Λ). Proof. (1) Clearly the derived equivalence Db (coh X) ≃ Db (mod Λ) induces an equivalence between full subcategories of homologically finite complexes. We observed in 2.18 that Kb (proj Λ) are precisely the homologically finite complexes in Db (mod Λ). On the other hand, per(X) are precisely the homologically finite complexes in Db (coh X) by [O05, 1.11]. Thus the assertion follows. (2) follows immediately from (1).  Corollary 4.2. Suppose that X is a scheme over a field k satisfying (ELF). Suppose that X is derived equivalent to some ring Λ, which is a d-sCY algebra over a normal d-sCY k-algebra. Then (1) X is smooth if and only if Λ is non-singular (in the sense of 2.4). (2) If X has only isolated singularities, then Λ has isolated singularities. Proof. The derived equivalence induces Dsg (X) ≃ Dsg (Λ) by 4.1. It is very well-known that X is smooth if and only if Dsg (X) = 0, so (1) follows from 2.5(1). (2) is immediate from 3.8 and 2.5(2).  14 OSAMU IYAMA AND MICHAEL WEMYSS In the rest of this subsection we suppose that we have a projective birational morphism f : Y → Spec R and that Y is derived equivalent to some ring Λ, and we investigate when Λ has the form EndR (M ) for some M ∈ ref R. We need the following well-known lemma. Lemma 4.3. Let Y → Spec R be a projective birational morphism between d-dimensional normal integral schemes. Let p ∈ Spec R and consider the following pullback diagram: Y′ i Y g Spec Rp f j Spec R (1) If p is a height one prime, then g is an isomorphism. (2) If V is a pretilting complex of Y with Λ := EndD(Y ) (V), then Λ is a module-finite R-algebra and i∗ V is a pretilting complex of Y ′ with Λp ∼ = EndY ′ (i∗ V). Proof. (1) Since Y and Spec R are integral schemes and f is a projective birational morphism, it is well-known that f is the blowup of some ideal I of R [Liu, 8.1.24]. But blowups are preserved under flat base change, and in fact g is the blowup at the ideal Ip [Liu, 8.1.14]. Now since R is normal Rp is a discrete valuation ring, so every ideal is principal. Thus g is the blowup of a Cartier divisor, and so is an isomorphism by the universal property of blowing up. (2) Since coh Y is an R-linear category, so is its derived category, and hence Λ has the structure of an R-algebra. Since V is a pretilting complex, we have Λ = RHomY (V, V) = Rf∗ RHomY (V, V). (4.D) Now since V is perfect, RHomY (V, V) is a bounded complex of coherent sheaves. Further, since f is proper, f∗ preserves coherence and so Rf∗ : Db (coh Y ) → Db (mod R). Therefore Rf∗ RHomY (V, V) = Λ is a finitely generated R-module. Lastly, applying j ∗ to both sides of (4.D) gives Λp = j ∗ Rf∗ RHomY (V, V) = Rg∗ i∗ RHomY (V, V) = Rg∗ RHomY ′ (i∗ V, i∗ V) = RHomY ′ (i∗ V, i∗ V), where the second equality is flat base change, and the third holds since i is flat and V is  coherent [H66, II.5.8]. Thus we have the assertion. We will also need the following result of Auslander–Goldman. A proof can be found in [IW2, 2.11]. Proposition 4.4. [AG] Let R be a normal domain, and let Λ be a module-finite R-algebra. Then the following conditions are equivalent: (1) There exists M ∈ ref R such that Λ ∼ = EndR (M ) as R-algebras. (2) Λ ∈ ref R and further Λp is Morita equivalent to Rp for all p ∈ Spec R with ht p = 1. This leads to the following, which is an analogue of [IW2, 4.6(1)]. Theorem 4.5. Let Y → Spec R be a projective birational morphism between d-dimensional normal integral schemes, and suppose that Y is derived equivalent to some ring Λ. Then Λ is a module-finite R-algebra. If moreover Λ ∈ ref R, then Λ ∼ = EndR (M ) for some M ∈ ref R. Proof. Since Λ ∼ = EndD(Y ) (V) for some tilting complex V, it is a module-finite R-algebra by 4.3(2). Now consider a height one prime p ∈ Spec R, then by base change we have a pullback diagram Y′ i g Spec Rp Y f j Spec R 6 0 By 4.3(1) g is an isomorphism, and by 4.3(2) Λp = RHomY ′ (i∗ V, i∗ V). Note that i∗ V = since Λ ∈ ref R, so since R is normal necessarily Λ is supported everywhere. Since Rp is a Q-FACTORIAL TERMINALIZATIONS AND MMAS 15 local ring, the only perfect complexes x with HomD(Rp ) (x, x[i]) = 0 for all i > 0 are shifts of projective modules [RZ, 2.12]. Thus g∗ i∗ V ∼ = Rpa [b] for some a ∈ N and b ∈ Z. Hence a ∼ Λp = EndRp (Rp ), which is Morita equivalent to Rp . This holds for all height one primes,  so by 4.4 the assertion follows. 4.2. Cohen–Macaulayness and crepancy. Let f : Y → Spec R be a projective birational morphism such that Y is derived equivalent to some ring Λ. In this section we show that f is crepant if and only if Λ ∈ CM R. To do this requires the following version of Grothendieck duality. Theorem 4.6. Suppose that f : Y → Spec R is a projective morphism, then RHomY (F , f ! G) = RHomR (RΓ F , G) for all F ∈ D(Qcoh Y ), and G ∈ D + (Mod R). Proof. The sheafified duality theorem [N96, §6, 6.3] reads Rf∗ RHomY (F , f ! G) = RHomR (Rf∗ F , G). In this situation, Rf∗ = RΓ, and since Spec R is affine, global and local hom agree.  The following is also well-known [V04a, 3.2.9]. Lemma 4.7. Suppose that f : Y → Spec R is a projective birational morphism, where Y and R are both Gorenstein varieties of dimension d. Then (1) f ! OR is a line bundle. (2) f is crepant if and only if f ! OR = OY . Proof. Since R is Gorenstein ωR is a line bundle and thus is a compact object in D(Mod R). ! ∗ ! Hence by [N96, p227–228] we have f ! ωR = Lf ∗ ωR ⊗L Y f OR = f ωR ⊗Y f OR and so ωY = DY [−d] = f ! DR [−d] = f ! ωR = f ∗ ωR ⊗Y f ! OR . Since both ωY and f ∗ ωR are line bundles, f ! OR = (f ∗ ωR )−1 ⊗Y ωY is a line bundle. Moreover f is crepant if and only if f ∗ ωR = ωY if and only if f ! OR = OY .  The following result show that crepancy implies that Λ is Cohen-Macaulay. Lemma 4.8. Suppose that f : Y → Spec R is a crepant projective birational morphism, where Y and R are both Gorenstein varieties of dimension d. Then EndD(Y ) (V) ∈ CM R for any pretilting complex V of Y . Proof. We have ∼ RHomY (V, V) ∼ = RHomY (V, V ⊗L Y OY ) = RHomY (RHomY (V, V), OY ). Applying RΓ to both sides, we have RHomY (V, V) ∼ = RHomY (RHomY (V, V), OY ) ∼ = RHomY (RHomY (V, V), f ! OR ) ∼ = RHomR (RHomY (V, V), R). 4.7 4.6 Since V is pretilting RHomY (V, V) = EndD(Y ) (V), so the above isomorphism reduces to EndD(Y ) (V) = RHomR (EndD(Y ) (V), R). Hence applying H i to both sides, we obtain ExtiR (EndD(Y ) (V), R) = 0 for all i > 0. Thus EndD(Y ) (V) ∈ CM R, as required.  To show the converse of 4.8, namely Λ is Cohen–Macaulay implies crepancy, will involve Serre functors. However, since we are in the singular setting these are somewhat more subtle than usual. The following is based on [G06, 7.2.6]. 16 OSAMU IYAMA AND MICHAEL WEMYSS Definition 4.9. Suppose that Y → Spec R is a morphism where R is CM ring with a canonical module CR . We say that a functor S : per(Y ) → per(Y ) is a Serre functor relative to CR if there are functorial isomorphisms RHomR (RHomY (F , G), CR ) ∼ = RHomY (G, S(F )) in D(Mod R) for all F , G ∈ per(Y ). If Λ is a module-finite R-algebra, we define Serre functor S : Kb (proj Λ) → Kb (proj Λ) relative to CR in a similar way. Remark 4.10. We remark that since we are working in the non-local CM setting, canonical modules are not unique. Although crepancy is defined with respect to the geometric canonical ωR , and [G06] defines Serre functors with respect to ωR , there are benefits of allowing the flexibility of different canonical modules. Bridgeland–King–Reid [BKR, 3.2] had technical problems when the geometric canonical is not trivial, since they first had to work locally (where the canonical is trivial), and then extend this globally. Below, we avoid this problem by considering Serre functors with respect to the canonical module R, using the trick in 4.13(2). The following two lemmas are standard. Lemma 4.11. Suppose that S and T are two Serre functors relative to the same canonical CR . Then S and T are isomorphic. Proof. There are functorial isomorphisms RHomY (G, S(F )) ∼ = RHomY (G, T(F )) for all F , G ∈ per(Y ), which after applying H 0 give functorial isomorphisms Homper(Y ) (−, S(−)) ∼ = Homper(Y ) (−, T(−)) Since S and T take values in per(Y ), we may use Yoneda’s lemma to conclude that S and T are isomorphic.  Lemma 4.12. Suppose that Y → Spec R is a projective birational morphism between varieties, and Y is derived equivalent to Λ. Then any Serre functor S : Kb (proj Λ) → Kb (proj Λ) relative to CR induces a Serre functor S′ : per(Y ) → per(Y ) relative to CR Proof. It is enough to show that we have a triangle equivalence F : per(Λ) → per(Y ) with a functorial isomorphism RHomΛ (A, B) ∼ = RHomY (F A, F B) in D(R) for all A, B ∈ per(Λ), since then for a quasi-inverse E of F we have that S′ := F ◦S◦E : per(Y ) → per(Y ) enjoys functorial isomorphisms RHomR (RHomY (F A, F B), CR ) ∼ = RHomR (RHomΛ (A, B), CR ) ∼ = RHomΛ (B, SA) ∼ = RHomY (F B, F (SA)) ∼ = RHomY (F B, S′ (F A)) in D(R). Let V be a tilting complex of Y , and let A be the DG endomorphism R-algebra of V . (i) Let Cdg (A ) be the DG category of DG A -modules. We denote by pretr(A ) the smallest DG subcategory of Cdg (A ) which is closed under [±1] and cones and contains A . Since the DG category perdg (Y ) of perfect complexes of Y is pretriangulated, there exists a fully faithful DG functor V ⊗A − : pretr(A ) → perdg (Y ) which induces a triangle equivalence G : per(A ) → per(Y ) [K06, Section 4.5]. In particular, we have a functorial isomorphism Hom•A (A, B) ∼ = Hom•Y (V ⊗A A, V ⊗A B) of DG R-modules for all A, B ∈ pretr(A ), where we denote by Hom•A and Hom•Y the Hom-sets in our DG categories. Thus we have a functorial isomorphism RHomA (A, B) ∼ = RHomY (GA, GB) in D(R) for all A, B ∈ per(A ). (ii) Let f : A → B be a quasi-isomorphism of DG R-algebras. Then the DG functor B⊗A − : pretr(A ) → pretr(B) gives a triangle equivalence H : per(A ) → per(B). For all A, B ∈ pretr(A ), we have a quasi-isomorphism Hom•A (A, B) → Hom•B (B ⊗A A, B ⊗A B) of DG R-modules. In particular, we have a functorial isomorphism RHomA (A, B) ∼ = RHomB (HA, HB) in D(R) for all A, B ∈ per(A). (iii) Since V is a tilting complex, we have quasi-isomorphisms A ≤0 → A and A ≤0 → Λ Q-FACTORIAL TERMINALIZATIONS AND MMAS 17 of DG R-algebras, where A ≤0 is a DG sub R-algebra (· · · → A −1 → Ker d0 → 0 → · · · ) of A . Combining (i) and (ii), we have the desired assertion.  The following is our key observation. Lemma 4.13. Suppose that f : Y → Spec R is a projective birational morphism, where Y and R are both Gorenstein varieties. (1) − ⊗Y f ! OR : per(Y ) → per(Y ) is a Serre functor relative to R. (2) f is crepant if and only if id : per(Y ) → per(Y ) is a Serre functor relative to R. Proof. (1) We know by 4.7 that f ! OR is a line bundle, so it follows that tensoring by f ! OR gives a functor − ⊗Y f ! OR : per(Y ) → per(Y ). Further, we have functorial isomorphisms 4.6 RHomY (G, F ⊗Y f ! OR ) ∼ = RHomY (RHomY (F , G), f ! OR ) ∼ = RHomR (RHomY (F , G), OR ) in D(Mod R) for all F , G ∈ per(Y ). Thus − ⊗Y f ! OR is a Serre functor relative to R. (2) By (1) and 4.11, id is a Serre functor relative to R if and only if − ⊗Y f ! OR = id as functors per(Y ) → per(Y ). This is equivalent to f ! OR = OY , which is equivalent to that  f is crepant by 4.7. The following explains the geometric origin of the definition of modifying modules, and is the first main result of this subsection. Theorem 4.14. Let f : Y → Spec R be a projective birational morphism between ddimensional Gorenstein varieties. Suppose that Y is derived equivalent to some ring Λ, then the following are equivalent. (1) f is crepant. (2) Λ ∈ CM R. (3) id : per(Y ) → per(Y ) is a Serre functor relative to R. In this case Λ ∼ = EndR (M ) for some M ∈ ref R. Proof. (3)⇔(1) is shown in 4.13(2), and (1)⇒(2) is shown in 4.8. (2)⇒(3) Let − − S := RHomR (Λ, R) ⊗L Λ − : D (mod Λ) → D (mod Λ). By [IR, 3.5(2)(3)], there exists a functorial isomorphism ∼ RHomR (RHomΛ (B, A), R) RHomΛ (A, S(B)) = (4.E) in D(R) for all A ∈ Db (mod Λ) and all B ∈ Kb (proj Λ). Now suppose that Λ ∈ CM R. Since it is reflexive, Λ ∼ = EndR (M ) for some M ∈ ref R by 4.5. Then we have Λ∼ = HomR (Λ, R) ∼ = RHomR (Λ, R) in D(Λ ⊗R Λop ) where the first isomorphism holds by 2.8(1), and the second since Λ ∈ CM R. Thus we have S ∼ = id, and (4.E) shows that id : Kb (proj Λ) → Kb (proj Λ) is a Serre functor relative to R. By 4.12 it follows that id : per(Y ) → per(Y ) is a Serre functor relative to R.  When further Y is smooth, we can strengthen 4.14. Corollary 4.15. Let f : Y → Spec R be a projective birational morphism between ddimensional Gorenstein varieties. Suppose that Y is derived equivalent to some ring Λ, then the following are equivalent. (1) f is a crepant resolution of Spec R. (2) Λ is an NCCR of R. Proof. By 4.14 f is crepant if and only if Λ ∈ CM R. Assume that this is satisfied, then again by 4.14 Λ ∼ = EndR (M ) for some M ∈ ref R. By 4.2(1) Y is smooth if and only if Λ is non-singular, which means that Λ is an NCCR of R.  We are now in a position to relate maximal modification algebras and Q-factorial terminalizations in dimension three. The following is the second main result of this subsection. 18 OSAMU IYAMA AND MICHAEL WEMYSS Theorem 4.16. Let f : Y → Spec R be a projective birational morphism, where Y and R are both Gorenstein varieties of dimension three. Assume that Y has (at worst) isolated singularities {x1 , . . . , xn } where each OY,xi is a hypersurface. If Y is derived equivalent to some ring Λ, then the following are equivalent. (1) f is crepant and Y is Q-factorial. (2) Λ is an MMA of R. In this situation, all MMAs of R are derived equivalent and have isolated singularities. Proof. By 4.14 f is crepant if and only if Λ ∈ CM R. Assume that this is satisfied, then again by 4.14 Λ ∼ = EndR (M ) for some M ∈ ref R. Thus Dsg (Y ) ≃ CM Λ by 4.1, 2.8(2) and 2.3. Since the singularities of Y are isolated, Λ has isolated singularities by 4.2(2). Now by 3.11(1), Y is Q-factorial if and only if Dsg (Y ) ≃ CM Λ is rigid-free, which by 2.14 holds if and only if Λ is an MMA. Lastly, all maximal modification algebras are derived equivalent [IW2, 4.15], thus all are derived equivalent to Y and hence all have isolated  singularities by 4.2(2). Remark 4.17. When k = C and Y has only terminal singularities, the geometric assumptions in 4.16 are satisfied since terminal singularities are isolated for 3-folds [KM, 5.18], and Gorenstein terminal singularities are Zariski locally hypersurfaces [R83, 0.6(I)]. This shows that when k = C and Y has only terminal singularities, Y is a Q-factorial terminalization of Spec R if and only if Λ is an MMA. Remark 4.18. We also remark that if Conjecture 1.8 is true, then the Y in 4.16 always admit a tilting complex. Note that the corresponding statement of 1.8 in dimension four is false, see 4.20. Note that all the results in this subsection remain valid in the complete local setting. In particular 4.19 below corresponds to 4.16, and will be used in §5. Here, a morphism f : Y → X = Spec R is called crepant if f ∗ ωX = ωY holds (as before), where now X has a unique canonical sheaf ωX = OR , and we choose the canonical sheaf ωY := f ! ωX on Y . Corollary 4.19. Suppose f : Y → Spec R is a projective birational morphism between 3dimensional Gorenstein normal integral schemes, satisfying (ELF), where R is a complete local ring containing a copy of its residue field. Suppose further that Y has (at worst) isolated singularities {x1 , . . . , xn } where each OY,xi is a hypersurface. If Y is derived equivalent to some ring Λ, then the following are equivalent. (1) Y is complete locally Q-factorial and f is crepant. (2) Y is Q-factorial and f is crepant. (3) Λ is an MMA of R. In this situation, all MMAs of R are derived equivalent and have isolated singularities. Proof. (2)⇔(3) is similar to 4.16 (1)⇔(2). (1)⇔(2) By 3.11(1)(2), we only have to show that Dsg (Y ) = Dsg (Y ) holds. By 4.14 Λ∼ = EndR (M ) ∈ CM R for some M ∈ ref R. We have Dsg (Y ) ≃ CM Λ by 4.1, 2.8(2) and 2.3. The endomorphism ring EndΛ (X) of any X ∈ mod Λ is again a module-finite algebra over a complete local ring R. Thus any idempotent in EndΛ (X) is an image of some idempotent in EndΛ (X) by [CR, 6.5, 6.7], which corresponds to some direct summand of X. Therefore the category CM Λ ≃ Dsg (Y ) is idempotent complete, and we have the assertion.  4.3. A counterexample in dimension four. Here we show that we cannot always expect the setup of 4.16 and 4.15 to hold in higher dimension. This puts severe limitations on any general homological theory that covers dimension four. The following is an extension of an example of Dao [D1, 3.5]. Theorem 4.20. Let R := C[x0 , x1 , x2 , x3 , x4 ]/(x50 + x41 + x42 + x43 + x44 ). This has a crepant resolution, which we denote by Y → Spec R. Then there is no algebra Λ that is derived equivalent to Y . Proof. Note first that R is an isolated singularity, with unique singular point at the origin. A projective crepant resolution exists by [Lin, Thm. A.4]. Suppose Λ is derived equivalent to Y , then by 4.15 Λ ∼ = EndR (M ) is an NCCR of R. Completing with respect to the Q-FACTORIAL TERMINALIZATIONS AND MMAS 19 c) is an NCCR of R. b But End b (M c) ∈ maximal ideal of the origin, this implies that EndRb (M R b with M c ∈ ref R, b so since R b is a 4-dimensional local isolated hypersurface, M c must CM R c) ∼ b be free [D1, 2.7(3)]. But this forces EndRb (M M ( R), which is a contradiction since = n b Mn (R) has infinite global dimension.  5. cAn singularities via derived categories We now illustrate the results of the previous section to give many examples of maximal modification algebras. The following result is due to Shepherd–Barron (unpublished). Proposition 5.1. Let R = C[[u, v, x, y]]/(uv − f (x, y)) be an isolated cAn singularity. Then the following are equivalent (1) There does not exist a non-trivial crepant morphism Y → Spec R. (2) f (x, y) is irreducible. (3) R is factorial. (4) R is Q-factorial. (5) R is an MM R-module. Proof. (1)⇒(2) If f (x, y) factors non-trivially as f = f1 f2 then blowing up the ideal (u, f1 ) yields a non-trivial crepant morphism (as in the calculation in §5.1). Hence f (x, y) cannot factor. (2)⇒(3) This is easy (see e.g. proof of [IW3, 5.9]). (3)⇒(4) This is clear. (4)⇒(5) This follows from 2.11(5)⇒(1). (5)⇒(1) Since R is an isolated cDV singularity of type A (see e.g. [BIKR, 6.1(e)]), it is a terminal singularity by [R83, 1.1]. If there exists a non-trivial crepant morphism f : Y → Spec R, then f must have one-dimensional fibres. Hence by [V04a, 3.2.10] there exists a non-projective modifying module. Since R is a MM R-module, this contradicts 2.9.  5.1. Crepant modifications of cAn singularities. In this section we work over K, an algebraically closed field of characteristic zero. Let R := K[[u, v, x, y]]/(uv − f (x, y)), with f ∈ m := (x, y) ⊆ K[[x, y]]. We let f = f1 . . . fn be a factorization into prime elements of K[[x, y]]. We restrict to this complete local setting since it simplifies the proof of the main theorem 5.2. A similar version of 5.2 is true when R is not complete local, though this requires a much more complicated proof [W12]. We remark that when K = C, R is a cAm singularity for m := ord(f ) − 1 (see e.g. [BIKR, 6.1(e)]). This is terminal if and only if R is an isolated singularity [R83, 1.1] if and only if (fi ) 6= (fj ) for all i 6= j. For any subset I ⊆ {1, . . . , n} we denote Y fI := fi and TI := (u, fI ) i∈I which is an ideal of R. For a collection of subsets ∅ ( I1 ( I2 ( ... ( Im ( {1, 2, ..., n}, we say that F = (I1 , . . . , Im ) is a flag in the set {1, 2, . . . , n}. We say that the flag F is maximal if n = m + 1. Given a flag F = (I1 , . . . , Im ), we define   m M T F := R ⊕  TIj  . j=1 On the other hand, geometrically, given a flag F = (I1 , . . . , Im ) we define a scheme X F as follows: 20 OSAMU IYAMA AND MICHAEL WEMYSS First, let X F1 → Spec R be the blowup of the ideal (u, fI1 ) in R = K[[u, v, x, y]]/(uv − f ). Then X F1 is covered by two open charts, given explicitly by R1 := K[[u, v, x, y]][V1 ] ! v − V1 ffI 1 uV1 − fI1 and R2 := K[[u, v, x, y]][U1 ] !. u − fI1 U1 U1 v − ffI 1 fI1 u and U1 = fuI glue to give a copy of P1 inside X F1 (possibly The new coordinates V1 = 1 moving in a family), which maps to the origin of Spec R. f Next, let X F2 → X F1 be the blowup of the divisor (U1 , fII2 ) in the second co-ordinate 1 f chart R2 . Note that the zero set of the divisor (U1 , fII2 ) does not intersect the first co1 ordinate chart R1 , so R1 is unaffected under the second blowup. Locally above R2 , the calculation to determine the structure of X F2 is similar to the above. Thus X F2 is covered by the three affine open sets K[[u, v, x, y]][V1 ] ! v − V1 ffI 1 uV1 − fI1 and K[[u, v, x, y]][U1 , V2 ]   u − fI1 U1  v − f V2  fI   2 U1 V2 − and K[[u, v, x, y]][U2 ] ! u − fI2 U2 U2 v − ffI 2 fI2 fI1 The U2 and the V2 coordinates again glue to produce another P1 (again which might move in a family) which maps to the origin of R2 and hence to the origin of R. f Continuing by blowing up the ideal (U2 , fII3 ), in this way we obtain a chain of pro2 jective birational morphisms X Fm → X Fm−1 → . . . → X F1 → Spec R, and we define X F := X Fm . See 5.5 later for a picture of this process. Note that X F , being projective over the base Spec R, automatically satisfies (ELF) [TT, 2.1.3], and by inspection of the charts, X F is a normal integral Gorenstein scheme, so we can apply the results in the previous section. Also note that if we complete each of the above affine open sets at the origin we obtain K[[u, V1 , x, y]] , (uV1 − fI1 ) K[[U1 , V2 , x, y]] (U1 V2 − fI2 fI1 ) , ... K[[Um−1 , Vm , x, y]] (Um−1 Vm − Theorem 5.2. Given a flag F = (I1 , . . . , Im ), denote X is derived equivalent to EndR (T F ). fIm fIm−1 F ) K[[Um , v, x, y]] . (Um v − fIf ) , and T m F as above. Then X F Proof. In the explicit calculation for X F above, the preimage of the unique closed point n of Spec R is a chain of P1 ’s (some of which move in a family), in a type Am configuration. F given as follows: let C = f −1 (n). Now by [V04a, Thm. B], there is a tilting bundle on X S Giving C the reduced scheme structure, write Cred = i∈I Ci , and let Li denote the line bundle on X F such that Li · Cj = δij . If the multiplicity of Ci in C is equal to one, set Mi := Li [V04a, 3.5.4], else define Mi to be given by the extension 0 → Ori −1 → Mi → Li → 0 L associated to a minimal set of ri − 1 generators of H 1 (X F , Li−1 ). Then O ⊕ ( i∈I Mi ) is a tilting bundle on X F [V04a, 3.5.5]. In our situation, let Ci be the curve in X F , above the origin of Spec R, which in the process of blowing up first appears in X Fi (see 5.5 for a picture of this). We now claim that all the curves Ci have multiplicity one. If some Ci had multiplicity greater than one, then Mi would be an indecomposable bundle with rank greater than one [V04a, 3.5.4]. But this would imply, by [V04a, 3.2.9], that its global sections H 0 (Mi ) := Mi is an indecomposable CM R-module of rank greater than one, such that EndR (Mi ) ∈ CM R. But this L is impossible (see e.g. [IW3, 5.24]). Hence all curves have multiplicity one, and m so O ⊕ ( i=1 Li ) is a tilting on X F . L Lm bundle m ∼ Li )) = EndR (R ⊕ ( i=1 H 0 (Li ))), and so it remains to show Now End LmX F (O0 ⊕ ( i=1 that R ⊕ ( i=1 H (Li )) ∼ = T F . In fact, we claim that H 0 (Li ) ∼ = (u, fIi ). But it is easy 21 Q-FACTORIAL TERMINALIZATIONS AND MMAS to see (for example using the Čech complex) that the rank one CM module H 0 (Li ) is  generated as an R-module by u and fIi . So as to match our notation with [BIKR] and [DH], we can (and do) identify maximal flags with elements of the symmetric group Sn . Hence we regard each ω ∈ Sn as the maximal flag {ω(1)} ⊂ {ω(1), ω(2)} ⊂ . . . ⊂ {ω(1), . . . , ω(n − 1)}. The following is simply a special case of 5.2. Corollary 5.3. The scheme X ω is derived equivalent to EndR (T ω ) for all ω ∈ Sn . Moreover the completions of singular points of X ω are precisely K[[u, v, x, y]]/(uv − fi ) for all 1 ≤ i ≤ n such that fi ∈ (x, y)2 . This yields the following generalization of [BIKR, 1.5] and [DH, 4.2], and provides a conceptual reason for the condition fi ∈ / m2 . Corollary 5.4. Let f1 , . . . , fn ∈ m := (x, y) ⊆ K[[x, y]] be irreducible polynomials and R = K[[u, v, x, y]]/(uv − f1 . . . fn ). Then (1) Each T ω (ω ∈ Sn ) is an MM R-module which is a generator. The endomorphism rings EndR (T ω ) have isolated singularities. (2) T ω is a CT R-module for some ω ∈ Sn ⇐⇒ T ω is a CT R-module for all ω ∈ Sn ⇐⇒ fi ∈ / m2 for all 1 ≤ i ≤ n. Proof. (1) EndR (T ω ) is derived equivalent to a scheme whose (complete local) singularities are listed in 5.3. Since each fi is irreducible, these are all factorial by 5.1. Hence the result follows from 4.19. (2) T ω is CT if and only if Γ := EndR (T ω ) is an NCCR [IW2, 5.4]. By 4.2(1) this occurs if and only if X ω is smooth. But by 5.3, this happens if and only if each uv = fi is smooth, which is if and only if each fi ∈ / m2 .  For an algebraic non-derived category proof of the above, see [IW3, §5]. In fact the commutative algebraic method in [IW3] is stronger, since it also gives that there are no other MM (respectively CT) generators. Also, the methods in [IW3] work over more general fields. Remark 5.5. It is useful to visualize the above in an example. y inc TI1 XF f3 f1 inc f4 u R inc R⊕TI1 ⊕TI2 ⊕TI3 TI3 u x ϕ3 TI2 f2 TI1 inc inc f2 f1 R⊕TI1 ⊕TI2 X F2 f3 f4 u R x u ϕ2 x X F1 y x f1 u R y TI2 TI1 inc f2 f3 f4 u R⊕TI1 y ϕ1 x Spec R v R y R u 22 OSAMU IYAMA AND MICHAEL WEMYSS Consider uv = f1 f2 f3 f4 and choose maximal flag F = (I1 := {1} ⊂ I2 := {1, 2} ⊂ I3 := {1, 2, 3}). Thus TI1 = (u, f1 ), TI2 = (u, f1 f2 ) and TI3 = (u, f1 f2 f3 ). Moreover we assume, so that we can draw an accurate picture, that (f2 ) = (f3 ), and (f3 ) 6= (f4 ), so that uv = f2 f3 f4 is non-isolated, but uv = f3 f4 is isolated. On the geometric side we have drawn the non-local picture; the complete local picture is obtained by drawing a tubular neighbourhood around all the red curves, and restricting to the origin in Spec R. Now on X F1 , the black dot is the singularity uv = f1 , whereas the yellow dot is uv = f2 f3 f4 . On X F2 , the latter singularity splits into uv = f2 (middle black dot) and uv = f3 f4 (yellow). The left hand black dot is still uv = f1 . On X F , the black dots are (reading left to right) uv = f1 , uv = f2 , uv = f3 and uv = f4 . All yellow dots correspond to non-Q-factorial singularities, and all black dots correspond to isolated Qfactorial singularities, possibly smooth. The yellow dots with squiggles through them are non-isolated singularities. The red curves are the P1 ’s which map to the origin in Spec R. The right hand curve in X F2 moves in a family (represented as blue lines) and ϕ2 contracts the whole family; consequently ϕ2 contracts a divisor. However both ϕ1 and ϕ3 contract a single curve but no divisor and so are flopping contractions. Note that Spec R and X F1 have canonical singularities, but X F2 and X F have only terminal singularities. The precise form of the quiver relies on the (easy) calculation in [IW3, 5.33], but this can be ignored for now. Note that the geometric picture will change depending both on the choice of polynomials, and their ordering. Blowing up in a different order can change which curves move in families, and also normal bundles of the curves. Of course, this depends on the choice of the polynomials too. On the algebraic side, if we change the polynomials or their order then the number of loops change, as do the relations. Changing the ordering corresponds to mutation (see [IW3, 5.31]). On each level i the geometric space X Fi is derived equivalent to the corresponding algebra by 5.2 . The top space has only Q-factorial terminal singularities, hence the top algebra is an MMA. Remark 5.6. A version of 5.4 is actually true in the non-local case (see [W12]), but we explain here why the non-local case is a much more subtle problem. For example, in the case R = C[u, v, x, y]/(uv − xy(y − 2)), define the modules M1 := (u, x), L1 := (u, x(y − 2)) and L2 := (u, xy). Then we can show that both M := R ⊕ M1 and L := R ⊕ L1 ⊕ L2 give NCCRs by checking complete locally. Also we can show add M = add L by checking complete locally [IW2, 2.26]). Thus EndR (M ) and EndR (L) are Morita equivalent. Since dim R = 3 and R has an NCCR, by [V04b] we obtain a derived equivalence between these NCCRs and some crepant resolution of Spec R. Hence our picture in 5.5 becomes x(y−2) u inc L2 y−2 u xy u R y u y L1 R x u inc M1 y y(y−2) u inc ϕ1 x v R y u with everything in the top row being derived equivalent. This all relies on the fact that we a priori know that we have an NCCR (because we can check this complete locally) and so we can use [V04b]. In a similar case uv = (x2 + y 3 )y(y − 2) (where no NCCR exists), we cannot play this trick, since we do not know if MMAs can be detected locally, and also since completion destroys Q-factoriality we cannot reduce to the complete local setting. Q-FACTORIAL TERMINALIZATIONS AND MMAS 23 The other way to try to prove a non-local version of 5.4 is to try and find an explicit tilting complex starting with the geometry, as in 5.2. Although a tilting bundle exists abstractly for one-dimensional fibres [V04a], to describe it explicitly is delicate, since for example we have to deal with issues such as curves being forced to flop together. We refer the reader to [W12] for more details. References [A84] [AG] [B02] [BKR] [BH] [B86] [BIKR] [BK] [C02] [C10] [CR] [D1] [D2] [D3] [DH] [F77] [G06] [GR] [H66] [H77] [HVdB] [IR] [IW1] [IW2] [IW3] [J70] [J75] [K88] [K06] [KMV] [K89] [KM] [Lin] M. Auslander, Isolated singularities and existence of almost split sequences. Representation theory, II (Ottawa, Ont., 1984), 194–242, Lecture Notes in Math., 1178, Springer, Berlin, 1986. M. Auslander and O. Goldman, Maximal orders, Trans. Amer. Math. Soc. 97 (1960), 1–24. T. Bridgeland, Flops and derived categories. Invent. Math. 147 (2002), no. 3, 613–632 T. Bridgeland, A. King and M. Reid, The McKay correspondence as an equivalence of derived categories, J. Amer. Math. Soc. 14 (2001), no. 3, 535–554. W. Bruns and J. Herzog, Cohen-Macaulay rings. Rev. ed., Cambridge Studies in Advanced Mathematics. 39 xiv+453 pp. R. -O. Buchweitz, Maximal Cohen–Macaulay modules and Tate–cohomology over Gorenstein rings, preprint, 1986. I. Burban, O. Iyama, B. Keller and I. Reiten, Cluster tilting for one-dimensional hypersurface singularities, Adv. Math. 217 (2008), no. 6, 2443–2484. I. Burban and M. Kalck, Singularity category of a non-commutative resolution of singularities, Adv. Math. 231 (2012), no. 1, 414–435. J-C. Chen, Flops and equivalences of derived categories for threefolds with only terminal Gorenstein singularities, J. Differential Geom. 61 (2002), no. 2, 227–261. X-W. Chen, Unifying two results of Orlov on singularity categories, Abh. Math. Semin. Univ. Hambg. 80 (2010), no. 2, 207–212. C. W. Curtis and I. Reiner, Methods of Representation Theory. Vol. I. With Applications to Finite Groups and Orders. Wiley, New York (1990). Reprint of the 1981 original. H. Dao, Remarks on non-commutative crepant resolutions of complete intersections, Adv. Math. 224 (2010), no. 3, 1021–1030. H. Dao, Decent intersection and Tor-rigidity for modules over local hypersurfaces, Trans. Amer. Math. Soc. 365 (2013), no. 6, 2803–2821. H. Dao, Picard groups of punctured spectra of dimension three local hypersurfaces are torsion-free, Compos. Math. 148 (2012), no. 1, 145–152. H. Dao and C. Huneke, Vanishing of Ext, cluster tilting modules and finite global dimension of endomorphism rings, Amer. J. Math. 135 (2013), no. 2, 561–578. H–B. Foxby, Isomorphisms between complexes with applications to the homological theory of modules, Mathematica Scandinavica, 40, (1977) no.1, 5–19. V. Ginzburg, Calabi–Yau algebras, arXiv:math/0612139. L. Gruson and M. Raynaud, Critères de platitude et de projectivité. Techniques de ‘platification’ d’un module, Invent. Math. 13, (1971) 1–89. R. Hartshorne, Residues and duality, Lecture Notes in Mathematics, No. 20 Springer-Verlag, Berlin-New York 1966 vii+423 pp. R. Hartshorne, Algebraic geometry, Graduate Texts in Mathematics, No. 52. Springer-Verlag, 1977. xvi+496 pp. L. Hille and M. Van den Bergh, Fourier-Mukai transforms, Handbook of tilting theory, 147–177, London Math. Soc. Lecture Note Ser., 332, Cambridge Univ. Press, Cambridge, 2007. O. Iyama and I. Reiten, Fomin-Zelevinsky mutation and tilting modules over Calabi-Yau algebras, Amer. J. Math. 130 (2008), no. 4, 1087–1149. O. Iyama and M. Wemyss, The classification of special Cohen Macaulay modules, Math. Z. 265 (2010), no.1, 41–83. O. Iyama and M. Wemyss, Maximal Modifications and Auslander–Reiten Duality for Non-isolated Singularities, arXiv:1007.1296, to appear Invent. Math. O. Iyama and M. Wemyss, Reduction of triangulated categories and Maximal Modification Algebras for cAn singularities, arXiv:1304.5259. C. U. Jensen, On the vanishing of lim(i) J. Alg. 15, (1970) 151–166. ←− P. Jothilingam, A note on grade, Nagoya Math. J. 59 (1975), 149 –152. Y. Kawamata, Crepant blowing-up of 3-dimensional canonical singularities and its application to degenerations of surfaces, Ann. of Math. (2) 127 (1988), no. 1, 93–163. B. Keller, On differential graded categories. International Congress of Mathematicians. Vol. II, 151–190, Eur. Math. Soc., Zurich, 2006. B. Keller, D. Murfet, M. Van den Bergh, On two examples by Iyama and Yoshino, Compos. Math. 147 (2011), no. 2, 591–612. J. Kollár, Flops, Nagoya Math. J. 113 (1989), 15–36. J. Kollár and S. Mori, Birational geometry of algebraic varieties, Cambridge Tracts in Math., 134, Cambridge Univ. Press, Cambridge, 1998. H.W. Lin, On crepant resolution of some hypersurface singularities and a criterion for UFD, Trans. Amer. Math. Soc., 354 (2002), no.5, 1861–1868. 24 OSAMU IYAMA AND MICHAEL WEMYSS [Liu] Q. Liu, Algebraic geometry and arithmetic curves, Translated from the French by Reinie Erné. Oxford Graduate Texts in Mathematics, 6. Oxford Science Publications. Oxford University Press, Oxford, 2002. xvi+576 pp. ISBN: 0-19-850284-2. [L09] J. Lipman, Notes on derived functors and Grothendieck duality, Foundations of Grothendieck duality for diagrams of schemes, 1–259, Lecture Notes in Math., 1960, Springer, Berlin, 2009. [N96] A. Neeman, The Grothendieck duality theorem via Bousfield’s techniques and Brown representability, J. Amer. Math. Soc. 9 (1996), no. 1, 205–236. [N01] A. Neeman, Triangulated categories, Annals of Mathematics Studies, vol. 148, Princeton University Press, Princeton, NJ, 2001. [O76] A. Ooishi, Matlis duality and the width of a module, Hiroshima Math. J. 6 (1976), 573–587. [O03] D. Orlov, Triangulated categories of singularities and D-branes in Landau-Ginzburg models, Proc. Steklov Inst. Math. 2004, no. 3 (246), 227–248. [O05] D. Orlov, Triangulated categories of singularities and equivalences between Landau-Ginzburg Models, Sb. Math. 197 (2006), no. 11–12, 1827–1840. [O09] D. Orlov, Formal completions and idempotent completions of triangulated categories of singularities, Adv. Math. 226 (2011), no. 1, 206–217. [R83] M. Reid, Minimal models of canonical 3-folds, Algebraic varieties and analytic varieties (Tokyo, 1981), 131–180, Adv. Stud. Pure Math., 1, North-Holland, Amsterdam, 1983. [R87] M. Reid, Young person’s guide to canonical singularities, Algebraic geometry, Bowdoin, 1985 (Brunswick, Maine, 1985), 345–414, Proc. Sympos. Pure Math., 46, Part 1, Amer. Math. Soc., Providence, RI, 1987. [R89] J. Rickard, Morita theory for derived categories, J. London Math. Soc. (2) 39 (1989), 436–456. [R98] P. Roberts, Multiplicities and Chern classes in local algebra, Cambridge Tracts in Mathematics, 133. Cambridge University Press, Cambridge, 1998. xii+303 pp. [R08] R. Rouquier, Dimensions of triangulated categories, J. K-Theory 1 (2008), no. 2, 193–256. [RZ] R. Rouquier and A. Zimmermann, Picard groups for derived module categories, Proc. London Math. Soc. (3) 87 (2003), no. 1, 197–225. [S89] O. Solberg, Hypersurface singularities of finite Cohen-Macaulay type. Proc. London Math. Soc. (3) 58 (1989), no. 2, 258–280. [TT] R. W. Thomason and T. Trobaugh, Higher algebraic K-theory of schemes and of derived categories, The Grothendieck Festschrift, Vol. III, 247–435, Progr. Math., 88, Birkhäuser Boston, Boston, MA, 1990. [V04a] M. Van den Bergh, Three-dimensional flops and noncommutative rings, Duke Math. J. 122 (2004), no. 3, 423–455. [V04b] M. Van den Bergh, Non-commutative crepant resolutions, The legacy of Niels Henrik Abel, 749– 770, Springer, Berlin, 2004. [W10] M. Wemyss, The GL(2, C) McKay correspondence, Math. Ann. 350, no. 3, (2011), 631–659. [W12] M. Wemyss, MMAs via key varities, in preparation. [Y90] Y. Yoshino, Cohen-Macaulay modules over Cohen-Macaulay rings, London Mathematical Society Lecture Note Series, 146. Cambridge University Press, Cambridge, 1990. Osamu Iyama, Graduate School of Mathematics, Nagoya University, Chikusa-ku, Nagoya, 464-8602, Japan E-mail address: [email protected] Michael Wemyss, School of Mathematics, James Clerk Maxwell Building, The King’s Buildings, Mayfield Road, Edinburgh, EH9 3JZ, UK. E-mail address: [email protected]
0math.AC
1 Greening Geographical Power Allocation for Cellular Networks arXiv:1802.06285v1 [cs.IT] 17 Feb 2018 Yanju Gu Abstract Harvesting energy from nature (solar, wind etc.) is envisioned as a key enabler for realizing green wireless networks. However, green energy sources are geographically distributed and the power amount is random which may not enough to power a base station by a single energy site. Burning brown energy sources such as coal and crude oil, though companied with carbon dioxide emission, provides stable power. In this paper, without sacrificing communication quality, we investigate how to perform green energy allocation to abate the dependence on brown energy with hybrid brown and green energy injected in power networks. We present a comprehensive framework to characterize the performance of hybrid green and brown energy empowered cellular network. Novel performance metric “bits/tonCO2 /Hz” is proposed to evaluate the greenness of the communication network. As green energy is usually generated from distributed geographical locations and is time varying, online geographical power allocation algorithm is proposed to maximize the greenness of communication network considering electricity transmission’s physical laws i.e., Ohm’s law and Kirchhoff’s circuit laws. Simulations show that geographically distributed green energy sources complement each other by improving the communication capacity while saving brown energy consumption. Besides, the penetration of green energy can also help reduce power loss on the transmission breaches. I. I NTRODUCTION A. Context and Motivation Telecommunications industry consumes 2% of the total electricity generation worldwide and base stations energy consumption taking account more than 80% [1]. Energy reduction in base stations has been studied in many ways: such as hardware design (e.g., more energy efficient power amplifiers [2] and topological management (e.g., the deployment of relays and/or micro BSs [3], [4]). Many base station equipment manufacturers have begun to offer a number of cost friendly solutions to reduce power demands of base stations. For example, Nokia Networks February 20, 2018 DRAFT 2 launches more than 20 products and services on its energy efficient base stations at Mobile World Congress 2015. For the cellular networks with multiple base stations, traffic-driven base station switchingon/off strategy has been proposed [5] to turn off a base station one by one that will minimally affect the network. Similar idea has also been further studied in [6], [7] with distributed control algorithm design. Instead of putting BSs into sleep, [8] tactically reduces the coverage (and the power usage) of each BS, and strategically places microcells (relay stations) to offload the traffic transmitted to/from base stations in order to save total power consumption. In stead of simply saving base stations consumption, other efforts have been put in empowering celluar networks with green energy such as sunlight and wind energy. In contrast, power source emits CO2 while burned has negative impact on environment is referred as brown energy. The fossil fueled power plants have great negative impacts on the environment as they emit a large part of man-made greenhouse gas to the atmosphere. It has been estimated [9] that cellular networks empowered by brown energy will consume so much energy that their CO2 emissions equivalent will be 0.4 percent of the global value by 2020. CO2 is a heat-trapping “greenhouse” gas which represents a negative externality on the climate system. Generation of electricity relies heavily on brown energy. Countries such as Australia, China, India, Poland and South Africa produce over two-thirds of their electricity and heat through the combustion of coal. To control the use of brown energy, CO2 has already been priced and thereby giving a financial value to each tonne of emissions saved. A sufficiently high carbon price also promotes investment in clean, low-carbon technologies. In France, the new carbon tax is 25 US dollars per tonne of CO2 and In Switzerland US the price is even 34.20 per tonne CO2 The total estimated income from the carbon tax would have been between 4.5 billion euros annually. In contrast, non-combustion energy sources such as sunlight and wind energy not convert hydrocarbons to CO2 . Once the system is paid for, the owner of a renewable energy system will be producing their own renewable electricity for essentially no cost and can sell the excess to the local utility at a profit. Therefore, green cellar network benefits both environment protection and economy cost. To build a green cellular network, we need to first improve base station which dominates the contribution factor to overall energy consumption. However, green energy has special properties different from traditional brown energy, and how to efficiently stylize green energy is challenging. As green energy harvested is usually random, most of existing works focus on designing new transmission strategies that can best February 20, 2018 DRAFT 3 take advantage of and adapt to the random energy arrivals [10]. Optimal packet scheduling is proposed in [11] to adaptively change the transmission rate according to the traffic load and available energy, such that the time by which all packets are delivered is minimized. However, green energy sources are geographically distributed, and the power amount is random and may not enough to power a base station. For example, solar converters can deliver power only during sunshine hours. During the night or on cloudy days, other energy sources have to cover the power demand instead of solar power. Besides, as large solar panels are super expensive and take up considerable space, middle size solar powers are always adopted and geographically distributed. B. Contributions and Organization of the Work Microgrid is the key enabler for deep integration of renewable energy sources. It is intelligent, reliable, and environmentally friendly. In this paper, we consider the case that base stations are empowered by microgrid. Brown energy is a stable power source injected in the micogrid when renewable energy is not enough. We investigate how to perform green energy allocation to abate the dependence on brown energy without sacrificing communication quality. As geographically distributed green energy need to be delivered to base stations to meet the power demand, power flow needs to be performed considering power transmission’s physical laws constraints i.e., Ohm’s law and Kirchhoff’s circuit laws. To solve above problems, in this paper we have made the following major contributions. • In this paper, we systematically study the hybrid energy sources (brown and green energy) powered cellular network. To evaluate the greenness of a cellular network, we define the ratio of spectrum efficiency over the total CO2 consumed (unit:bits/tonCO2 /Hz) as evaluation metric, and the tradeoff between brown energy consumption and information data rate is established. • The problem of optimal green power allocation to different base stations is modeled to minimize the consumption of brown energy needed As the power allocation is achieved via power flow over microgrid, power networks physical limits is considered. More importantly, electricity transmission’s physical laws constraints i.e., Ohm’s law and Kirchhoff’s circuit laws are considered. • Green energy is time varying in nature. Besides, due to measurement error, the exact amount of available green energy is hard to know. Stochastic online green energy power allocation February 20, 2018 DRAFT 4 algorithm is proposed and it is analytically shown that the expected brown energy consumed converge to the minimum brown energy needed. The rest of the paper is organized as follows. The network topology of cellular networks empowered by microgrid with geographically distributed green energy is shown in Section II. The brown energy consumption minimization problem is modelled and formulated in Section III. The online stochastic power allocation algorithm is presented in Section IV. Simulation results of online power allocation for real power networks are illustrated in Section V. Finally, conclusions are given in Section VI. Notations throughout this paper are introduced in in Table I. II. S YSTEM M ODEL AND G REEN C OMMUNICATION M ETRIC The system model of wireless cellular networks empowered by brown and green energy is shown in Fig. 1. Brown energy is assumed delivered by the power plant and green energy generated by wind turbines and solar panels are geographically distributed. Both brown and green energy are transmitted along the microgrid. The components in this system model are detailed as follows: • Base station: A base station is a centralized device used to provide wireless communication services to mobile units [12]. The wireless base station is the power consumption device. From the power consumption perspective, the base station has two parts: the communication unit and the cooling systems. The communication unit communication with mobile users Fig. 1. A green communication networks in the proposed scheme that integrate multiple base stations powered by distributed green energy. Brown energy from main grid is supplied to the communication networks via a bus of common coupling. February 20, 2018 DRAFT 5 TABLE I N OTATIONS Symbol Description N Total number of buses. B, Set of buses connected to base stations. G, Set of buses connected to green energy sources. Cn Communication capacity of base station n. gn Harvested energy at bus n. pm Power consumption at bus m. E0 Brown energy imported from main grid. vn Voltage at bus n. E0 Brown energy injected at bus 0. Ploss Total power loss on transmission line. E (·) Expectation over random variable. t Index of time slots. T Number of time slots. at certain transmission power and communication mechanism e.g., 3G, 4G to meet the quality-of-service of mobile users [13]. The cooling subsystem, including air conditioning and fans, maintains an appropriate operation temperature at the BS. Each BS spends more than 50% power on the cooling system. The base stations are connected to the micro-grid to obtain stable power supply. • Microgrid: A microgrid is a localized grouping of electricity/power sources and loads [14], [15], which consists of buses and branches, where a bus can represent a generator or a load substation, and a branch can stand for distribution line. It connects to the main grid at a bus of common coupling that maintains voltage at the same level as the main grid, which provides the microgrid stable power source. Besides, the increased market penetration of Fig. 2. Equivalent transmission branch between bus m and bus n with admittance ym,n . k and j are the other two buses connected to bus n. February 20, 2018 DRAFT 6 distributed green generation installed, such as solar, photovoltaic and wind, has been the advent of an micro-grid. Voltage difference between different buses pushes current through the branches to supply energy towards the load bus. • Green power source: Renewable energy provided from natural resources such as sunlight and wind is environmentally friendly green energy. Though clean, no carbon emissions renewable energy is not a panacea. Renewable energy is less stable and reliable compared to fossil fuel. Though energy like solar power and wind power is abundant and unlimited, the sun sets or disappears behind clouds, sometimes the wind stops blowing, causing fluctuations. Besides, renewable energy exists over wide geographical areas and thus are connected to different buses. Thus renewable energy needs to transmit to base stations at different locations. III. B ROWN E NERGY C ONSUMPTION M INIMIZATION : MODELING, AND FORMULATION In the previous section, we have discussed the system architecture for green energy allocation. In this section, we first provide the metric for our geographically green energy allocation problem. We then present the details for modeling the total brown energy cost, power transmission constraints, and server service delay constraint as well as formulating the total brown energy minimization problem. Based on detailed discussions, we show that the constrained optimization problem equivalent to a multiple objective optimization problem. The problem is proved analytically only has Pareto optimal solution. Considering a general cellular network consists of N base stations, and each base stations provides Cn bit/Hz communication capacity. Power plants burns natural gas fuel source to meet power demand base stations. In the meantime, green energy, such as solar power and wind power is utilize to abate the dependent on brown energy consumption at the power plant. Suppose among all power consumption for base stations, E0 kWh power is generated by the brown energy and the carbon dioxide factor is η tonsCO2 /kWh. Green energy, such as solar power and wind power is utilized to abate the dependent on brown energy. Though metric like bit/Joule/Hz has been proposed to evaluate the greenness of a communication network [1], one can not evaluate how efficiently we utilize green energy. The emission of CO2 can be exploited to distinguish the consumption of brown and green energy. More February 20, 2018 DRAFT 7 specifically, let the ηE0 be the brown energy injected to the microgrid, the efficiency of utilizing green energy to power the base station networks can be evaluated by the metric PN Cn f = n=1 . ηE0 (1) The unit of function f is bits/tonCO2 /Hz. Next, we model the power flow over micro grid to understand how geographical green energy can be allocated to different base stations. A. Formulation of Power Flow over Micro-Grid The power-flow problem is the computation of voltages and current in a power grid under power line physical constraint. The power grid consists of buses and branches, where a bus can represent a generator or a load substation, and a branch stands for a distribution line. Let {0, 1, 2, . . . N} denote the set of bus indexes, where bus 0 is the bus of common coupling connected to the main grid directly. In microgrid, this bus is a slack bus with fixed voltage magnitude denoted by U. Let G denote the set of Ng green energy sites and B denote the set of Nb base stations connected to different buses according to their geographical locations. Two neighboring buses are connected by a transmission line which are represented by a two-port model with certain admittance as shown in Fig. 2. 1) Brown Energy from Main Grid: The amount of power consumption depends on the type of base station and its communication load. Let pn denote the power consumption by the base station connected to load bus n, and gm denote the energy generation by green energy source connect to generation bus m. In physics, the law of conservation of energy states that the total energy of an isolated system remains constant which is said to be conserved. Therefore, the brown energy needs to be imported from main bus can be expressed as X X E0 = pn − gm + Ploss 1 , n∈B (2) m∈G where Ploss is the total branch losses due to physical heating of the lines by current flow. For the reason that electricity delived in the micrgrid obeys Kirchhoff’s voltage law which states that the sum of voltages around any closed loop in a circuit must be zero, the power loss must related to the power generations and consumptions at each bus. We next investigate the explicit expression of Ploss . 1 In this paper, we only consider the E0 > 0 case. February 20, 2018 DRAFT 8 The admittances of all the branches in the network are denoted by an admittance matrix Y , where the lowercase ymn indicates that matrix element that connects buses m and n. Let X , Y −1 − 1 Y −1 11T Y −1 , 1T Y −1 1 where p = [pT , −g T ]T the power loss Ploss of the microgrid is given by [16] 1 Ploss ({pn }∀n∈B ) = 2 pT R{X}p, (3) U with p , [p1 , ...pNb ]T and g , [g1 , ...gNg ]T 2 . Due to the fact that elements in the first line and the first column of R{X} are all zeros, R{X} can be denoted 0 0 0  by block matrix R{X} = 0 BT M , where submatrix B, M and G are with compatible 0 M G dimensions such that (3) can be equivalently written as 1 Ploss ({pn }∀n∈B ) = 2 (g T Gg − 2g T M p + pT Bp). U From (4), one can notice that the power loss is quadratic function of pn for all n ∈ B. (4) 2) Constraints at Buses and Branches: voltage stability played a vital role for the power networks. For example, in the August 14, 2003, blackout in the Northeastern U.S. is due to voltage instability. In microgrid, voltage regulator which in fact is a transformer tap is installed for controlling or supporting voltage. Denote the voltage at bus n is vn , then it is constrained in the safe range as |vnmin | ≤ |vn | ≤ vnmax . Let v , [v1 , . . . , vN ]T from (3) with the Ohm’s law, from (3) one can obtain [16] 1 [(Gg − M p)T , (N T g − Bp)T ]T , U is an all 1 vector with length N. |v({pn }∀n∈B )| = U1N + where 1N (5) The other constraint need to be considered for microgrid is that base station power consumption at each bus should not exceed the maximum value. Mathematically, we can denote that |pmin n | ≤ for n = 1, ...Nb . pn ≤ pmax n Therefore, we formulate the brown energy minimization problem as X X pn − gm + Ploss ({pn }∀n∈B ), min {pn }∀n∈B s.t. ∀n∈B (6a) m∈G min |pmin n | ≤ pn ≤ pn , |vnmin | ≤ |vn ({pn }∀n∈B )| ≤ vnmin ∀n ∈ B ∀n ∈ B ∪ G. (6b) (6c) It can be observed from (6), the objective function is in quadratic form [17], [18] and the constrain domain is convex. 2 Only real power is considered in this model and reactive power is neutralized by the reactive compensation unit that is installed at base station and renewable energy generator. February 20, 2018 DRAFT 9 B. Communication Model An important metric for characterizing any communication is the communication capacity which is defined as the maximum amount of information that can be transmitted as a function of available bandwidth given a constraint on transmitted power channel [19]. For the nth base station, the total energy consumption pn includes the transmitted power and the rest that is due to other components such as air conditioning, data processor, and circuits, which can be generally modeled as a constant power pc,n > 0. Thus the transmitted power can be denoted by pn − pc,n . [5]. Pertaining to topology constraints [20], [21] between base station and users, communications can be categorized into uplink and downlink. An uplink is communications used for the transmission of signals from an user to the base station. As base station only performs received signal processing for the uplink communication, the corresponding power consumption is assumed incorporated in pc,n . Thus pn is mainly used for downlink transmission. Next, we investigate the power consumption for downland transmission. Without loss of generality, we consider a flat fading model with composite channel fading (including both largescale and small-scale fading) from base station n to user k denoted by hn,k . Let xn,k denote the data symbol transmitted from base station n, then the received signal yn,k is expressed as yn,k = (pn − pc,n )xn,k hn,k + wn,k , (7) where the transmitted power to user k is p̃n,k joules/symbol, hn,k denotes the channel fading between base station n and user k and and w ∼ N (0, σn2 ) is i.i.d. Gaussian noise. The capacity Cn of a channel provides the performance limit: reliable communication can be attained at any rate Rk < Cn ; reliable communication is impossible at rates Rk > Cn . In the multiuser case, the consent capacity region which is the set of all Rk such that all users can reliably communicate at theire own rate Rk , respectively. We have the multi-user data rate bounds [22] (pn − pc,n )|hn |2  , (8) σn2 where |hn | = arg minhn,k |hn,k |2 . (9) indicates that increasing the transmission power pn − pc,n Cn = log2 1 + can increase the transmission capacity. To achieve the lowest rate, the transmission power is requested to be pn ≥ (2Cn − 1)σn2 +pc,n . |hn,k |2 {z } | (9) pn February 20, 2018 DRAFT 10 Note that information of σn2 and |hn | is estimated at user k and feeded back to base station n via control channel. This feedback communication is a standard process in nowadays wireless communication systems for adaptive power control. We then have X Cn , max {pn }∀n∈B s.t. (10a) n∈B ∀n ∈ B pn ≥ pn + pc,n , (10b) min |pmin n | ≤ pn ≤ pn , ∀n ∈ B (10c) |vnmin | ≤ |vn ({pn }∀n∈B )| ≤ vnmin , ∀n ∈ B ∪ G (10d) It can be simply approved that the above communication capacity optimization is a convex optimization problem. C. Green Metric for Communication Networks and Pareto Optimal Solvation Substituting the geographical power allocation model in (6) and the communication capacity model in (10) in the greenness metric (1) we have PN C P n=1 n η= P max , {pn }∀n∈B η( n∈B pn − m∈G gm + Ploss ({pn }∀n∈B )) s.t. ∀n ∈ B pn ≥ pn + pc,n , (11a) (11b) min |pmin n | ≤ pn ≤ pn , ∀n ∈ B (11c) |vnmin | ≤ |vn ({pn }∀n∈B )| ≤ vnmin , ∀n ∈ B ∪ G (11d) The above problem is equivalent to multicriteria optimization problem and can be formulated as follows Obj 1 : max {pn }∀n∈B Obj 2 : min {pn }∀n∈B s.t. C= N X log2 1 + n=1 E0 = X n∈B pn − X m∈G pn |hn |2  , σn2 (12a) gm + Ploss ({pn }∀n∈B ), (12b) pn ≥ pn + pc,n , min |pmin n | ≤ pn ≤ pn , |vnmin| ≤ |vn | ≤ vnmin . ∀n ∈ B ∀n ∈ B ∀n ∈ B ∪ G (12c) (12d) (12e) It can be easily noticed that these two objective functions are conflicting objectives. For example, when the total brown power is minimized (i.e., pn = 0), the communication capacity is also 0 February 20, 2018 DRAFT 11 and is not maximized. So there does not appear to exist an optimal solution in our problem that optimizes both objectives simultaneously. Then we can only obtain the Pareto optimal solution when investigating the multiple objectives optimization problem. Instead of solving (12) directly, let consider a simpler single objective optimization problem for a given C0 , E0 ({pn }∀n∈B ) min {pn }∀n∈B = X n∈B s.t. N X pn − X m∈G log2 1 + n=1 (13a) gm + Ploss ({pn }∀n∈B ), pn |hn |2  ≥ C0 , σn2 pn ≥ pn + pc,n , (13b) ∀n ∈ B (13c) min |pmin n | ≤ pn ≤ pn , ∀n ∈ B (13d) |vnmin | ≤ |vn ({pn }∀n∈B )| ≤ vnmin , ∀n ∈ B ∪ G (13e) which is named as one shot optimization. We show in the Appendix that if E0 = E0∗ is an optimal solution for a given value C0 = C ∗ in (13), then (C ∗ , E0∗ ) is a Pareto optimal solution to (12). Lemma 1 Let E0∗ be an optimal solution to (13) for a given value of C0 = C ∗ , then (E0∗ , C ∗ ) is a Pareto optimal solution to (12). Proof 1 See Appendix. It can be easily shown that (13) is a convex optimization problem and therefore can be solved efficiently and globally using the interior-point methods. However, in practice the power of green energy gn is random and the measurements of gn exists errors and lead to error in power allocation. In the next section, a convergence guaranteed stochastic renewable energy allocation will be discussed. IV. O NLINE S TOCHASTIC P OWER A LLOCATION A. Average Brown Energy Consumption Optimization In microgrid, Algorithm 1 is implemented in a central control unit for power allocation via gathering the green energy gm and other parameters in the micrograms and cellular networks. February 20, 2018 DRAFT 12 However, real-time exact value of gm is difficult to be obtained due to measurements errors and communication delays from distributed green energy sites to the central control unit. Rather than implementing the unreliable and possibly obsolete instantaneous decision of pn of (13), we consider a robust stochastic control scheme which is to minimize the average brown energy consumption as min {pn (t)}∀n∈B =E s.t. N X n=1 f ({gn (t)}∀n∈B ) X n∈B pn (t) − log2 1 + X (14a) gm (t) + Ploss ({pn (t)}∀n∈B ) , m∈G pn (t)|hn |2  ≥ C0 , σn2 pn ≥ pn (t) + pc,n (t), min |pmin n | ≤ pn (t) ≤ pn (t), ∀n ∈ B ∀n ∈ B |vnmin | ≤ |vn ({pn (t)}∀n∈B )| ≤ vnmin , ∀n ∈ B ∪ G (14b) (14c) (14d) (14e) In the subsequent, we use pn (t) and gm (t) to represent the time varying power consumption and green power generation of base station n and green energy site m. B. Stochastic Online Power Allocation Algorithm Design and Analysis Leveraging recent advances in online stochastic convex optimization, the above problem (14) can be solved under stochastic approximation framework. In this paper, we use Bregmen projection based mirror decent algorithm to iterate the objective variable p(t) that gradually converges to the optimization point of the expectation functions in (14). Let f ∗ (y) , supx∈domf (xT y−f (x)) denote the conjugate function of f (x), and F (·) denotes a continuous differentiable function that is α-strongly convex w.r.t. Euclid norm k·k. The Bregmen divergence associated with F (·) is defined as [23] BF (x, y) , F (x) − F (y) − (x − y)T ▽F (y), (15) where BF satisfies BF (x, y) ≥ α2 kx − yk2 for some α > 0. The online mirror decent method is described as the following two steps iterations: First, the gradient is performed in the dual space rather than in the primal space as ωp(t+1) = ▽F ∗ (▽F (p(t)) − δ▽f (p(t), pg )), February 20, 2018 (16) DRAFT 13 where F ∗ (·) denotes the dual function of F (·). and δ is the step size. The second step is the projection step defined by the Bregman divergence associated to F (·) as p(t + 1) = arg min BF (x, ωp (t + 1)), x∈A (17) where A is the feasible domain of x. Intuitively, the above mirror decent algorithm minimizes a first-order approximation of the function f (·) at the current iterate ωp(t) while forcing the next iterate ωp(t+1) to lie close to ωp(t) . The step size δ controls the trade-off between these two. To obtain closed form solution in the iteration, we use standard norm as the Bregmen divergence function i.e., F (x) = 12 kxk22. Substituting the expression into (15) and after simple calculation, we obtain BF (x, y) = 12 kx−yk2 . By Holder’s inequality, and a simple optimization of a quadratic polynomial, one has F ∗ (y) = supx∈D (xT y − 12 kxk2 ) ≤ supx∈D (kxkkyk − 1 kxk2 ) 2 = 21 kx − yk2 . Notice that the inequality above is in fact an equality by definition of the dual norm. Thus F ∗ (y) = y. Moreover, as ▽F (x) = x, we have ▽F (x)∗ = x. Then the update with the gradient in (16) can be computed as ωp(t+1) = p(t) − η▽f (p(t), g). (18) ▽f (p(t), g) = −2g T M + 2p(t)T B. (19) where Then the update with the projection step in (17) is derived as 1 p(t + 1) = arg min kx − ωp (t + 1)k2 , 2 N X pn |hn |2  s.t. log2 1 + ≥ C0 , σn2 n=1 pn ≥ pn + pc,n , (20a) (20b) ∀n ∈ B min |pmin n | ≤ pn ≤ pn , (20c) ∀n ∈ B |vnmin | ≤ |vn ({pn }∀n∈B )| ≤ vnmin . (20d) ∀n ∈ B ∪ G (20e) To summarize, the stochastic online power allocation can be solved by an iterative algorithm with two steps in each iteration. The first step can be easily computed using the closed form of the gradient as in (18) The second step is to compute (20). Obviously, (20) is a simple convex optimization problem, which can be solved by interior point method. The stochastic online power allocation algorithm is summarized in Algorithm 1. February 20, 2018 DRAFT 14 Algorithm 1 Stochastic Online Power Allocation 1: Initialize: p(1) is computed by one shot optimization in (13). 2: for t ∈ {1, 2, . . . , T } do 3: Compute the gradient ωp(t+1) according to (18). 4: Update the gradient according to (19). 5: Compute p(t + 1) via minimizing BF (x, ωp (t + 1)) according to (20). 6: end for Notice that the proposed online power allocation algorithm does not depend on any measurement error or communication delay distribution assumption. It rather utilizes real-time communication and power data to infer the unknown statistics. Next we evaluate the performance of the online power allocation algorithm. Property 1 Let {p̃n (t)}∀n∈B and {p̂n (t)}∀n∈B are the minimizers of (13) and (14) respectively, it holds that k E0 ({p̃n (t)}∀n∈B ) − f ({p̂n (t)}∀n∈B ) ≤ √ , T (21) where k is a constant irrespective of T . Proposition 1 guarantees that the expected brown power consumption converges to the opti√ mum stochastic solution at the rate of O(1/ T ). Therefore the online power allocation algorithm in Table 1 has sublinear accurate error. V. PERFORMANCE EVALUATION In this section, we present and discuss simulation results, in comparison with numerical results pertaining to the previously developed analysis. A. Parameter Setting The 37 bus test feeder model [24] is used for the simulation of micogrid. It represents an actual underground radial distribution feeder in California. The schematic view of this network can be seen in Fig. 7. In this 37-bus network, bus 799 is the bus of common coupling. Stable brown energy is injected to the microgrid when green energy is not enough. Green energy sites are geographically distributed at buses 742, 725, 735 731 and 741. Each other buses is load February 20, 2018 DRAFT 15 bus and is linked to a base station. The maximum power rate at each bus is set as 1.3MW. Solar power generation sites of 12MW are placed respectively on bus 742, 725 and 735 and the wind power generation sites of 8MW are placed respectively on bus 731 and 741. The green energy data set are from Smart∗ Microgrid Data Set [25]. Besides, we generate the data set for base station power consumption by adopting Huawei DBS3900 base station power consumption parameters in the simultion [26]. User traffic data are loaded according to [27] for the simulation and the total user number variation is given in Fig. 4. In general while users increases, the power consumption increases. For each operation interval, the microgrid control center collects green energy generation gm from generation buses. It is assumed that the renewable generation data is observed with a white Gaussian noise of 20% of its actual value due to measurement error. Besides, the communication channel state information hn for all n ∈ B and noise variance σn2 are obtained in the communication networks and send to the microgrid control center for implement the proposed online stochastic power allocation algorithm. B. Experimental Results While the user traffic increases more power is needed to support base station for information P transmission. As the transmission power increases, the communication capacity n∈B Cn will increase. Assume frequency reuse is adopted and therefore there is no inter-cell interference beween neighboring cells. To investigate the advantage of green energy for the communication system, base stations communication power at each base station is normalized by 1 (Ploss + E0 ). Nb Fig. 5 and Fig. 6 show the capacities variation of base stations at bus 720 and 730, respectivly. It is clear the proposed online stochastic power allocation algorithm provides larger communication capacity then the one shot solution. Thus it utilizes the green energy more efficiently and therefore abates the dependence on brown energy from the main grid. Besides, it can be observed that online stochastic algorithm provides more stable capacity then one shot algorithm. Power loss on the microgrid is due to physical heating on the transmission branches caused by electricity delivering. Though it is unavoidable, it is preferred to lower the power loss as much as possible. Distributed green energy also decrease the power loss on the microgrid. We evaluate the total power loss for the proposed stochastic online power allocation algorithm and one shot optimization algorithm. Besides, the power loss is also simulated according to (4) in the case that there is no green energy distributed in the microgrid and all energy is brown energy February 20, 2018 DRAFT 16 Fig. 3. Schematic diagram of the IEEE 37-bus test feeder cases [24]. Bus 799 is the bus of common coupling that links the microgrid to main power grid. Solar power harvesting sites are located at buses 742, 725, 735 and wind power harvesting sites are located at buses 731 and 741. These green energy sites are denoted by green triangles. Other buses are load buses connected to base stations. 750 User number 700 650 600 550 0 500 1000 Time slot 1500 2000 Fig. 4. Dynamic user number versus time slot. imported from the main grid. Fig. 7 shows the total power loss cost reductions by comparing results of the proposed online stochastic power allocation algorithm (Algorithm 1) and the one shot solution (13). It shows that while geographically green energy incorporated, powr flow is more efficiently as the power source is not far from the consumption bus. In contrast, with only brown energy from main grid, the power loss increases greatly. February 20, 2018 DRAFT 17 Base station capacity at bus 720 1 One shot solution Onlilne stochastic algorithm 0.8 0.6 0.4 0.2 0 0 200 400 600 Time slot 800 1000 Fig. 5. Normalized communication capacities of base station empowered by bus 720 versus time slot. Base station capacity at bus 730 1 0.8 0.6 0.4 0.2 0 0 One shot solution Onlilne stochastic algorithm 200 400 600 Time slot 800 1000 Fig. 6. Normalized communication capacities of base station empowered by bus 730 versus time slot. VI. C ONCLUSIONS In this paper, we have investigated optimal green energy allocation to abate the dependence on brown energy without sacrificing communication quality. Leveraging the fact that the green energy power amount generated from distributed geographical locations varies, the framework of green energy cooperation to empower cellular networks has been achieved by formulate the problem as maximizing data rate per ton CO2 consumed. Electricity transmission’s physical laws constraints i.e., Ohm’s law and Kirchhoff’s circuit laws, are considered for the power allocation. The exact real-time amount of green energy is difficult to obtain due to the noise contaminated measurement and possible communication delay from energy harvesting site to control unite, and therefore degrades the power allocation performance. We therefore have proposed stochastic online power allocation algorithm which is robust to the green energy uncertainty. It is shown that the online algorithm converges to the optimum stochastic data rate per ton CO2 . Finally, we February 20, 2018 DRAFT 18 6 10 x 10 One shot solution Powered by brown energy only Onlilne stochastic algorithm 8 Power loss 6 4 2 0 0 500 1000 Time slot 1500 2000 Fig. 7. Power loss versus time slot. have conducted data trace-driven experiments. The results show that geographically distributed green energy complement each other by improving the communication capacity while saving brown energy consumption from main grid. We also come to some key findings such as with penetration of green energy, power loss on the transmission breaches can be reduced. A PPENDIX The proof is based on contradiction. Suppose (E0∗ , C ∗ ) is not a Pareto optimal solution to (12). Then there must exist a feasible solution (E0 , C) to (12) such that C > C ∗ and E0 < E0∗ . Based on this feasible solution (E0 , C), we can construct another feasible solution to (13) as follows. We keep power consumption unchanged, but decrease C to C ∗ through scheduling or interference management. Clearly, (E0 , C ∗ ) is also a feasible solution. So corresponding to the same C ∗ value, we have two feasible solution (E0 , C ∗ ) and (E0∗ , C ∗ ) and that E0 < E0∗ . This contradicts to the fact that E0∗ is an optimal solution to (13) under a given C ∗ value. This completes our proof. R EFERENCES [1] Z. Hasan, H. Boostanimehr, and V. Bhargava, “Green cellular networks: A survey, some research issues and challenges,” Communications Surveys Tutorials, IEEE, vol. 13, no. 4, pp. 524–540, Fourth 2011. [2] IEEE PES Distribution System Analysis Subcommittee , “IEEE PES Test Feeders,” http://www.huawei.com/en/about-huawei/publications/communicate/hw-082748.htm. [3] K. Son, E. Oh, and B. Krishnamachari, “Energy-aware hierarchical cell configuration: From deployment to operation,” in Computer Communications Workshops (INFOCOM WKSHPS), 2011 IEEE Conference on, April 2011, pp. 289–294. February 20, 2018 DRAFT 19 [4] J. Du and Y.-C. Wu, “Network-wide distributed carrier frequency offsets estimation and compensation via belief propagation,” IEEE Transactions on Signal Processing, vol. 61, no. 23, pp. 5868–5877, 2013. [5] C. Peng, S.-B. Lee, S. Lu, H. Luo, and H. Li, “Traffic-driven power saving in operational 3g cellular networks,” in Proceedings of the 17th Annual International Conference on Mobile Computing and Networking, ser. MobiCom ’11, 2011, pp. 121–132. [6] E. Oh, K. Son, and B. Krishnamachari, “Dynamic base station switching-on/off strategies for green cellular networks,” Wireless Communications, IEEE Transactions on, vol. 12, no. 5, pp. 2126–2136, May 2013. [7] J. Du and Y.-C. Wu, “Fully distributed clock skew and offset estimation in wireless sensor networks,” in IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2013, pp. 4499–4503. [8] C. Gao, W. Zhang, J. Tang, C. Wang, S. Zou, and S. Su, “Relax, but do not sleep: A new perspective on green wireless networking,” in INFOCOM, 2014 Proceedings IEEE, April 2014, pp. 907–915. [9] A. Bianzino, C. Chaudet, D. Rossi, and J. Rougier, “A survey of green networking research,” Communications Surveys Tutorials, IEEE, vol. 14, no. 1, pp. 3–20, First 2012. [10] O. Ozel, K. Tutuncuoglu, J. Yang, S. Ulukus, and A. Yener, “Transmission with energy harvesting nodes in fading wireless channels: Optimal policies,” Selected Areas in Communications, IEEE Journal on, vol. 29, no. 8, pp. 1732–1743, September 2011. [11] J. Yang and S. Ulukus, “Optimal packet scheduling in an energy harvesting communication system,” Communications, IEEE Transactions on, vol. 60, no. 1, pp. 220–230, January 2012. [12] J. Du and Y.-C. Wu, “Distributed clock skew and offset estimation in wireless sensor networks: Asynchronous algorithm and convergence analysis,” IEEE Transactions on Wireless Communications, vol. 12, no. 11, pp. 5908–5917, 2013. [13] J. Du, X. Liu, and L. Rao, “Proactive doppler shift compensation in vehicular cyber-physical systems,” IEEE/ACM Transactions on Networking, 2018. [14] J. Du, S. Ma, Y.-C. Wu, and H. V. Poor, “Distributed hybrid power state estimation under PMU sampling phase errors,” IEEE Transactions on Signal Processing, vol. 62, no. 16, pp. 4052–4063, 2014. [15] Q. Wang, X. Liu, J. Du, and F. Kong, “Smart charging for electric vehicles: A survey from the algorithmic perspective,” IEEE Communications Surveys & Tutorials, vol. 18, no. 2, pp. 1500–1517, 2016. [16] S. Bolognani and S. Zampieri, “On the existence and linear approximation of the power flow solution in power distribution networks,” Power Systems, IEEE Transactions on, vol. PP, no. 99, pp. 1–10, 2015. [17] J. Du, S. Ma, Y.-C. Wu, S. Kar, and J. M. Moura, “Convergence analysis of distributed inference with vector-valued Gaussian belief propagation,” arXiv preprint arXiv:1611.02010, 2016. [18] J. Du, S. Kar, and J. M. Moura, “Distributed convergence verification for Gaussian belief propagation,” Asilomar Conference on Signals, Systems and Computers (ASILOMAR), arXiv preprint arXiv:1711.09888, 2017. [19] K. Cai, X. Li, J. Du, Y.-C. Wu, and F. Gao, “Cfo estimation in ofdm systems under timing and channel length uncertainties with model averaging,” IEEE Transactions on Wireless Communications, vol. 9, no. 3, pp. 970–974, 2010. [20] J. Du, S. Ma, Y.-C. Wu, S. Kar, and J. M. Moura, “Convergence analysis of the information matrix in Gaussian belief propagation,” IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), arXiv preprint arXiv:1704.03969, 2017. [21] ——, “Convergence analysis of belief propagation for pairwise linear Gaussian models,” IEEE Global Conference on Signal and Information Processing (GlobalSIP), arXiv preprint arXiv:1706.04074, 2017. [22] D. Tse and P. Viswanath, Fundamentals of Wireless. Cambridge, 2009. [23] M. Grotschel, S. O. Krumke, and J. Rambau, Online Optimizatio of Large Scale Systems. February 20, 2018 Springer, 2001. DRAFT 20 [24] IEEE PES Distribution System Analysis Subcommittee , “IEEE PES Test Feeders,” http://www.ewh.ieee.org/soc/pes/dsacom/testfeeders/index.html, [Online; accessed 20-July-2015]. [25] A. M. S. Barker, D. Irwin, E. Cecchet, P. Shenoy, and J. Albrecht, “Smart: An open data set and tools for enabling research in sustainable homes,” in Computer Communications Workshops (INFOCOM WKSHPS), 2011 IEEE Conference on, August 2012, pp. 289–299. [26] HUAWEI TECHNOLOGIES CO., LTD. , “Huawei 3900 Series Base Station Product Description,” http://enterprise.huawei.com/ilink/enenterprise/download/HW 323282. [27] K. Zheng, Y. Zheng, N. Yuan, and S. Shang, “On discovery of gathering patterns from trajectories,” in Data Engineering (ICDE), 2013 IEEE 29th International Conference on, April 2013, pp. 242–253. February 20, 2018 DRAFT
7cs.IT
arXiv:cs/0601038v1 [cs.LO] 10 Jan 2006 Under consideration for publication in Theory and Practice of Logic Programming 1 Constraint-based Automatic Verification of Abstract Models of Multithreaded Programs GIORGIO DELZANNO Dipartimento di Informatica e Scienze dell’Informazione, Università di Genova via Dodecaneso 35, 16146 Genova - Italy (e-mail: [email protected]) submitted 17 December 2003; revised 13 April 2005; accepted 15 January 2006 Abstract We present a technique for the automated verification of abstract models of multithreaded programs providing fresh name generation, name mobility, and unbounded control. As high level specification language we adopt here an extension of communication finitestate machines with local variables ranging over an infinite name domain, called TDL programs. Communication machines have been proved very effective for representing communication protocols as well as for representing abstractions of multithreaded software. The verification method that we propose is based on the encoding of TDL programs into a low level language based on multiset rewriting and constraints that can be viewed as an extension of Petri Nets. By means of this encoding, the symbolic verification procedure developed for the low level language in our previous work can now be applied to TDL programs. Furthermore, the encoding allows us to isolate a decidable class of verification problems for TDL programs that still provide fresh name generation, name mobility, and unbounded control. Our syntactic restrictions are in fact defined on the internal structure of threads: In order to obtain a complete and terminating method, threads are only allowed to have at most one local variable (ranging over an infinite domain of names). KEYWORDS: Constraints, Multithreaded Programs, Verification. 1 Introduction Andrew Gordon (Gordon 2001) defines a nominal calculus to be a computational formalism that includes a set of pure names and allows the dynamic generation of fresh, unguessable names. A name is pure whenever it is only useful for comparing for identity with other names. The use of pure names is ubiquitous in programming languages. Some important examples are memory pointers in imperative languages, identifiers in concurrent programming languages, and nonces in security protocols. In addition to pure names, a nominal process calculus should provide mechanisms for concurrency and inter-process communication. A computational model that provides all these features is an adequate abstract formalism for the analysis of multithreaded and distributed software. 2 Giorgio Delzanno The Problem Automated verification of specifications in a nominal process calculus becomes particularly challenging in presence of the following three features: the possibility of generating fresh names (name generation); the possibility of transmitting names (name mobility); the possibility of dynamically adding new threads of control (unbounded control). In fact, a calculus that provides all the previous features can be used to specify systems with a state-space infinite in several dimensions. This feature makes difficult (if not impossible) the application of finite-state verification techniques or techniques based on abstractions of process specifications into Petri Nets or CCS-like models. In recent years there have been several attempts of extending automated verification methods from finite-state to infinite-state systems (Abdulla and Nylén 2000; Kesten et al. 2001). In this paper we are interested in investigating the possible application of the methods we proposed in (Delzanno 2001) to verification problems of interest for nominal process calculi. Constraint-based Symbolic Model Checking In (Delzanno 2001) we introduced a specification language, called MSR(C), for the analysis of communication protocols whose specifications are parametric in several dimensions (e.g. number of servers, clients, and tickets as in the model of the ticket mutual exclusion algorithm shown in (Bozzano and Delzanno 2002)). MSR(C) combines multiset rewriting over first order atomic formulas (Cervesato et al. 1999) with constraints programming. More specifically, multiset rewriting is used to specify the control part of a concurrent system, whereas constraints are used to symbolically specify the relations over local data. The verification method proposed in (Delzanno 2005) allows us to symbolically reason on the behavior of MSR(C) specifications. To this aim, following (Abdulla et al. 1996; Abdulla and Nylén 2000) we introduced a symbolic representation of infinite collections of global configurations based on the combination of multisets of atomic formulas and constraints, called constrained configurations.1 The verification procedure performs a symbolic backward reachability analysis by means of a symbolic pre-image operator that works over constrained configurations (Delzanno 2005). The main feature of this method is the possibility of automatically handling systems with an arbitrary number of components. Furthermore, since we use a symbolic and finite representation of possibly infinite sets of configurations, the analysis is carried out without loss of precision. A natural question for our research is whether and how these techniques can be used for verification of abstract models of multithreaded programs. Our Contribution In this paper we propose a sound, and fully automatic verification method for abstract models of multithreaded programs that provide name generation, name mobility, and unbounded control. As a high level specification language we adopt here an extension with value-passing of the formalism of (Ball et al. 2001) 1 Notice that in (Abdulla et al. 1996; Abdulla and Nylén 2000) a constraint denotes a symbolic state whereas we use the word constraint to denote a symbolic representation of the relation of data variables (e.g. a linear arithmetic formula) used as part of the symbolic representation of sets of states (a constrained configuration). Constraint-based Verification of Abstract Multithreaded Programs 3 based on families of state machines used to specify abstractions of multithreaded software libraries. The resulting language is called Thread Definition Language (TDL). This formalism allows us to keep separate the finite control component of a thread definition from the management of local variables (that in our setting range over a infinite set of names), and to treat in isolation the operations to generate fresh names, to transmit names, and to create new threads. In the present paper we will show that the extension of the model of (Ball et al. 2001) with value-passing makes the model Turing equivalent. The verification methodology is based on the encoding of TDL programs into a specification in the instance MSRN C of the language scheme MSR(C) of(Delzanno 2001). MSRN C is obtained by taking as constraint system a subclass of linear arithmetics with only = and > relations between variables, called name constraints (N C). The low level specification language MSRN C is not just instrumental for the encoding of TDL programs. Indeed, it has been applied to model consistency and mutual exclusion protocols in (Bozzano and Delzanno 2002; Delzanno 2005). Via this encoding, the verification method based on symbolic backward reachability obtained by instantiating the general method for MSR(C) to NC-constraints can now be applied to abstract models of multithreaded programs. Although termination is not guaranteed in general, the resulting verification method can succeed on practical examples as the Challenge-Response TDL program defined over binary predicates we will illustrated in the present paper. Furthermore, by propagating the sufficient conditions for termination defined in (Bozzano and Delzanno 2002; Delzanno 2005) back to TDL programs, we obtain an interesting class of decidable problems for abstract models of multithreaded programs still providing name generation, name mobility, and unbounded control. Plan of the Paper In Section 2 we present the Thread Definition Language (TDL) with examples of multithreaded programs. Furthermore, we discuss the expressiveness of TDL programs showing that they can simulate Two Counter Machines. In Section 3, after introducing the MSRN C formalism, we show that TDL programs can be simulated by MSRN C specifications. In Section 4 we show how to transfer the verification methods developed for MSR(C) to TDL programs. Furthermore, we show that safety properties can be decided for the special class of monadic TDL programs. In Section 5 we address some conclusions and discuss related work. 2 Thread Definition Language (TDL) In this section we will define TDL programs. This formalism is a natural extension with value-passing of the communicating machines used by (Ball et al. 2001) to specify abstractions of multithreaded software libraries. Terminology Let N be a denumerable set of names equipped with the relations = and 6= and a special element ⊥ such that n 6= ⊥ for any n ∈ N . Furthermore, let V be a denumerable set of variables, C = {c1 , . . . , cm } a finite set of constants, and L a finite set of internal action labels. For a fixed V ⊆ V, the set of expressions is 4 Giorgio Delzanno defined as E = V ∪ C ∪ {⊥} (when necessary we will use E(V ) to explicit the set of variables V upon which expressions are defined). The set of channel expressions is defined as Ech = V ∪ C. Channel expressions will be used as synchronization labels so as to establish communication links only at execution time. A guard over V is a conjunction γ1 , . . . , γs , where γi is either true, x = e or x 6= e with x ∈ V and e ∈ E for i : 1, . . . , s. An assignment α from V to W is a conjunction like xi := ei where xi ∈ W , ei ∈ E(V ) for i : 1, . . . k and xr 6= xs for r 6= s. A message template m over V is a tuple m = hx1 , . . . , xu i of variables in V . Definition 1 A TDL program is a set T = {P1 , . . . , Pt } of thread definitions (with distinct names for local variables control locations). A thread definition P is a tuple hQ, s0 , V, Ri, where Q is a finite set of control locations, s0 ∈ Q is the initial location, V ⊆ V is a finite set of local variables, and R is a set of rules. Given s, s′ ∈ Q, and a ∈ L, a rule has one of the following forms2 : a • Internal move: s −−→ s′ [γ, α], where γ is a guard over V , and α is an assignment from V to V ; a • Name generation: s −−→ s′ [x := new], where x ∈ V , and the expression new denotes a fresh name; a • Thread creation: s −−→ s′ [run P ′ with α], where P ′ = hQ′ , t, W, R′ i ∈ T , and α is an assignment from V to W that specifies the initialization of the local variables of the new thread; e!m • Message sending: s −−→ s′ [γ, α], where e is a channel expression, m is a message template over V that specify which names to pass, γ is a guard over V , and α is an assignment from V to V . e?m • Message reception: s −−−→ s′ [γ, α], where e is a channel expression, m is a message template over a new set of variables V ′ (V ′ ∩ V = ∅) that specifies the names to receive, γ is a guard over V ∪ V ′ and α is an assignment from V ∪ V ′ to V . Before giving an example, we will formally introduce the operational semantics of TDL programs. 2.1 Operational Semantics In the following we will use N to indicate the subset of used names of N . Every constant c ∈ C is mapped to a distinct name nc 6= ⊥ ∈ N , and ⊥ is mapped to ⊥. Let P = hQ, s, V, Ri and V = {x1 , . . . , xk }. A local configuration is a tuple p = hs′ , n1 , . . . , nk i where s′ ∈ Q and ni ∈ N is the current value of the variable xi ∈ V for i : 1, . . . , k. A global configuration G = hN, p1 , . . . , pm i is such that N ⊆ N and p1 , . . . , pm are local configurations defined over N and over the thread definitions in T . Note that 2 In this paper we keep assignments, name generation, and thread creation separate in order to simplify the presentation of the encoding into MSR. Constraint-based Verification of Abstract Multithreaded Programs 5 there is no relation between indexes in a global configuration in G and in T ; G is a pool of active threads, and several active threads can be instances of the same thread definition. Given a local configuration p = hs′ , n1 , . . . , nk i, we define the valuation ρp as ρp (xi ) = ni if xi ∈ V , ρp (c) = nc if c ∈ C, and ρp (⊥) = ⊥. Furthermore, we say that ρp satisfies the guard γ if ρp (γ) ≡ true, where ρp is extended to constraints in the natural way (ρp (ϕ1 ∧ ϕ2 ) = ρp (ϕ1 ) ∧ ρp (ϕ2 ), etc.). The execution of x := e has the effect of updating the local variable x of a thread with the current value of e (a name taken from the set of used values N ). On the contrary, the execution of x := new associates a fresh unused name to x. The formula run P with α has the effect of adding a new thread (in its initial control location) to the current global configuration. The initial values of the local variables of the generated thread are determined by the execution of α whose source variables are the local variables of the parent thread. The channel names used in a rendez-vous are determined by evaluating the channel expressions tagging sender and receiver rules. Value passing is achieved by extending the evaluation associated to the current configuration of the receiver so as to associate the output message of the sender to the variables in the input message template. The operational semantics is given via a binary relation ⇒ defined as follows. Definition 2 Let G = hN, . . . , p, . . .i, and p = hs, n1 , . . . , nk i be a local configuration for P = hQ, s, V, Ri, V = {x1 , . . . , xk }, then: a • If there exists a rule s −−→ s′ [γ, α] in R such that ρp satisfies γ, then G ⇒ hN, . . . , p′ , . . .i (meaning that only p changes) where p′ = hs′ , n′1 , . . . , n′k i, n′i = ρp (ei ) if xi := ei is in α, n′i = ni otherwise, for i : 1, . . . , k. a • If there exists a rule s −−→ s′ [xi := new] in R, then G ⇒ hN ′ , . . . , p′ , . . .i ′ ′ ′ ′ where p = hs , n1 , . . . , nk i, ni is an unused name, i.e., n′i ∈ N \ N , n′j = nj for every j 6= i, and N ′ = N ∪ {n′i }; a • If there exists a rule s −−→ s′ [run P ′ with α] in R with P ′ = hQ′ , t0 , W, R′ i, W = {y1 , . . . , yu }, and α is defined as y1 := e1 , . . . , yu := eu then G ⇒ hN, . . . , p′ , . . . , qi (we add a new thread whose initial local configuration is q) where p′ = hs′ , n1 , . . . , nk i, and q = ht0 , ρp (e1 ), . . . , ρp (eu )i. • Let q = ht, m1 , . . . , mr i (distinct from p) be a local configuration in G associated with P ′ = hQ′ , t0 , W, R′ i. e!m e′ ?m′ Let s −−→ s′ [γ, α] in R and t −−−−→ t′ [γ ′ , α′ ] in R′ be two rules such that m = hx1 , . . . , xu i, m′ = hy1 , . . . , yv i and u = v (message templates match). We define σ as the value passing evaluation σ(yi ) = ρp (xi ) for i : 1, . . . , u, and σ(z) = ρq (z) for z ∈ W ′ . Now if ρp (e) = ρp (e′ ) (channel names match), ρp satisfies γ, and that σ satisfies γ ′ , then hN, . . . , p, . . . , q, . . .i ⇒ hN, . . . , p′ , . . . , q′ , . . .i where p′ = hs′ , n′1 , . . . , n′k i, n′i = ρp (v) if xi := v is in α, n′i = ni otherwise for i : 1, . . . , k; q′ = ht′ , m′1 , . . . , m′r i, m′i = σ(v) if ui := v is in α′ , m′i = mi otherwise for i : 1, . . . , r. 6 Giorgio Delzanno Definition 3 An initial global configuration G0 has an arbitrary (but finite) number of threads with local variables all set to ⊥. A run is a sequence G0 G1 . . . such that Gi ⇒ Gi+1 for i ≥ 0. A global configuration G is reachable from G0 if there exists a run from G0 to G. Example 1 Let us consider a challenge and response protocol in which the goal of two agents Alice and Bob is to exchange a pair of new names hnA , nB i, the first one created by Alice and the second one created by Bob, so as to build a composed secret key. We can specify the protocol by using new names to dynamically establish private channel names between instances of the initiator and of the responder. The TDL program in Figure 1 follows this idea. The thread Init specifies the behavior of the initiator. He first creates a new name using the internal action f resh, and stores it in the local variable nA . Then, he sends nA on channel c (a constant), waits for a name y on a channel with the same name as the value of the local variable nA (the channel is specified by variable nA ) and then stores y in the local variable mA . The thread Resp specifies the behavior of the responder. Upon reception of a name x on channel c, he stores it in the local variable nB , then creates a new name stored in local variable mB and finally sends the value in mB on channel with the same name as the value of nB . The thread M ain non-deterministically creates new thread instances of type Init and Resp. The local variable x is used to store new names to be used for the creation of a new thread instance. Initially, all local variables of threads Init/Resp are set to ⊥. In order to allow process instances to participate to several sessions (potentially with different principals), we could also add the following rule restart stopA −−−−−→ initA [nA := ⊥, mA := ⊥] In this rule we require that roles and identities do not change from session to session.3 Starting from G0 = hN0 , hinit, ⊥ii, and running the Main thread we can generate any number of copies of the threads Init and Resp each one with a unique identifier. Thus, we obtain global configurations like hN, hinitM , ⊥i, hinitA , i1 , ⊥, ⊥i, . . . , hinitA , iK , ⊥, ⊥i, hinitB , iK+1 , ⊥, ⊥i, . . . , hinitB , iK+L , ⊥, ⊥i i where N = {⊥, i1, . . . , iK , iK+1 , . . . , iK+L } for K, L ≥ 0. The threads of type Init and Resp can start parallel sessions whenever created. For K = 1 and L = 1 one possible session is as follows. Starting from h{⊥, i1 , i2 }, hinitM , ⊥i, hinitA , i1 , ⊥, ⊥i, hinitB , i2 , ⊥, ⊥ii 3 By means of thread and fresh name creation it is also possible to specify a restart rule in which a given process takes a potential different role or identity. Constraint-based Verification of Abstract Multithreaded Programs 7 T hread Init(local idA , nA , mA ); f resh initA −−−−→ genA c!hnA i genA −−−−→ waitA n ?hyi waitA −−A −−−→ stopA [nA := new] [true] [mA := y] T hread Resp(local id, nB , mB ); c?hxi initB −−−→ genB [nB := x] f resh genB −−−−→ readyB n !hm i [mB := new] B readyB −−B−−−− → stopB [true] T hread M ain(local x); id initM −−→ create newA create −−−−→ initM new → initM create −−−−B [x := new] [run Init with idA := x, nA := ⊥, mA := ⊥, x := ⊥] [run Resp with idB := x, nB := ⊥, mB := ⊥, x := ⊥B ] Fig. 1. Example of thread definitions. if we apply the first rule of thread Init to hinitA , i1 , ⊥, ⊥i we obtain h{⊥, i1 , i2 , a1 }, hinitM , ⊥i, hgenA , i1 , a1 , ⊥i, hinitB , i2 , ⊥, ⊥ii where a1 is the generated name (a1 is distinct from ⊥, i1 , and i2 ). Now if we apply the second rule of thread Init and the first rule of thread Resp (synchronization on channel c) we obtain h{⊥, i1 , i2 , a1 }, hinitM , ⊥i, hwaitA , i1 , a1 , ⊥i, hgenB , i2 , a1 , ⊥ii If we apply the second rule of thread Resp we obtain h{⊥, i1 , i2 , a1 , a2 }, hinitM , ⊥i, hwaitA , i1 , a1 , ⊥i, hreadyB , i2 , a1 , a2 ii Finally, if we apply the last rule of thread Init and Resp (synchronization on channel a1 ) we obtain h{⊥, i1 , i2 , a1 , a2 }, hinitM , ⊥i, hstopA , i1 , a1 , a2 i, hstopB , i2 , a1 , a2 ii Thus, at the end of the session the thread instances i1 and i2 have both a local copy of the fresh names a1 and a2 . Note that a copy of the main thread hinitM , ⊥i is always active in any reachable configuration, and, at any time, it may introduce new threads (either of type Init or Resp) with fresh identifiers. Generation of fresh names is also used by the threads of type Init and Resp to create nonces. Furthermore, threads can restart their life cycle (without changing identifiers). Thus, in this example the set of possible reachable configurations is infinite and contains configurations with arbitrarily many threads and fresh names. Since names are stored in the local variables of active threads, the local data also range over an infinite domain. ✷ 8 Giorgio Delzanno 2.2 Expressive Power of TDL To study the expressive power of the TDL language, we will compare it with the Turing equivalent formalism called Two Counter Machines. A Two Counters Machine configurations is a tuple hℓ, c1 = n1 , c2 = n2 i where ℓ is control location taken from a finite set Q, and n1 and n2 are natural numbers that represent the values of the counters c1 and c2 . Each counter can be incremented or decremented (if greater than zero) by one. Transitions combine operations on individual counters with changes of control locations. Specifically, the instructions for counter ci are as follows Inc: ℓ1 : ci := ci + 1; goto ℓ2 ; Dec: ℓ1 : if ci > 0 then ci := ci − 1; goto ℓ2 ; else goto ℓ3 ; A Two Counter Machine consists then of a list of instructions and of the initial state hℓ0 , c1 = 0, c2 = 0i. The operational semantics is defined according to the intuitive semantics of the instructions. Problems like control state reachability are undecidable for this computational model. The following property then holds. Theorem 1 TDL programs can simulate Two Counter Machines. Proof In order to define a TDL program that simulates a Two Counter Machine we proceed as follows. Every counter is represented via a doubly linked list implemented via a collection of threads of type Cell and with a unique thread of type Last pointing to the head of the list. The i-th counter having value zero is represented as the empty list Cell(i, v, v), Last(i, v, w) for some name v and w (we will explain later the use of w). The i-th counter having value k is represented as Cell(i, v0 , v0 ), Cell(i, v0 , v1 ), . . . , C(i, vk−1 , vk ), Last(i, vk , w) for distinct names v0 , v1 , . . . , vk . The instructions on a counter are simulated by sending messages to the corresponding Last thread. The messages are sent on channel Zero (zero test), Dec (decrement), and Inc (increment). In reply to each of these messages, the thread Last sends an acknowledgment, namely Y es/N o for the zero test, DAck for the decrement, IAck for the increment operation. Last interacts with the Cell threads via the messages tstC, decC, incC acknowledged by messages z/nz, dack. iack. The interactions between a Last thread and the Cell threads is as follows. Zero Test Upon reception of a message hxi on channel Zero, the Last thread with local variables id, last, aux checks that its identifier id matches x - see transition from Idle to Busy - sends a message hid, lasti on channel tstC directed to the cell pointed to by last (transition from Busy to W ait), and then waits for an answer. If the answer is sent on channel nz, standing for non-zero, (resp. z standing for zero) - see transition from W ait to AckN Z (resp. AckZ) - then it sends its identifier on Constraint-based Verification of Abstract Multithreaded Programs 9 Thread Last(local id, last, aux); (Zero test) Zero?hxi Idle −−−−−−→ Busy [id = x] tstC!hid,lasti Busy −−−−−−−−−→ W ait nz?hxi W ait −−−−→ AckN Z [id = x] z?hxi W ait −−−→ AckZ [id = x] Y es!hidi AckZ −−−−−→ Idle No!hidi AckN Z −−−−−→ idle (Decrement) Dec?hxi Idle −−−−−→ Dbusy [id = x] decC!hid,lasti DBusy −−−−−−−−−→ DW ait dack?hx,ui DW ait −−−−−−−→ DAck [id = x, last := u] DAck!hidi DAck −−−−−−−→ Idle (Increment) Inc?hxi Idle −−−−−→ IN ew [id = x] new [aux := new] run [run Cell with idc := id; prev := last; next := aux] IN ew −−−→ IRun IRun −−→ IAck IAck!hidi IAck −−−−−−→ Idle [last := aux] Fig. 2. The process defining the last cell of the linked list associated to a counter channel N o (resp. Y es) as an acknowledgment to the first message - see transition from AckN Z (resp. Z) to Idle. As shown in Fig. 3, the thread Cell with local variables idc, prev, and next that receives the message tstC, i.e., pointed to by a thread Last with the same identifier as idc, sends an acknowledgment on channel z (zero) if prev = next, and on channel nz (non-zero) if prev 6= next. Decrement Upon reception of a message hxi on channel Dec, the Last thread with local variables id, last, aux checks that its identifier id matches x (transition from Idle to Dbusy), sends a message hid, lasti on channel decC directed to the cell pointed to by last (transition from Busy to W ait), and then waits for an answer. 10 Giorgio Delzanno Thread Cell(local idc, prev, next); (Zero test) tstC?hx,ui idle −−−−−−−→ ackZ [x = idc, u = next, prev = next] tstC?hx,ui idle −−−−−−−→ ackN Z [x = idc, u = next, prev 6= next] z!hidci ackZ −−−−→ idle nz!hidci ackN Z −−−−−→ idle (Decrement) dec?hx,ui idle −−−−−−→ dec [x = idc, u = next, prev 6= next] dack!hidc,previ dec −−−−−−−−−−→ idle Fig. 3. The process defining a cell of the linked list associated to a counter If the answer is sent on channel dack (transition from DW ait to DAck) then it updates the local variable last with the pointer u sent by the thread Cell, namely the prev pointer of the cell pointed to by the current value of last, and then sends its identifier on channel DAck to acknowledge the first message (transition from DAck to Idle). As shown in Fig. 3, a thread Cell with local variables idc, prev, and next that receives the message decC and such that next = last sends as an acknowledgment on channel dack the value prev. Increment To simulate the increment operation, Last does not have to interact with existing Cell threads. Indeed, it only has to link a new Cell thread to the head of the list (this is way the Cell thread has no operations to handle the increment operation). As shown in Fig. 2 this can be done by creating a new name stored in the local variable aux (transition from IN ew to IRun) and spawning a new Cell thread (transition from IRun to IAck) with prev pointer equal to last, and next pointer equal to aux. Finally, it acknowledges the increment request by sending its identifier on channel IAck and updates variable last with the current value of aux. Two Counter Machine Instructions We are now ready to use the operations provided by the thread Last to simulate the instructions of a Two Counter Machine. As shown in Fig. 4, we use a thread CM with two local variables id1 , id2 to represent the list of instructions of a 2CM with counters c1 , c2 . Control locations of the Two Counter Machines are used as local states of the thread CM . The initial local state of the CM thread is the initial control location. The increment instruction on counter ci at control location ℓ1 is simulated by an handshaking with the Last thread with identifier idi : we first send the message Inc!hidi i, wait for the acknowledgment on channel IAck and then move to state ℓ2 . Similarly, for the decrement Constraint-based Verification of Abstract Multithreaded Programs 11 Thread CM (local id1 , id2 ); .. . (Instruction : ℓ1 : ci := ci + 1; goto ℓ2 ; ) Inc!hid i ℓ1 −−−−−−i→ waitℓ1 IAck!hxi waitℓ1 −−−−−−→ ℓ2 [x = idi ] .. . (Instruction : ℓ1 : ci > 0 then ci := ci − 1; goto ℓ2 ; else goto ℓ3 ; ) Zero!hid i ℓ1 −−−−−−−i→ waitℓ1 NZAck?hxi waitℓ1 − −−−−−−− → decℓ1 [x = idi ] Dec!hid i decℓ1 −−−−−−i→ wdecℓ1 DAck?hyi wdecℓ1 −−−−−−→ ℓ2 [y = idi ] ZAck?hxi waitℓ1 −−−−−−→ ℓ3 [x = idi ] .. . Fig. 4. The thread associated to a 2CM. Thread Init(local nid1 , p1 , nid2 , p2 ); f reshId init −−−−−→ init1 [nid1 := new] f reshP init1 −−−−−→ init2 [p1 := new] runC init2 − −−−→ init3 [run Cell with idc := nid1 ; prev := p1 ; next := p1 ] runL init3 −−−→ init4 [run Last with idc := nid1 ; last := p1 ; aux := ⊥] f reshId init4 −−−−−→ init5 [nid2 := new] f reshP init5 −−−−−→ init6 [p2 := new] runC init6 − −−−→ init7 [run Cell with idc := nid2 ; prev := p2 ; next := p2 ] runL init7 −−−→ init8 [run Last with idc := nid2 ; last := p2 ; aux := ⊥] runCM init8 −−−−−→ init9 [run 2CM with id1 := nid1 ; id2 := nid2 ] Fig. 5. The initialization thread. instruction on counter ci at control location ℓ1 we first send the message Zero!hidi i. If we receive an acknowledgment on channel N ZAck we send a Dec request, wait for completion and then move to ℓ2 . If we receive an acknowledgment on channel ZAck we directly move to ℓ3 . 12 Giorgio Delzanno Initialization The last step of the encoding is the definition of the initial state of the system. For this purpose, we use the thread Init of Fig. 5. The first four rules of Init initialize the first counter: they create two new names nid1 (an identifier for counter c1 ) and p1 , and then spawn the new threads Cell(nid1 , p1 , p1 ), Last(nid1 , p1 , ⊥). The following four rules spawns the new threads Cell(nid2 , p2 , p2 ), Last(nid2 , p2 , ⊥). After this stage, we create a thread of type 2CM to start the simulation of the instructions of the Two Counter Machines. The initial configuration of the whole system is G0 = hinit, ⊥, ⊥i. By construction we have that an execution step from hℓ1 , c1 = n1 , c2 = n2 i to hℓ2 , c1 = m1 , c2 = m2 i is simulated by an execution run going from a global configuration in which the local state of thread CM is hℓ1 , id1 , id2 i and in which we have ni occurrences of thread Cell with the same identifier idi for i : 1, 2, to a global configuration in which the local state of thread CM is hℓ2 , id1 , id2 i and in which we have mi occurrences of thread Cell with the same identifier idi for i : 1, 2. Thus, every executions of a 2CM M corresponds to an execution of the corresponding TDL program that starts from the initial configuration G0 = hinit, ⊥, ⊥i. As a consequence of the previous theorem, we have the following corollary. Corollary 1 Given a TDL program, a global configurations G, and a control location ℓ, deciding if there exists a run going from G0 to a global configuration that contains ℓ (control state reachability) is an undecidable problem. 3 From TDL to MSRN C As mentioned in the introduction, our verification methodology is based on a translation of TDL programs into low level specifications given in MSRN C . Our goal is to extend the connection between CCS and Petri Nets (German and Sistla 1992) to TDL and MSR so as to be able to apply the verification methods defined in (Delzanno 2005) to multithreaded programs. In the next section we will summarize the main features of the language MSRN C introduced in (Delzanno 2001). 3.1 Preliminaries on MSRN C N C-constraints are linear arithmetic constraints in which conjuncts have one of the following form: true, x = y, x > y, x = c, or x > c, x and y being two variables from a denumerable set V that range over the rationals, and c being an integer. The solutions Sol of a constraint ϕ are defined as all evaluations (from V to Q) that satisfy ϕ. A constraint ϕ is satisfiable whenever Sol(ϕ) 6= ∅. Furthermore, ψ entails ϕ whenever Sol(ψ) ⊆ Sol(ϕ). N C-constraints are closed under elimination of existentially quantified variables. Let P be a set of predicate symbols. An atomic formula p(x1 , . . . , xn ) is such that p ∈ P, and x1 , . . . , xn are distinct variables in V. A multiset of atomic formulas is indicated as A1 | . . . | Ak , where Ai and Aj have distinct variables (we use variable renaming if necessary), and | is the multiset constructor. Constraint-based Verification of Abstract Multithreaded Programs 13 In the rest of the paper we will use M, N , . . . to denote multisets of atomic formulas, ǫ to denote the empty multiset, ⊕ to denote multiset union and ⊖ to denote multiset difference. An MSRN C configuration is a multiset of ground atomic formulas, i.e., atomic formulas like p(d1 , . . . , dn ) where di is a rational for i : 1, . . . , n. An MSRN C rule has the form M −→ M′ : ϕ, where M and M′ are two (possibly empty) multisets of atomic formulas with distinct variables built on predicates in P, and ϕ is an N C-constraint. The ground instances of an MSRN C rule are defined as Inst(M −→ M′ : ϕ) = {σ(M) −→ σ(M′ ) | σ ∈ Sol(ϕ)} where σ is extended in the natural way to multisets, i.e., σ(M) and σ(M′ ) are MSRN C configurations. An MSRN C specification S is a tuple hP, I, Ri, where P is a finite set of predicate symbols, I is finite a set of (initial) MSRN C configurations, and R is a finite set of MSRN C rules over P. The operational semantics describes the update from a configuration M to one of its possible successor configurations M′ . M′ is obtained from M by rewriting (modulo associativity and commutativity) the left-hand side of an instance of a rule into the corresponding right-hand side. In order to be fireable, the left-hand side must be included in M. Since instances and rules are selected in a non deterministic way, in general a configuration can have a (possibly infinite) set of (one-step) successors. Formally, a rule H −→ B : ϕ from R is enabled at M via the ground substitution σ ∈ Sol(ϕ) if and only if σ(H) 4 M. Firing rule R enabled at M via σ yields the new configuration M′ = σ(B) ⊕ (M ⊖ σ(H)) We use M ⇒MSR M′ to denote the firing of a rule at M yielding M′ . A run is a sequence of configurations M0 M1 . . . Mk with M0 ∈ I such that Mi ⇒MSR Mi+1 for i ≥ 0. A configuration M is reachable if there exists M0 ∈ I ∗ ∗ such that M0 ⇒MSR M, where ⇒MSR is the transitive closure of ⇒MSR . Finally, the successor and predecessor operators P ost and P re are defined on a set of configurations S as P ost(S) = {M′ |M ⇒MSR M′ , M ∈ S} and P re(S) = {M|M ⇒MSR M′ , M′ ∈ S}, respectively. P re∗ and P ost∗ denote their transitive closure. As shown in (Delzanno 2001; Bozzano and Delzanno 2002), Petri Nets represent a natural abstractions of MSRN C (and more in general of MSR rule with constraints) specifications. They can be encoded, in fact, in propositional MSR specifications (e.g. abstracting away arguments from atomic formulas). 3.2 Translation from TDL to MSRN C The first thing to do is to find an adequate representation of names. Since all we need is a way to distinguish old and new names, we just need an infinite domain in which the = and 6= relation are supported. Thus, we can interpret names in N 14 Giorgio Delzanno either as integer of as rational numbers. Since operations like variable elimination are computationally less expensive than over integers, we choose to view names as non-negative rationals. Thus, a local (TDL) configuration p = hs, n1 , . . . , nk i is encoded as the atomic formula p• = s(n1 , . . . , nk ), where ni is a non-negative rational. Furthermore, a global (TDL) configuration G = hN, p1 , . . . , pm i is encoded as an MSRN C configuration G• p•1 | . . . | p•m | f resh(n) where the value n in the auxiliary atomic formula f resh(n) is an rational number strictly greater than all values occurring in p•1 , . . . , p•m . The predicate f resh will allow us to generate unused names every time needed. The translation of constants C = {c1 , . . . , cm }, and variables is defined as follows: x• = x for x ∈ V, ⊥• = 0, c•i = i for i : 1, . . . , m. We extend ·• in the natural way on a guard γ, by decomposing every formula x 6= e into x < e• and x > e• . We will call γ • the resulting set of N C-constraints.4 Given V = {x1 , . . . , xk }, we define V ′ as the set of new variables {x′1 , . . . , x′k }. Now, let us consider the assignment α defined as x1 := e1 , . . . , xk := ek (we add assignments like xi := xi if some variable does not occur as target of α). Then, α• is the N C-constraint x′1 = e•1 , . . . , x′k = e•k . The translation of thread definitions is defined below (where we will often refer to Example 1). Initial Global Configuration Given an initial global configuration consisting of the local configurations hsi , ni1 , . . . , niki i with nij = ⊥ for i : 1, . . . , u, we define the following MSRN C rule init → s1 (x11 , . . . , x1k1 ) | . . . | su (xu1 , . . . , xuku ) | f resh(x) : x > C, x11 = 0, . . . , xuku = 0 here C is the largest rational used to interpret the constants in C. For each thread definition P = hQ, s0 , V, Ri in T with V = {x1 , . . . , xk } we translate the rules in R as described below. a Internal Moves For every internal move s −−→ s′ [γ, α], and every ν ∈ γ • we define s(x1 , . . . , xk ) → s′ (x′1 , . . . , x′k ) : ν, α• a Name Generation For every name generation s −−→ s′ [xi := new], we define ^ s(x1 , . . . , xk ) | f resh(x) → s′ (x′1 , . . . , x′k ) | f resh(y) : y > x′i , x′i > x, x′j = xj j6=i f resh For instance, the name generation initA −−−−→ genA [n := new] is mapped into the MSRN C rule initA (id, x, y)| f resh(u) −−→ genA (id′ , x′ , y ′ ) | f resh(u′ ) : ϕ where ϕ 4 As an example, if γ is the constraint x = 1, x 6= z then γ • consists of the two constraints x = 1, x > z and x = 1, z > x. Constraint-based Verification of Abstract Multithreaded Programs 15 is the constraint u′ > x′ , x′ > u, y ′ = y, id′ = id. The constraint x′ > u represents the fact that the new name associated to the local variable n (the second argument of the atoms representing the thread) is fresh, whereas u′ > x′ updates the current value of f resh to ensure that the next generated names will be picked up from unused values. Thread Creation Let P = hQ′ , t0 , V ′ , R′ i and V ′ = {y1 , . . . , yu }. Then, for every a thread creation s −−→ s′ [run P with α], we define s(x1 , . . . , xk ) → s′ (x′1 , . . . , x′k ) | t(y1′ , . . . , yu′ ) : x′1 = x1 , . . . , x′k = xk , α• . new A initM [run Init with id := x, . . .] of Example 1. E.g., consider the rule create −−−−→ Its encoding yields the MSRN C rule create(x) −−→ initM (x′ ) | initA (id′ , n′ , m′ ) : ψ, where ψ represents the initialization of the local variables of the new thread x′ = x, id′ = x, n′ = 0, m′ = 0. Rendez-vous The encoding of rendez-vous communication is based on the use of constraint operations like variable elimination. Let P and P ′ be a pair of thread definitions, with local variables V = {x1 , . . . , xk } and V ′ = {y1 , . . . , yl } with V ∩ e′ ?m′ e!m V ′ = ∅. We first select all rules s −−→ s′ [γ, α] in R and t −−−−→ t′ [γ ′ , α′ ] in R′ , such that m = hw1 , . . . , wu i, m′ = hw1′ , . . . , wv′ i and u = v. Then, we define the new MSRN C rule s(x1 , . . . , xk ) | t(y1 , . . . , yl ) → s′ (x′1 , . . . , x′k ) | t′ (y1′ , . . . , yl′ ) : ϕ for every ν ∈ γ • and ν ′ ∈ γ ′• such that the NC-constraint ϕ obtained by eliminating w1′ , . . . , wv′ from the constraint ν ∧ ν ′ ∧ α• ∧ α′• ∧ w1 = w1′ ∧ . . . ∧ wv = wv′ nA ?hyi is satisfiable. For instance, consider the rules waitA −−−−−→ stopA [mA := y] and nB !hmB i readyB −−−−−−→ stopB [true]. We first build up a new constraint by conjoining the NC-constraints y = mB (matching of message templates), and nA = nB , m′A = y, n′A = nA , m′B = mB , n′B = nB , id′1 = id1 , id′2 = id2 (guards and actions of sender and receiver). After eliminating y we obtain the constraint ϕ defined as nB = nA , m′A = mB , n′A = nA , m′B = mB , n′B = nB , id′1 = id1 , id′2 = id2 defined over the variables of the two considered threads. This step allows us to symbolically represent the passing of names. After this step, we can represent the synchronization of the two threads by using a rule that simultaneously rewrite all instances that satisfy the constraints on the local data expressed by ϕ, i.e., we obtain the rule waitA (id1 , nA , mA )| readyB (id2 , nB , mB ) −→ stopA (id′1 , n′A , m′A ) | stopB (id′2 , n′B , m′B ) : ϕ The complete translation of Example 1 is shown in Fig. 6 (for simplicity we have applied a renaming of variables in the resulting rules). An example of run in the resulting MSRN C specification is shown in Figure 7. Note that, a fresh name is selected between all values strictly greater than the current value of f resh (e.g. in the second step 6 > 4), and then f resh is updated to a value strictly greater than all newly generated names (e.g. 8 > 6 > 4). 16 Giorgio Delzanno init −−→ f resh(x) | initM (y) : x > 0, y = 0. f resh(x) | initM (y) −−→ f resh(x′ ) | create(y ′ ) : x′ > y ′ , y ′ > x. create(x) −−→ initM (x′ ) | initA (id′ , n′ , m′ ) : x′ = x, id′ = x, n′ = 0, m′ = 0. create(x) −−→ initM (x′ ) | initB (id′ , n′ , m′ ) : x′ = x, id′ = x, n′ = 0, m′ = 0. initA (id, n, m)| f resh(u) −−→ genA (id, n′ , m) | f resh(u′ ) : u′ > n′ , n′ > u. genA (id1 , n, m)| initB (id2 , u, v) −−→ waitA (id1 , n, m) | genB (id′2 , u′ , v ′ ) : u′ = n, v ′ = v genB (id, n, m)| f resh(u) −−→ readyB (id, n, m′ ) | f resh(u′ ) : u′ > m′ , m′ > u. waitA (id1 , n, m)| readyB (id2 , u, v) −−→ stopA (id1 , n, m′ ) | stopB (id2 , u, v) : n = u, m′ = v. stopA (id, n, m) −−→ initA (id′ , n′ , m′ ) : n′ = 0, m′ = 0, id′ = id. stopB (id, n, m) −−→ initB (id′ , n′ , m′ ) : n′ = 0, m′ = 0, id′ = id. Fig. 6. Encoding of Example 1: for simplicity we embed constraints like x = x′ into the MSR formulas. init ⇒ . . . ⇒ f resh(4) | initM (0) | initA (2, 0, 0) | initB (3, 0, 0) ⇒ f resh(8) | initM (0) | genA (2, 6, 0) | initB (3, 0, 0) ⇒ f resh(8) | initM (0) | waitA (2, 6, 0) | genB (3, 6, 0) ⇒ . . . ⇒ f resh(16) | initM (0) | waitA (2, 6, 0) | genB (3, 6, 0) | initA (11, 0, 0) Fig. 7. A run in the encoded program. Let T = hP1 , . . . , Pt i be a collection of thread definitions and G0 be an initial global state. Let S be the MSRN C specification that results from the translation described in the previous section. Let G = hN, p1 , . . . , pn i be a global configuration with pi = hsi , vi1 , . . . , viki i, and let h : N ❀ Q+ be an injective mapping. Then, we define G• (h) as the MSRN C configuration s1 (h(v11 ), . . . , h(v1k1 )) | . . . | sn (h(vn1 ), . . . , h(vnkn )) | f resh(v) where v is a the first value strictly greater than all values in the range of h. Given an MSRN C configuration M defined as s1 (v11 , . . . , v1k1 ) | . . . | sn (vn1 , . . . , vnkn ) with sij ∈ Q+ , let V (M) ⊆ Q+ be the set of values occurring in M. Then, given a bijective mapping f : V (M) ❀ N ⊆ N , we define M• (f ) as the global configuration hN, p1 , . . . , pn i where pi = hsi , f (vi1 ), . . . , f (viki )i. Based on the previous definitions, the following property then holds. Theorem 2 For every run G0 G1 . . . in T with corresponding set of names N0 N1 . . ., there exist sets D0 D1 . . . and bijective mappings h0 h1 . . . with hi : Ni ❀ Di ⊆ Q+ for i ≥ 0, such that init G•0 (h0 )G•1 (h1 ) . . . is a run of S. Vice versa, if init M0 M1 . . . is a run of S, then there exist sets N0 N1 . . . in N and bijective mappings f0 f1 . . . with fi : V (Mi ) ❀ Ni for i ≥ 0, such that M•0 (f0 )M•1 (f1 ) . . . is a run in T . Proof We first prove that every run in T is simulated by a run in S. Let G0 . . . Gl be a run in T , i.e., a sequence of global states (with associated set Constraint-based Verification of Abstract Multithreaded Programs 17 of names N0 . . . Nl ) such that Gi ⇒ Gi+1 and Ni ⊆ Ni+1 for i ≥ 0. We prove that it can be simulated in S by induction on its length l. Specifically, suppose that there exist sets of non negative rationals D0 . . . Dl and bijective mappings h0 . . . hl with hi : Ni ❀ Di for 0 ≤ i ≤ l, such that c0 (h0 ) . . . G cl (hl ) init G is a run of S. Furthermore, suppose Gl ⇒ Gl+1 . We prove the thesis by a case-analysis on the type of rule applied in the last step of the run. Let Gl = hNl , p1 , . . . , pr i and pj = hs, n1 , . . . , nk i be a local configuration for the thread definition P = hQ, s, V, Ri with V = {x1 , . . . , xk } and ni ∈ Nl for i : 1, . . . , k. a Assignment Suppose there exists a rule s −−→ s′ [γ, α] in R such that ρpj satisfies γ, Gl = hNl , . . . , pj , . . .i ⇒ hNl+1 , . . . , p′j , . . .i = Gl+1 Nl = Nl+1 , p′j = hs′ , n′1 , . . . , n′k i, and if xi := yi occurs in α, then n′i = ρpj (yi ), otherwise n′i = ni for i : 1, . . . , k. The encoding of the rule returns one M SRN C rule having the form s(x1 , . . . , xk ) → s′ (x′1 , . . . , x′k ) : γ ′ , α b for every γ ′ ∈ γ b. cl (hl ) is a multiset of atomic formulas that contains the By inductive hypothesis, G formula s(hl (n1 ), . . . , hl (nk )). Now let us define hl+1 as the mapping from Nl to Dl such that hl+1 (n′i ) = hl (nj ) if xi := xj is in α and hl+1 (n′i ) = 0 if xi := ⊥ is in α. Furthermore, let us the define the evaluation σ = hx1 7→ hl (n1 ), . . . , xk 7→ hl (nk ), x′1 7→ hl+1 (n′1 ), . . . , x′k 7→ hl+1 (n′k )i Then, by construction of the set of constraints b γ and of the constraint α b, it follows that σ is a solution for γ ′ , α b for some γ ′ ∈ b γ . As a consequence, we have that s(n1 , . . . , nk ) → s′ (n′1 , . . . , n′k ) is a ground instance of one of the considered M SRN C rules. cl (hl ), if we apply a rewriting step Thus, starting from the M SRN C configuration G we obtain a new configuration in which s(n1 , . . . , nk ) is replaced by s′ (n′1 , . . . , n′k ), c [ and all the other atomic formulas in G l+1 (hl+1 ) are the same as in Gl (hl ). The [ resulting M SRN C configuration coincides then with the definition of G l+1 (hl+1 ). Creation of new names Let us now consider the case of fresh name generation. a Suppose there exists a rule s −−→ s′ [xi := new] in R, and let n 6∈ Nl , and suppose hNl , . . . , pj , . . .i ⇒ hNl+1 , . . . , p′j , . . .i where Nl+1 = Nl ∪ {v}, p′j = hs′ , n′1 , . . . , n′k i where n′i = n, and n′j = nj for j 6= i. We note than that the encoding of the previous rule returns the M SRN C rule s(x1 , . . . , xk ) | f resh(x) → s′ (x′1 , . . . , x′k ) | f resh(x′ ) : ϕ where ϕ consists of the constraints y > x′i , x′i > x and x′j = xj for j 6= i. By cl (hl ) is a multiset of atomic formulas that contains the inductive hypothesis, G 18 Giorgio Delzanno formulas s(hl (n1 ), . . . , hl (nk )) and f resh(v) where hl is a mapping into Dl , and v is the first non-negative rational strictly greater than all values occurring in the formulas denoting processes. Let v be a non negative rational strictly greater than all values in Dl . Furthermore, let us define v ′ = v + 1 and Dl+1 = Dl ∪ {v, v ′ }. Furthermore, we define hl+1 as follows hl+1 (n) = hl (n) for n ∈ Nl , and hl+1 (n′i ) = hl+1 (n) = v ′ . Furthermore, we define the following evaluation σ = h x 7→ v, x1 7→ hl (n1 ), . . . , xk 7→ hl (nk ), x′ 7→ v ′ , x′1 7→ hl+1 (n′1 ), . . . , x′k 7→ hl+1 (n′k ) i Then, by construction of σ and α b, it follows that σ is a solution for α b. Thus, s(n1 , . . . , nk ) | f resh(v) → s′ (n′1 , . . . , n′k ) | f resh(v ′ ) is a ground instance of the considered M SRN C rule. cl (hl ), if we apply a rewriting step we Starting from the M SRN C configuration G obtain a new configuration in which s(n1 , . . . , nk ) and f resh(v) are substituted by [ s′ (n′1 , . . . , n′k ) and f resh(v ′ ), and all the other atomic formulas in G l+1 (hl+1 ) are c the same as in Gl (hl ). We conclude by noting that this formula coincides with the [ definition of G l+1 (hl+1 ). For sake of brevity we omit the case of thread creation whose only difference from the previous cases is the creation of several new atoms instead (with values obtained by evaluating the action) of only one. Rendez-vous Let pi = hs, n1 , . . . , nk i and pj = ht, m1 , . . . , mu i two local configurations for threads P 6= P ′ , ni ∈ Nl for i : 1, . . . , k and mi ∈ Nl for i : 1, . . . , u. c!m c?m′ Suppose s −−→ s′ [γ, α] and t −−−→ t′ [γ ′ , α′ ], where m = hxi1 , . . . , xiv i, and m′ = hy1 , . . . , yv i ( all defined over distinct variables) are rules in R. Furthermore, suppose that ρpi satisfies γ, and that ρ′ (see definition of the operational semantics) satisfies γ ′ , and suppose that Gl = hNl , . . . , pi , . . . , pj , . . .i ⇒ hNl+1 , . . . , p′i , . . . , p′j , . . .i = Gl+1 , where Nl+1 = Nl , p′i = hs′ , n′1 , . . . , n′k i, p′j = ht′ , m′1 , . . . , m′u i, and if xi := e occurs in α, then n′i = ρpi (e), otherwise n′i = ni for i : 1, . . . , k; if ui := e occurs in α′ , then m′i = ρ′ (e), otherwise m′i = mi for i : 1, . . . , u. cl (hl ) is a multiset of atomic formulas that contains the By inductive hypothesis, G formulas s(hl (n1 ), . . . , hl (nk )) and t(hl (m1 ), . . . , hl (mu )). Now, let us define hl+1 as the mapping from Nl to Dl such that hl+1 (n′i ) = hl (nj ) if xi := xj is in α, hl+1 (m′i ) = hl (mj ) if ui := uj is in α′ , hl+1 (n′i ) = 0 if xi := ⊥ is in α, hl+1 (m′i ) = 0 if ui := ⊥ is in α′ . Now, let us define σ as the evaluation from Nl to Dl such that σ = σ1 ∪ σ2 σ1 = hx1 7→ hl (n1 ), . . . , xk 7→ hl (nk ), u1 7→ hl (m1 ), . . . , uu 7→ hl (mu )i σ2 = hx′1 7→ hl+1 (n′1 ), . . . , x′k 7→ hl+1 (n′k ), u′1 7→ hl+1 (m′1 ), . . . , u′u 7→ hl+1 (m′u )i. Then, by construction of the sets of constraints γ b, γb′ , α b and αb′ it follows that σ is ′ ′ ′ a solution for the constraint ∃w1 . . . . ∃wp .θ ∧ θ ∧ α b ∧ αb′ ∧ w1 = w1′ ∧ . . . ∧ wp = wp′ for some θ ∈ γ b and θ′ ∈ γb′ . Note in fact that the equalities wi = wi′ express the Constraint-based Verification of Abstract Multithreaded Programs 19 passing of values defined via the evaluation ρ′ in the operational semantics. As a consequence, s(n1 , . . . , nk ) | t(m1 , . . . , mu ) → s′ (n′1 , . . . , n′k ) | t′ (m′1 , . . . , m′u ) is a ground instance of one of the considered M SRN C rules. cl (hl ), if we apply a rewriting Thus, starting from the M SRN C configuration G step we obtain a new configuration in which s(n1 , . . . , nk ) has been replaced by s′ (n′1 , . . . , n′k ), and t′ (m′1 , . . . , m′k ) has been replaced by t(m′1 , . . . , m′u ), and all the cl (hl ). This formula coincides with the definition other atomic formulas are as in G [ of Gl+1 (hl+1 ). The proof of completeness is by induction on the length of an MSR run, and by case-analysis on the application of the rules. The structure of the case analysis is similar to the previous one and it is omitted for brevity. 4 Verification of TDL Programs Safety and invariant properties are probably the most important class of correctness specifications for the validation of a concurrent system. For instance, in Example 1 we could be interested in proving that every time a session terminates, two instances of thread Init and Resp have exchanged the two names generated during the session. To prove the protocol correct independently from the number of names and threads generated during an execution, we have to show that from the initial configuration G0 it is not possible to reach a configuration that violates the aforementioned property. The configurations that violate the property are those in which two instances of Init and Resp conclude the execution of the protocol exchanging only the first nonce. These configurations can be represented by looking at only two threads and at the relationship among their local data. Thus, we can reduce the verification problem of this safety property to the following problem: Given an initial configuration G0 we would like to decide if a global configuration that contains at least two local configurations having the form hstopA , i, n, mi and hstopB , i′ , n′ , m′ i with n′ = n and m 6= m′ for some i, i′ , n, n′ , m, m′ is reachable. This problem can be viewed as an extension of the control state reachability problem defined in (Abdulla and Nylén 2000) in which we consider both control locations and local variables. Although control state reachability is undecidable (see Corollary 1), the encoding of TDL into MSRN C can be used to define a sound and automatic verification methods for TDL programs. For this purpose, we will exploit a verification method introduced for MSR(C) in (Delzanno 2001; Delzanno 2005). In the rest of this section we will briefly summarize how to adapt the main results in (Delzanno 2001; Delzanno 2005) to the specific case of MSRN C . Let us first reformulate the control state reachability problem of Example 1 for the aforementioned safety property on the low level encoding into MSRN C . Given the MSRN C initial configuration init we would like to check that no configuration in P ost∗ ({init}) has the following form {stopA (a1 , v1 , w1 ), stopB (a2 , v2 , w2 )} ⊕ M 20 Giorgio Delzanno for ai , vi , wi ∈ Q i : 1, 2 and an arbitrary multiset of ground atoms M. Let us call U the set of bad MSRN C configurations having the aforementioned shape. Notice that U is upward closed with respect to multiset inclusion, i.e., if M ∈ U and M 4 M′ , then M′ ∈ U . Furthermore, for if U is upward closed, so is P re(U ). On the basis of this property, we can try to apply the methodology proposed in (Abdulla and Nylén 2000) to develop a procedure to compute a finite representation R of P re∗ U ). For this purpose, we need the following ingredients: 1. a symbolic representation of upward closed sets of configurations (e.g. a set of assertions S whose denotation [[S]] is U ); 2. a computable symbolic predecessor operator SP re working on sets of formulas such that [[SP re(S)]] = P re([[S]]); 3. a (decidable) entailment relation Ent to compare the denotations of symbolic representations, i.e., such that Ent(N, M ) implies [[N ]] ⊆ [[M ]]. If such a relation Ent exists, then it can be naturally extended to sets of formulas as follows: EntS (S, S ′ ) if and only if for all N ∈ S there exists M ∈ S ′ such that Ent(N, M ) holds (clearly, if Ent is an entailment, then EntS (S, S ′ ) implies [[S]] ⊆ [[S ′ ]]). The combination of these three ingredients can be used to define a verification methods based on backward reasoning as explained next. Symbolic Backward Reachability Suppose that M1 , . . . , Mn are the formulas of our assertional language representing the infinite set U consisting of all bad configurations. The symbolic backward reachability procedure (SBR) procedure computes a chain {Ii }i≥0 of sets of assertions such that I0 = {M1 , . . . , Mn } Ii+1 = Ii ∪ SP re(Ii ) for i ≥ 0 The procedure SBR stops when SP re produces only redundant information, i.e., EntS (Ii+1 , Ii ). Notice that EntS (Ii , Ii+1 ) always holds since Ii ⊆ Ii+1 . Symbolic Representation In order to find an adequate represention of infinite sets of MSRN C configurations we can resort to the notion of constrained configuration introduced in (Delzanno 2001) for the language scheme MSR(C) defined for a generic constraint system C. We can instantiate this notion with N C constraints as follows. A constrained configuration over P is a formula p1 (x11 , . . . , x1k1 ) | . . . | pn (xn1 , . . . , xnkn ) : ϕ where p1 , . . . , pn ∈ P, xi1 , . . . , xiki ∈ V for any i : 1, . . . n and ϕ is an N C-constraint. . The denotation a constrained configuration M = (M : ϕ) is defined by taking the upward closure with respect to multiset inclusion of the set of ground instances, namely [[M ]] = {M′ | σ(M) 4 M′ , σ ∈ Sol(ϕ)} Constraint-based Verification of Abstract Multithreaded Programs 21 This definition can be extended to sets of MSRN C constrained configurations with disjoint variables (we use variable renaming to avoid variable name clashing) in the natural way. In our example the following set SU of MSRN C constrained configurations (with distinct variables) can be used to finitely represent all possible violations U to the considered safety property SU = { stopA (i1 , n1 , m1 ) | stopB (i2 , n2 , m2 ) : n1 = n2 , m1 > m2 stopA (i1 , n1 , m1 ) | stopB (i2 , n2 , m2 ) : n1 = n2 , m2 > m1 } Notice that we need two formulas to represent m1 6= m2 using a disjunction of > constraints. The MSRN C configurations stopB (1, 2, 6) | stopA (4, 2, 5), and stopB (1, 2, 6) | stopA (4, 2, 5) | waitA (2, 7, 3) are both contained in the denotation of SU . Actually, we have that [[SU ]] = U . This symbolic representation allows us to reason on infinite sets of MSRN C configurations, and thus on global configurations of a TDL program, forgetting the actual number or threads of a given run. To manipulate constrained configurations, we can instantiate to N C-constraints the symbolic predecessor operator SP re defined for a generic constraint system in (Delzanno 2005). Its definition is also given in Section Appendix A in Appendix. From the general properties proved in (Delzanno 2005), we have that when applied to a finite set of MSRN C constrained configurations S, SP reN C returns a finite set of constrained configuration such that [[SP reN C (S)]] = P re([[S]]), i.e., SP reN C (S) is a symbolic representation of the immediate predecessors of the configurations in the denotation (an upward closed set) of S. Similarly we can instantiate the generic entailment operator defined in (Delzanno 2005) to MSRN C constrained configurations so as to obtain an a relation Ent such that EntN C (N, M ) implies [[N ]] ⊆ [[M ]]. Based on these properties, we have the following result. Proposition 1 Let T be a TDL program with initial global configuration G0 , Furthermore, let S be the corresponding MSRN C encoding. and SU be the set of MSRN C constrained configurations denoting a given set of bad TDL configurations. Then, init 6∈ SP re∗N C (SU ) if and only if there is no finite run G0 . . . Gn and mappings h0 , . . . , hn from the names occurring in G to non-negative rationals such that init• G•0 (h0 ) . . . G•n (hn ) is a run in S and G•n (hn ) ∈ [[U ]]. Proof Suppose init 6∈ SP re∗N C (U ). Since [[SP reN C (S)]] = pre([[S]]) for any S, it follows that there cannot exist runs initM0 . . . Mn in S such that Mn ∈ [[U ]]. The thesis then follows from the Theorem 2. As discussed in (Bozzano and Delzanno 2002), we have implemented our verification procedure based on M SR and linear constraints using a CLP system with linear arithmetics. By the translation presented in this paper, we can now reduce the verification of safety properties of multithreaded programs to a fixpoint computation built on constraint operations. As example, we have applied our CLP-prototype to automatically verify the specification of Fig. 6. The unsafe states are those described in Section 4. Symbolic backward reachability terminates after 18 iterations 22 Giorgio Delzanno and returns a symbolic representation of the fixpoint with 2590 constrained configurations. The initial state init is not part of the resulting set. This proves our original thread definitions correct with respect to the considered safety property. 4.1 An Interesting Class of TDL Programs The proof of Theorem 1 shows that verification of safety properties is undecidable for TDL specifications in which threads have several local variables (they are used to create linked lists). As mentioned in the introduction, we can apply the sufficient conditions for the termination of the procedure SBR given in (Bozzano and Delzanno 2002; Delzanno 2005) to identify the following interesting subclass of TDL programs. Definition 4 A monadic TDL thread definition P = hQ, s, V, Ri is such that V is at most a singleton, and every message template in R has at most one variable. A monadic thread definition can be encoded into the monadic fragment of MSRN C studied in (Delzanno 2005). Monadic MSRN C specifications are defined over atomic formulas of the form p or p(x) with p is a predicate symbol and x is a variable, and on atomic constraints of the form x = y, and x > y. To encode a monadic TDL thread definitions into a Monadic MSRN C specification, we first need the following observation. Since in our encoding we only use the constant 0, we first notice that we can restrict our attention to MSRN C specifications in which constraints have no constants at all. Specifically, to encode the generation of fresh names we only have to add an auxiliary atomic formula zero(z), and refer to it every time we need to express the constant 0. As an example, we could write rules like init −−→ f resh(x) | initM (y) | zero(z) : x > z, y = z for initialization, and create(x) | zero(z) −−→ initM (x′ ) | initA (id′ , n′ , m′ ) | zero(z) : x′ = x, id′ = x, n′ = z, m′ = z, z ′ = z for all assignments involving the constant 0. By using this trick an by following the encoding of Section 3, the translation of a collection of monadic thread definitions directly returns a monadic MSRN C specification. By exploiting this property, we obtain the following result. Theorem 3 The verification of safety properties whose violations can be represented via an upward closed set U of global configurations is decidable for a collection T of monadic TDL definitions. Proof Let S be the MSRN C encoding of T and SU be the set of constrained configuration such that SU = U . The proof is based on the following properties. First of all, the MSRN C specification S is monadic. Furthermore, as shown in (Delzanno 2005), Constraint-based Verification of Abstract Multithreaded Programs 23 the class of monadic MSRN C constrained configurations is closed under application of the operator SP reN C . Finally, as shown in (Delzanno 2005), there exists an entailment relation CEnt for monadic constrained configurations that ensures the termination of the SBR procedure applied to a monadic MSRN C specification. Thus, for the monadic MSRN C specification S, the chain defined as I0 = SU , Ii+1 = Ii ∪ SP re(Ii ) always reaches a point k ≥ 1 in which CEntS (Ik+1 , Ik ), i.e. [[Ik ]] is a fixpoint for P re. Finally, we note that we can always check for membership of init in the resulting set Ik . As shown in (Schnoebelen 2002), the complexity of verification methods based on symbolic backward reachability relying on the general results in (Abdulla and Nylén 2000; Finkel and Schnoebelen 2001) is non primitive recursive. 5 Conclusions and Related Work In this paper we have defined the theoretical grounds for the possible application of constraint-based symbolic model checking for the automated analysis of abstract models of multithreaded concurrent systems providing name generation, name mobility, and unbounded control. Our verification approach is based on an encoding into a low level formalism based on the combination of multiset rewriting and constraints that allows us to naturally implement name generation, value passing, and dynamic creation of threads. Our verification method makes use of symbolic representations of infinite set of system states and of symbolic backward reachability. For this reason, it can be viewed as a conservative extension of traditional finite-state model checking methods. The use of symbolic state analysis is strictly related to the analysis methods based on abstract interpretation. A deeper study of the connections with abstract interpretation is an interesting direction for future research. Related Work The high level syntax we used to present the abstract models of multithreaded programs is an extension of the communicating finite state machines used in protocol verification (Bochmann 1978), and used for representing abstraction of multithreaded software programs (Ball et al. 2001). In our setting we enrich the formalism with local variables, name generation and mobility, and unbounded control. Our verification approach is inspired by the recent work of Abdulla and Jonsson. In (Abdulla and Jonsson 2003), Abdulla and Jonsson proposed an assertional language for Timed Networks in which they use dedicated data structures to symbolically represent configurations parametric in the number of tokens and in the age (a real number) associated to tokens. In (Abdulla and Nylén 2000), Abdulla and Nylén formulate a symbolic algorithm using existential zones to represent the state-space of Timed Petri Nets. Our approach generalizes the ideas of (Abdulla and Jonsson 2003; Abdulla and Nylén 2000) to systems specified via multiset rewriting and with more general classes of constraints. In (Abdulla and Jonsson 2001), the authors apply similar ideas to (unbounded) channel systems in which messages can vary over an infinite name domain and can be stored in a finite (and fixed a 24 Giorgio Delzanno priori) number of data variables. However, they do not relate these results to multithreaded programs. Multiset rewriting over first order atomic formulas has been proposed for specifying security protocols by Cervesato et al. in (Cervesato et al. 1999). The relationships between this framework and concurrent languages based on process algebra have been recently studied in (Bistarelli et al. 2005). Apart from approaches based on Petri Net-like models (as in (German and Sistla 1992; Ball et al. 2001)), networks of finite-state processes can also be verified by means of automata theoretic techniques as in (Bouajjani et al. 2000). In this setting the set of possible local states of individual processes are abstracted into a finite alphabet. Sets of global states are represented then as regular languages, and transitions as relations on languages. Differently from the automata theoretic approach, in our setting we handle parameterized systems in which individual components have local variables that range over unbounded values. The use of constraints for the verification of concurrent systems is related to previous works connecting Constraint Logic Programming and verification, see e.g. (Delzanno and Podelski 1999). In this setting transition systems are encoded via CLP programs used to encode the global state of a system and its updates. In the approach proposed in (Delzanno 2001; Bozzano and Delzanno 2002), we refine this idea by using multiset rewriting and constraints to locally specify updates to the global state. In (Delzanno 2001), we defined the general framework of multiset rewriting with constraints and the corresponding symbolic analysis technique. The language proposed in (Delzanno 2001) is given for a generic constraint system C (taking inspiration from CLP the language is called M SR(C)). In (Bozzano and Delzanno 2002), we applied this formalism to verify properties of mutual exclusion protocols (variations of the ticket algorithm) for systems with an arbitrary number of processes. In the same paper we also formulated sufficient conditions for the termination of the backward analysis. The present paper is the first attempt of relating the low level language proposed in (Delzanno 2001) to a high level language with explicit management of names and threads. Acknowledgments The author would like to thank Ahmed Bouajjani, Andrew Gordon, Fabio Martinelli, Catuscia Palamidessi, Luca Paolini, and Sriram Rajamani and the anonymous reviewers for several fruitful comments and suggestions. References Abdulla, P. A., Cerāns, K., Jonsson, B., and Tsay, Y.-K. 1996. General Decidability Theorems for Infinite-State Systems. In Proceedings 11th Annual International Symposium on Logic in Computer Science (LICS’96). IEEE Computer Society Press, New Brunswick, New Jersey, 313–321. Abdulla, P. A. and Jonsson, B. 2001. Ensuring Completeness of Symbolic Verification Methods for Infinite-State Systems. Theoretical Computer Science 256, 1-2, 145–167. Abdulla, P. A. and Jonsson, B. 2003. Model checking of systems with many identical timed processes. Theoretical Computer Science 290, 1, 241–264. Abdulla, P. A. and Nylén, A. 2000. Better is Better than Well: On Efficient Verification of Infinite-State Systems. In Proceedings 15th Annual International Symposium on Constraint-based Verification of Abstract Multithreaded Programs 25 Logic in Computer Science (LICS’00). IEEE Computer Society Press, Santa Barbara, California, 132–140. Ball, T., Chaki, S., and Rajamani, S. K. 2001. Parameterized Verification of Multithreaded Software Libraries. In 7th International Conference on Tools and Algorithms for Construction and Analysis of Systems (TACAS 2001), Genova, Italy, April 2-6,. LNCS, vol. 2031. Springer-Verlag, 158–173. Bistarelli, S., Cervesato, I., Lenzini, G., and Martinelli, F. 2005. Relating multiset rewriting and process algebras for security protocol analysis. Journal of Computer Security 13, 1, 3–47. Bochmann, G. V. 1978. Finite state descriptions of communicating protocols. Computer Networks 2, 46–57. Bouajjani, A., Jonsson, B., Nilsson, M., and Touili, T. 2000. Regular Model Checking. In Proceedings 12th International Conference on Computer Aided Verification (CAV’00), E. A. Emerson and A. P. Sistla, Eds. LNCS, vol. 1855. Springer-Verlag, Chicago, Illinois, 403–418. Bozzano, M. and Delzanno, G. 2002. Algorithmic verification of invalidation-based protocols. In 14th International Conference on Computer Aided Verification, CAV ’02. Lecture Notes in Computer Science, vol. 2404. Springer. Cervesato, I., Durgin, N., Lincoln, P., Mitchell, J., and Scedrov, A. 1999. A Meta-notation for Protocol Analysis. In 12th Computer Security Foundations Workshop (CSFW’99). IEEE Computer Society Press, Mordano, Italy, 55–69. Delzanno, G. 2001. An Assertional Language for Systems Parametric in Several Dimensions. In Verification of Parameterized Systems - VEPAS 2001. ENTCS, vol. 50. Delzanno, G. 2005. Constraint Multiset Rewriting. Tech. Rep. TR-05-08, Dipartimento Informatica e Scienze dell’Informazione, Università di Genova, Italia. Delzanno, G. and Podelski, A. 1999. Model checking in CLP. In Proceedings 5th International Conference on Tools and Algorithms for Construction and Analysis of Systems (TACAS’99). Lecture Notes in Computer Science, vol. 1579. Springer-Verlag, Amsterdam, The Netherlands, 223–239. Finkel, A. and Schnoebelen, P. 2001. Well-Structured Transition Systems Everywhere! Theoretical Computer Science 256, 1-2, 63–92. German, S. M. and Sistla, A. P. 1992. Reasoning about Systems with Many Processes. Journal of the ACM 39, 3, 675–735. Gordon, A. D. 2001. Notes on nominal calculi for security and mobility. In Foundations of Security Analysis and Design, Tutorial Lectures. Lecture Notes in Computer Science, vol. 2171. Springer, 262–330. Kesten, Y., Maler, O., Marcus, M., Pnueli, A., and Shahar, E. 2001. Symbolic model checking with rich assertional languages. Theoretical Computer Science 256, 1, 93–112. Schnoebelen, P. 2002. Verifying Lossy Channel Systems has Nonprimitive Recursive Complexity. Information Processing Letters 83, 5, 251–261. Appendix A Symbolic Predecessor Operator Given a set of MSRN C configurations S, consider the MSRN C predecessor operator P re(S) = {M|M ⇒MSR M′ , M′ ∈ S}. In our assertional language, we can define a symbolic version SP reN C of P re defined on a set S containing MSRN C constrained 26 Giorgio Delzanno multisets (with disjoint variables) as follows: SP reN C (S) = { (A ⊕ N : ξ) | (A −→ B : ψ) ∈ R, (M : ϕ) ∈ S, M′ 4 M, B ′ 4 B, (M′ : ϕ) =θ (B ′ : ψ), N = M ⊖ M′ , ξ ≡ (∃x1 . . . . xk .θ) and x1 , . . . , xk are all variables not in A ⊕ N }. where =θ is a matching relation between constrained configurations that also takes in consideration the constraint satisfaction, namely (A1 | . . . | An : ϕ) =θ (B1 | . . . | Bm : ψ) provided m = n and there exists a permutation j1 , . . . , jn of 1, . . . , n such that Vn the constraint θ = ϕ ∧ ψ ∧ i=1 Ai = Bji is satisfiable; here p(x1 , . . . , xr ) = q(y1 , . . . , ys ) is an abbreviation for the constraints x1 = y1 ∧ . . . ∧ xr = ys if p = q and s = r, f alse otherwise. As proved in (Delzanno 2005), the symbolic operator SP reN C returns a set of MSRN C constrained configurations and it is correct and complete with respect to P re, i.e., [[SP reN C (S)]] = P re([[S]]) for any S. It is important to note the difference between SP reN C and a simple backward rewriting step. For instance, given the constrained configurations M defined as p(x, z) | f (y) : z > y and the rule s(u, m) | r(t, v) → p(u′ , m′ ) | r(t′ , v ′ ) : u = t, m′ = v, v ′ = v, u′ = u, t′ = t (that simulates a rendez-vous (u, t are channels) and value passing (m′ = v)), the application of SP re returns s(u, m) | r(t, v) | f (y) : u = t, v > y as well as s(u, m) | r(t, v) | p(x, z) | f (y) : u = t, x > y (the common multiset here is ǫ).
2cs.AI
The Shape of Art History in the Eyes of the Machine∗ Marian Mazzone2 Bingchen Liu1 Diana Kim1 Mohamed Elhoseiny1 The Art and Artificial Intelligence Laboratory 1 Department of Computer Science, Rutgers University, NJ, USA 2 Department of Art History, College of Charleston, SC, USA arXiv:1801.07729v2 [cs.AI] 12 Feb 2018 Ahmed Elgammal1† Abstract How does the machine classify styles in art? And how does it relate to art historians’ methods for analyzing style? Several studies have shown the ability of the machine to learn and predict style categories, such as Renaissance, Baroque, Impressionism, etc., from images of paintings. This implies that the machine can learn an internal representation encoding discriminative features through its visual analysis. However, such a representation is not necessarily interpretable. We conducted a comprehensive study of several of the state-of-the-art convolutional neural networks applied to the task of style classification on 77K images of paintings, and analyzed the learned representation through correlation analysis with concepts derived from art history. Surprisingly, the networks could place the works of art in a smooth temporal arrangement mainly based on learning style labels, without any a priori knowledge of time of creation, the historical time and context of styles, or relations between styles. The learned representations showed that there are few underlying factors that explain the visual variations of style in art. Some of these factors were found to correlate with style patterns suggested by Heinrich Wölfflin (1846-1945). The learned representations also consistently highlighted certain artists as the extreme distinctive representative of their styles, which quantitatively confirms art historian observations. Keywords: Artificial Intelligence — Computational Art History ∗ This paper is an extended version of a paper that will be published on the 32nd AAAI conference on Artificial Intelligence, to be held in New Orleans, USA, February 2-7, 2018 † Corresponding author: Ahmed Elgammal [email protected] 1 Art history could prove “to contain unexpected potentialities as a predictive science” – George Kubler, The Shape of Time: Remarks on the History of Things, 1962. 1 Introduction Style is central to the discipline of art history. The word “style” is used to refer to the individual way or manner that someone makes or does something, for example Rembrandt’s style of painting. Style also refers to groups of works that have a similar typology of characteristics, such as the Impressionist style, or High Renaissance style. Art historians identify, characterize, and define styles based on the evidence of the physical work itself, in combination with an analysis of the cultural and historical features of the time and place in which it was made. Although we see style, and we all know that it exists, there is still no central, agreed upon theory of how style comes about, or how and why it changes. Some of the best scholars of art history have written persuasively about the importance of style to the discipline, and the concomitant difficulty of defining or explaining what it is and why it changes [1, 2]. Up to now connoisseurship has proven to be one of the most effective means to detect the styles of various artists, and differentiate style categories and distinctions in larger movements and periods. Recent research in computer vision and machine learning have shown the ability of the machine to learn to discriminate between different style categories such as Renaissance, Baroque, Impressionism, Cubism, etc., with reasonable accuracy, (e.g. [3, 4, 5, 6]). However, classifying style by the machine is not what interests art historians. Instead, the important issues are what machine learning may tell us about how the characteristics of style are identified, and the patterns or sequence of style changes. The ability of the machine to classify styles implies that the machine has learned an internal representation that encodes discriminative features through its visual analysis of the paintings. However, it is typical that the machine uses visual features that are not interpretable by humans. This limits the ability to discover knowledge out of these results. Our study’s emphasis is on understanding how the machine achieves classification of style, what internal representation it uses to achieve this task, and how that representation is related to art history methodologies for identifying styles. To achieve such understanding, we utilized one of the key formulations of style pattern and style change in art history, the theory of Heinrich Wölfflin (1846-1945). Wölfflin’s comparative approach to formal analysis has become a standard method of art history pedagogy. Wölfflin chose to separate form analysis from discussions of subject matter and expression, focusing on the “visual schema” of the works, and how the “visible world crystallized for the eye in certain forms” [7]. Wölfflin identified pairs of works of art to demonstrate style differences through comparison and contrast exercises that focused on key principles or features. Wölfflin used his method to differentiate the Renaissance from the Baroque style through five key visual principles: linear/painterly, planar/recessional, closed form/open form, multiplicity/unity, absolute clarity/relative clarity. Wölfflin posited that form change has some pattern of differentiation, such that style types and changes can only come into being in certain sequences. With advances in computer vision and machine learning and the availability of comprehensive datasets of images, we are now positioned to approach the history of art as a predictive science, and relate its means of determining questions of style to machine results. Lev Manovich has argued that the use of computational methods, while providing a radical shift in scale, in fact continues the humanities’ traditional methodologies [8]. It was nearly impossible to apply and empirically test 2 Wölfflin’s methods of style differentiation and analysis before developments in computer science. No human being would assemble the number of examples needed to prove the value of his methods for finding discriminative features. Nor could anyone amass the dataset necessary to demonstrate the usefulness of his model for processing style description and sequencing beyond the immediate examples of Renaissance and Baroque via his five pairs. We chose Wölfflin’s theory because of his emphasis on formal, discriminative features and the compare/contrast logic of his system, qualities that make it conducive to machine learning. Today, art historians use a wide variety of methods that are not only solely focused on form, but for the type of analysis of this paper Wölfflin’s approach is useful. Methodology Deep convolutional neural networks have recently played a transformative role in advancing artificial intelligence [9]. We evaluated a large number of state-of-the-art deep convolutional neural network models, and variants of them, trained to classify styles. We focused on increasing the interpretability of the learned presentation by forcing the machine to achieve classification with a reduced number of variables without sacrificing classification accuracy. We then analyzed the achieved representations through linear and nonlinear dimensionality reduction of the activation space, visualization, and correlation analysis with time and with Wölfflin’s pairs. We used a collection of 77K digitized paintings to train, validate and test the models. We utilized two sets of digitized paintings for visualization and correlation analysis of the achieved representations. In particular, we used variants of AlexNet [10], VGGNet [11], ResNet [12], which were originally developed for the task of object categorization for the ImageNet challenge [13] and each of them raised the state of the art in that task when they were introduced. We adapted these networks for classifying 20 style classes. Our study included varying the training strategies (training from scratch on art data vs. using pre-trained models and fine-tuning them on art data), varying the network architecture, and data augmentation strategies. Main Results Trained to predict styles, based only on noisy discrete style labels, without being given any notion of time, the machine encoded art history in a smooth chronology. The learned representation can be explained based on a handful of factors. The first two modes of variations are aligned with the concepts of linear vs. painterly and planer vs. recessional suggested by Heinrich Wölfflin (18461945), and quantitatively explain most of the variance in art history, where temporal progression correlates radially across these modes (See Figure 1). The importance of these results is that they show that the selected art historian’s theories about style change can be quantifiably verified using scientific methods. The results also show that style, which appears to be a subjective issue, can be computationally modeled with objective means. 3 A Monet Renoir Sisley Cézanne Cézanne Marc Picasso Sisley Picasso Gris Manet Braque Goya Rubens Malevich Velázquez Rembrandt Warhol Rembrandt Van Eyck Raphael Malevich Da Vinci B C Rothko Mondrian Correla'on)with) Wölfflin's)concepts) Raphael 2% 1% !0.6% !0.5% !0.4% !0.3% !0.2% !0.1% 0% 0.1% 0.2% 0.3% 0.4% 1% 2% Absolute%vs%Rela6ve% Clarity% 0.0015% 0.198% Mul6plicity%vs%Unity% !0.0302% 0.2267% Planer%vs%Recession% !0.4946% !0.0736% Close%vs%Open% 0.2448% 0.1724% Linear%vs%Painterly% !0.2336% 0.3547% Figure 1: Modes of variations of the activation subspace showing smooth temporal transition and correlation with Wölfflin’s concepts. (A) First and second modes of variations of the AlexNet+2 model with paintings color-coded by date of creation. The first mode (the horizontal axis) seems to correlate with figurative art, which was dominant till Impressionism, vs. non-figurative, distorted figures, and abstract art that dominate 20th century styles. Another interpretation for this dimension is that it reflects Wölfflin’s concept of plane (to the right) vs. recession (to the left). This axis correlates the most with Wölfflin’s concept of plane vs. recession with -0.50 PCC. The vertical axis correlates with the linear (towards the bottom) vs. painterly (towards the top) concept (0.36 PCC). (B) The angular coordinate exhibits strong correlation with time (PCC of 0.69). (C) Correlation with Wölfflin’s concepts. 4 2 Detailed Methodology 2.1 Challenges with Art Style Classification In contrast to the typical object classification in images, the problem of style classification in art has a different set of challenges that we highlight here. Style is not necessarily correlated with subject matter, which corresponds to existence of certain objects in the painting. Style is mainly related to the form and can be correlated with features at different levels, low, medium and high-level. As a result, it is not necessary that networks which perform better for extracting semantic concepts, such as object categories, would be perform as well in style classification. In the literature of object classification, deeper networks were shown to perform better [11, 12] since they facilitate richer representations to be learned at different levels of features. We do not know if a deeper network will necessarily be better in the style classification domain. This remains something to discover through our empirical study. However, the challenge, in the context of art style classification, is the lack of images on a scale of magnitude similar to ImageNet (million of images). The largest publicly available dataset, which we use, is only in the order of 80K images. This limitation is due to copyright issue, which is integral to the domain of art. Moreover, collecting annotation in this domain is hard since it requires expert annotators and typical crowd sourcing annotators are not qualified. Another fundamental difference is that styles do no lend themselves to discrete mutually exclusive classes as in supervised machine learning. Style transition over time is typically smooth, and style labels are after-the-fact concepts imposed by art historians, sometimes centuries later. Paintings can have elements that belongs to multiple styles, and therefore not necessarily identifiable with a unique style class. Paintings also come in wide variety of sizes. The canvas can span a couple of hundreds of square feet or can be as small as a couple of square inches. The aspect ratio can vary very significantly as well. A typical CNN requires its input to be resized to a fixed size retinal array. This bound to introduce geometric distortions, which can affect the composition, and loss of details related to surface texture carrying essential information about brush strokes. Both composition and brush strokes are essential to identify style. In this paper we do no address solving these issues. We mainly report the behavior of the studied model for style classification despite their limitation to address these issues. 2.2 Datasets Training-testing Set: We trained, validated, and tested the networks using paintings from the publicly available WikiArt dataset1 . This collection (as downloaded in 2015) has images of 81,449 paintings from 1,119 artists ranging from the fifteenth century to contemporary artists. Several prior studies on style classification used subsets of this dataset (e.g. [4, 5, 6]). Originally WikiArt has 27 style classes. For the purpose of our study we reduced the number of classes to 20 classes by merging fine-grained style classes with small number of images, for example we merged cubism, analytical cubism, and synthetic cubism into one cubism class. Table 1 shows a list of the 20 style classes used and their mapping from the original WikiArt classes. We also ignored the symbolism 1 Wikiart dataset http://www.wikiart.org 5 style class since in the Wikiart collection this class contains various paintings from different styles that erroneously labeled as “symbolism”. In general, by visual inspection we notice that the style labels in the WikiArt collection is noisy and not accurate. However, it remains the largest publicly available collection. Other available collections, which might be cleaner in their labels, are typically much smaller in size for the purpose of training a deep network. We excluded from the collections images of sculptures and photography. The total number of images used for training, validation, and testing are 76,921 images. We split the data into training (85%), validation (9.5%) and test sets (5.5%). Table 1: Style classes used in learning the models 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Style Class Early Renaissance High Renaissance Mannerism and Late Renaissance Northern Renaissance Baroque Rococo Romanticism Impressionism Post-Impressionism Realism Art Nouveau Cubism Expressionism Fauvism Abstract-Expressionism Color field painting Minimalism Naı̈ve art-Primitivism Ukiyo-e Pop-art Total number of Images Number of Images 1391 1343 1279 2552 4241 2089 7019 13060 6965 11528 4334 2562 6736 934 2881 1615 1337 2405 1167 1483 76921 Merged styles Post Impressionism+Pointillism Realism + Contemporary Realism + New Realism Cubism + Analytical Cubism + Synthetic Cubism Abstract Expressionism & Action Painting Visualization Set I: We used another smaller dataset containing 1485 images of paintings from the Artchive dataset2 to analyze and visualize the representation. Previous researches that have used this dataset (e.g. [5]). We denote this dataset in this paper as the “Visualization dataset I”. While the WikiArt collection is much bigger in size, this dataset contains a better representation of the important works of western art from 1400-2000AD by 60 artists. Therefore, we mainly use it to visualize and analyze the learned representation. We excluded from the collections images of sculptures and images containing partial details of paintings. We also collected art historian’s rating annotations (scale of 1 to 5) for each of the Wölfflin’s pairs for 1000 paintings from this data set and use it in our correlation analysis. Visualization Set II: We also used 62K painting from the Wikiart dataset for visualization and analysis of the representations. We only included paintings that have date annotations for the purposes of visualization and temporal correlation. The two chosen visualization sets have complementary properties. While the Artchive visualization set represents knowledge about influential and important artists, the Wikiart is more arbitrarily chosen based on what is available in the public 2 Artchive dataset http://www.artchive.com 6 domain. The Artchive dataset lacks paintings from the 18th century and does not have broad sampling of early 19th paintings or post-war 20th century. In contrast, the Wikiart dataset is lacking certain works of art that art historians would consider important, nevertheless it densely samples a broad range of styles. In addition, the Wikiart dataset has a large bias towards 20th century art and post WWII works. 2.3 Studied Deep Learning Models: We performed a comprehensive comparative study on several deep convolutional networks, adapted for the task of style classification. For the purpose of this paper, we report the results of three main networks: AlexNet [10], VGGNet [11], and ResNet [12], as well as variants of them. All these models were originally developed for the task of object recognition for the ImageNet challenge [13] and each of them raised the state of the art when they were introduced. For the non-expert reader, here we briefly summarize the main features of each of these models. Deep convolutional networks in general consist of a sequence of layers of artificial neural units of different types. Convolutional layers apply learned filters (templates) to each location of its input image. These convolutional layers are interleaved with pooling layers, which aggregate the responses of the convolution layers. Typically, the sequence of convolution and pooling layers results in re-representing the visual information in the image as responses to a large number of learned filters applied to wider and wider regions of the image as the information propagates deeper in the network. Such filters are learned or tuned by the machine in response to the task in hand. Finally the responses are passed to a sequence of fully connected layers that acts as a classifier. AlexNet [10] architecture consists of five consecutive convolution layers, interleaved with some pooling layers, followed by three fully connected layers, resulting in 1000 nodes representing the object classes in ImageNet. The convolutional filters have different sizes at each layer, starting from big filters (11x11) and reduced the filter size at following layers. In contrast VGGNet [11] adapted an architecture of fixed size filters (3x3) over a deeper sequence of convolutional layers. Residual Networks (ResNet [12]) introduced shortcut connection between the convolution layers outputs and later layers, which results in much deeper architectures, reaching over 150 layers. In our study, in general for all the models, the final softmax layer, originally designed for the 1000 classes in ImageNet, was removed and replaced with a layer of 20 softmax nodes, one for each style class. Two modes of training were evaluated, 1) training the models from scratch on the Wikiart data set, described above; 2) using a pre-trained model with ImageNet data and finetuned on the Wikiart data. Fine-tuning is the standard practice when adapting well-performing pre-trained models to a different domain. 2.4 Increasing the interpretability of the representation Having a large number of nodes at the fully connected layer allows the representation to project the data into a very high dimensional space where classification would be easy (especially in our case with only 20 classes), without forcing similar paintings across styles to come closer in the representation. To increase the interpretability of the representation, we force the network to achieve classification through a lower dimension representation. To achieve this, after training the network (whether from scratch or through fine-tuning), two more fully connected layers were added with a reduced number of nodes. These reduced dimensional layers force the representation to use a 7 smaller number of degrees of freedom, which in turn forces paintings across styles to come closer in the representation based on their similarity. In particular, we added two layers with 1024 and 512 nodes to all the models, and the models were then fine-tuned to adjust the weights for the new layers. As will be shown later, adding these dimensionality reduction layers did not affect the classification accuracy. The experiments showed that gradually reducing the number of nodes in the fully connected layers forced the network to achieve a “smoother” and interpretable representation. It is important to emphasize that to achieve this effect without reducing the accuracy; the two new layers have to be added after the network is trained, then models are fine-tuned. Training the full architecture with the two extra layers, whether from scratch of fine-tuned, typically doesn’t result in converging to similar accuracy. We analyzed the modes of variations in the activation of each layer of the learned representation using Principle component analysis (PCA) [14]. We also analyzed the activation space using Independent Component Analysis (ICA) [15]. We analyzed the nonlinear manifold of activations through Laplacian Eigen Embedding (LLE) [16]. We chose these two techniques as widely used representatives of linear and nonlinear dimensionality reduction techniques, each providing a different insight about the learned representation. We also performed correlation analysis between the dimensions of the activation space and time as well as ground truth for Wölfflin’s concepts. 3 Quantitative Comparative Results Table 2 shows the classification accuracy of different models using both pre-training with finetuning, and training from scratch. In all cases, the pre-trained and fine-tuned networks achieved significantly better results than their counterparts that are trained from scratch (7% to 18% increase). This is not surprising and consistent with several models that adapted and fine-tuned pre-trained networks for different domains. However, learned filters when the network trained from scratch on the art domain were significantly different from the ones typically learned on ImageNet, which typically shows Gabor-like and blob-like filters. Figure 2 shows visualization of the filters of AlexNet when trained on ImageNet compared to same filters trained on WikiArt for style classification. While it is hard to interpret the filters trained for style classification, we do not observe oriented-edge-like filters except for a horizontal edge filter. This emphasizes the difference in nature between the problems and suggests that the better performance of the fine-tuned models could be out-performed if sufficient data is available to train a style-classification network from scratch on art data only. Table 2: Comparison of classification of different models and different training methodologies Network AlexNet AlexNet+2 VGGNet VGGNet+2 ResNet ResNet+2 Architecture Original:5 Conv layers+3 FC layers Adding 2 reduced FC layers 13 Conv layers + 3 FC layers Adding 2 reduced FC layers 152 Conv layers 50 Conv layers 152 Conv layers +2 reduced FC layers 50 Conv layers + 2 reduced FC layers Trained from scratch 48.1% 47.2% 51.6 % 55.2% Pre-trained & Fine-tuned 58.2% 58.3% 60.1% 62.8% 63.7% 45.0% 60.2% 48.0% 8 Figure 2: Comparison of the filters learned on object classification vs style classification. Left: Typical filters of AlexNet trained on ImageNet for object classification. Center and Right: Filters of AlexNet trained for style classification using 11x11 and 7x7 dim filters. Increasing the depth of the network only added no more than 5% to the accuracy from AlexNet with 5 convolutional layers to ResNet with 152 convolutional layers. In the case for learning from scratch, increasing the depth did not improve the results where a ResNet with 50 layers performed worse than an AlexNet with only 5 convolution layers. VGGNet with 13 convolutional layers performed only 2-3% better than AlexNet. Increasing the depth of VGGNet did not improve the results. This limited gain in performance with increase in depth, in conjunction with the difference in the learned filters, suggests that a shallow network might be sufficient for style classification along with better filter design. Effect of adding layers with reduced dimensionality: The experiments showed that adding extra fully connected layers while gradually reducing the number of nodes in them forces the networks to achieve a “smoother” and more interpretable representation. Having a large number of nodes at the fully connected layers allows the representation to project the data into a very high dimensional space where classification would be easy (specially in our case with only 20 classes), without necessarily enforcing similar paintings across styles to come closer in the representation based on their similarity. We quantified this phenomenon by examining the dimensionality of the subspace of the activation (using Principle Component Analysis (PCA [14]) of the visualization dataset using two measures: 1) The number of components needed to preserve 95% of the variance. 2) The variance retained with the first two PCA dimensions. We also evaluated the accuracy of the expanded models to see if the added reduced layers resulted in any loss of accuracy. In most of the cased the added layers enhanced the accuracy (see Table 2) Table 3 shows that adding two reduced-dimension layers effectively and consistently reduced the dimensionality of the subspace of the data while preserving the classification accuracy. The reduction is significant for AlexNet where 9 or 10 dimensions retained 95% of the variance compared to 201 and 397 dimensions for the cases of fine-tuned and learned from scratch networks respectively, with around 60% of the variance retained in the first two dimension. Interestingly, the representation achieved by VGGNets already has reduced dimension subspaces compared to 9 Table 3: The effect of adding two reduced dimension layers on the representation (subspace dimensionality and variance) Model Training Strategy number of nodes 4096 AlexNet Original Architecture subspace dim 1 retained variance 2 201 21.71 Adding two dimensionality reduction layers number of nodes subspace dim1 retained variance2 512 9 59.64 Pre-trained & Finetuned AlexNet From Scratch 4096 397 35.62 VGGNet Pre-trained 4096 55 49.52 & Finetuned VGGNet From Scratch 4096 36 51.16 ResNet Pre-trained 20483 491 17.53 & Finetuned 1 Subspace dim: Number of principle components cumulatively retaining 95% of variance. 2 Retained variance: Percentage of variance retained by the first two principle components. 3 ResNet does not have FC layers. This is the number of the nodes in the last pooling layer. 100   512 512 10 7 62.78 66.87 512 512 7 6 72.52 73.71 100   90   90   AlexNet+2  Finetuned   80   80   AexNet+2  From  Scratch   70   50   AlexNet  Finetuned   60   AexNet  From  Scratch   50   VGG+2  Finetuned   60   70   VGG  Finetuned   40   VGG  From  scratch   30   VGG+2  From  scratch   ResNet  Finetuned   20   40   ResNet+2  Finetuned   10   30   0   1   2   3   4   5   6   7   8   9   10   1   2   3   4   5   6   7   8   9   10   Figure 3: Cumulative retained variance by the first 10 PCA dimensions of the activation space at last FC layer (512 nodes). Left: models after adding the dimensionality reductions layers. Right: the original models. the AlexNet and ResNet. However, adding the reduced dimension layers for VGG significantly lowered the subspace dimension (only 7 dimensions retain 95% of the variance) while improving its classification accuracy between 2-4%. The maximum reduction in subspace dimensionality was in ResNet where the dimension of the subspace retaining 95% of the variance was reduced from 491 to only 6 with 74% of the variance in the first two dimensions. Figure 3 shows the cumulative retained variance for the first 10 PCA dimensions of the activation subspace for all the models before and after adding the two reduced dimensions layers. 4 Shape of Art History: Interpretation of the Representation This section focuses on analyzing, visualizing, and interpreting the activation space induced by the different networks after trained to classify style. We define the activation space of a given fully connected layer as the output of that layer prior to the rectified linear functions. In particular, in this paper, we show the analysis of activation of the last reduced dimension fully connected layer prior to the final classification layer, which consists of 512 nodes. We use the activations before the rectified linear functions in all the networks. 10 Few Factors Explain the Characteristics of Styles: The learned representation by the machine shows that there are a few underlying factors that can explain the characteristics of different styles in art history. Using Principle Component Analysis, we find that only fewer than 10 modes of variations can explain over 95% of the variance in the visualization set in all of the studied models with additional reduced fully connected layers. In ResNet and VGGNet the number of these modes is as low as 6 and 7 respectively. In all of the networks, the first two modes of variations explained from 60% to 74% from the variance in the various models in visualization set I (Table 3). Moreover, it is clear from the visualizations of both the linear and nonlinear embedding of the activation manifold in various models that art dated prior to 1900 lie on a plane (subspace of dimension 2). Consistent results are achieved by analyzing the 62K painting from the Wikiart data set where it was found that subspaces of dimensions 10, 9 and 7 retain 95% of the variance of the activation for AlexNet+2, VGGNet+2, ResNet+2 respectively (Table 5). The consistency of results in all the studied networks and the two datasets (varying in size from ≈ 1500 to 62K paintings) imply that the existence of a small number of the underlying factors explaining the representation is an intrinsic property of art history, and not just an artifact of the particular dataset or model. We will start our interpretation of these dimensions by investigating the time correlation with these dimensions, followed by correlation analysis with Wölfflin’s concepts. Table 4: Temporal correlation with the first two PCA dimensions and the first LLE dimensions of the activation space in different models model AlexNet+2 VGGNet+2 ResNet+2 training Fine-tuned From scratch Fine-tuned From scratch Fine-tuned Pearson correlation coefficient with time 1st PCA dim 2nd PCA dim Radial 1st LLE dim 0.4554 0.5545 0.6944 0.7101 -0.5797 0.2829 0.6697 0.6723 -0.2462 0.5316 0.5659 -0.4012 0.5781 0.3165 0.6239 -0.6532 -0.6559 0.4579 0.7712 0.8130 Smooth Temporal Evolution of Style: All the learned representations show smooth transition over time. Figure 4 shows the paintings in the visualization set I, projected into the first two modes of variations of the activations of the last reduced dimension fully connected layer for different networks. The paintings are color-coded based on their date of creation. The plots consistently show that the networks learned smooth temporal representations that reflect the historical progress in style. This is despite the fact that the networks are trained only with images and their discrete style labels. No information was provided about when each painting was created, when each style took place, which artist created which painting, nor how styles are related (such as style x is similar to style y, or came after or before style z). Despite the lack of all this information, the learned representations are clearly temporally smooth and reflect high level of correlation with time. Visualizing these modes of variations reveals very interesting ways of how the networks arrange the data in a temporal way. For example, for the case of AlexNet+2 model, as shown in Figure 1-A, 11 Figure 4: First two modes of variations of different learned representations and their temporal correlations. Every point is a painting, color-coded by the year of creation. Dataset: VS-I. the data is arranged in the plot in a radial clock-wise way around the center to make a complete circle in this 2D projection starting with Renaissance and ending with Abstract Art. We can see the progress following the plot in a clock-wise way from Italian and Northern Renaissance at the bottom, to Baroque, to Neo-classicism, Romanticism, reaching to Impressionism at the top 12 followed by Post impressionism, Expressionism and Cubism. The cycle completes with Abstract and Pop Art. The explanation of how the network arranged the representation this way will become clearer next when we show the results of nonlinear activation manifold analysis. We quantified the correlation with time in different ways. We measure the Pearson Correlation Coefficients (PCC) with each of the principle components, as well as with each dimension of the nonlinear manifold embedding. Table 4 shows the temporal correlation using PCC with the first two PCA dimensions and the first LLE embedding dimension for different models. We also computed the correlation of the radial coordinate – of each painting in the projection to the first two principle components– with time. The temporal correlation obtained in the representation is consistent among the different networks. Taking a fine-tuned AlexNet+2 as example, the first two dimensions have very strong correlation with time, 0.46 and 0.55 Pearson correlation coefficients respectively. A linear combination of these two dimensions with convex weights proportional to their Pearson correlation coefficients results in a single dimension that has 0.71 correlations with time (Figure 1-B). This cycle around the plot from Renaissance till abstraction and Pop art suggests that the angular coordinate around the plot would reflect correlation with time. In fact the angular coordinates have a PCC of 0.69 with time. The strongest temporal correlation is in the case of ResNet with 0.76 PCC radial correlations. This conclusion is consistent among all the networks that we tested. This conclusion shows that style changes smoothly over time and proves that noisy discrete style labels are enough for the networks to recover temporal arrangement, due mainly to visual similarities as encoded through the learned representation in a continuous activation space. Strong temporal correlation also exists with the modes of variations in Visualization set-II. However, in this case, it is not necessarily the first two modes of variation that are the ones with the highest temporal correlation. This is due to the bias in this dataset towards 20th century work. Table 5 shows the PCC with time for each of the dimensions for three fine tuned networks. Table 5: Analysis of the modes of variations of the activations on 62K paintings from the Wikiart collection in three models and their correlation with time (Pearson Correlation Coefficients) . The top two time-correlated modes are highlighted in bold. Subspace Dim 1 Retained Variance 2 Correlation with time 1 2 3 4 5 6 7 AlexNet+2 10 51.13 0.12 0.66 0.24 -0.43 -0.23 0.04 0.08 VGGNet+2 9 43 -0.15 -0.14 -0.46 -0.07 -0.59 0.28 0.02 ResNet+2 7 66.80 -0.03 -0.72 0.20 0.22 0.30 -0.01 0.06 1 Subspace Dim: Number of principle components retaining 95% of the variance 2 Retained Variance: Variance retained by first two dimensions 8 -0.05 0.07 9 -0.03 0.02 10 0.00 Interpretation of the Modes of Variations - Relation to Wölfflin’s Pairs: Visualizing the modes of variations reveals very interesting ways of how the networks were able to consistently capture evolution and characteristics of styles. Here we take the fine-tuned AlexNet+2 as example, however similar results can be noticed in other models. The first mode (the horizontal axis in Figure 1) seems to correlate with figurative art, which was dominant till Impressionism, vs. non-figure, distorted figures, and abstract art that dominates 20th century styles. Another interpretation for this dimension is that it reflects Wölfflin’s concept of planar (to the right) vs. 13 recession (to the left). This axis correlates the most with Wölfflin’s concept of planar vs recession with -0.50 Pearson correlation coefficient. To a lesser degree, this horizontal axis correlates with closed vs. open (0.24 PCC) and linear vs. painterly (-0.23 PCC). This quantitative correlation can be clearly noticed by looking at the sampled paintings shown in Figure 1, where we can see that the horizontal axis is characterized by planar, open, and linear form to the right (as in Cubism, and Abstract) vs. recession, closed, and painterly to the left (as appears in some of the Baroque paintings at the extreme left) Table 6: Correlation with Wölfflin’s concepts. Pearson Correlation Coefficient of the first two PC dimensions and the first two LLE dimensions of the activation space and Wölfflin’s concepts. The concepts with maximum correlation with each dimension are shown. Model AlexNet+2 VGGNet+2 ResNet+2 Training Fine-tuned From scratch Fine-tuned From scratch Fine-tuned Pearson correlation coefficient(absolute values) with Wölfflin’s concepts 1st PCA dim 2nd PCA dim 1st LLE dim 2nd LLE dim Planar vs. Linear vs. Planar vs. and Linear vs. Recession Painterly Recession Painterly 0.4946 0.3579 -0.501 0.3216 0.5129 0.3272 0.4930 -0.3111 0.3662 0.2638 0.4512 0.2646 0.4621 0.4000 0.4897 0.3174 0.5314 0.4795 0.5251 0.4158 The second mode of variations (the vertical axis) has 0.36 Pearson correlation coefficient with the linear (towards the bottom) vs. painterly (towards the bottom) concept. We can clearly see the smooth transition from linear form in Renaissance at the bottom towards more painterly form in Baroque to the extreme case of painterly at Impressionism at the top. Then we can see the transition back to linear form in abstract and Pop art styles. Projecting the data into these two dominant modes of variations, which are aligned with plane vs. recession and linear vs. painterly, gives an explanation to why this representation correlates with time in a radial fashion. The correlation between the first two modes of variations and the concepts of planar vs. recession and linear vs. painterly is consistent among all the representations learned by all tested networks, whether pre-trained or trained from scratch. In all cases the first mode of variations correlates the most with the concept of planar vs. recession while the second mode correlates the most with linear vs. painterly. Table 6 shows the Pearson correlation coefficients with these concepts. Full correlation results with all dimensions are shown in the appendix. The fourth and fifth dimensions of AlexNet+2 representation spread away strongly the Renaissance vs Baroque styles and put other styles in perspective to them (Figure 5). The fifth dimension in particular (and the fourth dimension to a lesser degree) correlates with relative vs. absolute clarity, unity vs. multiplicity, open vs. closed, and painterly vs. linear form from top to bottom (with PCC 0.36, 0.30, 0.28, 0.16 respectively). This is consistent with Wölfflin’s theory since he suggested exactly the same contrast between these concepts to highlight the difference between Renaissance and Baroque. In Figure 5-A , the Renaissance style appears at the top (absolute clarity, multiplicity, closed, linear form) while the Baroque appears at the bottom (relative clarity, unity, and open, painterly form). We can see in the figure that Impressionism and Cubism are at the top half of the plot since they share many of these same concepts with Baroque. The fourth dimension seems to separate Impressionism and Cubism to the right from abstraction and Pop art to the left. 14 A Rousseau Van Eyck Durer Van Eyck Van Eyck Mantegna Da Vinci Raphael Rousseau Warhol Raphael Klimt Warhol Da Vinci Lichtenstein Sisley Goya Braque Vermeer B Delacroix Rembrandt Picasso Monet Renoir Velázquez 0.3% 0.2% 0.1% Linear%vs%Painterly% Close%vs%Open% 0% 4% 5% !0.1% Planer%vs%Recession% Mul>plicity%vs%Unity% Absolute%vs%Rela>ve%Clarity% !0.2% !0.3% !0.4% Figure 5: Separation between Renaissance and Baroque: (A) The fourth and fifth modes of variations show separation between Renaissance and Baroque. (B) Correlation between these two modes of variations and Wölfflin’s concepts, which confirms with Wölfflin’s hypothesis. Looking at the 4th, 5th, and 6th dimensions of the embedded activation manifold, we can notice two orthogonal planes characterizing art prior to 1900 (Figure 10). One plane spans Renaissance vs. Baroque while an orthogonal plane spans Impressionism vs. Post-Impressionism. 15 A Renoir Rothko Monet Van Gogh Impressionism Johns Mondrain Cézanne Raphael Post -Impressionism Baroque Cubism Rousseau Rembrandt Picasso Northern Renaissance Velazquez Durer Van Eyck B Impressionism C D E Rubens Baroque Pop Art Naïve art/Primitivism Rousseau F G H Figure 6: The representation could discover distinctive artists for each style. (A)The first three modes of variations of the VGGNet activations. Distinctive artists representing each style are identified by the representation and pulled away from the cloud at the center. (B-E) Factorization of the activation space using Independent Component Analysis into 7 maximally independent axes, which show alignment with styles (more details in Figure 7). (F-H) The top three modes of variations in the VGG network activation of 62K works of art from the Wikiart collection (projected pairwise as dimensions 1-2, 2-3, 3-1 from left to right). 16 Discovering Limitations of Wölfflin’s Concepts: Interestingly, not all modes of variations explaining the data correlate with Wölfflin’s concepts. In all learned representations, one of the first five modes of variation always has close-to-zero linear correlation with all Wölfflin’s concepts. A notable example is the fifth dimension of the embedded activation manifolds, which separates Impressionism from Post-Impressionism, and has almost zero linear correlation with Wölfflin’s pairs (Figure 10). This implies that the separation between these styles is not interpretable in terms of Wölfflin’s pairs. Identification of Representative Artists: Visualizing the different representations shows that certain artists were consistently picked by the machine as the distinctive representatives of their styles, as they were the extreme points along the dimensions aligned with each style. This is visible in the first three modes of variations of the representation learned by the VGGNet, shown in Figure6-A, which retains 77% of the variance . Besides the observable temporal progress, the representation separates certain styles and certain artists within each style distinctively from the cloud at the center as non-orthogonal axes. We can see the Northern Renaissance in the yellow ellipse with the majority of the paintings sticking out being by Van Eyck and Dürer. The Baroque in the black ellipse is represented by Rubens, Rembrandt, and Velzquez. The orange ellipse is Impressionism and at its base are Pissarro, Caillebotte, and Manet as the least painterly of the type, ending with Monet and Renoir as most painterly on the end of the spike. The two red circles are Post-Impressionism, and in particular one is dominated by Van Gogh, and the other by Cézanne who forms the base for the spike of Cubism in the light blue ellipse. This spike is dominated by Picasso, Braque, and Gris; and goes out to the most abstract Cubist works. Most interestingly the representation separates Rousseau, as marked in the green ellipse, which is mainly dominated by his work. Consistent results can be seen when plotting the embedding of the activation of the whole 62K paintings in the Wikiart dataset collection as can be seen in Figure 6 F-H. Applying Independent Component Analysis (ICA) [15, 17] to the activation space results in finding non-maximally independent non-Gaussian orthogonal axes3 . Figure 6 B-E shows the ICA factorization of the VGG network activation space. Here, the same subspace that retains 95% of the variance is factorized by ICA. This results in 7 maximally independent components shown in Figure 6-E. We also show each of these components against the time axis in Figure 7. Some components are aligned with specific styles (A: Baroque, C: Cubism, D: Post-Impressionism, E: abstract art, F: Renaissance) and other components contrast several styles (B and F). This factorization facilitates quantitatively discovering the artists who represent each style, as their works appear as the extreme points on the axes of each style. It also highlights which styles are opposite to each other along each of these axes 4 . 3 Independent Component Analysis (ICA) transforms activation to a new embedding space in which transformed data become statistically independent as much as possible and the ICA achieve this by finding non-orthogonal basis in original activation space maximizing independence criteria. 4 Since the ICA algorithm (Fast ICA [17]) used in this experiment has a limitation to capture over-completeness, which implies existence greater number of fat tails than dimension of the space, our experiment found only some of axes are aligned with styles. However, still the results show that ICA has merits to find some of interesting art historical facts and provide quantitatively measurement of them, such as what art works or which artists are most representative 17 A Impressionism B C Cubism Baroque D Van Eyck Post Impressionism Durer Rousseau Lichtenstein Warhol E F Abstract art H G Renaissance 0.4% 0.3% Linear%vs%Painterly% 0.2% Close%vs%Open% 0.1% Planer%vs%Recession% 0% 1% Raphael El-Greco 2% 3% 4% 5% 6% 7% Mul@plicity%vs%Unity% !0.1% Rothko, Johns !0.2% Absolute%vs%Rela@ve% Clarity% !0.3% Figure 7: Independent component factorization of the activation of VGG network representation achieved by ICA. A-G: Each independent component vs time (1400-2000AD). H: Correlation (PCC) with Wölfflin’s concepts. Some components are aligned with specific styles (A: Baroque, C: Cubism, D: Post-Impressionism, E: abstract art, F: Renaissance) and other components contrast several styles (B and G). The fact that the representation highlights a certain representative artist or artists for each style – among hundreds or thousands of paintings by many artists in each style – emphasizes quantitatively the significance of these particular artists in defining the styles they belong to. Interpretations of the Activation Manifold and Understanding Influences: Using nonlinear dimensionality reduction of the activation allows us to achieve an embedding of the activation manifold of the visualization data sets, which reveals interesting observations as well. In particular we used Local Linear Embedding (LLE) [16]. LLE, as other similar techniques, is based on building a graph of data points, where each point is connected to its nearest neighbors, and using such graph to embed the data to a low dimensional space where it can be visualized. In our case the data points are the activation of a given painting as it goes through the deep network, and measured at the last fully connected layer, and this results in an embedding of the activation within each of styles. 18 manifold. Controlling the number of neighbors of each painting in constructing the graph allows for controlling connections between paintings. If this parameter is set to a small number, this results in accentuating distinctive paintings and trends. If we set this parameter to a large number, we allow more paintings to connect and we can capture the overall trend. The first dimension of the LLE representation of all the models exhibits strong temporal correlation, as shown in Table 4. For example, the first LLE dimension in AlexNet+2 representation has 0.71 PCC with time that of ResNet+2 has 0.81 PCC with time. Also, similar to the modes of variations, the first two LLE dimensions shows strong correlation with Wölfflin’s concepts planar vs. recession and linear vs. painterly respectively, see Table 6. Looking at the representation learned by AlexNet+2, as an example, we can notice that on the surface of the embedded activation manifold, different styles are arranged in the learned representation in a way that reflects their temporal relation as well as stylistic similarity (see Figure 8-A)5 . The temporal relation between styles is not just linear historical order, since elements of some styles can appear later in other styles. For example we can see linear temporal progress from Renaissance, to Baroque, to Romanticism, to Realism to Impressionism. However we can also see direct connection between Renaissance to Post-Impressionism and 20th century styles. This can be explained since the use of linear (vs. painterly) and planar (vs. recessional) concepts in these later styles echo these elements from Renaissance style(Fig 8-B). One interesting connection that is captured in this representation is the arrangement of Cézanne’s work in a way that connects Impressionism to Cubism. We can clearly see in Figures 8-B and 9A that Cézanne’s work acting as a bridge between Impressionism at one side and Cubism and Abstract at the other side. Art historians consider Cézanne to be a key figure in the style transition towards Cubism and the development of abstraction in the 20th century art. This bridge of Cézanne’s painting in the learned representation is quite interesting because that is a quantifiable connection in the data, not just a metaphorical term. We can see branching at Post-Impressionism where Cézanne’s work clearly separates from the other Post impressionist and expressionist works towards the top. This branch continues to evolve until it connects to early Cubist works by Picasso and Braque, as well as abstract works by Kandinsky. Figures 8-B and 9-B show another interesting connection between the Renaissance and modern art as captured by the learned representation. Despite the fact that the structure reflects smooth temporal progression, it is interesting to see outlier to this progression. In particular there are some High Renaissance, Northern Renaissance and Mannerist paintings that stick out of the Renaissance cluster to the left and connect to art from late 19th and early 20th centuries. This is because frequent similarity between art works across time results in pulling influential works of art out of order and placing them closer to the art they may have influenced. We can see in the figure that the works that stick out of the Renaissance cluster at the left and connect to modernity are mainly dominated by some paintings by El-Greco and some paintings by Dürer. Among the paintings by El-Greco that significantly stick out are Laocoön, Saint Ildefonso, View of Toledo, and Pietà. We can also see works by Raphael, Mantegna, and Michelangelo in this group as well. We can accentuate this representation by the reducing the number of neighbors of each painting while constructing the manifold. This small neighborhood construction results in lining up distinctive paintings in thin structures to accentuate trends. This results of this version shown in 5 The representation is achieved by setting the neighborhood size to 100 to capture the overall trend. 19 Figure 8: Interesting connections discovered in the activation manifold. (A) Example of activation manifold of AlexNet+2. Paintings color coded by date on the surface of the activation manifold showing smooth transition over time. (B) Transitions between art movements and important connections. (C) Accentuated version of the manifold highlighting five major styles: Renaissance, Baroque, Impressionism, Cubism, and abstract. 20 Figure 9: Interesting connections. (A) Cézanne’s bridge: we can see branching at PostImpressionism where Cézanne’s work clearly separates from the other Post-Impressionist and Expressionist works towards the top. This branch continues to evolve till it connects to early Cubist works by Picasso and Braque, as well as abstracts works by Kandinsky. All thumbnails without labels in this plot are by Cézanne. (B) The connection between Renaissance and modern styles is marked by the outliers in the temporal progress patterns by certain works by El-Greco, Dürer, Raphael, Mantegna, and Michelangelo. Figure 8-C6 . In this visualization, five distinct styles are clearly accentuated among all the twenty styles that the machine learned: Renaissance, Baroque, Impressionism, Cubism, and Abstract. We show the representative paintings at the tip of each of the five styles, which are in order Raphael’s St. Catherine (1507), Rembrandt’s self-portrait (1640), Monet’s Water Lilies under clouds (1903), Braque’s Violin and Candlestick (1910), and Malevich’s Red Square (1915). Both Cézanne’s bridge and El-Greco/Dürer’s bridge are accentuated in this representation as well. Interestingly, both Cézanne’s connection and El-Greco/Dürer connection appears consistently in the various representations learned by different networks, however manifested in different forms. Another interesting observation is that Cubism appears as very unique style that sticks out of as a singularity in most of the representations. 5 Conclusions and Discussion In this paper we presented the result of a comprehensive study of training various deep convolutional neural networks for the purpose of style classification. We mainly emphasized analyzing the learned representation to get an understanding of how the machine achieves style classification. The different representations learned by the machine using different networks shared striking similarities in many aspects. It is clear that a small numbers of factors can explain most of the 6 The accentuated representation is achieved by setting the neighborhood size to 25 to reduce the connectivity and accentuate the visualization. 21 A B Impressionism Renaissance Baroque Post-Impressionism C D Baroque Baroque Impressionism Post-Impressionism 0.3% E 0.2% Linear%vs%Painterly% 0.1% Close%vs%Open% Planer%vs%Recession% 0% 4% 5% 6% Mul?plicity%vs%Unity% !0.1% Absolute%vs%Rela?ve% Clarity% !0.2% !0.3% Figure 10: Two orthogonal planes characterize art prior to 1900 in the learned Representation. Renaissance-Baroque plane seems orthogonal to the Impressionism-Post-Impressionism plane in the embedding of the activation manifold of fine-tuned AlexNet+2 model is shown. (A,B) Two different view of the 4th, 5th, 6th dimensions are shown. (C) the 4th and 6th dimensions span the Renaissance-Baroque differences. (D) 5th and 6th dimensions. The 5th dimension spans the Impressionism-Post-Impressionism differences. Interestingly, the 5th dimension has very small correlation with Wölfflin’s concepts. (E) Correlation with Wölfflin’s concepts 22 variance in the studied datasets in all the trained models (between 7 and 10 factors explains 95% of the variance), which indicates that a small number of factors encapsulate the characterization of different styles in art history. The results also indicate that the learned representation shows a smooth temporal transition between styles, which the machine discovered without any notion of time given at training. Most interestingly, studying the modes of variations in the representation showed a radial temporal progress, with quantifiable correlation with time, starting at Renaissance, to Baroque, progressing all the way to Impressionism, Post impression, Cubism and closing the loop with 20th century styles such as Abstract and Pop Art coming back close to Renaissance. By studying the correlation between the modes of variations and Wölfflin’s suggested pairs, it was found that, consistently, all the learned models have the first mode of variation correlating the most with the concept of plane vs. recession while the second mode of variation correlates the most with the concept of linear vs. painterly. This correlation explains the radial temporal progress and the loop closure between Renaissance and 20th century styles since they share linearity and planarity in their form. We also studied the activation manifold of the different representation learned by the machine, which also reveal smooth temporal progress captured by the representation as well as correlation with Wölfflin’s concepts. Studying the activation manifolds with different neighborhood structure allowed us to discover different interesting connections in the history of art in a quantifiable way, such as the role of Cézanne’s work as a bridge between a Impressionism and Cubism-Abstract art. Another interesting connection is the connection between Renaissance and modern styles such as Expressionism, Abstract-Expressionism, through the works of El-Greco, Dürer, Raphael, and others. Visualizing the different representations shows that certain artists were consistently picked by the machine as the distinctive representatives of the styles they belong to as they were the extreme points along the dimensions aligned with each style. For example, such distinctively representative artists are Van Eyck and Dürer for Northern Renaissance, Raphael for Italian Renaissance, Rembrandt and Rubin for Baroque, Monet for Impressionism, Cézanne and Van Gogh for Post Impressionism, Rousseau for Nave-Primitivism, Picasso and Braque for Cubism, and Malevich and Kandinsky for Abstract. While this is quite known for art historians, the machine discovered and highlighted these artists, amongst many others in each style, as the distinctive representatives of their styles without any prior knowledge and in a quantifiable way. The networks are presented by raw colored images, and therefore, they have the ability to learn whatever features suitable to discriminate between styles, which might include compositional features, contrast between light and dark, color composition, color contrast, detailed brush strokes, subject matter related concepts. In particular, networks pre-trained on object categorization datasets might suggest potential bias towards choosing subject-matter-related features for classification. However, visualizing the learned representations reveals that the learned representations rule out subject matter as a basis for discrimination. This is clear from noticing the loop closure between Renaissance style, which is dominated with religious subject matter, and modern 20th century styles, such as Abstract, Pop art, and others. In contrast, this loop closure suggests that the basis of discrimination is related to concepts related to the form as suggested by Wölfflin. The implication of the networks ability to recover a smooth temporal progression through the history of art, in absence of any temporal cues given at training, and in absence of any temporal constraints other than putting paintings of the same style closer to each other to achieve classification, suggests that visual similarity is the main factor that forces this smooth temporal representation to 23 evolve, which in turns echoes the smooth transition of style in the history of art. The results of this study highlight the potential role that data science and machine learning can play in the domain of art history by approaching art history as a predictive science to discover fundamental patterns and trends not necessarily apparent to the individual human eye. The study also highlights the usefulness of re-visiting the formal methods in art history pioneered by art historians such as Wölfflin, in the age of data science using tools from computer vision and machine learning. Finally, the study offers insights into the characteristics and functions of style for art historians, confirming existing knowledge in an empirical way, and providing machine-produced patterns and connections for further exploration. References [1] M. Schapiro, Style, Anthropology Today. 287-312 (1953). [2] E. Gombrich, Style, International Encyclopedia of the Social Sciences 15, 352-361 (1968). [3] L. Shamir et al, Impressionism, Expres-sionism, Surrealism: Automated Recognition of Painters and Schools of Art, ACM Trans. Applied Perc., 7(2), (2010). [4] S. Karayev, et al, Recognizing image style, arXiv:1311.3715 (2013). [5] B. Saleh, K. Abe, R. S. Arora, A. Elgammal, Toward automated discovery of artistic influence, Multimedia Tools and Applications 75, 3565-3591 (2016). [6] B. Saleh, A. Elgammal, Large-scale classification of fine-art paintings: learning the right metric on the right features, Int. Journal of Digital Art 2, 71-93(2016). [7] H. Wölfflin, Principles of Art History: The Problem of the Development of Style in Later Art, (Trans MD Hottinger, New York: Dover Publications, Inc. (1950). [8] L. Manovich, Data science and digital art history, Int. J. for Digital Art Hist. 1 (2015) [9] Y. LeCun, Y. Bengio, G. Hinton, Deep learning, Nature, 521(7553), 436-444 (2015). [10] A. Krizhevsky, I. Sutskever, G. E. Hinton, Imagenet classification with deep convolutional neural networks, Adv. in Neur. Info. Process. Sys., 1097-1105 (2012). [11] K. Simonyan, A. Zisserman. Very deep convolutional networks for large-scale image recognition, arXiv:1409.1556 (2014). [12] K. He, X. Zhang, S. Ren, J. Sun, Deep residual learning for image recognition, Proc. of the IEEE Conf. on Comp. Vis. and Patt. Recog. (2016). [13] O. Russakovsky, et al, ImageNet Large Scale Visual Recognition Challenge, Int. Journal of Computer Vision (2015). [14] I. Jolliffe, Principle component analysis, John Wiley & Sons, Ltd, (2002). 24 [15] A. Hyvarinen, J. Karhunen, E. Oja, Independent Component Analysis, J. Wiley New York, (2001). [16] S. T. Roweis, L. K. Saul, Nonlinear dimensionality reduction by locally linear embedding, Science 290.5500, 2323-2326 (2000). [17] A. Hyvrinen, Fast and robust fixed-point algorithms for independent component analysis, IEEE Trans. on Neur. Net. 10.3: 626-634 (1999). 25
1cs.CV
ON TORSION-FREE NILPOTENT LOOPS arXiv:1610.06663v1 [math.GR] 21 Oct 2016 JACOB MOSTOVOY, JOSÉ M. PÉREZ-IZQUIERDO, AND IVAN P. SHESTAKOV Abstract. We show that a torsion-free nilpotent loop (that is, a loop nilpotent with respect to the dimension filtration) has a torsion-free nilpotent left multiplication group of, at most, the same class. We also prove that a free loop is residually torsion-free nilpotent and that the same holds for any free commutative loop. Although this last result is much stronger than the usual residual nilpotency of the free loop proved by Higman, it is proved, essentially, by the same method. 1. Introduction It has been argued [7] that the usual definition of nilpotency in loops, given by Bruck [2] is too weak for the most important properties of nilpotent groups to hold. Indeed, contrary to what happens in the associative case, the successive quotients of Bruck’s lower central series of a general finitely generated loop are not finitely generated; moreover, they do not carry any algebraic structure similar to that of a Lie ring. A different version of the lower central series, designed to eliminate these drawbacks, was introduced in [7] under the name of the commutator-associator filtration (in much greater generality, this definition was later independently stated by Hartl and Loiseau [4]). An important feature of this filtration is its close relationship with the dimension filtration which is defined via the powers of the augmentation ideal in the loop ring. By a theorem of Jennings, If G is a group, the dimension filtration of G collapses after nth term if and only if G is torsion-free nilpotent of class n; the same holds for loops if by nilpotency one understands the nilpotency with respect to the commutator-associator filtration [8]. It is therefore reasonable to call a loop torsion-free nilpotent of class n if its dimension filtration collapses after the nth term. In the present paper we prove two statements that show the usefulness of this notion. Firstly, we show that a torsion-free nilpotent loop of class n has a torsion-free nilpotent left multiplication group of class at most n. This fails to hold for torsion-free nilpotent loops in the sense of Bruck, a counterexample being the free nilpotent (in the sense of Bruck) loop of class two, whose left multiplication group is not nilpotent. We stress that the nilpotency class of the left multiplication group may be strictly less than the class of the loop; examples of such situation will be given. Our second (and most important) result says that a free loop is residually torsion-free nilpotent (and, in particular, residually nilpotent with respect to the commutator-associator 2010 Mathematics Subject Classification. 20N05. Key words and phrases. Loops, nilpotent loops, torsion-free nilpotent loops. The authors acknowledge the support by the Spanish Ministerio de Ciencia e Innovación (MTM201345588-C3-3-P); J. M. Pérez-Izquierdo also thanks support by PHBP14/00110; J. Mostovoy was also supported by the CONACYT grant 168093-F; I. P. Shestakov also acknowledges support by FAPESP, processo 2014/09310-5 and CNPq, processos 303916/2014-1 and 456698/2014-0. 1 filtration). This statement is much stronger than the assertion that free loops are residually nilpotent in the sense of Bruck, proved by Higman in [5], although our proof is an application of the same arguments (Higman was well aware that his methods were stronger than what was necessary for the study of Bruck’s lower central series). A similar result is then proved for free commutative loops. Our main technical tool is the non-associative modification of the Magnus map from the free group on k letters to the group of units in the ring of non-commutative power series in k variables. We will use some very basic facts about loops and about non-associative Hopf algebras as described in [11], although we shall give some definitions in order to fix the notation. 2. Preliminaries 2.1. Torsion-free nilpotent loops. A loop L is a set with a unital, not necessarily associatve, product, such that both left and right multiplications La : L → L, x 7→ ax Ra : L → L, x 7→ xa by any a ∈ L are bijective. In a loop one defines the operations of left and the right division by setting a\x = L−1 a x and x/a = Ra−1 x respectively. With each loop L one associates its left multiplication group LMlt(L): this is the subgroup of the permutation group of L considered as a set, which is generated by the La for all a ∈ L. Extending the loop product in a loop L by linearity to the Q-vector space spanned by L, one obtains the loop algebra QL. In the loop algebra, the augmentation ideal I is the kernel of the homomorphism QL → Q which sends each element of L to 1. The nth power I n of the augmentation ideal is the ideal spanned by the products of at least n elements of I. The nth dimension subloop of L over Q is defined as Dn L = {g ∈ L | g − 1 ∈ I n }. We shall refer to these subloops simply as to dimension subloops, without any mention of the field Q. For each n the subloop Dn L is normal (and fully invariant) in L and each quotient Dn L/Dn+1 L is torsion-free [9]. The loop L is called torsion-free nilpotent of class n if Dn+1 L is trivial while Dn L is not. 2.2. Free loops and the Magnus map. Let x = {x1 , . . . , xn }. The set W (x) of words on x is defined recursively so as to consist of (a) all elements of x and e; (b) all expressions of the form uv, u\v and u/v where u and v belong to W (x). The set W (x) is the free algebra on x with one nullary operation e and three binary operations. The set Comp(w) of components of a word w ∈ W (x) is defined by setting Comp(e) = {e}, Comp(xi ) = {e, xi } when xi ∈ x 2 and Comp(w) = Comp(u) ∪ Comp(v) ∪ {w} if w = uv, u\v or u/v. A word in W (x) is reduced if none of its components is of the form u\(uv), u(u\v), (uv)/v, (u/v)v, u/(v\u), (u/v)\u, ev, e\v, u/e, ue, u/u, or v\v. The free loop F (x) is the quotient of the algebra W (x) by the relations eu = u = ue, u\(uv) = v = u(u\v) and (uv)/v = u = (u/v)v. Each element of F (x) can be represented by a unique reduced word so that W (x) ⊂ F (x); this is a corollary of the Evans Normal Form Theorem [3]. Now, let X = {X1 , . . . , Xn }. Denote by Q{X} the free non-associative algebra on X over Q and let Q{X} be its completion with respect to the degree; elements of Q{X} are non-associative formal power series in the Xi . The power series with non-zero constant term × form a loop Q{X} under multiplication. Explicitly, the operation of the left division in this loop is determined by (1 + B)\(1 + A) = 1 + (A − B) − B(A − B) + B(B(A − B)) − . . . for any power series A and B with no constant term. Notice that in the case when A consists only of terms with right-normed parentheses and B = Xi is one of the generators, (1 + B)\(1 + A) also contains terms with right-normed parentheses only. The Magnus map is the homomorphism × M : F (x) → Q{X} , xi 7→ 1 + Xi . Extending the Magnus map by linearity to any r ∈ QF (x) we see that M(r) has a zero constant term if and only if r lies in the augmentation ideal of QF (x). This implies the following: Lemma 1 ([9]). An element w ∈ F (x) lies in Dn F (x) if and only if M(w) = 1 + terms of degree n and higher. In particular, in order to prove that F (x) is residually torsion-free nilpotent, it is sufficient to show that the Magnus map is injective. This is totally analogous to the associative case where the Magnus map is used to prove that the free group is residually torsion-free nilpotent [6]. However, while in the associative case this is established by a straightforward argument involving the syllable length of w, the non-associative version is somewhat more complex. The Magnus map can be defined, in an entirely analogous fashion, for free commutative loops. Here the algebra Q{X} should be replaced by the free commutative non-associative algebra on X. We shall prove that the commutative Magnus map is also injective, and this will imply that free commutative loops are residually torsion-free nilpotent. 3. The left multiplication group Theorem 2. If L is a torsion-free nilpotent loop of class n, the group LMlt(L) is nilpotent of class at most n. 3 We shall see that there are examples where the class of LMlt(L) is strictly smaller than the class of L. On the other hand, when L is a group, we have LMlt(L) = L and, hence, the class of LMlt(L) is the same as the class of L. The key to the proof of Theorem 2 is the following: Lemma 3. For all a ∈ L and F ∈ γn LMlt(L) we have F (a) ≡ a mod Dn L. Proof. First, let us consider the case when L is the free loop generated by a, x1 , . . . , xn , and F is the n-fold commutator [Lx1 , [. . . , [Lxn−1 , Lxn ]...]]. Then M(F (a)) contains right-normed terms only. By dropping the parentheses we get the associative Magnus map of the element [x1 , [. . . , [xn−1 , xn ]...]] · a in the free group generated by a, x1 , . . . , xn ; this series is of the form 1 + a + terms of degree n and greater. This implies that M(F (a)) is also of the same form. Indeed, the homomorphism of the free non-associative algebra on a certain set of generators onto the free associative algebra on the same generators which “forgets the parentheses” maps the space of the right-normed monomials isomorphically onto the free associative algebra. This proves the lemma in this case. The exact same argument works in the case when L is the free loop generated by a, x1 , . . . , xm , with m ≥ n, and F is a product of arbitrary n-fold commutators in the Lxi . Now, each element F (a) with F ∈ γn LMlt(L) in an arbitrary loop L is a homomorphic image of Fe(a) where Fe is a product of arbitrary n-fold commutators in the Lxi in the free loop generated by a, x1 , . . . , xm , for some m. Since the dimension subloops are respected by loop homomorphisms, the lemma follows.  Theorem 2 is now an easy consequence of Lemma 3. Indeed, if L is torsion-free nilpotent of class n, we have Dn+1 L = {1}. Then, by Lemma 3, for F ∈ γn+1 LMlt(L) and any a ∈ L we have F (a) = a, which means that F is the identity in LMlt(L). Now, let us consider several examples. Proposition 4. Let L be the commutative loop whose elements are pairs of integers (p, q) with    ′  p p ′ ′ ′ ′ . (p, q) · (p , q ) = p + p , q + q + 2 2 Then L is torsion-free nilpotent of class 4, with D2 L = D3 L = D4 L = {(0, q) | q ∈ Z}, while LMlt(L) is nilpotent of class 3. Proof. From what follows it should become clear that L is the reduction of the free commutative loop on one generator modulo D5 and the argument is based on the Magnus map. Let L2 = {(0, q) | q ∈ Z} ⊂ L. It is clear that L2 is a normal subloop of L (in fact, it is the centre of L) and the quotient L/L2 is abelian and torsion-free. It follows that Di L ⊂ L2 for i > 1. It can be seen directly that (0, 1) ∈ D4 L. Indeed, if X = (1, 0) − 1 ∈ I, we have (0, 1) − 1 = (4, 0)\((4, 1) − (4, 0)) = (4, 0)\(X 2X 2 − X 3 X), 4 which is readily seen to lie in I 4 ; see also Lemma 1 of [9]. (We can write X 3 here since, by commutativity, X 2 X = XX 2 ). Since (0, 1) generates L2 , we see that D4 L = L2 . Let us now show that D5 L is trivial. Let Qc {X} be the free commutative non-associative algebra on one generator X and I k the ideal consisting of non-associative polynomials in X without terms of degree < k. As a a vector space, Qc {X}/I 5 is spanned by the monomials 1, X, X 2 , X 3 , X 3 X and X 2 X 2 . Consider the map L → Qc {X}/I 5 given by        p p p 3 2 − q X 3 X + qX 2 X 2 X + X + (p, q) 7→ 1 + pX + 4 3 2 mod I 5 . A direct computation shows that it is an injective homomorphism of L into the loop of units in Qc {X}/I 5 . Extend it to the loop algebra QL by linearity; the augmentation ideal I ⊂ QL is then mapped to the ideal I/I 5 . In particular, if g ∈ D5 L, we see that g − 1 maps to zero, which implies that g = 1. It remains to see that LMlt(L) is nilpotent of class three. On one hand, notice that L(p,q) = L(p,0) L(0,q) and that L(0,q) lies in the centre of LMlt(L) for all q. On the other hand, we have 1 −1 [L(p,0) , L(r,0) ](a, b) = L−1 (p,0) L(r,0) L(p,0) L(r,0) (a, b) = (a, b + apr(p − r)). 2 Furthermore, 1 [L(s,0) , [L(p,0) , L(r,0) ]](a, b) = (a, b − prs(p − r))). 2 It follows that [L(s,0) , [L(p,0) , L(r,0) ]] lies in the center of LMlt(L) and, hence, LMlt(L) is three-step nilpotent.  Proposition 5. Let L be the loop whose elements are pairs of integers (p, q) with     p ′ ′ ′ ′ ′ p . (p, q) · (p , q ) = p + p , q + q + 2 Then L is torsion-free nilpotent of class 3, with D2 L = D3 L = {(0, q) | q ∈ Z}, while LMlt(L) is nilpotent of class 2. The proof of this proposition is very similar to that of Proposition 4, only in this example the loop in question is isomorphic to the reduction of the free non-commutative loop on one generator modulo D4 ; we omit it. Finally, we have the following fact which shows the radical difference between nilpotency in the sense of Bruck for torsion-free loops and torsion-free nilpotency for loops: Proposition 6. Let L = F/F3 be the free nilpotent (in the sense of Bruck) loop of class 2 on a countable number of generators. Then LMlt(L) is not nilpotent. We shall prove this assertion in the next section. Note that, by [14], for any nilpotent, in the sense of Bruck, loop L the left multiplication group LMlt(L) is solvable. 5 4. Higman’s construction Here we state several results of [5] which will be of importance. Let F = F {x} be the free loop on the set x = {x1 , . . . , xn }, α : F → L a surjective homomorphism and N = ker α. The subloop [N, F ] is defined as smallest subloop of N which is normal in F and such that N/[N, F ] is in the centre of F/[N, F ]. In particular, if N = Fk , the kth term of Bruck’s lower central series, then, by definition, [N, F ] = Fk+1 . Define the abelian group A to be freely generated by two types of symbols: • xi for each xi ∈ x; • hl1 , l2 i for each pair l1 , l2 ∈ L \ {e}. On the set L × A consider the following product: (l1 , a1 )(l2 , a2 ) = (l1 l2 , a1 + a2 + hl1 , l2 i), where hl, ei = he, li = 0 for all l ∈ L. With this product, L × A becomes a loop, which we denote by (L, A). In particular, (l1 , a1 )/(l2 , a2 ) = (l1 /l2 , a1 − a2 − hl1 /l2 , l2 i), (l2 , a2 )\(l1 , a1 ) = (l2 \l1 , a1 − a2 − hl2 , l2 \l1 i). Consider the homomorphism δ : F → (L, A) w 7→ (α(w), ψ(w)) where ψ(xi ) = xi ∈ A. Lemma 7 ([5], Lemma 3). ker(δ) = [N, F ]. This lemma has the following corollary: Lemma 8. γn−1 LMlt(F/F3 ) is non-trivial. Proof. Let N = [F, F ] so that L = F/N is a free abelian group on x1 , . . . , xn (strictly speaking, we should write α(xi ) instead of xi but the notation can take some abuse) and [N, F ] = F3 . By Lemma 7 the image of the map δ : F → (L, A) is isomorphic to F/F3 . Write y = [Lxn , [Lxn−1 , . . . [Lx3 , Lx2 ]]](x1 ). Then δ(y) = (x1 , a) with a 6= x1 . Indeed, it is easy to see (by induction on n, for instance) that the term hx2 , x1 i appears in a with coefficient 1. This implies that the iterated commutator [Lxn , [Lxn−1 , . . . [Lx3 , Lx2 ]]] is not the identity and, hence, γn−1 LMlt(F/F3 ) 6= {1}.  Proposition 6 follows. The main technical result of Higman’s paper [5] is the following: Lemma 9 ([5], Lemma 6). Let w, w ′ ∈ W (x) be reduced words such that • w ′ 6∈ Comp(w), • α(w) = α(w ′), 6 • if u, v are words in Comp(w) ∪ Comp(w ′ ) such that α(u) = α(v) then either u = v or {u, v} = {w, w ′}. Then there exists a generator xi or hl1 , l2 i of A whose coefficient in ψ(w) is zero, and in ψ(w ′ ) is ±1. This statement has a consequence which will be of immediate importance for us: Lemma 10 ([5], Corollary 1). Let S be a finite set of reduced words containing together with any word all of its components. If the images of the elements of S in F/N under the natural projection map are not all distinct, the number of elements in the image of S in F/[N, F ] is strictly greater than the number of elements in the image of S in F/N. 5. Injectivity of the Magnus map Let Fc (x) be the free commutative loop on the set x = {xi } and Qc {X} the free commutative non-associative algebra on the corresponding set X = {Xi }. The commutative version of the Magnus map sends Fc (x) into the loop of invertible elements in the completion of Qc {X} and is defined exactly in the same way as the the usual Magnus map: xi is sent to 1 + Xi . Theorem 11. The Magnus maps M : F (x) → Q{X} × and Mc : Fc (x) → Qc {X} × are injective. In particular, the free loops F (x) and Fc (x) are residually torsion-free nilpotent. 5.1. Group-like elements and the modified Magnus map. Recall that in a Hopf algebra a primitive element is an element x satisfying ∆(x) = x ⊗ 1 + 1 ⊗ x and a group-like element is an element g such that ∆(g) = g ⊗ g and ǫ(g) = 1. The set G(H) of all group-like elements in a non-associative Hopf algebra H is, actually, a loop [13]. The free algebra Q{X} is a Hopf algebra whose coproduct is defined by the condition that the generators are primitive. The only group-like element in Q{X} is 1; however, the completion Q{X} has many group-like elements. A group-like element e(X) in the algebra Q{X} of power series in one non-associative and non-commutative variable X with a nonzero coefficient at X is called a base for logarithms or a non-associative exponential series (see [10, 12]). An example of a base for logarithms is the usual exponential series endowed with the right-normed parentheses. Given e(X) there exists another series loge (1 + X) such that loge (e(X)) = X and e(loge (1 + X)) = X. 7 It will be convenient to use a slightly different version of the Magnus map by choosing a base e(X) for logarithms and setting × M′ : F (x) → G(Q{X}) ⊂ Q{X} , xi 7→ e(Xi ). The map Xi 7→ e(Xi ) − 1 determines an algebra homomorphism Q{X} → Q{X} which sends M(w) to M′ (w) for any w ∈ F = F (x). Therefore, if M′ is injective so is M. Let N = ker M′ and L = F/N. We shall prove that N coincides with the kernel of Higman’s homomorphism F → (L, A) and this, by Lemmas 7 and 10, will imply that N is trivial. For this purpose, we shall embed (L, A) into a bigger loop, namely the loop of group-like elements of a Hopf-algebraic version of Higman’s construction (L, A). 5.2. Higman’s construction for Hopf algebras. Let m(X) be the set of all non-associative monomials on X of degree ≥ 1 and T the set of symbols {t1 , . . . , tn } ⊔ {t(m1 , m2 ) | m1 , m2 ∈ m(X)} with degrees |t1 | = . . . = |tn | = 1 and |t(m1 , m2 )| = |m1 | + |m2 |, where |X1 | = . . . |Xn | = 1. Write Q[T ] for the usual commutative and associative algebra on T with the structure of a Hopf algebra obtained by declaring all elements of T to be primitive. Define a linear map t : Q{X} ⊗ Q{X} → spanhT i by setting t(m1 ⊗ m2 ) = t(m1 , m2 ), t(m1 ⊗ 1) = t(1 ⊗ m2 ) = t(1 ⊗ 1) = 0 and let t∗ : Q{X} ⊗ Q{X} → Q[T ] be the coalgebra morphism t∗ (µ ⊗ µ′ ) = ǫ(µ)ǫ(µ′ )1 + X 1 t(µ(1) , µ′(1) ) . . . t(µ(k) , µ′(k) ). k! k≥1 We shall use the same notation t and t∗ for the extensions of these maps to maps between the respective completions of Q{X} ⊗ Q{X}, spanhT i and Q[T ] with respect to the degree. The maps t and t∗ are related in the following way: for any g, g ′ ∈ G(Q[X]) we have ∞ X 1 t(g ⊗ g ′ )k = exp(t(g ⊗ g ′)) ∈ Q[T ], t (g ⊗ g ) = k! k≥0 ∗ ′ where exp is the usual exponential series. Lemma 12. The elements exp(t1 ), . . . exp(tn ) and t∗ (g ⊗ g ′), where g, g ′ ∈ G(Q[X])\{1}, freely generate a multiplicative abelian subgroup of G(Q[T ]). Proof. Assume that ′ dm exp(t1 )e1 · · · exp(tn )en t∗ (g1 ⊗ g1′ )d1 · · · t∗ (gm ⊗ gm ) =1 8 ′ for some g1 , g1′ , . . . , gm , gm ∈ G(Q{X}) \ {1} with (gi , gi′ ) 6= (gj , gj′ ) if i 6= j, and some integers e1 , . . . , en , d1 , . . . , dm . Then ′ exp(e1 t1 + · · · + en tn + d1 t(g1 ⊗ g1′ ) + · · · + dm t(gm ⊗ gm )) = 1 and ′ e1 t1 + · · · en tn + d1 t(g1 ⊗ g1′ ) + · · · + dm t(gm ⊗ gm ) = 0. Since {t1 , . . . , tn } and {t(m1 ⊗m2 ) | m1 , m2 ∈ m(X)} are algebraically independent, we have e1 = · · · = en = 0 and ′ ′ t(d1 g1 ⊗ g1′ + · · · + dm gm ⊗ gm ) = d1 t(g1 ⊗ g1′ ) + · · · + dm t(gm ⊗ gm ) = 0. The kernel of t : Q{X} ⊗ Q{X} → spanhT i is Q{X} ⊗ 1 + 1 ⊗ Q{X} so that ′ d1 · g1 ⊗ g1′ + · · · + dm · gm ⊗ gm = µ⊗1+1⊗η ′ ∈ G(Q{X})\{1} and since different group-like for some µ, η ∈ Q{X}. As g1 , g1′ , . . . , gm , gm elements are linearly independent [1, Theorem 2.1.2], we see that d1 = · · · = dm = 0.  Now, define a new product on Q{X} ⊗ Q[T ] by X (5.1) (x ⊗ α)(y ⊗ β) = x(1) y(1) ⊗ t∗ (x(2) ⊗ y(2) )αβ. With this product, both Q{X}⊗Q[T ] and Q{X} ⊗ Q[T ] are connected bialgebras. Consider the homomorphism f′ : F (x) → G(Q{X} ⊗ Q[T ]) M xi 7→ e(Xi ) ⊗ exp(ti ), where e is the same base for logarithms used for defining M′ . The formula Xi 7→ loge (e(Xi ) ⊗ exp(ti )) defines an injective algebra homomorphism φ : Q{X} → Q{X} ⊗ Q[T ] f′ . In particular, for any words w1 , w2 ∈ F (x) the equality and we have φ ◦ M′ = M M′ (w1 ) = M′ (w2 ) f′ (w1 ) = M f′ (w2 ). holds if an only if M Now, by definition, L is a subloop of G(Q{X}) and Lemma 12 gives an natural injective homomorphism of (L, A) into G(Q{X} ⊗ Q[T ]). Moreover, on L the map φ coincides with the map L → (L, A) and, therefore, as mentioned before, Lemmas 7 and 10 imply that M′ is injective. 9 5.3. The commutative case. The proof of the injectivity of Mc involves minor changes: • denote by mc (X) the set of all monomials of degree ≥ 1 in the commuting variables X1 , . . . , Xn ; • define the set T as {t1 , . . . , tn } ⊔ {t(m1 , m2 ) | m1 , m2 ∈ mc (X)} where we assume that t(m1 , m2 ) = t(m2 , m1 ) for all m1 , m2 ∈ mc (X); • define the coalgebra morphism t∗ : Qc {X} ⊗ Qc {X} → Q[T ] as before. The symmetry of t implies t∗ (µ ⊗ µ′ ) = t∗ (µ′ ⊗ µ) for all µ, µ′ ∈ Qc {X}; • write Qc {X} ⊗ Q[T ] for the commutative bialgebra with the product given by (5.1); • note that Lemma 12 trivially holds when Q{X} is replaced by Qc {X}; f′ : Fc {x} → G(Qc {X} ⊗ Q[T ]) be the homo• let M′c : Fc {x} → G(Qc {X}) and M c ′ f′ (xi ) = e(Xi ) ⊗ exp(ti ) for some morphisms determined by Mc (xi ) = e(Xi ) and M c base for logarithms e(X); • fix a total order on W (x) and call a word in W (x) reduced if none of its components is the left-hand side of any of the equations uv = vu (u < v) v\(uv) = u ev = v ue = u u/v = v\u u\(uv) = v u(u\v) = v (v\u)\u = v (u\v)u = v e\v = v v\v = e; • in the definition of the loop (L, A), take the symbols hl1 , l2 i to be symmetric in the sense that hl1 , l2 i = hl2 , l1 i. With these new definitions Lemma 9 (that is, Higman’s Lemma 6) remains true, and the injectivity of Mc follows from it in the very same fashion as in the non-commutative case. For the sake of completeness, we include the proof of the commutative version of Lemma 9 here, although it follows Higman’s original proof very closely. 5.4. Proof of the commutative version of Lemma 9. First, we observe that w ′ 6= e since w ′ 6∈ Comp(w). The case when w ′ = xi is straightforward: xi = w ′ 6∈ Comp(w) implies that the coefficient of xi in ψ(w ′) is 1 while in ψ(w) it is 0. Therefore, we only have to consider two cases: (1) w ′ = uv and (2) w ′ = u\v, where both u and v are reduced words. As w ′ is reduced, we have u 6= e. In fact, α(u) 6= 1, the unit element of L, since α(u) = 1 = α(e) implies, by hypothesis, that either u = e, a contradiction, or {u, e} = {w, w ′}, which is not possible since w ′ 6= u, e. In what follows, we will often consider two elements, say c1 and c2 , in Comp(w ′ )∪Comp(w) with α(c1 ) = α(c2 ). By hypothesis, this implies that either c1 = c2 or {w ′, w} = {c1 , c2 }. It will be clear that w ′ 6= c1 , c2 (usually c1 and c2 will be either e, components of w or components of w ′ different from w ′ ) so we will conclude that c1 = c2 without further explanation. 10 5.4.1. Case w ′ = uv. First we observe that α(v) 6= 1. Indeed, α(v) = 1 = α(e) would imply that v = e so that w ′ = ue is not reduced, a contradiction. This ensures that hα(u), α(v)i is a generator of A. We will prove that the coefficient of hα(u), α(v)i in ψ(τ ) is zero for any τ ∈ {w, u, v}, which will allow us to conclude that the coefficient of hα(u), α(v)i in ψ(w) is zero while in ψ(w ′ ) it equals to one. To this end, assume that the coefficient of hα(u), α(v)i in ψ(τ ) is non-zero and observe that w ′ 6∈ Comp(τ ). There are two possibilities: (1) τ has a component τ1 τ2 with {α(τ1 ), α(τ2 )} = {α(u), α(v)}. • If α(τ1 ) = α(u) and α(τ2 ) = α(v) then τ1 = u and τ2 = v. Thus τ = uv = w ′ , a contradiction. • If α(τ1 ) = α(v) and α(τ2 ) = u then τ1 = v, τ2 = u and τ = vu. Both τ and w ′ are reduced so u ≥ v and v ≥ u. Hence u = v and τ = uu = w ′ , a contradiction. (2) τ has a component τ1 \τ2 with {α(τ1 ), α(τ1 \τ2 )} = {α(u), α(v)}. • If α(τ1 ) = α(u) and α(τ1 \τ2 ) = α(v) then τ1 = u and – either τ1 \τ2 = v, which implies that w ′ = uv = τ1 (τ1 \τ2 ) is not reduced, a contradiction, – or w ′ = τ1 \τ2 and w = v, which is again a contradiction since w ′ 6∈ Comp(τ ). • If α(τ1 ) = α(v) and α(τ1 \τ2 ) = α(u) then τ1 = v and τ1 \τ2 = u. Thus w ′ = (τ1 \τ2 )τ1 is not reduced, a contradiction. 5.4.2. Case w ′ = u\v. We first observe that α(u\v) 6= 1. Indeed, α(u\v) = 1 would imply α(u) = α(v) so that u = v and w ′ = u\u is not reduced, a contradiction. This ensures that hα(u), α(u\v)i is a generator of A. We will prove that the coefficient of hα(u), α(u\v)i in ψ(τ ) is zero for any τ ∈ {w, u, v}, which will allow us to conclude that the coefficient of hα(u), α(u\v)i in ψ(w) is zero while it is −1 in ψ(w ′). To this end, assume that the coefficient of hα(u), α(u\v)i in ψ(τ ) is non-zero and observe that w ′ 6∈ Comp(τ ). There are two possibilities: (1) τ has a component τ1 τ2 with {α(τ1 ), α(τ2 )} = {α(u), α(u\v)}. • If α(τ1 ) = α(u) and α(τ2 ) = α(u\v) then τ1 = u and α(v) = α(u)α(w ′) = α(u)α(τ2 ) = α(τ1 τ2 ). Thus – either v = τ1 τ2 , which implies w ′ = τ1 \(τ1 τ2 ), a contradiction, – or w ′ = τ1 τ2 and w = v, which is not possible since w ′ 6∈ Comp(τ ). • If α(τ1 ) = α(u\v) and α(τ2 ) = α(u) then τ2 = u and α(τ1 τ2 ) = α(τ1 )α(τ2 ) = α(τ2 )α(τ1 ) = α(u)α(u\v) = α(v). Thus, τ1 τ2 = v and w ′ = u\v = τ2 \(τ1 τ2 ) is not reduced, a contradiction. (2) τ has a component τ1 \τ2 with {α(τ1 ), α(τ1 \τ2 )} = {α(u), α(u\v)}. • If α(τ1 ) = α(u) and α(τ1 \τ2 ) = α(u\v) then τ1 = u and α(v) = α(u)α(u\v) = α(τ1 )α(τ1 \τ2 ) = α(τ2 ) so τ2 = v. Hence w ′ = u\v = τ1 \τ2 ∈ Comp(τ ), a contradiction. • If α(τ1 ) = α(u\v) and α(τ1 \τ2 ) = α(u) then u = τ1 \τ2 and α(v) = α(u)α(u\v) = α(u\v)α(u) = α(τ1 )α(τ1 \τ2 ) = α(τ2 ). Thus, τ2 = v and w ′ = u\v = (τ1 \τ2 )\τ2 is not reduced, a contradiction. References [1] E. Abe, Hopf algebras. Cambridge University Press, Cambridge-New York (1980). [2] R.H. Bruck, A survey of binary systems. Springer Verlag, Berlin-Göttingen-Heidelberg (1958). 11 [3] T. Evans, On multiplicative systems defined by generators and relations. I. Normal form theorems, Proc. Cambridge Phil. Soc. 47, (1951), 637–49. [4] M. Hartl and B. Loiseau, On actions and strict actions in homological categories, Theory and Applications of Categories, 27, no. 15, (2013), 347–392. [5] G. Higman, The lower central series of a free loop, Q. J. Math., 14 , no. 1, (1963), 131–140. [6] W. Magnus, A. Karrass, D. Solitar, Donald, Combinatorial group theory: Presentations of groups in terms of generators and relations. Interscience Publishers [John Wiley & Sons, Inc.], New YorkLondon-Sydney (1966) Heldermann Verlag, Berlin, 1990. [7] J. Mostovoy, The Notion of Lower Central Series for Loops. In Sabinin, L., Sbitneva, L., Shestakov, I. (eds.) Non-associative algebra and its applications. pp. 291–298. Chapman & Hall/CRC-Press, Boca Raton, FL (2006) [8] J. Mostovoy, Nilpotency and Dimension Filtration for Loops. Commun. Algebra 36, (2008),1565–1579. [9] J. Mostovoy, J.M. Pérez Izquierdo, Dimension Filtration on Loops. Isr. J. Math. 158, (2007), 105–118. [10] J. Mostovoy, J.M. Pérez Izquierdo, I. Shestakov, Nilpotent Sabinin algebras, J. Algebra, 419, (2014), 95–123. [11] J. Mostovoy, J.M. Pérez Izquierdo, I. Shestakov, Hopf algebras in non-associative Lie theory, Bull. Math. Sci. 4, no. 1, (2014),129-174. [12] J. Mostovoy, J.M. Pérez Izquierdo, I. Shestakov, A Non-associative Baker-Campbell-Hausdorff formula, arXiv:1605.00953 [math.RA]. [13] J.M. Pérez Izquierdo, Algebras, hyperalgebras, nonassociative bialgebras and loops, Adv. Math. 208, 834–876 (2007) [14] C.R.B. Wright, On the multiplication group of a loop, Illinois J. Math. 13, no. 4, (1969), 660–673. Departamento de Matemáticas, CINVESTAV-IPN, Col. San Pedro Zacatenco, Ciudad de México, C.P. 07360, Mexico E-mail address: [email protected] Departamento de Matemáticas y Computación, Universidad de La Rioja, Edificio CCT C/ Madre de Dios, 53, 26006, Logroño, La Rioja, Spain E-mail address: [email protected] Instituto de Matematica e Estatstica, Universidade de São Paulo, Caixa Postal 66281, São Paulo, SP 05311-970, Brazil E-mail address: [email protected] 12
4math.GR
Graphettes: Constant-time determination of graphlet and orbit identity including (possibly disconnected) graphlets up to size 8 arXiv:1708.04341v1 [cs.DS] 14 Aug 2017 Adib Hasan1 , Po-Chien Chung2 , Wayne Hayes2* , 1 Ananda Mohan College, Mymensingh, Bangladesh 2 Dept. of Computer Science, University of California, Irvine, California, USA * Corresponding author: [email protected] Abstract Graphlets are small connected induced subgraphs of a larger graph G. Graphlets are now commonly used to quantify local and global topology of networks in the field. Methods exist to exhaustively enumerate all graphlets (and their orbits) in large networks as efficiently as possible using orbit counting equations. However, the number of graphlets in G is exponential in both the number of nodes and edges in G. Enumerating them all is already unacceptably expensive on existing large networks, and the problem will only get worse as networks continue to grow in size and density. Here we introduce an efficient method designed to aid statistical sampling of graphlets up to size k = 8 from a large network. We define graphettes as the generalization of graphlets allowing for disconnected graphlets. Given a particular (undirected) graphette g, we introduce the idea of the canonical graphette K(g) as a representative member of the isomorphism group Iso(g) of g. We compute the mapping K, in the form of a lookup table, from all 2k(k−1)/2 undirected graphettes g of size k ≤ 8 to their canonical representatives K(g), as well as the permutation that transforms g to K(g). We also compute all automorphism orbits for each canonical graphette. Thus, given any k ≤ 8 nodes in a graph G, we can in constant time infer which graphette it is, as well as which orbit each of the k nodes belongs to. Sampling a large number N of such k-sets of nodes provides an approximation of both the distribution of graphlets and orbits across G, and the orbit degree vector at each node. Author summary Graphlets are small subgraphs of a larger network. They have been used extensively for over a decade in the analysis of social, biological, and other networks. Unfortunately it is extremely expensive to exhaustively enumerate all graphlets appearing in a large graph, requiring days or weeks of computer time for recent large networks. Here we introduce a novel method for statistically sampling graphlets from large graphs. The time required does not depend upon the size of the input network, but instead upon the number of samples desired. In addition, existing methods only look at graphlets up to size 5 or 6; we allow graphlets up to size 8, which significantly improves on the sensitivity and specificity of network analysis. Our method will allow graphlets to be efficiently utilized to analyze networks of arbitrary size going into the future. PLOS 1/13 Fig 1. All (connected) graphlets of sizes k = 3, 4, 5 nodes, and their automorphism orbits; within each graphlet, nodes of equal shading are in the same orbit. The numbering of these graphlets and orbits were created by hand [8] and do not correspond to the automatically generated numbering used in this paper. The figure is taken verbatim from [16]. Introduction Network comparison is a growing area of research. In general the problem of complete comparison of large networks is intractable, being an N P -complete problem [1]. Thus, approximate heuristics are needed. Networks have been compared for statistical similarity from a high-level using simple, easy-to-calculate measures such as the degree distribution, clustering co-efficients, network centrality, among many others [2, 3]. While more sophisticated methods such as spectral analysis [4, 5] and topological indices [6] have been useful, the study of small subnetworks such as motifs [7] and graphlets [8, 9] have become popular. They have been used extensively to globally classify highly disparate types of networks [10] as well as to aid in local measures used to align networks [11–14]. A graphlet is a small, connected, induced subgraph g of a larger graph G. Given a particular graphlet g, the automorphism orbits of g are the sets of nodes that are topologically identical to each other inside g. Graphlets and their automorphism orbits with up to k = 5 nodes were first introduced in 2004 [8], and are depicted in Fig 1. Recently, automated methods have been created that can enumerate, in a larger graph, all graphlets and their automorphism orbits up to graphlet size k = 5 [15] and subsequently to any k [16], although the latter authors only applied it up to k = 6. Unfortunately, we have found that these methods take a very long time (hours to days) even just to count graphlets up to size k = 5 on some large biological networks, such as those in BioGRID [17]. It is not clear that such methods, especially for even larger k, PLOS 2/13 will be applicable to the coming age of ever bigger networks, since the total number of graphlets appearing in a large network tends to increase exponentially with both k (the graphlet size) and n (the number of nodes in the large network). Eventually, an exhaustive enumeration of all graphlets appearing in a large network may become infeasible simply due to the number of graphlets that need to be enumerated, even under the optimization of using orbit counting equations. On the other hand, graphlets are too useful to abandon as a method of quantifying the topological structure of graphs. An achievable alternative for a large network G is to statistically sample its graphlets rather than exhaustively enumerate them. Additionally, such sampling could be useful with the recent advent of comprehensive biological network databases [18]: each sampled graphlet would act as a seed for local matching between larger networks, similar to how k-mers (short sequences of length k) are used for seed-and-extend sequence matching in BLAST [19]. To efficiently create a statistical sample of graphlets in a large network G, one must be able to take an arbitrary set of k nodes from G, and efficiently (preferably in constant time) determine both which graphlet is represented, as well as the automorphism orbits of each of the k nodes. Here, we solve this problem both by enumerating all graphlets (and their disconnected counterparts, which we term graphettes) and their automorphism orbits up to graphettes of size k = 8. We present a method that creates a lookup table that can quickly determine the graphette identity of any k nodes, as well as their automorphism orbits. Since the lookup table required significant time to pre-compute for k = 7 (a few hours on a single core) and k = 8 (hundreds of CPU weeks on a cluster), we provide the actual lookup tables for these values of k online at http://github.com/Neehan/Faye. Materials and methods Definitions and notations Given a graph G on n nodes, a k-graphette is a (not necessarily connected) induced subgraph g on any set of k nodes of G. There are many ways one could choose the k nodes, for example (i) choosing k nodes uniformly at random from G, or (ii) performing a local search around some node u. We expect the former to be useful only in dense networks, while the latter is probably more useful in sparse networks because most random sets of k nodes in a sparse graph will be highly disconnected and thus not very informative. One could also (iii) perform edge-based selection (with local expansion) to ensure dense regions are sampled more frequently than sparse regions [20]; still other methods have been suggested [21]. Given a set of k nodes, we wish to quickly ascertain which graphette is represented, and which automorphism orbits each of the k nodes belong to. To do that we need a canonical list of graphettes and their orbits, and a fast way to determine which canonical graphette is represented by any permutation of k nodes. Here we demonstrate how, if k is fixed and relatively small (k ≤ 8 in our case), this can be accomplished in constant time by pre-computing and storing a lookup table indexed by a bit vector representation of the lower triangular matrix of the (undirected) adjacency matrix of the induced subgraph. Given such an index, the value associated with that index identifies the canonical graphette (a canonical ordering of the nodes for that graphette). We also pre-compute the automorphism orbits of all the canonical graphettes. Thus, by reversing the lookup table we can, in constant time, infer the orbit identity of each of the k nodes in that k-graphette. As a corrollary, we can also update the (statistically sampled) graphette orbit degree vector of each of the k nodes, similar to the graphlet degree vector [9]. PLOS 3/13 We use the following abbreviations and notations throughout: G(V, E) The Graph with nodes V and edges E V(G) The set of nodes of graph G E(G, u, v) The boolean value denoting connectivity between nodes u and v of graph G ⇐⇒, iff If and only if |S| The number of elements in set S. Adj(G) The adjacency matrix representation of graph G Aut(G) The set of automorphisms of graph G K(g) Canonical isomorph of graphette g 1 2 6 2 7 1 4 7 6 0 5 3 9 2 3 1 7 0 0 9 8 9 3 5 4 8 4 5 6 8 Fig 2. Three isomorphic representations of the Petersen graph. Canonization of graphettes If graphs G and H are isomorphic, it essentially means they are exactly the same graph, but drawn differently. For example, Fig 2 shows three different drawings of the Petersen graph. Technically, an isomorphism between networks G and H is a permutation π : V(G) → V(H) so that E(G, u, v) ⇐⇒ E(H, π(u), π(v)), w x w y x w x y w y x y Fig 3. All the possible 3-graphettes. Consider a 3-graphette with nodes w, x and y. There are only 4 possible such graphettes, depicted in Fig 3. However, by permuting the order of the nodes, each of these graphettes can be represented by several isomorphic variants. In order to 1 determine if two graphettes are isomorphic, we will represent its (undirected) graph with the lower-triangle of its adjacency matrix. We will place this lower-triangular PLOS 4/13 w w x Matrix: Bit vector: x y z y w 0 1 0 x 0 0 100 x y 0 w x y z y w 0 0 0 x 0 1 001 x y 0 x y z y w 0 0 1 x y 0 0 0 010 Fig 4. All 3-graphettes with exactly one edge; the canonical one is the one with lowest integer representation (the middle one in this case). Each of them is placed in a lookup table indexed by the bit vector representation of its adjacency matrix, pointing at the canonical one. In this way we can determine that it is the one-edge 3-graphette in constant time. matrix into a bit vector, resulting in a representation similar to existing ones for orbit identification [16]. We now describe the idea of a canonical representative of each isomorph. To provide an explicit example, consider Fig 4, depicting the three isomorphic configurations of the 3-graphette that has exactly one edge. In order to determine that these graphettes are all isomorphic, we take the bit vector representation depicted, and define the lowest-numbered bitvector among all the isomorphs as the canonical representative. All the other isomorphs in the lookup table point to it. In this way, every graph on 3 nodes can be efficiently mapped to its canonical 3-isomorph. We also automatically determine the number of automorphism orbits (see below) for each canonical isomorph. Table 1 represents, for various values of k, the number of bits 1 b(k) required to store the lower-triangular matrix of all graphettes on k nodes (i.e., the length of the bit vector used to store this matrix); the resulting total number possible representations of k nodes (which is simply 2b(k) ); the number of canonical isomorphs N C(k); and the number of canonical automorphism orbits. Note that, to map each possible set of k nodes to their canonical isomorphs, the lookup table has 2b(k) entries, and each entry has a value between 0 and N C(k) − 1. Note that for k up to 8, the graphettes can be stored in 32 bits. In that case, the maximum space required will be 32 × 228 = 1 GB. This is as far as we go, for now. Moore’s Law suggests that we may be able to go to k = 9 within a few years, and to k = 10 in perhaps a decade or two. We note that the most expensive part of our algorithm is creating the lookup table between an arbitrary set of k nodes, to the canonical graphette represented by those k nodes; in the absence of a requirement for this lookup table, one could use orbit counting equations [16] to generate automorphism orbits up to k = 12. Generating the lookup table from non-canonical to canonical graphettes Assume the large graph G has n nodes labeled 0 through n − 1, and pick an arbitrary set of k nodes U = {u0 , u1 , . . . , uk−1 }. Create the subgraph g induced on the nodes in U ⊆ V(G), and let its bit vector representation B be of the form lower-triangular matrix described in Fig 4. We now describe how to create the lookup table that maps any such PLOS 5/13 k 1 2 3 4 5 6 7 8 9 10 11 12 bits b(k) 0 1 3 6 10 15 21 28 36 45 55 66 #Graphs 2b(k) 1 2 8 64 1K 32 K 2M 256 M 64 G 32 T 32 P 64 E Space b(k)2b(k) 0 0.25 B 3B 48 B 1.25 KB 60 KB 5.25 MB 896 MB 288 GB 180 TB 220 PB 528 EB #Canonicals N C(k) 1 2 4 11 34 156 1044 12346 274668 12005168 1018997864 165091172592 #Orbits 1 2 6 20 90 544 5096 79264 2208612 113743760 10926227136 1956363435360 required to store the Table 1. For each value of k: the number of bits b(k) = k(k−1) 2 lower-triangle of the adjacency matrix for an undirected k-graphette; the number of such k-graphettes counting all isomorphs which is just 2b(k) ; the number of canonical k-graphettes (this will be the number of unique entries in the above lookup table [22], and up to k = 8, 14 bits is sufficient); and the total number of unique automorphism orbits (up to k = 8, 17 bits is sufficient) [27]. Note that up to k = 8, together the lookup table for canonical graphettes and their canonical orbits fits into 31 bits, allowing storage as a single 4-byte integer, with 1 bit to store whether the graphette is connected (i.e., also a graphlet). The suffixes K, M, G, T, P, and E represent exactly 210 , 220 , 230 , 240 , 250 and 260 , respectively. B to its canonical representative. We iterate through all 2b(k) bit vectors in order; for each value B, we check to see if it is isomorphic to any of the previously found canonical graphettes; if so, the lookup table value is set to the previously found canonical graphette; otherwise we have a new, previously unseen canonical graphette and the lookup table value is set to itself (B). When checking for isomorphism between B and all previously found canonical graphettes, we use a relatively simple brute force approach. If the degree distribution of the two graphettes are different, we can immediately discard the pair as non-isomorphic; otherwise we resort to cycling through every permutation of the nodes checking each pair for graph equality, which has worst-case running time of k 2 k!. The total run time to compute the lookup table for a particular value k is thus bounded above by k 2 k! · N C(k) · 2b(k) , where k! is the maximum number of permutations we need to check if a non-canonical matches an existing canonical, k 2 is the worst-case running time to check if 2 specific permutations of k-graphettes are isomorphic, there are at most N C(k) canonicals to check against [22], and 2b(k) = 2n(n−1)/2 is the total number of undirected graphs on k nodes. More sophisticated approaches exist [23], which may more easily allow higher values of k. This process can also be parallelized, which is what we did for k = 8. Essentially, we can split the 2b(k) non-canonical graphettes into m sets of about 2b(k) /m graphettes each, and then spread the computation across m machines. For each of the m sets Si , we loop through all graphettes in that set and mark out which are isomorphic to each other. For each set Si , we will find a set Ti of lowest-numbered “temporary” canonical graphettes in Si , along with the map T C : Si → Ti of which graphettes in Si map to each temporary canonical in Ti . That is, for each graphette g ∈ Si , ∃h ∈ Ti for which the temporary canonical T C(g) = h. Finally, once all the m sets have been evaluated in this way, a second stage passes through all the Ti , i = 0, . . . , m − 1, merging the PLOS 6/13 temporary canonicals together into a final, global list of canonical graphettes, while also propagating these globally lowest-numbered canonicals back up through the m temporary canonical maps, so each graphette g globally maps to the globally lowest-numbered canonical; we call this process sifting for canonicals, and it may require several iterations to globally find the final list of canonicals. In this way we ran k = 8 in about a week across 600 cores, for a total of 600 CPU-weeks. This process could probably be made more efficient with smarter isomorphism checking [23, 24]. Graph automorphism and orbits An isomorphism π : V(g) → V(g) (from a graph g to itself) is called an automorphism. While an isomorphism is just a permutation of the nodes, it is called an automorphism if it results in exactly the same labeling of the nodes in the same order—in other words exactly the same adjacency matrix. The set of all automorphisms of g will be called Aut(g). An automorphism orbit, or just orbit, of g is a minimally sized collection of nodes from V(g) that remain invariant under every automorphism of g [25]. There can be more than one automorphism orbit, and each orbit can have anywhere from 1 to k member nodes; refer again to Fig 1 for some examples. More formally, a set of nodes ω constitute an orbit of g iff: 1. For any node u ∈ ω and any automorphism π of g, u ∈ ω ⇐⇒ π(u) ∈ ω. 2. if nodes u, v ∈ ω, then there exists an automorphism π of g and a γ > 0 so that π γ (u) = v. Now, we shall prove a few relevant results that will be useful later for automatically enumerating the orbits. Proposition 1. For each node u ∈ V(g) and each automorphism π : V(g) → V(g), there exists an integer λ > 0 such that π λ (u) = u. Proof. Because π is an automorphism, u ∈ V(g) =⇒ π(u) ∈ V(g) =⇒ π 2 (u) ∈ V(g) .. . =⇒ π i (u) ∈ V(g), ∀i ∈ N. Since |V(g)| is finite and π is bijective, the conclusion obviously follows. We shall call the set of nodes Cπ (u) = {u, π(u), . . . , π λ−1 (u)} the cycle of u under automorphism π, where λ is the smallest positive integer such that π λ (u) = u. Note that λ is not unique since π λ (u) = π 2λ (u) = · · · = u. Also, π, u, and λ are tied together into triples such that knowing any two determines the third. Corollary 1.1. π maps every node ∈ Cπ (u) to a node (possibly same) ∈ Cπ (u). Corollary 1.2. In any automorphism π of g, every node appears in exactly one cycle. PLOS 7/13 In other words, the cycles π creates are disjoint. (However, the cycles from different automorphisms might not be so.) Hence, it makes sense to say splitting an automorphism into its cycles. For example consider the permutation π = (201354) of (012345). Since π(0) = 2, π(2) = 1, π(1) = 0, the nodes (012) form a cycle. Now start with the next node, 3. π(3) = 3. So, (3) is another cycle. Finally, π(4) = 5, π(5) = 4, so, (45) form another cycle. Hence, the permutation (201354) is split into three cycles, namely (012), (3), (45). Proposition 2. The orbits are disjoint. (In other words, each node appears in exactly one orbit.) Proof. Assume the contrary, i.e., a node u ∈ V(g) appears in two different orbits ω1 and ω2 . According to the second condition, for any other node v ∈ ω1 , there exists an automorphism π of g and a γ so that π γ (u) = v. However, from the first condition, u ∈ ω2 =⇒ π(u) ∈ ω2 =⇒ π 2 (u) ∈ ω2 .. . =⇒ π γ (u) ∈ ω2 =⇒ v ∈ ω2 Therefore, every node v ∈ ω1 also belongs to ω2 . Hence, ω1 ⊆ ω2 . Following the same logic, ω2 ⊆ ω1 , implying ω1 = ω2 . ⇒⇐ Corollary 2.1. Each cycle appears in exactly one orbit, which completely contains that cycle. Proof. If an orbit ω partially contains a cycle Cπ (u), then ω is not invariant under automorphism π, as π will map some node in ω (and Cπ (u)) to another node outside ω (but still in Cπ (u)) according to corollary 1.1, contradicting our definition of orbits. Since two orbits are disjoint, Cπ (u) must appear only in ω, and in none of the other orbits. These statements are enough to be able to find all orbits of each graphette, as we now demonstrate. Automatically enumerating all orbits of a graph From the propositions in the previous section, an algorithm to enumerate the orbits can be constructed like this: 1. Generate all automorphisms of g. 2. Split each automorphism into its cycles. 3. Merge the cycles from different automorphisms to form orbits. Generating all automorphisms of g Referring to Algorithm 1, the function generateAutomorphisms() applies every possible permutation of V(g) over Adj(g). Each permutation creates an isomorph of Adj(g). If Adj(g) is unchanged under some permutation π, then by definition, π is an automorphism of g. Hence it is saved into Aut(g). Two optimization strategies are employed: PLOS 8/13 Algorithm 1 Automatically enumerating automorphism orbits of a graph function generateAutomorphisms(Graph g) Aut(g) = {} // Find the automorphisms of g for each permutation π of V(g) do apply π over Adj(g) if Adj(g) == π(Adj(g)) then put π in Aut(g) end if end for end function function generateCycles(automorphism π) C = {} for node u in π do if u is not visited then mark u visited new cycle Cπ (u) = {} node v = π(u) while v != u do put v in Cπ (u) mark v visited v = π(v) end while put Cπ (u) in C end if end for end function function enumerateOrbits(C(g)) for each node u ∈ V(g) do ω(u) = u end for for cycle c ∈ C(g) do let ωmin = ∞ for node u ∈ c do ωmin = min(ωmin , ω(u)) end for for node u ∈ c do ω(u) = ωmin end for end for end function PLOS 9/13 1. No node is mapped to another node with unequal degree. 2. An automorphism of graph g is also an automorphism of its complement graph g 0 . In practice, this algorithm generates all automorphisms of all the canonical graphettes up to size 8 in a matter of seconds. Nevertheless, for additional speed up in higher sizes, modern sophisticated automorphism detection algorithms [23, 24] may be used. Splitting automorphisms into cycles An automorphism π of g is basically a permutation of nodes of g. Hence, to split π into cycles, we can repeatedly apply π over every node u ∈ π and remember the nodes u transforms into. This forms the cycle with node u, i.e. Cπ (u), which is saved in C. After first visit, each node is marked visited to prevent more visits. Merging cycles to enumerate orbits Suppose C(g) is the set of all cycles resulting from all the automorphisms of g. To enumerate orbits from it, first each node u is colored with a unique color ω(u) = u. Then ω(u) is continuously updated to reflect the current color of u, as the nodes belonging to same orbits are gradually colored by identical color. For the nodes of each cycle c ∈ C(g), we save their minimum color in ωmin , and then color all of them with ωmin . After coloring all the cycles in this way, nodes belonging to same orbits get the same color, and hence, get enumerated. Proof of correctness of Algorithm 1 Here we prove that Algorithm 1 determines every orbit of g. Suppose a set ω is among the final sets generated by Algorithm 1. We shall prove ω is an orbit of g by showing that it follows the two properties of orbits: 1. Let a node u ∈ ω form the cycle Cπ (u) under automorphism π. The generateCycles function will apply π repeatedly until it finds a λ so that π λ (u) = u and will therefore determine Cπ (u). Since the enumerateOrbits function assigned u to ω, it had also assigned all nodes in Cπ (u) to ω. Hence u ∈ ω ⇐⇒ π(u) ∈ ω. 2. Suppose nodes u, v ∈ ω. Then, either they belonged to a cycle from which they were assigned to a mutual set ω in enumerateOrbits function, or there is a third node w so that w shares separate cycles with u and v under different automorphisms π1 and π2 . In the first case, u and v already belong to a common cycle. In the second case, assume π1γ1 (w) = u and π2γ2 (w) = v. Consider the permutation φ = π2γ2 ◦ π1−γ1 . Since composition of two automorphisms is an automorphism [26], φ is also an automorphism. And notice that  φ(u) = π2γ2 π1−γ1 (u) = π2γ2 (w) = v implying u and v belong to a common cycle under φ. Therefore, ω is indeed an orbit of g. Since each node was given a unique orbit color in the beginning of enumerateOrbits, every orbit of g will be eventually found by Algorithm 1. PLOS 10/13 Results and discussion Using the algorithms described herein, we have enumerated all possible graphlets, including the generalization of disconnected counterparts called graphettes, up to size k = 8. The code and data can be found in http://github.com/Neehan/Faye. (Note that the github code uses the upper triangle matrix, though we intend to convert it to use the lower tringle as that representation has already been established [16].) We have also enumerated all orbits up to size k = 8. More importantly to the statistical sampling technique described in the Introduction, we have used a bit-vector representation of all possible adjacency matrices of all possible sets of up to k = 8 nodes and created a lookup table from the 2k(k−1)/2 k-sets to their canonical graphette representatives. This allows us to determine, in constant time, the graphette represented by these k nodes, as well as the automorphism orbits of each nodes. This allows efficient estimation of both the global distribution of graphlets and orbits, as well as an estimation of the graphlet (or orbit) degree vector for each node in a large graph G. Although the lookup tables for k > 8 are at present too big to compute or store, we could also use NAUTY or SAUCY to enumerate all the canonical graphettes up to size k = 12, and use our orbit generation code Algorithm 1 to determine all the orbits in all graphettes up to size k = 12. We have verified that previous results are consistent with ours in terms of the number of distinct graphettes [22] and orbits [27] determined, as displayed in Table 1. In future work we will study which statistical sampling techniques most efficiently produce a good estimate of the complete graphlet and local (per-node) degree vectors. We also intend to study how this method may aid in cataloging of graphlets for database network queries, or in non-alignment network comparison [10]. Finally, there may be ways to combine our method with those of orbit counting equations [15, 16] to more efficiently produce samples of orbit counts. Acknowledgments We thank Sridevi Maharaj, Dillon Kanne, and the anonymous referees for several helpful suggestions on presentation. References 1. Cook SA. The Complexity of Theorem-proving Procedures. In: Proceedings of the Third Annual ACM Symposium on Theory of Computing. STOC ’71. New York, NY, USA: ACM; 1971. p. 151–158. Available from: http://doi.acm.org/10.1145/800157.805047. 2. Newman M. Networks: an introduction. 2010. United Slates: Oxford University Press Inc, New York. 2010; p. 1–2. 3. Emmert-Streib F, Dehmer M, Shi Y. Fifty years of graph matching, network alignment and network comparison. Information Sciences. 2016;346:180–197. 4. Wilson RC, Zhu P. A study of graph spectra for comparing graphs and trees. Pattern Recognition. 2008;41(9):2833–2841. 5. Thorne T, Stumpf MP. Graph spectral analysis of protein interaction network evolution. Journal of The Royal Society Interface. 2012; p. rsif20120220. 6. Dehmer M, Emmert-Streib F, Shi Y. Interrelations of graph distance measures based on topological indices. PloS one. 2014;9(4):e94985. PLOS 11/13 7. Milo R, Shen-Orr S, Itzkovitz S, Kashtan N, Chklovskii D, Alon U. Network motifs: simple building blocks of complex networks. Science. 2002;298(5594):824–827. 8. Pržulj N, Corneil DG, Jurisica I. Modeling interactome: scale-free or geometric? Bioinformatics. 2004;20(18):3508–3515. 9. Pržulj N. Biological network comparison using graphlet degree distribution. Bioinformatics. 2007;23(2):e177–e183. 10. Yaveroğlu ÖN, Malod-Dognin N, Davis D, Levnajic Z, Janjic V, Karapandza R, et al. Revealing the hidden language of complex networks. Scientific reports. 2014;4:4547. 11. Kuchaiev O, Milenković T, Memišević V, Hayes W, Pržulj N. Topological network alignment uncovers biological function and phylogeny. Journal of The Royal Society Interface. 2010;7(50):1341–1354. doi:10.1098/rsif.2010.0063. 12. Malod-Dognin N, Pržulj N. L-GRAAL: Lagrangian Graphlet-based Network Aligner. Bioinformatics. 2015;doi:10.1093/bioinformatics/btv130. 13. Saraph V, Milenković T. MAGNA: maximizing accuracy in global network alignment. Bioinformatics. 2014;30(20):2931–2940. 14. Mamano N, Hayes W. SANA: Simulated Annealing far outperforms many other search algorithms for biological network alignment. Bioinformatics. 2017;0(0):8. 15. Hočevar T, Demšar J. A combinatorial approach to graphlet counting. Bioinformatics. 2014;30(4):559–565. doi:10.1093/bioinformatics/btt717. 16. Melckenbeeck I, Audenaert P, Michoel T, Colle D, Pickavet M. An Algorithm to Automatically Generate the Combinatorial Orbit Counting Equations. PLoS ONE. 2016;11(1). doi:http://dx.doi.org/10.1371/journal.pone.0147078. 17. Chatr-aryamontri A, Breitkreutz BJ, Heinicke S, Boucher L, Winter A, Stark C, et al. The BioGRID interaction database: 2013 update. Nucleic Acids Research. 2013;41(D1):D816–D823. doi:10.1093/nar/gks1158. 18. Pillich RT, Chen J, Rynkov V, Welker D, Pratt D. NDEx: A Community Resource for Sharing and Publishing of Biological Networks. Protein Bioinformatics: From Protein Modifications and Networks to Proteomics. 2017; p. 271–301. 19. Camacho C, Coulouris G, Avagyan V, Ma N, Papadopoulos JS, Bealer K, et al. BLAST+: architecture and applications. BMC Bioinformatics. 2009;10:421. 20. Rahman M, Bhuiyan MA, Al Hasan M. Graft: An efficient graphlet counting method for large graph analysis. IEEE Transactions on Knowledge and Data Engineering. 2014;26(10):2466–2478. 21. Pržulj N, Corneil DG, Jurisica I. Efficient estimation of graphlet frequency distributions in protein–protein interaction networks. Bioinformatics. 2006;22(8):974–980. 22. Sloane N. Online Encyclopedia of Integer Sequences (OEIS);. Available from: http://oeis.org/A000088. 23. Mckay BD. Nauty; 2010. Available from: http://users.cecs.anu.edu.au/˜bdm/nauty. PLOS 12/13 24. Codenotti P, Katebi H, Sakallah KA, Markov IL. Conflict Analysis and Branching Heuristics in the Search for Graph Automorphisms. In: Tools with Artificial Intelligence (ICTAI). IEEE; 2013. 25. Gross JL. Graph Theory – Lecture 2: Structure and Representation — Part A;. Available from: http://www.cs.columbia.edu/˜cs4203/files/GT-Lec2.pdf. 26. Automorphism of a group;. Available from: https: //groupprops.subwiki.org/wiki/Automorphism_of_a_group. 27. Sloane N. Online Encyclopedia of Integer Sequences (OEIS);. Available from: http://oeis.org/A000666. PLOS 13/13
8cs.DS
Reinforcement Learning in a large scale photonic Recurrent Neural Network J. Bueno1 , S. Maktoobi2 , L. Froehly2 , I. Fischer1 , M. Jacquot2 , L. Larger2 , D. Brunner2,∗ arXiv:1711.05133v2 [cs.NE] 15 Nov 2017 2 1 Instituto de Fı́sica Interdisciplinar y Sistemas Complejos, IFISC (UIB-CSIC), Campus Universitat de les Illes Balear, E-07122 Palma de Mallorca, Spain. and FEMTO-ST Institute/Optics Department, CNRS & University Bourgogne Franche-Comté, 15B avenue des Montboucons, 25030 Besanon Cedex, France. ∗ Corresponding author: [email protected] Photonic Neural Network implementations have been gaining considerable attention as a potentially disruptive future technology. Demonstrating learning in large scale neural networks is essential to establish photonic machine learning substrates as viable information processing systems. Realizing photonic Neural Networks with numerous nonlinear nodes in a fully parallel and efficient learning hardware was lacking so far. We demonstrate a network of up to 2500 diffractively coupled photonic nodes, forming a large scale Recurrent Neural Network. Using a Digital Micro Mirror Device, we realize reinforcement learning. Our scheme is fully parallel, and the passive weights maximize energy efficiency and bandwidth. The computational output efficiently converges and we achieve very good performance. I. INTRODUCTION Multiple concepts of Neural Networks have initiated a revolution in the way we process information. Deep Neural Networks outperform humans in challenges previously deemed unsolvable by computers [1]. Among others, these systems are now capable to solve non-trivial computational problems in optics [2]. At the same time, Reservoir Computing (RC) emerged as a Recurrent Neural Network (RNN) concept [3]. Initially, RC received substantial attention due to excellent prediction performance achieved with minimal optimization effort. However, quickly it was realized that RC is highly attractive for analogue hardware implementations [4, 5]. As employed by the machine learning community, Neural Networks (NNs) consist of a large number of nonlinear nodes interacting with each other. Evolving the NNs’ state requires performing vector-matrix products with possibly millions of entries. Neural Network concepts therefore fundamentally benefit from parallelism. Consequently, photonics was identified as an attractive alternative to electronic implementation [6, 7]. Early implementations were bulky and suffered from lack of adequate technology and NN concepts. This recently started to change, firstly because RC enabled a tremendous complexity-reduction of analog electronic and photonic RNNs’ [5, 8–11]. In addition, integrated photonic platforms have matured and integrated photonic Neural Networks are now feasible [12]. Various demonstrations how a particular network of neurons can be implemented have been realized in hardware. Yet, Neural Networks consisting of numerous photonic nonlinear nodes combined with photonically implemented learning were so far only demonstrated in a delay systems controlled by a Field Programmable Gate Array [13]. Due to the timemultiplexing, delay system NNs fundamentally require such auxiliary infrastructure and computational speed suffers due to their serial nature. While networks with multiple nodes are more challenging to implement, they offer key advantages in terms of parallelism, speed and for realizing the essential vectormatrix products. Here, we demonstrated a network of up to 2025 nonlinear network nodes, where each node is a pixel of a Spatial Light Modulator (SLM). Recurrent and complex network connections are implemented using a Diffractive Optical Element (DOE), an intrinsically parallel and passive device [14]. Simulations based on the angular spectrum of plane waves show that the concept is scalable to well over 20.000 nodes. In a photonic RNN with N =900 nodes we implement learning using a digital micro-mirror device (DMD). The DMD is intrinsically parallel as well and, once weights have been trained, passive and energy efficient. Both, the coupling and learning concepts’ bandwidth and power consumption is not impacted by the system’s size, offering attractive scaling properties. Here we apply such a passive and parallel readout layer to an analogue hardware RNN, and introduce learning strategies improving performance of such systems. Using reinforcement learning we implement timeseries prediction with excellent performance. Our findings open the door to novel and versatile photonic Neural Network concepts. II. NONLINEAR NODES AND DIFFRACTIVE NETWORK Figure 1(a) conceptually illustrates our RNN. Information enters the system via a single input node, from where it is injected into a recurrently connected network of nonlinear nodes. The computational result is provided at the single output node after summing the network’s state according to weight matrix WDM D . Following the RC concept, one can choose the input and recurrent internal weights randomly [3]. Here, we create a complex and recurrently connected network using imaging which is spatially structured via a DOE, resulting in the internal connectivity matrix WDOE [14]. In Fig. 1(b) we schematically illustrate our experimental setup. The polarization of an illumination laser 2 of SLM (12.5 µm) and camera (5.2 µm). The detected sat is state is xi = (αEi )2 with α = IGS sat · N D. Here, I the camera’s saturation intensity and N D the transmission through a neutral density filter (ND) always selected such that the the dynamical range of the camera is fully exploited, while avoiding over-exposure (maximum gray scale GS=255). After multiplication with scalar β, we add a constant phase offset θi and send the resulting matrix back to the SLM. Ignoring the DOE’s effect, each pixel therefore corresponds to an Ikeda map: xi (n + 1) = GS cos2 (βxi (n) + θi ). FIG. 1. (a) Schematic illustration of a recurrent neural network. (b) Experimental setup. The NN state encoded on the SLM is imaged onto the camera (CAM) through a polarizing beam splitter (PBS) and a diffractive optical element (DOE). In this way, we realize a recurrently coupled network of Ikeda maps. A digital micromirror device (DMD) creates a spatially modulated image of the SLM’s state. The integrated state, obtained via superimposing the modulated intensities, is detected, creating the photonic RNN’s output. (c) The RNN’s coupling matrix established by the DOE, with the inset showing a zoom into a smaller region. (Thorlabs LP660-SF20, λ=661.2 nm, Ibias =89.69 mA, T =23 ℃) is adjusted to s-polarization and the polarizing beam splitter cube (PBS) therefore reflects all light towards the SLM. By focusing the illumination laser onto the first microscope objective’s (MO1, Nikon CFI Plan Achro 10X) back focal plane, the SLM (Hamamatsu X13267-01) is illuminated by a plane wave. The λ2 -plate in front of MO1 is adjusted such that the SLM operates in intensity modulation mode. Consequently the optical field transmitted through the PBS (p-polarization) for each SLM pixel i is modulated according to Ei = Ei0 cos(2π xi ), κSLM (1) where Ei0 and xSLM are the illumination and gray scale i value of pixel i, respectively. κSLM is the SLM’s conversion factor between pixel gray scale and polarization rotation angle. Ignoring for now the DOE’s effect for explanatory purposes, the transmitted field is imaged (MO2, Nikon CFI Plan Achro 10X) on a mirror, and double passing through a λ4 -plate results in a s-polarized field. The PBS therefore reflects the entire optical field, which is consecutively imaged (MO2, Nikon CFI Plan Fluor 4X) on the camera (CAM, Thorlabs DCC1545M). We rescale the camera image via linear interpolation to fit the number of pixels of the SLM. This step is necessary due to (i) an imaging magnification of 2.5, and (ii) the different pixel sizes (2) We write the SLM state as vector x(n + 1), yet in the experiment this state corresponds to a square array of SLM pixels. Illumination wavelength, DOE (HOLOOR MS-443650-Y-X), as well as MO1 and MO2 were chosen such that the spacing between diffractive orders matches the pixel-spacing of the SLM. Therefore, upon adding the DOE to the beam path, the optical field on the camPN DOE era becomes EiC = j Wi,j Ej , where WDOE is the networks coupling matrix created by the DOE. In Fig. 1(c) we show the experimentally obtained W DOE for a network of 30×30 nodes. Upon inspection of the inset one can see that locally connectivity strengths vary significantly. This is due to each pixel illuminating a DOE area comparable to the DOE’s lowest spatial frequency. As this area shifts slightly from pixel to pixel, the intensity distribution between diffractive orders varies. This intended effect inherently creates the heterogeneous photonic network topology needed for computation [3]. Finally, the photonic RNN’s state x(n + 1) is given by  xi (n + 1) = GS · cos2 (β · α  N X 2 DOE Wi,j Ej  j + γWiinj u(n + 1) + θi ). (3) Here u(n + 1) is the information to be injected into the RNN and γ is the signal injection strength. Matlab is used to control all instruments, update the network state and to inject the input information weighted by matrix γWiinj . The overall update rate of the entire system is ∼5 Hz. Currently, the maximum size of networks we can realize consist of ∼2500 nodes, which is limited by the imaging setup’s field of view and not by the concept itself. III. NETWORK READOUT WEIGHTS Having created a recurrent photonic neural network driven by external data, the final to information processing is to adjust the system such that it performs the required computation. This is typically achieved by modifying connection weights according to some learning routine. Inspired by the RC concept, we constrain learning 3 (b) (a) employ a version of reinforcement learning. The learning input signal is injected after inverting the weight assigned to one node. The error εk of signal ykout (n + 1) obtained for configuration WkDM D is then compare to the error εk−1 , where k is the index of learning iterations. If the error is reduced, we keep DMD configuration WkDM D , DM D if not, we revert back to Wk−1 and invert a different weight. The weight to be updated is determined by the largest entrys Wkselect,max position lk according to h FIG. 2. (a) Learning curves for a photonic RNN with two phase offsets φi across the network. A fraction of (1 − µ) nodes have a response function with a negative slope (Θ0 = 0.17π), the remaining nodes experience a response function with a positive slope (Θ0 = 0.43π). (b) An almost symmetric distribution of phase offsets, resulting in positive and negative node responses, benefits computational performance. induced weight adjustment to the readout layer. Our 900 RNN nodes are spatially distributed, and we therefore can use a simple lens (Thorlabs AC254-400-B) to image the SLM’s state onto a commercial array of micro mirrors (DLi4120 XGA, pitch 13.68 µm). Micro mirrors can be flipped between ±12 °, such that for -12 °the optical signal is directed to a detector. The detectors photo current then corresponds to the RNN output. With WDM D as the readout weight vector, the RNN output becomes  y out (n + 1) = δ WDM D (1 − x(n + 1)) . (4) Here, δ relates the power recorded by the power meter (Thorlabs S150C and PM100A) to the SLM state. The signal directed towards the DMD is orthogonally polarized compared to the one directed to the camera, resulting in xDM D (n) = 1 − x(n). In the experiment weight vector WDM D corresponds to a square matrix, which can be seen in Fig. 1(b). The image labeled DMD shows a typical configuration of the DMD with WDM D . As the contribution of each node is either on or off, WDM D consists of Boolean entries only. Weights are not temporal modulations as in delay system implementations of RC [13], and therefore can be implemented by passive attenuations in reflection or transmission. Such passive processes are energy efficient and typically do not results in a bandwidth limitation. In this specific implementation, once trained, mirrors can simply remain in their position, and if mechanically fixed, would not consume additional energy. Also, readout eq. 4 is optically performed for all elements in parallel. IV. PHOTONIC LEARNING It is now the task of a learning algorithm to tailor WDM D such that signal y out (n + 1) approximates a target value as good as possible. In our experiment, we Wkselect =rand(N ) · Wbias , i lk , Wkselect,max = max(Wkselect ), DM D Wk,l = k DM D ¬(Wk−1,l ), k (5) (6) (7) 1 + Wbias , Wlbias = 0. (8) k N rand(N ) creates a random vector with N entries, and at the start W1DM D and Wbias are randomly initialized. Wbias acts as a bias vector, whose values are increased by N1 each learning iteration while the bias belonging to the most recently updated weight is set to zero. This results in a randomized selection process with a bias away from inverting recently updated weights. In simulations we found that reinforcement learning including such a bias showed significantly faster learning convergence. As a task to be performed by our system, we chose nonlinear time series prediction. The injected signal u(n + 1) is the chaotic Mackey-Glass (MG) sequence [3], and the RNN’s learning target is y T (n + 1) = u(n + 2), the onetime-step-prediction of the MG system. Parameters of the temporal MG sequence where identical to [15], using an integration step size of 0.1. For determining the error εk we discarded the first 30 data points due to their transient nature. The RNNs remaining output sequence was then inverted, its offset subtracted and normalized by its standard deviation, creating signal ỹkout . The error was measured by εk = σ(y T − ỹkout ), where σ is the standard deviation and εk therefore corresponds to the normalized mean square error (NMSE). At this stage we would like to stress a significant difference between neural networks emulated on digital electronic computers and our photonic hardware implementation. In our system, all connection weights are positive, and WDM D is boolean. This restricts the functional space available for approximating the targeted input-output transformation. As a result, first evaluations of the learning procedure and prediction of the MG series suffered from minor performance. However, we were able to mitigate this restriction by harnessing the non-monotonous slope of the cos2 nonlinearity. We randomly divided the offest phases θi |i=1...N , resulting in nodes with negative and positive slope of their response function. We chose Θ0 = 42=0.17π ˆ and Θ0 + ∆Θ = 106=0.43π, ˆ respectively, with a probability of 1 − µ for θi = Θ0 . As RNN-states and WDOE entries are exclusively positive, the nonlinear transformation of nodes with θi = Θ0 is predominantly along a positive slope, for θi = Θ0 + ∆Θ along a negative slope. Wbias = 4 larger by a factor of 2.2 relative to a delay RC based on a semiconductor laser [15] and by 6.5 relative to a MachZehnder modulator based setup [16]. These comparisons have to be evaluated in the light of the significantly increased level of hardware implementation in our current setup. In [15, 16], readout weights were applied digitally in an off-line procedure using weights with double precision. In [16] a strong impact of digitization resolution on the computational performance was identified, suggesting that ε can be significantly reduced by increasing the resolution of WDM D . FIG. 3. (a) Learning performance at optimal parameters (β=0.8, γ=0.4, µ=0.45). (b) The photonic RNN’s predicted output in µW (blue line) can hardly be differentiated from the prediction target (red dots). Prediction error ε is given by the yellow dashed data. This enables the reinforcement learning procedure to select from nonlinear transformations with positive and negative slopes. We used feedback β = 0.8 and injection gain γ = 0.4, and learning curves for various ratios (µ = [0.25, 0.35, 0.45, 0.5]) are shown in Fig. 2 (a). They reveal a strong impact of this symmetry breaking. Optimum performance for each µ is shown in 2(b). Best performance is found for an RNN operating around almost equally distributed operating points at µ = 0.45. This demonstrates that the absence of negative weights in WDM D , WDOE and x can be partially compensated for by incorporating nonlinear transformations with positive as well as negative slopes. This result is of high significance for optical neural networks, which, e.g. motivated by robustness considerations, renounce making use of the optical phase to implement negative weights. We further optimized our system’s performance by scanning the remaining parameters β and γ. In Fig. 3 (a) we show the error convergence under optimized global conditions for a training sample size of 500 steps (blue stars). The error efficiently reduces, and finally stabilizes at ε ≈ 0.013. Considering learning is limited to Boolean readout weights this is an excellent result. After training, the prediction performance is evaluated further on a sequence of 4500 datapoints consecutive data points which were not part of the training dataset. As indicated by the red line in the same panel, the testing error matches the training error. We can therefore conclude that our photonic RNN successfully generalized the underlying target system’s properties. The excellent prediction performance can be appreciated in Fig. 3 (b). Data belonging to the left y-axis (blue line) shows the recorded output power, while on the right y-axis (red dots) we show the normalized prediction target signal. A difference between both is hardly visible, and the prediction error ε (yellow dashed line) is small. Down-sampling the injected signals by 3 creates condition identical to [15, 16]. Under these conditions our error (ε = 0.042) is V. CONCLUSION We demonstrated a photonic RNN consisting of hundreds of photonic nonlinear nodes and the implementation of photonic reinforcement learning. Using a simple Boolean valued readout implemented with a DMD, we trained our system to predict the chaotic MG sequence. The resulting prediction error is very low despite of the Boolean readout weights. In our work we demonstrate how symmetry breaking inside the RNN can compensate for exclusively positive intensities in our analogue neural networks systems. These results resolve a complication of general importance to neural networks implemented in analog hardware. Hardware-implemented networks and readout weights based on physical devices open the door to a new class of experiments, i.e. evaluating the robustness and efficiency of learning strategies in fully implemented analogue neural networks. The final step, a photonic realization of the input, should be straight forward, as it only requires a complex spatial distribution of the input information. Finally, our system is not limited to the reported slow opto-electronic system. Extremely fast all-optical systems can be realized employing the same concept since we intentionally implemented a 4f architecture to allow for self-coupling [14]. FUNDING INFORMATION The authors acknowledge the support of the Region Bourgogne Franche-Comté. This work was supported by Labex ACTION program (contract ANR-11-LABX0001-0) and via the Volkswagen Foundation NeuroQNet project. ACKNOWLEDGMENTS The authors would like to thank Christian Markus Dietrich for valuable contributions to earlier versions of the setup. 5 [1] Y. LeCun, Y. Bengio, and G. Hinton, Nature 521, 436 (2015). [2] A. Sinha, J. Lee, S. Li, and G. Barbastathis, Optica 4, 1117 (2017). [3] H. Jaeger and H. Haas, Science (New York, N.Y.) 304, 78 (2004). [4] K. Vandoorne, W. Dierckx, B. Schrauwen, D. Verstraeten, R. Baets, P. Bienstman, and J. Van Campenhout, Optics Express 16, 11182 (2008). [5] L. Appeltant, M. C. Soriano, G. Van der Sande, J. Danckaert, S. Massar, J. Dambre, B. Schrauwen, C. R. Mirasso, and I. Fischer, Nature Communications 2, 468 (2011). [6] K. Wagner and D. Psaltis, Applied Optics 26, 5061 (1987). [7] C. Denz, Optical Neural Networks (Springer Vieweg, Wiesbaden, 1998). [8] F. Duport, B. Schneider, A. Smerieri, M. Haelterman, and S. Massar, Optics Express 20, 22783 (2012). [9] Y. Paquot, F. Duport, A. Smerieri, J. Dambre, B. Schrauwen, M. Haelterman, and S. Massar, Scien- tific Reports 2, 287 (2012). [10] L. Larger, M. C. Soriano, D. Brunner, L. Appeltant, J. M. Gutierrez, L. Pesquera, C. R. Mirasso, and I. Fischer, Optics Express 20, 3241 (2012). [11] D. Brunner, M. C. Soriano, C. R. Mirasso, and I. Fischer, Nature Communications 4, 1364 (2013). [12] Y. Shen, N. C. Harris, S. Skirlo, M. Prabhu, T. BaehrJones, M. Hochberg, X. Sun, S. Zhao, H. Larochelle, D. Englund, and M. Soljacic, Nature Photonics 11, 441 (2017), arXiv:1610.02365. [13] P. Antonik, M. Haelterman, and S. Massar, Cognitive Computation , 1 (2017). [14] D. Brunner and I. Fischer, Optics Letters 40, 3854 (2015). [15] J. Bueno, D. Brunner, M. Soriano, and I. Fischer, Optics Express 25, 2401 (2016). [16] M. C. Ortı́n, S.and Soriano, L. Pesquera, D. Brunner, D. San-Martı́n, I. Fischer, C. R. Mirasso, and J. M. Gutiérrez, Scientific Reports 5, 14945 (2015).
9cs.NE
Decentralized Autonomous Navigation Strategies for Multi-Robot Search and Rescue by arXiv:1605.04368v1 [cs.RO] 14 May 2016 Ahmad Baranzadeh 2016 Abstract Use of multi-robot systems has many advantages over single robot systems in various applications. However, it comes with its own complexity and challenges. In this report, we try to improve the performance of existing approaches for search operations in multi-robot context. We propose three novel algorithms that are using a triangular grid pattern, i.e., robots certainly go through the vertices of a triangular grid during the search procedure. The main advantage of using a triangular grid pattern is that it is asymptotically optimal in terms of the minimum number of robots required for the complete coverage of an arbitrary bounded area. Therefore, using the vertices of this triangular grid coverage guarantees complete search of a region as well as shorter searching time. We use a new topological map which is made and shared by robots during the search operation. We consider an area that is unknown to the robots a priori with an arbitrary shape, containing some obstacles. Unlike many current heuristic algorithms, we give mathematically rigorous proofs of convergence with probability 1 of the algorithms. The computer simulation results for the proposed algorithms are presented using a simulator of real robots and environment. We evaluate the performance of the algorithms via experiments with real Pioneer 3DX mobile robots. We compare the performance of our own algorithms with three existing algorithms from other researchers. The results demonstrate the merits of our proposed solution. A further study on formation building with obstacle avoidance for a team of mobile robots is presented in this report. We propose a robust decentralized formation building with obstacle avoidance algorithm for a group of mobile robots to move in a defined geometric configuration. Furthermore, we consider a more complicated formation problem with a group of anonymous robots; these robots are not aware of their position in the final configuration and need to reach a consensus during the formation process. We propose a randomized algorithm for the anonymous robots that achieves the convergence to a desired configuration with probability 1. We also propose a novel obstacle avoidance rule, used in the formation building algorithm. A mathematically rigorous proof of the proposed algorithm is given. The performance and applicability of the proposed algorithm are confirmed by the computer simulation results. ii Contents 1 Introduction 1.1 Multi-Robot Systems . . . . . . . . . 1.2 Multi-Robot Search and Rescue . . . 1.3 Communication and Coordination . . 1.4 Centralized vs. Decentralized . . . . 1.5 Consensus Variables Rule . . . . . . 1.6 Mapping . . . . . . . . . . . . . . . . 1.7 Formation Building . . . . . . . . . . 1.8 Contributions of This Report . . . . 1.8.1 Main Contribution Highlights 1.9 Report Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Consensus Variables Locating Algorithm 2.1 Problem statement . . . . . . . . . . . . 2.2 Consensus Variables Locating Algorithm 2.3 Simulation Results . . . . . . . . . . . . 2.4 Summary . . . . . . . . . . . . . . . . . 3 Random Triangular Grid-Based Search 3.1 Distributed Random Search Algorithm 3.1.1 Searching the Whole Area . . . 3.1.2 Searching for Targets . . . . . . 3.1.3 Patrolling . . . . . . . . . . . . 3.1.4 Robots’ Motion . . . . . . . . . 3.2 Simulation Results . . . . . . . . . . . 3.2.1 Searching the Whole Area . . . 3.2.2 Searching for Targets . . . . . . 3.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 15 19 22 23 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 25 26 29 29 30 30 31 34 36 . . . . . . . 38 38 39 42 43 43 44 44 . . . . . . . . . . . . . . . . . . . . 4 Semi-Random Triangular Grid-Based Search Algorithm 4.1 Distributed Semi-Random Search Algorithm . . . . . . . . 4.1.1 Searching the Whole Area . . . . . . . . . . . . . . 4.1.2 Searching for Targets . . . . . . . . . . . . . . . . . 4.1.3 Patrolling . . . . . . . . . . . . . . . . . . . . . . . 4.1.4 Robots’ Motion . . . . . . . . . . . . . . . . . . . . 4.2 Simulation Results . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Searching the Whole Area . . . . . . . . . . . . . . iii . . . . . . . . . . 2 2 3 6 8 8 9 9 11 12 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 4.2.2 Searching for Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5 Modified Triangular-Grid-Based Search Algorithm 5.1 Distributed Triangular Grid-Based Search Algorithm . . . . . . . . . . 5.1.1 Searching the Whole Area . . . . . . . . . . . . . . . . . . . . . 5.1.2 Searching for Targets . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 Patrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Robots’ Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Searching the Whole Area . . . . . . . . . . . . . . . . . . . . . 5.2.2 Searching for Targets . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Experiments with Real Robots . . . . . . . . . . . . . . . . . . . . . . . 5.4 Comparison Between Presented Search Algorithms and Other Methods 5.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Formatiom Building with Obstacle Avoidance 6.1 Multi-Robot System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Formation Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Formation Building with Anonymous Robots . . . . . . . . . . . . . . . . . . 6.4 Obstacle Avoidance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.1 Obstacle Avoidance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.2 Formation Building with Obstacle Avoidance . . . . . . . . . . . . . 6.5.3 Formation Building with Anonymous Robots and Obstacle Avoidance 6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 52 53 56 57 57 57 58 60 65 68 69 . . . . . . . . . 72 72 74 79 81 84 85 86 89 89 92 1 Chapter 1 Introduction The past three decades have seen increasingly rapid advances in robotics. Also, mobile robots area; usually referred to unmanned aerial vehicles (UAVs), unmanned ground vehicles (UGVs), unmanned underwater vehicles, driverless cars, etc., has been a major area of interest within the field of robotics. Using mobile robots has recently become very popular in various tasks. Mobile robots are employed to achieve from very simple home tasks like vacuum cleaning [1,2] to some important and complicated jobs like finding a dangerous odour source in a warehouse [3]. They have been used to help or replace human in various applications such as unmanned aircraft systems (UAS) [4–6], factory automation [7,8], mining [9–11], home and office assistance [12,13], interactive guide systems [14], search and rescue operations [15, 16], search and exploration in hazardous environments [17], and sensor networks [18, 19]. A single-robot system refers to only one individual robot which can model itself, the environment and their interaction [20]. Use of a single robot in applications mentioned above has been studied by many researchers, and this field of research is well developed. NASA Mars Pathfinder [21], Sony Aibo, a robotic dog capable of seeing and walking [22], and Boston Dynamics BigDog that is able to walk on icy terrain and recover its balance when kicked from the side [23], are famous examples of mobile robots. Despite advances in single-robot systems that enable them to overcome many obstacles and achieve a lot of operations, there are still some tasks that are inherently impossible or too complicated to be done by an individual robot. Furthermore, there are also some tasks that might not be timely or economically efficient to be done by a single robot. For instance, two keys in different parts of an environment must be activated concurrently, cannot be accomplished by a single robot [24]. 1.1 Multi-Robot Systems On the other side, using a team consisting of some autonomous mobile robots instead of only a single robot for aforementioned tasks, is a newer approach that has attracted many researchers in recent years [25–28]. Though, using multi-robot systems may cause some new challenging problems in contrast to single-robot systems, they have a lot of advantages that assure the researchers to have an increased interest in this topic. Furthermore, recent developments in the fields of microelectronics, measurement and sensors, wireless communication networks, and computer hardware and software, have led to a renewed interest in multi-robot systems. Compared to single-robot systems, multi-robot systems have several potential advantages which are [29–33]: 2 • More reliable; as a result of information sharing among robots, any failure in one robot would not cause a failure of the whole system. • Robust and fault-tolerant; using multi-robot systems can reduce errors in odometry, communication, sensing and so on. • Scalable; with growing amount of work, the algorithm applied to multi-robot systems still works properly. • Flexible; they can adopt themselves with any changes in the environment. • Lower cost; using some simple robots is cheaper than a single complex and powerful robot. • A better spatial distribution. • A better overall system performance in terms of time or the energy consumption required completing a task. Despite aforementioned advantages, multi-robot systems consist of many different and yet related research topics and problems. Communication and coordination of the robots during the operation, localization, and mapping are some of the most significant problems of multi-robot systems which have been discussed in the next sections. 1.2 Multi-Robot Search and Rescue In the field of multi-robot systems, search and rescue, exploration, foraging and patrolling are some different terms that are closely related. A considerable amount of literature has been published on these topics [34–39]. Although these topics may seem distinct, their related problems in multi-robot systems are almost similar so that they can be classified in the same category. All of these problems can be done by a single robot, and there are many articles have been published about that. But as outlined before, using a team of robots has many advantages over a single robot that make it powerful so that it can accomplish a search task more efficient in terms of time and cost. Multi-robot exploring systems have numerous applications such as exploring an entire region for unknown number of targets [40, 41], search and rescue operations [42], surveyance a building to detect potential intruders (e.g., museums and laboratories) [43], patrolling in outdoor environments (e.g., a country borders) [44], intruder detection and perimeter protection [45, 46]. This report intends to present some algorithms which can be applied in the search and rescue operations (SAR) [47, 48] as well as other exploring tasks. Clearly, it is significant to save human lives in a disaster such as an earthquake, a plane crash, a missed boat in the ocean and a fire in an industrial warehouse. In most of such cases, search and rescue operations are usually difficult or even impossible to be performed by humans. Therefore, using a team of robots would be helpful to carry out the operation to increase the survival rate and to decrease the risk of the operation. Besides, in a search and rescue operation, the search area must be completely explored ensuring all possible targets are detected. Our suggested algorithms thoroughly cover this goal in the sense that they guarantee exploring all points of the search area. In the following, we mention some of the studies in this field carried out in recent years by other researchers. 3 Beard and McLain [49] proposed a dynamic programming approach for a team of cooperating UAVs to explore a region as much as possible while avoiding regions of hazards. Vincent and Rubin [50] used predefined swarm patterns to address the problem of cooperative search strategies for UAVs searching for moving targets in hazardous environments. Yang et al. [51] used distributed reinforcement learning for multi-agent search wherein the robots learn the environment online and store the information as a map and utilise that to compute their route. Baxter et al. [52] described two implementations of a potential field sharing multi-robot system; pessimistic and optimistic. They considered that robots perform no reasoning and are purely reactive in nature. They pointed out that potential field sharing has a positive impact on robots involved in a search and rescue problem. Marjovi et al. [53] presented a method for fire searching by a multi-robot team. They proposed a decentralized frontier based exploration by which the robots explore an unknown environment to detect fire sources. In [15], Guarnieri et al. presented a search and rescue system named HELIOS team, consisting of five tracked robots for urban search And rescue. Two units are equipped with manipulators for the accomplishment of particular tasks, such as the handling of objects and opening doors; the other three units, equipped with cameras and laser range finders, are utilized to create virtual 3D maps of the explored environment. The three units can move autonomously while collecting the data by using a collaborative positioning system (CPS). Sugiyama et al. [54] investigated the autonomous chain network formation by multi-robot rescue systems. According to Sugiyama et al. [54], chain networks connecting a base station and rescue robots are essential to reconnoiter distant spaces in disaster areas, and the chains must be formed to assure communications among them and must be transformed if the target of exploration changes. They adopted autonomous classification of robots into search robots and relay robots so that the robots act according to the behavior algorithms of each class of robot to form chain network threading the path to the distant spaces. In [55], Luo et al. proposed an approach that employs a team consisting of ground and aerial vehicles simultaneously. The ground vehicle is used for the purpose of environment mapping, the micro aerial vehicle is used simultaneously for the purpose of search and localization with a vertical camera and a horizontal camera, and two other micro ground vehicles with sonar, compass and colour sensor used as the back-up team. Lewis and Sycara [56] demonstrated the evolution of an experimental human-multi-robot system for urban search and rescue in which operators and robots collaborate to search for victims. Macwan and Nejat [57] presented a modular methodology for predicting a lost person’s behavior (motion) for autonomous coordinated multi-robot wilderness search and rescue. They asserted introducing new concept of isoprobability curves, which represents a unique mechanism for identifying the targets probable location at any given time within the search area while accounting for influences such as terrain topology, target physiology and psychology, clues found, etc. Mobedi and Nejat [58] developed an active 3-D sensory system that can be used in robotic rescue missions to map these unknown cluttered urban disaster environments and determine the locations of victims. Sugiyama et al. [59] proposed a system procedure for a multi-robot rescue system that performs real-time exploration over disaster areas. The proposed system procedure consists of the autonomous classification of robots into search and relay types, and behavior algorithms for each class of robot. Searching robots explore the areas, and relay robots act as relay terminals between searching robots and the base station. The rule of the classification and the behavior algorithm refer to the forwarding table of each robot constructed for ad hoc networking. The table construction is based on DSDV (destination-sequenced distance vector) 4 routing that informs each robot of its topological position in the network and other essentials. In [60], Liu et al. proposed a hierarchical reinforcement learning (HRL) based semi-autonomous control architecture for rescue robot teams to enable cooperative learning between the robot team members. They claimed that the HRL-based control architecture allows a multi-robot rescue team to collectively make decisions regarding which rescue tasks need to be carried out at a given time, and which team member should execute them to achieve optimal performance in exploration and victim identification. In [61], Cipolleschi et al. proposed a system that exploits semantic information to push robots to explore areas that are relevant; according to a priori information provided by human users. That semantic information, which embedded in a semantic map, associates spatial concepts (like rooms and corridors) with metric entities, showing its effectiveness to improve total explored area. Two main issues of multi-robot exploration are the exploration strategy employed to select the most convenient observation locations the robots should reach in a partially known environment and the coordination method employed to manage the interferences between the actions performed by robots [62]. To determine the effect of each issues, Amigoni et al. [62] studied a search and rescue setting in which different coordination methods and exploration strategies are implemented and their contributions to an efficient exploration of indoor environments are comparatively evaluated. Their results showed that the role of exploration strategies dominates that of coordination methods in determining the performance of an exploring multirobot system in a highly structured indoor environment, while the situation is reversed in a less structured indoor environment. To our knowledge, there is not a lot of publications about the grid-based search by multirobot systems. A preliminary related work on this topic was undertaken by Spires et al. [63] wherein they proposed space filling curves such as Hilbert curves for geographical search for targets by multiple robots. Enns et al. [64] addressed the problem of searching a wide area for targets using multiple autonomous air vehicles. They considered a scenario where viewing from two perpendicular directions is needed to confirm a target. They employed a simple rule wherein the unmanned air vehicles move in lanes to detect the targets. In recent years, there has been an increasing amount of literature on using the Voronoi diagram for multi-robot systems [65–67]. Wurm et al. [36] addressed the problem of exploring an unknown environment with a team of mobile robots. They proposed an approach to distribute the robots over the environment by partitioning the space into segments using Voronoi diagram. Haumann et al. [68] proposed a frontier based approach for multi-robot exploration wherein using a Voronoi partition of the environment, each robot autonomously creates and optimizes the objective function to obtain a collision-free path in a distributed fashion. In [69], authors used Voronoi decomposition of the map to build a connected graph of a place for generating the set of exploration goals. Bhattacharya et al. [70] presented a distributed algorithm that computes the generalized Voronoi tessellation of non-convex environments in real-time for use in feedback control laws for cooperative coverage control in unknown non-convex environments. Yang et al. [71] proposed a decentralized control algorithm of swarm robots for target search and trapping inspired by bacteria chemotaxis; by dividing the target area into Voronoi cells. Guruprasad and Ghose [72–74] studied employing Voronoi diagram for multi-robot deploy and search. However, such approaches that use Voronoi diagram for multi-robot search have some weakness. For example, they need a lot of resources for computation to obtain a reasonable performance that depends on the number of robots. Also, they are inefficient and quiet complex to 5 implement in practice [29]. This study makes a major contribution to research on multi-robot systems by demonstrating some new methods of grid-based search to fill such gaps. In particular, our proposed methods do not need much computational resources, and are feasible to implement in real systems. Regarding the shape of search area, there are a lot of research conducted in multi-robot systems with various assumptions about the search area [52, 73, 75, 76]. However, few of them propose a comprehensive solution for the shape of the environment and obstacles. For instance, in [52] a structured environment has been assumed as the search area whereas an unstructured environment has been considered in [75]. In [73], the search area has been assumed a region without any obstacles while in [76], the operation has been done in an environment with obstacles. 1.3 Communication and Coordination It is apparent that the strength of multi-robot systems rises when the robots cooperate to complete a task. Communication and coordination, as a means of interaction among robots, is essential to the accomplishment of teamwork effectively [77]. The primary objective of coordination is to have a team of autonomous robots work together efficiently to achieve a collective team behavior through local interaction. Recent advances in science and technology in the fields of microelectronics, computing, communication and control systems have made it feasible to deploy a large number of autonomous robots to work cooperatively to accomplish civilian and military missions with the capability to significantly improve the operational effectiveness, reduce the costs, and provide additional degrees of redundancy. Coverage control, flocking, formation control and consensus are some of the problems in cooperative control of multi-robot systems [78]. Multi-robot coordination has been primarily inspired from nature as there are various coordination behaviours in animals. For instance, flocking in a school of fish to avoid predators and obstacles, flocking in a group of migrating birds, or a swarm of insects looking for food are some famous examples of coordinating behaviour of animals [79]. A seminal study in this area is the work of Reynolds in the 1980s, wherein the flocking behaviour of animals has been simulated [80], which shows that a mathematical study of the animals flocking can be used as a framework for cooperative control of multi-agent systems. Today we have a large number of industrial systems which are good examples of multi-agent coordination. An example is the deployment of sensors in an unknown environment [81] or clock synchronization [82] in wireless sensor networks. Formation flying of satellites is another example, which can be employed, e.g., for space interferometers and military surveillance [83, 84]. Multi-robot teams competitions, e.g., Robocup, are further useful samples of cooperation control of multi-agent systems [85]. Fig. 1.1 shows the configuration of multi-robot systems [78]. As depicted in this figure, there are three main components in multi-robot systems, which are: agent dynamics, interagent interactions and cooperative control laws. Describing agents dynamics depends on the complexity of the agents, and in most cases, a first-order or second-order dynamics is used to model the agents. In some circumstances, the agents are described by nonlinear models, and some uncertainties or disturbances are taken into account. Note that the agents in a multi-agent system are dynamically decoupled; therefore, they must be coupled through another way enabling them to cooperate. Exchanging information 6 Agent Dynamics Cooperative Control Laws Inter-Agent Interactions Figure 1.1: Configuration of multi-agent systems through a communication network is a method by which the agents can interact with each other. The information which is exchanged among the agents can be their odometry data, the data of the environment they explore, e.g., maps, and the information about the targets they detect. Direct sensing is another way by which the agents can communicate, for example, a robot can detect the other robots’ positions by its sensors such as sonars, lasers or cameras. It is very beneficial to represent the topology of the communication between the robots themselves and with a center in a multi-robot system by a graph [86]. To put it simply, the agents of a multi-robot system are equal to the nodes in the related graph, and an edge between two nodes in the graph implies that there is a communication between two related robots. As the communication between robots can be one-way or two-way, the related graph is directed or undirected. Furthermore, if the robots are always connected via a communication network, the related graph is static meaning that its edges are not time varying. On the other hand, due to the limited communication range of the robots, they sometimes get disconnected. Thus, the corresponding graph will be dynamic, i.e., the edges of the graph vary over time. In multi-robot systems, cooperative control laws are applied via a control center or distributed among all agents; in agreement with the agent dynamics and the interaction topology. Therefore, coordination control in a multi-robot system is classified into two main categories: centralized and decentralized which will be discussed in the next section. Also, we describe some related problems of cooperative control such as formation control, consensus and flocking later in this chapter. For more detail on these topics and issues of multi-robot cooperation control, see [87–91] and the references therein. Networked control systems are another increasingly important area in multi-robot systems [92]. It has already been common to consider the control and communication as two separate parts in a system. Usually in control theory, we consider that dynamical systems are connected via ideal channels, whereas communication theory studies data transmission over non-ideal channels. Actually, networked control systems are the combination of these two theories. Since the control signals in multi-robot systems are transmitted through imperfect communication channels with a limited capacity, it is more practical to study them as networked control systems [93–97]. In this report, we consider a multi-robot system as a network, and a decentralized coordination control is applied by which the robots share their information via wireless communication; therefore, our multi-robot system is an example of a networked 7 control system with various communication limitations. 1.4 Centralized vs. Decentralized For a cooperative control problem, designing an appropriate controller to carry out the desired team goal is the primary task [89]. Centralized approach and decentralized (or distributed) approach are two major ways to control multi-robot systems [98–101]. In centralized control systems , there is no communication between robots at all, and the robots are controlled by a central unit which is responsible for the team coordination. Although multi-robot centralized systems are easier to implement and apply, decentralized control has important advantages so that it has recently brought researchers to pay more attention to it. Also in some applications, it is hard or even impossible to use a centralized control; then, using a decentralized system is inevitable. Several constraints are imposed by a centralized control such as limited wireless communication range, the short sensing capability of sensors, high cost, limited resources and energy, and large size of vehicles to manage and control or even infeasible to implement [89]. In decentralized control, there is not any control center; thus, the algorithm is such that the control procedure is distributed among the agents. In other words, all the robots in a decentralized control system are autonomous robots which are controlled by relatively simple control rules [102, 103]. Thus, decentralized control only relies on local information of a robot itself and the information that it receives from the other robots of the team; usually the information from its neighbours. The decentralized control approach has many advantages in achieving cooperative team performances, specifically with low operational costs, less system requirements, high robustness, strong adaptivity, and flexible scalability; therefore, has been widely recognized and appreciated [89]. In decentralized control of multi-robot systems, the primary goal typically is to have the whole team working in a cooperative way throughout a distributed law. Here, cooperative means an interaction among all the robots in the team via sharing their information. Therefore, one of the main issues in decentralized control systems is how the robots share their information among themselves. When the robots of a team collaborate to achieve a goal based on an algorithm, they need to share their information. That information can be their motion’s data like position and velocity, the maps they build during the search procedure or the information about the targets they detect. Moreover, in multi-robot systems, a control algorithm must consider some practical limitations such as memory usage [104], processing speed [105] and communication bandwidth [106]. One shortcoming of decentralized control is that some robots cannot predict the team behavior based only on the available local information from their neighbours; so a team behavior cannot be controlled. In addition, in a complicated task where the goal is to optimize a global cost, the decentralized control may suffer from the lack of competence. Therefore, it would be interesting to assess a balance between decentralization and centralization so as to achieve further improvement in overall performance. 1.5 Consensus Variables Rule Consensus problem in networks is a cooperative behavior used in many fields of studies such as sensor networks [107–109], mobile communication systems, unmanned vehicles, distributed computing as well as multi-robot systems [110]. The first serious discussions and analysis of 8 consensus problems started with distributed computing in computer science [111, 112]. Vicsek presented a model for studying collective behavior of interacting self-propelled particles, which is a basis for modeling of many animals behaviours such as a school of fish, flock of birds and swarm of insects [113, 114]. Later, a mathematical justification for the Vicsek model was proposed in [115], and a general framework of the consensus problem for networks of integrators was provided in [116]. There is a large volume of published studies describing the role of consensus problems; see, e.g., [89, 90, 117, 118] and the references therein. In the case of multi-robot systems, the consensus is an important and fundamental problem that means reaching a consensus on an amount for one or more variables. For example, the robots communicate with each other to agree on a particular value for their speed and direction. They share their information and also exchange their calculations based on a rule called consensus algorithm [119]. Consensus algorithms are widely used in multi-robot systems such as formation control [120], flocking [121], and coverage control [122, 123]. In this report, we apply an algorithm based on consensus variables, by which the robots eventually reach an agreement on a common triangular grid. Hence, they can be located on some vertices of that grid and begin the search operation by moving through the vertices of the grid. Furthermore, in another algorithm proposed for formation building, a control rule based on the consensus variables rule is employed. 1.6 Mapping Mapping and map merging are two other challenging problems in multi-robot systems. In single robot systems, a robot makes its map and utilizes it only by itself of course since there is nobody else to share with. On the other hand, in multi-robot systems, each robot makes its map which is used by the other robots, getting better performance in an operation. Therefore, map merging is essential for multi-robot systems; however, it is a challenging issue due to the different coordinate systems of the robots. Researchers proposed several methods for mapping and map merging in multi-robot systems. One solution is based on a global or local positioning system [124] which is not available in many conditions. Another approach assumes that all robots know their positions in a shared map [17]. There are also methods that merge maps of different robots to build a shared map of the environment [125, 126]. Geometric grid based [127] and topological maps [128] are two main methods for map making of mobile robots. Although geometric grid based method is more accurate for the case where the grid size is small enough, it needs considerable memory and takes a remarkable time to process; especially for map merging in multi-robot systems. Thus, in multi-robot systems, topological maps are more efficient and feasible. In this report, we use a kind of topological map, described in detail in Chapter 2. 1.7 Formation Building In the field of multi-robot systems, formation control has been the subject of many classic studies in the past two decades. The purpose of formation control is to drive a group of agents to some desired states; for example, to build a geometric pattern. There are some multi-robot applications such as remote sensing, patrolling, search and rescue wherein it is helpful if the robots move with a desired geometric formation. Therefore, the research about distribution 9 formation control of a team of mobile robots has become a new challenging area for researchers in recent years; see, e.g., [129–133] and the references therein. The notable difference between general distributed control approach and the approaches that are used for a team of mobile robots is that in the second case, there is no dynamic coupling among the robots; meaning that the robots do not directly affect each other. Based on the distributed control approach, each robot uses the information provided by its nearest neighbouring robots in order to update its linear and angular velocities at discrete time instants. There are some articles on this topic that proposed a distributed control algorithm by which the robots will eventually move with the same heading and speed; see, e.g., [134–136]. The more challenging problem is to apply a distributed control algorithm to force the robots to move so that they finally build a desired geometric pattern. Furthermore, formation building in the existence of obstacles is even a more difficult problem. Many of the articles presented in this area consider a simple linear model for the motion of the robots without constraints on the control inputs; see, e.g., [137–139]. In particular, these simple models do not consider the essential standard constraints on the angular and linear velocities. Indeed, all actual vehicles such as Unmanned ground vehicles (UGVs) and unmanned aerial vehicles (UAVs) have standard hard constraints on their angular and linear velocities [140]. For example, with no constraints on the angular velocity, it may become a large value which results in a small turning radius for the robots that is impossible to obtain with actual robots. Therefore, the linear system approaches considered without constraints on the control inputs are not applicable. In [106], an algorithm of flocking for a group of wheeled robots described by the unicycle model with hard constraints on angular and linear velocities was proposed; however, the much more challenging problem of formation building was not considered. We consider a more difficult problem of formation building where a nonlinear model with hard constraints on the angular and linear velocities describing the robots. Communication between the robots is another issue that was considered in many of the papers in this area. However, most of such publications consider leader-follower in the team; therefore, they must consider quite restrictive classes of robot communication graphs; see, e.g., [141, 142]. In some other papers, robots communication graph is assumed to be minimally rigid [143, 144] or time-invariant and connected [145] which is also quite restrictive. The existence of obstacles in the environment is the other problem that has been considered in a lot of recent research on mobile robots control methods; see, e.g., [44, 146–152] and the references therein. The problem of existence of obstacles in the environment is not considered in most references mentioned above for formation building methods [153]. However, some papers assume obstacles in the environment and include an obstacle avoidance method in their proposed algorithms; see, e.g., [154–156] and the references therein. In [154], it was assumed that the shape of the obstacle is convex and known to the robots. Obstacle avoidance strategy in [155] is based on the concept of impedance with fictitious forces. The technique for obstacle avoidance of mobile robots in [156] relies on a rotational potential field. In this report, we consider the problem of distributed control of a team of autonomous mobile robots in which the robots finally move with the same direction and speed in a desired geometric pattern while avoiding the obstacles. We propose a distributed motion coordination control algorithm so that the robots collectively move in a desired geometric pattern from any initial position while avoiding the obstacles on their routes. Furthermore, we present the algorithm of formation building with anonymous robots meaning that the robots do not know their final position in the desired geometric configuration at the beginning; but, using a randomized algorithm, they will eventually reach a consensus on their positions. Also, we 10 propose a new obstacle avoidance method by which the robots maintain a given distance to the obstacles as well as mathematical justification of the proposed method. There are various applications for the suggested formation control algorithm such as sweep coverage [100,110,157], border patrolling [158], mine sweeping [159], ocean floor monitoring [160], and exploration in a sea floor [161]. 1.8 Contributions of This Report In this report, we propose some new methods for distributed control of a multi-robot team which its duty is to search all or a part of an unknown region. The aim of the search can be either finding some targets in the region, patrolling the region frequently or putting some signs on particular points in the region. The suggested algorithms use a triangular grid pattern, i.e., robots certainly go through the vertices of a triangular grid during the search operation. To ensure that all the vertices of the region’s covering grid are visited by the robots, they must have a common triangular grid. In order to achieve that, we use a two-stage algorithm. In the first stage, robots apply an algorithm according to the consensus variables rule to deploy themselves on the vertices of a common triangular grid which covers the region. In the second stage, they begin searching the area by moving between the vertices of the common triangular grid. There are various scenarios can be used in the second stage. We propose three different methods for the second stage, namely, random triangular grid-based search algorithm, semi-random triangular grid-based search algorithm and modified triangular-grid-based search algorithm, which are presented in Chapters 3, 4 and 5, respectively. The proposed algorithms are partly based on ideas from [162] where a distributed random algorithm for self-deployment of a network of mobile sensors has been presented. In [162], authors have proposed a method to deploy a team of mobile sensors on the vertices of a triangular grid that covers the entire area of interest. Indeed, in the proposed search algorithms, we benefit from the triangular grid coverage to cover the entire area. It is clear that any triangular grid coverage of a region is a complete blanket coverage of that region. The main advantage of deploying robots in a triangular grid pattern is that it is asymptotically optimal regarding the minimum number of robots required for the complete coverage of an arbitrary bounded area [163]. Therefore, using the vertices of this triangular grid coverage, which is applied in this report, guarantees search of the whole region. One of the advantages of the proposed algorithms is the method by which the robots make and share their maps and use them for exploration. We use a kind of topological map, described in detail in the next chapters. Furthermore, we consider a region with an arbitrary shape that contains some obstacles. Also we assume the area is unknown to the robots a priori. In addition, mathematically rigorous proofs of convergence with probability 1 of the algorithms are given. Moreover, our algorithms are implemented and tested using Mobilesim, a simulator of the real robots and environment. Mobilesim is a powerful simulator which considers robots’ real circumstances such as dynamics of motion, encoders, sonar and also borders and obstacles of the environment. We also test one of the algorithms via experiments by real robots. In fact, we confirm the performance of the proposed algorithm with experiments with Adept Pioneer 3DX wheeled mobile robots in a real world environment. A further study on networked multi-robot formation building algorithm is presented in this report. We consider the problem of distributed control of a team of autonomous mobile robots in which the robots finally move with the same direction and speed in a desired geometric 11 pattern while avoiding the obstacles. We propose a distributed motion coordination control algorithm so that the robots collectively move in a desired geometric pattern from any initial position while avoiding the obstacles on their routes. In the proposed method, the robots have no information on the shape and position of the obstacles and only use range sensors to obtain the information. We use standard kinematic equations for the robots with hard constraints on the linear and angular velocities. There is no leader in the team, and the robots apply a distributed control algorithm based on the local information they obtain from their nearest neighbours. We take the advantage of using the consensus variables approach that is a known rule in multi-agent systems. Also, an obstacle avoidance technique based on the information from the range sensors is used. Indeed, we propose a new obstacle avoidance method by which the robots maintain a given distance to the obstacles. We consider quite general class of robot communication graphs which are not assumed to be time-invariant or always connected. Furthermore, we present the algorithm of formation building with obstacle avoidance with anonymous robots meaning that the robots do not know their final position in the desired geometric configuration at the beginning; but, using a randomized algorithm, they eventually reach a consensus on their positions. Mathematically rigorous proofs of the proposed control algorithms are given, and the effectiveness of the algorithms are illustrated via computer simulations. 1.8.1 Main Contribution Highlights The main contributions of this report are summarized as follows: • Three novel algorithms are proposed for search with multi-robot systems. The detailed descriptions of the proposed algorithms are presented. • The suggested algorithms use a triangular grid pattern, i.e., robots certainly go through the vertices of a triangular grid during the search procedure. The main advantage of using a triangular grid pattern is that it is asymptotically optimal in terms of the minimum number of robots required for the complete coverage of an arbitrary bounded area. Therefore, using the vertices of this triangular grid coverage, what is applied in this report, guarantees complete search of all the region as well as better performance in terms of search time. • We use a new kind of topological map which robots make and share during the search operation. • We consider a region with an arbitrary shape that contains some obstacles; also, we assume the area is unknown to the robots a priori. • Unlike many existing heuristic methods, we give mathematically rigorous proofs of convergence with probability 1 of the proposed algorithms. • We present an extensive simulation study for the proposed algorithms using a powerful simulator of real robots and environment. The results confirm the effectiveness and applicability of the proposed algorithms. 12 • To evaluate the performance of the algorithms, the experiment results with real Pioneer 3DX mobile robots are presented for one of the search algorithms with detailed descriptions and explanations. The results demonstrate the features of the proposed algorithms and their performance with real systems. • We compare the proposed search algorithms with each other and also with three algorithms from other researchers. The comparison shows the strength of our algorithms over the other existing algorithms. • The problem of formation building for a group of mobile robots is considered. A robust decentralized formation building with obstacle avoidance algorithm for a group of mobile robots to move in a defined geometric configuration is proposed. Furthermore, we consider a more complicated formation problem with a group of anonymous robots where the robots are not aware of their position in the final configuration, and have to reach a consensus during the formation process. We propose a randomized algorithm for the anonymous robots which achieves the convergence to the desired configuration with probability 1. • We give mathematically rigorous proofs of convergence of the proposed algorithms for formation building and also computer simulation results to confirm the performance and applicability of our proposed solution. • A novel obstacle avoidance rule is proposed which is used in the formation building algorithms. 1.9 Report Outline The remainder of this report is organised as follows: In Chapter 2, we describe the problem statement, defining the search problem in details and shedding some lights on terms, assumptions and definitions used in this report. Then, the first stage of the proposed search algorithms is presented that is the consensus variables locating algorithm by which the robots will be located on the vertices of a common triangular grid. A mathematically proof for the presented algorithm is given as well as some simulation results. Whenever all the robots are located on the vertices of a common triangular grid, the search operation starts by moving the robots between the vertices of the common triangular grid. The first method of search that we propose is the random triangular grid-based search algorithm presented in Chapter 3. Using this algorithm, the robots randomly move through the vertices of the common triangular grid during the search operation. Therefore, a complete search of the whole area is guaranteed. We give a mathematically rigorous proof of convergence of the presented algorithm as well as the computer simulation results to demonstrate that the algorithm is effective and practicable. In a similar way, in Chapter 4, the semi-random triangular grid-based search algorithm is presented along with a mathematically rigorous proof of the algorithm and computer simulation results. In Chapter 5, the modified triangular grid-based search algorithm is given, and a mathematically rigorous proof of the algorithm along with computer simulation results are presented. In addition, the experiment results with Pioneer 3DX wheeled mobile robots are presented to confirm the performance of our suggested algorithm. Finally, a comparison between the proposed triangular grid-based search algorithms in Chapters 3, 4 and 13 5 against three other algorithms are given. Chapter 6, describes a distributed motion coordination control algorithm so that the robots collectively move in a desired geometric pattern from any initial position while avoiding the obstacles on their way. Also, a randomized algorithm for the anonymous robots which achieves the convergence to the desired configuration is presented. Mathematically rigorous proofs of the proposed control algorithms are given, and the effectiveness of the algorithms are confirmed via computer simulations. Chapter 7 summarizes the work that is presented and discusses possible future research projects as an extension of the presented work. 14 Chapter 2 Consensus Variables Locating Algorithm Consensus problem in networks is a cooperative behavior used in many fields of studies such as sensor networks, mobile communication systems, unmanned vehicles, distributed computing as well as multi-robot systems. In the case of multi-robot systems, it means reaching a consensus on an amount for one or more variables. For example, the robots communicate with each other to agree on a specific value for their speed and direction. They share their information and also exchange their calculations based on a rule called consensus algorithm [119]. In the next three chapters, we present some search algorithms regarding that an area is explored by a team of mobile robots to explore the entire area or to find some targets. The presented algorithms are grid-based search algorithms meaning that the robots certainly pass through the vertices of a grid; a triangular grid in our algorithms. Therefore, for the first step, all the robots must be located on a common triangular grid to start the exploring operation. To accomplish that, we apply an algorithm based on consensus variables, by which the robots eventually reach an agreement on a common triangular grid. Hence, they can be located on some vertices of that grid and begin the search operation by moving through the vertices of the grid. In this chapter, the problem statement is described firstly, which defines the problem of search in details. We also give some terms, assumptions and definitions used in this chapter and Chapters 3, 4 and 5. Then, the first stage of the proposed search algorithms is presented that is ”consensus variables locating algorithm” by which the robots will be located on the vertices of a common triangular grid. A mathematically rigorous proof of the presented algorithm is given as well as some simulation results. 2.1 Problem statement Consider a planar and bounded area R. Also, consider a few number of obstacles O1 ,O2 ,. . . Om inside the area R (see Fig. 2.1). The goal is to search the whole area by a few autonomous mobile robots in order to find some targets. The number of targets may be known or unknown to the robots. We use a distributed algorithm to drive the robots inside the search area as well as avoiding the obstacles and borders. The algorithm is such that the robots follow a pattern to search. The proposed pattern is a triangular grid so that the robots search the area by moving through the vertices of that triangular grid. The grid consists of equilateral triangles with sides 15 Figure 2.1: A triangular grid (dotted area) covers the search area r. Fig. 2.2 shows this triangular grid that covers the searching area. It is assumed that the robots are equipped with sensors to detect the targets, and these sensors have a circular sensing area with radius rs . As shown in Fig. 2.2, the small circles of radius rs with centers located on the vertices of the triangular grid are the sensing ranges of the robots. It means that robot i can gather information of or detect a target if it is located in a disk of center pi (k) with radius rs defined by Di,rs (k) := {p ∈ R2 : kp − pi (k)k ≤ rs }, where k indicates discrete time instances; k = 0, 1, 2, . . ., pi (k) ∈ R2 denotes the Cartesian coordinates of robot i at time k and k · k denotes the Euclidean norm. As demonstrated in Fig. 2.2, to have an optimal search operation, the common areas of the robots’ sensing regions (small √ circles) must be minimum. To achieve this goal, we assume r = 3rs . However, this is for an ideal and optimal case but in practice where there is sensor √ noise and/or position uncertainty, the triangles sides r can be chosen a little smaller than 3rs that reduces the possibility of unexplored areas. One of the main benefits of multi-robot systems is that robots share their information in order to improve the strength of the search algorithm in terms of time and cost. The information includes the position of robots, maps, explored areas and detected targets. We assume that the robots share their information via a wireless communication so that a robot always sends new information it obtains to the other robots and also listens to receive new information from them. Due to the limited communication range of the robots, we assume rc as the communication range that is the same for all the mobile robots. It means that a robot can only receive information from the robots which are located not further than rc . Therefore, the range of communication for a robot can be defined as the disk of Di,rc (k) := {p ∈ R2 : kp − pi (k)k ≤ rc }. In Fig. 2.2, the big circle of radius rc is the communication range of robot A, meaning that robot A can communicate with robot B but not with robot C. The multi-robot system under consideration is an example of networked control systems in which coordinates and heading of neighbouring robots can be estimated from distance based measurements using robust Kalman state estimation and model validation techniques via limited communication with each robots neighbours; see, e.g., [164–167]. Definition 2.1.1 Robot j is a neighbour of robot i at time k if it is located on the disk Di,rc (k). So, N i (k) = {j : pj ∈ Di,rc (k), j ∈ {1, 2, . . . , n}, j 6= i} is the set of all neighbours of robot i at time k. Also, |N i (k)| denotes the number of its neighbours. 16 Communication range Sensing range Triangular grid Node A B C Figure 2.2: Robots on vertices of a triangular grid; small circles are robots’ sensing ranges and big circle is the communication range of robot A It is essential for the robots in any search operation to make the map of the searching area when it has not been available already to the robots. That helps the robots to keep the information of the search operation in their memory for future use or to send it to a center or to the other robots of the search team. The problem of mapping is a challenging problem especially when there is a team of robots instead of only one robot. The main problem is merging the maps which are made by different robots. It is much easier for robots to make maps and merge them in the case that there is a central control station or when robots can use a central positioning system like GPS. On the other hand, without a central positioning system, robots have to make their map themselves in their own coordinate systems. Furthermore, the information of maps needs lots of memory also processing of maps for merging is a time consuming task. In such cases , i.e., distributed systems, it is useful to employ topological maps instead of grid geometry maps that need a considerable amount of memory. In this report, we take advantage of using a kind of topological map that robots make and share among themselves. It is also assumed that the searching area is unknown to all the robots a priori. Therefore, robots have to make the map of the area during the search operation. To define the problem, we utilize definitions of [122]. Also, to clarify some terms in the rest of this report, and to state our theoretical results, we introduce a number of assumptions and definitions. Assumption 2.1.1 The area R is bounded and connected; also, the obstacles On are nonoverlapping, closed, bounded, and linearly connected sets for any n ≥ 0. Definition 2.1.2 Let O := ∪On for all n ≥ 0; then, introduce W := { p ∈ R: p ∈ / O}. 17 As mentioned before, the robots can detect borders of the area R and all the obstacles therein. Accordingly, W is actually those points in the area R that the robots can go there during the search operation. Also, our search procedure is so that robots go through vertices of a triangular grid that covers this area and cuts the plane into equilateral triangles. A triangular grid can be determined by its vertices; therefore, when we say a triangular grid, it means the set of all the vertices of it. It is obvious that there exists an infinite number of triangular grids. Definition 2.1.3 Consider T , one of the all possible triangle grids that covers the area R. T̂ := T ∩ W is called a triangular grid set in W (see Fig. 2.1). Simply, T̂ is the set of all vertices of the covering triangular grid which robots must visit during the search operation. Since we use topological maps, T̂ is actually the map of W. Definition 2.1.4 A set consisting of all the vertices of a triangular grid in an area is called a map of that area. In fact, what the robots actually save in their memory as maps, are the coordinates of the vertices. A robot can also put some tags on these vertices to assign some attributes like visited, unvisited, occupied, etc. The robots share their maps with their neighbours too. The relationships between robots can be defined by an undirected graph G(k). We assume that any robot of the multi-robot team is a node of the graph G(k) at time k, i.e., i in VG = {1, 2, . . . , n} , the node set of G(k), is related to robot i. In addition, robot i is a neighbour of robot j at time k if and only if there is an edge between the nodes i and j of graph G(k) where i 6= j. Therefore, the problem of communication among the team of robots equals the problem of the connectivity of the related graph. It is undeniable that it does not need for robot i to be the neighbour of robot j to get the information from it. The information can be transferred through the other robots which connect these robots in the related graph. Fig. 2.2 shows this condition in which robot A cannot directly communicate with robot C but can do it through robot B. To guarantee the connectivity of the graph, we accept the following assumption [115]. Assumption 2.1.2 There exists an infinite sequence of contiguous, non-empty, bounded, timeintervals [kj , kj+1 ), j = 0, 1, 2, . . ., starting at k0 = 0, such that across each [kj , kj+1 ), the union of the collection {G(k) : k ∈ [kj , kj+1 )} is a connected graph. Since the main goal of the proposed algorithm is to search an area in such a way that robots certainly go through the vertices of a triangular grid, firstly, robots have to be located on some vertices of that grid. Thus, we divide our algorithm into two stages. In the first stage, robots make a common triangular grid in order to be finally located on some vertices of it. To achieve this goal, we apply consensus variables method which is a known distributed method for multi-robot systems [117]. In the second stage, robots start to search the area based on moving between the vertices of the created grid which is common among all the members of the team. In this chapter, we introduce the first stage of our search algorithms named consensus variables locating algorithm. Then, we propose three different algorithms for the second stage of our algorithms in Chapters 3, 4 and 5. 18 2.2 Consensus Variables Locating Algorithm We propose some two-stage search algorithms so that in the first stage, using a consensus variables rule, robots make a triangular grid that is common among all the members of the team [122]. In the beginning, robots are located anywhere in the area W. Each robot can assign its position and heading angle respect to its own coordinate system. The center of a robot at the starting point is assumed to be the origin of its coordinate system, and its heading vector as the x-axis. To define a unique triangular grid with equilateral triangles in a plane, we only need a point and an angle. Thus, the point q which is any vertex of the grid together with the angle θ that is the angle of the grid, uniquely defines the triangular grid T̂ [q, θ] that covers the area W (see Fig. 2.1). We consider that at the beginning, the triangular grid that a robot makes for itself at each vertex, is based on the position and heading of the robot that are q and θ, respectively. Accordingly, each robot has its own grid that is different from the other robots’ grids. To combine these different grids to a unique grid which will be common among all robots, we apply the consensus variables approach. We assume that at any time k, robot i has two consensus variables; qi (k) and θi (k) on which it builds its triangular grid T̂ [qi (k), θi (k)]. At first, these consensus variables are not the same for different robots, so their triangular grids are not the same as well. Using the proposed algorithm will bring the consensus variables qi (k) and θi (k) from different values of qi (0) and θi (0) to the same values of q0 and θ0 for all the robots. That is, a common triangular grid for all the members of the team is built based on q0 and θ0 which are the same for all. Assumption 2.2.1 The initial values of the consensus variables θi satisfy θi (0) ∈ [0, π) for all i = 1, 2, . . . , n. Definition 2.2.1 Consider p be a point on the plane; also, q and θ are a vertex and an angle that build the triangular grid T̂ [q, θ]; then, C[q, θ](p) will be the closest vertex of T̂ [q, θ] to p. If there is more than one vertex, any of them can be chosen. Now, we propose the following rules as the consensus variables locating algorithm: θi (k + 1) = θi (k) + Σj∈Ni (k) θj (k) ; 1 + |Ni (k)| qi (k + 1) = qi (k) + Σj∈Ni (k) qj (k) 1 + |Ni (k)| (2.1) pi (k + 1) = C[qi (k), θi (k)](pi (k)) (2.2) The rule (2.1) causes that the robots reach consensus on heading using θi and gain consensus on phase shift using qi . Based on q and θ calculated by each robot using rule (2.1), a robot makes a triangular grid for itself, which is used in rule (2.2). Fig. 2.3 illustrates the rule (2.1). Suppose that there are four robots in the environment. At time k, robots R2 and R3 are located in the communication range of robot R1 but robot R4 is out of the range. Therefore, only robots R2 and R3 are the neighbours of robot R1. As a result, robot R1 updates variable θ1 using the information from R2 and R3, i.e., θ1 (k + 1) will be the average of θ1 , θ2 and θ3 at time k (see Fig. 2.3(a)). In a similar way, the variable q is updated as shown in Fig. 2.3(b). Rule (2.2) means that whenever a robot makes its triangular grid, it will move to the nearest vertex on it. Fig. 2.4 demonstrates this stage in which robot i located at pi (k) at time k, makes 19 3(k) 1(k 1) R3 1 ( k ) R1 rc 4(k) 2(k) R2 R4 (a) q3 (k ) rc R3 R1 R1 q1 (k ) q1 (k  1) q4 (k ) q2 (k ) R4 R2 (b) Figure 2.3: Updating consensus variables θ and q using the information from the neighbours 20 the triangular grid T̂ [q, θ] using θi (k) and qi (k). Then, it moves to the nearest vertex of the grid, which will be the position of robot i at time k + 1, i.e., pi (k + 1). Since rule (2.1) brings the same q and θ for all the robots, they eventually will build a common triangular grid, and they all will be located on its vertices. Tˆ[q i ,  i ] p (k) i p (k 1) i q (k ) i  i (k ) 21.0° Figure 2.4: A robot moves to the nearest vertex of its triangular grid Remark 2.2.1 The robots initially do not have a common coordinate system; otherwise, the consensus building problem would be trivial. Therefore, each robot has consensus variables θi (k) and qi (k) in its own coordinate system. However, each robot knows the bearing and the distance to each of its neighbouring robots. Using this information, at any time instance k, robot i sends to a neighbouring robot j the consensus variables θi (k) and qi (k) re-calculated in the coordinate system with the line (pi , pj ) as the x-axis, pj as the origin, and the angle θi (k) is measured from this axis in counter-clockwise direction. Using this information, each robot can re-calculate the sums (2.1) at each time step in its own coordinate system [122]. Theorem 2.2.1 Suppose that Assumptions 2.1.1, 2.1.2 and 2.2.1 hold, and the mobile robots move according to the distributed control law (2.1), (2.2). Then, there exists a triangular grid set T̂ such that for any i = 1, 2, . . . , n, there exists a τ ∈ T̂ such that lim pj (k) = τ . k→∞ Proof of Theorem 2.2.1: Assumption 2.1.1 and the update rule (2.1) guarantee that there exist a θ0 and q0 such that θi (k) → θ0 , qi (k) → q0 ∀i = 1, 2, . . . , n (2.3) (see [115]). Furthermore, the update rule (2.2) guarantees that pi (k + 1) ∈ T̂ [qi (k), θi (k)]. Therefore, this and (2.3) guarantee that lim pi (k) = τ where τ ∈ T̂ [q0 , θ0 ]. This completes k→∞ the proof of Theorem 2.2.1.  21 2.3 Simulation Results To verify the suggested algorithm, computer simulations are employed. The region W is considered to be searched by a few robots (see Fig. 2.1). We suppose a multi-robot team with three robots which are randomly located in the region W with random initial values of angles. The goal is locating the robots on the vertices of a triangular grid by applying algorithm (2.1),(2.2). Table 2.1: Simulation Parameters Linear speed (default) Linear speed (Maximum) Angular speed (default) Angular speed (Maximum) Linear acceleration Angular acceleration Linear deceleration Angular deceleration 0.4 0.4 1.3 1.74 0.3 1.74 0.3 1.74 Localization method Localization origin Odometry [0 0 0] Odometry error Number of sonars Minimum view Maximum view Field of view Noise Position (x, y θ) m/s m/s radian/s radian/s m/s2 radian/s2 m/s2 radian/s2 Localization x, y, θ Slip in x, y and θ (Uniform random distribution), [ 0.0075 0.0075 0.0075 ] proportional to velocity Sonar 16 0.1 meter 5 meter 30 degree 0.0005 meter 0.069, 0.136, 90 0.114, 0.119, 50 0.148, 0.078, 30 0.166, 0.027, 10 0.166, -0.027, -10 0.148, -0.078, -30 0.114, -0.119, -50 0.069, -0.136, -90 m,m, degree -0.157, -0.136, -90 -0.203 -0.119 -130 -0.237, -0.078, -150 -0.255, -0.027, -170 -0.255, 0.027, 170 -0.237, 0.078, 150 -0.203, 0.119, 130 -0.157, 0.136, 90 To simulate the algorithm, MobileSime, a simulator of mobile robots developed by Adept MobileRobots, is used. We also use Visual C++ for programming and ARIA, a C++ library that provides an interface and framework for controlling the robots. In addition, Pioneer 3DX is selected as type of the robots, and simulation parameters are given in Table 2.1. To prevent collisions between the robots and to avoid the obstacles and borders, an obstacle avoidance algorithm is applied using functions provided in ARIA library. Furthermore, to avoid hitting and sticking to the borders, we assume a margin near the borders such that the robots do not pass it. The simulation results are shown in Fig. 2.5. Fig. 2.5(a) displays the initial position of the 22 (a) (b) Figure 2.5: Robots’ locations; (a) Initial locations of robots, (b) After applying the consensus variables locating algorithm robots at k = 0, which are randomly distributed in the area. Applying algorithm (2.1),(2.2) will result in locating the robots on the vertices of a common triangular grid. Routes of the robots and their final position depicted in Fig. 2.5(b) shows that they are eventually located at the desired places; on the vertices of a common triangular grid, at time 1m47s. 2.4 Summary In this chapter, the problem of searching an area by a team of mobile robots using grid-based algorithms has been presented. Some terms, definitions and assumptions have been defined that are used in the proposed algorithms. It has been confirmed that for a grid-based search, the robots must be located on the vertices of a common grid, first. That is a consensus rule named consensus variables locating algorithm has been employed as the first stage of the search algorithms, which locates the robots on the vertices of a common grid among all the robots; a triangular grid in our proposed algorithm. A mathematically rigorous proof of convergence of the presented algorithm has been demonstrated. Furthermore, the computer simulation results 23 using MobileSim, a powerful simulator of real robots and environment, have been presented to confirm that the algorithm is effective and practicable. In the next three chapters, three grid-based search algorithms will be proposed. The locating algorithm presented in this chapter will be employed as the first stage of those algorithms. 24 Chapter 3 Random Triangular Grid-Based Search Algorithm As described in Chapter 2, applying consensus variables locating algorithm as the first stage of a search algorithm, locates all the robots on the vertices of a common triangular grid. After that, the search operation is started by moving the robots between the vertices of the common triangular grid. The first method that we apply for search is ”random triangular grid-based search algorithm”. By this method, the robots randomly move between the vertices of the common triangular grid so that in each step they only move to the one of the six neighbouring vertices. A mathematically rigorous proof of convergence with probability 1 of the algorithm is given. Moreover, our algorithm is implemented and simulated using a simulator of the real robots and environment. The other methods will be presented in Chapters 4 and 5. 3.1 Distributed Random Search Algorithm In order to search an area by a team of mobile robots using the vertices of a grid as the exploring points, we need to locate the searching mobile robots on the vertices of a common grid among the robots. Consensus variables locating algorithm (described in Chapter 2) can be the first stage of the suggested search algorithm, which locates all the robots on the vertices of a common triangular grid T̂ (see Fig. 2.1). The next step will be search of the area W based on moving the robots between the vertices of the covering grid of the area. In this chapter, we propose a random triangular grid-based search algorithm. Suppose a robot located on a vertex of the common triangular grid. Consequently, it can explore the surrounding area using its sensors, and that depends on the sensing range of its sensors. After exploring that area, the robot moves to another point which can be one of the six neighbouring vertices in the triangular grid. As the first method, we suppose that selecting the neighbouring vertex is random. In this regard, there are a few scenarios can be considered to search the area. The first scenario is exploring the whole area which can be applicable when the robots are searching for an undetermined number of targets. Therefore, to detect all possible targets, the team of robots must search the whole area. Patrolling of the area is the other application for this scenario where the robots should move continuously to detect the possible intruders to the area. In the case of given number of targets which is our second scenario, the search operation should be stopped whenever all the targets are detected without searching the whole area. 25 3.1.1 Searching the Whole Area To make sure that the whole area is explored by the team of the robots, each vertex in the triangular covering grid set of the area W must be visited at least one time by a member of the team. Consider T̂ is a triangular covering grid of W, and also each vertex of T̂ has been visited at least one time by a robot of the team. This guarantees that the area W has completely been explored by the multi-robot team. Since the robots do not have any map at the beginning, they need to do map making during the search operation so that their maps will gradually be completed. Definition 3.1.1 Let S T̂i (k) be the set of all the vertices of T̂ have been detected by robot i at time k. Then, T̂ (k) = T̂i (k) will be the map of the area W detected by the team of the robots until time k. Note that a detected vertex is different from an explored vertex. These terms are defined in detail in the following definitions. Definition 3.1.2 A detected vertex means that vertex is detected by a robot using map making, and it is in the map of that robot though it might be visited or not by the robots. Definition 3.1.3 An explored vertex is a vertex that is visited by, at least, one member of the team. Definition 3.1.4 The map of robot i at time k, Mi (k), is the set of the vertices in T̂ detected by robot i itself or received from other robots by which they are detected until time k. Definition 3.1.5 Suppose a Boolean variable Vτ (k) which defines the state of vertex τ ∈ T̂ (k) at time k. Vτ (k) = 1 if the vertex τ has already been visited by, at least, one of the robots, otherwise Vτ (k) = 0. Assumption 3.1.1 The triangular grid set T̂i (k); k = 0, 1, ... is a connected set. That means that if τ ∈ T̂i (k), then, at least, one of the six nearest neighbours of τ also belongs to T̂i (k). Let ℵ(pi (k)) be a set containing all the closest vertices to pi (k) on the triangular grid T̂ (k); also, consider |ℵ(pi (k))| as the number of elements in ℵ(pi (k)). It is clear that 1 ≤ |ℵ(pi (k))| ≤ 6. In addition, assume ν be a randomly opted element of ℵ(pi (k)). Consider at time k robot i is located at point pi (k), and it wants to go to the next vertex. The following rule is proposed as the random triangular grid-based search algorithm: ( ν if |M̂i (k)| = 6 0 with probability |ℵ(pi1(k))| (3.1) pi (k + 1) = pi (k) if |M̂i (k)| = 0 where M̂i (k) = {m ∈ Mi (k); Vm (k) = 0} is the set of all elements of Mi (k) have not been visited before, and |M̂i (k)| denotes the number of elements in M̂i (k). Applying the rule (3.1) ensures that the area T̂ is completely explored and every vertex of it is visited at least one time by a robot of the team. Theorem 3.1.1 Suppose that all assumptions hold, and the mobile robots move according to the distributed control law (3.1). Then, for any number of robots, with probability 1 there exists a time k0 ≥ 0 such that Vτ (k0 ) = 1; ∀τ ∈ T̂ . 26 Proof of Theorem 3.1.1: The algorithm 3.1 defines an absorbing Markov chain which contains many transient states and a number of absorbing states that are impossible to leave. Transient states are all the vertices of the triangular grid T̂ which have been visited by the robots during the search procedure. On the other hand, absorbing states are the vertices where the robots stop at the end of the search operation. Using the algorithm 3.1, a robot goes to the vertices where may have not been visited yet. Therefore, the number of transient states will eventually decrease. This continues until the number of the robots is equal to the number of unvisited vertices which will be the absorbing states. It is also clear that these absorbing states can be reached from any initial states, with a non-zero probability. This implies that with probability 1, one of the absorbing states will be reached. This completes the proof of Theorem 3.1.1.  In Fig. 3.1, the flowchart of the proposed algorithm is presented that shows how our decision-making approach is implemented. At the first step, robots start making their maps using their sonar. Each robot, based on the vertex on which it is located, assumes some probable neighbouring vertices on the common triangular grid. The number of these probable neighbouring vertices and their distance to the robot depend on the robot’s sonar range. Then, the robot uses the sonar to detect its surrounding environment including borders and obstacles. If any of those probable neighbouring vertices is located outside the borders or blocked by an obstacle, it will be ignored. The rest of those probable neighbouring vertices will be added to the map of the robot. This step is repeated every time that the robot occupies a vertex. In order to avoid sticking in borders or obstacles, we consider a margin near the borders and obstacles that depends on the size of the robot. If a vertex on the map is closer to the borders or obstacles less than the margin, it will be eliminated from the robot’s map. Whenever a robot makes any changes to its map, it sends the new map to the other robots by transmitting packets. On the other side, whenever a robot receives a packet of data, it extracts the new vertices from the received map and adds them to its map. Since the communication range of the robots is limited, if two robots are far from each other, they cannot directly communicate but can do it via other robots. In other words, since there is a connected network of robots, each robot has the role of a hub in the network in order to share the maps among the robots. Therefore, all the robots that are connected and make a network have a common map. In the second phase of the algorithm when the robots have a common triangular grid map, a robot can go far from the other robots and be disconnected from the team for a while. In this case, sharing maps between disconnected robot and the others is paused until the robot returns back to the communication range of the team again. In the next step, each robot randomly chooses one of the nearest neighbouring vertices in the map and goes there. Since we assume that the map of a robot is a connected set, there exists always at least one neighbouring vertex, and at most six vertices. If the robot reaches the target vertex, it marks that vertex as an explored vertex in its map and sends it to the other neighbouring robots as well. However, because of some practical issues, maybe it is impossible to reach the target vertex at a limited time or even maybe the target vertex is fake that has been wrongly created during mapping. To avoid such problems, we include a factor of time. Since the robot knows its location and the location of the target, it can estimate the time needed to achieve the goal based on the distance to the target and velocity of the robot. Here, we consider the parameter ET as the expected time to reach the target, that is a factor of the estimated time. This coefficient that has a value greater than one, actually reflects the effects of a non-straight route because of the shape of the search area and also existing obstacles or other robots on the robot’s path. If the travelling time were more than ET, the robot would 27 Start No Is there any unexplored vertex in the map? Stop Yes Are vertex already in the map? Mapping Detect new vertices in the area using sonar Yes No Add vertex to the map Ignore it Select one of the nearest vertices in the map randomly Go to the selected vertex, Use obstacle avoidance No No Yes Yes Set the vertex as an explored vertex in the map Is time > ET? Delete the vertex from the map send map to other robots Received map from other robots? Yes Map merging No Communication & Sharing Has the selected vertex been reached? Navigation & Guidance Send updated map to other robots Figure 3.1: The flowchart of the suggested algorithm; searching the whole area ignore that target vertex, delete it from its map, and send the updated map to the other robots. Since the area has borders and obstacles, the robots should avoid them while they are searching for the targets. That is why we have to use an obstacle avoidance in our algorithm. In addition, because of practical problems such as sonar and encoders accuracy and slipping 28 of the robots, there might be the difference between the actual position of a robot and the coordinates of the vertices stored in its map. Therefore, if a robot is closer to a target vertex than a specified distance, we consider the goal has been achieved. 3.1.2 Searching for Targets When the robots are looking for some targets in the area, they should continue the search operation till all the targets are detected. If the number of the targets is not specified, they have to search the entire area like what described in Section 3.1.1. When robots know the number of the targets, they do not need to explore the entire area but until all the targets are detected. Suppose T = {T1 , T2 , . . . , Tnt } be the set of nt static targets should be detected by the robots. As it was stated before, we assume the robots equipped with sensors by which the targets can be detected whenever they are close enough to the robots. The distance by which the robots must be close to the targets to be able to detect them is the sensing range of the robots (rs ). Definition 3.1.6 Suppose a Boolean variable VTj (k) which defines the state of target Tj at time k. VTj (k) = 1 if the target Tj has been detected by at least one of the robots, otherwise Tj (k) = 0. Then, we modify the rule (3.1) as the following rule to ensure that the search operation stops after finding all the targets. ( ν if ∃Tj ∈ T; VTj (k) = 0 pi (k + 1) = (3.2) pi (k) if ∀Tj ∈ T; VTj (k) = 1 Theorem 3.1.2 Suppose that all assumptions hold, and the mobile robots move according to distributed control law (3.2). Then, for any number of robots and any number of targets, with probability 1 there exists a time k0 ≥ 0 such that ∀j ; VTj (k0 ) = 1. Proof of Theorem 3.1.2: Proof is similar to the proof of Theorem 3.1.1. The flowchart in Fig. 3.1 can also be used to describe this operation. Fig. 3.2 depicts the procedure we use to implement this algorithm. Most procedures are the same as the previous one; therefore, we ignore their description. We only need to change the condition that stops the operation in the algorithm. The operation will be stopped if all the targets are detected. Also, the robots send the information about the detected targets to the other members of the team. 3.1.3 Patrolling The above algorithms are appropriate for the cases when the robots should break the search operation; for instance, when the aim is finding some predetermined objects or labeling some vertices of a grid. In cases where a permanent search is needed; for example, in applications such as continuously patrolling or surveying a region, the algorithm should be modified such that the search procedure maintains. To achieve that, we modify control law 3.1 as follows: 1 ; (3.3) |ℵ(pi (k))| hence, the robots do not stop and continuously move between the vertices of the grid. pi (k + 1) = ν with probability 29 Start Is there still any target to detect? Yes No Stop Mapping Navigation & Guidance Assign detected targets in the map Communication & Sharing Figure 3.2: The flowchart of the suggested algorithm; searching for targets 3.1.4 Robots’ Motion To have a more real estimation of time that the robots spend to search an area to detect the targets, we apply motion dynamics in our simulations. Besides, since the environment is unknown to the team, it is essential to use an obstacle avoidance in the low-level control of the robots. As a result, we use a method of reactive potential field control in order to avoid obstacles [168]. 3.2 Simulation Results To verify the suggested algorithm, computer simulations are employed. The region W is considered to be searched by a few robots (see Fig. 2.1). We suppose a multi-robot team consisting some mobile robots which are randomly located in the region W with random initial values of angles. The goal is to search the whole area or to find some targets by the robots using proposed random triangular grid-based search algorithm. To simulate the algorithm, MobileSime, a simulator of mobile robots developed by Adept MobileRobots, is used. We also use Visual C++ for programming and ARIA, a C++ library that provides an interface and framework for controlling the robots. In addition, Pioneer 3DX is selected as the type of the robots. Robots’ parameters in the simulations are given in Table 2.1. Since this simulator simulates the real robots along with all conditions of a real world, the results of the simulations would be obtained in the real world experiments with the real robots indeed. Furthermore, to prevent collisions between robots and to avoid the obstacles and borders, an obstacle avoidance algorithm is applied using functions provided in ARIA library. Moreover, to avoid hitting and sticking to the borders, we assume a margin near the borders such that the robots do not pass it. 30 (a) (b) (c) (d) Figure 3.3: Robots’ trajectories after applying the second stage of the algorithm; (a) After 2m19s, (b) After 7m38s, (c) After 16m50s, (d) After 29m44s 3.2.1 Searching the Whole Area As mentioned in Chapter 2, a two-stage algorithm is used to achieve the goal. First, the rule (2.1),(2.2) is applied which uses consensus variables in order to drive the robots to the vertices of a common triangular grid. In Fig. 3.3(a), the beginning of the robots’ trajectories are the position of the robots after applying the first stage of the search algorithm, i.e., rule (2.1),(2.2) (see Fig. 2.5). The second stage of the algorithm, i.e., the algorithm 3.1, is applied whenever the first stage is completed. Fig. 3.3 demonstrates the result of applying algorithm 3.1 on a team of three robots. As seen in Fig. 3.3, the robots go through the vertices of the common triangular grid based on the proposed algorithm until the whole area is explored by the robots. Fig. 3.3(a), Fig. 3.3(b) and Fig. 3.3(c) display the trajectories of the robots at times 2m19s, 7m38s and 16m50s after applying algorithm 3.1, respectively. Fig. 3.3(d) shows trajectories of the robots at time 29m44s when the search operation has been completed. It is obvious that the area W is completely explored by the robots such that each vertex of the covering triangular grid is occupied at least one time by the robots. In this case study, we assume that the sides of the equilateral triangles are 2 meter (sensing range of the robots is √23 m) and the communication range between the robots is 10 meter. The area of the region W is about 528 m2 . Although any number of robots can be used to search the whole area, it is evident that more robots complete the operation in a shorter time. However, more number of robots certainly increases the cost of the operation. The question is, how many robots should be used in order 31 to optimize both the time and cost. It seems, that is somehow dependent on the shape of the region and the obstacles and also the sides of the triangles. In order to have a better view of a relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to fifteen robots. Then, minimum, maximum, average and standard deviation are calculated for the search duration of each team. Table 3.1 displays the results of these simulations that are also depicted in Fig. 3.4. Table 3.1: Duration of search No of Robots 1 2 3 Min 74.16 40.42 27.86 21.21 16.43 16.85 15.15 15.91 14.51 12.47 11.71 10.11 10.35 12.51 11.44 Max 108.64 69.13 43.68 35.59 31.43 28.48 24.27 24.80 23.08 23.17 22.52 22.50 19.40 19.15 17.93 Average 87.88 52.09 36.43 30.51 25.56 21.35 19.54 19.69 18.94 17.52 16.44 16.23 15.14 15.52 14.64 STD 9.67 7.83 4.17 4 4.18 5 3.74 6 2.73 7 2.51 8 2.52 9 2.22 10 3.17 11 2.36 12 2.89 13 2.06 14 1.95 15 1.94 Figure 3.4: Duration of Search Vs. Number of Robots As depicted in this figure, the search time decreases by increasing the number of robots. It is noticeable that after increasing the number of robots to a specific number, the search duration almost remains constant. Indeed, increasing the number of robots increases the probable collision between robots during the operation. Consequently, robots have to turn each other to avoid the collision, and that is the main reason which increases the search time. Therefore, increasing the number of robots more than a specific value (seven robots in this case) 32 (a) (b) (c) (d) (e) (f) Figure 3.5: Robots’ trajectories in the case of searching for three targets. (a) One robot detects three targets in 52m25s, (b) Two robots detect the targets in 24m4s, (c) Three robots detect targets in 14m44s, (d) Four robots detect the targets in 14m57s, (e) Five robots detect the targets in 8m27s and (f) Six robots detect the targets in 8m15s. 33 will be ineffectual in terms of time and should be avoided to save cost. As obvious from Fig. 3.4, increasing the number of robots more than seven improves the search time less than five minutes. 3.2.2 Searching for Targets To demonstrate that how the algorithm works in the case of search for a given number of targets, we consider an area the same as in section 3.2.1 with three targets therein. The targets, shown by green disks in Fig. 3.5, are located in different parts of the area. We evaluate the presented algorithm to figure out how the robots can find the targets using multi-robot teams with different number of robots. As depicted in Fig. 3.5, the results of simulation by the teams consisting of one to six robots have been presented. A target is assumed detected whenever it lies in the sensing range of a robot of the team. If there is just one robot in the team, all the targets should be detected by that robot; thus, it will take longer time in compare with the cases that there are more robots in the team. As shown in Fig. 3.5(a), a robot searches for three targets using the presented search algorithm and they all have been detected after 52m25s. Fig. 3.5(b) shows the same case with two robots in the team so that a robot has detected one target and the other one has detected two other targets in 24m4s. It should be mentioned that in Fig. 3.5, only the paths of the robots after making consensus have been displayed. In Fig. 3.5(c), three robots search for three targets and each robot finds one of them in 14m44s. As shown in that figure, when a robot detects a target, it continues the search operation until all targets are detected by the team. Fig. 3.5(d)-(f) show the search operation using 4-6 robots, respectively. What is very noticeable in this case is that it is expected decreasing the time of detecting the targets by increasing the number of robots while it has not occurred in some instances. For example, when the number of robots has been increased form three to four, the time of detecting the targets has been increased form 14m44s to 14m57s. To explain why this happens, we should consider the fact that the time needed to detect the targets depends on many parameters not only on the number of robots. The shape of the area and obstacles therein, the initial position of the robots in the area and also the relative distance of the robots and targets are significant parameters that affect the time of search. The other serious parameter must be considered, is the nature of the search algorithm that is random. That is we might have different paths for the same cases. To discover more about how the number of robots affects on the search duration, we do more simulations for each case. For example, Fig. 3.6 shows the paths of the robots in the case that three robots are looking for three targets similar to the previous instance. It shows that we have different paths thus different search durations. While in the first simulation, the targets are detected in 14m44s, it takes 13m41 in the second and 19m11s in the third one which is much more than the first one. Fig. 3.7 shows the results of three different simulations using five robots. As depicted in that figure, the period of search for these simulations are 8m27s, 11m46s and 14m21s. Comparing to the case with three robots, it is obvious that the differences between periods of search in this case are less than the case of the team with three robots. That is an expected result because more robots means more coverage of the search area; hence, the chance of detecting targets increases. In order to have a better view of the relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to ten robots. Then, minimum, maximum and average of search 34 (a) Targets are detected in 14m44s (b) Targets are detected in 13m41s (c) Targets are detected in 19m11s Figure 3.6: Robots’ trajectories in the case of searching for three targets by three robots. Table 3.2: Time of detecting targets No of Robots 1 2 3 4 5 6 7 8 9 10 Min 39.13 19.14 13.74 11.21 7.97 5.62 5.38 6.23 5.41 5.04 Max 76.38 42.67 25.87 20.49 14.35 12.87 11.97 10.95 10.67 9.83 Average 55.72 29.97 19.86 15.23 11.79 9.31 8.83 8.67 8.26 7.01 STD 9.29 5.64 3.63 2.50 1.79 1.84 1.72 1.13 1.43 1.26 duration for simulations with each team as well as their standard deviation are calculated. Table 3.2 displays the results of these simulations that are also depicted in Fig. 3.8. The results show that although the average of search duration to detect the targets decreases by increasing the number of robots, the standard deviation of the team with less number of robots is significantly high. Simply, the number of robots should be proportional to the search area to have an adequate chance to detect targets in an acceptable time. 35 (a) Targets are detected in 8m27s (b) Targets are detected in 11m46s (c) Targets are detected in 14m21s Figure 3.7: Robots’ trajectories in the case of searching for three targets by five robots. 3.3 Summary In this chapter, we have developed a distributed control algorithm, namely, random triangular grid-based search algorithm, to drive a multi-robot team to explore an unknown area. We have used a triangular grid pattern and a two-stage random search algorithm for the control law so that the robots randomly move through the vertices of the triangular grid during the search operation. Therefore, a complete search of the whole area has been guaranteed. A mathematically rigorous proof of convergence of the presented algorithm has been demonstrated. Furthermore, the computer simulation results using MobileSim, a powerful simulator of real robots and environment, have been presented to show that the algorithm is effective and practicable. 36 Figure 3.8: Time of target detection Vs. Number of robots 37 Chapter 4 Semi-Random Triangular Grid-Based Search Algorithm In Chapter 3, the random triangular grid-based search algorithm was presented. In that method, the robots randomly move between the vertices of a triangular grid so that in each step they only move to the one of the closest neighbouring vertices. In a similar way, we present the second method of search, namely, ”semi-random triangular grid-based search algorithm” in this chapter. By this method, the robots still randomly move between the vertices of a triangular grid so that in each step they move to the one of the closest neighbouring vertices, but only to those vertices which have not been visited by the robots yet. If all the neighbouring vertices have already been visited, one of them will randomly be selected. A mathematically rigorous proof of convergence with probability 1 of the algorithm is given. Moreover, our algorithm is implemented and simulated using a simulator of the real robots and environment. The third method of search will be presented in the next chapter. 4.1 Distributed Semi-Random Search Algorithm To search an area by a team of mobile robots using the vertices of a grid as the exploring points, we need to locate the searching mobile robots on the vertices of a common grid among the robots. Consensus variables locating algorithm (described in Chapter 2) can be the first stage of the suggested search algorithm, which locates all the robots on the vertices of a common triangular grid T̂ (see Fig. 2.1). The next step will be search of the area W based on moving the robots between the vertices of the covering grid of the area. In this chapter, we propose a semi-random triangular grid-based search algorithm. Suppose a robot located on a vertex of the common triangular grid. Consequently, it can explore the surrounding area using its sensors, and that depends on the sensing range of its sensors. After exploring that area, the robot moves to another point which can be one of the six neighbouring vertices in the triangular grid. As the second method, we suppose that selecting the neighbouring vertex is random but from those neighbouring vertices which have not been visited yet by any of the robots. If all the neighbouring vertices have been visited already, then on of them will be randomly selected. In this regard, there are a few scenarios can be considered to search the area. The first scenario is exploring the whole area which can be applicable when the robots are searching for an undetermined number of targets. Therefore, to detect all possible targets, the team of robots must search the whole area. Patrolling of the area is the other application for this scenario 38 where the robots should move continuously to detect the possible intruders to the area. In the case of given number of targets which is our second scenario, the search operation should be stopped whenever all the targets are detected without searching the whole area,. 4.1.1 Searching the Whole Area To make sure that the whole area is explored by the team of the robots, each vertex in the triangular covering grid set of the area W must be visited at least one time by a member of the team. Consider T̂ is a triangular covering grid of W, and also each vertex of T̂ has been visited at least one time by a robot of the team. This guarantees that the area W has completely been explored by the multi-robot team. Since the robots do not have any map at the beginning, they need to do map making during the search operation so that their maps will gradually be completed. Definition 4.1.1 Let T̂i (k)Sbe as the set of all the vertices of T̂ have been detected by robot i at time k. Then, T̂ (k) = T̂i (k) will be the map of the area W detected by the team of the robots until time k. Note that a detected vertex is different from an explored vertex. These terms are defined in detail in the following definitions. Definition 4.1.2 A detected vertex means that vertex is detected by a robot using map making, and it is in the map of that robot though it might be visited or not by the robots. Definition 4.1.3 An explored vertex is a vertex that is visited by, at least, one member of the team. Definition 4.1.4 The map of robot i at time k, Mi (k), is the set of the vertices in T̂ detected by robot i itself or received from other robots by which they are detected until time k. Definition 4.1.5 Suppose a Boolean variable Vτ (k) which defines the state of vertex τ ∈ T̂ (k) at time k. Vτ (k) = 1 if the vertex τ has already been visited by, at least, one of the robots, otherwise Vτ (k) = 0. Assumption 4.1.1 The triangular grid set T̂i (k); k = 0, 1, ... is connected. That means if τ ∈ T̂i (k), then, at least, one of the six nearest neighbours of τ also belongs to T̂i (k). Let ℵ(pi (k)) be a set containing all the closest vertices to pi (k) on the triangular grid T̂ (k); also, consider |ℵ(pi (k))| as the number of elements in ℵ(pi (k)). It is clear that 1 ≤ |ℵ(pi (k))| ≤ 6. In addition, assume ν be a randomly opted element of ℵ(pi (k)). Moreover, Let ℵ̂(pi (k)) be a set containing all the closest vertices to pi (k) on the triangular grid T̂ (k) which have not been visited yet also consider |ℵ̂(pi (k))| as the number of elements in ℵ̂(pi (k)). It is clear that 1 ≤ |ℵ̂(pi (k))| ≤ 6. Furthermore, assume ν̂ be a randomly opted element of ℵ̂(pi (k)). Consider at time k robot i is located at point pi (k), and it wants to go to the next vertex. The following rule is proposed as the semi-random triangular grid-based search algorithm:  if |M̂i (k)| = 6 0 & |ℵ̂(pi (k))| = 6 0 with probability  ν̂ pi (k + 1) = ν if |M̂i (k)| = 6 0 & |ℵ̂(pi (k))| = 0 with probability   pi (k) if |M̂i (k)| = 0 39 1 |ℵ̂(pi (k))| 1 |ℵ(pi (k))| (4.1) where M̂i (k) = {m ∈ Mi (k); Vm (k) = 0} is the set of all elements of Mi (k) have not been visited before, and |M̂i (k)| denotes the number of elements in M̂i (k). Applying the rule (4.1) ensures that the area T̂ is completely explored, and every vertex of it is visited at least one time by a robot of the team. Theorem 4.1.1 Suppose that all assumptions hold, and the mobile robots move according to the distributed control law (4.1). Then, for any number of robots, with probability 1 there exists a time k0 ≥ 0 such that Vτ (k0 ) = 1; ∀τ ∈ T̂ . Proof of Theorem 4.1.1: The algorithm 4.1 defines an absorbing Markov chain which contains many transient states and some absorbing states that are impossible to leave. Transient states are all the vertices of the triangular grid T̂ which have been visited by the robots during the search procedure. On the contrary, absorbing states are the vertices where the robots stop at the end of search. Using the algorithm 4.1, a robot goes to the vertices where may have not been visited yet. Therefore, the number of transient states will eventually decrease. That continues until the number of robots is equal to the number of unvisited vertices which will be the absorbing states. It is also clear that these absorbing states can be reached from any initial states, with a non-zero probability. This implies that with probability 1, one of the absorbing states will be reached. This completes the proof of Theorem 4.1.1.  In Fig. 4.1, the flowchart of the proposed algorithm is presented that shows how our decision-making approach is implemented. At the first step, robots start making their maps using their sonar. Each robot, based on the vertex on which it is located, assumes some probable neighbouring vertices on the common triangular grid. The number of these probable neighbouring vertices and their distance to the robot depend on the robot’s sonar range. Then, the robot uses the sonar to detect its surrounding environment including borders and obstacles. If any of those probable neighbouring vertices is located outside the borders or blocked by an obstacle, it will be ignored. The rest of those probable neighbouring vertices will be added to the map of the robot. This step is repeated every time that the robot occupies a vertex. In order to avoid sticking in borders or obstacles, we consider a margin near the borders and obstacles that depends on the size of the robot. If a vertex on the map is closer to the borders or obstacles less than the margin, it will be eliminated from the robot’s map. Whenever a robot makes any changes to its map, it sends the new map to the other robots by transmitting packets. On the other side, whenever a robot receives a packet of data, it extracts the new vertices from the received map and adds them to its map. Since the communication range of the robots is limited, if two robots are far from each other, they cannot directly communicate but can do it via other robots. In other words, since there is a connected network of robots, each robot has the role of a hub in the network in order to share the maps among the robots. Therefore, all the robots that are connected and make a network have a common map. In the second phase of the algorithm when the robots have a common triangular grid map, a robot can go far from the other robots and be disconnected from the team for a while. In this case, sharing maps between the disconnected robot and the others is paused until the robot returns back to the communication range of the team again. In the next step, each robot randomly chooses one of the nearest unvisited neighbouring vertices in the map and goes there. If all the neighbouring vertices have been visited already, one of them is randomly selected. Since we assume that the map of a robot is a connected set, there exists always at least one neighbouring vertex, and at most six vertices. If the robot reaches the target vertex, it marks that vertex as an explored vertex in its map and sends it to 40 Start No Is there any unexplored vertex in the map? Stop Yes Mapping Detect new vertices in the area using sonar Yes Are vertex already in the map? No Add vertex to the map Ignore it Have all the nearest vertices been explored? No Yes Select one of the nearest unexplo red vertices in the map randomly Select one of the nearest vertices in the map randomly Navigation & Guidance Send updated map to other robots Go to the selected vertex, Use obstacle avoidance No Has the selected vertex been reached? No Is time > ET? Yes Yes Delete the vertex from the map send map to other robots Received map from other robots? Yes Map merging No Communication & Sharing Set the vertex as an explored vertex in the map Figure 4.1: The flowchart of the suggested algorithm; searching the whole area 41 the other neighbouring robots as well. However, because of some practical issues, maybe it is impossible to reach the target vertex at a limited time or even maybe the target vertex is fake that has been wrongly created during mapping. To avoid such problems, we include a factor of time. Since the robot knows its location and the location of the target, it can estimate the time needed to achieve the goal based on the distance to the target and velocity of the robot. Here, we consider the parameter ET as the expected time to reach the target, that is a factor of the estimated time. This coefficient that has a value greater than one, actually reflects the effects of a non-straight route because of the shape of the search area and also existing obstacles or other robots on the robot’s path. If the travelling time were more than ET, the robot would ignore that target vertex, delete it from its map, and send the updated map to the other robots. Since the area has borders and obstacles, the robots should avoid them while they are searching for the targets. That is why we have to use an obstacle avoidance in our algorithm. Moreover, because of practical problems like sonar and encoders accuracy and slipping of the robots, there might be a difference between the actual position of a robot and the coordinates of the vertices stored in its map. Therefore, if a robot is closer to a target vertex than a specified distance, we consider the goal has been achieved. 4.1.2 Searching for Targets When the robots are looking for some targets in the area, they should continue the search operation till all the targets are detected. If the number of the targets is not specified, they have to search the entire area like what described in Section 4.1.1. When robots know the number of the targets, they do not need to explore the entire area but until all the targets are detected. Suppose T = {T1 , T2 , . . . , Tnt } be the set of nt static targets must be detected by the robots. As it was stated before, we assume the robots equipped with sensors by which the targets can be detected whenever they are close enough to the robots. The distance by which the robots must be close to the targets to be able to detect them is the sensing range of the robots (rs ). Definition 4.1.6 Suppose a Boolean variable VTj (k) which defines the state of target Tj at time k. VTj (k) = 1 if the target Tj has been detected by at least one of the robots, otherwise Tj (k) = 0. Therefore, we modify the rule (4.1) as the following rule to ensure that the search operation stops after finding all the targets.   if |M̂i (k)| = 6 0 & |ℵ̂(pi (k))| = 6 0 & (∃Tj ∈ T; VTj (k) = 0) ν̂ pi (k + 1) = ν if |M̂i (k)| = 6 0 & |ℵ̂(pi (k))| = 0 & (∃Tj ∈ T; VTj (k) = 0)   pi (k) if ∀Tj ∈ T; VTj (k) = 1 (4.2) Theorem 4.1.2 Suppose that all assumptions hold, and the mobile robots move according to distributed control law (4.2). Then, for any number of robots and any number of targets, with probability 1 there exists a time k0 ≥ 0 such that ∀j ; VTj (k0 ) = 1. Proof: Proof is similar to the proof of Theorem 4.1.1. The flowchart in Fig. 4.1 can also be used to describe this operation. Fig. 4.2 depicts the procedure we use to implement this algorithm. Most procedures are the same as the previous 42 one; therefore, we ignore their description. We only need to change the condition that stops the operation in the algorithm. The operation will be stopped if all the targets are detected. Also, the robots send the information about the detected targets to the other members of the team. Start Is there still any target to detect? Yes No Stop Mapping Navigation & Guidance Assign detected targets in the map Communication & Sharing Figure 4.2: The flowchart of the suggested algorithm; searching for targets 4.1.3 Patrolling The above algorithms are appropriate for the cases when the robots should break the search operation; for instance, when the aim is finding some predetermined objects or labeling some vertices of a grid. In cases where a permanent search is needed; for example, in applications such as continuously patrolling or surveying a region, the algorithm should be modified such that the search procedure maintains. That is, we modify control law 4.1 as follows: pi (k + 1) = ( ν̂ if |ℵ̂(pi (k))| = 6 0 with probability ν if |ℵ̂(pi (k))| = 0 with probability 1 |ℵ̂(pi (k))| 1 |ℵ(pi (k))| (4.3) hence, the robots do not stop and continuously move between the vertices of the grid. 4.1.4 Robots’ Motion To have a more real estimation of time that the robots spend to search an area to detect the targets, we apply motion dynamics in our simulations. In addition, since the environment is unknown to the team, it is essential to use an obstacle avoidance in the low level control of the robots. As a result, we use a method of reactive potential field control in order to avoid obstacles [168]. 43 4.2 Simulation Results To verify the suggested algorithm, computer simulations are employed. The region W is considered to be searched by a few robots (see Fig. 2.1). We suppose a multi-robot team with some autonomous mobile robots which are randomly located in the region W with random initial values of angles. The goal is to search the whole area by the robots using proposed semi-random triangular grid-based search algorithm. To simulate the algorithm, MobileSime, a simulator of mobile robots developed by Adept MobileRobots, is used. We also use Visual C++ for programming and ARIA, a C++ library that provides an interface and framework for controlling the robots. In addition, Pioneer 3DX is selected as the type of the robots. Robots parameters in the simulations are given in Table 2.1. Since this simulator simulates the real robots along with all conditions of a real world, the results of the simulations would be obtained in the real world experiments with the real robots indeed. Furthermore, to prevent collisions between robots and to avoid the obstacles and borders, an obstacle avoidance algorithm is applied using functions provided in ARIA library. Moreover, to avoid hitting and sticking to the borders, we assume a margin near the borders such that the robots do not pass it. 4.2.1 Searching the Whole Area As mentioned in Chapter 2, a two-stage algorithm is used to achieve the goal. First, the algorithm (2.1),(2.2) is applied which uses consensus variables in order to drive the robots to the vertices of a common triangular grid. In Fig. 4.3(a), the beginning of the robots’ trajectories are the position of the robots after applying the first stage of the search algorithm, i.e., rule (2.1),(2.2) (see Fig. 2.5). The second stage of the algorithm, i.e., the algorithm 4.1, is applied whenever the first stage is completed. Fig. 4.3 demonstrates the result of applying algorithm 4.1 on a team of three robots. As seen in Fig. 4.3, the robots go through the vertices of the common triangular grid based on the proposed algorithm until the whole area is explored by the robots. Fig. 4.3(a), Fig. 4.3(b) and Fig. 4.3(c) display the trajectories of the robots at times 3m48s, 8m5s and 15m47s after applying algorithm 4.1, respectively. Fig. 4.3(d) shows trajectories of the robots at time 18m3s when the search operation has been completed. It is obvious that the area W is completely searched by the robots such that each vertex of the covering triangular grid is occupied at least one time by the robots. In this case study, we assume that the sides of the equilateral triangles are 2 meter (sensing range of the robots is √23 m) and the communication range between the robots is 10 meter. The area of the region W is about 528 m2 . Although any number of robots can be used to search the whole area, it is obvious that more robots complete the operation in a shorter time. However, more number of robots certainly increases the cost of the operation. The question is, how many robots should be used in order to optimize both the time and cost. It seems, that is somehow dependent on the shape of the region and the obstacles and also the sides of the triangles. In order to have a better view of the relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to fifteen robots. Then, minimum, maximum, average and standard deviation are calculated for the search duration of each team. Table 4.1 displays the results of these simulations that are also depicted in Fig. 4.4. 44 (a) (b) (c) (d) Figure 4.3: Robots’ trajectories after applying the second stage of the algorithm; (a) After 3m48s, (b) After 8m5s, (c) After 15m47s, (d) After 18m3s Table 4.1: Duration of search No of Robots 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Min 36.51 18.40 15.28 11.21 10.05 8.03 6.47 6.56 6.13 5.82 5.81 5.74 4.80 4.69 4.37 Max 48.62 32.05 21.06 17.56 15.36 14.25 12.61 11.33 10.52 10.37 9.65 9.11 8.59 8.62 8.51 Average 41.57 25.52 18.29 14.69 12.56 10.81 10.02 9.24 9.05 8.43 8.21 7.55 7.56 7.10 7.03 STD 3.53 2.95 1.93 1.92 1.29 1.46 1.46 1.34 1.10 1.09 1.06 1.01 1.02 0.97 0.96 As depicted in this figure, the search time decreases by increasing the number of robots. It is noticeable that after increasing the number of robots to a specific number, the search duration almost remains constant. Indeed, increasing the number of robots increases the probable collision between robots during the operation. Consequently, the robots have to turn each other to avoid the collision, and that is the main reason which increases the search time. Therefore, increasing the number of robots more than a particular value (seven robots in this case) will be ineffectual in terms of time and should be avoided to save cost. As apparent from Fig. 4.4, increasing the number of robots more than seven improves the search time only about three minutes. 45 Figure 4.4: Duration of Search Vs. Number of Robots 4.2.2 Searching for Targets To demonstrate that how the algorithm works in the case of search for a given number of targets, we consider an area the same as in section 4.2.1 with three targets therein. The targets, shown by green disks in Fig. 4.5, are located in different parts of the area. We evaluate the presented algorithm to figure out how the robots can find the targets using multi-robot teams with different number of robots. As depicted in Fig. 4.5, the results of simulation by the teams consisting of one to six robots have been presented. A target is assumed detected whenever it lies in the sensing range of a robot of the team. If there is just one robot in the team, all the targets should be detected by that robot; thus, it will take longer time in compare with the cases that there are more robots in the team. As shown in Fig. 4.5(a), a robot searches for three targets using the presented search algorithm and they all have been detected after 17m13s. Fig. 4.5(b) shows the same case with two robots in the team so that a robot has detected one target and the other one has detected two other targets in 12m24s. It should be mentioned that in Fig. 4.5, only the paths of the robots after making consensus have been displayed. In Fig. 4.5(c) three robots search for three targets and each robot finds one of them in 5m49s. As shown in that figure, when a robot detects a target, it continues the search operation until all targets are detected by the team. Fig. 4.5(d)-(f) show the search operation using 4-6 robots, respectively. What is very noticeable in this case is that, it is expected decreasing the time of detecting the targets by increasing the number of robots while it has not occurred in some instances. For example, when the number of robots has been increased from three to four, the time of detecting 46 (a) (b) (c) (d) (e) (f) Figure 4.5: Robots’ trajectories in the case of searching for three targets. (a) One robot detects three targets in 17m13s, (b) Two robots detect the targets in 12m24s, (c) Three robots detect targets in 5m49s, (d) Four robots detect the targets in 7m33s, (e) Five robots detect the targets in 4m8s and (f) Six robots detect the targets in 5m19s. 47 the targets has been increased from 5m49s to 7m33s. To explain why this happens, we should consider the fact that the time needed to detect the targets depends on many parameters not only on the number of robots. The shape of the area and obstacles therein, the initial position of the robots in the area and also the relative distance of the robots and targets are significant parameters that affect the time of search. The other serious parameter must be considered is the nature of the search algorithm that is semi-random. That is we might have different paths for the same cases. (a) Targets are detected in 5m49s (b) Targets are detected in 4m33s (c) Targets are detected in 14m21s Figure 4.6: Robots’ trajectories in the case of searching for three targets by three robots. To discover more about how the number of robots affects on the search duration, we do more simulations for each case. For example, Fig. 4.6 shows the paths of the robots in the case that three robots are looking for three targets similar to the previous instance. It shows that we have different paths thus different search durations. While in the first simulation, the targets are detected in 5m49s, it takes 4m33s in the second and 14m21s in the last one, which is much more than the second one. Fig. 4.7 shows the results of three different simulations using five robots. As depicted in that figure, the period of search for these simulations are 4m8s, 4m37s and 7m33s. Comparing to the case with three robots, it is obvious that the differences between the periods of search in this instance are less than the case of the team with three robots. That is an expected result because more robots means more coverage of the search area; hence, the chance of detecting targets increases. 48 (a) Targets are detected in 4m8s (b) Targets are detected in 4m37s (c) Targets are detected in 7m33s Figure 4.7: Robots’ trajectories in the case of searching for three targets by five robots. 49 Table 4.2: Time of detecting targets No of Robots 1 2 3 4 5 6 7 8 9 10 Min 13.45 7.26 4.13 3.59 2.72 2.49 2.07 2.01 1.95 1.72 Max 29.50 19.95 14.35 10.70 7.55 6.08 5.23 5.15 4.97 4.95 Average 21.99 11.36 8.41 6.95 4.44 3.96 3.46 3.30 3.02 3.13 STD 5.79 3.11 2.34 1.96 1.12 1.02 0.85 0.94 0.77 0.82 Figure 4.8: Time of target detection Vs. Number of robots In order to have a better view of the relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to ten robots. Then, minimum, maximum and average of search duration for simulations with each team as well as their standard deviation are calculated. Table 4.2 displays the results of these simulations that are also depicted in Fig. 4.8. The results show that although the average of search duration to detect the targets decreases by increasing the number of robots, the standard deviation of the team with less number of robots is significantly high. Simply, the number of robots should be proportional to the search area to have an adequate chance to detect targets in a desirable time. 50 4.3 Summary In this chapter, we have developed a distributed control algorithm, namely, semi-random triangular grid-based search algorithm, to drive a multi-robot team to explore an unknown area. We have used a triangular grid pattern and a two-stage semi-random search algorithm for the control law so that the robots randomly move through the vertices of the triangular grid during the search operation. Therefore, a complete search of the whole area has been guaranteed. A mathematically rigorous proof of convergence of the presented algorithm has been demonstrated. Furthermore, the computer simulation results using MobileSim, a powerful simulator of real robots and environment, have been presented to demonstrate that the algorithm is effective and practicable. 51 Chapter 5 Modified Triangular-Grid-Based Search Algorithm In Chapters 3 and 4, two methods for exploring an unknown environment using a team of mobile robots were presented. In those methods, the robots randomly move between the vertices of a common triangular grid so that in each step they only move to the one of the neighbouring vertices. In this chapter, we present the third method of search, namely, ”modified triangular grid-based search algorithm”. By this method, the robots are not confined to move to the closest neighbouring vertices. Instead, they move to the nearest unvisited vertex. A mathematically rigorous proof of convergence with probability 1 of the algorithm is given. Moreover, our algorithm is implemented and simulated using a simulator of the real robots and environment and also tested via experiments with Adept Pioneer 3DX wheeled mobile robots. Finally, a comparison between our three proposed algorithms and three algorithms from other researchers is given. 5.1 Distributed Triangular Grid-Based Search Algorithm To search an area by a team of mobile robots using the vertices of a grid as the exploring points, we need to locate the searching mobile robots on the vertices of a common grid among the robots. Consensus variables locating algorithm (described in Chapter 2) can be the first stage of the suggested search algorithm, which locates‘ all the robots on the vertices of a common triangular grid T̂ (see Fig. 2.1). The next step will be search of the area W based on moving the robots between the vertices of the covering grid of the area. In this chapter, we propose a triangular grid-based search algorithm. Suppose a robot located on a vertex of the common triangular grid. Consequently, it can explore the surrounding area using its sensors, and that depends on the sensing range of its sensors. After exploring that area, the robot moves to another point which can be one of the unexplored vertices in the triangular grid. As a modified version of the previous methods presented in Chapters 3 and 4, we suppose that a robots selects the nearest unvisited vertex as the next destination in every step. If there is more than one vertex, any of them can be chosen randomly. In this regard, there are various scenarios can be considered to search the area. The first scenario is exploring the whole area which can be applicable when the robots are searching for an undetermined number of targets. Therefore, to detect all possible targets, the team of the robots must search the whole area. Patrolling of the area is the other application for this scenario where the robots should move 52 continuously to detect the possible intruders to the area. In the case of given number of targets which is our second scenario, the search operation should be stopped without searching the whole area; whenever all the targets are detected. 5.1.1 Searching the Whole Area To make sure that the whole area is explored by the team of the robots, each vertex in the triangular covering grid set of the area W must be visited at least one time by a member of the team. Consider T̂ is a triangular covering grid of W, and also each vertex of T̂ has been visited at least one time by a robot of the team. This guarantees that the area W has completely been explored by the multi-robot team. Since the robots do not have any map at the beginning, they need to do map making during the search operation so that their maps will gradually be completed. Definition 5.1.1 Let S T̂i (k) be the set of all the vertices of T̂ have been detected by robot i at time k. Then, T̂ (k) = T̂i (k) will be the map of the area W detected by the team of the robots until time k. Note that a detected vertex is different from an explored vertex. These terms are defined in detail in the following definitions. Definition 5.1.2 A detected vertex means that vertex is detected by a robot using map making, and it is in the map of that robot though it might be visited or not by the robots. Definition 5.1.3 An explored vertex is a vertex that is visited by at least one member of the team. Definition 5.1.4 The map of robot i at time k, Mi (k), is the set of those vertices in T̂ detected by robot i itself or received from other robots by which they are detected until time k. Definition 5.1.5 Suppose a Boolean variable Vτ (k) which defines the state of vertex τ ∈ T̂ (k) at time k. Vτ (k) = 1 if the vertex τ has already been visited by at least one of the robots, otherwise Vτ (k) = 0. Assumption 5.1.1 The triangular grid set T̂i (k); k = 0, 1, ... is connected. That means if τ ∈ T̂i (k), then at least one of the six nearest neighbours of τ also belongs to T̂i (k). Consider at time k robot i is located at point pi (k), and it wants to go to the next vertex. The following rule is proposed as the modified triangular grid-based search algorithm: ( m̂i (k) if |M̂i (k)| = 6 0 pi (k + 1) = (5.1) pi (k) if |M̂i (k)| = 0 where M̂i (k) = {m ∈ Mi (k); Vm (k) = 0} is the set of all elements of Mi (k) have not been visited before, |M̂i (k)| denotes the number of elements in M̂i (k) and m̂i (k) is the vertex in M̂i (k) nearest to robot i at time k. Applying the rule (5.1) ensures that the area T̂ is completely explored, and every vertex of it is visited at least one time by a robot of the team. 53 Theorem 5.1.1 Suppose that all assumptions hold, and the mobile robots move according to the distributed control law (5.1). Then, for any number of robots, with probability 1 there exists a time k0 ≥ 0 such that Vτ (k0 ) = 1; ∀τ ∈ T̂ . Proof of Theorem 5.1.1: The algorithm 5.1 defines an absorbing Markov chain which contains many transient states and a number of absorbing states that are impossible to leave. Transient states are all the vertices of the triangular grid T̂ which have been occupied already by the robots during the search procedure. On the other hand, absorbing states are the vertices where the robots stop at the end of the search operation. Using the algorithm 5.1, a robot goes to the vertices where may have not been visited yet. Therefore, the number of transient states will eventually decrease. That continues until the number of robots is equal to the number of unvisited vertices which will be the absorbing states. It is also explicit that these absorbing states can be reached from any initial states, with a non-zero probability. This implies that with probability 1, one of the absorbing states will be reached. This completes the proof of Theorem 5.1.1.  In Fig. 5.1, the flowchart of the proposed algorithm is presented that shows how our decision-making approach is implemented. At the first step, robots start making their maps using their sonar. Each robot, based on the vertex on which it is located, assumes some probable neighbouring vertices on the common triangular grid. The number of these probable neighbouring vertices and their distance to the robot depend on the robot’s sonar range. Then, the robot uses the sonar to detect its surrounding environment including borders and obstacles. If any of those probable neighbouring vertices is located outside the borders or blocked by an obstacle, it will be ignored. The rest of those probable neighbouring vertices will be added to the map of the robot. This step is repeated every time that the robot occupies a vertex. In order to avoid sticking in borders or obstacles, we consider a margin near the borders and obstacles that depends on the size of the robot. If a vertex on the map is closer to the borders or obstacles less than the margin, it will be eliminated from the robot’s map. Whenever a robot makes any changes to its map, it sends the new map to the other robots by transmitting packets. On the other side, whenever a robot receives a packet of data, it extracts the new vertices from the received map and adds them to its map. Since the communication range of the robots is limited, if two robots are far from each other, they cannot directly communicate but can do it via other robots. In other words, since there is a connected network of robots, each robot has the role of a hub in the network in order to share the maps among the robots. Therefore, all the robots that are connected and make a network have a common map. In the second phase of the algorithm when the robots have a common triangular grid map, a robot can go far from the other robots and be disconnected from the team for a while. In this case, sharing maps between the disconnected robot and the others is paused until the robot returns back to the communication range of the team again. In the next step, each robot chooses the nearest unexplored vertex in the map and goes there. Whenever a robot visits a vertex, it marks that as an explored vertex in its map. Therefore, all the robots know which vertices have not been explored yet. To find the nearest vertex that has not been explored yet, each robot searches the map stored in its memory. This vertex has probably been detected by the robot itself or added to robot’s map via sharing map among robots. After finding the nearest unexplored vertex, the robot moves to reach there. If the robot reaches the target vertex, it marks that vertex as an explored vertex in its map and sends it to the other neighbouring robots as well. However, because of some practical issues, maybe it is impossible to reach the target vertex at a limited time or even maybe the target vertex is fake 54 Start No Is there any unexplored vertex in the map? Stop Yes Are vertex already in the map? Mapping Detect new vertices in the area using sonar Yes No Add vertex to the map Ignore it Find in the map the nearest unexplored vertex Go to the selected vertex, Use obstacle avoidance No No Yes Yes Set the vertex as an explored vertex in the map Is time > ET? Delete the vertex from the map send map to other robots Received map from other robots? Yes Map merging No Communication & Sharing Has the selected vertex been reached? Navigation & Guidance Send updated map to other robots Figure 5.1: The flowchart of the suggested algorithm; searching the whole area that has been wrongly created during mapping. To avoid such problems, we include a factor of time. Since the robot knows its location and the location of the target, it can estimate the time needed to achieve the goal based on the distance to the target and velocity of the robot. Here, we consider the parameter ET as the expected time to reach the target, that is a factor of the 55 estimated time. This coefficient with a value greater than one, actually reflects the effects of a non-straight route because of the shape of the search area and also existing obstacles or other robots on the robot’s path. If the traveling time were more than ET, the robot would ignore that target vertex, delete it from its map, and send the updated map to the other robots. Since the area has borders and obstacles, the robots should avoid them while they are searching for the targets. That is why we have to use an obstacle avoidance in our algorithm. In addition, because of practical problems like sonar and encoders accuracy and slipping of the robots, there might be a difference between the actual position of a robot and the coordinates of the vertices stored in its map. Therefore, if a robot is closer to a target vertex than a specified distance, we consider the goal has been achieved. 5.1.2 Searching for Targets When the robots are looking for some targets in the area, they should continue the search operation till all the targets are detected. If the number of the targets is not given, they have to search the entire area like what described in Section 5.1.1. When robots know the number of the targets, they do not need to explore the entire area but until all the targets are detected. Suppose T = {T1 , T2 , . . . , Tnt } be the set of nt static targets should be detected by the robots. As it was stated before, we assume the robots equipped with sensors by which the targets can be detected whenever they are close enough to the robots. The distance by which the robots must be close to the targets to be able to detect them is the sensing range of the robots (rs ). Definition 5.1.6 Suppose a Boolean variable VTj (k) which defines the state of target Tj at time k. VTj (k) = 1 if the target Tj has been detected by at least one of the robots, otherwise Tj (k) = 0. Therefore, we modify the rule (5.1) as the following rule to ensure that the search operation stops after finding all the targets. ( m̂i (k) if ∃Tj ∈ T; VTj (k) = 0 pi (k + 1) = pi (k) if ∀Tj ∈ T; VTj (k) = 1 (5.2) Theorem 5.1.2 Suppose that all assumptions hold, and the mobile robots move according to distributed control law (5.2). Then, for any number of robots and any number of targets, with probability 1 there exists a time k0 ≥ 0 such that ∀j ; VTj (k0 ) = 1. Proof: Proof is similar to the proof of Theorem 5.1.1. The flowchart in Fig. 5.1 can also be used to describe this operation. Fig. 5.2 depicts the procedure we use to implement this algorithm. Most procedures are the same as the previous one; therefore, we ignore their description. We only need to change the condition that stops the operation in the algorithm. The operation will be stopped when all the targets are detected. Also, the robots send the information about the detected targets to the other members of the team. 56 Start Is there still any target to detect? Yes No Stop Mapping Navigation & Guidance Assign detected targets in the map Communication & Sharing Figure 5.2: The flowchart of the suggested algorithm; searching for targets 5.1.3 Patrolling The above algorithms are appropriate for the cases when the robots should break the search operation; for instance, when the aim is finding some predetermined objects or labeling some vertices of a grid. In cases where a permanent search is needed; for example, in applications such as continuously patrolling or surveying a region, the algorithm should be modified such that the search procedure maintains. That can be done by periodically changing the states of the vertices in the maps of the robots; hence, the robots consider those vertices as the targets again. To archive that, the state of the previously visited vertices should be changed to unvisited in the map of the robots. Based on some conditions such as the size of the area and the number of the robots, the period of changing the state of vertices can be chosen. 5.1.4 Robots’ Motion To have a more real estimation of time that the robots spend to search an area to detect the targets, we apply motion dynamics in our simulations. In addition, since the environment is unknown to the team, it is essential to use an obstacle avoidance in the low-level control of the robots. As a result, we use a method of reactive potential field control in order to avoid obstacles [168]. 5.2 Simulation Results To verify the suggested algorithm, computer simulations are employed. The region W is considered to be searched by a few robots (see Fig. 2.1). We suppose a multi-robot team of some autonomous mobile robots which are randomly located in the region W with random initial 57 values of angles. The goal is to search the whole area by the robots using proposed grid-based search algorithm. To simulate the algorithm, MobileSime, a simulator of mobile robots developed by Adept MobileRobots, is used. We also use Visual C++ for programming and ARIA, a C++ library that provides an interface and framework for controlling the robots. In addition, Pioneer 3DX is selected as type of the robots. Robots parameters in the simulations are given in Table 2.1. Since, this simulator simulates the real robots along with all conditions of a real world, the results of the simulations would be obtained in the real world experiments with the real robots indeed. Furthermore, to prevent collisions between robots and to avoid the obstacles and borders, an obstacle avoidance algorithm is applied using functions provided in ARIA library. Moreover, to avoid hitting and sticking to the borders, we assume a margin near the borders such that the robots do not pass it. (a) (b) (c) (d) Figure 5.3: Robots’ trajectories after applying the second stage of the algorithm; (a) After 3m21s, (b) After 5m45s, (c) After 7m26s, (d) After 8m23s 5.2.1 Searching the Whole Area As mentioned in Chapter 2, a two-stage algorithm is used to achieve the goal. First, the algorithm (2.1),(2.2) is applied which uses consensus variables in order to drive the robots to the vertices of a common triangular grid. In Fig. 5.3(a), the beginning of the robots’ trajectories 58 are the position of the robots after applying the first stage of the search algorithm, i.e., rule (2.1),(2.2) (see Fig. 2.5). The second stage of the algorithm, i.e., the algorithm 5.1, is applied whenever the first stage is completed. Fig. 5.3 demonstrates the result of applying algorithm 5.1 on a team of three robots. As seen in Fig. 5.3, the robots go through the vertices of the common triangular grid based on the proposed algorithm until the whole area is explored by the robots. Fig. 5.3(a), Fig. 5.3(b) and Fig. 5.3(c) display the trajectories of the robots at times 3m21s, 5m45s and 7m26s after applying algorithm 5.1, respectively. Fig. 5.3(d) shows trajectories of the robots at time 8m23s when the search operation has been completed. It is obvious that the area W is completely explored by the robots such that each vertex of the covering triangular grid is occupied at least one time by the robots. In this case study, we assume that the sides of the equilateral triangles are 2 meter (sensing range of the robots is √23 m) and the communication range between the robots is 10 meter. The area of the region W is about 528 m2 . Fig. 5.4 shows another simulation result but for an area with three obstacles with different shapes. It shows that the algorithm indeed works with any number of obstacles. Although any number of robots can be used for the search operation, it is obvious that more robots complete the operation in a shorter time. However, more robots certainly increases the cost of the operation. The question is, how many number of robots should be used in order to optimize both the time and cost. It seems, that may be somehow dependent on the shape of the region and the obstacles and also the sides of the triangles. In order to have a better view of the relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to fifteen robots. Then, minimum, maximum, average and standard deviation are calculated for the search duration of each team. Table 5.1 displays the results of these simulations that are also depicted in Fig. 5.5. Figure 5.4: Searching an area with three obstacles As depicted in this figure, the search time decreases by increasing the number of robots. It is noticeable that after increasing the number of robots to a specific number, the search duration almost remains constant. Indeed, increasing the number of robots increases the probable collision between robots during the operation. Consequently, robots have to turn each other to avoid the collision, and that is the main reason which increases the search time. Therefore, 59 Table 5.1: Duration of search No of Robots 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Min 16.98 9.55 7.03 5.68 5.09 4.23 3.72 3.66 3.44 3.38 3.18 3.12 2.98 3.01 2.88 Max 23.02 13.61 9.98 7.90 6.98 5.82 5.05 4.96 4.77 4.65 4.38 4.26 4.12 4.17 3.76 Average 20.51 11.62 8.56 6.73 5.97 5.00 4.42 4.37 4.09 4.00 3.83 3.71 3.56 3.57 3.31 STD 1.77 1.20 0.98 0.54 0.62 0.52 0.37 0.40 0.42 0.36 0.35 0.33 0.34 0.41 0.25 Figure 5.5: Duration of Search Vs. Number of Robots increasing the number of robots more than a specific value (six robots in this case) will be ineffectual in terms of time and should be avoided to save cost. As obvious from Fig. 5.5, increasing the number of robots more than six, improves the search time less than one minute. 5.2.2 Searching for Targets To demonstrate that how the algorithm works in the case of search for a given number of targets, we consider an area the same as in section 5.2.1 with three targets therein. The targets, shown by green disks in Fig. 5.6, are located in different parts of the area. We evaluate the presented algorithm to figure out how the robots can find the targets using multi-robot teams with different number of robots. As depicted in Fig. 5.6, the results of simulation by the teams consisting of one to six robots have been presented. A target is assumed detected whenever it lies in the sensing range of a robot of the team. If there is just one robot in the 60 (a) (b) (c) (d) (e) (f) Figure 5.6: Robots’ trajectories in the case of searching for three targets. (a) One robot detects three targets in 12m49s, (b) Two robots detect the targets in 4m3s, (c) Three robots detect targets in 3m32s, (d) Four robots detect the targets in 3m50s, (e) Five robots detect the targets in 1m51s and (f) Six robots detect the targets in 2m15s. 61 team, all the targets should be detected by that robot; thus, it will take longer time in compare with the cases that there are more robots in the team. As shown in Fig. 5.6(a), a robot searches for three targets using the presented search algorithm and they all have been detected after 12m49s. Fig. 5.6(b) shows the same case with two robots in the team so that a robot has detected one target and the other one has detected two other targets in 4m3s. It should be mentioned that in Fig. 5.6, only the paths of the robots after making consensus have been displayed. In Fig. 5.6(c), three robots search for three targets and each robot finds one of them in 3m32s. As shown in that figure, when a robot detects a target, it continues the search operation until all the targets are detected by the team. Fig. 5.6(d)-(f) show the search operation using 4-6 robots, respectively. What is very noticeable in this case is that it is expected decreasing the time of detecting the targets by increasing the number of robots while it has not occurred in some instances. For example, when the number of robots has been increased from three to four, the time of detecting the targets has been increased from 3m32s to 3m50s. To explain why this happens, we should consider the fact that the time needed to detect the targets depends on many parameters not only on the number of robots. The shape of the area and obstacles therein, the initial position of the robots in the area and also the relative distance of the robots and targets are significant parameters that affect the time of search. The other serious parameter must be considered is the nature of the search algorithm that is semi-random. Indeed, a robot always chooses the nearest unexplored vertex as its destination vertex, but sometimes there are a few vertices which can be chosen as the nearest, and the robot randomly selects one of them. That is we might have different paths for the same cases. To discover more about how the number of robots affects on the search duration, we do more simulations for each case. For example, Fig. 5.7 shows the paths of the robots in the case that two robots are looking for three targets similar to the previous instance. It shows that we have different paths thus different search durations. While in the first simulation, the targets are detected in 4m3s, in the last one it occurs in 7m41s which is much more than the first one. Fig. 5.8 shows the results of three different simulations using five robots. As depicted in that figure, the period of search for these simulations are 1m51s, 1m58s and 2m33s. Comparing to the case with two robots, it is obvious that the differences between periods of search in this case are less than the case of the team with two robots. That is an expected result because more robots means more coverage of the search area; hence, the chance of detecting targets increases. To have a better view of the relation between the number of robots and the search duration, twenty simulations with different number of robots have been done. We consider teams consisting of one to ten robots. Then minimum, maximum and average of search duration for simulations with each team as well as their standard deviation are calculated. Table 5.2 displays the results of these simulations that are also depicted in Fig. 5.9. The results show that although the average of search duration to detect the targets decreases by increasing the number of robots, the standard deviation of the team with less number of robots is significantly high. Simply, the number of robots should be proportional to the search area to have an adequate chance to detect the targets in an acceptable time. 62 (a) Targets are detected in 4m3s (b) Targets are detected in 6m44s (c) Targets are detected in 7m41s Figure 5.7: Robots’ trajectories in the case of searching for three targets by two robots. 63 (a) Targets are detected in 1m51s (b) Targets are detected in 1m58s (c) Targets are detected in 2m33s Figure 5.8: Robots’ trajectories in the case of searching for three targets by five robots. 64 Table 5.2: Time of detecting targets No of Robots 1 2 3 4 5 6 7 8 9 10 Min 7.82 3.95 2.35 2.05 1.73 1.54 1.45 1.38 1.32 1.27 Max 15.49 8.02 5.05 4.21 3.63 3.42 2.88 2.56 2.19 2.01 Average 11.95 5.99 3.61 3.02 2.58 2.34 2.07 1.80 1.70 1.60 STD 2.03 1.37 0.79 0.71 0.69 0.61 0.47 0.36 0.30 0.24 Figure 5.9: Time of target detection Vs. Number of robots 5.3 Experiments with Real Robots In this section, the experiment results with real robots are presented. We use Pioneer 3DX mobile robots to implement the proposed algorithm. Pioneer 3DX is one of the world’s most popular research mobile robots. These robots are equipped with encoders and sonar by which the localization and mapping can be done during the experiments. We do experiment with three robots in a surrounded area. The workspace is an irregularly shaped fenced area of about 16.5 m2 with a rectangular obstacle of about 0.8 m2 (see Fig. 5.12). The goal is searching the whole area by three robots using the proposed algorithm. We have used sonar to detect area boundaries, obstacles and other robots. A method of reactive potential field control is applied to avoid collisions with obstacles. Moreover, other robots are viewed as obstacles by a robot. We have used ArNetworking, a library provided by Adept MobileRobots for communication between robots. It works with ARIA, the library we 65 have applied to control the robots. The robots exchange the map of the environment that they make during the search operation and the vertices which they visit. Figure 5.10: Pioneer 3DX robot used in the experiments (a) (b) (c) (d) Figure 5.11: Three robots exploring a whole area The snapshots of the experiment results are demonstrated in Fig. 5.11. First, the robots are randomly placed in the field with an obstacle . After applying the algorithm, the robots start to do the first stage of the algorithm, i.e., locating themselves on the vertices of a common triangular grid using consensus variables locating algorithm. Fig. 5.11(a) shows the result of this stage. Then, the robots begin to search the area based on the second stage of the algorithm 66 that is modified triangular grid-based search algorithm presented in this chapter. Fig. 5.11(b)Fig. 5.11(d) are snapshots during this stage. The overall paths taken by the robots in the experiment are depicted in Fig. 5.12. The results show that the area has been completely explored based on the proposed algorithm. Note that the robots do not necessarily reach the end points at the same time. Table 5.3: search duration in the No of Robots 1 Min 57 Max 66 Average 61.6 STD 4.04 experiments (seconds) 2 3 35 18 41 22 37.8 19.4 2.39 1.67 Also, to have a better view of a relation between the number of robots and the search duration in the experiments, five runs with one, two and three robots have been done. Table 5.3 displays the calculated values for the minimum, maximum, average and standard deviation of the search duration in the experiments. Note that since the area and the triangles sides in the simulations and the experiments are different, and we had only three robots in the experiments, an exact comparison between results is not possible. But as the Tables 5.1 and 5.3 show, the results from the simulations and experiments give similar outcomes. For example, in the simulations, three robots explore a 528 m2 area in about 546 seconds (with exploring speed of 0.97 m2 /s), and in the experiments three robots explore a 16.5 m2 area in about 19.4 seconds (with exploring speed of 0.85 m2 /s). We have used 1 m for the sides of triangles in the experiments, while in the simulations, they have been 2 m; therefore, the robots have had more stops in the experiments thus the lower speed of exploring. Figure 5.12: Robots’ trajectories in the experiment 67 5.4 Comparison Between Presented Search Algorithms and Other Methods To evaluate the proposed triangular grid-based search algorithms in Chapters 3, 4 and this chapter against other algorithms, we compare them with each other also with three more algorithms: fixed-length random, Levy random-walk and Levy random-walk with potential field algorithms [169]. In [169], the simulation results for these three algorithms have been given in a plot of search time versus the number of robots. They consider a 400 m2 regular square area to be explored by a team of mobile robots with a speed of 60 cm/s. We have considered an irregular shape with an area of about 528 m2 , and the robots with a maximum speed of 40 cm/s. First, we compare our presented algorithm in this chapter with algorithms presented in Chapters 3 and 4. All algorithms are grid-based such that the robots certainly go through the vertices of a triangular grid. In the algorithm of random triangular grid-based search, presented in Chapter 3, robots go to the one of the six nearest vertices in each step regardless that the vertex has been explored already or not; therefore, we have a pure random grid-based search algorithm. On the other side, in the algorithm of semi-random triangular grid-based search presented in Chapter 4, a robot goes to the one of the unexplored neighbouring vertices (each vertex has at most six neighbouring vertices). If all the nearest neighbouring vertices have been visited, one of them is randomly selected. It is clear that a semi-random algorithm is faster than a pure random algorithm but requires more resources and processing. Our third proposed algorithm, i.e., modified triangular grid-based search algorithm presented in this chapter, drives the robots to move to the nearest unexplored vertex in the area in each step. In this algorithm, the robots are not constrained to only move to the one of the six nearest neighbouring vertices in the grid; but, they can move to the nearest unexplored vertex anywhere in the area. Fig. 5.13 displays a comparison between our presented search algorithms using data from Tables 3.1, 4.1 and 5.1. As shown in Fig. 5.13, semi-random triangular grid-based search algorithm is faster than random triangular grid-based search algorithm, and modified triangular grid-based search algorithm is much faster than both. Numerically, the speed of search by semirandom triangular grid-based search algorithm is about fifty percent more than by random triangular grid-based search algorithm, and the speed of search by modified triangular gridbased search algorithm is more than fifty percent greater than by random triangular grid-based search algorithm. Also, a comparison between the standard deviation of these algorithms shows that standard deviation in modified triangular grid-based search algorithm is much less than the other methods meaning that in this algorithm, repeating the simulation for a team of robots does not have a considerable effect on the time of search. Second, we compare our three algorithms with three other algorithms: fixed-length random, Levy random-walk and Levy random-walk with potential field algorithms. Table 5.4 shows the search time for these algorithms and our proposed algorithms that also depicted in Fig. 5.14. Note that the search times given in Table 5.4 are approximated values extracted from the graph given in [169], and also average values from Tables 3.1, 4.1 and 5.1. Table 5.5 shows the speed of search versus the number of robots for the algorithms that also depicted in Fig. 5.15. Since the size of the areas and speed of the robots in our simulations and the simulations in [169] are different, they have been normalized; then, we can compare them. As shown in Fig. 5.15, the fastest algorithm is our algorithm presented in this chapter, i.e., modified triangular grid-based search algorithm; more than two times faster than the fastest algorithm presented in [169]. Fig. 68 Figure 5.13: Comparison between presented search algorithms 5.15 also shows that semi-random triangular grid-based search algorithm presented in Chapter 4, is almost as fast as Levy random-walk and potential field algorithm, the fastest algorithm in [169]; but, still slightly faster. Finally, Fig. 5.15 shows that random triangular grid-based search algorithm presented in Chapter 3, is slightly slower than Levy random-walk algorithm but noticeably faster than the fixed-length random algorithm; about two times faster. 5.5 Summary In this chapter, we have developed a distributed control algorithm to drive a multi-robot team to explore an unknown area. We have used a triangular grid pattern and a two-stage algorithm for the control law so that the robots move through the vertices of the grid during the search procedure. Therefore, a complete search of the whole area has been guaranteed. A mathematically rigorous proof of convergence of the presented algorithm has been demonstrated. Furthermore, the computer simulation results using MobileSim, a powerful simulator of real robots and environments, have been presented to confirm that the algorithm is effective and practicable. Also, the experiments with Pioneer 3DX wheeled mobile robots have been done to confirm the performance of our suggested algorithm. The presented results of the experiments with real robots show that the algorithm is quite practical. Finally, a comparison between the proposed triangular grid-based search algorithms in Chapters 3, 4 and this chapter against three other algorithms have been given. 69 Table 5.4: Comparison Between Presented Search Algorithms and Other Methods (Search time, minute) @ Search @ @ @ Algorithm @ @ @ @ @ Fixedlength random Levy randomwalk Levy randomwalk and Potential Field Random Triangular GridBased SemiRandom Triangular GridBased Modified TriangularGridBased 1 253.3 114.7 115.7 87.9 41.6 20.5 5 87.5 19.5 13.9 25.6 12.6 6.0 10 38.8 14.7 9.3 17.5 8.4 4.0 @ @ @ @ @ @ Number of robots @ @ @ @ @ Figure 5.14: Comparison between presented search algorithms and other methods 70 Table 5.5: Comparison Between Presented Search Algorithms and Other Methods (Searching speed, m2 /min) @ Search @ @ @ Algorithm @ @ @ @ @ Fixedlength random Levy randomwalk Levy randomwalk and Potential Field Random Triangular GridBased SemiRandom Triangular GridBased Modified TriangularGridBased 1 1.1 2.3 2.3 3.0 6.4 13.0 5 3.0 13.7 19.2 10.4 21.2 44.7 10 6.9 18.2 28.8 15.2 31.6 66.7 @ @ @ @ @ Number of robots @ @ @ @ @ @ Figure 5.15: Comparison between presented search algorithms and other methods 71 Chapter 6 Formatiom Building with Obstacle Avoidance In this chapter, we propose a distributed motion coordination control algorithm for a team of mobile robots so that the robots collectively move in a desired geometric pattern from any initial position while avoiding the obstacles on their routes. In the proposed method, the robots have no information on the shape and position of the obstacles and only use range sensors to obtain the information. We use standard kinematic equations for the robots with hard constraints on the linear and angular velocities. There is no leader in the team and the robots apply a distributed control algorithm based on the local information they obtain from their nearest neighbours. We take the advantage of using the consensus variables approach that is a known rule in multi-agent systems. Also, we propose a randomized algorithm for the anonymous robots, which achieves the convergence to the desired configuration with probability 1. Furthermore, we propose a novel obstacle avoidance technique based on the information from the range sensors. Mathematically rigorous proofs of the proposed control algorithms are given, and the effectiveness of the algorithms are illustrated via computer simulations. 6.1 Multi-Robot System We consider a system consisting of n autonomous mobile robots labeled 1 through n moving in a plane. The kinematic equations of motion for the robots are given by ẋi (t) = vi (t) cos(θi (t)) ẏi (t) = vi (t)sin(θi (t)) (6.1) θ̇i (t) = ωi (t) for all i = 1, 2, . . . , n, where (xi (t), yi (t)) are the Cartesian coordinates of robot i at time t, and θi (t) is its orientation with respect to the x-axis measured in the counter-clockwise direction. Also, vi (t), the speed of the robot, and ωi (t), its angular velocity, are the control inputs. Note that model (6.1) is a very common model, and many mobile agents (UGVs, UAVs, missiles, etc.) can be described by this model [170–175]. Furthermore, we need the following practical constraints: − ω max ≤ ωi (t) ≤ ω max 72 ∀t ≥ 0 (6.2) V m ≤ vi (t) ≤ V M ∀t ≥ 0 (6.3) for all i = 1, 2, . . . , n. Here, ω max > 0 and 0 < V m < V M are given constants. Moreover, let zi (t) be the vector of the robots’ coordinates and Vi (t) as the robots’ velocity vector defined by     xi (t) vi (t)cos(θi (t)) zi (t) := , Vi (t) := (6.4) yi (t) vi (t)sin(θi (t)) for all i = 1, 2, . . . , n. We assume that the robots share their information via a wireless communication at discrete time instants k = 0, 1, 2, . . .. Due to limited communication range of the robots, we assume rc as the communication range for all the mobile robots, meaning that a robot can only receive information from the robots which are located not farther than rc . Definition 6.1.1 Robot j is the neighbour of robot i at time k if and only if it is located on the disk of radius rc with the center of robot i’s position. Also, let N i (k) be the set of all neighbours of the robot i at time k, and |N i (k)| be the number of elements in N i (k). The relationship among the robots can be defined by an undirected graph G(k). We assume that any robot of the multi-robot team is a node of the graph G(k) at time k, i.e., i in VG = {1, 2, . . . , n}, the node set of G(k), is related to robot i. In addition, robot i is the neighbour of robot j at time k if and only if there is an edge between the nodes i and j of the graph G(k) where i 6= j. Therefore, the problem of communication among the robots equals the problem of the connectivity of the related graph. Note that robot i does not need to be the neighbour of robot j to get the information from. The information is transferred through the other robots which connect these robots in the related graph. We will also need the following assumption. Assumption 6.1.1 There exists an infinite sequence of contiguous, non-empty, bounded timeintervals [kj , kj+1 ), j = 0, 1, 2, . . ., starting at k0 = 0, such that across each [kj , kj+1 ), the union of the collection {G(k) : k ∈ [kj , kj+1 )} is a connected graph. To achieve the common heading and speed of formation, we use the consensus variables θ̃i (k) and ṽi (k), respectively. Also, we need a common origin of coordinates of the formation for the multi-robot system; therefore, x̃i (k) and ỹi (k) are used as the consensus variables for the coordinates of the robots. In other words, the robots start with different initial values of consensus variables x̃i (0), ỹi (0), θ̃i (0) and ṽi (0), and each robot calculates these consensus variables at any time k such that eventually the consensus variables converge to some consensus values which define a common speed and orientation in a common coordinate system. Assumption 6.1.2 The initial values of the consensus variables θ̃i satisfy θ̃i (0) ∈ [0, π) for all i = 1, 2, . . . , n. Assumption 6.1.3 The information on the other robots that is available to robot i at time k is the coordinates (xj (k), yj (k)), and the consensus variables θ̃j (k), x̃j (k), ỹj (k) and ṽj (k) for all j ∈ Ni (k). In practice, the coordinates of neighbouring robots can be obtained using Kalman state estimation via limited capacity communication channels [176]. 73 6.2 Formation Building We propose the following rules for updating the consensus variables θ̃i (k), x̃i (k), ỹi (k) and ṽi (k) : P θ̃i (k) + θ̃i (k + 1) = x̃i (k + 1) = ỹi (k + 1) = ṽi (k + 1) = θ̃j (k) j∈Ni (k) 1 + |Ni (k)| P xi (k) + x̃i (k) + (xj (k) + x̃j (k)) j∈Ni (k) 1 + |Ni (k)| P yi (k) + ỹi (k) + (yj (k) + ỹj (k)) j∈Ni (k) 1 + |Ni (k)| P ṽi (k) + ṽj (k) − xi (k + 1) (6.5) − yi (k + 1) j∈Ni (k) 1 + |Ni (k)| Based on rule (6.5), the mobile robots use the consensus variables to achieve a consensus on the heading, speed and origin of the coordinate system of the formation. Lemma 6.2.1 Suppose that Assumptions 6.1.1 and 6.1.2 hold, and the consensus variables are updated according to the decentralized control rule (6.5). Then, there exist constants θ̃0 , X̃0 , Ỹ0 and ṽ0 such that lim θ̃i (k) = θ̃0 k→∞ lim ṽi (k) = ṽ0 k→∞ lim (xi (k) + x̃i (k)) = X̃0 (6.6) k→∞ lim (yi (k) + ỹi (k)) = Ỹ0 k→∞ for all i = 1, 2, . . . , n. Furthermore, the convergence in (6.6) is exponentially fast. The statement of Lemma 6.2.1 immediately follows from the main result of [115]. Note that the constants θ̃0 , X̃0 , Ỹ0 and ṽ0 are the same for all the robots. Definition 6.2.1 A navigation law is said to be globally stabilizing with initial conditions (xi (0), yi (0), θi (0)), i = 1, 2, . . . , n and the given values of configuration C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . if there exists a Cartesian coordinate system and ṽ0 such that the solution of the closed-loop system (6.1) with these initial conditions and the proposed navigation law in this Cartesian coordinate system satisfies: lim (xi (t) − xj (t)) = Xi − Xj t→∞ lim (yi (t) − yj (t)) = Yi − Yj t→∞ 74 (6.7) and lim θi (t) = 0 t→∞ lim vi (t) = ṽ0 (6.8) t→∞ for all 1 ≤ i 6= j ≤ n. where X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn are given constants. Rule (6.8) means that as t → ∞ all the robots will finally move in the same direction along the x-axis with the same speed. Furthermore, rule (6.7) indicates that a geometric configuration of the robots given by C will be obtained. For instance, if we have four robots and C = {0, 0, 2, 2, 0, 1, 0, 1}, then the geometric formation of the robots will be a rectangle of sides 1 and 2. Since we use the discrete time consensus variables θ̃i (k), x̃i (k), ỹi (k) and ṽi (k) updated according to (6.5), we need to define the corresponding piecewise constant continuous time variables as θ̃i (t) x̃i (t) ỹi (t) ṽi (t) := θ̃i (k) ∀t ∈ (k, k + 1) := x̃i (k) ∀t ∈ (k, k + 1) := ỹi (k) ∀t ∈ (k, k + 1) := ṽi (k) ∀t ∈ (k, k + 1). (6.9) For any time t and any robot i, we consider a Cartesian coordinate system with the x-axis in the direction θ̃i (t) (according to the definition (6.9), θ̃i (t) is piecewise constant). In other words, in this coordinate system θ̃i (t) = 0 and xi (t), yi (t) are now coordinates of robot i in this system. Notice that we now formulate our decentralized control law for each robot in its own coordinate system. Since according to Lemma 6.2.1, θ̃i (k) converges to the same value for all i, all these robots’ coordinate systems converge to the same coordinate system in which (6.7) holds. Assumption 6.2.1 Let c > 0 be any constant such that c> 2V M . ω max (6.10) We assume that the constant c and also the configuration C are known to all the robots. Introduce the functions hi (t) as h(t) := (xi (t) + x̃i (t)) + Xi + tṽi (t) (6.11) for all i = 1,2,. . . , n. Also, introduce two-dimensional vector gi (t) as  x  g (t) gi (t) : = iy gi (t) where 75 (6.12) Y-Axis X-Axis Figure 6.1: Vectors geometry  hi (t) + c if xi (t) ≤ hi (t) xi (t) + c if xi (t) > hi (t) gix (t) := giy (t) := (yi (t) + ỹi (t)) + Yi (6.13) and two-dimensional vector di (t) as di (t) := gi (t) − zi (t) (6.14) for all i = 1,2,. . . , n, where zi (t) is defined by (6.4). Now, we introduce the following decentralized control law:  vi (t) = ωi (t) = ω V M if xi (t) ≤ hi (t) V m if xi (t) > hi (t) max (6.15) sign(ψi (t)) for all i = 1, 2, . . . , n, where ψi (t) is the angle between Vi (t) and di (t) measured from Vi (t) in the counter-clockwise direction, i.e., ψi (t) = ∠(Vi (t), di (t)) (6.16) (see Fig. 6.1), and sign(·) is defined by   −1 if α < 0 0 if α = 0 sign(α) :=  1 if α > 0 We also need the following assumption. 76 (6.17) Assumption 6.2.2 The initial robots’ speeds satisfy V m < vi (0) < V M for all i = 1, 2, . . . , n. Notice that Assumption 6.2.2 is just slightly stronger than the requirement (6.3) for t = 0 where non-strict inequalities are required. The proposed algorithm is based on robots’ headings and coordinates which, of course, depend on initial conditions. Therefore, the proposed law depends on initial conditions on robots’ headings and coordinates. The connectivity of the multi-robot formation is maintained due to Assumption 6.1.1 which is a standard assumption in numerous papers on multi- agent systems; see, e.g., [106, 115] and the references therein. Now, we are in a position to present the main result of this section. Theorem 6.2.1 Consider the autonomous mobile robots described by the equations (6.1) and the constraints (6.2), (6.3). Let C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn } be a given configuration. Suppose that Assumptions 6.1.1, 6.1.2, 6.2.1 and 6.2.2 hold. Then, the decentralized control law (6.5), (6.15) is globally stabilizing with any initial conditions and the configuration C. Proof of Theorem 6.2.1: Let 1 ≤ i ≤ n. We consider a fictitious target Ti moving on the plane with coordinates gi (t) defined by (6.13). Furthermore, introduce another fictitious target T̃i moving on the plane with coordinates g̃i (t) defined by  x  g̃ (t) g̃i (t) : = iy (6.18) g̃i (t) where  X0 + Xi + tṽ0 + c if xi (t) ≤ X̃0 + Xi + tṽ0 xi (t) + c if xi (t) > X̃0 + Xi + tṽ0 g̃ix (t) := g̃iy (t) := Ỹ0 + Yi (6.19) It immediately follows from Lemma 6.2.1 that lim (g̃i (t) − gi (t)) = 0. t→∞ (6.20) Moreover, this convergence is exponentially fast. Let ψi (t) be the angle between the velocity vector Vi (t) of robot i and the line-of-sight between the robot and Ti ; and βi (t) be the angle between the velocity vector ViT (t) of Ti and the line-of-sight from robot i to Ti (see Fig.6.1). It is well-known (see, e.g., [177]) that the following equation holds: ψ̇i (t) = where d˜i (t) is defined as kV T (t)k sin βi (t) kVi (t)k sin ψi (t) − ωi (t) − i kd˜i (t)k kd˜i (t)k d˜i (t) := g̃i (t) − zi (t), (6.21) (6.22) zi (t) is defined by (6.4), and k · k denotes the standard Euclidean vector norm. It obviously follows from (6.19),(6.22) that 77 t Figure 6.2: Sliding mode solution kd˜i (t)k ≥ c ∀t ≥ 0. (6.23) Furthermore, (6.19) implies that ViT (t)  ViT x (t) = ViT y (t) = 0.  Tx  (Vi (t) ; := ViT y (t) ṽ0 if xi (t) ≤ X0 + Xi + tṽ0 vi (t) if xi (t) > X0 + Xi + tṽ0 (6.24) It follows from (6.24) and (6.3) that kViT (t)k ≤ V M . (6.25) Now, we consider the control law (6.15) with di replaced by d˜i . The inequality (6.25) together with (6.10), (6.21) and (6.23) implies that under this control law, there exists a constant  > 0 such that ψ̇i (t) < − if ψi (t) > 0 ψ̇i (t) >  if ψi (t) < 0. (6.26) Therefore, there exists a time τ > 0 such that ψi (t) = 0 ∀t ≥ τ. (6.27) Notice that the closed-loop system (6.1), (6.15) is a system of differential equations with discontinuous right-hand sides; the equation ψi = 0 defines a switching surface of this system, and a solution satisfying (6.27) is a sliding mode; see, e.g., [178]. Also, (6.5), (6.15) that belongs to 78 the class of switched control laws and the system (6.1) with such controller is a hybrid dynamical system [179–181]. The inequalities (6.26) guarantee that this sliding mode solution of the closed-loop system looks as it is shown in Fig. 6.2 and satisfies ψ̇i (t) = 0 ∀i ∀t ≥ τ. (6.28) From this and (6.21), we obtain that ωi (t) = − kViT (t)k sin βi (t) ||d˜i (t)k (6.29) for all sliding mode solutions. Therefore, for any initial condition, the sliding mode solution is unique and well-defined. Furthermore, (6.29), (6.25), (6.10) and (6.23) imply that the constraint (6.2) holds for any sliding mode solution satisfying (6.27). Furthermore, the condition (6.27) means that the velocity vector Vi (t) is parallel to the vector d˜i (t) for all t ≥ τ . Hence, for all t ≥ τ , we have that the robot’s velocity vector is always pointed at g̃i (t) . Since g̃iy (t) = Ỹ0 + Yi , we obtain that yi (t) → Ỹ0 + Yi . The second of the conditions (6.7) immediately follows from this. Furthermore, Assumption 6.2.2 implies that V m ≤ ṽ0 ≤ V M . The fact that the velocity vector Vi (t) is parallel to the vector d˜i (t) for all t ≥ τ , and the control law (6.15) with di replaced by d˜i imply that   c ˜ di (t) = 0 for all i and all large enough t. The first of the conditions (6.7) immediately follows from this. We proved the statement of the theorem for the control law (6.15) with di replaced by d˜i . This and the exponential convergence (6.20) together with the inequality (6.23) imply that the same statement holds for the original control law (6.15). This completes the proof of Theorem 6.2.1.  Remark 6.2.1 It is evident from the proof of Theorem 6.2.1 that the main idea of the control law (6.15) can be explained as follows. Each robot i is guided towards a fictitious target Ti that is always located ahead of the desired robot’s position relative to its neighbours. The reason we guide the robot towards a fictitious target but not the desired relative robot’s position itself is clear from (6.29). If we conducted the robot towards the desired relative position, we would have kdi (t)k → 0; therefore, ωi (t) → ∞ and the constraint (6.2) would be violated. Notice that our method for guidance towards a fictitious target Ti is a pure pursuit type guidance law (see, e.g., [182]). 6.3 Formation Building with Anonymous Robots In the area of robotics, it is common to use the multi-robot task allocation approach to similar problems. However, most work on multi-robot task allocation has been ad hoc and empirical especially in the case of an arbitrarily large number of robots; see, e.g., [183,184]. In this section, we propose a randomized algorithm to handle this problem which leads to a mathematically rigorous theoretical analysis for any number of robots. In Section 6.2, an algorithm of formation building for a team of mobile robots was proposed in which positions of all robots are preassigned, i.e., each robot knows a priori its final position in the desired geometric configuration. 79 In this section, we present the algorithm of formation building with anonymous robots meaning that the robots do not know their final position in the desired geometric configuration at the beginning but using a randomized algorithm, they eventually reach a consensus on their positions. In other words, each robot does not know a priori its position in the configuration C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn }. Definition 6.3.1 A navigation law is said to be globally stabilizing with anonymous robots and the configuration C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn } if for any initial conditions (xi (0), yi (0), θi (0)), there exists a permutation r(i) of the index set {1, 2, . . . , n} such that for any i = 1, 2, . . . , n, there exist a Cartesian coordinate system and ṽ0 such that the solution of the closed-loop system (6.1) with the proposed navigation law in this Cartesian coordinate system satisfies (6.8) and lim (xi (t) − xj (t)) =Xr(i) − Xr(j) t→∞ lim (yi (t) − yj (t)) =Yr(i) − Yr(j) (6.30) t→∞ for all 1 ≤ i 6= j ≤ n. Let R > 0 be a given constant. We assume that each robot i has the capacity to detect all other robots inside the circle of radius R centred at the current position of robot i. Furthermore, R let 0 <  < be a given constant. For any configuration C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn } 2 introduce a undirected graph P consisting of n vertices. Vertices i and j of the graph P are p connected by an edge if and only if (Xi − Xj )2 + (Yi − Yj )2 ) ≤ R − 2. We will need the following assumption. Assumption 6.3.1 The graph P is connected. We present a randomized algorithm to build an index permutation function r(i) . Let N ≥ 1 be a given integer. Let r(0, i) ∈ {1, 2, . . . , n} be any initial index values where i = 1, 2, . . . , n. As in the navigation law (6.5), (6.15), for any time t and any robot i, we consider a Cartesian coordinate system with the x-axis in the direction θ̃i (t) (according to the definition (6.9), θ̃i (t) is piecewise constant). In other words, in this coordinate system θ̃i (t) = 0, xi (t), yi (t) are now coordinates of robot i in this system. Furthermore, we say that a vertex j of the graph P is vacant at time kN for robot i if there is no any robot inside the circle of radius  centred at the point   (xi (kN ) + x̃i (kN )) + Xj + kN ṽi (kN ) (yi (kN ) + ỹi (kN )) + Yj Let S(kN, i) denote the set of vertices of P consisting of r(kN, i) and those of vertices of P that are connected to r(kN, i) and vacant at time kN for robot i. Let |S(kN, i)| be the number of elements in S(kN, i). It is clear that 1 ≤ |S(kN, i)| because r(kN, i) ∈ S(kN, i). Moreover, introduce the Boolean variable bi (kN ) such that bi (kN ) := 1 if there exists another robot j 6= i that is inside of the circle of radius  centred at   (xi (kN ) + x̃i (kN )) + Xi + kN ṽi (kN ) (yi (kN ) + ỹi (kN )) + Yi 80 at time kN , and bi (kN ) := 0 otherwise. We propose the following random algorithm:  r(kN, i) if (bi (kN ) = 0 or (bi (kN ) = 1)    and |S(kN, i)| = 1 r((k + 1)N, i) = (6.31) j if bi (kN ) = 1    and |S(kN, i)| > 1 Now, we are in a position to present the main result of this section. Theorem 6.3.1 Consider the autonomous robots described by the equations (6.1) and the constraints (6.2), (6.3). Let C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn } be a given configuration. Suppose that Assumptions 6.1.1, 6.1.2, 6.2.2 and 6.3.1 hold, and c is a constant satisfying (6.10). Then, for initial conditions (xi (0), yi (0), θi (0)), i = 1, 2, . . . , n, there exists an integer N0 > 0 such that for any N ≥ N0 , the decentralized control law (6.5), (6.15), (6.31) with probability 1 is globally stabilizing with these initial conditions and the configuration C. Proof of Theorem 6.3.1: The algorithm (6.31) defines an absorbing Markov chain which contains a number of absorbing states that are impossible to leave; in this case, the states when different robots correspond to different vertices of the desired configuration. It is also obvious that these absorbing states can be reached from any initial state with a non-zero probability. It is a well-known theorem of the Markov chain theory that a Markov chain with finite number of states has, at least, one absorbing state which can be reached from any other states with non-zero probability. Then, with probability 1, one of the absorbing states will be reached. This completes the proof of Theorem 6.3.1.  6.4 Obstacle Avoidance We consider a more challenging problem of navigation of a group of mobile robots for formation in the existence of obstacles. The map of the environment, information about the obstacles including their shapes, positions and geometric distribution are not known to the robots a priori. To detect an obstacle, the robots must be equipped with a range sensor like sonar or laser. The robots can detect an obstacle when it lies within their range. Then, they obtain range and angle to the obstacle. The algorithm of obstacle avoidance employs this information and calculates an appropriate route to avoid collision with the obstacle. We apply an algorithm for obstacle avoidance that uses angles and distances provided by range sensors. We assume that the range sensors are located on the robot’s perimeter, in the forepart with 180◦ field of view; ±90◦ with respect to robot’s heading. Also, we assume that the maximum range of robots’ range sensors is rs . As shown in Fig. 6.3, a robot moving toward an obstacle detects the obstacle as soon as the obstacle is placed in the sensing range of the robot. Then, the robot changes its route to turn the obstacle preserving a distance to it. Suppose Rt be the turning radius of the robot and d be the distance to the obstacle when the robot’s heading is parallel to the obstacle surface. Since Rtmax = VM ω min and dmin = rs − Rtmax thus, we need following assumption. 81 d Figure 6.3: Detecting an obstacle Figure 6.4: Moving with a constant distance to the obstacle Assumption 6.4.1 dmin > d0 where d0 is a given constant. Assume a robot is moving along the circumference of an obstacle (see Fig. 6.4). Also, suppose that the curvature radius of the obstacle is big enough such that the surface of the obstacle is assumed flat. As shown in Fig. 6.4, if the robot picks the farthest detectable point on the obstacle surface using its range sensor as a reference point, there exists an angle between the robot’s heading and range sensor’s ray is termed as avoiding angle. To have a constant distance to the obstacle, we need a constant avoiding angle φ0 satisfying d0 = rs sin φ0 . Now, consider the robot encounters a curved obstacle (see Fig. 6.5). Therefore, the robot must follow a trajectory preserving the given distance of d0 to the obstacle surface. For instance, as shown in Fig. 6.5, the robot’s distance to the obstacle is d0 but the range sensor detects that the avoiding angle φ is greater than φ0 and their difference is ∆φ = |φ − φ0 |. Thus, the robot must turn in order to remove this gap; by turning equal to ∆φ to the right in this case. Fig. 6.6 shows the details of obstacle avoidance approach when the obstacle is convex. As shown in Fig. 6.6, the robot is moving along the surface of the obstacle with avoiding distance of d0 . As previously mentioned and shown in Fig. 6.4, there is an angle of φ0 between the 82 Figure 6.5: Detecting the curvature of an obstacle robot’s heading and the range sensor’s ray for a flat surface. However, in order to keep moving with the avoiding distance of d0 , the robot must turn by ∆φ toward the obstacle. Assume a fictitious target T , a point with a distance of rs to the robot and angle of ∆φ respect to the robot’s heading toward the obstacle (see Fig .6.6). As depicted in Fig. 6.6, angles θ0 and θ00 d = CD d thus are equal thus the line segments d0 and d00 will be equal. In addition, since AB ]ODB = ]OCD = γ which satisfies that triangles BED and AFC are equal. Therefore, line segment AF, which is the distance to the obstacle at F, will be equal to BE= d0 . It means that if point C is selected as the fictitious target, the distance to the obstacle will be maintained to a given constant. Fig. 6.7 shows the case that the obstacle is concave. This case is similar to the convex case except the fictitious target that is away from the obstacle; therefore, the robot must turn by ∆φ away from the obstacle. As a result, we propose the following control law that enables robots to avoid a collision by calculating a smooth path around the obstacles. vi (t) = V M ωi (t) = ω max sign(ψi (t)) (6.32) for all i = 1, 2, . . . , n, where  If φ < φ0  1 0 If φ = φ0 ψi (t) =  −1 If φ > φ0 also V M , ω max and sign(.) are given in (6.2), (6.3) and (6.17), respectively. Now, we are in a position to present the main results of this chapter. 83 (6.33) E O D F C B A Figure 6.6: A convex obstacle Theorem 6.4.1 Consider the autonomous mobile robots described by the equations (6.1) and the constraints (6.2), (6.3). Let C = {X1 , X2 , . . . , Xn , Y1 , Y2 , . . . , Yn } be a given configuration. Suppose that Assumptions 6.1.1, 6.1.2, 6.2.1 and 6.2.2 hold, and c is a constant satisfying (6.10). Then, the distributed control law (6.5), (6.15), (6.32) is globally stabilizing with any initial conditions and the configuration C. Proof of Theorem 6.4.1: proof of Theorem 6.4.1 is completely similar to the proof of Theorem 6.2.1. Both control laws, (6.15) for formation building and (6.32) for obstacle avoidance are the same. The main difference is that the fictitious target T in this case is variable between (6.12) and what is defined in this section. In other words, whenever a robot encounters an obstacle, the fictitious target switches from (6.12) to a point with a distance of rs to the robot and angle of ∆φ respect to the robot’s heading toward the obstacle (point C in Fig. 6.6 and Fig. 6.7). 6.5 Simulation Results We present computer simulation results for all algorithms proposed in this chapter: obstacle avoidance, formation building with obstacle avoidance and anonymous formation building with obstacle avoidance. We use Mobotsim 1.0 simulator, a powerful 2D simulator of mobile robots that simulates robots’ motion, environment and range sensors like sonar. Simulation parameters are given in Table 6.1. 84 F C E O D A B Figure 6.7: A concave obstacle Table 6.1: Simulation Paremeters Parameter Sampling Intervals Robot’s Platform Diameter Distance Between Wheels Wheels Diameter Maximum Angular Velocity Maximum Linear Velocity Minimum Linear Velocity Sonars Maximum Range Number of Ranging Sonars Sonars’ Radiation Cone 6.5.1 Value 0.1 0.5 0.35 0.2 2 1.5 .2 2 12 15 Comment s meter meter meter rad/s m/s m/s meter degree Obstacle Avoidance First, we present the simulation results for the proposed obstacle avoidance rule (6.32). Fig. 6.8 shows the simulation results for obstacle avoidance rule (6.32) with some different obstacles. As Fig. 6.8 displays, by applying the proposed obstacle avoidance rule, the robots successfully bypass the obstacles with different shapes and sizes. 85 (a) (b) (c) (d) Figure 6.8: Applying the obstacle avoidance rule; robots pass the obstacles 6.5.2 Formation Building with Obstacle Avoidance To simulate the algorithm of formation building with obstacle avoidance, we consider a team consisting of five robots randomly located on the plane with different headings. The goal is to build a formation as well as avoiding the obstacles that might obstruct robots’ movement. The robots are to build the edge ( ’>’) by applying the proposed algorithm of formation building in Section 6.2 and the obstacle avoidance rule in Section 6.4. First, we assume that there is not any obstacle; therefore, only the formation building rule of the proposed algorithm is used. As depicted in Fig. 6.9, the robots build the desired formation (’>’). Second, we assume the same problem but this time with an obstacle. The simulation results of applying the proposed algorithm are displayed in Fig. 6.10. As shown in Fig. 6.10(a), the robots build the desired formation before they encounter the obstacle, and move such that the formation configuration holds. When the robots detect an obstacle on their direction, they avoid the obstacle by turning around. Fig. 6.10(b) shows the snapshot of this phase. Passing the obstacle, the robots restart the formation building phase and as Fig. 6.10(c) shows, the desired formation is built again. Note that as shown in Fig. 6.10, it is not necessary for the robots to pass the obstacle all together and then start the formation building, e.g., while one robot is still in the obstacle avoidance phase, the other robots that have passed the obstacle begin the formation building phase again. 86 Figure 6.9: Robots form the desired pattern without any obstacles (a) (b) (c) Figure 6.10: Robots pass the obstacle and build the desired form To confirm that the proposed algorithm is effective even with any number of obstacles with different shapes and sizes, more simulations are fulfilled. Fig. 6.11 shows the results of 87 (a) (b) (c) Figure 6.11: Robots form the desired patterns and avoid obstacles 88 these simulations in which more obstacles with different shapes and sizes are used, and the robots build various formations. In Fig. 6.11(a), the robots build an edge (’>’) while avoiding the obstacles on their routes. In Fig. 6.11 (b) and (c), they form shapes of a line and an arc, respectively. The results confirm that the proposed algorithm is effective even with any number of obstacles with different shapes and sizes. It should be pointed out that the proposed obstacle avoidance algorithm prevents the collision between robots too; as a robot considers another robot in its sensing range as an obstacle. 6.5.3 Formation Building with Anonymous Robots and Obstacle Avoidance In Section 6.5.2, simulation results for formation building with obstacle avoidance have been presented. As previously explained, in the algorithm of Section 6.2, positions of all the robots are pre-assigned, i.e., each robot knows its position in the final formation building. Therefore, the positions of the robots do not change during the formation process; as it has been shown in Fig. 6.11 when positions of the robots are invariant before and after passing the obstacles. On the other hand, applying the algorithm of Section 6.3, result in altering the position of the robots during the formation process. Simulation results for the algorithm of formation building with anonymous robots presented in Section 6.3, are given in Fig. 6.12. In Fig. 6.12(a), robots form an edge (’>’) before encountering the obstacles, and Fig. 6.12(b) shows the positions of the robots after passing the obstacles. As shown in Fig. 6.12(b), the positions of the robots after passing the obstacles are not the same as before; robots make the same formation building but with a different arrangement of the robots. Fig. 6.12(c-f), show something like that for line ’|’ and arc ’(’ formation buildings. Fig. 6.13 shows a comparison between the formation building algorithms, with and without anonymous robots. As depicted in Fig. 6.13(a), the positions of the robots in the formation building are the same before and after passing the obstacles while in Fig. 6.13(b) where the algorithm of anonymous formation building is applied, the positions of the robots change. 6.6 Summary The problem of formation building with obstacle avoidance for a team of mobile robots have been considered. The algorithm of global formation building has been combined with a local obstacle avoidance algorithm. We have proposed a distributed motion coordination control algorithm so that the robots collectively move in a desired geometric pattern from any initial position while avoiding the obstacles on their way. We have considered unicycles with standard kinematic equations and hard constraints on their linear and angular velocities for the type of the robots. A consensus variables rule has been used for the formation building phase that is based on the local information. Also, a novel technique based on the information from the range sensors have been employed for the obstacle avoidance phase. Furthermore, we propose a randomized algorithm for the anonymous robots which achieves the convergence to the desired configuration with probability 1. Mathematically rigorous proofs of the proposed control algorithms have been given, and the effectiveness of the algorithms have been confirmed via computer simulations. 89 (a) (b) (c) (d) (e) (f) Figure 6.12: Robots form (a),(b) an edge; (c),(d) a line and (e),(f) an arc 90 (a) Formation building without anonymous robots (b) Formation building with anonymous robots Figure 6.13: A comparison between formation building with and without anonymous robots 91 Chapter 7 Conclusions The main purpose of this report was to design some algorithms for search by multi-robot systems. We assumed an unknown area including some obstacles to be searched by a team of autonomous mobile robots either partially for a given number of targets or entirely for the unknown number of targets. For that purpose, we developed three decentralized control algorithms to drive a multi-robot team to explore unknown environments. We used a triangular grid pattern and two-stage algorithms for the control law so that robots move through the vertices of the grid during the search procedure. In the first stage of the proposed search algorithms, using a consensus variables rule, the robots are located on the vertices of a triangular grid. For the second stage of the algorithm, three different scenarios were considered. First, a pure random grid-based algorithm described in Chapter 3 was presented, by which the robots randomly move between the vertices of a common triangular grid so that in each step they only move to the one of the closest neighbouring vertices. Note that there are at most six closest neighbouring vertices for each vertex. In the second scenario, presented in Chapter 4, we changed the pure random rule to a semi-random rule. In this case, the robots still randomly move between the vertices of a common triangular grid so that in each step they move to the one of the closest neighbouring vertices; but, only to those vertices which have not been visited by the robots yet. If all the (at most) six neighbouring vertices have been visited already, one of them will randomly be selected. Finally, a modified algorithm was proposed in Chapter 5. This algorithm does not confine the robots to move only to the closest neighbouring vertices; but, they move to the nearest unvisited vertex anywhere in the search area. It has been shown that a triangular grid pattern is asymptotically optimal in terms of the minimum number of robots required for the complete coverage of an arbitrary bounded area. That is we employed a triangular grid pattern for the proposed algorithms, i.e., robots certainly go through the vertices of a triangular grid during the search operation. Therefore, using the vertices of a triangular grid coverage guarantees complete search of the whole area as well as better performance in terms of search time. Furthermore, we presented a new kind of topological map which robots make and share during the search operation. Unlike many other hubristic algorithms in this area, we gave mathematically rigorous proofs of convergence with probability 1 of the proposed algorithms. The procedures of this study were approved by computer simulation results using a simulator of real robots and environments. To evaluate the performance of the algorithms, we presented the experiment results with real Pioneer 3DX mobile robots for one of the algorithms with detailed descriptions and explanations. The results demonstrated the features of the proposed algorithms and their performance with real systems. Moreover, we compared the proposed 92 algorithms with each other and also with three other algorithms from other researchers. The comparison showed the strength of our proposed algorithms over the other existing algorithms. Also, a further study on networked multi-robot formation building algorithms was presented in this report. The problem of formation building for a group of mobile robots was considered. A decentralized formation building with obstacle avoidance algorithm for a group of mobile robots to move in a defined geometric configuration was proposed. Furthermore, we considered a more complicated formation problem with a group of anonymous robots where the robots are not aware of their position in the final configuration and have to reach a consensus during the formation process while avoiding obstacles. We proposed a randomized algorithm for the anonymous robots which achieves the convergence to the desired configuration with probability 1. Moreover, we presented a novel obstacle avoidance rule which was employed in the formation building algorithms. We demonstrated mathematically rigorous proofs of convergence of the presented algorithms. Also, we confirmed the performance and applicability of the proposed algorithms by computer simulation results. Future Work In terms of directions for future research, further work could be as follows: • It is an interesting direction for future research to apply the proposed search algorithms to swarm systems. In that case, it could also be conducted to determine the effectiveness of limited wireless communication and memory resources [185, 186]. • During the experiments, no visible or severe drift on wheel odometry was observed; but, it can be significant if the number of vertices of the grid is large. Addressing this problem is a direction for our future work [187, 188]. • We have assumed static obstacles in the workspace. For a real application, more challenges may appear with moving obstacles in the environment that would be a fruitful area for further work [189, 190]. • In the proposed search algorithms, we have assumed static targets. It is recommended that further research be undertaken with moving targets [191]. • In Chapter 6, we proposed new strategies in formation control with obstacle avoidance of autonomous robots and presented computer simulation results. It would be interesting to investigate and verify the effectiveness of the proposed algorithms through experiments with real robots. • Regarding the proposed formation building algorithms, the future work can be modifying the proposed algorithms so that the formation holds while passing the obstacles [192]. • Another possible area of future research would be to consider the problem of environmental extremum seeking by multi-robot teams using the algorithms presented in this report for search and formation [193–196]. 93 Bibliography [1] H. H. Viet, V.-H. Dang, M. N. U. Laskar, and T. Chung, “Ba*: an online complete coverage algorithm for cleaning robots,” Applied Intelligence, vol. 39, no. 2, pp. 217–235, 2013. [2] J. Hess, M. Beinhofer, and W. Burgard, “A probabilistic approach to high-confidence cleaning guarantees for low-cost cleaning robots,” in Proceedings of the 2014 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2014, pp. 5600–5605. [3] A. Marjovi and L. Marques, “Multi-robot olfactory search in structured environments,” Robotics and Autonomous Systems, vol. 59, no. 11, pp. 867–881, 2011. [4] F. Kendoul, “Survey of advances in guidance, navigation, and control of unmanned rotorcraft systems,” Journal of Field Robotics, vol. 29, no. 2, pp. 315–378, 2012. [5] J. Linchant, J. Lisein, J. Semeki, P. Lejeune, and C. Vermeulen, “Are unmanned aircraft systems (uass) the future of wildlife monitoring? a review of accomplishments and challenges,” Mammal Review, vol. 45, no. 4, pp. 239–252, 2015. [Online]. Available: http://dx.doi.org/10.1111/mam.12046 [6] C. Zhang and J. M. Kovacs, “The application of small unmanned aerial systems for precision agriculture: a review,” Precision Agriculture, vol. 13, no. 6, pp. 693–712, 2012. [7] Q.-V. Dang, I. Nielsen, K. Steger-Jensen, and O. Madsen, “Scheduling a single mobile robot for part-feeding tasks of production lines,” Journal of Intelligent Manufacturing, vol. 25, no. 6, pp. 1271–1287, 2014. [8] E. Guizzo and E. Ackerman, “The rise of the robot worker,” IEEE Spectrum, vol. 49, no. 10, pp. 34–41, 2012. [9] H. Chi, K. Zhan, and B. Shi, “Automatic guidance of underground mining vehicles using laser sensors,” Tunnelling and Underground Space Technology, vol. 27, no. 1, pp. 142–148, 2012. [10] M. Dunn, D. Reid, and J. Ralston, “Control of automated mining machinery using aided inertial navigation,” in Machine Vision and Mechatronics in Practice. Springer, 2015, pp. 1–9. [11] M. Subhan, A. Bhide, and B. SSGB COE, “Study of unmanned vehicle (robot) for coal mines,” International Journal of Innovative Research in Advanced Engineering (IJIRAE), vol. 1, no. 10, pp. 116–120, 2014. 94 [12] U. Reiser, T. Jacobs, G. Arbeiter, C. Parlitz, and K. Dautenhahn, “Care-o-bot R 3–vision of a robot butler,” Your Virtual Butler, pp. 97–116, 2013. [13] C. Wang, A. V. Savkin, R. Clout, and H. T. Nguyen, “An intelligent robotic hospital bed for safe transportation of critical neurosurgery patients along crowded hospital corridors,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 23, no. 5, pp. 744–754, 2015. [14] S. Satake, K. Hayashi, K. Nakatani, and T. Kanda, “Field trial of an informationproviding robot in a shopping mall,” in Proceedings of the 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2015, pp. 1832–1839. [15] M. Guarnieri, R. Kurazume, H. Masuda, T. Inoh, K. Takita, P. Debenest, R. Hodoshima, E. Fukushima, and S. Hirose, “Helios system: A team of tracked robots for special urban search and rescue operations,” in Proceedings of the 2009 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2009, pp. 2795–2800. [16] G.-J. M. Kruijff, M. Janı́ček, S. Keshavdas, B. Larochelle, H. Zender, N. J. Smets, T. Mioch, M. A. Neerincx, J. V. Diggelen, F. Colas et al., “Experience in system design for human-robot teaming in urban search and rescue,” in Field and Service Robotics, 2014, pp. 111–125. [17] A. Marjovi, J. G. Nunes, L. Marques, and A. de Almeida, “Multi-robot fire searching in unknown environment,” in Field and Service Robotics, 2010, pp. 341–351. [18] G. Tuna, V. C. Gungor, and K. Gulez, “An autonomous wireless sensor network deployment system using mobile robots for human existence detection in case of disasters,” Ad Hoc Networks, vol. 13, pp. 54–68, 2014. [19] B. Liu, O. Dousse, P. Nain, and D. Towsley, “Dynamic coverage of mobile sensor networks,” IEEE Transactions on Parallel and Distributed Systems, vol. 24, no. 2, pp. 301– 311, 2013. [20] P. Stone and M. Veloso, “Multiagent systems: A survey from a machine learning perspective,” Autonomous Robots, vol. 8, no. 3, pp. 345–383, 2000. [21] “Mars pathfider,” http://mars.nasa.gov/MPF/index1.html, accessed: 2016-01-17. [22] “Sony aibo,” http://www.sony-aibo.com, accessed: 2016-02-12. [23] “Bigdog-the most advanced rough-terrain robot on http://www.bostondynamics.com/robot bigdog.html, accessed: 2016-02-01. earth,” [24] G. Dudek, M. R. Jenkin, E. Milios, and D. Wilkes, “A taxonomy for multi-agent robotics,” Autonomous Robots, vol. 3, no. 4, pp. 375–397, 1996. [25] V. Zadorozhny and M. Lewis, “Information fusion based on collective intelligence for multi-robot search and rescue missions,” in Proceedings of the 14th IEEE International Conference on Mobile Data Management. IEEE, 2013, pp. 275–278. 95 [26] T. Pereira, A. P. Moreira, and M. Veloso, “Coordination for multi-robot exploration using topological maps,” in Proceedings of the 11th Portuguese Conference on Automatic Control (CONTROLO). Springer, 2015, pp. 515–524. [27] F. F. Carvalho, R. C. Cavalcante, M. Vieira, L. Chaimowicz, M. F. Campos et al., “A multi-robot exploration approach based on distributed graph coloring,” in Proceedings of the 2013 Latin American Robotics Symposium and Competition (LARS/LARC). IEEE, 2013, pp. 142–147. [28] S. Sharma, C. Sur, A. Shukla, and R. Tiwari, “Multi-robot area exploration using particle swarm optimization with the help of cbdf-based robot scattering,” in Computational Vision and Robotics. Springer, 2015, pp. 113–123. [29] Z. Yan, N. Jouandeau, and A. A. Cherif, “A survey and analysis of multi-robot coordination,” International Journal of Advanced Robotic Systems, vol. 10, 2013. [30] S. I. Roumeliotis and G. A. Bekey, “Distributed multirobot localization,” IEEE Transactions on Robotics and Automation, vol. 18, no. 5, pp. 781–795, 2002. [31] D. Fox, W. Burgard, H. Kruppa, and S. Thrun, “A probabilistic approach to collaborative multi-robot localization,” Autonomous Robots, vol. 8, no. 3, pp. 325–344, 2000. [32] J. Wawerla and R. T. Vaughan, “A fast and frugal method for team-task allocation in a multi-robot transportation system,” in Proceedings of the 2010 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2010, pp. 1432–1437. [33] A. Prorok, A. Bahr, and A. Martinoli, “Low-cost collaborative localization for largescale multi-robot systems,” in Proceedings of the 2012 IEEE International Conference on Robotics and Automation (ICRA). Ieee, 2012, pp. 4236–4241. [34] N. Agmon, S. Kraus, and G. A. Kaminka, “Multi-robot perimeter patrol in adversarial settings,” in Proceedings of the 2008 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2008, pp. 2339–2345. [35] L. Chaimowicz, A. Cowley, D. Gomez-Ibanez, B. Grocholsky, M. Hsieh, H. Hsu, J. Keller, V. Kumar, R. Swaminathan, and C. Taylor, “Deploying air-ground multi-robot teams in urban environments,” in Multi-Robot Systems. From Swarms to Intelligent Automata Volume III. Springer, 2005, pp. 223–234. [36] K. M. Wurm, C. Stachniss, and W. Burgard, “Coordinated multi-robot exploration using a segmentation of the environment,” in Proceedings of the 2008 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2008, pp. 1160–1165. [37] A. Baranzadeh, “A decentralized control algorithm for target search by a multi-robot team,” in Proceedings of the 2013 Australasian Conference on Robotics and Automation (ACRA). ARAA, 2013. [38] V. Nazarzehi and A. Baranzadeh, “A decentralized grid-based random search algorithm for locating targets in three dimensional environments by a mobile robotic network,” in Proceedings of the 2015 Australasian Conference on Robotics and Automation (ACRA). ARAA, 2015. 96 [39] ——, “A distributed bio-inspired algorithm for search of moving targets in three dimensional spaces,” in Proceedings of the 2015 IEEE International Conference on Robotics and Biomimetics (ROBIO). IEEE, 2015, pp. 2507–2512. [40] A. Baranzadeh and A. V. Savkin, “A distributed algorithm for grid-based search by a multi-robot system,” in Proceedings of the 10th Asian Control Conference (ASCC). IEEE, 2015, pp. 1–6. [41] ——, “A distributed control algorithm for area search by a multi-robot team,” Robotica, 2016 (Accepted). [42] H. Sugiyama, T. Tsujioka, and M. Murata, “Integrated operations of multi-robot rescue system with ad hoc networking,” in Proceedings of the 1st International Conference on Wireless Communication, Vehicular Technology, Information Theory and Aerospace & Electronic Systems Technology (Wireless VITAE). IEEE, 2009, pp. 535–539. [43] D. Portugal and R. Rocha, “A survey on multi-robot patrolling algorithms,” in Technological Innovation for Sustainability. Springer, 2011, pp. 139–146. [44] A. S. Matveev, H. Teimoori, and A. V. Savkin, “A method for guidance and control of an autonomous vehicle in problems of border patrolling and obstacle avoidance,” Automatica, vol. 47, no. 3, pp. 515–524, 2011. [45] A. Howard, L. E. Parker, and G. S. Sukhatme, “Experiments with a large heterogeneous mobile robot team: Exploration, mapping, deployment and detection,” The International Journal of Robotics Research, vol. 25, no. 5-6, pp. 431–447, 2006. [46] A. Fagiolini, M. Pellinacci, G. Valenti, G. Dini, and A. Bicchi, “Consensus-based distributed intrusion detection for multi-robot systems,” in Proceedings of the 2008 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2008, pp. 120– 127. [47] S. Tadokoro, Rescue robotics: DDT project on robots and systems for urban search and rescue. Springer Science & Business Media, 2009. [48] R. R. Murphy, J. Kravitz, S. Stover, and R. Shoureshi, “Mobile robots in mine rescue and recovery,” IEEE Robotics & Automation Magazine, vol. 16, no. 2, pp. 91–103, 2009. [49] R. W. Beard and T. W. McLain, “Multiple uav cooperative search under collision avoidance and limited range communication constraints,” in Proceedings of 42nd IEEE Conference on Decision and Control, vol. 1. IEEE, 2003, pp. 25–30. [50] P. Vincent and I. Rubin, “A framework and analysis for cooperative search using uav swarms,” in Proceedings of the 2004 ACM Symposium on Applied Computing. ACM, 2004, pp. 79–86. [51] Y. Yang, M. M. Polycarpou, and A. A. Minai, “Multi-uav cooperative search using an opportunistic learning method,” Journal of Dynamic Systems, Measurement, and Control, vol. 129, no. 5, pp. 716–728, 2007. 97 [52] J. L. Baxter, E. Burke, J. M. Garibaldi, and M. Norman, “Multi-robot search and rescue: A potential field based approach,” in Autonomous Robots and Agents. Springer, 2007, pp. 9–16. [53] A. Marjovi, J. Nunes, L. Marques, and A. de Almeida, “Multi-robot exploration and fire searching,” in Proceedings of the 2009 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2009, pp. 1929–1934. [54] H. Sugiyama, T. Tsujioka, and M. Murata, “Autonomous chain network formation by multi-robot rescue system with ad hoc networking,” in Proceedings of the 2010 IEEE International Workshop on Safety Security and Rescue Robotics (SSRR). IEEE, 2010, pp. 1–6. [55] C. Luo, A. P. Espinosa, D. Pranantha, and A. De Gloria, “Multi-robot search and rescue team,” in Proceedings of the 2011 IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR). IEEE, 2011, pp. 296–301. [56] M. Lewis and K. Sycara, “Network-centric control for multirobot teams in urban search and rescue,” in Proceedings of the 44th Hawaii International Conference on System Sciences (HICSS). IEEE, 2011, pp. 1–10. [57] A. Macwan, G. Nejat, and B. Benhabib, “Target-motion prediction for robotic search and rescue in wilderness environments,” IEEE Transactions on Systems, Man, and Cybernetics, Part B: Cybernetics, vol. 41, no. 5, pp. 1287–1298, 2011. [58] B. Mobedi and G. Nejat, “3-d active sensing in time-critical urban search and rescue missions,” IEEE/ASME Transactions on Mechatronics, vol. 17, no. 6, pp. 1111–1119, 2012. [59] H. Sugiyama, T. Tsujioka, and M. Murata, “Real-time exploration of a multi-robot rescue system in disaster areas,” Advanced Robotics, vol. 27, no. 17, pp. 1313–1323, 2013. [60] Y. Liu, G. Nejat, and J. Vilela, “Learning to cooperate together: A semi-autonomous control architecture for multi-robot teams in urban search and rescue,” in Proceedings of the 2013 IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR). IEEE, 2013, pp. 1–6. [61] R. Cipolleschi, M. Giusto, A. Q. Li, and F. Amigoni, “Semantically-informed coordinated multirobot exploration of relevant areas in search and rescue settings,” in Proceedings of the 2013 European Conference on Mobile Robots (ECMR). IEEE, 2013, pp. 216–221. [62] F. Amigoni, N. Basilico, and A. Q. Li, “How much worth is coordination of mobile robots for exploration in search and rescue?” in RoboCup 2012: Robot Soccer World Cup XVI. Springer, 2013, pp. 106–117. [63] S. V. Spires and S. Y. Goldsmith, “Exhaustive geographic search with mobile robots along space-filling curves,” in Collective Robotics. Springer, 1998, pp. 1–12. [64] D. Enns, D. Bugajski, and S. Pratt, “Guidance and control for cooperative search,” in Proceedings of the 2002 American Control Conference (ACC), vol. 3. IEEE, 2002, pp. 1923–1929. 98 [65] B. A. Bash and P. J. Desnoyers, “Exact distributed voronoi cell computation in sensor networks,” in Proceedings of the 6th International Conference on Information Processing in Sensor Networks. ACM, 2007, pp. 236–243. [66] L. Wu, M. Á. Garcı́a Garcı́a, D. Puig Valls, and A. Solé Ribalta, “Voronoi-based space partitioning for coordinated multi-robot exploration,” vol. 1, pp. 37–44, 2007. [67] F. Bullo, J. Cortés, and S. Martinez, Distributed control of robotic networks: a mathematical approach to motion coordination algorithms. Princeton University Press, 2009. [68] A. D. Haumann, K. D. Listmann, and V. Willert, “Discoverage: A new paradigm for multi-robot exploration,” in Proceedings of the 2010 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2010, pp. 929–934. [69] A. Cowley, C. J. Taylor, and B. Southall, “Rapid multi-robot exploration with topometric maps,” in Proceedings of the 2011 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2011, pp. 1044–1049. [70] S. Bhattacharya, N. Michael, and V. Kumar, “Distributed coverage and exploration in unknown non-convex environments,” in Distributed Autonomous Robotic Systems. Springer, 2013, pp. 61–75. [71] B. Yang, Y. Ding, Y. Jin, and K. Hao, “Self-organized swarm robot for target search and trapping inspired by bacterial chemotaxis,” Robotics and Autonomous Systems, vol. 72, pp. 83–92, 2015. [72] K. Guruprasad and D. Ghose, “Automated multi-agent search using centroidal voronoi configuration,” IEEE Transactions on Automation Science and Engineering, vol. 8, no. 2, pp. 420–423, 2011. [73] ——, “Performance of a class of multi-robot deploy and search strategies based on centroidal voronoi configurations,” International Journal of Systems Science, vol. 44, no. 4, pp. 680–699, 2013. [74] ——, “Heterogeneous locational optimisation using a generalised voronoi partition,” International Journal of Control, vol. 86, no. 6, pp. 977–993, 2013. [75] R. Zlot, A. Stentz, M. Dias, and S. Thayer, “Multi-robot exploration controlled by a market economy,” in Proceedings of the 2002 IEEE International Conference on Robotics and Automation (ICRA), vol. 3. IEEE, 2002, pp. 3016–3023. [76] J. Fink, M. A. Hsieh, and V. Kumar, “Multi-robot manipulation via caging in environments with obstacles,” in Proceedings of the 2008 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2008, pp. 1471–1476. [77] K. Derr and M. Manic, “Multi-robot, multi-target particle swarm optimization search in noisy wireless environments,” in Proceedings of the 2nd Conference on Human System Interactions (HSI’09). IEEE, 2009, pp. 81–86. [78] Z. Li and Z. Duan, Cooperative Control of Multi-Agent Systems: A Consensus Region Approach. CRC Press, 2014. 99 [79] A. Okubo, “Dynamical aspects of animal grouping: swarms, schools, flocks, and herds,” Advances in Biophysics, vol. 22, pp. 1–94, 1986. [80] C. W. Reynolds, “Flocks, herds and schools: A distributed behavioral model,” vol. 21, no. 4, pp. 25–34, 1987. [81] A. Howard, M. J. Matarić, and G. S. Sukhatme, “Mobile sensor network deployment using potential fields: A distributed, scalable solution to the area coverage problem,” in Proceedings of the 6th International Symposium on Distributed Autonomous Robotics Systems. Springer, 2002, pp. 299–308. [82] F. Sivrikaya and B. Yener, “Time synchronization in sensor networks: a survey,” Network, IEEE, vol. 18, no. 4, pp. 45–50, 2004. [83] R. W. Beard, J. Lawton, F. Y. Hadaegh et al., “A coordination architecture for spacecraft formation control,” IEEE Transactions on Control Systems Technology, vol. 9, no. 6, pp. 777–790, 2001. [84] M. Aung, A. Ahmed, M. Wette, D. Scharf, J. Tien, G. Purcell, M. Regehr, and B. Landin, “An overview of formation flying technology development for the terrestrial planet finder mission,” in Proceedings of the 2004 IEEE Aerospace Conference, vol. 4. IEEE, 2004, pp. 2667–2679. [85] C. Candea, H. Hu, L. Iocchi, D. Nardi, and M. Piaggio, “Coordination in multi-agent robocup teams,” Robotics and Autonomous Systems, vol. 36, no. 2, pp. 67–86, 2001. [86] M. Mesbahi and M. Egerstedt, Graph theoretic methods in multiagent networks. Princeton University Press, 2010. [87] F. L. Lewis, H. Zhang, K. Hengster-Movric, and A. Das, Cooperative control of multiagent systems: optimal and adaptive design approaches. Springer Science & Business Media, 2013. [88] H. Bai, M. Arcak, and J. Wen, Cooperative control design: a systematic, passivity-based approach. Springer Science & Business Media, 2011. [89] 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. [90] G. Antonelli, “Interconnected dynamic systems: An overview on distributed control,” Control Systems, vol. 33, no. 1, pp. 76–88, 2013. [91] X. Jia and M. Q.-H. Meng, “A survey and analysis of task allocation algorithms in multirobot systems,” in Proceedings of the 2013 IEEE International Conference on Robotics and Biomimetics (ROBIO). IEEE, 2013, pp. 2280–2285. [92] J. P. Hespanha, P. Naghshtabrizi, and Y. Xu, “A survey of recent results in networked control systems,” IEEE Proceedings, vol. 95, no. 1, p. 138, 2007. [93] A. S. Matveev and A. V. Savkin, Estimation and control over communication networks. Springer Science & Business Media, 2009. 100 [94] ——, “Optimal state estimation in networked systems with asynchronous communication channels and switched sensors,” in Proceedings of the 40th IEEE Conference on Decision and Control, vol. 1. IEEE, 2001, pp. 825–830. [95] ——, “The problem of state estimation via asynchronous communication channels with irregular transmission times,” IEEE Transactions on Automatic Control, vol. 48, no. 4, pp. 670–676, 2003. [96] ——, “Comments on” control over noisy channels” and relevant negative results,” IEEE Transactions on Automatic Control, vol. 50, no. 12, pp. 2105–2110, 2005. [97] A. V. Savkin, “Analysis and synthesis of networked control systems: Topological entropy, observability, robustness and optimal control,” Automatica, vol. 42, no. 1, pp. 51–62, 2006. [98] M. O. F. Sarker, T. S. Dahl, E. Arcaute, and K. Christensen, “Local interactions over global broadcasts for improved task allocation in self-organized multi-robot systems,” Robotics and Autonomous Systems, vol. 62, no. 10, pp. 1453–1462, 2014. [99] R. Luna and K. E. Bekris, “Efficient and complete centralized multi-robot path planning,” in Proceedings of the 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2011, pp. 3268–3275. [100] T. M. Cheng and A. V. Savkin, “Decentralized control for mobile robotic sensor network self-deployment: barrier and sweep coverage problems,” Robotica, vol. 29, no. 2, pp. 283–294, 2011. [101] G. Pini, A. Brutschy, M. Frison, A. Roli, M. Dorigo, and M. Birattari, “Task partitioning in swarms of robots: An adaptive method for strategy selection,” Swarm Intelligence, vol. 5, no. 3-4, pp. 283–304, 2011. [102] K. Choi, S. J. Yoo, J. B. Park, and Y. H. Choi, “Adaptive formation control in absence of leader’s velocity information,” IET Control Theory & Applications, vol. 4, no. 4, pp. 521–528, 2010. [103] S. P. Hou and C. C. Cheah, “Dynamic compound shape control of robot swarm,” IET Control Theory & Applications, vol. 6, no. 3, pp. 454–460, 2012. [104] P. Chand and D. A. Carnegie, “A two-tiered global path planning strategy for limited memory mobile robots,” Robotics and Autonomous Systems, vol. 60, no. 2, pp. 309–321, 2012. [105] P. Chand and D. A. Carnegie, “Mapping and exploration in a hierarchical heterogeneous multi-robot system using limited capability robots,” Robotics and Autonomous Systems, vol. 61, no. 6, pp. 565–579, 2013. [106] A. V. Savkin and H. Teimoori, “Decentralized navigation of groups of wheeled mobile robots with limited communication,” IEEE Transactions on Robotics, vol. 26, no. 6, pp. 1099–1104, 2010. 101 [107] A. V. Savkin, T. M. Cheng, Z. Xi, F. Javed, A. S. Matveev, and H. Nguyen, Decentralized Coverage Control Problems For Mobile Robotic Sensor and Actuator Networks. Wiley & IEEE Press, 2015. [108] T. M. Cheng and A. V. Savkin, “A distributed self-deployment algorithm for the coverage of mobile wireless sensor networks,” IEEE Communications Letters, vol. 13, no. 11, pp. 877–879, 2009. [109] T. Cheng and A. Savkin, “Decentralized control of mobile sensor networks for asymptotically optimal blanket coverage between two boundaries,” IEEE Transactions on Industrial Informatics, vol. 9, no. 1, pp. 365–376, 2013. [110] T. M. Cheng, A. V. Savkin, and F. Javed, “Decentralized control of a group of mobile robots for deployment in sweep coverage,” Robotics and Autonomous Systems, vol. 59, no. 7, pp. 497–507, 2011. [111] V. Borkar and P. P. Varaiya, “Asymptotic agreement in distributed estimation,” IEEE Transactions on Automatic Control, vol. 27, no. 3, pp. 650–655, 1982. [112] J. N. Tsitsiklis, D. P. Bertsekas, and M. Athans, “Distributed asynchronous deterministic and stochastic gradient optimization algorithms,” in Proceedings of the 1984 American Control Conference (ACC), 1984, pp. 484–489. [113] T. Vicsek, A. Czirók, E. Ben-Jacob, I. Cohen, and O. Shochet, “Novel type of phase transition in a system of self-driven particles,” Physical review letters, vol. 75, no. 6, p. 1226, 1995. [114] A. V. Savkin, “Coordinated collective motion of groups of autonomous mobile robots: Analysis of vicsek’s model,” IEEE Transactions on Automatic Control, vol. 49, no. 6, pp. 981–983, 2004. [115] A. Jadbabaie, J. Lin, and A. S. Morse, “Coordination of groups of mobile autonomous agents using nearest neighbor rules,” IEEE Transactions on Automatic Control, vol. 48, no. 6, pp. 988–1001, 2003. [116] R. Olfati-Saber and R. M. 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. [117] W. Ren, R. W. Beard, and E. M. Atkins, “A survey of consensus problems in multi-agent coordination,” in Proceedings of the 2005 American Control Conference (ACC). IEEE, 2005, pp. 1859–1864. [118] R. Olfati-Saber, A. Fax, and R. M. Murray, “Consensus and cooperation in networked multi-agent systems,” Proceedings of the IEEE, vol. 95, no. 1, pp. 215–233, 2007. [119] A. Stanoev and D. Smilkov, “Consensus theory in networked systems,” in Consensus and Synchronization in Complex Networks. Springer, 2013, pp. 1–22. [120] A. V. Savkin, C. Wang, A. Baranzadeh, Z. Xi, and H. T. Nguyen, “Distributed formation building algorithms for groups of wheeled mobile robots,” Robotics and Autonomous Systems, vol. 75, pp. 463–474, 2016. 102 [121] V. Blondel, J. M. Hendrickx, A. Olshevsky, J. Tsitsiklis et al., “Convergence in multiagent coordination, consensus, and flocking,” in Proceedings of the 2005 IEEE Conference on Decision and Control, vol. 44, no. 3. IEEE; 1998, 2005, p. 2996. [122] A. V. Savkin and F. Javed, “A method for decentralized self-deployment of a mobile sensor network with given regular geometric patterns,” in Proceedings of the Seventh International Conference on Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP). IEEE, 2011, pp. 371–376. [123] V. Nazarzehi, A. V. Savkin, and A. Baranzadeh, “Distributed 3d dynamic search coverage for mobile wireless sensor networks,” IEEE Communications Letters, vol. 19, no. 4, pp. 633–636, 2015. [124] L. E. Parker, “Distributed algorithms for multi-robot observation of multiple moving targets,” Autonomous robots, vol. 12, no. 3, pp. 231–255, 2002. [125] A. Cunningham, K. M. Wurm, W. Burgard, and F. Dellaert, “Fully distributed scalable smoothing and mapping with robust multi-robot data association,” in Proceedings of the 2012 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2012, pp. 1093–1100. [126] G. Erinc and S. Carpin, “Anytime merging of appearance-based maps,” Autonomous Robots, vol. 36, no. 3, pp. 241–256, 2014. [127] T.-D. Vu, J. Burlet, and O. Aycard, “Grid-based localization and local mapping with moving object detection and tracking,” Information Fusion, vol. 12, no. 1, pp. 58–69, 2011. [128] D. Marinakis and G. Dudek, “Pure topological mapping in mobile robotics,” IEEE Transactions on Robotics, vol. 26, no. 6, pp. 1051–1064, 2010. [129] A. Baranzadeh and V. Nazarzehi, “Distributed formation building with obstacle avoidance for a team of wheeled mobile robots,” in Proceedings of the 2015 Australasian Conference on Robotics and Automation (ACRA). ARAA, 2015. [130] ——, “A decentralized formation building algorithm with obstacle avoidance for multirobot systems,” in Proceedings of the 2015 IEEE International Conference on Robotics and Biomimetics (ROBIO). IEEE, 2015, pp. 2513–2518. [131] R. Olfati-Saber and R. M. Murray, “Graph rigidity and distributed formation stabilization of multi-vehicle systems,” in Proceedings of the 41st IEEE Conference on Decision and Control, vol. 3. IEEE, 2002, pp. 2965–2971. [132] M. Farrokhsiar and H. Najjaran, “An unscented model predictive control approach to the formation control of nonholonomic mobile robots,” in Proceedings of the 2012 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2012, pp. 1576– 1582. [133] M. Turpin, N. Michael, and V. Kumar, “Trajectory design and control for aggressive formation flight with quadrotors,” Autonomous Robots, vol. 33, no. 1-2, pp. 143–156, 2012. 103 [134] Y. Hong, J. Hu, and L. Gao, “Tracking control for multi-agent consensus with an active leader and variable topology,” Automatica, vol. 42, no. 7, pp. 1177–1182, 2006. [135] H. Yu and Y. Wang, “Coordinated collective motion of groups of autonomous mobile robots with directed interconnected topology,” Journal of Intelligent and Robotic Systems, vol. 53, no. 1, pp. 87–98, 2008. [136] T. Liu and Z.-P. Jiang, “Distributed formation control of nonholonomic mobile robots without global position measurements,” Automatica, vol. 49, no. 2, pp. 592–600, 2013. [137] W. Dong, “Robust formation control of multiple wheeled mobile robots,” Journal of Intelligent & Robotic Systems, vol. 62, no. 3-4, pp. 547–565, 2011. [138] J.-W. Kwon and D. Chwa, “Hierarchical formation control based on a vector field method for wheeled mobile robots,” IEEE Transactions on Robotics, vol. 28, no. 6, pp. 1335–1345, 2012. [139] J. Guo, Z. Lin, M. Cao, and G. Yan, “Adaptive leader-follower formation control for autonomous mobile robots,” in Proceedings of the 2010 American Control Conference (ACC). IEEE, 2010, pp. 6822–6827. [140] E. M. Low, I. R. Manchester, and A. V. Savkin, “A biologically inspired method for visionbased docking of wheeled mobile robots,” Robotics and Autonomous Systems, vol. 55, no. 10, pp. 769–784, 2007. [141] L. Consolini, F. Morbidi, D. Prattichizzo, and M. Tosques, “On a class of hierarchical formations of unicycles and their internal dynamics,” IEEE Transactions on Automatic Control, vol. 57, no. 4, pp. 845–859, 2012. [142] M. Defoort, T. Floquet, A. Kokosy, and W. Perruquetti, “Sliding-mode formation control for cooperative autonomous mobile robots,” IEEE Transactions on Industrial Electronics, vol. 55, no. 11, pp. 3944–3953, 2008. [143] L. Krick, M. E. Broucke, and B. A. Francis, “Stabilisation of infinitesimally rigid formations of multi-robot networks,” International Journal of Control, vol. 82, no. 3, pp. 423–439, 2009. [144] Q. Wang and Y.-P. Tian, “Minimally rigid formations control for multiple nonholonomic mobile agents,” in Proceedings of the 31st Chinese Control Conference (CCC). IEEE, 2012, pp. 6171–6176. [145] H. Mehrjerdi, J. Ghommam, and M. Saad, “Nonlinear coordination control for a group of mobile robots using a virtual structure,” Mechatronics, vol. 21, no. 7, pp. 1147–1155, 2011. [146] M. Hoy, A. S. Matveev, and A. V. Savkin, “Algorithms for collision-free navigation of mobile robots in complex cluttered environments: a survey,” Robotica, vol. 33, no. 03, pp. 463–497, 2015. [147] H. Teimoori and A. V. Savkin, “A biologically inspired method for robot navigation in a cluttered environment,” Robotica, vol. 28, no. 5, pp. 637–648, 2010. 104 [148] A. S. Matveev, C. Wang, and A. V. Savkin, “Real-time navigation of mobile robots in problems of border patrolling and avoiding collisions with moving and deforming obstacles,” Robotics and Autonomous systems, vol. 60, no. 6, pp. 769–788, 2012. [149] A. V. Savkin and C. Wang, “Seeking a path through the crowd: Robot navigation in unknown dynamic environments with moving obstacles based on an integrated environment representation,” Robotics and Autonomous Systems, vol. 62, no. 10, pp. 1568–1580, 2014. [150] ——, “A simple biologically inspired algorithm for collision-free navigation of a unicyclelike robot in dynamic environments with moving obstacles,” Robotica, vol. 31, no. 6, pp. 993–1001, 2013. [151] M. Hoy, A. S. Matveev, and A. V. Savkin, “Collision free cooperative navigation of multiple wheeled robots in unknown cluttered environments,” Robotics and Autonomous Systems, vol. 60, no. 10, pp. 1253–1266, 2012. [152] A. V. Savkin and M. Hoy, “Reactive and the shortest path navigation of a wheeled mobile robot in cluttered environments,” Robotica, vol. 31, no. 2, pp. 323–330, 2013. [153] A. V. Savkin, C. Wang, A. Baranzadeh, Z. Xi, and H. T. Nguyen, “A method for decentralized formation building for unicycle-like mobile robots,” in Proceedings of the 9th Asian Control Conference (ASCC). Istanbul, Turkey: IEEE, 2013, pp. 1–5. [154] Y. Liang and H.-H. Lee, “Decentralized formation control and obstacle avoidance for multiple robots with nonholonomic constraints,” in Proceedings of the 2006 American Control Conference. IEEE, 2006, pp. 6–pp. [155] C. De La Cruz and R. Carelli, “Dynamic model based formation control and obstacle avoidance of multi-robot systems,” Robotica, vol. 26, no. 03, pp. 345–356, 2008. [156] H. Rezaee and F. Abdollahi, “A decentralized cooperative control scheme with obstacle avoidance for a team of mobile robots,” IEEE Transactions on Industrial Electronics, vol. 61, no. 1, pp. 347–354, 2014. [157] H. Choset, “Coverage for robotics–a survey of recent results,” Annals of Mathematics and Artificial Intelligence, vol. 31, no. 1-4, pp. 113–126, 2001. [158] S. Kumar, T. H. Lai, and A. Arora, “Barrier coverage with wireless sensors,” in Proceedings of the 11th Annual International Conference on Mobile Computing and Networking. ACM, 2005, pp. 284–298. [159] R. Cassinis, G. Bianco, A. Cavagnini, and P. Ransenigo, “Strategies for navigation of robot swarms to be used in landmines detection,” in Proceedings of the Third European Workshop on Advanced Mobile Robots (Eurobot’99). IEEE, 1999, pp. 211–218. [160] A. Jeremic and A. Nehorai, “Design of chemical sensor arrays for monitoring disposal sites on the ocean floor,” IEEE Journal of Oceanic Engineering, vol. 23, no. 4, pp. 334–343, 1998. [161] E. Borhaug, A. Pavlov, and K. Y. Pettersen, “Straight line path following for formations of underactuated underwater vehicles,” in Proceedings of the 46th IEEE Conference on Decision and Control. IEEE, 2007, pp. 2905–2912. 105 [162] A. V. Savkin, F. Javed, and A. S. Matveev, “Optimal distributed blanket coverage selfdeployment of mobile wireless sensor networks,” IEEE Communications Letters, vol. 16, no. 6, pp. 949–951, 2012. [163] R. Kershner, “The number of circles covering a set,” American Journal of Mathematics, vol. 61, no. 3, pp. 665–671, 1939. [164] A. V. Savkin and I. R. Petersen, “Model validation for robust control of uncertain systems with an integral quadratic constraint,” Automatica, vol. 32, no. 4, pp. 603–606, 1996. [165] S. R. Moheimani, A. V. Savkin, and I. R. Petersen, “Robust filtering, prediction, smoothing, and observability of uncertain systems,” IEEE Transactions on Circuits and Systems - I: Fundamental Theory and Applications, vol. 45, no. 4, pp. 446–457, 1998. [166] I. R. Petersen and A. V. Savkin, Robust Kalman filtering for signals and systems with large uncertainties. Birkhauser, Boston, 1999. [167] P. N. Pathirana, N. Bulusu, A. V. Savkin, and S. Jha, “Node localization using mobile robots in delay-tolerant sensor networks,” IEEE Transactions on Mobile Computing, vol. 4, no. 3, pp. 285–296, 2005. [168] O. Khatib, “Real-time obstacle avoidance for manipulators and mobile robots,” The international journal of robotics research, vol. 5, no. 1, pp. 90–98, 1986. [169] D. K. Sutantyo, S. Kernbach, P. Levi, V. Nepomnyashchikh et al., “Multi-robot searching algorithm using lévy flight and artificial potential field,” in Proceedings of the 2010 IEEE International Workshop on Safety Security and Rescue Robotics (SSRR). IEEE, 2010, pp. 1–6. [170] I. R. Manchester and A. V. Savkin, “Circular-navigation-guidance law for precision missile/target engagements,” Journal of Guidance, Control, and Dynamics, vol. 29, no. 2, pp. 314–320, 2006. [171] R. Fierro and F. L. Lewis, “Control of a nonholonomic mobile robot using neural networks,” IEEE Transactions on Neural Networks, vol. 9, no. 4, pp. 589–600, 1998. [172] J. P. Desai, J. P. Ostrowski, and V. Kumar, “Modeling and control of formations of nonholonomic mobile robots,” IEEE Transactions on Robotics and Automation, vol. 17, no. 6, pp. 905–908, 2001. [173] J.-M. Yang and J.-H. Kim, “Sliding mode control for trajectory tracking of nonholonomic wheeled mobile robots,” IEEE Transactions on Robotics and Automation, vol. 15, no. 3, pp. 578–587, 1999. [174] T. D. Barfoot and C. M. Clark, “Motion planning for formations of mobile robots,” Robotics and Autonomous Systems, vol. 46, no. 2, pp. 65–78, 2004. [175] S. G. Tzafestas, Introduction to mobile robot control. Elsevier, 2013. [176] V. Malyavej and A. V. Savkin, “The problem of optimal robust Kalman state estimation via limited capacity digital communication channels,” Systems & Control Letters, vol. 54, no. 3, pp. 283–292, 2005. 106 [177] H. Teimoori and A. V. Savkin, “Equiangular navigation and guidance of a wheeled mobile robot based on range-only measurements,” Robotics and Autonomous Systems, vol. 58, no. 2, pp. 203–215, 2010. [178] V. I. Utkin, Sliding Modes in Control and Optimization. Media, 2013. Springer Science & Business [179] A. V. Savkin, I. R. Petersen, E. Skafidas, and R. J. Evans, “Hybrid dynamical systems: robust control synthesis problems,” Systems & Control Letters, vol. 29, no. 2, pp. 81–90, 1996. [180] A. S. Matveev and A. V. Savkin, Qualitative theory of hybrid dynamical systems. Birkhauser, Boston, 2000. [181] A. V. Savkin and R. J. Evans, Hybrid dynamical systems: controller and sensor switching problems. Birkhauser, Boston, 2002. [182] A. V. Savkin and H. Teimoori, “Bearings-only guidance of a unicycle-like vehicle following a moving target with a smaller minimum turning radius,” IEEE Transactions on Automatic Control, vol. 55, no. 10, pp. 2390–2395, 2010. [183] B. P. Gerkey and M. J. Matarić, “A formal analysis and taxonomy of task allocation in multi-robot systems,” The International Journal of Robotics Research, vol. 23, no. 9, pp. 939–954, 2004. [184] K. Lerman, C. Jones, A. Galstyan, and M. J. Matarić, “Analysis of dynamic task allocation in multi-robot systems,” The International Journal of Robotics Research, vol. 25, no. 3, pp. 225–241, 2006. [185] M. Saleem, G. A. Di Caro, and M. Farooq, “Swarm intelligence based routing protocol for wireless sensor networks: Survey and future directions,” Information Sciences, vol. 181, no. 20, pp. 4597–4624, 2011. [186] M. Dorigo, D. Floreano, L. M. Gambardella, F. Mondada, S. Nolfi, T. Baaboura, M. Birattari, M. Bonani, M. Brambilla, A. Brutschy et al., “Swarmanoid: a novel concept for the study of heterogeneous robotic swarms,” IEEE Robotics & Automation Magazine, vol. 20, no. 4, pp. 60–71, 2013. [187] A. Censi, A. Franchi, L. Marchionni, and G. Oriolo, “Simultaneous calibration of odometry and sensor parameters for mobile robots,” IEEE Transactions on Robotics, vol. 29, no. 2, pp. 475–492, 2013. [188] K. Lee, W. Chung, and K. Yoo, “Kinematic parameter calibration of a car-like mobile robot to improve odometry accuracy,” Mechatronics, vol. 20, no. 5, pp. 582–595, 2010. [189] A. S. Matveev, M. C. Hoy, and A. V. Savkin, “A globally converging algorithm for reactive robot navigation among moving and deforming obstacles,” Automatica, vol. 54, pp. 292–304, 2015. [190] A. Matveev, A. V. Savkin, M. Hoy, and C. Wang, Safe Robot Navigation Among Moving and Steady Obstacles. Elsevier, 2015. 107 [191] G. Hollinger, S. Singh, J. Djugash, and A. Kehagias, “Efficient multi-robot search for a moving target,” The International Journal of Robotics Research, vol. 28, no. 2, pp. 201–219, 2009. [192] R. Olfati-Saber, “Flocking for multi-agent dynamic systems: Algorithms and theory,” IEEE Transactions on Automatic Control, vol. 51, no. 3, pp. 401–420, 2006. [193] A. S. Matveev, H. Teimoori, and A. V. Savkin, “Navigation of a unicycle-like mobile robot for environmental extremum seeking,” Automatica, vol. 47, no. 1, pp. 85–91, 2011. [194] N. Ghods and M. Krstic, “Multiagent deployment over a source,” IEEE Transactions on Control Systems Technology, vol. 20, no. 1, pp. 277–285, 2012. [195] J. Cochran, E. Kanso, S. D. Kelly, H. Xiong, and M. Krstic, “Source seeking for two nonholonomic models of fish locomotion,” IEEE Transactions on Robotics, vol. 25, no. 5, pp. 1166–1176, 2009. [196] S.-J. Liu and M. Krstic, “Stochastic source seeking for nonholonomic unicycle,” Automatica, vol. 46, no. 9, pp. 1443–1453, 2010. 108
3cs.SY
1 Diffusion Based Molecular Communication with Limited Molecule Production Rate arXiv:1802.08965v1 [cs.IT] 25 Feb 2018 Hamid G. Bafghi, Amin Gohari, Mahtab Mirmohseni, Masoumeh Nasiri-Kenari Department of Electrical Engineering, Sharif University of Technology, Tehran, Iran Abstract—This paper studies the impact of a transmitter’s molecule generation process on the capacity of a concentration based Molecular Communication (MC) system. Constraints caused by the molecule generation process affect the availability of the molecules at the transmitter. The transmitter has a storage of molecules, and should decide whether to release or save the currently produced molecules. As a result, the MC system has conceptual connections with energy harvesting systems. In this paper, we consider two scenarios on the propagation channel. The first scenario assumes a channel with no Inter-symbol Interference (ISI), i.e., a memoryless channel. We derive bounds on the capacity of the MC system in this scenario. The second scenario assumes the MC network with ISI, in which the output of the channel depends on the history of released molecules in the pervious time-slots. Based on the assumptions that either the transmitter or the receiver knows the channel statistics, we compute a lower bound on the channel capacity.1 Index Terms—Molecular communication (MC) network, Channel Capacity, inter-symbol interference (ISI). I. I NTRODUCTION Unlike the classical wireless communication, diffusion based Molecular Communication (MC) utilizes molecules as the carriers of information between the communicating parties. Type, concentration, or the release time of molecules can be used for signaling by a molecular transmitter. As a result, a mechanism must be set in place for production of molecules at the transmitters [1]. For instance, this may be realized by chemical reactions inside the transmitter nodes. The impact of this molecule production process on the capacity of a molecular channel is the subject of this paper. We assume that the transmitter includes a production unit as well as a storage unit. The production unit adds some amount of new molecules in each time-slot to the storage unit. The production rate of molecules may depend on the amount of molecules already exist in the storage unit, e.g., the chemical process responsible for molecule production might have a faster production rate if the storage unit is empty. The transmitter communicates its message by controlled opening of an outlet of the storage unit for a short period of time and thereby releasing a concentration of molecules into the environment at the beginning of each time-slot. This model is comparable with an Energy Harvesting (EH) system in the classical communications, in which the transmitter harvests energy and wishes to send its message such that its transmitted signal is amplitude-constrained to the amount of harvested and 1 Authors are listed in the alphabetical order, not according to their contributions. stored energy at the transmitter [2]–[7]. The transmitter (in the EH system) may have finite [6] or infinite [8] energy storage (battery) or it can be assumed with no battery [9]. There are several approaches and models of transmitters and receivers for diffusion based MC in the literature. We follow the common approach of choosing one of the models and adapting our analysis to it. In particular, we adopt the macro-scale mode of MC and the molecular Poisson model for our study (see [1], [10] and references therein for a review of different models and the related results). More specifically, we assume that the amount of released molecules is a deterministic concentration (in molar) and the Fick’s law of diffusion describes the medium. The reception noise is modeled by a Poisson random variable, i.e., the received signal has a Poisson distribution whose mean is proportional to the average concentration of molecules at the receiver. In this paper, we consider two cases of the Poisson channel, with or without Inter-Symbol Interference (ISI). The ISI occurs when a non-negligible portion of transmitted molecules from the previous time-slots remain in the medium and affect the communication in the current time-slot. We begin by providing a number of capacity results when the channel is without ISI. One should note that though the channel is memoryless in this case, the problem is still complicated due to the fact that the transmitter has memory; the number of released molecules in each transmission is limited by the level of the storage, which itself depends on the previous transmissions. A similar phenomenon occurs in the classical energy harvesting systems. Next, we consider a channel with ISI, i.e., a channel with memory, and provide a result on its capacity depending on whether the channel statistics are known at the transmitter or at the receiver. A. Related works In practice, a MC transmitter suffers from constraints on its molecule production and storage processes [11]–[13]. The molecule production may be constrained by limitations on the chemical reactions or the availability of food and energy for molecule generation at the transmitter [13]. Moreover, in practical scenarios, the bio-nanomachines store the molecules that they produce internally or capture externally from the environment [13]. Thus, the limitation on molecule storage forces some constraints on the molecule transmitting process [14]. Most of the existing works in the literature of diffusion based MC networks assume availability of a constant number 2 of molecules at the transmission times [15]. For instance in the on/off keying, the transmitter releases a fixed amount of molecules to send bit ‘1’ and stays silent to send bit ‘0’ [15]– [19]. However, there are a few works that consider the limitations on molecule production at the transmitter [11]–[13]: the random chemical reactions in the molecule production process is considered in [11]. This work studies the chemical description of the transmitters in terms of Langevin equation. In [12] the total molecule concentration at the transmitter is assumed to be a function of the number of random chemical reactions between different molecule types. More precisely, the inherent randomness in the availability of food and energy is assumed to affect the molecule generation process which limits the availability of molecules at the transmitter in the beginning of each time-slot [13]. Due to lack of sufficient molecules, the lengths of the symbol intervals may vary in practical MC systems and the constrained transmitter may not be able to emit molecules with a fixed release frequency [20]; the authors in [20] suggest using two types of molecules for communicating and symbol synchronization over the channel. In [21], it is assumed that the amount of available molecules in the present time-slot, which is referred to as the “state” of the transmitter, depends on the state and the inputs in the previous time-slots. In another line of works, the transmitter is assumed to actively capture the needed molecules from the environment. This process is referred to as “molecule harvesting” [14]. Here the transmitter has the ability to harvest the arrived molecules, in addition to the background molecules that randomly hit the transmitter and the ones captured through chemical synthesis from other materials. In this model, the harvesting process is constrained by the size of the molecule storage at the transmitter. The state of the transmitter (i.e., the number of the molecules at the transmitter’s storage) is updated according to a weighted combination of the released, the received and the harvested molecules in the past time-slot [14]. In this paper, we study the transmitter molecule production constraint. Our work is novel since previous works do not consider capacity degradation due to the molecule production constraint at the transmitter. For our study, we adopt a molecular Poisson channel model, an important molecular channel adopted in many works in the literature [19], [22]–[27], The rest of the paper is organized as follows. In Section II, the MC channel and some preliminary definitions are presented. The main results of the paper on the MC networks with no ISI are presented in III, including the capacity in the case of infinite molecule storage, and inner and outer bounds on the capacity in the case of finite molecule storage. The main results of the paper on the MC networks with ISI are presented in IV. The paper is concluded in Section V. II. S YSTEM M ODEL A. Notation and Definitions We use the notation xn to denote the sequence (x0 , x1 , . . . , xn ). Random variables (r.v.s) are denoted by uppercase letters, while their realizations are denoted by the lowercase letters. We say that random variables X, Y, Z form a Markov chain if pZ|XY (z|x, y) = pZ|Y (z|y) for all x, y, z. We show this Markov chain relation by X → Y → Z. A sequence of random variables {Xk } for k = 1, 2, · · · is said to be Asymptotically Mean Stationary (AMS) if n 1X P[Xk ∈ A] = P (A) n→∞ n lim (1) k=1 exists for all measurable A. Under this condition, P is also a probability measure and is named the stationary mean of the AMS sequence [33]. B. Channel Model In our setting, we have a point-to-point communication channel in which the information is conveyed by the molecule concentration released into the environment by the transmitter. A deterministic channel between the transmitter and the receiver, based on the Fick’s law of diffusion, is assumed. A reception noise is assumed at the receiver; the concentration of molecules is detected by a Poisson reception process at the receiver [28]. A common example of the Poisson reception process is the particle counting noise of a transparent receiver [29], [30]. A transparent receiver consists of a transparent sphere of a certain volume. It counts the number of molecules that fall into its sphere. A transparent receiver is passive in the sense that it does not affect the diffusion medium by imposing a boundary condition to the differential equation describing the diffusion process. The precise mathematical description of a Poisson reception process is as follows: if the concentration of molecules around the receiver is ρ moles, the receiver’s measurement is distributed according to Poisson(κρ) for some constant κ. Since the variance of a Poisson distribution is proportional to its mean, the larger the ρ, the noisier the receiver’s reception will be. We assume a time-slotted transmission. The transmitter instantaneously releases Xi moles of molecules into the environment at the beginning of each time-slot for i = 0, 1, 2, . . . . In other words, if the transmitter is located at ~r = 0 and has a clock with frequency 1/Ts , the transmitter’s channel input is the impulse train X Xk δ(~r = 0)δ(t − kTs ). k The Fick’s law of diffusion describes propagation of molecules in the environment. Here, we assume that the communication is invariant over time, and the boundary conditions are set to zero, i.e., there is no molecule production source besides the transmitter. As a result, the diffusion medium (described by the Fick’s law of diffusion) becomes a linear time-invariant (LTI) system and can be characterized by its impulse response. Thus, the concentration of molecules at the receiver at the end of Pithe i-th time-slot can be expressed as the convolution j=0 ζj Xi−j , where ζj represents the channel impulse response coefficient. The receiver’s measurement follows a Pi Poisson distribution as Yi ∼ Poisson(κ j=0 ζj Xi−j ). Letting P pj = κζj , we can write Yi ∼ Poisson( ij=0 pj Xi−j ) for i = 0, 1, 2, . . . . We refer to {pi } as the channel coefficients. We assume that the reception noise at the receiver in different 3 time slots are mutually independent, i.e., Yi ’s are conditionally independent given the transmission amounts {Xi }. If the reception noise is the particle counting noise, to satisfy independence of the reception noises one should adopt the common assumption in the literature that the sampling period Ts is not very small [31, Section IV], [10, Remark 1]. We say that the channel is without ISI if pi is negligible for i > 0. In this case, Yi ∼ Poisson(p0 Xi ), and p(y n |xn ) = n Y i=1 p(yi |xi ). (2) The channel is said to be with ISI if the output of the channel in i-th time-slot depends on the past inputs of the channel in the previous time-slots with weights pj , j ∈ {0, . . . , i} (see Fig. 1). C. Transmitter Model The transmitter opens the outlet of its molecule storage unit for a short period of time at the beginning of each time-slot. The channel input xi , at time-slot i, represents the deterministic released molecule concentration (in molar) into the environment. We assume that the transmitter has si moles of molecules in the beginning of i-th time-slot (in its storage unit). Moreover, the amount of molecules in the storage unit after recharging for the duration of the i-th time-slot is denoted by f (si ), where f (·) is a known function. We expect that f (si ) ≥ si , i.e., molecule production is non-negative in the ith time slot. Also, we expect f (·) to be a non-decreasing function, i.e., f (s) ≥ f (s′ ) for s ≥ s′ . The intuition here is that if the transmitter starts off with s mole of molecules, it will have more molecules after recharging than if it starts off with s′ < s moles of molecules. In some practical scenarios, the production rate of new molecules (f (s)−s) decreases in s, the amount of molecules already existing in the storage unit. We do not need to make such a restrictive assumption on the function s 7→ f (s) − s for our results to hold. If Si is the amount of molecules in the transmitter at i-th time-slot, we assume that Xi ≤ Si moles of molecules are released into the environment. Thus, we will have Si+1 = f (Si − Xi ). (3) In other words, Si reduces to Si − Xi because of molecule release and then recharges to f (Si − Xi ). We assume that the transmitter starts off empty, i.e., S0 = 0. If we have no transmission (Xi = 0) and just recharging, we will have Si = f (Si−1 ) for i = 1, 2, . . . ; and thus, Si = f i (0) where f i (s) , (f ◦ f ◦ f · · · ◦ f )(s). {z } | i times Since we assumed that f (s) ≥ s for all s, the equation Si = f (Si−1 ) implies that Si ≥ Si−1 . Therefore, f i (0) is a nondecreasing sequence of non-negative reals. Let ϕ = lim f i (0), i→∞ (4) be the amount of molecules after recharging for infinite time (when there is no transmission); we set ϕ = ∞ if the sequence Fig. 1. Modeling the molecular communication networks with constrained transmitter and ISI effect as a point-to-point molecule-harvesting Poisson channel with memory. f i (0) tends to infinity (as discussed later). From (4), it follows that given any s∗ ∈ [0, ϕ), it is possible to save molecules for a finite number of time instances n0 and reach the molecular level s∗ or larger in the transmitter’s reservoir (when there is no transmission). That is Sn0 ≥ s∗ . We say that the transmitter has finite molecule capacity and saturates if ϕ < ∞, and has unbounded molecule capacity if ϕ = ∞. If ϕ < ∞, from (4) we have f (ϕ) = limi→∞ f i+1 (0) = ϕ, i.e., ϕ is a fixed point of f . If ϕ = ∞, from monotonicity of f and (4) we have lim f (x) = ∞, x→∞ which we can interpret as f (ϕ) = ϕ for ϕ = ∞ by symbolically extending the domain of f to include ∞. With the assumption that the transmitter starts off empty, we only need to define the function f over the interval [0, ϕ]. The reason is that for any transmission sequence {Xi } satisfying Xi ≤ Si , we will have Si ≤ ϕ. This follows from induction Si+1 = f (Si − Xi ) ≤ f (Si ) ≤ f (ϕ) = ϕ, (5) where we use the monotonicity property of f (.). Hence, we assume that the function f (.) is well-defined over [0, ϕ]. D. Channel Capacity The transmitter wishes to send the message M which is uniformly distributed over the set M = {0, 1}k to the receiver in n channel uses. The communication rate is R = k/n bits per channel use. The rate R is achievable if for any 0 < ǫ ≤ 1 there exists a code (respecting the transmitter’s input constraints) with rate R − ǫ whose average error probability is less than ǫ. The channel capacity C is the maximum achievable communication rate. Capacity calculation is complicated due to the memory introduced into the problem by the constraints on the transmitter. The transmitter should adapt its molecule release to the amount of produced molecules in the current time-slot and the consumed molecules in the previous time-slots. Thus, the transmitter has memory. III. MC N ETWORK W ITHOUT ISI In this section, we present our main results on the capacity of the MC network without ISI, i.e., Yi ∼ Poisson(p0 Xi ) for all i. 4 For a given memoryless channel p(y|x) (here a Poisson channel) on input alphabet X = [0, ∞) and a real c ≥ 0, let us define: Rc = sup I(X; Y ), (6) I(X; Y ). (7) pX : E[X]≤c R̃c = sup pX : 0≤X≤c The difference between Rc and R̃c is that in Rc we take supremum over all distributions on [0, ∞) with an expected value be at most c, while in R̃c we take supremum over all distribution whose support is [0, c]. Theorem 1: Let ∆u = sup f (s) − s. (8) s∈[0,ϕ] Then the channel capacity C satisfies: R̃∆u ≤ C ≤ R∆u . (9) 1 n i=1 Xi ≤ ∆u . (10) Observe that (6) is the channel capacity under the average input cost constraint ∆u given in (10) [32]. As a result, the upper bound then follows from the known result on the capacity of memoryless channels with an average input cost constraint [32]. Because we assume no ISI in this section, our channel is a memoryless Poisson channel and the result of [32] can be utilized. It remains to prove the lower bound on the capacity: C ≥ R̃∆u . Take an arbitrary s ∈ [0, ϕ) and let c = f (s) − s. (11) We prove that R̃c = suppX : X≤c I(X; Y ) is an achievable rate. This will complete the proof because s has been taken arbitrary in [0, ϕ), and furthermore ∆u = sup f (s) − s = sup f (s) − s, s∈[0,ϕ] Si+1 = f (Si − Xi ) ≥ f (Si − c) ≥ f (s∗ − c) = s∗ . (12) The above argument shows that it is possible to transmit any sequence Xi satisfying Xi ≤ c for all i > n0 , as the molecular reservoir is always at least s∗ and hence never hits zero. By letting the blocklength n tend to infinity, the initial finite time instances n0 becomes negligible compared to transmission length n and results in no rate loss. We obtain the achievability of R̃c = suppX : X≤c I(X; Y ) via Shannon’s point to point achievability scheme, i.e., by constructing i.i.d. codewords from a pX defined on [0, c]. Theorem 2: Assume that ϕ = ∞. Let ∆ℓ = lim inf (f (s) − s) . s→∞ Proof: To see the upper bound, note that the number of molecules produced in each recharging period cannot exceed ∆u . Therefore, the average number of consumed molecules cannot be larger than ∆u : n X We would like to start transmitting in time instances i > n0 . We claim that if we limit the transmission level to c, then transmitter’s molecular reservoir will not drop below s∗ . In other words, if Xi ≤ c for i > n0 we have Si ≥ s∗ for all i > n0 . This follows from induction. Assuming that Si ≥ s∗ and using the fact that Xi ≤ c, we have s∈[0,ϕ) as f (ϕ) − ϕ = 0. To show that R̃c is achievable, it suffices to show that for any arbitrary distribution pX on [0, c], the mutual information I(X; Y ) is an achievable rate. Let s∗ = f (s) = s+c. Then from (11) we have f (s∗ −c) = ∗ s . We claim that s∗ ∈ [0, ϕ]. This is because s∗ = f (s) ≤ f (ϕ) = ϕ where we used the monotonicity property of f . Since s ∈ [0, ϕ), we can use the save strategy at the beginning and wait for a finite number of time instances to reach the molecule level s or larger in the transmitter’s reservoir. If we wait for one more time step, we reach the molecule level s∗ = f (s). Hence, there is some finite number n0 such that Sn0 ≥ s∗ assuming that we do not transmit any molecules in the first n0 time steps. (13) Then the channel capacity can be bounded from below as follows: C ≥ R∆ℓ . (14) Proof: We prove that Rc is an achievable rate for any c < ∆ℓ . By the definition of ∆ℓ , there exists some s∗ > 0 such that for any s ≥ s∗ we have f (s) ≥ s + c. (15) To prove that Rc = suppX : E[X]≤c I(X; Y ) is achievable, we need to prove achievability of I(X; Y ) for an arbitrary distribution pX satisfying E[X] ≤ c. The idea is to mimic the proof of [5] here and prove this by considering distributions on a finite support. Take some positive real number K, and an arbitrary distribution pX of finite support on [0, K]. Here K may be larger than c, but the distribution of X is required to satisfy E[X] ≤ c. It is shown in [5] that achievability of I(X; Y ) for such finite support distributions is enough to show the achievability of Rc . As in [5], we wait at the beginning for a finite amount of time and save molecules so that the amount of saved molecules exceeds a number w (to be specified later). Because ϕ = ∞, we can take w as large as we want. As long as Si ≥ K + s∗ , we have Si − Xi ≥ s∗ and hence from (15) we have Si+1 = f (Si − Xi ) ≥ Si − Xi + c. (16) In other words, a production of c moles of molecules is guaranteed as long as the molecular reservoir level stays above K + s∗ . In [5], the update rule Si+1 = Si −Xi +c is considered. Here in the inequality (16), the sequence Si has a larger growth and dominates the process of [5]. This indicates that the same proof can be mimicked here since (16) shows that in each step, more molecules are produced than the update rule Si+1 = Si −Xi +c of [5]. The number w should be chosen to ensure that with high probability, starting from w molecules, Si remains above 5 K + s∗ so that (16) remains valid. But this is possible with the same argument as in [5]. Remark 1: Theorems 1 and 2 give a tight characterization of capacity C for the case of infinite battery capacity ϕ = ∞ if ∆ℓ = ∆u . For example, this occurs if f (s) = s + v for some constant v, i.e., when we have a constant production rate. Theorem 2 is comparable with an EH system with an infinite battery [5]. In [5], it is shown that the capacity of Gaussian EH channel with an infinite battery, with the average arrived energy P , is equal to the capacity of the Gaussian point-topoint channel with average power constraint P . In the following, we find a lower bound on the capacity when ϕ < ∞. Theorem 3: Assume that ϕ < ∞. Let qX|S (x|s) be a conditional distribution on is a lower bound on the capacity of the channel. Next, note that I(X n ; Y n ) = H(Y n ) − H(Y n |X n ) n X H(Yi |Xi ) = H(Y n ) − i=1 = ≥ = = {(x, s) : f (0) ≤ s ≤ ϕ, 0 ≤ x ≤ s} such that the Markov chain S0 = 0, Si+1 = f (Si − Xi ) with pXi |Si = qX|S asymptotically converges to a stationary distribution qS , i.e., pSi tends to qS in total variation distance as i tends to infinity. Then the capacity is lower bounded as C ≥ I(X; Y |S), (17) where qX,S,Y = qX,S pY |X where pY |X is the Poisson channel Y ∼ Poisson(p0 X). Proof: Assume that we start with S0 = 0 and choose Xi from Si according to qX|S . Consider the update rule Si+1 = f (Si − Xi ). This yields a sequence {(Si , Xi , )} for i = 0, 1, 2, · · · . Let Yi ∼ Poisson(p0 Xi ) be a memoryless channel. Then we have p(y n , xn , sn ) = n Y i=1 p(si |xi−1 , si−1 )q(xi |si )p(yi |xi ). (18) We claim that {(Si , Xi , Yi )} is an Asymptotically Mean Stationary (AMS) sequence. As argued in [33], the AMS condition allows us to conclude that lim n→∞ 1 I(X n ; Y n ) n is a lower bound on the capacity of the channel. Next, we show that {(Si , Xi , Yi )} is an Asymptotically Mean Stationary (AMS) sequence. Observe that {Si } is a Markov chain (on a countable state space) starting from S0 = 0. Furthermore, from the definition of the qS,X in the statement of the theorem, qS is a limiting stationary distribution for this Markov chain and p(Si ) converges to qS in total variation distance. Because pXi ,Yi |Si (xi , yi |si ) = qX|S (xi |si )pY |X (yi |xi ), the distribution of pSi ,Xi ,Yi also converges to qS,X,Y and {(Si , Xi , Yi )} will be proven to be an Asymptotically Mean Stationary (AMS) sequence. To sum this up, we have that 1 I(X n ; Y n ) n→∞ n lim = n X i=1 n X i=1 n X i=1 n X i=1 n X i=1 H(Yi |Y1:i−1 ) − H(Yi |Xi ) H(Yi |Y1:i−1 , Si ) − H(Yi |Xi ) H(Yi |Si ) − H(Yi |Xi ) H(Yi |Si ) − H(Yi |Xi , Si ) I(Xi ; Yi |Si ) where we used the fact that Yi → Xi → Si and Yi → Si → Y1:i−1 form Markov chains, which are implied from (18). Because pSi ,Xi ,Yi tends to qS,X,Y as i tends to infinity, we have n 1 1X lim I(X n ; Y n ) ≥ lim I(Xi ; Yi |Si ) = Iq (X; Y |S). n→∞ n n→∞ n i=1 IV. MC N ETWORK W ITH ISI In this section, we present our main results on the capacity of the MC network with ISI. As we mentioned in Section II-B, P in this channel Xi and Yi ∼ Poisson( ij=0 pj Xi−j ) represent the channel input and the channel output, respectively (see Fig. 1). Let C(p) denote the capacity of a channel with coefficient sequence p. Calculation of C(p) is complicated by the fact that the channel has memory. Assume that the channel coefficient sequence p belong to a class P. Here, we consider two scenarios: the first scenario assumes that the transmitter is aware of the actual p ∈ P, but the receiver only knows the class P and is unaware of the sequence p ∈ P. A rate is achievable if there is a sequence of coding strategies for the transmitter and receiver whose error probability vanishes regardless of the choice of p ∈ P. The second scenario is the other way around; it assumes that the receiver is aware of the actual p ∈ P, and the transmitter only knows the class P. Thus, the two scenarios differ in terms of whether the “channel state information” is available at the transmitter or receiver. To state our results, we begin by a definition: Definition 1: Given two sequences p = (pj ) and p̃ = (p̃j ) of channel coefficients, we say p̃  p if p̃j = j X qj−k pk , (19) k=0 for some non-negative sequence P ∞ j=0 qi ≤ 1. q0 , q1 , · · · satisfying 6 Intuitively speaking, p̃  p can be understood as a channel with a coefficient sequence p̃ having a more spread out channel coefficient profile than the channel with a coefficient sequence p. Example 1: As an example, given any p̃ we have p̃  p where p = (pj ) is defined as follows: piP = 0 for i ≥ 1 and p0 is any number greater than or equal to i p̃i . Our main results are as follows: Theorem 4: Assume that the molecule production function f (·) is a concave function (in addition to the constraints of Section II-C). Take some channel coefficient sequence p̃ = (p̃j ) such that p̃  p for all p ∈ P. Then, C(p̃) is an achievable rate for any channel coefficient profile p ∈ P when p is known only at the transmitter. Theorem 5: Take some channel coefficient sequence p̃ = (p̃j ) such that p̃  p for all p ∈ P. Then, for any molecule production function f (·), C(p̃) is an achievable rate for any channel coefficient profile p ∈ P when p is known only at the receiver. Remark 2: Theorem 4 imposes more restrictions on the function f (·) compared to √ Theorem 5. Functions f (x) = min(x+ c, ϕ) and f (x) = x + c for c > 0 are two examples of increasing and concave functions. Remark 3: From Example 1, we know that given any channel coefficient sequence p̃ = (p̃j ), the sequence p = P ( j p̃j , 0, 0, · · · , 0) satisfies p̃  p. Since p corresponds to a memoryless channel, the above theorems confirms that ISI cannot be utilized to increase the channel capacity. Proof of Theorem 4: In this case, the receiver is unaware of the p ∈ P. The receiver proceeds with the assumption that the true channel coefficient is p̃. The idea is to show that any code for a channel with coefficient p̃ can be “simulated” by a code for channel p at the transmitter. More specifically, choose an arbitrary n-code of rate R designed for a channel with coefficients p̃ consisting of a set of codewords x̃n (m) for m ∈ {1, 2, . . . , 2nR }. The codeword x̃n (m) satisfies the transmitter molecule production constraint (i.e., transmission in each stage is less than the amount of molecules available in the transmitter reservoir). The receiver assumes that the actual channel coefficient is p̃ and uses the decoding algorithm for this channel code. The transmitter gets the true channel coefficient p and uses the following strategy: 1) From p̃  p, it computes a non-negative sequence (q0 , q1 , . . .) such that p̃j = j X qj−k pk . k=0 2) To transmit message m ∈ {1, 2, . . . , 2nR }, it transmits xj (m) = j X qj−k x̃k (m), j = 0, 1, . . . , n, (20) k=0 on the channel, where x̃n (m) is the codeword of the codebook for p̃ corresponding to message m. With this Pi strategy, the receiver Poisson( j=0 pi−j xj (m)). Observe that i X pi−j xj (m) = j=0 pi−j i X i X  qj−k pi−j x̃k (m) i X x̃k (m)p̃i−k . k=0 = Yi i X j=0 = j X gets qj−k x̃k (m) ∼ (21) k=0 j=k k=0 Pi Therefore, Yi ∼ Poisson( j=0 p̃i−j x̃j (m)), as if the codeword x̃n (m) was transmitted over a channel with the coefficient sequence p̃. Hence, (20) allows for the simulation of channel p̃ from channel p. The crucial and more difficult step is to show that the sequence of transmission xn (m) defined in (20) satisfies the transmitter cost constraint. To prove this, we use the assumption that each codeword x̃n (m) satisfies the transmitter cost constraint. That is, x̃i (m) ≤ s̃i (m) where s̃0 (m) = 0 and s̃i (m) = f (s̃i−1 (m) − x̃i−1 (m)) is the number of molecules in transmitter’s reservoir at time i if message m is transmitted. Our claim follows from Lemma 1 in the Appendix. Proof of Theorem 5: In this case, the transmitter is unaware of the p ∈ P. The transmitter proceeds with the assumption that the true channel coefficient sequence is p̃. The idea is to convert the channel p to the channel p̃ by an operation at the receiver. Choosing an arbitrary n-code of rate R designed for a channel with a coefficient sequence p̃ consisting of a set of codewords x̃n (m) for m ∈ {1, 2, . . . , 2nR }, the transmitter sends the codeword x̃n (m), assuming that the actual channel coefficient sequence is p̃. The receiver gets the true channel coefficient sequence p and uses the following strategy: from p̃  p, the receiver computes a non-negative sequence (q0 , q1 , . . .) such that p̃j = j X qk pj−k . k=0 Next, having received the sequence (Y0 , Y1 , Y2 , · · · , Yn ), the receiver produces the sequence (Ỹ0 , Ỹ1 , Ỹ2 , · · · , Ỹn ) as follows: for each 0 ≤ k ≤ n, we produce random variables Ŷ0k , Ŷ1k , Ŷ2k , · · · , Ŷkk , Zk from a multinomial distribution withPYk balls and probability sequence (qk , qk−1 , · · · , q0 , 1 − ki=0 qi ). We assume that the variables Ŷ0k , Ŷ1k , Ŷ2k , · · · , Ŷkk , Zk for different values of k are produced independently. Then, we let Ỹj = j X Ŷij . i=0 Pi Note that Yi ∼ Poisson( k=0 pi−k x̃k (m)), 0 ≤ i ≤ n are independent given x̃n (m). By the thinning property of Poisson distribution, and the fact that sum of independent Poisson random variables is again a Poisson random variable, 7 Pi we obtain that Ŷij ∼ Poisson(qj−i k=0 pi−k x̃k (m)) and furthermore, Ŷij for different values of i, j are mutually independent. We have Ỹj = j X i=0 j i X X qj−i pi−k x̃k (m)) Ŷij ∼ Poisson( i=0 k=0 j j X X qj−i pi−k ) x̃k (m) = Poisson( k=0 i=k j X = Poisson( x̃k (m)p̃j−k ). k=0 Furthermore, Ỹj for different values of j are mutually independent because they involve summation over disjoint sets of Ŷij . As a result, Ỹi is exactly what we obtain if x̃n (m) were passed through the channel p̃. This completes the proof of the receiver being able to apply a post-processing to convert the channel p to p̃. V. C ONCLUSIONS In this paper, a molecular communication (MC) system is considered in which the information is encoded in the concentration of the molecules, and the molecule generation process causes some constraints on the transmitter. Moreover, it is assumed that the number of received molecules at the receiver follows a Poisson distribution of the channel input. Two scenarios on the MC channel with no Inter-symbol Interference (ISI) and the MC channel with ISI were studied. For the case of no-ISI scenario, lower and upper bounds on the channel capacity were derived. For the case of channels with ISI, we provided a capacity result for the cases where the channel coefficient sequence is known either at the transmitter or at the receiver. R EFERENCES [1] N. Farsad, H. B. Yilmaz, A. Eckford, C. B. Chae, and W. Guo, “A comprehensive survey of recent advancements in molecular communication,” IEEE Commun. Surv. Tutorials, vol. 18, no. 3, pp. 1887–1919, thirdquarter 2016. [2] M. L. Ku, W. Li, Y. Chen, and K. J. R. Liu, “Advances in energy harvesting communications: Past, present, and future challenges,” IEEE Comm. Surveys Tutorials, vol. 18, no. 2, pp. 1384–1412, Secondquarter 2016. [3] O. Ozel, J. Yang, and S. Ulukus, “Broadcasting with a battery limited energy harvesting rechargeable transmitter,” in Int. Symp. on Modeling and Optimization in Mobile, Ad Hoc and Wireless Networks (WiOpt), 2011, pp. 205–212. [4] R. Rajesh, V. Sharma, and P. Viswanath, “Information capacity of energy harvesting sensor nodes,” in Int. Symp. on Inf. Theory (ISIT), July 2011, pp. 2363–2367. [5] O. Ozel and S. Ulukus, “Achieving AWGN capacity under stochastic energy harvesting,” IEEE Trans. on Inf. Theory, vol. 58, no. 10, pp. 6471–6483, Oct. 2012. [6] K. Tutuncuoglu and A. Yener, “Optimum transmission policies for battery limited energy harvesting systems,” IEEE Trans. Wireless Comm., vol. 11, no. 3, pp. 1180–1189, Mar. 2012. [7] 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 Jour. Selec. Area Comm., vol. 33, no. 3, pp. 360–381, Mar. 2015. [8] O. Ozel and S. Ulukus, “Information-theoretic analysis of an energy harvesting communication system,” in Int. Symp. on Personal, Indoor and Mob. Radio Comm. Workshops (PIMRC Workshops), Sept. 2010, pp. 330–335. [9] H. G. Bafghi, B. Seyfe, M. Mirmohseni, and M. R. Aref, “Capacity of channel with energy harvesting transmitter,” IET Comm., vol. 9, no. 4, pp. 526–531, 2015. [10] A. Gohari, M. Mirmohseni, and M. Nasiri-Kenari, “Information theory of molecular communication: Directions and challenges,” IEEE Trans. on Molecular, Biological and Multi-Scale Commun., vol. 2, no. 2, pp. 120–142, Dec 2016. [11] D. T. Gillespie, “The chemical langevin equation,” The Journal of Chemical Physics, vol. 113, 2000. [12] M. Pierobon and I. F. Akyildiz, “A statistical–physical model of interference in diffusion-based molecular nanonetworks,” IEEE Trans. on Commun., vol. 62, 6 2014. [13] B. Alberts, D. Bray, K. Hopkin, A. Johnson, J. Lewis, M. Raff, K. Roberts, and P. Walter, Essential Cell Biology, 4th ed. Garland Science, 2014. [14] J.-T. Huang and C.-H. Lee, “On capacity bounds of two-way diffusion channel with molecule harvesting,” in IEEE Int. Conf. on Commun. (ICC), Paris, France, 2017, 2017. [15] M. Pierobon and I. F. Akyildiz, Fundamentals of Diffusion–Based Molecular Communication in Nanonetworks. Now Publisher, 2014. [16] R. Mosayebi, H. Arjmandi, A. Gohari, M. Nasiri-Kenari, and U. Mitra, “Receivers for diffusion-based molecular communication: Exploiting memory and sampling rate,” IEEE Journal on Selected Areas in Commun., vol. 32, no. 12, pp. 2368–2380, Dec 2014. [17] C. Jiang, Y. Chen, and K. J. Ray Liu, “Nanoscale molecular communication networks: a game-theoretic perspective,” EURASIP Jour. on Adv. in Signal Proc., vol. 5, 2015. [18] J. Suzuki, T. Nakano, and M. J. Moore, Modeling, Methodologies and Tools for Molecular and Nano-scale Communications. Springer Int. Publishing, 2017. [19] H. Arjmandi, M. Movahednasab, A. Gohari, M. Mirmohseni, M. NasiriKenari, and F. Fekri, “Isi-avoiding modulation for diffusion-based molecular communication,” IEEE Trans. on Molecular, Biological and Multi-Scale Commun., vol. 3, no. 1, pp. 48–59, March 2017. [20] V. Jamali, A. Ahmadzadeh, and R. Schober, “Symbol synchronization for diffusive molecular communication systems,” in IEEE Int. Conf. on Commun. (ICC), Paris, France, 2017. [21] T. Nakano, T. Suda, Y. Okaie, M. J. Moore, and A. V. Vasilakos, “Molecular communication among biological nanomachines: A layered architecture and research issues,” IEEE Trans. on NanoBioscience, vol. 13, 9 2014. [22] M. Pierobon and I. F. Akyildiz, “Capacity of a diffusion-based molecular communication system with channel memory and molecular noise,” IEEE Trans. on Inf. Theory, vol. 59, 02 2013. [23] G. Aminian, H. Arjmandi, A. Gohari, M. Nasiri-Kenari, and U. Mitra, “Capacity of diffusion-based molecular communication networks over lti-poisson channels,” IEEE Trans. on Molecular, Biological and MultiScale Communications, vol. 1, no. 2, pp. 188–201, June 2015. [24] S. M. Mustam, S. K. Syed-Yusof, and S. Zubair, “Capacity and delay spread in multilayer diffusion-based molecular communication (dbmc) channel,” IEEE Trans. on NanoBioscience, vol. 15, no. 7, pp. 599–612, Oct 2016. [25] J. Sun and H. Li, “On the capacity of amplitude modulation based molecular communication channels,” in 2016 8th Int. Conf. on Wireless Commun. Signal Proc. (WCSP), Oct 2016, pp. 1–6. [26] B. Atakan and O. B. Akan, On Channel Capacity and Error Compensation in Molecular Communication. Berlin, Heidelberg: Springer Berlin Heidelberg, 2008, pp. 59–80. [27] G. Aminian, M. Farahnak-Ghazani, M. Mirmohseni, M. Nasiri-Kenari, and F. Fekri, “On the capacity of point-to-point and multiple-access molecular communications with ligand-receptors,” IEEE Trans. on Molecular, Biological and Multi-Scale Commun., vol. 1, no. 4, pp. 331– 346, Dec 2015. [28] H. Mahdavifar and A. Beirami, “Diffusion channel with poisson reception process: capacity results and applications,” in 2015 IEEE Int. Symp. on Inf. Theory (ISIT), June 2015, pp. 1956–1960. [29] D. Kilinc and O. B. Akan, “Receiver design for molecular communication,” IEEE Journal on Selected Areas in Communications, vol. 31, no. 12, pp. 705–714, 2013. [30] M. Pierobon and I. F. Akyildiz, “Diffusion-based noise analysis for molecular communication in nanonetworks,” IEEE Transactions on Signal Processing, vol. 59, no. 6, pp. 2532–2547, 2011. 8 [31] A. Noel, K. C. Cheung, and R. Schober, “Optimal receiver design for diffusive molecular communication with flow and additive noise,” IEEE transactions on nanobioscience, vol. 13, no. 3, pp. 350–362, 2014. [32] A. El Gamal and Y.-H. Kim, Network Information Theory. Cambridge University Press, 2011. [33] R. Rajesh, V. Sharma, and P. Viswanath, “Capacity of Gaussian channels with energy harvesting and processing cost,” IEEE Transactions on Information Theory, vol. 60, no. 5, pp. 2563–2575, May 2014. The base of the induction is clear. Since x̃1 ≤ s̃1 = 0, we have x1 = q0 x̃1 = 0. Therefore, x1 ≤ s1 = 0 and s1 ≥ q0 s̃1 hold. Equation (26) holds because sT +1 = f (sT − xT ) T X qT −k s̃k − xT ) ≥ f( k=0 T X = f( A PPENDIX k=0 Lemma 1: Let (x̃0 , s̃0 , x̃1 , s̃1 , · · · ) be a sequence satisfying s̃0 = 0, x̃i ≤ s̃i , and s̃i+1 = f (s̃i − x̃i ) for i ≥ 0. Let qP 0 , q1 , · · · be a sequence of non-negative numbers satisfying i qi ≤ 1. Let xj = j X qj−k x̃k , T X ≥ k=0 T X = qT −k (s̃k − x̃k )) (29) qT −k s̃k+1 (30) k=0 j = 0, 1, . . . . = qT +1 s̃0 + X X αi f (vi ). αi vi ) ≥ f( (22) P j αj ∈ [0, 1]. Then, qT −k s̃k+1 (31) i ≥ (1 − κ)f (0) + ≥ X i X where (27) follows from the induction hypothesis and monotonicity of f , (28) follows from the definition of xT , (29) follows from (22), (30) follows from the definition of s̃k+1 and (31) follows from the fact that s̃0 = 0. Equation (25) holds because xT +1 = αi f (vi ) ≤ (23) i = αi f (vi ), i where (23) from Jensen’s inequality for the concave function f. We prove the Lemma by induction on i. We form the induction by assuming a stronger induction hypothesis: we assume that we have defined si for i ≤ T such that xi ≤ si , si = f (si−1 − xi−1 ) and additionally qj−k s̃k , j = 1, 2, . . . , T. (24) k=0 Then, we prove that sT +1 = f (sT − xT ) will satisfy xT +1 ≤ sT +1 (25) sT +1 ≥ (26) T +1 X k=0 qT +1−k s̃k . qT +1−k s̃k , k=0 = X X αi vi ) αi vi ) = f ((1 − κ) · 0 + f( T +1 X = i i j X T X k=0 Then, assuming that f is a concave molecule production function, there is a sequence (s0 , s1 , · · · ) of non-negative numbers satisfying s0 = 0, xi ≤ si and si+1 = f (si − xi ) for any i ≥ 0. Proof of Lemma 1: We begin by first proving the following fact about the function P f : given any non-negative numbers αi and vi such that i αi ≤ 1 we have sj ≥ (28) qT −k f (s̃k − x̃k ) k=0 To see this, let κ = (27) T +1 X k=0 T +1 X k=1 T +1 X k=1 T +1 X qT +1−k x̃k qT +1−k x̃k (32) qT +1−k s̃k (33) qT +1−k f (s̃k−1 − x̃k−1 ) (34) k=1 T +1 X ≤ f( qT +1−k (s̃k−1 − x̃k−1 )) = f( qT −k (s̃k − x̃k )) k=1 T X =f k=0  X T k=0  qT −k s̃k − xT ≤ f (sT − xT ) = sT +1 ,  (35) (36) (37) where (32) follows from x̃0 = 0, (33) follows from x̃k ≤ s̃k , (34) follows from the definition of s̃k , (35) follows from (22), (36) follows from definition of xT and finally, (37) follows from induction hypothesis (24) and the fact that f is nondecreasing.
7cs.IT
Theory and Techniques for Synthesizing a Family of Graph Algorithms Srinivas Nedunuri William R. Cook Douglas R. Smith University of Texas at Austin Kestrel Institute nedunuri|[email protected] [email protected] Although Breadth-First Search (BFS) has several advantages over Depth-First Search (DFS) its prohibitive space requirements have meant that algorithm designers often pass it over in favor of DFS. To address this shortcoming, we introduce a theory of Efficient BFS (EBFS) along with a simple recursive program schema for carrying out the search. The theory is based on dominance relations, a long standing technique from the field of search algorithms. We show how the theory can be used to systematically derive solutions to two graph algorithms, namely the Single Source Shortest Path problem and the Minimum Spanning Tree problem. The solutions are found by making small systematic changes to the derivation, revealing the connections between the two problems which are often obscured in textbook presentations of them. 1 Introduction Program synthesis is experiencing something of a resurgence [21, 20, 4] [14, 22] following negative perceptions of its scalability in the early 90s. Many of the current approaches aim for near-automated synthesis. In contrast, the approach we follow, we call guided program synthesis, also incorporates a high degree of automation but is more user-guided. The basic idea is to identify interesting classes of algorithms and capture as much generic algorithm design knowledge as possible in one place.The user instantiates that knowledge with problem-specific domain information. This step is often carried out with machine assistance. The approach has been applied to successfully derive scores of efficient algorithms for a wide range of practical problems including scheduling [18], concurrent garbage collection [13], and SAT solvers [19]. One significant class of algorithms that has been investigated is search algorithms. Many interesting problems can be solved by application of search. In such an approach, an initial search space is partitioned into subspaces, a process called splitting, which continues recursively until a feasible solution is found. A feasible solution is one that satisfies the given problem specification. Viewed as a search tree, spaces form nodes, and the subspaces after a split form the children of that node. The process has been formalized by Smith [15, 17]. Problems which can be solved by global search are said to be in the Global Search (GS) class. The enhancements in GS over standard branch-and-bound include a number of techniques designed to improve the quality of the search by eliminating unpromising avenues. One such technique is referred to as dominance relations. Although they do not appear to have been widely used, the idea of dominance relations goes back to at least the 70s [5]. Essentially, a dominance relation is a relation between two nodes in the search tree such that if one dominates the other, then the dominated node is guaranteed to lead to a worse solution than the dominating one, and can therefore be discarded. Establishing a dominance relation for a given problem is carried out by a user. However this process is not always obvious. There are also a variety of ways in which to carry out the search, for example Depth-First (DFS), Breadth-First (BFS), Best-First, etc. Although DFS is the most common, Doron Peled and Sven Schewe (Eds.): First Workshop on Synthesis (SYNT2012) EPTCS 84, 2012, pp. 33–46, doi:10.4204/EPTCS.84.3 c S.Nedunuri, W. R. Cook & D.R. Smith This work is licensed under the Creative Commons Attribution License. Theory and Techniques for Synthesizing a Family of Graph Algorithms 34 BFS actually has several advantages over DFS were it not for its exponential space requirement. The key to carrying out BFS space-efficiently is to limit the size of the frontier at any level. However, this has not been investigated in any systematic manner up to now. This paper has two main contributions: • We show how to limit the size of the frontier in search using dominance relations, thereby enabling space-efficient BFS. From this formal characterization, we derive a characteristic recurrence that serves as the basis of a program schema for implementing Global Search. Additionally, we show that limiting the size of the undominated frontier to one results in a useful class of greedy algorithms. • We show how to derive dominance relations and demonstrate they satisfy the greediness conditions for two graph problems, namely Single Source Shortest Path and Minimum Spanning Tree by a systematic process, which though not automatic, we believe has the potential to be automated. 2 Background To Guided Program Synthesis 2.1 Process The basic steps in guided program synthesis are: 1. Start with a logical specification of the problem to be solved. A specification is a quadruple hD, R, o, ci where D is an input type, R an output or result type, o : D × R is a predicate relating correct or feasible outputs to inputs, and c : D×R → Int is a cost function on solutions. An example specification is in Eg. 1 (This specification is explained in more detail below) 2. Pick an algorithm class from a library of algorithm classes (G LOBAL S EARCH , L OCAL S EARCH , D IVIDE AND C ONQUER , F IXPOINT I TERATION, etc). An algorithm class comprises a program schema containing operators to be instantiated and an axiomatic theory of those operators (see [9] for details). A schema is analogous to a template in Java/C++ , with the difference that both the template and template arguments are formally constrained. 3. Instantiate the operators of the program schema using information about the problem domain and in accordance with the axioms of the class theory. To ensure correctness, this step can be carried out with mechanical assistance. The result is an efficient algorithm for solving the given problem. 4. Apply low-level program transforms such as finite differencing, context-dependent simplification, and partial evaluation, followed by code generation. Many of these are automatically applied by Specware [1], a formal program development environment. The result of Step 4 is an efficient program for solving the problem which is guaranteed correct by construction. The power of the approach stems from the fact that the common structure of many algorithms is contained in one reusable program schema and associated theory. Of course the program schema needs to be carefully designed, but that is done once by the library designer. The focus of this paper is the G LOBAL S EARCH class, and specifically on how to methodically carry out Step 3 for a wide variety of problems. Details of the other algorithm classes and steps are available elsewhere [7, 15, 13]. Example 1. Specification of the Single Pair Shortest Path (SPSP) problem is shown in Fig. 2.1 (The 7→ reads as “instantiates to”) The input D is a structure with 3 fields, namely a start node, end node and a set of edges. The result R is a sequence of edges ([. . .] notation). A correct result is one that satisfies the predicate path? which checks that a path z must be a contiguous path from the start node to the end node ( simple recursive definition not shown). Finally the cost of a solution is the sum of the costs of the edges in that solution. Note that fields of a structure are accessed using the ’.’ notation. S.Nedunuri, W. R. Cook & D.R. Smith 35 2.2 Global Search Before delving into a program schema for Global Search, it helps to understand the structures over D 7→ hs : Node, e : Node, edges : {Edge}i which the program schema operates. In [15], a Edge = h f : Node,t : Node, w : Nati search space is represented by a descriptor of R 7→ [Edge] b which is an abstraction of the result some type R, o 7→ λ (x, z) · path?(z, x.s, x.e) type R. The initial or starting space is denoted path?(p, s, f ) = ... b b ⊥. There are also two predicates split: D × R × R, c 7→ λ (x, z) · ∑edge∈z edge.w written ⋔, and extract: Rb × R, written χ . Split defines when a space is a subspace of another space, Figure 2.1: Specification of Shortest Path problem and extract captures when a solution is extractable from a space. We say a solution z is contained in a space y (written z ∈ y) if it can be extracted after a finite number of splits. A feasible space is one that contains feasible solutions. We often write ⋔ (x, y, y′ ) as y ⋔x y′ for readability, and even drop the subscript when there is no confusion. Global Search theory (GS-theory) [15] axiomatically characterizes the relation between the predicates ⊥, ⋔ and χ , as well as ensuring that the associated program schema computes a result that satisfies the b ⊥, ⋔, χ , ⊕ are all assumed to be drawn from GS-theory. specification. In the sequel, the symbols R, A theory for a given problem is created by instantiating these terms, as shown in the next example. Example 2. Instantiating GS-theory for the Single Pair Shortest Path problem. The type of solution spaces Rb is the same as the result type R 1 . A space is split by adding an edge to the current path - that is the subspaces are the different paths that result from adding an edge to the parent path. Finally a solution can be trivially extracted from any space by setting the result z to the space p. This is summarized in Fig. 2.2 ([] denotes the empty list, and ++ denotes list concatenation). 2.3 Dominance Relations As mentioned in the introduction, a dominance relation provides a way of comparing two subspaces Rb 7→ R in order to show that one will always contain at ⊥ 7→ λ x · [] ′ least as good a solution as the other. (Goodness ⋔ 7→ λ (x, p, p ) · ∃e ∈ x.edges· ′ in this case is measured by some cost function on p = p++[e] solutions). The first space is said to dominate (⊲) χ 7→ λ (z, p) · p = z the second, which can then be eliminated from the Figure 2.2: GS instantiation for Single Pair Shortest search. Letting c∗ denote the cost of an optimal Path solution in a space, this can be formalized as (all free variables are assumed to be universally quantified): y ⊲ y′ ⇒ c∗ (x, y) ≤ c∗ (x, y′ ) (2.1) Another way of expressing the consequent of (2.1) is ∀z′ ∈ y′ · o(x, z′ ) ⇒ ∃z ∈ y · o(x, z) ∧ c(x, z) ≤ c(x, z′ ) (2.2) To derive dominance relations, it is often useful to first derive a semi-congruence relation [15]. A semi-congruence between two partial solutions y and y′ , written y y′ , ensures that any way of extending 1 there is a covariant relationship between an element of R b and of R. For example, the initial space, corresponding to all possible paths, is the empty list. Theory and Techniques for Synthesizing a Family of Graph Algorithms 36 y′ into a feasible solution can also be used to extend y into a feasible solution. Like ⋔, is a ternary b × Rb but as we have done with ⋔ and many other such relations in this work, we drop relation over D × R the input argument when there is no confusion and write it as a binary relation for readability. Before defining semi-congruence, we introduce two concepts. One is the idea of useability of a space. A space y is is useable, written o∗ (x, y), if ∃z. χ (y, z) ∧ o(x, z), meaning a feasible solution can be extracted from the space. The second is the notion of incorporating sufficient information into a space to make it useable. This is defined by an operator ⊕ : Rb × t → Rb that takes a space and some additional information of type b For example if Rb is the type of lists, then t t and returns a more defined space. The type t depends on R. might also be the same type. Now the formal definition of semi-congruence is: y y′ ⇒ o∗ (x, y′ ⊕ e) ⇒ o∗ (x, y ⊕ e) That is, y y′ is a sufficient condition for ensuring that if y′ can be extended into a feasible solution than so can y with the same extension. If c is compositional (that is, c(s ⊕ t) = c(s) + c(t)) then it can be shown [9] that if y y′ and y is cheaper than y′ , then y dominates y′ (written y ⊲ y′ ). Formally: y y′ ∧ c(x, y) ≤ c(x, y′ ) ⇒ y ⊲ y′ (2.3) The axioms given above extend GS-theory [15]. Example 3. Single Pair Shortest Path. If there are two paths p and p′ leading from the start node, if p and p′ both terminate in the same node then p p′ . The reason is that any path extension e (of type t = [Edge]) of p′ that leads to the target node is also a valid path extension for p. Additionally if p is shorter than p′ then p dominates p′ , which can be discarded. Note that this does not imply that p leads to the target node, simply that no optimal solutions are lost in discarding p′ . This dominance relation is formally derived in Eg. 8 Example 4. 0-1 Knapsack The 0-1 Knapsack problem is, given a set of items each of which has a weight and utility and a knapsack that has some maximum weight capacity, to pack the knapsack with a subset of items that maximizes utility and does not exceed the knapsack capacity. Given combinations k, k′ , if k and k′ have both examined the same set of items and k weighs less than k′ then any additional items e that can be feasibly added to k′ can also be added to k, and therefore k k′ . Additionally if k has at least as much utility as k′ then k ⊲ k′ . The remaining sections cover the original contributions of this paper. 3 A Theory Of Efficient Breadth-First Search (EBFS) While search can in principle solve for any computable function, it still leaves open the question of how to carry it out effectively. Various search strategies have been investigated over the years; two of the most common being Breadth-First Search (BFS) and Depth-First Search (DFS). It is well known that BFS offers several advantages over DFS. Unlike DFS which can get trapped in infinite paths2 , BFS will always find a solution if one exists. Secondly, BFS does not require backtracking. Third, for deeper trees, BFS will generally find a solution at the earliest possible opportunity. However, the major drawback of BFS is its space requirement which grows exponentially. For this reason, DFS is usually preferred over BFS. 2 resolvable in DFS with additional programming effort S.Nedunuri, W. R. Cook & D.R. Smith 37 Our first contribution in this paper is to refine GS-theory to identify the conditions under which a BFS algorithm can operate space-efficiently. The key is to show how the size of the undominated frontier of the search tree can be polynomially bounded. Dominance relations are the basis for this. In [15], the relation ⋔l for l ≥ 0 is recursively defined as follows: y ⋔0 y′ = (y = y′ ) y ⋔l+1 y′ = ∃y′′ · y ⋔ y′′ ∧ y′′ ⋔l y′ From this the next step is to define those spaces at a given frontier level that are not dominated. However, this requires some care because dominance is a pre-order, that is it satisfies the reflexivity and transitivity axioms as a partial order does, but not the anti-symmetry axiom. That is, it is quite possible for y to dominate y′ and y′ to dominate y but y and y′ need not be equal. An example in Shortest Path is two paths of the same length from the start node that end at the same node. Each path dominates the other. To eliminate such cyclic dominances, define the relation y ≈ y′ as y ⊲ y′ ∧ y′ ⊲ y. It is not difficult to show that ≈ is an equivalence relation. Now let the quotient frontier at level l be the quotient set frontierl / ≈ . For type consistency, let the representative frontier rfrontierl be the quotient frontier in which each equivalence class is replaced by some arbitrary member of that class. The representative frontier is the frontier in which cyclic dominances have been removed. Finally then the undominated frontier undoml is rfrontierl − {y | ∃y′ ∈ rfrontierl · y′ ⊲ y}. Now given a problem in the GS class, if it can be shown that kundoml k for any l is polynomially bounded in the size of the input, a number of benefits accrue: (1) BFS can be used to tractably carry out the search, as implemented in the raw program schema of Alg. 1, (2) The raw schema of Alg. 1 can be transformed into an efficient tail recursive form, in which the entire frontier is passed down and (3) If additionally the tree depth can be polynomially bounded (which typically occurs for example in constraint satisfaction problems or CSPs [3]) then, under some reasonable assumptions about the work being done at each node, the result is a polynomial-time algorithm for the problem. 3.1 Program Theory A program theory for EBFS defines a recursive function which given a space y, computes a non-trivial subset Fx (y) of the optimal solutions contained in y, where Fx (y) = optc {z | z ∈ y ∧ o(x, z)} optc is a subset of its argument that is the optimal set of solutions (w.r.t. the cost function c), defined as follows: optc S = {z | z ∈ S ∧ (∀z′ ∈ S · c(z) ≤ c(z′ ))} Also let undom(y) be undoml(y)+1 ∩ {yy | y ⋔ yy} where l(y) is the level of y in the tree. The following proposition defines a recurrence for computing the feasible solutions in a space: b o, c, ⊥, ⋔, χ , ⊲, ⊕i be a well-founded GS-Theory w.r.t. the subspace relation Proposition 5. Let hD, R, R, ⋔ and let Fx (y) = {z | z ∈ y ∧ o(x, z)} be the set of feasible solutions contained in y and Gx (y) = {z | S χ (y, z) ∧ o(x, z)} ∪ yy⋔y Gx (yy)} be a recurrence. Then Gx (y) = Fx (y) for any y Proof. See [15]. Finally he following theorem defines a recurrence that can be used to compute FOx (y): 38 Theory and Techniques for Synthesizing a Family of Graph Algorithms Theorem 6. Let ⋔ be a well-founded relation of GS-theory and let GOx (y) = optc {z | χ (y, z) ∧ o(x, z)} ∪ yy∈undom(y) GOx (yy)) be a recurrence. Then GOx (y) ⊆ FOx (y) S Proof. By generalized induction. The base case is those spaces which do not have subspaces. Then GOx (y) = optc {z | χ (y, z) ∧ o(x, z)}. By Prop. 5 {z | χ (y, z) ∧ o(x, z)} = {z | z ∈ y ∧ o(x, z)}. The inductive case is as follows: FOx (y) = {defn} optc {z | z ∈ y ∧ o(x, z)} = {defn of Fx } opt(Fx (y)) = {Fx (y) = Gx (y) by Prop.5} S opt({z | χ (y, z) ∧ o(x, z)} ∪ y⋔yy Gx (yy)) = {Gx (yy) = Fx (yy) by Prop.5} S opt({z | χ (y, z) ∧ o(x, z)} ∪ y⋔yy Fx (yy)) = {distributivity of opt} S opt(opt{z | χ (y, z) ∧ o(x, z)} ∪ opt( y⋔yy Fx (yy))) by = {distributivity and idempotence of opt} S opt({z | χ (y, z) ∧ o(x, z)} ∪ y⋔yy opt(Fx (yy))) = {unfold defn of Fx , fold defn of FOx } S opt({z | χ (y, z) ∧ o(x, z)} ∪ y⋔yy FOx (yy)) ⊇ {yy ∈ undom(y) ⇒ y ⋔ yy} S opt({z | χ (y, z) ∧ o(x, z)} ∪ yy∈undom(y) FOx (yy)) ⊇ {induction hypothesis:FOx (yy) ⊇ GOx (yy)} S opt({z | χ (y, z) ∧ o(x, z)} ∪ yy∈undom(y) GOx (yy)) = {fold defn of GOx } GOx (y) The theorem states that if the feasible solutions immediately extractable from a space y are combined with the solutions obtained from GOx of each undominated subspace yy, and the optimal ones of those retained, the result is a subset of FOx (y). The next theorem demonstrate non-triviality3 of the recurrence by showing that if a feasible solution exists in a space, then one will be found. Theorem 7. Let ⋔ be a well-founded relation of GS-Theory and GOx be defined as above. Then FOx (y) 6= 0/ ⇒ GOx (y) 6= 0/ Proof. The proof of Theorem 6 is a series of equalities except for two steps. It is sufficient to show that both of these steps preserve non-triviality. The proof is again by induction over the subspace relation. S S The first refinement reduces y⋔yy FOx (yy) to yy∈undom(y) FOx (yy). Suppose ∃yy · y ⋔ yy ∧ FOx (yy) 6= 0. / If yy∈ undom(y) then we are done. Otherwise if yy is dominated, then there is some yy′ ⊲ yy and by the S property of dominance, FOx (yy′ ) 6= 0, / so yy∈undom(y) FOx (yy) 6= 0. / The second refinement follows again by induction, using the induction hypothesis FOx (yy) 6= 0/ ⇒ GOx (yy) 6= 0. / From the characteristic recurrence we can straightforwardly derive a simple recursive function bfs to compute a non-trivial subset of Fx for a given y, shown in Alg. 1 3 Non-triviality is similar but not identical to completeness. Completeness requires that every optimal solution is found by the recurrence, which we do not guarantee. S.Nedunuri, W. R. Cook & D.R. Smith 39 Algorithm 1 pseudo-Haskell Program Schema for EBFS (schema parameters underlined) solve :: D -> {R} solve(x) = bfs x {initial(x)} bfs :: D -> {RHat}-> {R} bfs x frontier = let localsof y = let z = extract x y in if z!={} && o(x,z) then z else {} locals = (flatten.map) localsof frontier allsubs = (flatten.map) (subspaces x) frontier undom = {yy : yy∈allsubs && (yy’∈subs && yy’ ‘dominates‘ yy ⇒ yy==yy’)} subsolns = bfs x undom in opt(locals ∪ subsolns) subspaces :: D -> RHat -> {RHat} subspaces x y = {yy: split(x,y,yy)) opt :: {R} -> {R} opt zs = min {c x z | z ∈zs} The final program schema that is included in the Specware library is the result of incorporating a number of other features of GS such as necessary filters, bounds tests, and propagation, which are not shown here. Details of these and other techniques are in [15]. 3.2 A class of strictly greedy algorithms (SG) A greedy algorithm [2] is one which repeatedly makes a locally optimal choice. For some classes of problems this leads to a globally optimum choice. We can get a characterization of optimally greedy algorithms within EBFS by restricting the size of undoml for any l to 1. If undoml 6= 0/ then the singleton member y∗ of undoml is called the greedy choice. In other work [12] we show how to derive greedy algorithms for a variety of problems including Activity Selection, One machine scheduling, Professor Midas’ Traveling Problem, Binary Search. 4 Methodology We strongly believe that every formal approach should be accompanied by a methodology by which it can be used by a competent developer, without needing great insights. Guided program synthesis already goes a long way towards meeting this requirement by capturing design knowledge in a reusable form. The remainder of the work to be done by a developer consists of instantiating the various parameters of the program schema. In the second half of this paper, we demonstrate how carrying this out systematically allows us to derive several related graph algorithms, revealing connections that are not always obvious from textbook descriptions. We wish to reiterate that once the dominance relation and other operators in the schema have been instantiated, the result is a complete solution to the given problem. We focus on dominance relations because they are arguably the most challenging of the operators to design. The remaining parameters can usually be written down by visual inspection. The simplest form of derivation is to reason backwards from the conclusion of y y′ ⇒ o∗ (x, y′ ⊕ e) ⇒ o∗ (x, y ⊕ e), while assuming o∗ (x, y′ ⊕ e) . The additional assumptions that are made along the way form the required semi-congruence condition. The following example illustrates the approach. 40 Theory and Techniques for Synthesizing a Family of Graph Algorithms o∗ (x, y ⊕ e) = {defn of o∗ } ∃z · χ (y ⊕ e, z) ∧ o(x, z) = {defn of χ } o(x, y ⊕ e) = {defn of o} path?(y ⊕ e, x.s, x.e) = {distributive law for path?} ∃n · path?(y, x.s, n) ∧ path?(e, n, x.e) ⇐ {o∗ (x, y′ ⊕ e), ie.∃m · path?(y′ , x.s, m) ∧ path?(e, m, x.e). Let m be witness for n} path?(y, x.s, m) ∧ path?(e, m, x.e) = {m = last(y).t, (where last returns the last element of a sequence)} last(y).t = last(y′ ).t ∧ path?(y, x.s, n) Figure 4.1: Derivation of semi-congruence relation for Single Pair Shortest Path Example 8. Derivation of the semi-congruence relation for Single Pair Shortest Path in Eg. 1 is a straightforward calculation as shown in Fig 4.1. It relies on the specification of Shortest Path given in Eg. 1 and the GS-theory in Eg. 2. The calculation shows that a path y is semi-congruent to y′ if y and y′ both end at the same node and additionally y is itself a valid path from the start node to its last node. Since the cost function is compositional, this immediately produces a dominance relation y ⊲ y′ = last(y) = last(y′ ) ∧ path?(y, x.s, n) ∧ ∑edge∈y edge.w ≤ ∑edge′ ∈y′ edge′ .w. Note the use of the distributive law for path? in step 4. Such laws are usually formulated as part of a domain theory during a domain discovery process, or even as part of the process of trying to carry out a derivation such as the one just shown. Given an appropriate constructive prover (such as the one in KIDS [16]) such a derivation could in fact be automated. Other examples that have been derived using this approach are Activity Selection [11], Integer Linear Programming [15], and variations on the Maximum Segment Sum problem [10]. While this dominance relation could in principle be used to computer Single Source Shortest Path using a Best-First search (such as A*) it would not be very efficient as every pair of nodes on the frontier would need to be compared. In the next section, a more powerful dominance relation is derived which can be used in a Breadth-First search, and even more importantly, be shown to be in the SG class, resulting in a very efficient greedy algorithm. The dominance relation just derived is still utilized, but in a subsidiary role. 5 More complex derivations: A family of related algorithms 5.1 (Single Source) Shortest Path Previously in Eg. 8 we derived a dominance relation for the (undirected) single pair shortest path problem. To solve the problem of finding all shortest paths from a given start node to every other node in the graph it is convenient to consider the output as a set of edges that form what is called a path tree, a subgraph of the input graph which forms a spanning tree rooted at the start node. The desired output is a path tree in which every path from the root is the shortest. The specification of Single Pair Shortest Path in Fig. 2.1 is revised as shown in Fig. 5.1 The revised instantiation of Global Search theory is shown in Fig. 5.2 In what follows, the extends operator ⊕ is shown by simple concatenation. The goal is to S.Nedunuri, W. R. Cook & D.R. Smith 41 D 7→ hs : Node, edges : {Edge}i Edge = ha : Node, b : Node, w : Nati R 7→ {Edge} o 7→ λ (x, z) · connected(x, z) ∧ acyclic(x, z) c 7→ λ (x, z) · ∑ p∈pathsFrom(x.s) c′ (p) c′ (p) = ∑edge∈p edge.w Figure 5.1: Specification of Shortest Path problem Rb ⊥ ⋔ χ ⊕ 7→ 7→ 7→ 7→ 7→ R λ x · {} λ (x, p, pe) · ∃e ∈ x.edges · pe = p ∪ {e} λ (z, p) · p = z ∪ Figure 5.2: GS instantiation for Shortest Path show that there is at most one undominated child following a split of a partial solution α . Let α e and α e′ be two children following a split of α , that is the graphs α with edge e added and that with e′ added. Without loss of generality (w.l.o.g.) assume neither e nor e′ are already contained in α and both connect to α . Let z′ = α e′ ω ′ be a feasible solution derived from α e′ . The task is to construct a feasible solution z from α e and discover the conditions under which it is cheaper than z′ . We will use the definition of general dominance (2.2), repeated here for convenience: ∀z′ ∈ y′ · o(x, z′ ) ⇒ ∃z ∈ y · o(x, z) ∧ c(x, z) ≤ c(x, z′ ) Establishing o(α eω ) requires connected(α eω ) and acyclic(α eω ). In guided program synthesis, it is often useful to write down laws [16] that will be needed during the derivation. Some of the most useful laws are distributive laws and monotonicity laws. For example the following distributive law applies to ayclic : acyclic(αβ ) = acyclic(α ) ∧ acyclic(β ) ∧ ac(α , β ) where ac defines what happens at the “boundary” of α and β : ac(α , β ) = ∀m, n · ∃p ∈ α ∗ · path?(p, m, n) ⇒ ¬∃q ∈ β ∗ · path?(q, m, n) requiring that if p is a path in α (α ∗ is a regular expression denoting all possible sequences of edges in α ) connecting m and n then there should be no path between m and n in β . Examples of monotonicity laws are acyclic(αβ ) ⇒ acyclic(α ) and connected(α ) ∧ connected(β ) ∧ nodes(α ) ∩ nodes(β ) 6= 0/ ⇒ connected(αβ ). By using the laws constructively, automated tools such as KIDS [16] can often suggest instantiations for terms. For instance, after being told connected(α e′ ω ′ ), the tool could apply the monotonicity law for connected to suggest connected(α ee′ ω ′ ), that is to try ω = e′ ω ′ . With this binding for ω we can attempt to establish acyclic(α eω ), by expanding its definition. One of the terms is . . . ac(e, α e′ ω ′ ) . . . which fails because conn(α e′ ω ′ ) implies path?(α e′ ω ′ , e.a, e.b) so adding edge e creates a cycle. The witness to the failure is some path π ′ = e j . . . ek where e j .a = e.a ∧ ek .b = e.b. One possibility is that e j = ek = e, that is ω ′ contains e. If so, let ω ′ = eψ ′ for some ψ ′ . Then 42 Theory and Techniques for Synthesizing a Family of Graph Algorithms Figure 5.3: Feasible solution α e′ ω ′ z′ = α e′ ω ′ = α e′ eψ ′ = α ee′ ψ ′ . Let ω = e′ ψ ′ and now z = z′ . Otherwise, w.l.o.g assume that e connects with α at e.a, and therefore so does e j , so the case e j .b = e.b is not very interesting. The only option then is to remove edge ek from ω ′ . Let ω ′ = ek ψ ′ and so ω is e′ ψ ′ . Now the requirement becomes acyclic(α e) ∧ acyclic(e′ ψ ′ ) ∧ ac(α e, e′ ψ ′ ) acyclic(e′ ψ ′ ) follows from acyclic(α e′ ψ ′ ) by monotonicity and ac(α e, e′ ψ ′ ) follows from acyclic(α e′ ψ ′ ) and the fact that e was chosen above to remove the cycle in α ee′ ω ′ . This demonstrates o(α eω ) provided acyclic(α e) where ω is constructed as above. Finally, to establish general dominance it is necessary to show that z costs no more than z′ . Note that the cost of a solution is the sum of individual path costs starting from x.s. Let m denote e.a and n denote e.b (and analogously for e′ ). Now consider a path to a node p in z′ . If the path to p does not contain edge ek ie. pass through n then the same path holds in z. Otherwise let β ′ e′i γ ′ e”δ be a path to p in z′ where e” is the edge ek above (see Fig. 5.3). β ′ is a path from x.s in α and e′i is some edge that leads out of α on the path to p. Then the corresponding path in z is β eδ (see Fig. 5.4). c(α eω , β eδ ) ≤ c(α e′ ω ′ , β ′ ei γ ′ e”δ ) = {expand defns} c(z, β e) + c(z, δ ) ≤ c(z′ , β ′ ei ) + c(z′ , e”) + c(z, δ ) = {+ve edge weights, triangle inequality} c(z, β e) ≤ c(z′ , β ′ ei ) As there were no restrictions on e′ above, let ei be the witness for e′ and this establishes That is, provided the path β e is shorter than β ′ e′ , there cannot be a shorter path via e′ to n. As cost is the sum of the path costs, it follows that c(x, α eω ) ≤ c(α e′ ω ′ ). The dominance condition is then α e ⊲ α e′ ⇐ acyclic(α e) ∧ c(z, β e) ≤ c(z′ , β ′ e′ ) . Finally, as it is not known at the time of the split which e′ will lie on the path to e.b, to be conservative, let e be that edge whose endpoint e.b is the closest to the start node. This is therefore the greedy choice. Iincorporating finite differencing to incrementally maintain the distances to the nodes, using the dominance relation derived earlier for Single Pair Shortest Path to eliminate the longer paths to a node, and data structure refinement results in an algorithm similar to Dijkstra’s algorithm for MSTs. S.Nedunuri, W. R. Cook & D.R. Smith 43 Figure 5.4: Feasible solution α eω D 7→ {Edge} | connected Edge = h f : Node,t : Node, w : Nati R 7→ {Edge} o 7→ λ (x, z) · connected(x, z) ∧ acyclic(x, z) c 7→ λ (x, z) · ∑edge∈z edge.w Figure 5.5: Specification of Min. Spanning Tree problem 5.2 Minimum Spanning Tree The specification of MST is very similar to that of Shortest Path, with the difference that there is no longer a distinguished node s, the input graph must be connected, and the cost of a solution is simply the sum of the weights of the edges in the tree The instantiation of the simple GS operators is as for SP. Again, any edge that is added must not create a cycle or it cannot lead to a feasible solution. We will describe the algorithm construction process informally so as to expose the connection with the Shortest Path algorithm more clearly. However the derivations shown here can also be similarly formalized. There are now two ways to satisfy the acyclicity requirement. One is by choosing an edge connecting a node in α to one outside of α . Another is to choose an edge that connects two nodes within α , being careful not to create cycles. The two options are examined next, Option 1: Let z′ = α e′ ω ′ be a feasible solution derived from α e′ . If ω ′ includes e then let ω in a feasible solution z = α eω simply be ω ′ − {e} ∪ {e′ } and then z = z′ . Otherwise, if ω ’ does not contain e there must be some other path connecting α with e.t. W.l.o.g. assume that path is via e′ . If α e′ ω ′ is feasible, then it is a tree, so ω ’ is also a tree. Therefore it is not difficult to show that z = α eω ′ is also a spanning tree. Now to show dominance, derive conditions under which z is cheaper than z′ : c(x, α eω ′ ) ≤ c(x, α e′ ω ′ ) = {defn of c} ∑edge∈α eω ′ edge.w ≤ ∑edge∈α e′ ω ′ edge.w = e.w ≤ e′ .w Theory and Techniques for Synthesizing a Family of Graph Algorithms 44 Finally, as it is not known at the time of the split which e′ will lie on the path to e.t, to be conservative, let e be that edge with the least weight connecting α with an external node . This is therefore the greedy choice. The result is an algorithm that is similar to Prim’s algorithm for MSTs. Option 2: The difference with Option 1 is in how e is chosen in order to ensure acyclicity. For a feasible solution, α must not contain any cycles. Therefore it consists of a collection of acyclic connected components, ie trees. Any new edge cannot connect nodes within a component without introducing a cycle. Therefore it must connect two component trees. Connecting two trees by a single edge results in a new tree. As in Option 1, let z′ = α e′ ω ′ be a feasible solution derived from α e′ . If ω ′ includes e then let ω in a feasible solution z = α eω simply be ω ′ − {e} ∪ {e′ } and then z = z′ . Otherwise, if ω ’ does not contain e there must be some other edge used to connect the two trees that e would have connected. W.l.o.g. assume that edge is e′ . If α e′ ω ′ is feasible, then it is a tree, so ω ’ is also a tree. Therefore it is not difficult to show that z = α eω ′ is also a spanning tree. The derivation of a cost comparison relation is identical to Option 1, and once again the greedy choice is the edge e that connects two trees and is of least weight. The result of this option is an algorithm that is similar to Kruskal’s algorithm. In conclusion, we observe that far from being completely different algorithms, Dijkstra’s algorithm, Prim’s algorithm and Kruskal’s algorithm differ only in very small number of (albeit important) ways. In contrast, many textbook descriptions of the algorithms introduce the algorithms out of the blue, followed by separate proofs of correctness. We have shown how a systematic procedure can derive different algorithms, with relatively minor changes to the derivations. 6 Related Work Gulwani et al. [21, 4] describe a powerful program synthesis approach called template-based synthesis. A user supplies a template or outline of the intended program structure, and the tool fills in the details. A number of interesting programs have been synthesized using this approach, including Bresenham’s line drawing algorithm and various bit vector manipulation routines. A related method is inductive synthesis [6] in which the tool synthesizes a program from examples. The latter has been used for inferring spreadsheet formulae from examples. All the tools rely on powerful SMT solvers. The Sketching approach of Solar-Lezama et al [14] also relies on inductive synthesis. A sketch, similar in intent to a template, is supplied by the user and the tool fills in such aspects as loop bounds and array indexing. Sketching relies on efficient SAT solvers. To quote Gulwani et al. the benefit of the template approach is that “the programmer only need write the structure of the code and the tool fills out the details” [21].Rather than the programmer supplying an arbitrary template, though, we suggest the use of a program schema from the appropriate algorithm class (refer to Step 2 of the process in Sec. 2.1). We believe that the advantage of such an approach is that, based on a sound theory, much can already be inferred at the abstract level and this is captured in the theory associated with the algorithm class. Furthermore, knowledge of properties at the abstract level allows specialization of the program schema with information that would otherwise have to either be guessed at by the programmer devising a template or inferred automatically by the tool (e.g. tail recursive implementation or efficient implementation of dominance testing with hashing). We believe this will allow semi-automated synthesis to scale up to larger problems such as constraint solvers (SAT, CSP, LP, MIP, etc.), planning and scheduling, and O/S level programs such as garbage collectors [13]. Program verification is another field that shares common goals with program synthesis - namely a correct efficient program. The difference lies in approach - we prefer to construct the program in a way that is guaranteed to be correct, as opposed to verifying its correctness after the fact. Certainly some S.Nedunuri, W. R. Cook & D.R. Smith 45 recent tools such as Dafny [8] provide very useful feedback in an IDE during program construction. But even such tools requires significant program annotations in the form of invariants to be able to automatically verify non-trivial examples such as the Schorr-Waite algorithm [8]. Nevertheless, we do not see verification and synthesis as being necessarily opposed. For example, ensuring the correctness of the instantiation of several of the operators in the program schema which is usually done by inspection is a verification task, as is ensuring correctness of the schema that goes in the class library. We also feel that recent advances in verification via SMT solvers will also help guided synthesis by increasing the degree of automation. Refinement is generally viewed as an alternative to synthesis. A specification is gradually refined into an efficient executable program. Refinement methods such as Z and B have proved to be very popular. In contrast to refinement, guided program synthesis already has the program structure in place, and the main body of work consists of instantiating the schema parameters followed by various program transformations many of which can be mechanically applied. Both refinement and synthesis rely extensively on tool support, particularly in the form of provers. We expect that advances in both synthesis and refinement will benefit the other field. 7 Summary and Future Work We have formulated a theory of efficient breadth-first search based on dominance relations. A very useful specialization of this class occurs when there is at most one undominated child node. This is the class of Strictly Greedy algorithms. We have also derived a recurrence from which a simple program schema can be easily constructed. We have shown how to systematically derive dominance relations for a family of important graph algorithms revealing connections between them that are obscured when each algorithm is presented in isolation. Nearly all the derivations shown in this paper have been carried out by hand. However, they are simple enough to be automated. We plan on building a prover that incorporates the ideas mentioned in here. We are encouraged by the success of a similar prover that was part of KIDS, a predecessor to Specware. References [1] Specware. Http://www.specware.org. [2] T. Cormen, C. Leiserson, R. Rivest & C. Stein (2001): Introduction to Algorithms, 2nd edition. MIT Press. [3] R Dechter (2003): Constraint Processing. Morgan Kauffman. [4] S. Gulwani, S. Jha, A. Tiwari & R. Venkatesan (2011): Synthesis of loop-free programs. In: PLDI, pp. 62–73, doi:10.1145/2F1993498.1993506. [5] T. Ibaraki (1977): The Power of Dominance Relations in Branch-and-Bound Algorithms. J. ACM 24(2), pp. 264–279, doi:10.1145/2F322003.322010. [6] S. Itzhaky, S. Gulwani, N. Immerman & M. Sagiv (2010): A simple inductive synthesis methodology and its applications. In: OOPSLA, pp. 36–46, doi:10.1145/2F1869459.1869463. [7] C. Kreitz (1998): Program Synthesis. In W. Bibel & P. Schmitt, editors: Automated Deduction – A Basis for Applications, chapter III.2.5, III, Kluwer, pp. 105–134. [8] K. R. M. Leino (2010): Dafny: an automatic program verifier for functional correctness. In: Proc. 16th intl. conf. on Logic for Prog., AI, & Reasoning, LPAR, pp. 348–370, doi:10.1007/2F978-3-642-17511-4_20. 46 Theory and Techniques for Synthesizing a Family of Graph Algorithms [9] S. Nedunuri (2012): Theory and Techniques for Synthesizing Efficient Breadth-First Search Algorithms. Ph.D. thesis, Univ. of Texas at Austin. [10] S. Nedunuri & W.R. Cook (2009): Synthesis of Fast Programs for Maximum Segment Sum Problems. In: Intl. Conf. on Generative Prog. and Component Engineering (GPCE), doi:10.1145/2F1621607.1621626. [11] S. Nedunuri, D. R. Smith & W. R. Cook (2010): A Class of Greedy Algorithms and Its Relation to Greedoids. Intl. Colloq. on Theoretical Aspects of Computing (ICTAC), doi:10.1007/2F978-3-642-14808-8_24. [12] S. Nedunuri, D. R. Smith & W. R. Cook (2012): Theory and Techniques for a Class of Efficient Breadth-First Search Algorithms. In: Intl. Symp. on Formal Methods (FM). [13] D. Pavlovic, P. Pepper & D. R. Smith (2010): Formal Derivation of Concurrent Garbage Collectors. In: Math. of Program Constr. (MPC), doi:10.1007/2F978-3-642-13321-3_20. [14] Y. Pu, R. Bodík & S. Srivastava (2011): Synthesis of first-order dynamic programming algorithms. In: OOPSLA, pp. 83–98, doi:10.1145/2F2048066.2048076. [15] D. R. Smith (1988): Structure and Design of Global Search Algorithms. Tech. Rep. Kes.U.87.12, Kestrel Institute. [16] D. R. Smith (1990): KIDS: A Semi-Automatic Program Development System. IEEE Trans. on Soft. Eng., Spec. Issue on Formal Methods 16(9), pp. 1024–1043, doi:10.1109/2F32.58788. [17] D. R. Smith (2010): Global Search Theory Revisited. Unpublished. [18] D. R. Smith, E. A. Parra & S. J. Westfold (1995): Synthesis of high-performance transportation schedulers. Technical Report, Kestrel Institute. [19] D. R. Smith & S. Westfold (2008): Synthesis of Propositional Satisfiability Solvers. Final Proj. Report, Kestrel Institute. [20] A. Solar-Lezama, L. Tancau, R. Bodik, S. Seshia & V. Saraswat (2006): Combinatorial sketching for finite programs. In: Proc. of the 12th intl. conf. on architectural support for prog. lang. and operating systems (ASPLOS), pp. 404–415, doi:10.1145/2F1168857.1168907. [21] S. Srivastava, S. Gulwani & J. S. Foster (2010): From program verification to program synthesis. In: POPL, pp. 313–326, doi:10.1.1.148.395. [22] M. Vechev & E. Yahav (2008): Deriving linearizable fine-grained concurrent objects. PLDI ’08, pp. 125– 135, doi:10.1145/2F1375581.1375598.
6cs.PL
1 Video Denoising and Enhancement via Dynamic Video Layering arXiv:1710.02213v1 [cs.CV] 5 Oct 2017 Han Guo and Namrata Vaswani Iowa State University, Ames, IA, USA Email: {hanguo,namrata}@iastate.edu Abstract—Video denoising refers to the problem of removing “noise” from a video sequence. Here the term “noise” is used in a broad sense to refer to any corruption or outlier or interference that is not the quantity of interest. In this work, we develop a novel approach to video denoising that is based on the idea that many noisy or corrupted videos can be split into three parts - the “low-rank layer”, the “sparse layer”, and a small residual (which is small and bounded). We show, using extensive experiments, that our denoising approach outperforms the stateof-the-art denoising algorithms. I. I NTRODUCTION Video denoising refers to the problem of removing “noise” from a video sequence. Here the term “noise” is used in a broad sense to refer to any corruption or outlier or interference that is not the quantity of interest. In the last few decades there has been a lot of work on video denoising. Many of the approaches extend image denoising ideas to 3D by also exploiting dependencies across the temporal dimension. An important example of this is “grouping and collaborative filtering” approaches which try to search for similar image patches both within an image frame and across nearby frames, followed by collaboratively filtering the noise from the stack of matched patches [2], [3], [4], [5], [6]. One of the most effective methods for image denoising, Block Matching and 3D filtering (BM3D) [3], is from this category of techniques. In BM3D, similar image blocks are stacked in a 3D array followed by applying a noise shrinkage operator in a transform domain. In its video version, VBM3D [7], the method is generalized to video denoising by searching for similar blocks across multiple frames. Other related works [8], [9] apply batch matrix completion or matrix decomposition on grouped image patches to remove outliers. Other recent works on video denoising include approaches that use motion compensation algorithms from the video compression literature followed by denoising of similar nearby blocks [10], [11]; and approaches that use wavelet transform based [12], [13], [14] and discrete cosine transform (DCT) based [15] denoising solutions. Very recent video denoising methods include algorithms based on learning a sparsifying transform [16], [17], [18], [19]. Within the image denoising literature, the most promising recent approaches are based on deep learning [20], [21]. This work was partially supported by Rockwell Collins. A portion of this work was presented at IEEE Workshop on Statistical Signal Processing (SSP) 2016 [1]. Contribution. In this paper, we develop a novel approach to video denoising, called ReProCS-based Layering Denoising (ReLD), that is based on the idea that many noisy or corrupted videos can be split into three parts or layers - the “low-rank layer”, the “sparse layer” and the “small bounded residual layer”. Here these terms mean the following. “Low-rank layer” ℓt : the matrix formed by each vectorized image of this layer is low-rank. “Sparse layer” st : each vectorized image of this layer is sparse. “Small bounded residual layer”: each vectorized image of this layer has l∞ norm that is bounded. Our proposed algorithm consists of two parts. At each time instant, it first separates the video into “noisy” versions of the two layers ℓt and st . This is followed by applying an existing state-of-the-art denoising algorithm, VBM3D [7] on each layer. For separating the video, we use a combination of an existing batch technique for sparse + low-rank matrix decomposition called principal components’ pursuit (PCP) [22] and an appropriately modified version of our recently proposed dynamic robust PCA technique called Recursive Projected Compressive Sensing (ReProCS) [23], [24]. We initialize using PCP and use ReProCS afterwards to separate the video into a “sparse layer” and a “low-rank layer”. The video-layering step is followed by VBM3D on each of the two layers. In doing this, VBM3D exploits the specific characteristics of each layer and, hence, is able to find more matched blocks to filter over, resulting in better denoising performance. The motivation for picking ReProCS for the layering task is its superior performance in earlier video experiments involving videos with large-sized sparse components and/or significantly changing background images. The performance of our algorithm is compared with PCP [22], GRASTA [25] and non-convex rpca (NCRPCA) [26], which are some of the best solutions from the existing sparse + low-rank (S+LR) matrix decomposition literature [22], [25], [26], [27], [28], [29], [30], [31], [32] followed by VBM3D for the denoising step; as well as with just using VBM3D directly on the video. We also compare with one neural network based image denoising method that uses a Multi Layer Perceptron (MLP) [33] and with the approach of [9] which performs standard sparse + low-rank (S+LR) matrix approximation (SLMA) on grouped image patches. As we show, our approach is 6-10 times faster than SLMA while also having improved performance. The reason is we use a novel online algorithm (after a short batch initialization) for S+LR and then use VBM3D on each layer. 2 A. Example applications A large number of videos that require denoising/enhancement can be accurately modeled in the above fashion. Some examples are as follows. All videos referenced below are posted at http://www.ece.iastate.edu/∼hanguo/denoise.html. 1) In a traditional denoising scenario, consider slowly changing videos that are corrupted by salt-and-pepper noise (or other impulsive noise). For these types of videos, the large magnitude part of the noise forms the “sparse layer”, while the video-of-interest (slowlychanging in many applications, e.g., waterfall, waving trees, sea water moving, etc) forms the approximate “low-rank layer”. The approximation error in the lowrank approximation forms the “small bounded residual”. See the waterfall-salt-pepper video for an example. The goal is to denoise or extract out the “low-rank layer”. 2) More generally, consider slow-changing videos corrupted by very large variance white Gaussian noise. As we explain below, large Gaussian noise can, with high probability, be split into a very sparse noise component plus bounded noise. Thus, our approach also works on this type of videos, and in fact, in this scenario, we show that it significantly outperforms the existing state-of-theart video denoising approaches. (See Fig. 4a.) 3) In very low-light videos of moving targets/objects (the moving target is barely visible), the denoising goal is to “see” the barely visible moving targets (sparse). These are hard to see because they are corrupted by slowlychanging background images (well modeled as forming the low-rank layer plus the residual). The dark-room video is an example of this. The goal is to extract out the sparse targets or, at least, the regions occupied by these objects. (See Fig. 3.) Moreover, in all these examples, it is valid to argue that the columns of the low-rank matrix lie in a low-dimensional subspace that is either fixed or slowly changing. This is true, for example, when the background consists of moving waters, or the background changes are due to illumination variations. These also result in global (non-sparse) changes. In special cases where foreground objects are also present, the video itself become “low-rank + sparse”. In such a scenario, the “sparse layer” that is extracted out will consist of the foreground object and the large magnitude part of the noise. Some examples are the curtain and lobby videos. The proposed ReLD algorithm works for these videos if VBM3D applied to the foreground layer video is able to separate out the foreground moving object(s) from the noise. B. Problem formulation Let mt denote the image at time t arranged as a 1D vector of length n. We consider denoising for videos in which each image can be split as mt = ℓt + st + wt where st is a sparse vector, ℓt ’s lie in a fixed or slowly changing low-dimensional subspace of Rn so that the matrix L := [ℓ1 , ℓ2 , . . . , ℓtmax ] is low-rank, and wt is the residual noise that satisfies kwt k∞ ≤ bw . We use Tt to denote the support set of st , i.e., Tt := support(st ). In the first example given above, the moving targets’ layer is st , the slowly-changing dark background is ℓt + wt . The layer of interest is st . In the second example, the slowly changing video is ℓt + wt , while the salt-and-pepper noise is st . The layer of interest is ℓt . In the third example, the slowly changing video is ℓt + w1,t with w1,t being the residual; and, as we explain next, with high probability (whp), white Gaussian noise can be split as st + w2,t with w2,t being bounded. In this case, wt = w1,t + w2,t . Let n denote a Gaussian noise vector in Rn with zero mean and covariance σ 2 I. Let β(b) := 2Φ(b) − 1 with Φ(z) being the cumulative distribution function (CDF) of the standard Gaussian distribution. Then, it is not hard to see that n can be split as n=s+w where w is bounded noise with kwk∞ ≤ b0 and  s is a sparse vector with support size |Tt | ≈ 1 − β bσ0 n whp. More precisely, with probability at least 1 − 2 exp(−2ǫ2 n),         b0 b0 − ǫ n ≤ |Tt | ≤ 1 − β + ǫ n. 1−β σ σ In words, whp, s is sparse with support size roughly (1 − β)n where β = β bσ0 . The above claim is a direct consequence of Hoeffding’s inequality for a sum of independent Bernoulli random variables1. II. R E P RO CS- BASED L AYERING D ENOISING (R E LD) We summarize the ReProCS-based Layering Denoising (ReLD) algorithm in Algorithm 1 and detail each step in Algorithm 3. The approach is explained below. Algorithm 1 Overall ReLD Algorithm 1) For t < t0 , initialization using PCP [22]. 2) For all t > t0 , implement an appropriately modified ReProCS algorithm a) Split the video frame mt into layers ℓ̂t and ŝt b) For every α frames, perform subspace update, i.e., update P̂t 3) Denoise using VBM3D Initialization. Take M0 = [m1 , m2 , · · · , mt0 ] as training data and use PCP [22] to separate it into a sparse matrix [ŝ1 , ŝ2 , · · · , ŝt0 ] and a low-rank matrix [ℓ̂1 , ℓ̂2 , · · · , ℓ̂t0 ]. Compute the top b% left singular vectors of [ℓ̂1 , ℓ̂2 , · · · , ℓ̂t0 ] and denote by P̂0 . Here b% left singular vectors of a matrix M refer to the left singular vectors of M whose corresponding 1 If p is the probability of zi = 1, then Hoeffding’s inequality says that: X Pr((p − ǫ)n ≤ zi ≤ (p + ǫ)n) ≥ 1 − 2 exp(−2ε2 n) i We apply it to the Bernoulli random variables zi ’s with zi defined as zi = 1 if {si 6= 0} and zi = 0 if {si = 0}. Clearly, Pr(zi = 0) = Pr(si = 0) = Pr(n2i ≤ b20 ) = Φ(b0 /σ) − Φ(−b0 /σ) = 2Φ(b0 /σ) − 1 = β(b0 /σ). 3 Algorithm 2 Details of each step of ReLD Parameters: We used α = 20, Kmin = 3, Kmax = 10, t0 = 50 in all experiments. 1) Initialization using PCP [22]: Compute (L̂0 , Ŝ0 ) ← PCP(M0 ) and compute [P̂0 , Σ̂0 ] ← approx-basis(L̂0 , 90%). The notation PCP(M ) means implementing the PCP algorithm on matrix M and P = approx-basis(M , b%) means that P is the b% left singular vectors’ matrix for M . Set r̂ ← rank(P̂0 ), σ̂min ← (Σ̂0 )r̂,r̂ , t̂0 = t0 , flag=detect 2) For all t > t0 , implement an appropriately modified ReProCS algorithm a) Split mt into layers ℓ̂t and ŝt : i) Compute yt ← Φt mt with Φt ← I − ′ P̂t−1 P̂t−1 ii) Compute ŝt as the solution of min kxk1 s.t.kyt − Φt xk2 ≤ ξ x with ξ = kΦt ℓ̂t−1 k p iii) T̂t ← Thresh(ŝt , ω) with ω = 3 kmt k2 /n. Here T ← Thresh(x, ω) means that T = {i : |(x)i | ≥ ω} ŝt,∗ ← LS(yt , Φt , T̂t ). Here x̂ ← LS(y, A, T ) means that x̂T = (A′T AT )−1 A′T y, which is least-squared estimate of x on T . iv) ℓ̂t ← mt − ŝt , ℓ̂t,∗ ← mt − ŝt,∗ b) Perform subspace update, i.e., update P̂t (see details in supplementary material) 3) Denoise using VBM3D: a) σ̂fg ← Std-est([ŝt , . . . , ŝt0 ]) σ̂bg ← Std-est([ℓ̂t , . . . , ℓ̂t0 ]). Here Std-est(M ) denotes estimating the standard deviation of noise from M : we first subtract column-wise mean from M and then compute the standard deviation by seeing it as a vector. b) Ŝdenoised ← VBM3D([ŝ1 , . . . , ŝtmax ], σ̂fg ) L̂denoised ← VBM3D([ℓ̂1 , . . . , ℓ̂tmax ], σ̂bg ). Here VBM3D(M , σ) implements the VBM3D algorithm on matrix M with input standard deviation σ. Output: Ŝ, Ŝdenoised , L̂denoised or Iˆdenoised = Ŝdenoised + L̂denoised based on applications singular values form the smallest set of singular values that contains at least b% of the total singular values’ energy. Splitting phase. Let P̂t−1 be the basis matrix (matrix with orthonormal columns) for the estimated subspace of ℓt−1 . For t ≥ t0 +1, we split mt into ŝt and ℓ̂t using prac-ReProCS [24]. To do this, we first project mt onto the subspace orthogonal to range(P̂t−1) to get the projected measurement vector, ′ )mt := Φt mt . yt := (I − P̂t−1 P̂t−1 (1) Observe that yt can be expressed as yt = Φt st + βt where βt := Φt (ℓt + wt ). (2) Because of the slow subspace change assumption, the projection nullifies most of the contribution of ℓt and hence βt is small noise. The problem of recovering st from yt becomes a traditional noisy sparse recovery/CS problem and one can use ℓ1 minimization or any of the greedy or iterative thresholding algorithms to solve it. We denote its solution by ŝt , and obtain ℓ̂t by simply subtracting ŝt from mt . Denoising phase. We perform VBM3D on Ŝ = [ŝ1 , . . . , ŝtmax ] and L̂ = [ℓ̂1 , . . . , ℓ̂tmax ] and obtain the denoised data Ŝdenoised and L̂denoised . Based on applications, we output different results. For example, in the low-light denoising case, our output is Ŝ since the goal is to extract out the sparse targets. In traditional denoising scenarios, the output can be L̂denoised or Iˆdenoised =Ŝdenoised +L̂denoised . This depends on whether the video contains only background or background and foreground. In practice, even for videos with only backgrounds, adding Ŝdenoised helps improve PSNR. Subspace Update phase (Optional). In long videos the span of the ℓt ’s will change with time. Hence one needs to update the subspace estimate P̂t every so often. This can be done efficiently using the projection-PCA algorithm from [24]. III. E XPERIMENTS Due to limited space, in this paper we only present a part of the experimental results. The complete presentation of experimental results are in the supplementary material. Video demos and all tables of peak signal to noise ratio (PSNR) comparison are also available at http://www.ece.iastate.edu/∼hanguo/denoise.html. Code for ReLD as well as for all the following experiments is also posted here. A. Removing Salt & Pepper noise First we compare the denoising performance on two dataset – Curtain and Lobby which are available at http://www.ece.iastate.edu/∼hanguo/denoise.html. The algorithms being compared are ReLD, SLMA [9], VBM3D and a neural network image denoising method, Multi Layer Perceptron (MLP) [33]. The codes for algorithms being compared are downloaded from the authors’ webpages. The available MLP code contains parameters that are trained solely from image patches that were corrupted with Gaussian noise with σ = 25 and hence the denoising performance is best with σ = 25 and deteriorates for other noise levels. The noise being added to the original image frames are Gaussian (σ = 25) plus 8% salt and pepper noise. In Fig.6 we show a plot of the framewise PSNRs for the lobby video, which shows that ReLD outperforms all other algorithms – the PSNR is the highest in all image frames. B. Removing Gaussian noise Next, with different levels of Gaussian noise, we compare performance of our proposed denoising framework with video layering performed using either ReProCS [24] (our proposed algorithm), or using the other robust PCA algorithms - PCP [22], NCRPCA [26], and GRASTA 4 σ 36 50 70 σ 50 70 34 32 PSNR 30 28 RELD: mixed noise VBM3D: mixed noise MLP: mixed noise SLMA: mixed noise 26 24 σ 50 70 22 20 18 σ 0 50 100 150 t 200 250 300 Fig. 1: Frame-wise PSNR for Lobby dataset with Gaussian(σ = 25) plus salt and pepper noise. 50 70 σ 50 70 σ 50 70 original noisy SLMA Dataset: waterfall ReLD VBM3D MLP PCP-LD 33.08(73.14) 27.99(24.14) 18.87(477.60) 32.93(195.77) 29.25(69.77) 24.42(21.01) 15.03(478.73) 29.17(197.94) NCRPCA-LD GRASTA-LD 30.48(128.35) 25.33(58.23) 27.97(133.53) 21.89(55.45) Dataset: fountain ReLD VBM3D MLP SLMA 30.53(15.82) 26.55(5.24) 18.53(109.79) 18.55(3.13 × 104 ) 27.53(15.03) 22.08(4.69) 14.85(107.52) 16.25(3.19 × 104 ) Dataset: escalator ReLD VBM3D MLP SLMA 27.84(16.03) 25.10(5.27) 18.83 (109.40) 17.98(3.21 × 104 ) 25.15(15.28) 20.20(4.72) 15.20(108.78) 15.90(3.18 × 104 ) Dataset: curtain ReLD VBM3D MLP SLMA 31.91(17.17) 30.29(4.42) 18.58(188.30) 19.12(7.86 × 104 ) 28.10(16.50) 26.15(3.85) 14.73(192.00) 16.68(8.30 × 104 ) Dataset: lobby ReLD VBM3D MLP SLMA 35.15(58.41) 29.23(19.35) 18.66(403.59 ) 18.21(3.99 × 105 ) 29.68(56.51) 24.90(17.00) 14.85(401.29) 16.82(4.09 × 105 ) TABLE I: PSNR (running time in seconds) for different denoising algorithms. The running time for MLP does not include training time. C. Denoising in Low-light Environment ReLD VBM3D MLP Fig. 2: Visual comparison of denoising performance for the Curtain dataset for very large Gaussian noise (σ = 70) In this part we show how ReLD can also be used for video enhancement of low-light videos, i.e., to see the target signal in the low-light environment. The video was taken in a dark environment where a barely visible person walked through the scene. The output we are using here for ReLD is Ŝ, which is the output of ReProCS. In Fig. 3 we see ReLD is able to enhance the visual quality – observing the walking person. Observe that Histogram-Equalization, which is a standard technique for enhancing low-light images, does not work for this video. [25]. We call the respective algorithms ReLD, PCP-LD, NCRPCA-LD, and GRASTA-LD for short. We test all these on the Waterfall dataset (downloaded from Youtube https://www.youtube.com/watch?v=UwSzu 0h7Bg). Besides these Laying-Denoising algorithms, we also compare with VBM3D and MLP. Since the video length was too long, img1 SLMA code failed for this video. The waterfall video is slow changing and hence is well modeled as being low-rank. We add i.i.d. Gaussian noise with different variances to the video. The video consists of img2 650 frames of size 108 × 108. The results are summarized original ReLD Hist-Eq in Table V. This table contains results on a smaller sized waterfall video. This is done because SLMA and PCP-LD Fig. 3: Ability of “seeing” in the dark for two sample frames. From become too slow for the full size video. Comparisons of left to right: orignal dark image, results using ReLD, and using the other algoithms on full size video are included in the Histogram-Equalization (Hist-Eq). supplementary material. ReLD has the best performance when the noise variance is large. We also show the time taken by each method in parantheses. As can be seen, ReProCS is IV. C ONCLUSION slower than VBM3D and GRASTA-LD, but has significantly In this paper we developed a denoising scheme, called better performance than both. ReLD which enhances the denoising performance of the stateIn Table V, we also provide comparisons on four more of-the-art algorithm VBM3D, and is able to achieve denoising videos - fountain, escalator, curtain and lobby (same videos as in a broad sense. Using ReProCS to split the video first in the salt and pepper noise experiment) with different levels of results in a clean low-rank layer since the large noise goes Gaussian noise. In Fig.4a we show sample visual comparisons to the sparse layer. The clean layer improves the “grouping” for the curtain video with noise standard deviation σ = 70. As accuracy in VBM3D. One drawback of our algorithm is that can be seen, ReLD is able to recover more details of the images VBM3D needs to be executed twice, once on each layer. As a result, the running time is at least doubled, but that also while other algorithms either fail or cause severe blurring. 5 results in significantly improved PSNRs especially for very large variance Gaussian noise. Moreover ReLD is still 6-10 times faster than SLMA and MLP, while also being better. It is also much faster than PCP-LD and NCRPCA-LD. 6 R EFERENCES [1] Han Guo and Namrata Vaswani, “Video denoising via online sparse and low-rank matrix decomposition,” in Statistical Signal Processing Workshop (SSP), 2016 IEEE. IEEE, 2016, pp. 1–5. [2] Antoni Buades, Bartomeu Coll, and Jean-Michel Morel, “Image denoising by non-local averaging,” in Acoustics, Speech, and Signal Processing, 2005. Proceedings.(ICASSP’05). IEEE International Conference on. IEEE, 2005, vol. 2, pp. 25–28. [3] Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian, “Image denoising by sparse 3-d transform-domain collaborative filtering,” Image Processing, IEEE Transactions on, vol. 16, no. 8, pp. 2080–2095, 2007. [4] Michael Elad and Michal Aharon, “Image denoising via sparse and redundant representations over learned dictionaries,” Image Processing, IEEE Transactions on, vol. 15, no. 12, pp. 3736–3745, 2006. [5] Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian, “Pointwise shape-adaptive dct for high-quality denoising and deblocking of grayscale and color images,” Image Processing, IEEE Transactions on, vol. 16, no. 5, pp. 1395–1411, 2007. [6] Julien Mairal, Francis Bach, Jean Ponce, Guillermo Sapiro, and Andrew Zisserman, “Non-local sparse models for image restoration,” in Computer Vision, 2009 IEEE 12th International Conference on. IEEE, 2009, pp. 2272–2279. [7] Kostadin Dabov, Alessandro Foi, and Karen Egiazarian, “Video denoising by sparse 3d transform-domain collaborative filtering,” 2007. [8] Hui Ji, Chaoqiang Liu, Zuowei Shen, and Yuhong Xu, “Robust video denoising using low rank matrix completion,” in Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, pp. 1791–1798. [9] Hui Ji, Sibin Huang, Zuowei Shen, and Yuhong Xu, “Robust video restoration by joint sparse and low rank matrix approximation,” SIAM Journal on Imaging Sciences, vol. 4, no. 4, pp. 1122–1142, 2011. [10] Ce Liu and William T Freeman, “A high-quality video denoising algorithm based on reliable motion estimation,” in Computer Vision– ECCV 2010, pp. 706–719. Springer, 2010. [11] Liwei Guo, Oscar C Au, Mengyao Ma, and Zhiqin Liang, “Temporal video denoising based on multihypothesis motion compensation,” Circuits and Systems for Video Technology, IEEE Transactions on, vol. 17, no. 10, pp. 1423–1429, 2007. [12] SM Mahbubur Rahman, M Omair Ahmad, and MNS Swamy, “Video denoising based on inter-frame statistical modeling of wavelet coefficients,” Circuits and Systems for Video Technology, IEEE Transactions on, vol. 17, no. 2, pp. 187–198, 2007. [13] H Rabbani and S Gazor, “Video denoising in three-dimensional complex wavelet domain using a doubly stochastic modelling,” IET image processing, vol. 6, no. 9, pp. 1262–1274, 2012. [14] Shigong Yu, M Omair Ahmad, and MNS Swamy, “Video denoising using motion compensated 3-d wavelet transform with integrated recursive temporal filtering,” Circuits and Systems for Video Technology, IEEE Transactions on, vol. 20, no. 6, pp. 780–791, 2010. [15] Michal Joachimiak, Dmytro Rusanovskyy, Miska M Hannuksela, and Moncef Gabbouj, “Multiview 3d video denoising in sliding 3d dct domain,” in Signal Processing Conference (EUSIPCO), 2012 Proceedings of the 20th European. IEEE, 2012, pp. 1109–1113. [16] Saiprasad Ravishankar and Yoram Bresler, “Learning sparsifying transforms,” Signal Processing, IEEE Transactions on, vol. 61, no. 5, pp. 1072–1086, 2013. [17] Saiprasad Ravishankar, Bihan Wen, and Yoram Bresler, “Online sparsifying transform learning - part 1: algorithms,” accepted to Signal Processing, IEEE Transactions on. [18] Saiprasad Ravishankar and Yoram Bresler, “Online sparsifying transform learning - part 2: convergence analysis,” accepted to Signal Processing, IEEE Transactions on. [19] Bihan Wen, Saiprasad Ravishankar, and Yoram Bresler, “Video denoising by online 3d sparsifying transform learning,” in Image Processing (ICIP), 2015 IEEE International Conference on. IEEE, 2015, pp. 118– 122. [20] Junyuan Xie, Linli Xu, and Enhong Chen, “Image denoising and inpainting with deep neural networks,” in Advances in Neural Information Processing Systems, 2012, pp. 341–349. [21] Forest Agostinelli, Michael R Anderson, and Honglak Lee, “Adaptive multi-column deep neural networks with application to robust image denoising,” in Advances in Neural Information Processing Systems, 2013, pp. 1493–1501. [22] E. J. Candès, X. Li, Y. Ma, and J. Wright, “Robust principal component analysis?,” Journal of ACM, vol. 58, no. 3, 2011. [23] C. Qiu, N. Vaswani, B. Lois, and L. Hogben, “Recursive robust pca or recursive sparse recovery in large but structured noise,” IEEE Trans. Info. Th., 2014. [24] Han Guo, Chenlu Qiu, and Namrata Vaswani, “An online algorithm for separating sparse and low-dimensional signal sequences from their sum,” Signal Processing, IEEE Transactions on, vol. 62, no. 16, pp. 4284–4297, 2014. [25] Jun He, Laura Balzano, and Arthur Szlam, “Incremental gradient on the grassmannian for online foreground and background separation in subsampled video,” in IEEE Conf. on Comp. Vis. Pat. Rec. (CVPR), 2012. [26] Praneeth Netrapalli, UN Niranjan, Sujay Sanghavi, Animashree Anandkumar, and Prateek Jain, “Non-convex robust pca,” in Advances in Neural Information Processing Systems, 2014, pp. 1107–1115. [27] F. De La Torre and M. J. Black, “A framework for robust subspace learning,” International Journal of Computer Vision, vol. 54, pp. 117– 142, 2003. [28] Clemens Hage and Martin Kleinsteuber, “Robust pca and subspace tracking from incomplete observations using l0-surrogates,” arXiv:1210.0805 [stat.ML], 2013. [29] A.E. Abdel-Hakim and M. El-Saban, “Frpca: Fast robust principal component analysis for online observations,” in Pattern Recognition (ICPR), 2012 21st International Conference on, 2012, pp. 413–416. [30] J. Feng, H. Xu, and S. Yan, “Online robust pca via stochastic optimization,” in Adv. Neural Info. Proc. Sys. (NIPS), 2013. [31] J. Feng, H. Xu, S. Mannor, and S. Yan, “Online pca for contaminated data,” in Adv. Neural Info. Proc. Sys. (NIPS), 2013. [32] Morteza Mardani, Gonzalo Mateos, and G Giannakis, “Dynamic anomalography: Tracking network anomalies via sparsity and low rank,” J. Sel. Topics in Sig. Proc., Feb 2013. [33] Harold C Burger, Christian J Schuler, and Stefan Harmeling, “Image denoising: Can plain neural networks compete with bm3d?,” in Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on. IEEE, 2012, pp. 2392–2399. 7 Supplementary Material C OMPLETE A LGORITHM Detailed algorithm of ReLD is summarized in Algorithm 3. Algorithm 3 Details of each step of ReLD Parameters: We used α = 20, Kmin = 3, Kmax = 10, t0 = 50 in all experiments. 1) Initialization using PCP: Compute (L̂0 , Ŝ0 ) ← PCP(M0 ) and compute [P̂0 , Σ̂0 ] ← approx-basis(L̂0 , 90%). The notation PCP(M ) means implementing the PCP algorithm on matrix M and P = approx-basis(M , b%) means that P is the b% left singular vectors’ matrix for M . Set r̂ ← rank(P̂0 ), σ̂min ← (Σ̂0 )r̂,r̂ , t̂0 = t0 , flag=detect 2) For all t > t0 , implement an appropriately modified ReProCS algorithm a) Split mt into layers ℓ̂t and ŝt : ′ i) Compute yt ← Φt mt with Φt ← I − P̂t−1 P̂t−1 ii) Compute ŝt as the solution of min kxk1 s.t.kyt − Φt xk2 ≤ ξ x with ξ = kΦt ℓ̂t−1 k p iii) T̂t ← Thresh(ŝt , ω) with ω = 3 kmt k2 /n. Here T ← Thresh(x, ω) means that T = {i : |(x)i | ≥ ω} ŝt,∗ ← LS(yt , Φt , T̂t ). Here x̂ ← LS(y, A, T ) means that x̂T = (A′T AT )−1 A′T y, which is least-squared estimate of x on T . iv) ℓ̂t ← mt − ŝt , ℓ̂t,∗ ← mt − ŝt,∗ b) Perform subspace update, i.e., update P̂t : i) If flag = detect and mod(t − t̂j + 1, α) = 0, ′ )[ℓ̂t−α+1,∗ , . . . ℓ̂t,∗ ] and check if any singular values are above A) compute the SVD of √1α (I − P̂(j−1) P̂(j−1) σ̂min B) if the above number is more than zero then set flag ← pPCA, increment j ← j + 1, set t̂j ← t − α + 1, reset k ← 1 Else P̂t ← P̂t−1 . ii) If flag = pPCA and mod(t − t̂j + 1, α) = 0, ′ )[ℓ̂t−α+1,∗ , . . . ℓ̂t,∗ ], A) compute the SVD of √1α (I − P̂j−1 P̂(j−1) B) let P̂j,new,k retain all its left singular vectors with singular values above σ̂min or all α/3 top left singular vectors whichever is smaller, C) update P̂t ← [P̂(j−1) P̂j,new,k ], increment k ← k + 1 D) If k ≥ Kmin and k Pt ′ ′ t−α+1 (P̂j,new,i−1 P̂j,new,i−1 −P̂j,new,i P̂j,new,i )ℓ̂t,∗ k2 Pt ′ k t−α+1 P̂j,new,i−1 P̂j,new,i−1 ℓ̂t,∗ k2 < 0.01 for i = k − 2, k − 1, k; or k = Kmax , then K ← k, P̂(j) ← [P̂(j−1) P̂j,new,K ] and reset flag ← detect. Else P̂t ← P̂t−1 . 3) Denoise using VBM3D: a) σ̂fg ← Std-est([ŝt , . . . , ŝt0 ]) σ̂bg ← Std-est([ℓ̂t , . . . , ℓ̂t0 ]). Here Std-est(M ) denotes estimating the standard deviation of noise from M : we first subtract column-wise mean from M and then compute the standard deviation by seeing it as a vector. b) Ŝdenoised ← VBM3D([ŝ1 , . . . , ŝtmax ], σ̂fg ) L̂denoised ← VBM3D([ℓ̂1 , . . . , ℓ̂tmax ], σ̂bg ). Here VBM3D(M , σ) implements the VBM3D algorithm on matrix M with input standard deviation σ. Output: Ŝ, Ŝdenoised , L̂denoised or Iˆdenoised = Ŝdenoised + L̂denoised based on applications C OMPLETE E XPERIMENTS First, we compare the performance of our propsed denoising framework with video layering performed using eiher ReProCS (our proposed algorithm), or using the other robust PCA agorithms - PCP, NCRPCA, and GRASTA. We call the respective algorithms ReLD, PCP-LD, NCRPCA-LD, and GRASTA-LD for short. We test the algorithms on the Waterfall dataset (downloaded from Youtube https://www.youtube.com/watch?v=UwSzu 0h7Bg). Besides these Laying-Denoing algorithms, we also compare with VBM3D and a neural network image denoising method, Multi Layer Perceptron (MLP). The codes for algorithms being compared are downloaded from the authors’ webpages. The available MLP code contains parameters that are 8 σ 25 30 50 70 35.00, 34.51, 33.08, 29.25, ReLD 32.78 (73.54) 32.68 (73.33) 32.27 (73.14) 31.79 (69.77) 34.92, 34.42, 32.93, 29.17, PCP-LD 32.84 (198.87) 32.60 (185.47) 31.65 (195.77) 30.67 (197.94) NCRPCA-LD 33.34, 31.98 (101.78) 32.53, 31.56 (106.30) 30.48, 30.09 (128.35) 27.97, 29.63 (133.53) GRASTA-LD 30.45, 28.11 (59.43) 29.40, 26.89 (58.76) 25.33, 23.97 (58.23) 21.89, 21.81 (55.45) VBM3D 32.02 (24.83) 30.96 (23.96) 27.99 (24.14) 24.42 (21.01) MLP 28.26 (477.22) 26.96 (474.26) 18.87 (477.60) 15.03 (478.73) TABLE II: Comparison of denoising performance (PSNR) on the Waterfall dataset (length 650 and the images are of size 108 × 192): data shown in format of PSNR using Iˆdenoised , PSNR using L̂denoised , (and runing time in second). σ 25 30 50 70 33.84, 33.01, 30.48, 27.39, ReLD 29.98 (335.97) 29.79 (338.51) 28.86 (333.26) 27.77 (321.71) 33.38, 32.49, 29.79, 26.80, PCP-LD 29.17 (413.45) 28.72 (406.45) 26.83 (399.09) 25.06 (386.60) NCRPCA-LD 28.99, 27.54 (507.03) 27.63, 27.63 (510.39) 23.74, 23.29 (544.60) 20.95, 20.88 (589.22) GRASTA-LD 29.37, 16.12 (435.54) 28.16, 12.53 (405.53) 22.17, 11.27 (417.50) 13.92, 9.78 (411.87) VBM3D 33.67 (110.89) 32.75 (110.92) 30.18 (110.83) 26.75 (105.80) 31.11 29.18 19.00 15.08 MLP (1.38 × 103 ) (1.38 × 103 ) (1.39 × 103 ) (1.40 × 103 ) TABLE III: Comparison of denoising performance (PSNR) on the Waterfall dataset (length 100 and the images are of size 540 × 960): data shown in format of PSNR using Iˆdenoised , PSNR using L̂denoised , (and runing time in second). σ 25 30 50 70 35.13, 34.14, 31.10, 27.71, ReLD 29.79 (2.83 × 103 ) 29.61 (2.34 × 103 ) 28.72 (2.31 × 103 ) 27.66 (2.38 × 103 ) 34.52, 33.45, 30.31, 27.08, PCP-LD 29.03 (6.31 × 103 ) 28.59 (5.50 × 103 ) 26.75 (4.89 × 103 ) 25.00 (4.82 × 103 ) 30.69, 29.22, 25.18, 22.23, NCRPCA-LD 28.50 (2.88 × 103 ) 27.62 (2.38 × 103 ) 24.58 (2.45 × 103 ) 22.09 (2.48 × 103 ) GRASTA-LD 29.94, 10.72 (1.83 × 103 ) 28.46, 10.42 (1.88 × 103 ) 22.27, 8.69 (1.98 × 103 ) 13.59, 8.33 (1.98 × 103 ) VBM3D 36.04 (533) 35.18 (550) 32.55 (536) 28.45 (608) 33.73 30.94 19.06 15.09 MLP (5.56 × 103 ) (5.49 × 103 ) (5.50 × 103 ) (5.55 × 103 ) TABLE IV: Comparison of denoising performance (PSNR) on the Waterfall dataset (length 100 and the images are of size 1080 × 1920): data shown in format of PSNR using Iˆdenoised , PSNR using L̂denoised , (and runing time in second). σ 25 30 50 70 σ 25 30 50 70 ReLD 32.67(16.70) 32.25(15.84) 30.53(15.82) 27.53(15.03) ReLD 35.47(16.78) 34.58(17.35) 31.91(17.17) 28.10(16.50) Dataset: fountain VBM3D MLP 31.18(5.44) 26.86(105.64) 30.26(5.17) 25.67(107.41) 26.55(5.24) 18.53(109.79) 22.08(4.69) 14.85(107.52) Dataset: curtain VBM3D MLP 34.60(4.15) 31.14(189.14) 33.59(4.37) 28.90(191.14) 30.29(4.42) 18.58(188.30) 26.15(3.85) 14.73(192.00) SLMA 22.93(3.05 × 104 ) 21.85(3.06 × 104 ) 18.55(3.13 × 104 ) 16.25(3.19 × 104 ) ReLD 31.01(16.64) 30.27(16.45) 27.84(16.03) 25.15(15.28) SLMA 23.28(7.75 × 104 ) 22.74(9.05 × 104 ) 19.12(7.86 × 104 ) 16.68(8.30 × 104 ) ReLD 39.78(57.96) 38.76(57.99) 35.15(58.41) 29.68(56.51) Dataset: escalator VBM3D MLP 30.32(5.34) 25.53(107.51) 29.29(5.38) 24.54(108.65) 25.10(5.27) 18.83 (109.40) 20.20(4.72) 15.20(108.78) Dataset: lobby VBM3D MLP 35.00(19.57) 29.22(384.11) 33.64(19.09) 27.72(395.67) 29.23(19.35) 18.66(403.59 ) 24.90(17.00) 14.85(401.29) SLMA 21.17(3.09 × 104 ) 20.49(3.15 × 104 ) 17.98(3.21 × 104 ) 15.90(3.18 × 104 ) SLMA 23.43(3.75 × 105 ) 21.15(3.82 × 105 ) 18.21(3.99 × 105 ) 16.82(4.09 × 105 ) TABLE V: PSNR (and running time in second) for different denoising algorithms on datasets of fountain, escalator, curtain and lobby. original noisy SLMA original noisy SLMA ReLD VBM3D MLP ReLD VBM3D MLP (a) Curtain (b) Lobby Fig. 4: Visual comparison of denoising performance for Curtain and Lobby dataset for very large Gaussian noise (σ = 70) 36 32 38 34 30 36 32 28 34 30 26 32 28 30 RELD: Gaussian (σ=25) VBM3D: Gaussian (σ=25) MLP: Gaussian (σ=25) SLMA: Gaussian (σ=25) 28 26 PSNR 40 PSNR PSNR 9 RELD: mixed noise VBM3D: mixed noise MLP: mixed noise SLMA: mixed noise 26 24 24 20 22 18 24 20 16 22 18 0 50 100 150 t 200 250 300 0 50 100 RELD: Gaussian (σ=70) VBM3D: Gaussian (σ=70) MLP: Gaussian (σ=70) SLMA: Gaussian (σ=70) 22 150 t 200 250 14 300 0 50 100 150 t 200 250 300 (a) (b) (c) Fig. 5: Frame-wise PSNR for Curtain dataset with different noise level: (a) Gaussian noise with σ = 25, (b) Gaussian noise (σ = 25) plus salt and pepper noise, (c) Gaussian noise with σ = 70. 45 RELD: Gaussian (σ=25) VBM3D: Gaussian (σ=25) MLP: Gaussian (σ=25) SLMA: Gaussian (σ=25) 40 36 32 34 30 32 28 30 26 28 PSNR PSNR PSNR 35 RELD: mixed noise VBM3D: mixed noise MLP: mixed noise SLMA: mixed noise 26 30 24 0 50 100 150 t 200 250 300 18 RELD: Gaussian (σ=70) VBM3D: Gaussian (σ=70) MLP: Gaussian (σ=70) SLMA: Gaussian (σ=70) 18 20 20 22 20 22 25 24 16 0 50 100 150 t 200 250 300 14 0 50 100 150 t 200 250 (a) (b) (c) Fig. 6: Frame-wise PSNR for Lobby dataset with different noise level: (a) Gaussian noise with σ = 25, (b) Gaussian noise (σ = 25) plus salt and pepper noise, (c) Gaussian noise with σ = 70. trained solely from image patches that were corrupted with Gaussian noise with σ = 25 and hence the denoising performance is best with σ = 25 and deteriorates for other noise levels. The video is a background scene without foreground, and hence has no sparse component. We add i.i.d. Gaussian noise with different variance onto the video. Since there is no foreground in the video, the splitting phase can generate a sparse layer which basically consists of the large-magnitude part of the Gaussian noise. The denoising operation followed on such layer does not have the problem of degrading the video quality since this layer is foreground-free. The video consists of 650 frames and the images are of size 1080 × 1920. To speed up the algorithms, we first test on the under-sampled data which has image size of 108 × 192. As can be seen from TABLE II, ReLD has the best denoising performance. We also compare PSNRs using L̂denoised and Iˆdenoised , and we find that using L̂denoised shows an advantage when the noise variance is very large. We then test the algorithms on larger image sizes. To avoid out-of-memory in computation, we only use 100 frames of data. In TABLE III and TABLE IV we summarize the result for images of size 540 × 960 and 1080 × 1920 (original), respectively. We notice that, on very large data set (TABLE IV), using VBM3D without video-layering algorithms achieves the best denoising performance. This may due to the fact that with larger image size, VBM3D has better chance to find similar image blocks. Next we thoroughly compare the denoising performance on two more dataset – curtain and lobby which are available at http://www.ece.iastate.edu/∼hanguo/denoise.html. The algorithms being compared are ReLD, VBM3D, MLP and SLMA. The noise being added to the original image frames are Gaussian (σ = 25), Gaussian (σ = 25) plus salt and pepper noisy, and Gaussian (σ = 70). The input σ for all algorithms is estimated from the noisy data rather then given the true value. We compute the frame-wise PSNRs (using Iˆdenoised ) for each case in Fig. 5 and Fig. 6 and show sample visual comparisons in Fig. 4a and Fig. 4b. We can see in Fig. 5 and Fig. 6 that ReLD outperforms all other algorithms in all three noise level – the PSNR is the highest in almost all image frames. Visually, ReLD is able to recover more details of the images while other algorithms either fail or cause severe blurring effect. We test the algorithms on two more datasets (the fountain dataset and escalator dataset). The noise being added to the original video is Gaussian, with standard deviation σ increases from 25 to 70. We present the PSNRs in Table V. 300
1cs.CV
Energy Efficient and Throughput Optimal CSMA Scheme Ali Maatouk* , Mohamad Assaad* , and Anthony Ephremides† arXiv:1712.03063v1 [cs.IT] 8 Dec 2017 * TCL Chair on 5G, Laboratoire des Signaux et Systèmes, CentraleSupélec, Gif-sur-Yvette, France † ECE Dept., University of Maryland, College Park, MD 20742 Abstract—Carrier Sense Multiple Access (CSMA) is widely used as a Medium Access Control (MAC) in wireless networks thanks to its simplicity and distributive nature. This motivated researchers to find CSMA schemes that achieves throughput optimality. In 2008, it has been shown that even simple CSMAtype algorithms is able to achieve optimality in terms of throughput and has been given the name ”adaptive” CSMA. Lately, new technologies emerged where prolonged battery life is crucial such as environment and industrial monitoring. This inspired the foundation of new CSMA based MAC protocols where nodes are allowed to transition into sleep mode e.g. IEEE 802.15.4 MAC. However, throughput optimality of these protocols was not established. This paper therefore aims to find a new CSMA scheme that combines both throughput optimality and energy efficiency by adapting to the throughput and power consumption needs of each node. This is done by smartly controlling operational parameters such as back-off and sleeping timers. The main advantages about this scheme is being asynchronous, completely distributed and its ability to adapt to different power consumption profiles required by each node. We present numerical results that show the gain in terms of energy efficiency compared to the conventional adaptive CSMA scheme. Index Terms—CSMA, Throughput Optimality, IoT, Wireless MAC. I. I NTRODUCTION T optimality for network scheduling, which is by definition the ability to withstand any arrival rate inside the capacity region of the network [1], has been thoroughly investigated in the litterature. Tassiulas and Ephremides introduced in their seminal paper [2] the maximal-weight scheduling (MWS), a throughput optimal scheduling scheme. This scheme is however centralized and requires finding the maximum weighted independent sets, a well known NP-Complete problem. In the aim of overcoming the complexity, a surge of papers have been published. The efforts were divided in two classes: the first one aimed to propose low complexity algorithms for certain interference models (e.g. [3] and the references therein) while the other focused on proposing low complexity algorithms that guarantee a portion of capacity region [4] or a worst-case performance [5]. These approaches suffer from message passing, which can create a lot of congestion especially in the case of high nodes density. On the other hand, another class of simple and distributed algorithms is the Carrier Sense Multiple Access (CSMA), HROUGHPUT which is one of the most popular random access protocols. CSMA is referred to as the class of algorithms in which a node senses the medium and transmit a packet only if the medium is sensed idle. The reason for its widespread is due to the fact that it is simple and completely distributed [5]. Classical CSMA such as the one adopted in IEEE 802.11 suffers however from throughput sub-optimality. This issue has been solved in a series of work where it was shown that throughput optimality can be achieved using fully distributed algorithms (e.g. [1][6]). For instance, it was shown in [1] that adaptive CSMA maximizes the throughput of the system for a general interference model. Both classical and adaptive CSMA suffer however from high energy consumption. When in back-off stages, continuous sensing of the environment by each node is required to spot any conflicting transmissions from its neighbors which would result in an inevitable power consumption [1]. With long battery life being a strict requirement for emerging technologies, new MAC protocols were therefore proposed. In particular, low energy consumption has been the main focus in the design of MAC protocols in Wireless Sensor Networks (WSN). These protocols rely on the idea of duty cycling in which nodes regularly sleep. Sensor-MAC is one of the most famous low-energy MAC protocols, which is based on sleep schedules that are managed by virtual clusters [7]. Numerous other protocols were also introduced to further enhance performance [8][9]. These protocols however suffer from message passing in order to maintain synchronization. Another procedure available in the literature is to make the nodes wake up periodically with an offset between them while compensating for the clock drift through several proposed methods [10]. Since the throughput optimality of these proposed methods was not established, we seek to propose a new distributed CSMA scheme that does not involve any message passing and achieves throughput optimality while reducing power consumption. In the aim of reducing power consumption, our scheme involves giving each node the freedom to transition between AWAKE and SLEEP states. Conventional duty cycling proposed by the above methods will however not fit our case due to a lack of adaptation of the duty cycle period. We argue that by smartly controlling both the sleeping and back-off duration of each node, power consumption can be reduced while still maintaining the ability to withstand any feasible arrival rate. This of course drastically changes the CSMA model which requires new analysis as one will see in the sequel. The result will be a fully distributed algorithm in which time is not slotted (hence no synchronization required) and does not suffer from any message passing or clock drift issues. A new parameter will reveal itself which is assigned to each node based on a satisfactory power-delay tradeoff. The Paper is organized as follows: Section II describes the model used and present the proposed CSMA scheme. The Markov Chain and optimality analysis is provided in section III. Section IV provides numerical results that corroborate the theoretical assumptions while Section V concludes the paper. II. S YSTEM M ODEL AND P ROPOSED A LGORITHM A. Interference Model We consider a wireless network composed of multiple links (i.e. multiple transmitters and receivers pairs) using the same bandwidth. The interference between the links is modeled by a conflict graph model, which is the most common model used in the literature and more precisely in the area of random access and CSMA based modeling. Assuming that we have K links in the network, we associate a corresponding conflict graph G={V, E}, where V is the set of vertices of the graph which denotes the links of the network and E being the set of edges. Two vertices have an edge between them iff these two links cannot transmit at the same time. Clearly, not all links necessarily have the ability to transmit at the same time hence we define the notion of independent set of this conflict graph. We denote the independent set of this graph by xi ∈ {0, 1}K where xik = 1 if link k is active in this set. In the aim of reducing power consumption, we give the ability to each node to choose either to be awake or asleep. In this context, we have 2K possible awake configurations for the links. For each configuration j, there exist a unique conflict graph Gj ={Vj , Ej }. We define for each of these graphs, the set of independent sets Ij ={xi : the network is in awake configuration j}. B. Proposed Scheme The words nodes, links and users are used interchangeably throughout the paper. In the following, we adopt the standard CSMA assumptions [1]: • Sensing is considered instantaneous, there is no sensing delay • The problem of Hidden Nodes does not exist These two assumptions make the model easier to work with and mathematically tractable. In addition to that, we assume that the links are always back-logged. Taking these assumptions into consideration, we can now state the way our mechanism works. The node can be in one of the following states: • SLEEP state: In this case, power consumption is minor and no sensing of the environment takes place • AWAKE state: The adaptive CSMA sensing and back-off mechanisms take place The decision to either Wake-up/Sleep is dictated by an appropriate timer. When a node decides to sleep, it picks an exponentially distributed wake-up time with mean 1/Wk after which it wakes up. Once the node is awake, it picks an exponentially chosen sleep timer with mean 1/Sk after which it goes back to sleep. The motivation behind choosing exponentially distributed timers is the memory-less property that enables us to pursue a MC based analysis. When the node is awake, the adaptive CSMA scheme takes place: • • • • • An exponentially distributed back-off timer with mean 1/Rk is picked Continuous sensing of the channel takes place and whenever the channel is sensed idle, the back-off timer runs otherwise it is frozen. In both cases, the sleep timer keeps running Once the back-off timer runs out, the channel is captured by the node and the sleep timer is hence frozen Packets transmission time is assumed to be exponentially distributed with an average channel holding time 1/Hk After successful transmission, the sleep-timer is resumed and another back-off timer is picked for the next transmission III. MC BASED O PTIMALITY A NALYSIS A. Proposed Markov Chain Due to the introduction of a new degree of freedom for each node, the MC proposed in [1] would not fit our analysis. The description of our scheme can be modeled by a 2D CTMC where each state in the chain is made of two components (aj , xi ): Configuration State aj : A K-tuplet of binary variables ak that indicates if the node k is awake (binary value 1) or asleep (binary value 0). Transmission State xi : A K-tuplet of variables xk that indicates if the node k is transmitting or not. We assume that a node transmit just one packet when it acquires the channel hence xik is a binary variable. To note that if xik = 1, this necessarily means that the associated configuration state with this transmission state must have ajk = 1 since a node cannot transmit unless it is awake. Proposition 1. This CTMC is irreducible and time reversible that is fully characterized by the two parameters rk = log(Rk /Hk ) and ρk = log(Wk /Sk ) called transmission aggressiveness and waking-up aggressiveness respectively. This chain admits the following distribution as stationary: exp( j i π(a , x ; r, ρ) = K P k=1 ajk ρk )exp( K P k=1 C(r, ρ) xik rk ) (1) Fig. 1: Time-line of the proposed CSMA scheme Where C(r, ρ) is a normalization constant and is equal to: K C(r, ρ) = 2 X exp( j=1 K X ajk ρk ) |Ij | X i=1 k=1 exp( K X xik rk ) k=1 Proof: It is sufficient to show that the preceding distribution verifies the detailed balance equations. Step 1: Consider the following two states (aj , xi ) and (aj + ek , xi ) where ajk = 0 and ek represents the canonical vector in RK . It can be verified that: π(aj + ek , xi ; r, ρ) = exp(ρk ) π(aj , xi ; r, ρ) Step 2: Consider the two states (aj , xi ) and (aj , xi + ek ) where ajk = 1 (the node has to be awake to be able to transmit), xik = 0 and xik0 = 0 ∀k 0 ∈ N eighbor(k). It can also be verified that: π(aj , xi + ek ; r, ρ) = exp(rk ) π(aj , xi ; r, ρ) To further clarify the model, a simple example of two conflicting links is taken in Fig. 2. The dashed lines partition the chain in 4 regions where in each, the states share the same configuration state. One can see how our chain is much more general by observing that the partition where aj = (1, . . . , 1) is nothing but the MC in [4]. The throughput achieved by user k using this scheme is simply the amount of time the chain is in a state where node k is both awake and transmitting. This can be formulated in the following way: K sk (r, ρ) = 2 X j=1 ajk |Ij | X xik π(aj , xi ; r, ρ) (2) i=1 Remark 1. One can see that our framework provides more degrees of freedom as compared to the adaptive CSMA since new parameters, for instance 1/Wk and 1/Sk , are introduced. In the adaptive CSMA, the overall optimal transmission aggressiveness (and therefore the optimal back-off timer mean) is just dictated by the network. This might lead to relatively large back-off timers which would result in an inevitable power loss due to continuous sensing of the environment. The motivation behind the utility of these new degree of freedom is the fact that nodes that sleep tend to be more aggressive on the channel once they are awake to compensate for the time spent in Sleep mode. By doing so, back-off timers are drastically shrinked which reduces power consumption. One can see in Fig. 1 an example of the case of two nodes where Node 1 is highly constrained by its battery life unlike Node 2. Node 1 therefore eventually end up in sleeping mode for large duration of time while being extremely aggressive on the network (short back-off timer) once it transitions to Awake state. On the other hand, Node 2 barely sleeps and is moderately aggressive on the network. Our aim is therefore to develop a well designed sleep-wake up mechanism that would still maintain throughput optimality while dealing with this power consumption issue and this is what we are going to tackle in the following sections. B. Optimality Analysis We consider that that the arrival rate is normalized to the capacity hence λk ≤ 1. In this case, λk can be seen as the portion of time the chain should be in a state where user k is both awake and transmitting. Hence a rate is said to be feasible if it can be written in function of a joint probability distribution over our MC space P where: K λk = |Ij | 2 X X pij ajk xik (3) j=1 i=1 and P verifies: K |Ij | 2 X X pij = 1 j=1 i=1 The rate region is then defined by: K C = {λ ∈ R where P verifies: K : λk = |Ij | 2 X X j=1 i=1   pij > 0 j| 2K |I P P  pij = 1  pij ajk xik } j=1 i=1 For any arrival rate λ ∈ C, our goal would therefore be to calibrate the parameters (r, ρ) in a way to make the MC stationary distribution as close as possible to P . This is equivalent to reducing the distance between these two Fig. 2: Two conflicting nodes MC example distributions. Different measures between distributions exist but in our paper we consider the Kullback-Leibler divergence. This approach was firstly introduced by the authors in [1] to prove the optimality of the adaptive CSMA. For our case, due to the introduction of new parameters, the subsequent analysis is different and the resulting problem is not necessarily convex which requires further investigation. Our optimization problem is the following: |Ij | 2K X X pij minimize D(pkπ(r, ρ)) = pij log( ) j r,ρ π(a , xi ; r, ρ) j=1 i=1 The objective function can be reduced through several steps: K 2K |Ij | |Ij | 2 X X XX pij )= pij log(pij ) pij log( j i π(a , x ; r, ρ) j=1 i=1 j=1 i=1 K − |Ij | 2 X X pij log(π(aj , xi ; r, ρ)) = |Ij | 2 X X K pij ( j=1 i=1 K X xik rk + k=1 K X k=1 pij log(pij ) ajk ρk − log(C(r, ρ))) The first term being independent of (r, ρ), the problem can be reformulated as minimizing the following function: F (r, ρ) = − |Ij | K X 2K X X k=1 j=1 i=1 2K X + log( j=1 pij xik rk − exp( K X k=1 ajk ρk ) |Ij | K X 2K X X pij ajk ρk k=1 j=1 i=1 |Ij | X i=1 pij xik rk = |Ij | 2 X K X X pij ajk xik rk = k=1 j=1 i=1 k=1 j=1 i=1 exp( K X k=1 xik rk )) K X λk rk k=1 For the second term we will define a new variable K |Ij | K X 2 X X K pij ajk ρk k=1 j=1 i=1 = K X 2 X ajk ρk k=1 j=1 where: |Ij | X pij = i=1 fk = ajk αj = E(ak ) and K X fk ρk k=1 K 2 X αj = j=1 j=1 i=1 |Ij | 2 X X K K |Ij | K X 2 X X K j=1 i=1 − The first term can be further reduced to an easier form since xik cannot be equal to 1 unless the node k is actually awake. So multiplying by the binary variable ajk does not change the value of this term: |Ij | X pij i=1 αj represents the portion of time required for the network to be at configuration state aj . fk can be seen as the portion of time that the node k is awake as dictated by the arrival rate λk . At a first glance, our problem as formulated is not necessarily convex in (r, ρ). However, this difficulty can be alleviated by introducing a new variable tji in the following manner: minimize r,ρ,T − K X k=1 subject to tji = λk rk − K X k=1 K X K fk ρk + log( j=1 i=1 k=1 ajk ρk + K X |Ij | 2 X X xik rk k=1 j = 1, . . . , 2K i = 1, . . . , |Ij |. exp(tji )) The objective function is now made of convex/linear functions in (r, ρ, t) since the log-sum-exponential function is a well known convex function [11]. On top of that, our equality constraints are simply linear hence our transformed OP is indeed convex. We can now formulate the Lagrangian and state the necessary and sufficient conditions for optimality. K L(r, ρ, T , µ) = − K X k=1 |Ij | 2 X X µji (−tji + j=1 i=1 λk rk − K X ajk ρk + k=1 K X K X xik rk ) k=1 |Ij | 2K X X fk ρk + log( exp(tji )) j=1 i=1 k=1 Where µji represents the dual variable corresponding to the {ji} constraint. At the optimal point, the following conditions are met: exp(t∗ji ) ∂L(r ∗ , ρ∗ , T ∗ , µ∗ ) =0 (4) = −µ∗ji + ∂tji C(r ∗ , ρ∗ ) K K k=1 k=1 X j X ∂L(r ∗ , ρ∗ , T ∗ , µ∗ ) = −t∗ji + ak ρ∗k + xik rk∗ = 0 (5) ∂µji Combinining the above two conditions, we can conclude that: exp( µ∗ji K P k=1 = ajk ρ∗k )exp( K P k=1 C(r ∗ , ρ∗ ) xik rk∗ ) = π(aj , xi ; r ∗ , ρ∗ ) which is nothing but the stationary distribution of our chain. Furthermore: K |Ij | 2 X X ∂L(r ∗ , ρ∗ , T ∗ , µ∗ ) = −fk + µ∗ji ajk = 0 ∂ρk j=1 i=1 (6) Using our previous conclusion on µ∗ji , (6) will lead to: K −fk + 2 X ajk j=1 |Ij | X π(aj , xi ; r ∗ , ρ∗ ) = 0 i=1 K −fk + 2 X ajk αˆj = 0 and αˆj = j=1 |Ij | X π(aj , xi ; r ∗ , ρ∗ ) i=1 αˆj is interpreted as the amount of time the chain is in configuration state aj . Which means that at the optimal point, . P2K fˆk = j=1 ajk αˆj = fk or in other words, the node k is awake just as needed to be. Lastly: K |Ij | 2 X X ∂L(r ∗ , ρ∗ , T ∗ , µ∗ ) = −λk + µ∗ji xik = 0 ∂rk j=1 i=1 (7) As it has been used before, multiplying by the binary variable ajk does not change this value due to the fact a node cannot transmit if not awake. Also using the previous conclusions concerning µ∗ji , (7) becomes: K −λk + 2 X j=1 ajk |Ij | X i=1 xik π(aj , xi ; r ∗ , ρ∗ ) = 0 Hence at the optimal point we have sk (r ∗ , ρ∗ ) = λk which ensures rate stability of the queues. Consequently, our OP problem can be solved distributively using a simple gradient descent method by each user monitoring its own service rate and awake time. C. Discussions and Parameter Birth Now the question to answer is: what does the distribution P truly dictates concerning the configuration state? For any feasible λ, it is clear from the expression of λk that the arrival rate only dictates the portion of time when user k has to be both awake and transmitting. The other states where the user is either awake or in a back-off stage are irrelevant to the arrival rate so the portion of time in which the chain is in those states presents for us a degree of freedom we can take advantage of. To see that more clearly, we know that the minimal value of fk is λk . The only way to achieve this is if the node wakes up and instantly acquire the channel. Consequently for this case, the value of rk tends to +∞. In other words, the user is really aggressive to get the channel as soon as he wakes up. The maximal value for fk is 1, in other words the node is always awake. Consequently in this case, ρk −→ +∞. The special case when fk −→ 1 ∀k, we will have the configuration state aj = (1, . . . , 1) almost all the time and we are back to the adaptive CSMA scheme in [1]. In order to mitigate these extreme cases on ρk and rk , we impose that λk < fk < 1 ∀k. In overall we can write fk in the following manner: fk = λk + ωk where 0 < ωk < 1 − λk . This ωk is the degree of freedom (DoF) previously mentioned. When ωk is really small, we are forcing the user to wake up just as necessary, so we expect him to be extremely aggressive on the channel (small back-off timer) and therefore power consumption is reduced. However due to the frequent long sleep, delays are to be anticipated which would manifest in long queues lengths. On the other extreme, if ωk is close to its maximal value, the user is almost continuously active so less delays would be expected but a higher power consumption. In summary, ωk is a power-delay trade off parameter that is assigned to each node depending on the desired trade-off. The beauty of this parameter comes from the fact that IoT applications present a mixture of both delay-sensitive and delay-tolerant applications. This can be exploited by simply calibrating the parameter assignment accordingly, the following table gives a few examples: IoT Applications Category Delay Emergencies Highly Sensitive E-Health Med. Sensitivity Environment Monitors Highly Tolerant TABLE I: Parameter Assignment Parameter High Medium Low This scheme would only be plausible if the optimum is always attained for a finite (r ∗ , ρ∗ ) and that is what the following theorem addresses. Theorem 2. If λ is strictly feasible and if λk < fk < 1 ∀k, then the optima is attained for a finite (r ∗ , ρ∗ ) To note: A rate λ is said to be strictly feasible if λ ∈ int(C) or in other words if there exist a neighborhood of λ such as every λI that belongs to this neighborhood is feasible. The case of two conflicting links can be found in Figures 3 and 4. Both λ and f that are pointed to verify the required conditions by this theorem. Proof: The proof can be found in the Appendix. frame) has elapsed after which the transmission aggressiveness and wake-up aggressiveness attain their optimal value, a new constant ωk = gk (Qk ) can be assigned to calibrate the power-delay trade off based on the link’s queue. It can be seen as a penalty function for the high queue length, that should be compensated in the next convergence frame. However this chosen function verifies certain properties, the first being that gk is an increasing function in Qk . Other properties include: 0 < gk (Qk ) < 1 − λk ∀Qk Update: Since the gradient of the desired objective function can be calculated in a distributed manner by each node k, the update will be done using a simple gradient descent method. However due to the fact that the mixing time is slow [1], the update should be done using sufficiently large time frames Tm called update frame in order to ensure that the chain reaches its stationary distribution. Suppose that the links update their aggressiveness at time tm , we define Tm = tm − tm−1 as being the m-th update frame. rk (m + 1) = rk (m) + 41k (m)(λk − sk (m)) ρk (m + 1) = ρk (m) + 42k (m)(λk + ωk − fˆk (m)) Fig. 3: Feasible capacity region for two conflicting links case Fig. 4: The allowed region for the awake vector in the case of two conflicting links D. Implementation Considerations The DoF parameter assignment can be either static (kept constant) or it can be dynamic by choosing an appropriate function gk (Qk ) where Qk is the queue length of link k. First case: ωk is assigned to each node and kept constant throughout transmission without change. Second case: Once a large time frame Tc (called convergence where 4 refers to a well chosen step size. Both sk (m) and fˆk (m) are calculated as follows: R tm+1 R tm+1 ak (τ )dτ ak (τ )xk (τ )dτ tm fˆk (m) = tm sk (m) = Tm+1 Tm+1 If λk is unknown, it can be itself approximated using its empirical average. A simple note to be taken in consideration, dummy packets are considered to be sent by node k if its buffer was empty to ensure the ideal throughput and awake duration are used during the updates. As we can see from the expression of the wake-up aggressiveness and Transmission aggressiveness, the chain depends Rk k on the ratio between W Sk and Hk and not individually on them. For instance, if we fix Sk to a value and update the wake-up aggressiveness, it is equivalent to changing just Wk and vice-versa. This means that the node’s sleep timer is kept with the same mean but how often the node wakes up depends on the corresponding wake-up aggressiveness. We will adopt this approach by fixing both Sk and Hk . Due to the fact that the updates create a fresh new chain, residual effects from the previous chain should be mitigated: • • • If the node was awake and transmitting when the update time frame has elapsed, the update of the parameters will not affect it so no further actions If the node was awake but in a back-off stage, a new back-off timer according to the new transmission aggressiveness should be taken. If the node was asleep, a new wake-up timer according to the new wake-up aggressiveness should be generated Power Model Power Parameter Value Pz 5 µW Pt 27 mW Ps 1.8 mW TABLE II: Power model values For the sake of simplicity, we assume that the channel mean holding time is 1 ms, and as mentioned before we are going to assume that the sleeping timer’s mean is kept constant throughout the simulations and is equal to 1 ms. In this way, the calibrations of parameters rk an ρk is equivalent to calibrating the back-off and the wake-up timers mean respectively. Scenario 1: The following simulation is a simple proof of concept and approval of theoretical results in terms of parameters convergence. For this purpose, we take a simple example of two conflicting links with medium traffic of arrival rate λ = (0.35, 0.35). The simulations are run for 100 s with a fixed update time frame Tm = 10 ms and with the same step size 4 = 0.1 in all updates for both of the algorithms. For the delay-power tradeoff parameter, it is taken as ωk = 0.3 for both links which would require both links to be awake 65% of the time. For the adaptive CSMA, the minimization of the convex objective function leads to a theoretical Transmission Aggressiveness vector r ∗ = (0.154, 0.154). For our algorithm, the OP leads to an optimal Transmission Aggressiveness vector r ∗ = (0.9273, 0.9273) and Wake-up Aggressiveness vector ρ∗ = (−0.1541, −0.1541). When adopting our scheme, as it can be seen from these values, the nodes will sleep but are more aggressive on the channel when they wake up than the adaptive CSMA to compensate for the time spent sleeping. Evolution of the aggressivenesses 1.4 r1 r2 rho1 rho2 CSMA r1 CSMA r2 1.2 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 0 1 2 3 4 5 Time 6 7 8 9 10 4 x 10 Fig. 5: Evolution of aggressiveness for ωk = 0.3 ∀k Scenario 2: In this scenario, we take a realistic heterogeneous case in which several groups of nodes each have their own desired delay-power tradeoff. 3 groups of 4 nodes each are considered: -Group 1: This group is made of nodes that are extremely delay sensitive but can tolerate a higher energy consumption -Group 2: This group is made of nodes that fall between the two extremes, they need a moderate power consumption without introducing a lot of delay -Group 3: This group is made of nodes that can tolerate long delays however they are power limited We consider that the arrival for each node is λk = 0.077 ∀k. ω1 = 0.8, ω2 = 0.4 and ω3 = 0.1 are assigned for Group 1,2 and 3 respectively. Average queue 150 100 Average queue The goal of these simulations is to show the gain experienced from using this method compared to the adaptive CSMA. Two scenarios are taken in consideration but before we present them we should state the power model taken. The power consumption is as follows: • When the node is in a SLEEP state, the node consumes Pz • When the node is transmitting, it consumes Pt • When the node is sensing the medium: it is essentially receiving radio signals and after signal processing, it takes a decision whether the medium is to be considered busy or not. We neglect the processing power consumption and assume that the power consumption in this case is simply the power required to receive the radio signal We will show that even with this assumption that gives adaptive CSMA an edge since our goal is to minimize power induced by the medium sensing, we will still achieve a decent power gain. As for the numerical values, we will adopt the values in WiseNET low power radio transceiver used in [12]. The algorithm is completely distributed and by only observing the amount of time the node spends transmitting and being awake, the parameters converge to their optimal point as seen in Fig.5. Aggressiveness IV. S IMULATIONS 50 0 Group 1 Group 2 Group 3 Fig. 6: Average queue lengths for each group Power Gain 70 60 Power Gain in % 50 40 30 20 10 0 Group 1 Group 2 Group 3 Fig. 7: Power gain of each group In order to really demonstrate the difference, we are going to let the initial parameters to be close to their optimal values for both our scheme and adaptive CSMA. The results are shown in both Fig.6 and Fig.7. As expected, Group 3 experienced the highest queue length but benefited from a high power gain (recall that Group 3 is delay tolerant). Group 1 on the other extreme had the complete opposite results while Group 2 laid in between these two cases. Fig.7 shows the gain in terms of power of our scheme as compared to the adaptive CSMA. Our results show clearly that our algorithm can handle multiple services at the same time by simply adjusting the parameters. For some IoT applications (with delay tolerance), our scheme provides a huge power gain. V. C ONCLUSION In this paper, we introduced a new scheme that belongs to the CSMA family. In this scheme, we give each node the choice to be awake or asleep. We have shown that we can still maintain throughput optimality even if the node have the ability to transition into a SLEEP state. Each node controls two parameters for which the convergence to their optimal values has been proven to be completely distributed without any message passing. The theoretical analysis resulted in the birth of a parameter which had the interpretation as being a delay-power tradeoff. This parameter is assigned to each node depending on the application concerned. The simulations conformed with the theoretical results and showed the advantages in terms of power gain with respect to the adaptive CSMA. R EFERENCES [1] L. Jiang and J. Walrand. A distributed csma algorithm for throughput and utility maximization in wireless networks. IEEE/ACM Transactions on Networking, 18(3):960–972, June 2010. [2] L. Tassiulas and A. Ephremides. Stability properties of constrained queueing systems and scheduling policies for maximum throughput in multihop radio networks. IEEE Transactions on Automatic Control, 37(12):1936–1948, Dec 1992. [3] A. Eryilmaz, A. Ozdaglar, and E. Modiano. Polynomial complexity algorithms for full utilization of multi-hop wireless networks. In IEEE INFOCOM 2007 - 26th IEEE International Conference on Computer Communications, pages 499–507, May 2007. [4] X. Wu, R. Srikant, and J. R. Perkins. Scheduling efficiency of distributed greedy scheduling algorithms in wireless networks. IEEE Transactions on Mobile Computing, 6(6):595–605, June 2007. [5] S. Y. Yun, Y. Yi, J. Shin, and D. Y. Eun. Optimal csma: A survey. In 2012 IEEE International Conference on Communication Systems (ICCS), pages 199–204, Nov 2012. [6] Devavrat Shah and Jinwoo Shin. Randomized scheduling algorithm for queueing networks. Ann. Appl. Probab., 22(1):128–171, 02 2012. [7] Wei Ye, J. Heidemann, and D. Estrin. An energy-efficient mac protocol for wireless sensor networks. In Proceedings.Twenty-First Annual Joint Conference of the IEEE Computer and Communications Societies, volume 3, pages 1567–1576 vol.3, 2002. [8] Tijs van Dam and Koen Langendoen. An adaptive energy-efficient mac protocol for wireless sensor networks. In Proceedings of the 1st International Conference on Embedded Networked Sensor Systems, SenSys ’03, pages 171–180, New York, NY, USA, 2003. ACM. [9] G. Lu, B. Krishnamachari, and C. S. Raghavendra. An adaptive energyefficient and low-latency mac for data gathering in wireless sensor networks. In 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings., pages 224–, April 2004. [10] Bharath Sundararaman, Ugo Buy, and Ajay D. Kshemkalyani. Clock synchronization for wireless sensor networks: a survey. Ad Hoc Networks, 3(3):281 – 323, 2005. [11] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. [12] Amre El-Hoiydi and Jean-Dominique Decotignie. Low power downlink mac protocols for infrastructure wireless sensor networks. Mobile Networks and Applications, 10(5):675–690, 2005. A PPENDIX P ROOF OF T HEOREM 2 Since we do not impose any positivity constraints on our parameters, the use of Slatter’s conditions theorem as in [1] to prove finiteness of our parameters cannot be applied here and we have to recourse to other tools. Lemma 3. pij > 0 ∀i, j if and only if   λk > 0 ∀k λ is strictly feasible   λk < fk < 1 ∀k Proof: We divide the proof of the Lemma in two parts as will be seen in the sequel. Part 1: We start by proving that if pij > 0 ∀i, j then:   λk > 0 ∀k λ is strictly feasible   λk < fk < 1 ∀k - f < 1 : the state S = (0, 0) has a non-null probability then no node stay awake all the time and therefore we have that fk < 1 ∀k - f > λ : states where nodes are awake and not transmitting have non zero probability i.e. nodes enter in back-off stages and therefore spend more time awake than transmitting - λ > 0 : it is straightforward since each node has an arrival rate of at least pk = (aj = ek , xi = ek ) > 0 - Strict feasibility : we will have to prove that there is exist a neighborhood of λ such that each arrival rate inside of it is feasible. Let p0 = P ((1, 0)) > 0 the portion of time users are all awake and none of them is transmitting and pk = P ((1, ek )) > 0 where ek refers to the canonical vector, we define  = min{p0 /K, min pk } > 0. We can satisfy any arrival rate λ0 such as: k |λ0k − λk | 6  ∀k We can do that by simply constructing the following distribution p0 such as:  K P  0   (λ0k − λk ) p0 = p0 − k=1 p0k = pk + λ0k − λk ∀k    p0 = p for all other states To note that fk0 = fk ∀k since we only change the transmission state and not the configuration state. Part 2: Throughout this section, a visualization of the proof in the case of two conflicting nodes is presented to clarify the explanation. In this part, we suppose that λ and f verify:   λk > 0 ∀k λ is strictly feasible   λk < fk < 1 ∀k Fig. 8: Case (b) capacity region We will try to construct p > 0 such as:  j| 2K |I P P    pij ajk xik λk = j=1 i=1 j| 2K |I  P P   pij ajk fk = j=1 i=1 We start by choosing an arbitrary probability distribution pA > 0, then four cases can occur: (a): the randomly constructed pA verifies the requirements λA = λ and fA = f then we choose p = pA (b): pA verifies λA = λ but fA 6= f . Since both fA , f > λ (for fA we recall part 1 since pA > 0) hence they lay in the same region and we can find d > 0 as shown in Fig 9 such as: fB = f + d(f − fA ) Therefore we can find pB > 0 such as λB = λ. We can then construct in this case p in the following way: pij = θpAij + (1 − θ)pBij > 0. We know that pAij > 0 and pBij > 0, 0. (c): pA verifies the requirement for fA = f but λA 6= λ. It is tricky here since the region of f depends on λ hence fA and f do not lay in the same region. This is shown in Fig 11 where the green region represents the allowed region of fA while the wavy one is for f . However since λ < f , we can always find a neighborhood of λ such as for each element in it λI , it verifies λI < f . This neighborhood is marked as a red disk in Figure 12. Now we take the intersections d where θ = 1+d therefore pij > Fig. 9: Case (b) awake vector allowed region between this neighborhood and all the affine combinations between λ and λA , then we can state that there is exist λB in this intersection ( hence verifies λB < f ) such as ∃d > 0 in a way that: λB = λ + d(λ − λA ) Let pB > 0 its corresponding probability distribution with fB = f which is possible since λB < f . Then we can conclude that we can write p in the following way: pij = θpAij + (1 − θ)pBij d where θ = 1+d > 0. We know that pAij > 0 and pBij > 0, therefore pij > 0. (d): in this case we have fA 6= f and λA 6= λ. This might seem like the hardest case but it is merely a combination of both cases (c) and (d). Since the priority is to coincide the regions of fA and f , we start by using the same analysis as case (c). By doing so, we can have: λB = λ + d1 (λ − λA ) d1 > 0. We know that pAij > 0 and pBij > 0, where θ1 = 1+d 1 therefore pCij > 0. We have now λC = λ but fC 6= f . We are back to case (2) and therefore we can find d2 > 0 such as: fD = f + d2 (f − fC ) and λD = λ. We can then construct in this case p in the following way: pij = θ2 pCij + (1 − θ2 )pDij d2 where θ2 = 1+d > 0. We know that pCij > 0 and pDij > 0, 2 therefore pij > 0 which concludes the proof of the Lemma Fig. 10: Case (c) capacity region The next step is to use the results of Lemma 3 to prove that our optimum is attained for a finite (r ∗ , ρ∗ ). Finite Minimzer: First, we know that D(pkπ(r, ρ)) > 0 hence Inf D(pkπ(r, ρ)) exists r,ρ Now it remains to show that it’s attained by a finite (r ∗ , ρ∗ ). As proven before, we consider in our case that pij > 0 and we recall our optimization problem: K minimize F (r, ρ) = − r,ρ Fig. 11: Case (c) awake vector allowed region |Ij | 2 X X pij log(π(aj , xi ; r, ρ)) j=1 i=1 We have proven that this minimization is indeed a convex OP after appropriate transformations. Therefore, we either have one of the following cases: (a): a finite minimizer (r ∗ , ρ∗ ) exists and it is unique due to the convexity of our problem (b): there exist a sequence (r n )n such that n→+∞ n→+∞ F ((r n )n , ρ∗ ) −→ F ∗ and ||r n || −→ +∞ (c): there exist a sequence (ρn )n such that n→+∞ n→+∞ F (r ∗ , (ρn )n ) −→ F ∗ and ||ρn || −→ +∞ n (d): there exist two sequences (r )n and (ρm )m such that n,m→+∞ F ((r n )n , (ρm )m ) −→ F ∗ while the norm of these two n,m→+∞ vectors ||r n ||, ||ρm || −→ +∞. First, we recall a fundamental mathematical theorem on bounded sequences. Bolzano–Weierstrass Theorem: Before stating the theorem, we call to mind the notion of accumulation point. Let (an ) be a sequence of real vectors, the vector L is said to be an accumulation point of (an ) if there exists a subsequence (ank ) that converges to L. In other words: ∀ > 0, ∃K ∈ N such that if k > K then ||ank − L|| 6  Fig. 12: Visualization of case (c) analysis and let pB > 0 its corresponding probability distribution with fB = f . We construct now the probability distribution pC in the following way: pCij = θ1 pAij + (1 − θ1 )pBij The theorem states that each bounded sequence in RK has at least one accumulation point or equivalently at least one convergent subsequence. Armed with this theorem, we proceed our proof by conn tradiction. Consider that case (b) occurs, r n = ||r n || ||rrn || n where ||rrn || is a bounded sequence. We denote by r one n→+∞ of its accumulations point. Since F ((r n )n , ρ∗ ) −→ F ∗ then this is still true for any subsequence extracted from (r n )n . Consider the subsequence corresponding to the accumulation point r, then for y ≥ 0 which refers to the modulus, F ∗ = lim F (yr, ρ∗ ). We define the set of all y→+∞ states Ω = {(aj , xi ), j = 1, . . . , 2K i = 1, . . . , |Ij |}, let m = max {hxi , ri} and denote Λ = {S ∈ Ω : hxi , ri = m} S∈Ω where h·, ·i refers to the scalar product. Then as nk → +∞, the stationary distribution for a random S = (aj , xi ) ∈ Ω of our chain becomes: π(aj , xi ; yr, ρ∗ ) = exp(haj , ρ∗ i)exp(hxi , yri) j| P |I P exp(haj , ρ∗ i)exp(hxi , yri) 2K j=1 i=1 By multiplying both the numerator and denominator by the same quantity exp(−ym), it leads to: exp(y(hxi , ri − m + haj , ρ∗ i/y)) y→+∞ −→ K |Ij | 2 P P ∗ j i exp(y(hx , ri − m + ha , ρ i/y)) 1{S ∈ Λ} |Λ| j=1 i=1 y→+∞ Since haj , ρ∗ i/y −→ 0, we are left with the factor hxi , ri − m 6 0 with y tending to infinity. In order to have a non zero numerator we need that factor to be null or in other words S ∈ Λ. We can distinguish two cases: - Λ = Ω: In this case, all the states share the same maximum value m hence the limiting distribution is simply the uniform distribution over all the state space. In this case, π(aj , xi ; yr, ρ∗ ) = π(aj , xi , 0, 0) and F ∗ = F (0, 0) therefore F has a finite minimizer (0, 0) which contradicts with our assumption - Λ 6= Ω: In this case, there exist at least a state S 0 = 0 0 0 0 y→+∞ (aj , xi ) ∈ / Λ and therefore π(aj , xi ; yr, ρ∗ ) −→ 0. But we assumed that pi0 j 0 > 0 then from the expression of the objective function we can conclude that F ∗ = +∞ which is clearly not minimal since F (0, 0) < +∞ hence case (b) cannot occur. The proof that case (c) cannot occur is identical to the preceding one but by taking the sequence (ρn )n into account instead. The same reasoning can be applied to prove the impossibility of case (d). The two sequences are taken simultaneously and we extract from each a subsequence with their corresponding accumulation points. We will have to define the following quantities: - m1 = max {haj , ρi} and denote Λ1 = {S ∈ Ω : haj , ρi = S∈Ω m1 } - m2 = max {hxi , ri} and denote Λ2 = {S ∈ Ω : hxi , ri = S∈Ω m2 } By multiplying the stationary distribution by exp(−m1 y1 − m2 y2 ), we will end up with: π(aj , xi ; y2 r, y1 ρ) y1 ,y2 →+∞ −→ 1{S ∈ Λ1 ∩ Λ2 } |Λ1 ∩ Λ2 | By following the same analysis as before, we will get to the conclusion that case (d) cannot occur and we are left with case (a) which proves the existence of a unique minimizer (r∗ , ρ∗ ) as long as pij > 0 ∀ S ∈ Ω which brings us back to our original condition that it is enough to have λ is strictly feasible and the awake vector f verifying λk < fk < 1 ∀k to have a unique finite minimizer (r∗ , ρ∗ ).
7cs.IT
arXiv:1307.2396v1 [math.AC] 9 Jul 2013 DE RAHM COHOMOLOGY OF LOCAL COHOMOLOGY MODULES-THE GRADED CASE TONY J. PUTHENPURAKAL Abstract. Let K be a field of characteristic zero, R = K[X1 , . . . , Xn ]. Let An (K) = K < X1 , . . . , Xn , ∂1 , . . . , ∂n > be the nth Weyl algebra over K. We consider the case when R and An (K) is graded by giving deg XiP = ωi and deg ∂i = −ωi for i = 1, . . . , n (here ωi are positive integers). Set ω = n k=1 ωk . Let I be a graded ideal in R. By a result due to Lyubeznik the local cohomology modules HIi (R) are holonomic An (K)-modules for each i ≥ 0. In this article we prove that the De Rahm cohomology modules H ∗ (∂; HI∗ (R)) is concentrated in degree −ω, i.e., H ∗ (∂; HI∗ (R))j = 0 for j 6= −ω. As an application when A = 1 (R) to H n−1 (∂(f ); A), R/(f ) is an isolated singularity we relate H n−1 (∂; H(f ) the (n − 1)th Koszul cohomology of A with respect to ∂1 (f ), . . . , ∂n (f ). Introduction Let K be a field of characteristic zero and let R = K[X1 , . . . , Xn ]. We consider R graded with deg Xi = ωi for i = 1, . . . , n; here ωi are positive integers. Set m = (X1 , . . . , Xn ). Let I be a graded ideal in R. The local cohomology modules HI∗ (R) are clearly graded R-modules. Let An (K) = K < X1 , . . . , Xn , ∂1 , . . . , ∂n > be the nth Weyl algebra over K. By a result due to Lyubeznik, see [2], the local cohomology modules HIi (R) are holonomic An (K)-modules for each i ≥ 0. We can consider An (K) graded by giving deg ∂i = −ωi for i = 1, . . . , n. Let N be a graded left An (K) module. Now ∂ = ∂1 , . . . , ∂n are pairwise commuting K-linear maps. So we can consider the De Rahm complex K(∂; N ). Notice that the De Rahm cohomology modules H ∗ (∂; N ) are in general only graded K-vector spaces. They are finite dimensional if N is holonomic; [1, Chapter 1, Theorem 6.1]. In particular H ∗ (∂; HI∗ (R)) are finite dimensional graded K-vector spaces. Our first result is Pn Theorem 1. Let I be a graded ideal in R. Set ω = i=1 ωi . Then the De Rahm cohomology modules H ∗ (∂1 , . . . , ∂n ; HI∗ (R)) is concentrated in degree −ω, i.e., H ∗ (∂1 , . . . , ∂n ; HI∗ (R))j = 0, for j 6= −ω. We give an application of Theorem 1. Let f be a homogenous polynomial in R with A = R/(f ) an isolated singularity, i.e., AP is regular for all homogeneous prime ideals P 6= m. Let H i (∂(f ); A) be the ith Koszul cohomology of A with respect to ∂1 (f ), . . . , ∂n (f ). We show Date: December 11, 2017. 1991 Mathematics Subject Classification. Primary 13D45; Secondary 13N10 . Key words and phrases. local cohomology, associated primes, D-modules, Koszul homology. 1 2 TONY J. PUTHENPURAKAL Theorem 2. (with hypotheses as above) There exists a filtration F = {Fν }ν≥0 1 n−1 1 consisting of K-subspaces of H n−1 (∂; H(f (∂; H(f ) (R)) with Fν = H ) (R)) for ν ≫ 0, Fν ⊇ Fν−1 and F0 = 0 and injective K-linear maps Fν ην : −→ H n−1 (∂(f ); A)(ν+1) deg f −ω . Fν−1 1 The techniques in this theorem is generalized in [5] to show that H i (∂; H(f ) (R)) = 0 for i < n − 1. There is no software to compute De-Rahm cohomology of a An (K)module M . As an application of Theorem 2 we prove 2 Example 0.1. Let R = K[X1 , . . . , Xn ] and let f = X12 + X22 + . . . + Xn−1 + Xnm with m ≥ 2. Then 1 (1) if m is odd then H n−1 (∂; H(f ) (R)) = 0. (2) if m is even then 1 (a) If n is odd then H n−1 (∂; H(f ) (R)) = 0. n−1 1 (b) If n is even then dimK H (∂; H(f ) (R)) ≤ 1. We now describe in brief the contents of the paper. In section one we discuss a few preliminaries that we need. In section two we introduce the concept of generalized Eulerian modules. In section three we give a proof of Theorem 1. In section four we give an outline of proof of Theorem 2. In section five we prove Theorem 2. In section six we give a proof of Example 0.1. 1. Preliminaries In this section we discuss a few preliminary results that we need. Remark 1.1. Although all the results are stated for De-Rahm cohomology of a An (K)-module M , we will actually work with De-Rahm homology. Note that Hi (∂, M ) = H n−i (∂, M ) for any An (K)-module M . Let S = K[∂1 , . . . , ∂n ]. Consider it as a subring of An (K). Then note that Hi (∂, M ) is the ith Koszul homology module of M with respect to ∂. 1.2. Let M be a holonomic An (K)-module. Then for i = 0, 1 the De-Rahm homology modules Hi (∂n , M ) are holonomic An−1 (K)-modules, see [1, 1.6.2]. The following result is well-known. Lemma 1.3. Let ∂ = ∂r , ∂r+1 , . . . , ∂n and ∂ ′ = ∂r+1 , . . . , ∂n . Let M be a left An (K)-module. For each i ≥ 0 there exist an exact sequence 0 → H0 (∂r ; Hi (∂ ′ ; M )) → Hi (∂; M ) → H1 (∂r ; Hi−1 (∂ ′ ; M )) → 0. 2. generlized Eulerian modules Consider the Eulerain operator En = ω1 X1 ∂1 + ω2 X2 ∂2 + · · · + ωn Xn ∂n . If r ∈ R is homogenous then recall that En r = (deg r) · r. Note that degree of En is zero. Let M be a graded An (K) module. If m is homogenous, we set |m| = deg m We say that M is Eulerian An (K)-module if En m = |m| · m for each homogenous m ∈ M . This notion was discovered by Ma and Zhang, see the very nice paper [3]. They prove that local cohomology modules HI∗ (R) are Eulerian An (K)-modules, DE RAHM 3 see [3, 5.3]. Infact they prove this when R is standard graded. The same proof can be adapted to prove the general case. It can be easily seen that if M is Eulerian An (K) module then so are each graded submodule and graded quotient of M . However extensions of Eulerian modules need not be Eulerian, see [3, 3.5]. To rectify this we introduce the following notion: A graded An (K)-module M is said to be generalized Eulerian if for a homogenous element m of M there exists a positive integer a, (here a may depend on m) such that (En − |m|)a m = 0. We now prove that the class of generalized Eulerian modules is closed under extensions. α α 2 1 M3 → 0 be a short exact sequence of M2 −→ Proposition 2.1. Let 0 → M1 −→ graded An (K)-modules. Then the following are equivalent: (1) M2 is generalized Eulerian. (2) M1 and M3 is generalized Eulerian. Proof. The assertion (1) =⇒ (2) is clear. We prove (2) =⇒ (1). Let m ∈ M2 be homogenous. As M3 is generalized Eulerian we have (En − |m|)b α2 (m) = 0 for some b ≥ 1. Set v2 = (En − |m|)b m ∈ M2 . As α2 is An (K)-linear we get α2 (v2 ) = 0. So v2 = α1 (v1 ) for some v1 ∈ M1 . Note deg v1 = deg v2 = |m|. As M1 is generalized Eulerian we have that (En − |m|)a v1 = 0 for some a ≥ 1. As α1 is An (K)-linear we get (En − |m|)a v2 = 0. It follows that (En − |m|)a+b m = 0.  If M is a graded An (K)-module then for l ∈ Z the module M (l) denotes the shift of M by l, i.e., M (l)n = Mn+l for all n ∈ Z. The following result was proved for Eulerian An (K)-modules in [3, 2.4]. Proposition 2.2. Let M be a non-zero generalized Eulerian An (K)-module. Then for l 6= 0 the module M (l) is NOT a generalized Eulerian An (K)-module. Proof. Suppose M (l) is a generalized Eulerian An (K)-module for some l 6= 0. Let m ∈ M be homogenous of degree r and non-zero. As M is generalized Eulerain An (K)-module we have that (En − r)a m = 0 for some a ≥ 1. We may assume (En − r)a−1 m 6= 0. Now m ∈ M (l)r−l . As M (l) is generalized Eulerain we get that (En − r + l)b m = 0 for some b ≥ 1. Notice b 0 = (En − r + l) m = b   X b b−i l + l (En − r)i i i=1 b ! m. 4 TONY J. PUTHENPURAKAL Multiply on the left by (En − r)a−1 . We obtain lb (En − r)a−1 m = 0 As l 6= 0 we get (En − r)a−1 m = 0 a contradiction.  3. Proof of Theorem 1 In this section we prove Theorem 1. Notice that HIi (R) are Eulerian An (K)module for all i ≥ 0. Hence Theorem 1 follows from the following more general result. Theorem 3.1. Let M be a generalized Eulerian An (K)-module. Then Hi (∂; M ) P is concentrated in degree −ω = − nk=1 ωk . Before proving 3.1 we need to prove a few preliminary results. Proposition 3.2. Let M be a generalized Eulerian An (K)-module. Then for i = 0, 1, the An−1 (K)-modules Hi (∂n ; M )(−ωn ) are generalized Eulerian. Proof. Clearly Hi (∂n ; M )(−ωn ) are An−1 (K)-modules for i = 0, 1. We have an exact sequence of An−1 (K)-modules ∂ n M → H0 (∂n ; M ) → 0. 0 → H1 (∂n ; M ) → M (ωn ) −→ Note that H1 (∂n ; M )(−ωn ) ⊂ M . Let ξ ∈ H1 (∂n ; M )(−ωn ) be homogeneous. As M is generalized Eulerian we have that (En − |ξ|)a ξ = 0 for some a ≥ 1. Notice En = En−1 + ωn Xn ∂n . Also note that Xn ∂n commutes with En−1 . So 0 = (En−1 − |ξ| + ωn Xn ∂n )a ξ = ((En−1 − |ξ|)a + (∗)Xn ∂n ) ξ. As ∂n ξ = 0 we get that (En−1 − |ξ|)a ξ = 0. It follows that H1 (∂n ; M )(−ωn ) is a generalized Eulerian An−1 (K)-module. Let ξ ∈ H0 (∂n ; M )(−ωn ) be homogenous of degree r. Then ξ = α + ∂n M where α ∈ Mr−ωn . As M is generalized Eulerian we get that (En − r + ωn )a α = 0 for some a ≥ 1. Notice En = En−1 + ωn Xn ∂n = En−1 + ωn ∂n Xn − ωn . So En − r + ωn = En−1 − r + ωn ∂n Xn . Notice that ∂n Xn commutes with En−1 . Thus 0 = (En−1 − r + ωn ∂n Xn )a α = (En−1 − r)a α + ∂n · ∗α. Going mod ∂n M we get (En−1 − r)a ξ = 0. It follows that H0 (∂n ; M )(−ωn ) is a generalized Eulerian An−1 (K)-module.  Remark 3.3. If M is Eulerian then the same proof shows that Hi (∂n ; M )(−ωn ) is a Eulerian An−1 (K)-module for i = 0, 1. However as the proof of the following theorem shows that we can only prove that H1 (∂n−1 , ∂n ; M )(−ωn−1 − ωn ) is a generalized Eulerian An−1 (K)-module. We now show that DE RAHM 5 Proposition 3.4. Let M be a generalized Eulerian An (K)-module. Let ∂ = ∂i , ∂i+1 , . . . , ∂n ; here i ≥ 2. Then for each j ≥ 0 the De Rahm homology module n X Hj (∂; M )(− ωk ) k=i is a generalized Eulerian Ai−1 (K)-module. Proof. We prove this result by descending induction on i. For i = n the result holds byPProposition 3.2. Set ∂ ′ = ∂i+1 , . . . , ∂n . By induction hypothesis n Hj (∂ ′ ; M )(− k=i+1 ωk ) is generalized Eulerian Ai (K)-module. By Proposition 3.2 again we get that for l = 0, 1 and for each j ≥ 0 ! n n X X ′ ωk ) (−ωi ) = Hl (∂i ; Hj (∂ ′ ; M )) (− ωk ) Hl ∂i ; Hj (∂ ; M )(− k=i+1 k=i is generalized Eulerian. By 1.3 we have exact sequence 0 → H0 (∂i ; Hj (∂ ′ ; M )) → Hj (∂; M ) → H1 (∂i ; Hj−1 (∂ ′ ; M )) → 0. The Pnmodules at the left and right end become generalized Eulerian after shifting by − k=i ωk . By 2.1 it follows that for each j ≥ 0 the De Rahm homology module Hj (∂; M )(− n X ωk ) k=i is a generalized Eulerian Ai−1 (K)-module.  We now consider the case when n = 1. Proposition 3.5. Let M be a generalized Eulerian A1 (K)-module. Then for l = 0, 1 the modules Hl (∂1 ; M ) is concentrated in degree −ω1 . Proof. We have an exact sequence of K-vector spaces ∂ 1 M → H0 (∂1 ; M ) → 0. 0 → H1 (∂1 ; M ) → M (ω1 ) −→ Let ξ ∈ H1 (∂1 ; M )(−ω1 ) be homogenous and non-zero. As ξ ∈ M we have that (ω1 X1 ∂1 − |ξ|)a ξ = 0 for some a ≥ 1. Notice (ω1 X1 ∂1 − |ξ|)a = (∗)∂1 + (−1)a |ξ|a . As ∂1 ξ = 0 we get (−1)a |ξ|a ξ = 0. As ξ 6= 0 we get that |ξ| = 0. It follows that H1 (∂1 ; M ) is concentrated in degree −ω1 . Let ξ ∈ H0 (∂1 , M ) be non-zero and homogeneous of degree r. Let ξ = α + ∂1 M where α ∈ Mr . As M is generalized Eulerian we get that (ω1 X1 ∂1 − r)a α = 0 for some a ≥ 1. Notice ω1 X1 ∂1 = ω1 ∂1 X1 − ω1 . So we have 0 = (ω1 ∂1 X1 − (r + ω1 ))a α = (∂1 ∗ +(−1)a (r + ω1 )a ) α. In M/∂1 M we have (−1)a (r + ω1 )a ξ = 0. As ξ 6= 0 we get that r = −ω1 . It follows that H0 (∂1 ; M ) is concentrated in degree −ω1 .  We now give 6 TONY J. PUTHENPURAKAL Pn Proof of Theorem 3.1. Set ∂ ′ = ∂2 , . . . , ∂n . By 3.4 Nj = Hj (∂ ′ ; M )(− k=2 ωk ) is generalized Eulerian P A1 (K)-module, for each j ≥ 0. We use exact sequence in 1.3 and shift it by − nk=2 ωk to obtain an exact sequence 0 → H0 (∂1 , Nj ) → Hj (∂; M )(− n X ωk ) → H1 (∂1 , Nj−1 ) → 0, k=2 for each j ≥ 0. By Proposition 3.5 the modules on the left and right of the above exact sequence is concentrated in degree −ω1 . It follows that Pnfor each j ≥ 0 the K-vector space Hj (∂; M ) is concentrated in degree −ω = − k=1 ωk .  4. Outline of proof of Theorem 2 The proof of Theorem 2 is a bit long and has a lot of technical details. For the convenience of the reader we give an outline of the proof. ∼ H1 (∂, H 1 (R)). So it is sufficient to 4.1. By [4, Lemma 2.7] we have H1 (∂, Rf ) = (f ) work with H1 (∂, Rf ) in order to prove Theorem 2. We consider elements of Rfm as column-vectors. For x ∈ Rfm we write it as x = (x1 , . . . , xm )′ ; here ′ indicates transpose. 4.2. Let ξ ∈ Rfm \ Rm . The element (a1 /f i , a2 /f i , . . . , am /f i )′ , with aj ∈ R for all j, is said to be a normal form of ξ if (1) ξ = (a1 /f i , a2 /f i , . . . , am /f i )′ . (2) f does not divide aj for some j. (3) i ≥ 1. It can be easily shown that normal form of ξ exists and is unique; see Proposition 5.1. Let (a1 /f i , a2 /f i , . . . , am /f i )′ be the normal form of ξ. Set L(ξ) = i. Notice L(ξ) ≥ 1. 4.3. Construction of a function θ : Z1 (∂, Rf ) \ Rn → H1 (∂(f ); A). n i i i ′ Let ξ ∈ ZP 1 (∂, Rf ) \ R . Let (a1 /f , a2 /f , . . . , an /f ) be the normal form of ξ. n i So we have j=1 ∂/∂Xj (aj /f ) = 0. So we have     n n ∂f  i X 1 X ∂aj  aj − i+1 = 0. f i j=1 ∂Xj f ∂Xj j=1 It follows that f divides n X j=1 ′ So (a1 , . . . , an ) ∈ Z1 (∂(f ); A). We set aj ∂f . ∂Xj θ(ξ) = [(a1 , . . . , an )′ ] ∈ H1 (∂(f ); A). Remark 4.4. It can be shown that if ξ ∈ Z1 (∂, Rf )−ω is non-zero then ξ ∈ / Rn , see 5.2. If L(ξ) = i then by 5.3 we have θ(ξ) ∈ H1 (∂(f ); A)(i+1) deg f −ω . The next result uses the fact that A is an isolated singularity. Proposition 4.5. If ξ ∈ B1 (∂, Rf )−ω is non-zero then θ(ξ) = 0. DE RAHM 7 4.6. Let ξ ∈ Rfm . We define L(f ) as follows. Case 1: ξ ∈ Rfm \ Rm . Let (a1 /f i , a2 /f i , . . . , am /f i )′ be the normal form of ξ. Set L(ξ) = i. Notice L(ξ) ≥ 1 in this case. Case 2: ξ ∈ Rm \ {0}. Set L(ξ) = 0. Case 3: ξ = 0. Set L(ξ) = −∞. The following properties of the function L can be easily verified. Proposition 4.7. (with hypotheses as above) Let ξ, ξ1 , ξ2 ∈ Rfm and α, α1 , α2 ∈ K. (1) (2) (3) (4) (5) (6) (7) If L(ξ1 ) < L(ξ2 ) then L(ξ1 + ξ2 ) = L(ξ2 ). If L(ξ1 ) = L(ξ2 ) then L(ξ1 + ξ2 ) ≤ L(ξ2 ). L(ξ1 + ξ2 ) ≤ max{L(ξ1 ), L(ξ2 )}. If α ∈ K ∗ then L(αξ) = L(ξ). L(αξ) ≤ L(ξ) for all α ∈ K. L(α1 ξ1 + α2 ξ2 ) ≤ max{L(ξ1 ), L(ξ2 )}. Let ξ1 , . . . , ξr ∈ Rfm and let α1 , . . . , αr ∈ K. Then   r X L αj ξj  ≤ max{L(ξ1 ), L(ξ2 ), . . . , L(ξr )}. j=1 4.8. We now use the fact that H1 (∂, Rf ) is concentrated in degree −ω = − So Z1 (∂, Rf ))−ω H1 (∂, Rf ) = H1 (∂, Rf )−ω = . B1 (∂, Rf )−ω Let x ∈ H1 (∂, Rf ) be non-zero. Define Pn k=1 ωk . L(x) = min{L(ξ) | x = [ξ], where ξ ∈ Z1 (∂, Rf )−ω .}. It can be shown that L(x) ≥ 1. If x = 0 then set L(0) = −∞. We now define a function θe: H1 (∂, Rf ) → H1 (∂(f ); A) ( θ(ξ) if x 6= 0, x = [ξ], and L(x) = L(ξ), x 7→ 0 if x = 0. e It can be shown that θ(x) is independent of choice of ξ; see Proposition 5.6. Also e note that if L(x) = i then θ(x) ∈ H1 (∂(f ); A)(i+1) deg f −ω . 4.9. We now construct a filtration F = {Fν }ν≥0 of H1 (∂, Rf ). Set Fν = {x ∈ H1 (∂, Rf ) | L(x) ≤ ν}. In the next section we prove Proposition 4.10. (1) Fν is a K subspace of H1 (∂, Rf ). (2) Fν ⊇ Fν−1 for all ν ≥ 1. (3) Fν = H1 (∂, Rf ) for all ν ≫ 0. (4) F0 = 0. 8 TONY J. PUTHENPURAKAL Let G = L ν≥1 Fν /Fν−1 . For ν ≥ 1 we define ην : Fν → H1 (∂(f ); A)(ν+1) deg f −ω Fν−1 ( 0, if ξ = 0; ξ 7→ e θ(x), if ξ = x + Fν−1 is non-zero. It can be shown that ην (ξ) is independent of choice of x; see 5.10. Finally we prove the following result. Theorem 4.11. (with Notation as above). For all ν ≥ 1, (1) ην is K-linear. (2) ην is injective. 5. Proof of Theorem 2 In this section we give a proof of Theorem 2 with all details. The reader is advised to read the previous section before reading this section. We first prove Proposition 5.1. Let ξ ∈ Rfm \ Rm . Then normal form of ξ exists and is unique. Proof. Existence: Let ξ ∈ Rfm \ Rm . Let ξ = (b1 /f i1 , b2 /f i2 , · · · , bm /f im )′ with f ∤ bj if bj 6= 0. Note ij ≤ 0 is possible. Let ir = max{ij | ij ≥ 1 and bj 6= 0}. Notice ir ≥ 1. Then b1 f ir −i1 b2 f ir −i2 bm f ir −im ′ , , · · · , ) f ir f ir f ir Note that f ∤ br . Thus the expression above is a normal form of ξ. Uniqueness: Let (a1 /f i , · · · , am /f i )′ and (b1 /f r , · · · , bm /f r )′ be two normal forms of ξ. We first assert that i < r is not possible. For if this holds then note as aj /f i = bj /f r we get bj = aj f r−i . So f |bj for all j; a contradiction. A similar argument shows that i > r is not possible. So i = r. Thus aj = bj for all j. Thus the normal form of ξ is unique.  ξ=( 5.2. Let ξ ∈ Z1 (∂, Rf )−ω be non-zero. Let ξ = (ξ1 , . . . , ξn )′ . Note that ξ ∈ (Rf (ω1 ) ⊕ Rf (ω2 ) ⊕ · · · ⊕ Rf (ωn ))−ω It follows that ξj ∈ (Rf )− Pk6=j ωk . It follows that ξ ∈ Rfn \ Rn . 5.3. Let (a1 /f i , · · · , an /f i )′ be the normal form of ξ. Then X deg aj = i deg f − ωk . k6=j In particular going mod f we get aj ∈ A (− deg f + ωj )(i+1) deg f −ω . Notice deg ∂f /∂Xj = deg f − ωj . It follows that (a1 , · · · , an )′ ∈ Z1 (∂(f ); A)(i+1) deg f −ω . DE RAHM 9 Thus θ(ξ) ∈ H1 (∂(f ); A)(i+1) deg f −ω . 5.4. Let K = K(∂; Rf ) be the De Rahm complex on Rf written homologically. So φ1 φ2 φ3 K = · · · → K3 −→ K2 −→ K1 −→ K0 → 0. L Here K0 = Rf , K1 = nk=1 Rf (ωk ), M M K2 = Rf (ωi + ωj ) and K3 = Rf (ωi + ωj + ωl ). 1≤i<j≤n 1≤i<j<l≤n Let K′ = K(∂(f ); A) be the Koszul complex on A with respect to ∂f /∂X1, . . . , ∂f /∂Xn. So ψ3 ψ2 ψ1 K′ = · · · → K′3 −−→ K′2 −−→ K′1 −−→ K′0 → 0. Ln Here K′0 = A, K′1 = k=1 A(− deg f + ωk ), M M K′2 = A(−2 deg f +ωi +ωj ) and K′3 = A(−3 deg f +ωi +ωj +ωl ). 1≤i<j≤n 1≤i<j<l≤n We now give proof of Proposition 4.5. Let u ∈ B1 (∂; Rf )−ω be non-zero. Let ξ ∈ (K2 )−ω be homogeneous with φ2 (ξ) = u. Let ξ = (ξij | 1 ≤ i < j ≤ n)′ . Notice that ξij ∈ Rf (ωi + ωj )−ω = (Rf )− Pk6=i,j ωk . n (n) It follows that ξ ∈ Rf 2 \ R( 2 ) . Set c = min{j | j = L(ξ) where φ2 (ξ) = u and ξ ∈ (K2 )−ω is homogeneous}. Notice c ≥ 1. Let ξ ∈ (K2 )−ω be such that L(ξ) = c and φ2 (ξ) = u. Let (bij /f c | 1 ≤ i < j ≤ n)′ be the normal form of ξ. Let u = (u1 , . . . , un )′ . Then for l = 1, . . . , n X ∂  bil  X ∂  blj  − ul = ∂Xi f c ∂Xj f c j>l i<l So ul = Set  f  f c+1 Therefore X ∂(bil ) i<l ∂Xi − X ∂(blj ) j>l  vl = c − ∂Xj X i<l  +  c  − f c+1 X i<l bil ∂f + ∂Xi  X ∂f  ∂f + blj bil ∂Xi ∂Xj ul = X j>l blj  ∂f  ∂Xj j>l f ∗ +vl . f c+1 Claim: f ∤ vl for some l. First assume the claim. Then ((f ∗ +v1 )/f c+1 , . . . , (f ∗ +vn )/f c+1 )′ is normal form of u. So θ(u) = [(v1 , . . . , vn )′ ] = [ψ2 (−cb)] = 0. We now prove our claim. Suppose if possible f |vl for all l. Then ψ2 (−cb) = (v1 , . . . , vl )′ = 0. 10 TONY J. PUTHENPURAKAL So −cb ∈ Z2 (∂(f ); A). As H2 (∂(f ); A) = 0 we get −cb ∈ B2 (∂(f ); A). Thus −cb = ψ3 (γ). Here γ = (γijl | 1 ≤ i < j < l ≤ n)′ . So X X X ∂f ∂f ∂f (5.4.1) − cbij = γkij − + + αij f. γikj γijk ∂Xk ∂Xk ∂Xk k<i<j i<k<j i<j<k We need to compute degree of γijl . Note that ξ ∈ (K2 )−ω . So bij ∈ (Rf (ωi + ωj ))−ω . fc It follows that (5.4.2) deg bij = c deg f − ω + ωi + ωj It can be easily checked that b ∈ (K′2 )(c+2) deg f −ω . So γ ∈ (K′3 )(c+2) deg f −ω . It follows that (5.4.3) deg γijl = (c − 1) deg f − ω + ωi + ωj + ωl . We first consider the case when c = 1. Then by equation 5.4.1 we have αij = 0. Also deg γijl = −ω + ωi + ωj + ωl < 0 if n > 3. So if n > 3 we get γijl = 0. So b = 0 and so ξ = 0, a contradiction. We now consider the case when n = 3. Note that γ = γ123 is a constant. Thus ′  ∂f ∂f ∂f , −γ ,γ . b= γ ∂X3 ∂X2 ∂X3 A direct computation yields u = 0, a contradiction. We now consider the case when c ≥ 2. Notice by equation 5.4.1 we have −cbij 1 X 1 X 1 X αij ∂f ∂f ∂f = c − c + c + c−1 . γkij γikj γijk c f f ∂Xk f ∂Xk f ∂Xk f k<i<j Notice i<k<j ∂ γkij ∂f /∂Xk = c f ∂Xk Put γe∗ = i<j<k  γkij /(1 − c) f c−1  − ∗ f c−1 1 γ∗ . c(c − 1) So we obtain    X ∂  γg X ∂  γg X ∂  γg bij bf ij kij ikj ijk − + + c−1 . = c c−1 c−1 c−1 f ∂Xk f ∂Xk f ∂Xk f f k<i<j Set δ=  i<k<j γg ijl |1≤i<j<l≤n f c−1 i<j<k  and ξe = ! bf ij |1≤i<j≤n . f c−1 DE RAHM 11 Then e ξ = φ3 (δ) + ξ. e This contradicts choice of c. So we have u = φ2 (ξ) = φ2 (ξ).  5.5. By Theorem 3.1 we have H1 (∂; Rf ) = H1 (∂; Rf )−ω = Z1 (∂; Rf )−ω . B1 (∂; Rf )−ω Let x ∈ H1 (∂; Rf ) be non-zero. Define L(x) = min{L(ξ) | x = [ξ], where ξ ∈ Z1 (∂, Rf )−ω .}. Let ξ = (ξ1 , . . . , ξn )′ ∈ Z1 (∂, Rf )−ω be such that x = [ξ]. So ξ ∈ (K1 )−ω . Thus ξi ∈ Rf (+ωi )−ω . So if ξ 6= 0 then ξ ∈ Rfn \ Rn . It follows that L(ξ) ≥ 1. Thus L(x) ≥ 1. We now define a function θe: H1 (∂, Rf ) → H1 (∂(f ); A) ( θ(ξ) if x 6= 0, x = [ξ], and L(x) = L(ξ), x 7→ 0 if x = 0. g is independent of choice of ξ. Proposition 5.6. (with hypotheses as above) θ(x) Proof. Suppose x = [ξ1 ] = [ξ2 ] is non-zero and L(x) = L(ξ1 ) = L(ξ2 ) = i. Let (a1 /f i , . . . , an /f i )′ be normal form of ξ1 and let (b1 /f i , . . . , bn /f i )′ be normal form of ξ2 . It follows that ξ1 = ξ2 + δ where δ ∈ B1 (∂; Rf )−ω . By Proposition 4.7.1 we get j = L(δ) ≤ i. Let (c1 /f j , . . . , cn /f j )′ be normal form of δ. We consider two cases. Case 1. j < i. Then note that ak = bk + f i−j ck for k = 1, . . . , n. It follows that θ(ξ1 ) = [(a1 , . . . , an )] = [(b1 , . . . , bn )] = θ(ξ2 ). Case 2. j = i. Then note that ak = bk + ck for k = 1, . . . , n. It follows that θ(ξ1 ) = θ(ξ2 ) + θ(δ). g is independent However by Proposition 4.5, θ(δ) = 0. So θ(ξ1 ) = θ(ξ2 ). Thus θ(x) of choice of ξ.  5.7. We now construct a filtration F = {Fν }ν≥0 of H1 (∂, Rf ). Set Fν = {x ∈ H1 (∂, Rf ) | L(x) ≤ ν} We prove Proposition 5.8. (1) Fν is a K subspace of H1 (∂; Rf ). (2) Fν ⊇ Fν−1 for all ν ≥ 1. (3) Fν = H1 (∂; Rf ) for all ν ≫ 0. (4) F0 = 0. Proof. (1) Let x ∈ Fν and let α ∈ K. Then by * L(αx) ≤ L(x) ≤ ν. So αx ∈ Fν . 12 TONY J. PUTHENPURAKAL Let x, x′ ∈ Fν be non-zero. Let ξ, ξ ′ ∈ Z1 (∂; Rf ) be such that x = [ξ], x′ = [ξ ′ ] and L(x) = L(ξ), L(x′ ) = L(ξ ′ ) Then x + x′ = [ξ + ξ ′ ]. It follows that L(x + x′ ) ≤ L(ξ + ξ ′ ) ≤ max{L(ξ), L(ξ ′ )} ≤ ν. Note that the second inequality follows from Proposition 4.7. Thus x + x′ ∈ Fν . (2) This is clear. (3) Let B = {x1 , . . . , xm } be a K-basis of H1 (∂; Rf ) = H1 (∂; Rf )−ω . Let c = max{L(xi ) | i = 1, . . . , m}. We claim that Fν = H1 (∂; Rf ) for all ν ≥ c. Fix ν ≥ c. Let ξi ∈ Z1 (∂; Rf )−ω be such that xi = [ξi ] and L(xi ) = L(ξi ) for i = 1, . . . , m. Pm u ∈ H1 (∂; Rf ). Say u = i=1 αi xi for some α1 , . . . , αm ∈ K. Then u = PLet m [ i=1 αi ξi ]. It follows that m X αi xi ) ≤ max{L(ξi ) | i = 1, . . . , m} = c ≤ ν. L(u) ≤ L( i=1 Here the second inequality follows from Proposition 4.7. So u ∈ Fν . Thus Fν = H1 (∂; Rf ). (4) If x ∈ H1 (∂; Rf ) is non-zero then L(x) ≥ 1. It follows that F0 = 0.  L 5.9. Let G = ν≥1 Fν /Fν−1 . For ν ≥ 1 we define ην : Fν → H1 (∂(f ); A)(ν+1) deg f −ω Fν−1 ( 0, if u = 0; u 7→ e θ(x), if u = x + Fν−1 is non-zero. Proposition 5.10. [with hypotheses as above.] ην (u) is independent of choice of x. Proof. Suppose u = x + Fν−1 = x′ + Fν−1 be non-zero. Then x = x′ + y where y ∈ Fν−1 . As u 6= 0 we have that x, x′ ∈ Fν \ Fν−1 . So L(x) = L(x′ ) = ν. Say x = [ξ], x′ = [ξ ′ ] and y = [δ] where ξ, ξ ′ , δ ∈ Z1 (∂; Rf ) with L(ξ) = L(ξ ′ ) = ν and L(δ) = L(y) = k ≤ ν − 1. So we have that ξ = ξ ′ + δ + α where α ∈ B1 (∂; Rf )−ω . Let L(α) = r. Note r ≤ ν. Let (a1 /f ν , . . . , an /f ν )′ , (a′1 /f ν , . . . , a′n /f ν )′ , (b1 /f k , . . . , bn /f k )′ and (c1 /f r , . . . , cn /f r )′ be normal forms of ξ, ξ ′ , δ and α respectively. So we have aj = a′j + f ν−k bj + f ν−r cj for j = 1, . . . , n. Case 1: r < ν. In this case we have that aj = a′j in A for each j = 1, . . . , n. So e e ′ ). θ(ξ) = θ(ξ ′ ). Thus θ(x) = θ(x Case 2: r = ν. In this case notice that aj = a′j + cj in A for each j = 1, . . . , n. So θ(ξ) = θ(ξ ′ ) + θ(α). However θ(α) = 0 as α ∈ B1 (∂; Rf )−ω ; see Proposition 4.5. e e ′ ). Thus θ(x) = θ(x  Note that neither θ nor θe is linear. However we prove the following: Proposition 5.11. (with Notation as above). For all ν ≥ 1, ην is K-linear. DE RAHM 13 Proof. Let u, u′ ∈ Fν /Fν−1 . We first show ην (αu) = αην (u) for all α ∈ K. We have nothing to show if α = 0 or if u = 0. So assume α 6= 0 and u 6= 0. Say e e u = x + Fν−1 . Then αu = αx + Fν−1 . As θ(αx) = αθ(x) we get the result. Next we show that ην (u + u′ ) = ην (u) + ην (u′ ). We have nothing to show if u or u′ is zero. Next we consider the case when u + u′ = 0. Then u = −u′ . So ην (u) = −ην (u′ ). Thus in this case ην (u + u′ ) = 0 = ην (u) + ην (u′ ). Now consider the case when u, u′ are non-zero and u + u′ is non-zero. Say u = x + Fν−1 and u′ = x′ + Fν−1 . Note that as u + u′ is non-zero x + x′ ∈ Fν \ Fν−1 . Let x = [ξ] and x′ = [ξ ′ ] where ξ, ξ ′ ∈ Z1 (∂; Rf )−ω and L(ξ) = L(ξ ′ ) = ν. Then x + x′ = [ξ + ξ ′ ]. Note that L(ξ + ξ ′ ) ≤ ν by Proposition 4.7. But L(x + x′ ) = ν. So L(ξ + ξ ′ ) = ν. Let (a1 /f ν , . . . , an /f ν )′ , (a′1 /f ν , . . . , a′n /f ν )′ be normal forms of ξ and ξ ′ respectively. Note that ((a1 + a′1 )/f ν , . . . , (an + a′n )/f ν )′ is normal form e + x′ ) = θ(x) e + θ(x e ′ ). of ξ + ξ ′ . It follows that θ(ξ + ξ ′ ) = θ(ξ) + θ(ξ ′ ). Thus θ(x Therefore ην (u + u′ ) = ην (u) + ην (u′ ).  Finally we have the main result of this section Proof of Theorem 2. Let ν ≥ 1. By Proposition 5.11 we know that ην is a linear map of K-vector spaces. We now prove that ην is injective. Suppose if possible ην is not injective. Then there exists non-zero u ∈ Fν /Fν−1 with ην (u) = 0. Say u = x + Fν−1 . Also let x = [ξ] where ξ ∈ Z1 (∂; Rf )−ω and L(ξ) = L(x) = ν. Let (a1 /f ν , . . . , an /f ν )′ be the normal form of ξ. So we have e 0 = ην (u) = θ(x) = θ(ξ) = [(a1 , . . . , an )′ ]. It follows that (a1 , . . . , an )′ = ψ2 (b) where b = (bij | 1 ≤ i < j ≤ n)′ . it follows that for l = 1, . . . , n X X ∂f ∂f al = bil blj − . ∂Xi ∂Xj i<l l>j It follows that for l = 1, . . . , n we have the following equation in R: X X ∂f ∂f (5.11.1) al = bil − + dl f, blj ∂Xi ∂Xj i<l l>j for some dl ∈ R. Note that the above equation is of homogeneous elements in R. So we have the following P P ∂f ∂f dl al l>j blj ∂Xj i<l bil ∂Xi = − + ν−1 . (5.11.2) ν ν ν f f f f We consider two cases: Case 1: ν ≥ 2. Set bf ij = −bil /(c − 1). Then note that ∂f bil ∂X i fν ∂ = ∂Xi bf il f ν−1 ! − ∗ f ν−1 . 14 TONY J. PUTHENPURAKAL By 5.11.2 we have for l = 1, . . . , n, ! X ∂ X ∂ al bf il − = ν ν−1 f ∂Xi f ∂Xj l<j i<l bf lj f ν−1 ! + cl . ν−1 f ν−1 Put ξ ′ = (c1 /f ν−1 , . . . , cn /f ν−1 )′ and δ = (bf | 1 ≤ i < j ≤ n). Then we ij /f have ξ = φ2 (δ) + ξ ′ . ′ So we have x = [ξ] = [ξ ]. This yields L(x) ≤ L(ξ ′ ) ≤ ν − 1. This is a contradiction. Case 2: ν = 1. Note that ξ ∈ (K1 )−ω . Thus for l = 1, . . . , n we have al ∈ (Rf (ωl ))−ω . f It follows that X deg al = deg f − ωk . k6=l Also note that deg ∂f /∂Xi = deg f − ωi . By comparing degrees in 5.11.1 we get al = 0 for all l. Thus ξ = 0. So x = 0. Therefore u = 0 a contradiction.  6. Example 0.1 2 + Xnm with m ≥ 2. Set Let R = K[X1 , . . . , Xn ] and let f = X12 + . . . + Xn−1 1 A = R/(f ). In this section we compute H1 (∂; H(f ) (R)). 6.1. We give ωi = deg Xi = m for i = 1, . . . , n − 1 and ωn = deg Xn = 2. NotePthat f is a homogeneous polynomial in R of degree 2m. Also note that ω = nk=1 ωk = (n − 1)m + 2. 6.2. First note that the Jacaobian ideal J of f is primary to the unique graded maximal ideal of R. It follows that A is an isolated singularity. Note J = (X1 , . . . , Xn−1 , Xnm−1 ). Let Hi (J; A) be the ith -Koszul homology of A with respect to J. Proposition 6.3. The Hilbert series, P (t), of H1 (J; A) is P (t) = m−2 X t2m+2j . k=0 Proof. It is easily verified that X1 , . . . , Xm−1 is an A-regular sequence. Set K[Xn ] = K ⊕ KXn ⊕ Xn2 ⊕ · · · ⊕ KXnm−1 . (Xnm ) Note that we have an exact sequence B = A/(X1 , . . . , Xm−1 )A = X m−1 0 → H1 (J; A) → B(−2(m − 1)) −−n−−→ B. It follows that H1 (J; A) = Xn B(−2(m − 1)). The result follows  6.4. By Theorem 2 there exists a filtration F = {Fν }ν≥0 consisting of K-subspaces 1 n−1 1 of H1 (∂; H(f (∂; H(f ) (R)) with Fν = H ) (R)) for ν ≫ 0, Fν ⊇ Fν−1 and F0 = 0 and injective K-linear maps Fν ην : −→ H1 (∂(f ); A)(ν+1) deg f −ω . Fν−1 DE RAHM 15 Notice (ν + 1) deg f − ω = (ν + 1)2m − (n − 1)m − 2 = (2ν − n + 3)m − 2. If ην 6= 0 then by Proposition 6.3 it follows that (2ν − n + 3)m − 2 = 2m + 2j for some j = 0, . . . , m − 2. So we obtain (6.4.1) 2νm = (n − 1)m + 2(j + 1) It follows that m divides 2(j + 1). As 2(j + 1) ≤ 2m − 2 it follows that 2(j + 1) = m. Thus m is even. 6.5. Say m = 2r. Then by equation (6.4.1) we have 2νr = (n − 1)r + r. So ν = n/2. It follows that n is even. Furthermore note that ην = 0 for ν 6= n/2 and that if ν = n/2 then by 6.3, dim Fn/2 /Fn/2−1 ≤ 1. It follows that in this case 1 dim H1 (∂; H(f ) (R)) ≤ 1. 6.6. In conclusion we have 1 (1) if m is odd then H n−1 (∂; H(f ) (R)) = 0. (2) if m is even then 1 (a) If n is odd then H n−1 (∂; H(f ) (R)) = 0. n−1 1 (b) If n is even then dimK H (∂; H(f ) (R)) ≤ 1. This proves Example 0.1. References [1] J.-E. Björk, Rings of differential operators. North-Holland Mathematical Library, 21. NorthHolland Publishing Co., Amsterdam-New York, 1979. [2] G. Lyubeznik, Finiteness properties of local cohomology modules (an application of Dmodules to commutative algebra). Invent. Math. 113 (1993), no. 1, 4155. [3] L. Ma and W. Zhang, Eulerian graded D-modules, eprint arXiv:1210.8402. [4] T. J. Puthenpurakal, De Rahm cohomoology of local cohomology modules, Preprint.arXiv: 1302.0116v1. 1 (R), where V (f ) is [5] T. J. Puthenpurakal and R. B. T. Reddy, De Rahm cohomology of H(f ) a smooth hypersurface in Pn . In preparation Department of Mathematics, Indian Institute of Technology Bombay, Powai, Mumbai 400 076 E-mail address: [email protected]
0math.AC
QuPARA: Query-Driven Large-Scale Portfolio Aggregate Risk Analysis on MapReduce Andrew Rau-Chaplin, Blesson Varghese, Duane Wilson, Zhimin Yao, and Norbert Zeh arXiv:1308.3615v1 [cs.DC] 16 Aug 2013 Risk Analytics Lab, Dalhousie University Halifax, Nova Scotia, Canada Email: {arc, varghese, yao, nzeh}@cs.dal.ca Abstract—Modern insurance and reinsurance companies use stochastic simulation techniques for portfolio risk analysis. Their risk portfolios may consist of thousands of reinsurance contracts covering millions of individually insured locations. To quantify risk and to help ensure capital adequacy, each portfolio must be evaluated in up to a million simulation trials, each capturing a different possible sequence of catastrophic events (e.g., earthquakes, hurricanes, etc.) over the course of a contractual year. In this paper, we explore the design of a flexible framework for portfolio risk analysis that facilitates answering a rich variety of catastrophic risk queries. Rather than aggregating simulation data in order to produce a small set of high-level risk metrics efficiently (as is often done in production risk management systems), the focus here is on allowing the user to pose queries on unaggregated or partially aggregated data. The goal is to provide a flexible framework that can be used by analysts to answer a wide variety of unanticipated but natural ad hoc queries. Such detailed queries can help actuaries or underwriters to better understand the multiple dimensions (e.g., spatial correlation, seasonality, peril features, construction features, financial terms, etc.) that can impact portfolio risk and thus company solvency. We implemented a prototype system, called QuPARA (QueryDriven Large-Scale Portfolio Aggregate Risk Analysis), using Hadoop, which is Apache’s implementation of the MapReduce paradigm. This allows the user to take advantage of large parallel compute servers in order to answer ad hoc risk analysis queries efficiently even on very large data sets typically encountered in practice. We describe the design and implementation of QuPARA and present experimental results that demonstrate its feasibility. A full portfolio risk analysis run consisting of a 1,000,000 trial simulation, with 1,000 events per trial, and 3,200 risk transfer contracts can be completed on a 16-node Hadoop cluster in just over 20 minutes. Keywords—ad hoc risk analytics; aggregate risk analytics; portfolio risk; MapReduce; Hadoop I. I NTRODUCTION At the heart of the analytical pipeline of a modern insurance/reinsurance company is a stochastic simulation technique for portfolio risk analysis and pricing referred to as Aggregate Analysis [1], [2], [3], [4]. At an industrial scale, a risk portfolio may consist of thousands of annual reinsurance contracts covering millions of individually insured locations. To quantify annual portfolio risk, each portfolio must be evaluated in up to a million simulation trials, each consisting of a sequence of possibiliy thousands of catastrophic events, such as earthquakes, hurricanes or floods. Each trial captures one scenario how globally distributed catastrophic events may unfold in a year. Aggregate analysis is computationally intensive as well as data-intensive. Production analytical pipelines exploit parallelism in aggregate risk analysis and ruthlessly aggregate results. The results obtained from production pipelines summarize risk in terms of a small set of standard portfolio metrics that are key to regulatory bodies, rating agencies, and an organisation’s risk management team, such as Probable Maximum Loss (PML) [5], [6] and Tail Value-at-Risk (TVaR) [7], [8]. While production pipelines can efficiently aggregate terabytes of simulation results into a small set of key portfolio risk metrics, they are typically very poor at answering the types of ad hoc queries that can help actuaries or underwriters to better understand the multiple dimensions of risk that can impact a portfolio, such as spatial correlation, seasonality, peril features, construction features, and financial terms. This paper proposes a framework for aggregate risk analysis that facilitates answering a rich variety of ad hoc queries in a timely manner. A key characteristic of the proposed framework is that it is designed to allow users with extensive mathematical and statistical skills but perhaps limited programming background, such as risk analysts, to pose a rich variety of complex risk queries. The user formulates their query by defining SQL-like filters. The framework then answers the query based on these filters, without requiring the user to make changes to the core implementation of the framework or to reorganize the input data of the analysis. The challenges that arise due to the amounts of data to be processed and due to the complexity of the required computations are largely encapsulated within the framework and hidden from the user. Our prototype implementation of this framework for Query-Driven Large-Scale Portfolio Aggregate Risk Analysis, referred to as QuPARA, uses Apache’s Hadoop [9], [10] implementation of the MapReduce programming model [11], [12], [13] to exploit parallelism, and Apache Hive [14], [15] to support ad hoc queries. Even though QuPARA is not as fast as a production system on the narrow set of standard portfolio metrics, it can answer a wide variety of ad hoc queries in an efficient manner. For example, our experiments demonstrate that an industry-size risk analysis with 1,000,000 simulation trials, 1,000 events per trial, and on a portfolio consisting of 3,200 risk transfer contracts (layers) with an average of 5 event loss tables per layer can be carried out on a 16-node Hadoop cluster in just over 20 minutes. The remainder of this paper is organized as follows. Section II gives an overview of reinsurance risk analysis. Section III proposes our new risk analysis framework. Section IV considers an example query processed by the framework and various queries for fine-grained aggregate risk analysis. Section V describes implementation details. Section VI presents a performance evaluation of our framework. Section VII presents conclusions and discusses future work. II. A N OVERVIEW OF R ISK A NALYSIS A reinsurance company typically holds a portfolio of programs that insure primary insurance companies against largescale losses, like those associated with catastrophic events. Each program contains data that describes (1) the buildings to be insured (the exposure), (2) the modelled risk to that exposure (the event loss tables), and (3) a set of risk transfer contracts (the layers). The exposure is represented by a table, one row per building covered, that lists the building’s location, construction details, primary insurance coverage, and replacement value. The modelled risk is represented by an event loss table (ELT). This table lists for each of a large set of possible catastrophic events the expected loss that would occur to the exposure should the event occur. Finally, each layer (risk transfer contract) is described by a set of financial terms that includes aggregate deductibles and limits (i.e., deductibles and maximal payouts to be applied to the sum of losses over the year) and per-occurrence deductibles and limits (i.e., deductibles and maximal payouts to be applied to each loss in a year), plus other financial terms. Consider, for example, a Japanese earthquake program. The exposure might list 2 million buildings (e.g., single-family homes, small commercial buildings, and apartments) and, for each, its location (e.g., latitude and longitude), constructions details (e.g., height, material, roof shape, etc.), primary insurance terms (e.g., deductibles and limits), and replacement value. The event loss table might, for each of 100,000 possible earthquake events in Japan, give the sum of the losses expected to the associated exposure should the associated event occur. Note that ELTs are the output of stochastic region peril models [17] and typically also include some additional financial terms. Finally, a risk transfer contract may consist of two layers as shown in Figure 1. The first layer is a per-occurrence layer that pays out a 60% share of losses between 160 million and 210 million associated with a single catastrophic event. The second layer is an aggregate layer covering 30% of losses between 40 million and 90 million that accumulate due to earthquake activity over the course of a year. Given a reinsurance company’s portfolio described in terms of exposure, event loss tables, and layers, the most fundamental type of analysis query computes an Exceedance Probability (EP) curve, which represents, for each of a set of user-specified loss values, the probability that the total claims a reinsurer will have to pay out exceeds this value. Not surprisingly there is no computationally feasible closed-form expression for computing such an EP curve over hundreds of thousands of events and millions of individual exposures. Consequently a simulation approach must be taken. The idea is to perform a stochastic simulation based on a year event table (YET). This table describes a large number of trials, each representing one possible sequence of catastrophic events that might occur in a given year. This YET is generated by an event simulator that uses the expected occurrence rate of each event plus other Fig. 1. An example two-layer reinsurance program. hazard information like seasonality. The process to generate the YET is beyond the scope of this paper, and we focus on the computationally intensive task of computing the expected loss distribution (i.e., EP curve) for a given portfolio, given a particular YET. Given the sequence of events in a given trial, the loss for this particular trial can be computed, and the overall loss distribution is obtained from the losses computed for the set of trials. While computing the EP curve for the company’s entire portfolio is critical in assessing a company’s solvency, analysts are often interested in digging deeper into the data and posing a wide variety of queries with the goal of analysing such things as cash flow throughout the year, diversity of the portfolio, financial impact of adding a new contract or contracts to the portfolio, and many others. The following is a representative, but far from complete, set of example queries. Note that while all of them involve some aspects of the basic aggregate risk analysis algorithm used to compute Exceedance Probability curves, each puts its own twist on the computation. EP Curves with secondary uncertainty: In the basic aggregate risk analysis algorithm, the loss value for each event is represented by a mean value. This is an oversimplification because for any given event there are a multitude of possible loss outcomes. This means that each event has an associated probability distribution of loss values rather than a single associate loss value. Secondary uncertainty arises from the fact that we are not just unsure whether an event will occur (primary uncertainty) but also about many of the exposure and hazard parameters and their interactions. Performing aggregate risk analysis accounting for secondary uncertainty (i.e., working with the loss distributions associated with events rather than just mean values) is computationally intensive due to the statistical tools employed— for example, the beta probability distribution is employed in estimating the loss using the inverse beta cumulative density function [16]—but is essential in many applications. Return period losses (RPL) by line of business (LOB), class of business (COB) or type of participation (TOP): In the reinsurance industry, a layer defines coverage on different types of exposures and the type of participation. Exposures can be classified by class of business (COB) or line of business (LOB) (e.g., marine, property or engineering coverage). The way in which the contractual coverage participates when a catastrophic event occurs is defined by the type of participation (TOP). Decision makers may want to know the loss distribution of a specific layer type in their portfolios, which requires the analysis to be restricted to layers covering a particular LOB, COB or TOP. Region/peril losses: This type of query calculates the expected losses or a loss distribution for a set of geographic regions (e.g., Florida or Japan), a set of perils (e.g., hurricane or earthquake) or a combination of region and peril. This allows the reinsurer to understand both what types of catastrophes provide the most risk to their portfolio and in which regions of the globe they are most heavily exposed to these risks. This type of analysis helps the reinsurer to diversify or maintain a persistent portfolio in either dimension or both. Multi-marginal analysis: Given the current portfolio and a small set of potential new contracts, a reinsurer will have to decide which contracts to add to the portfolio. Adding a new contract means additional cash flow but also increases the exposure to risk. To help with the decision which contracts to add, multi-marginal analysis calculates the difference between the loss distributions for the current portfolio and for the portfolio with any subset of these new contracts added. This allows the insurer to choose contracts or to price the contracts so as to obtain the “right” combination of added cash flow and added risk. Stochastic exceedance probability (STEP) analysis: This analysis is a stochastic approach to the weighted convolution of multiple loss distributions. After the occurrence of a natural disaster not in their event catalogue, catastrophe modelling [17] vendors attempt to estimate the distribution of possible loss outcomes for that event. One way of doing this is to find similar events in existing stochastic event catalogues and propose a weighted combination of the distributions of several events that best represents the actual occurrence. A simulation-based approach allows for the simplest method of producing this combined distribution. To perform this type of analysis, a customized Year Event Table must be produced from the selected events and their weights. In this YET, each trial contains only one event, chosen with a probability proportional to its weight. The final result is a loss distribution of the event, including various statistics such as mean, variance and quantiles. Periodic Loss Distribution: Many natural catastrophes have a seasonal component to them, that is, do not occur uniformly throughout the year. For example, hurricanes on the Atlantic coast occur between July and November. Flooding in equatorial regions occurs in the rain season. As a result, the reinsurer may be interested in how their potential losses fluctuate throughout the year, for example to reduce their exposure through reduced contracts or increased retrocessional coverage during riskier periods. To aid in these decisions, a periodic loss distribution represents the loss distribution for different periods of the year, such as quarters, months, weeks, etc. III. Q U PARA F RAMEWORK In this section, we present our QuRARA framework. Before describing QuPARA, we give an overview of the steps involved in answering an aggregate query sequentially. This will be helpful in understanding the parallel evaluation of aggregate queries using QuPARA. The loss distribution is computed from the portfolio and the YET in two phases. The first phase computes a year loss table (YLT). For each trial in the YET, each event in this trial, and each ELT that includes this event, the YLT contains a tuple htrial, event, ELT, lossi recording the loss incurred by this event, given the layer’s financial terms and the sequence of events in the trial up to the current event. The second phase then aggregates the entries in the YLT to compute the final loss distribution. Algorithm 1 shows the sequential computation of the YLT. Algorithm 1: Sequential Aggregate Risk Analysis Input: Portfolio and YET Output: YLT 1 2 3 4 5 6 7 8 9 10 11 12 for each trial T in the YET do for each event X in T do for each program P in the portfolio do for each layer L in P do for each ELT E covered by L do Lookup X in E to determine the loss lX associated with X lL ← lL + lX Apply per-occurrence and aggregate financial terms to lL lP ← lP + lL lP F ← lP F + lP lT ← lT + lP F Populate Y LT After looking up the losses incurred by a given event in the ELTs of a given layer and summing these losses, the resulting layer loss lL is reduced by applying the layer’s per-occurrence and aggregate financial terms. The remaining loss is added to the program loss lP for this event, which in turn is added tho the portfolio loss lP F for this event. Finally, the loss of an entire trial, lT is computed by summing the portfolio losses for all events in the trial. Depending on the level of detail of the final analysis, the YLT is populated with the loss values at different levels of aggregation. At one extreme, if only the loss distribution for the entire portfolio is of interest, there is one loss value per trial. At the other extreme, if the filtering of losses based on some combination of region, peril, LOB, etc. is required, the YLT contains one loss value for each htrial, program, layer, ELT, eventi tuple. In order to answer ad hoc aggregate queries efficiently, our QuPARA framework provides a parallel implementation of such queries using the MapReduce programming model. The computation of the YLT is the responsibility of the mapper, while the computation of the final loss distribution(s) is done by the reducer. Next we describe the components of QuPARA. Fig. 2. The Query-Driven Portfolio Aggregate Risk Analysis (QuPARA) Framework A. Components Figure 2 visualizes the design of QuPARA. The framework is split into a front-end offering a query interface to the user, and a back-end consisting of a distributed file system and a query engine that executes the query using MapReduce. As already stated, the user poses a query to the query interface using an SQL-like syntax and does not need to have any knowledge of the implementation of the back-end. The query interface offers a web-based portal through which the user can issue ad hoc queries in an SQL-like syntax. The query is then parsed and passed to the query engine. The distributed file system, implemented using Hadoop’s HDFS, stores the raw portfolio data, as well as the YET in tabular form. The query engine employs the MapReduce framework to evaluate the query using a single round consisting of a map/combine step and a reduce step. During the map step, the engine uses one mapper per trial in the YET, in order to construct a YLT from the YET, equivalent to the sequential construction of the YLT from the YET using Algorithm 1. The combiner and reducer collaborate to aggregate the loss information in the YLT into the final loss distribution for the query. There is one combiner per mapper. The combiner pre-aggregates the loss information produced by this mapper, in order to reduce the amount of data to be sent across the network to the reducer(s) during the shuffle step. The reducer(s) then carry out the final aggregation. In most queries, which require only a single loss distribution as output, there is a single reducer. Multi-marginal analysis is an example where multiple loss distributions are to be computed, one per subset of the potential contracts to be added to the portfolio. In this case, we have one reducer for each such subset, and each reducer produces the loss distribution for its corresponding subset of contracts. Each mapper retrieves the set of ELTs required for the query from the distributed file system using a layer filter and an ELT filter. Specifically, the query may specify a subset of the layers in the portfolio to be the subject of the analysis. The layer filter retrieves the identifiers of the ELTs contained in these layers from the layer table. If the query specifies, for example, that the analysis should be restricted to a particular type of peril, the ELT filter then extracts from this set of ELTs the subset of ELTs corresponding to the specified type of peril. Given this set of ELT identifiers, the mapper retrieves the actual ELTs and, in memory, constructs a combined ELT associating a loss with each hevent, ELTi pair. It then iterates over the sequence of events in its trial, looks up the ELTs recording non-zero losses for each event, and generates the corresponding htrial, event, ELT, lossi tuple in the YLT, taking each ELT’s financial terms into account. The aggregation to be done by the combiner depends on the query. In the simplest case, a single loss distribution for the selected set of layers and ELTs is to be computed. In this case, the combiner sums the loss values in the YLT output by the mapper and sends this aggregate value to the reducer. A more complicated example is the computation of a weekly loss distribution. In this case, the combiner would aggregate the losses corresponding to the events in each week and send each aggregate to a different reducer. Each reducer is then responsible for computing the loss distribution for one particular week. Algorithm 2: Mapper in parallel aggregate risk analysis Input: hT, E := {E1 , E2 , · · · , Em }i, where m is the number of events in a trial Output: A list of entries hT, Ei , lP F i of the YLT 1 2 3 4 5 6 7 8 9 The following is a more detailed description of the mapper, combiner, and reducer used to implement parallel aggregate risk analysis in MapReduce. 1) Mapper: The mapper, shown in Algorithm 2, takes as input an entire trial and the list of its events, represented as a pair hT, E := {E1 , E2 , . . . , Em }i. Algorithm 2 does not show the construction of the combined ELT (CELT) and layer list (LLT) performed by the mapper before carrying out the steps in lines 1–9. The loss estimate of an event in a portfolio is computed by scanning through every layer L in the LLT, retrieving and summing the loss estimates for all ELTs covered by this layer, and finally applying the layer’s financial terms. 2) Combiner: The combiner, shown in Algorithm 3, receives as input the list of triples hT , Ei , lP F i generated by a single mapper, that is, the list of loss values for the events in one specific trial. The combiner groups these loss values according to user-specified grouping criteria and outputs one aggregate loss value per group. 3) Reducer: The reducer, shown in Algorithm 4, receives as input the loss values for one specific group and for all trials in the YET. The reducer then aggregates these loss values into the loss statistic requested by the user. For example, to generate an exceedance probability curve, the reducer sorts the received loss values in increasing order and, for each loss value v in a user-specified set of loss values, reports the percentage of trials Apply L’s financial terms to lL lP F ← lP F + lL Emit(hT , Ei , lP F i) Algorithm 3: Combiner in parallel aggregate risk analysis Input: A list of YLT entries hT , Ei , lP F i for the events in a given trial T . Output: A list of aggregate YLT entries hGi , T , lG i with key Gi for the event groups in trial T 1 2 3 A reducer, finally, receives one loss value per trial. It sorts these loss values in increasing order and uses this sorted list to generate a loss distribution. for each event, Ei in E do Look up Ei in the CELT and find corresponding 1 2 n losses, lEi = {lE , lE , · · · , lE }, where ELT1 , ELT2 , i i i . . . , ELTn are the ELTS in the CELT for each layer, L, in the LLT do for each ELT ELTj covered by L do j Lookup lE in lEi i j lL ← lL + lEi 4 5 Join input tuples with event catalogue to annotate events with their attributes (region, peril, etc.) Group events in the input list by event features according to the user’s query for each group Gi do lGi ← sum of the loss values associated with the events in Gi in trial T Emit(hT , Gi , LG i) with a loss value greater than v as the probability of incurring a loss higher than v. Algorithm 4: Reducer in parallel aggregate risk analysis Input: A list of loss tuples hGi , T , lP F i for an event group Gi . Output: Loss statistics for event group Gi based on user’s query 1 Based on user query, generate: (i) Group loss distribution, or (ii) Group loss statistics, or (iii) Group value-at-risk (VaR) and/or Tail value-at-risk (TVaR), or (iv) Exceedance probability curves B. Data Organization The data used by QuPARA is stored in a number of tables: • The year event table YET contains tuples htrial_ID, event_ID, time_Index, z_PEi. trial_ID is a unique identifier associated with each of the one million trials in the simulation. event_ID is a unique identifier associated with each event in the event catalogue. • • • • • • • • time_Index determines the position of the occurrence of the event in the sequence of events in the trial. z_PE is a random number specific to the program and event occurrence. Each event occurrence across different programs has a different associated random number. The layer table LT contains tuples hlayer_ID, cob, lob, tob, elt_IDsi. layer_ID is a unique identifier associated with each layer in the portfolio. cob is an industry classification according to perils insured and the related exposure and groups homogeneous risks. lob defines a set of one or more related products or services where a business generates revenue. tob describes how reinsurance coverage and premium payments are calculated. elt_IDs is a list of event loss table IDs that are covered by the layer. The layer list table LLT contains tuples hlayer_ID, occ_Ret, occ_Lim, agg_Ret, agg_Limi. Each entry is a simplified representation of the layer identified by layer_ID. occ_Ret is the occurrence retention or deductible of the insured for an individual occurrence loss. occ_Lim is the occurrence limit or coverage the insurer will pay for occurrence losses in excess of the occurrence retention. agg_Ret is the aggregate retention or deductible of the insured for an annual cumulative loss. agg_Lim is the aggregate limit or coverage the insurer will pay for annual cumulative losses in excess of the aggregate retention. The event loss table pool ELTP contains tuples helt_ID, region, perili. Each such entry associates a particular type of peril and a particular region with the ELT with ID elt_ID. The extended event loss table EELT contains tuples hevent_ID, z_E, mean_Loss, sigma_I, sigma_C, max_Lossi. event_ID is the unique identifier of an event in the event catalogue. z_E is a random number specific to the event occurrence. Event occurrences across different programs have the same random number. mean_Loss denotes the mean loss incurred if the event occurs. max_Loss is the maximum expected loss incurred if the event occurs. sigma_I represents the variance of the loss distribution for this event. sigma_C represents the error of the event-occurrence dependencies. The combined event loss table CELT is not stored on disk but is constructed by each mapper in memory from the extended event loss tables corresponding to the user’s query. It associates with each event ID event_ID a list of tuples helt_ID, z_E, mean_Loss, sigma_I, sigma_C, max_Lossi, which is the loss information for event event_ID stored in the extended ELT elt_ID. The year event loss table YELT is an intermediate table produced by the mapper for consumption by the combiner. It contains tuples htrial_ID, event_ID, time_Index, estimated_Lossi. The event catalogue ECT contains tuples hevent_ID, region, perili associating a region and a type of peril with each event. The year region peril loss table YRPLT contains tuples htrial_ID, time_Index, region, peril, estimated_Lossi, listing for each trial the estimated loss at a given time, in a given region, and due to a particular type of peril. This is yet another intermediate table, which is produced by the combiner for consumption by the reducer. C. Data Filters QuPARA incorporates three types of data filters that allow the user to focus their queries on specific geographic regions, types of peril, etc. These filters select the appropriate entries from the data tables they operate on, for further processing my the mapper, combiner, and reducer. • The layer filter extracts the set of layers from the layer table LT and passes this list of layers to the mapper as the “portfolio” to be analyzed by the query. The list of selected layers is also passed to the ELT filter for selection of the relevant ELTs. • The ELT filter is used to select, from the ELT pool ELTP, the set of ELTs required by the layer filter and for building the combined ELT CELT. • The event filter selects the features of events from the event catalogue ECT to provide the grouping features to the combiner. IV. A N E XAMPLE Q UERY An example of an ad hoc request on QuPARA is to generate a report on seasonal loss value-at-risk (VaR) with confidence level of 99% due to hurricanes and floods that affects all commercial properties in different locations in Florida. The user poses the query through the query interface, which translates the query into a set of five SQL-like queries to be processed by the query engine: Q1 : The first part of processing any user query is the query to be processed by the layer filter. In this case, we are interested in all layers covering commercial properties, which translates into the following SQL query: SELECT * FROM LT WHERE lob IN commercial Q2 : The second query is processed by the ELT filter to extract the ELTs relevant for the analysis. In this case, we are interested in all ELTs covered by layers returned by query Q1 and which cover Florida (FL) as the region and hurricanes (HU) and floods (FLD) as perils: SELECT elt_ID FROM ELTP WHERE elt_ID IN Q1 AND region IN FL AND peril IN HU, FLD Q3 : This query is provided to the event filter for retrieving event features required for grouping estimated losses in the YELT. SELECT event_ID AND region FROM YELT Q4 : This query is provided to the combiner for grouping all events in a trial based on their order of occurrence. For example, if there are 100 events equally distributed in a year and need to be grouped based on the four seasons in a year, then the estimated loss for each season is the sum of 25 events that occur in that season. SELECT trial_ID, SEASON_SUM(estimated_Loss) FROM YELT GROUP BY time_Index Q5 : This query is provided to the reducer to define the final output of the user request. The seasonal loss Value-at-Risk (VaR) with 99% confidence level is estimated. SELECT VaR IN 0.01 FROM YRPLT V. I MPLEMENTATION For our implementation of QuPARA, we used Apache Hadoop, an open-source software framework that implements the MapReduce programming model [9], [10], [18]. We chose Hadoop because other available frameworks [20], [21] require the use of additional interfaces, commercial or web-based, for deploying an application. A number of interfaces provided by Hadoop, such as the InputFormat and the OutputFormat are implemented as classes. The Hadoop framework works in the following way for a MapReduce round. The data files are stored on the Hadoop Distributed File System (HDFS) [19] and are loaded by the mapper. Hadoop provides an InputFormat interface, which specifies how the input data is to be split for processing by the mapper. HDFS provides an additional functionality, called distributed cache, for distributing small data files that are shared by the nodes of the cluster. The distributed cache provides local access to the shared data. The Mapper interface receives the partitioned data and emits intermediate key-value pairs. The Partitioner interface receives the intermediate key-value pairs and controls the partitioning of these keys for the Reducer interface. Then the Reducer interface receives the partitioned intermediate key-value pairs and generates the final output of this MapReduce round. The output is received by the OutputFormat interface and provides it back to HDFS. The input data for a MapReduce round in QuPARA is the year event table YET, the event loss table pool ELTP, the list of layers LT, and the event catalogue ECT, which are stored on HDFS. The master node executes Algorithm 5 and requires access to the ELT pool and the portfolio before the MapReduce round. Firstly, the master node uses the portfolio to decompose the aggregate analysis job into a set of sub-jobs {J1 , · · · , Jx } as shown in line 1, each covering 200 layers. This partition into sub-jobs was chose to ensure a balance between Input/Output cost and the overhead for (sequentially) constructing the combined ELT in each mapper; more sub-jobs means reading the YET more often, whereas fewer and larger jobs increase the overhead of the sequential combined ELT construction. The layers and the corresponding ELTs required by each sub-job are then submitted to the Hadoop job scheduler in lines 2–6. The MapReduce round is illustrated in Figure 3. The InputFormat interface splits the YET based on the number of mappers specified for the MapReduce round. By default, Hadoop splits large files based on HDFS block size, but in this paper, the InputFormat is redefined to split files based on the number of mappers. The mappers are configured so that they receive all the ELTs covered by the entire portfolio via the distributed cache. Each mapper then constructs its own copy of the combined ELT form the ELTs in the distributed cache. Using a combined ELT speeds up the lookup of events in the relevant ELTs in the subsequent processing of the events in the YET. If individual ELTs were employed, then one lookup would be required for fetching the Fig. 3. Apache Hadoop for MapReduce in the QuPARA Framework Algorithm 5: Algorithm for master node in aggregate risk analysis Input: ELT pool, portfolio 1 2 3 4 5 6 Split the portfolio into jobs J1 , · · · , Jx for each Job Ji do Distribute its layers to nodes via the distributed cache for each layer Lj in job Ji do Distribute the ELTs covered by Lj to nodes via the distributed cache Submit Ji to Hadoop job scheduler loss value of an event from each ELT. Using a combined ELT, only a single lookup is required. The mapper now implements Algorithm 2 to compute the loss information for all events in its assigned portion of the YET. The combiner implements Algorithm 3 to group the eventloss pairs received from the mapper and emits the group-loss pairs to the partitioner. The event catalogue is contained in the distributed cache of the combiner and is used by the combiner to implement the grouping of events. The Combiner delivers the grouped loss pairs to the partitioner. The partitioner ensures that all the loss pairs with the same group key are delivered to the same reducer. The reducer implements Algorithm 4 to collect the sorted group-loss pairs and produces year region peril loss table YRPLT. Based on the query, the OutputFormat generates reports which are then saved to the HDFS. The layer filter, ELT filter, and event filter, described earlier, are implemented using Apache Hive [14], which is built on top of the Hadoop Distributed File System and supports data summarization and ad hoc queries using an SQL-like language. VI. P ERFORMANCE E VALUATION In this section, we discuss our experimental setup for evaluating the performance of QuPARA and the results we obtained. Fig. 4. Running time of QuPARA on an increasing number of nodes with a fixed number of layers per job and one job per node A. Platform We evaluated QuPARA on the Glooscap cluster of the Atlantic Computational Excellence Network (ACEnet). We used 16 nodes of of the cluster, each of which was an SGI C2112-4G3 with four quad-core AMD Opteron 8384 (2.7 GHz) processors and 64 GB RAM per node. The nodes were connected via Gigabit Ethernet. The operating system on each node was Red Hat Enterprise Linux 4.8. The global storage capacity of the cluster was 306 TB of Sun SAM-QFS, a hierarchical storage system using RAID 5. Each node had 500GB of local storage. The Java Virtual Machine (JVM) version was 1.6. The Apache Hadoop version was 1.0.4. The Apache Hive version was 0.10.0. B. Results Figure 4 shows the total time taken in seconds for performing aggregate risk analysis on our experimental platform. Up to 16 nodes were used in the experiment. Each node processed one job with 200 layers, each covering 5 unique ELTs. Thus, up to 16,000 ELTs were considered. The YET in our experiments contained 1,000,000 trials, each consisting of 1,000 events. The graph shows a very slow increase in the total running time, in spite of the constant amount of computation to be performed by each node (because every node processes the same number of layers, ELTs, and YET entries). The gradual increase in the running time is due to the increase in the setup time required by the Hadoop job scheduler and the increase in network traffic (reflected in an increase in the time taken by the reducer). Nevertheless, this scheduling and network traffic overhead amounted to only 1.67%–7.13% of the total computation time. Overall, this experiment demonstrates that, if the hardware scales with the input size, QuPARA’s processing time of a query remains nearly constant. Figure 5 shows the increase in running time when the number of layers is increased from 200 to 3200 while keeping the number of nodes fixed. Once again, each layer covered 5 ELTs, the YET contains 1,000,000 trials, each consisting of 1,000 events. 16 nodes were used in this experiment. As expected, the running time of QuPARA increases linearly with the input size as we increase the number of layers. With the Fig. 5. Running time of QuPARA on an increasing number of layers with a fixed number of nodes increase in the number of layers, the time taken for setup, I/O time, and the time for all numerical computations scale in a linear fashion. The time taken for building the combined ELT, by the reducer, and for clean up are a constant. For 200 Layers, only 30% of the time is taken for computations, and the remaining time accounts for system and I/O overheads. For 3200 layers, on the other hand, more than 80% of the time is spent on computations. Figure 6 shows the decrease in running time when the number of nodes is increased but the input size is kept fixed at 3,200 layers divided into 16 jobs of 200 layers. Figure 7 shows the relative speed-up achieved in this experiment, that is, the ratio between the running time achieved on a single node and the running time achieved on up to 16 nodes. Up to 4 nodes, the speed-up is almost linear. Beyond 4 nodes, the speed-up starts to decrease. This is not due to an increase in overhead, but since the computation times have significantly reduced after 4 nodes, the overheads start to take away a greater percent of the total time. In summary, our experiments show that QuPARA is capable of performing ad-hoc aggregate risk analysis queries on industry-size data sets in a matter of minutes. Thus, it is a viable tool for analysts to carry out such analyses interactively. R EFERENCES [1] [2] [3] [4] [5] [6] Fig. 6. Running time of QuPARA on a fixed input size using between 1 and 16 nodes [7] [8] [9] [10] [11] [12] [13] Fig. 7. Speed-up achieved on the QuPARA framework VII. C ONCLUSIONS Typical production systems performing aggregate risk analysis used in the industry are efficient for generating a small set of key portfolio metrics such as PML or TVAR required by rating agencies and regulatory bodies and essential for decision making. However, production systems can neither accommodate nor solve ad hoc queries that provide a better view of the multiple dimensions of risk that can impact a portfolio. The research presented in this paper proposes a framework for portfolio risk analysis capable of expressing and solving a variety of ad hoc catastrophic risk queries, based on MapReduce, and provided a prototype implementation, QuPARA, using the Apache Hadoop implementation of the MapReduce programming model and Apache Hive for expressing ad hoc queries in an SQL-like language. Our experiments demonstrate the feasibility of answering ad hoc queries on industry-size data sets efficiently using QuPARA. As an example, a portfolio analysis on 3,200 layers and using a YET with 1,000,000 trials and 1,000 events per trial took less than 20 minutes. Future work will aim to develop a distributed system by providing an online interface to QuPARA which can support multiple user queries. [14] [15] [16] [17] [18] [19] [20] [21] [22] R. R. Anderson and W. Dong, “Pricing Catastrophe Reinsurance with Reinstatement Provisions using a Catastrophe Model,” Casualty Actuarial Society Forum, Summer 1998, pp. 303-322. G. G. Meyers, F. L. Klinker and D. A. Lalonde, “The Aggregation and Correlation of Reinsurance Exposure,” Casualty Actuarial Society Forum, Spring 2003, pp. 69-152. W. Dong, H. Shah and F. Wong, “A Rational Approach to Pricing of Catastrophe Insurance,” Journal of Risk and Uncertainty, Vol. 12, 1996, pp. 201-218. R. M. Berens, “Reinsurance Contracts with a Multi-Year Aggregate Limit,” Casualty Actuarial Society Forum, Spring 1997, pp. 289-308. G. Woo, “Natural Catastrophe Probable Maximum Loss,” British Actuarial Journal, Vol. 8, 2002. M. E. Wilkinson, “Estimating Probable Maximum Loss with Order Statistics, in Casualty Actuarial Society Forum, 1982, pp. 195209. A. A. Gaivoronski and G. Pflug, “Value-at-Risk in Portfolio Optimization: Properties and Computational Approach,” Journal of Risk, Vol. 7, No. 2, Winter 2004-05, pp. 131. P. Glasserman, P. Heidelberger, and P. Shahabuddin, “Portfolio Valueat-Risk with Heavy-Tailed Risk Factors,” Mathematical Finance, Vol. 12, No. 3, 2002, pp. 239269. T. White, “Hadoop: The Definitive Guide,” 1st Edition, O’Reilly Media, 2009. Apache Hadoop Project website: http://hadoop.apache.org/ [Last accessed: 25 May, 2013]. J. Dean and S. Ghemawat, “MapReduce: Simplified Data Processing on Large Clusters,” Communications of the ACM, Vol. 51, Issue 1, 2008, pp. 107–113. T. Condie, N. Conway, P. Alvaro, J. M. Hellerstein, K. Elmeleegy and R. Sears, “Mapreduce Online,” EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2009136, October 2009. http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/ EECS-2009-136.pdf [Last accessed: 25 May, 2013]. K. -H. Lee, Y. -J. Lee, H. Choi, Y. D. Chung and B. Moon, “Parallel Data Processing with MapReduce: A Survey,” SIGMOD Record Vol. 40, No. 4, 2011, pp. 11–20. HiveQL website: http://hive.apache.org/ [Last accessed: 25 May, 2013]. E. Capriolo, D. Wampler and J. Rutherglen, “Programming Hive,” O’Reilly Media, 1st Edition, 2012. A. Rau-Chaplin, B. Varghese and Z. Yao, “A MapReduce Framework for Analysing Portfolios of Catastrophic Risk with Secondary Uncertainty,” accepted for publication in the Workshop Proceedings of the International Conference on Computational Science, 2013. P. Grossi and H. Kunreuter, “Catastrophe Modelling: A New Approach to Managing Risk,” Springer, 2005. K. Shvachko, K. Hairong, S. Radia, R. Chansler, “The hadoop Distributed File System,” Proceedings of the 26th IEEE Symposium on Mass Storage Systems and Technologies, 2010, pp. 1–10. Hadoop Distributed File System website: http://hadoop.apache.org/docs/ r1.0.4/hdfs design.htmlS [Last accessed: 25 May, 2013] Amazon Elastic MapReduce (Amazon EMR) website: http://aws. amazon.com/elasticmapreduce/ [Last accessed: 25 May, 2013]. Google MapReduce website: https://developers.google.com/appengine/ docs/python/dataprocessing/overview [Last accessed: 25 May, 2013]. C. Eaton, D. Deroos, T. Deutsch, G. Lapis and P. Zikopoulos, “Understanding Big Data: Analytics for Enterprise Class Hadoop and Streaming Data,” McGraw Hill, 2012.
5cs.CE
AD in Fortran Part 1: Design arXiv:1203.1448v2 [cs.PL] 8 Mar 2012 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind Abstract We propose extensions to F ORTRAN which integrate forward and reverse Automatic Differentiation (AD) directly into the programming model. Irrespective of implementation technology, embedding AD constructs directly into the language extends the reach and convenience of AD while allowing abstraction of concepts of interest to scientific-computing practice, such as root finding, optimization, and finding equilibria of continuous games. Multiple different subprograms for these tasks can share common interfaces, regardless of whether and how they use AD internally. A programmer can maximize a function F by calling a library maximizer, XSTAR=ARGMAX(F, X0), which internally constructs derivatives of F by AD, without having to learn how to use any particular AD tool. We illustrate the utility of these extensions by example: programs become much more concise and closer to traditional mathematical notation. A companion paper describes how these extensions can be implemented by a program that generates input to existing F ORTRANbased AD tools. Key words: Nesting, multiple transformation, forward mode, reverse mode, TAPE NADE , A DIFOR, programming-language design 1 Introduction The invention of F ORTRAN was a major advance for numeric computing, allowing Alexey Radul Hamilton Institute, National University of Ireland Maynooth, Ireland, [email protected] Barak A. Pearlmutter Department and Computer Science and Hamilton Institute, National University of Ireland Maynooth, Ireland, [email protected] Jeffrey Mark Siskind Electrical and Computer Engineering, Purdue University, IN, USA, [email protected] 1 2 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind g(x; α , β ) = β α α −1 −β x e x Γ (α ) ✞to be transcribed into a natural but unambiguous notation FUNCTION G(X,ALPHA,BETA) G=BETA**ALPHA/GAMMA(ALPHA)*X**(ALPHA-1)*EXP(-BETA*X) END which could be automatically translated into an executable program. However, transcribing xi+1 = xi − f (xi )/ f ′ (xi ) ✞to F ORTRAN in FUNCTION RAPHSN(F, FPRIME, X0, N) EXTERNAL F, FPRIME X = X0 DO 1690 I=1,N 1690 X = X-F(X)/FPRIME(X) RAPHSN = X END requires that the caller provide both F and FPRIME. Manually coding the latter from the former is, in most cases, a mechanical process, but tedious and error prone. This problem has traditionally been addressed by arranging for an AD preprocessor to produce FPRIME (Speelpenning, 1980; Wengert, 1964). That breakthrough technology not only relieves the programmer of the burden of mechanical coding of derivative-calculation codes, it also allows the derivative code to be updated automatically, ensuring consistency and correctness. However, this caller derives discipline has several practical difficulties. First, the user must learn how to use the AD preprocessor, which constitutes a surprisingly serious barrier to adoption. Second, it makes it very difficult to experiment with the use of different sorts of derivatives (e.g., adding a Hessian-vector product step in an optimization) in such called subprograms, or to experiment with different AD preprocessors. Third, although preprocessors might be able to process code which has already been processed in order to implement nested derivatives, the maneuvers required by current tools can be somewhat arcane (Siskind and Pearlmutter, 2008a). Fourth, software engineering principles of locality and atomicity are being violated: knowledge of what derivatives are needed is distributed in a number of locations which must be kept consistent; and redundant information, which must also be kept consistent, is being passed, often down a long call chain. We attempt to solve these problems, making the use of AD more concise, convenient, and intuitive to the scientific programmer, while keeping to the spirit of F ORTRAN. This is done using the Forward And Reverse Fortran Extension Language or FARFEL, a small set of extensions to F ORTRAN, in concert with an implementation strategy which leverages existing F ORTRAN compilers and AD preprocessors (Bischof et al., 1992; Hascoët and Pascual, 2004). The remainder of the paper is organized as follows: Section 2 describes FARFEL. Section 3 describes a concrete example FARFEL program to both motivate and illuminate the proposed extensions. Section 4 situates this work in its broader context. AD in Fortran: Design 3 Section 5 summarizes this work’s contributions. A companion paper (Radul et al., 2012) describes how FARFEL can be implemented by generating input to existing AD tools. 2 Language Extensions FARFEL consists of two principal extensions to F ORTRAN: syntax for AD and for nested subprograms. We currently support only F ORTRAN77, but there is no barrier, in principle, to adding FARFEL to more recent dialects. Extension 1: AD Syntax Traditional mathematical notation allows one to specify φ′ = d  1 1  x − x̄ 2  √ exp − dσ 2 σ 2πσ 2 ✞By analogy, we extend F ORTRAN to encode this as ADF(TANGENT(SIGMA) = 1) PHI = 1/SQRT(2*PI*SIGMA**2)*EXP(-0.5*((X-XBAR)/SIGMA)**2) END ADF(PHIPRM = TANGENT(PHI)) which computes the derivative PHIPRM of PHI with respect to SIGMA by forward AD. For syntactic details see companion paper (Radul et al., 2012). An analogous FARFEL construct supports computing the same derivative with reverse AD: ✞ ADR(COTANGENT(PHI) = 1) PHI = 1/SQRT(2*PI*SIGMA**2)*EXP(-0.5*((X-XBAR)/SIGMA)**2) END ADR(PHIPRM = COTANGENT(SIGMA)) Note that with the ADR construct, the dependent variable appears at the beginning of the block and the independent variable at the end—the variables and assignments in the opening and closing statements specify the desired inputs to and outputs from the reverse phase, whereas the statements inside the block give the forward phase. These constructs allow not just convenient expression of AD, but also modularity and encapsulation of code which employs AD. For instance, we can write a general ✞scalar-derivative subprogram DERIV1 at user level FUNCTION DERIV1(F, X) EXTERNAL F ADF(X) Y = F(X) END ADF(DERIV1 = TANGENT(Y)) END ✞which could be used in, for example, FUNCTION PHI(SIGMA) PHI = 1/SQRT(2*PI*SIGMA**2)*EXP(-0.5*((X-XBAR)/SIGMA)**2) END 4 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind PHIPRM = DERIV1(PHI, SIGMA) ✞DERIV1 can be changed to use reverse AD without changing its API: FUNCTION DERIV1(F, X) EXTERNAL F ADR(Y) Y = F(X) END ADR(DERIV1 = COTANGENT(X)) END allowing codes written with DERIV1 to readily switch between using forward and reverse AD. To take a more elaborate example, we can write a general gradient calculation GRAD using repeated forward AD: ✞ SUBROUTINE GRAD(F, X, N, DX) EXTERNAL F DO 1492 I=1,N ADF(TANGENT(X(J)) = 1-MIN0(IABS(I-J),1), J=1,N) Y = F(X) 1492 END ADF(DX(I) = TANGENT(Y)) END (Note that the ADF and ADR constructs support implied-DO syntax for arrays.) ✞ This can be modified to instead use reverse AD without changing the API: SUBROUTINE GRAD(F, X, N, DX) EXTERNAL F ADR(Y) Y = F(X) END ADR(DX(I) = COTANGENT(X(I)), I=1,N) END Although not intended to support checkpoint-reverse AD, our constructs are suffi✞ciently powerful to express a reverse checkpoint: C CHECKPOINT REVERSE F->G. BOTH 1ST ARG IN, 2ND ARG OUT CALL F(X, Y) ADR(COTANGENT(Z(I)) = . . ., I=1,NZ) CALL G(Y, Z) END ADR(DY(I) = COTANGENT(Y(I)), I=1,NY) ADR(COTANGENT(Y(I)) = DY(I), I=1,NY) CALL F(X, Y) END ADR(DX(I) = COTANGENT(X(I)), I=1,NX) This sort of encapsulation empowers numeric programmers to conveniently experiment with the choice of differentiation method, or with the use of various sorts of derivatives, including higher-order derivatives, without tedious modification of lengthy call chains. Extension 2: Nested Subprograms We borrow from A LGOL 60 (Backus et al., 1963) and generalize the F ORTRAN “statement function” construct by allowing subprograms to be defined inside other subprograms, with lexical scope. For example, given a univariate maximizer ARGMAX, we can express the idea of line search as follows: AD in Fortran: Design 5 ✞ C MAXIMIZE F ALONG THE LINE PARALLEL TO XDIR THROUGH X SUBROUTINE LINMAX(F, X, XDIR, LENX, N, XOUT) EXTERNAL F DIMENSION Y(50) FUNCTION ALINE(DIST) DO 2012 I=1,LENX 2012 Y(I) = X(I)+DIST*XDIR(I) ALINE = F(Y) END BESTD = ARGMAX(ALINE, 0.0, N) DO 2013 I=1,LENX 2013 XOUT(I) = X(I)+BESTD*XDIR(I) END Here we are using a library univariate maximizer to maximize the univariate function ALINE, which maps the distance along the given direction to the value of our multidimensional function of interest F at that point. Note that ALINE refers to variables defined in its enclosing scope, namely F, X, XDIR, LENX, and Y. Note that if ARGMAX uses derivative information, AD will be performed automatically on ALINE. 3 Concrete Example We employ a concrete example to show the convenience of the above constructs. We will also illustrate the implementation on this example in (Radul et al., 2012). Let two companies, Apple and Banana, be engaged in competition in a common fashion accessories market. Each chooses a quantity of their respective good to produce, and sells all produced units at a price determined by consumer demand. Let us model the goods as being distinct, but partial substitutes, so that availability of products of A decreases demand for products of B and vice versa (though perhaps not the same amount). We model both companies as having market power, so the price each gets will depend on both their own output and their competitor’s. Each company faces (different) production costs and seeks to maximize its profit, so we can model this situation as a two player game. Let us further assume that the quantities involved are large enough that discretization effects can be disregarded. An equilibrium (a∗ , b∗ ) of a two-player game with continuous scalar strategies a and b and payoff functions A(a, b) and B(a, b) must satisfy a system of equations: a∗ = argmax A(a, b∗ ) b∗ = argmax B(a∗ , b) a (1) b Equilibria can be sought by finding roots of a∗ = argmax A(a, argmax B(a∗ , b)) a (2) b which is the technique we shall employ.1 Translated into computer code in the most natural way, solving this equation involves a call to an optimization subprogram within the function passed to an optimization subprogram, itself within the function 6 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind passed to a root-finding subprogram. If said optimization and root-finding subprograms need derivative information, this gives rise to deeply nested AD. Note that in (2), the payoff function B is bivariate but argmax takes a univariate (in the variable of maximization) objective function. The a∗ variable passed to B is free in the innermost argmax expression. Free variables occur naturally in mathematical notation, and we support them by allowing nested subprogram definitions. ✞ We can use our extensions to code finding the roots of (2) in a natural style: C ASTAR & BSTAR: GUESSES IN, OPTIMIZED VALUES OUT SUBROUTINE EQLBRM(BIGA, BIGB, ASTAR, BSTAR, N) EXTERNAL BIGA, BIGB FUNCTION F(ASTAR) FUNCTION G(A) FUNCTION H(B) H = BIGB(ASTAR, B) END BSTAR = ARGMAX(H, BSTAR, N) G = BIGA(A, BSTAR) END F = ARGMAX(G, ASTAR, N)-ASTAR END ASTAR = ROOT(F, ASTAR, N) END where we implement just the minimal cores of one-dimensional optimization and ✞root finding to illustrate the essential point — root finding by the Rhapson method: FUNCTION ROOT(F, X0, N) X = X0 DO 1669 I=1,N CALL DERIV2(F, X, Y, YPRIME) 1669 X = X-Y/YPRIME ROOT = X END ✞ SUBROUTINE DERIV2(F, X, Y, YPRIME) EXTERNAL F ADF(X) Y = F(X) END ADF(YPRIME = TANGENT(Y)) END ✞and optimization by finding the root of the derivative: FUNCTION ARGMAX(F, X0, N) FUNCTION FPRIME(X) FPRIME = DERIV1(F, X) END ARGMAX = ROOT(FPRIME, X0, N) END 1 The existence or uniqueness of an equilibrium is not in general guaranteed, but our particular A and B have a unique equilibrium. Coordinate descent (alternating optimization of a∗ and b∗ ) would require less nesting, but has inferior convergence properties. Although this example involves AD through iterative processes, we do not address that issue in this work: it is beyond the scope of this paper, and used here only in a benign fashion, for vividness. AD in Fortran: Design 7 On our concrete objective functions these converge rapidly, so for clarity we skip the clutter of convergence detection. This strategy impels us to compute derivatives nested five deep, in a more complicated pattern than just a fifth-order derivative of a single function. This undertaking is nontrivial with current AD tools (Siskind and Pearlmutter, 2008a), but becomes straightforward with the proposed extensions—embedded AD syntax and nested subprograms make it straightforward to code sophisticated methods that require complex patterns of derivative information. 4 Discussion The FARFEL AD extensions hew to the spirit of F ORTRAN, which tends to prefer blocks rather than higher-order operators for semantic constructs. (In this, these extensions are syntactically quite similar to a set of AD extensions integrated with the NAGware F ORTRAN 95 compiler (Naumann and Riehme, 2005), albeit quite different semantically. Unfortunately those NAGware extensions are no longer publicly available, and the limited available documentation is insufficient to allow a detailed comparison.) A reasonably straightforward implementation technology involves changing transformed blocks into subprograms that capture their lexical variable context and closure-converting these into top-level subprograms, rendering them amenable to processing with existing tools (Radul et al., 2012). Since the machinery for nested subprograms is present, allowing them imposes little additional implementation effort. Moreover, as seen in the example above, that extension makes code that involves heavy use of higher-order functions, which is encouraged by the availability of the AD constructs, more straightforward. In this sense AD blocks and nested subprograms interact synergistically. These new constructs are quite expressive, but this very expressiveness can tax many implementations, which might not support some combinations or usages. For instance, code which makes resolution of the AD at compile time impossible (an n-th derivative subprogram, say) would be impossible to support without a dynamic run-time AD mechanism. This would typically not be available. Another common restriction would be that many tools do not support reverse mode at all and even those that do typically do not allow nesting over reverse mode, either reverse-overreverse or forward-over-reverse. It is the responsibility of the implementation to reject such programs with a cogent error. The FARFEL extensions are implemented by the FARFALLEN preprocessor (Radul et al., 2012), which generates input for and invokes existing AD tools. This leverages existing AD systems to provide the differentiation functionality in a uniform and integrated way, extending the reach of AD by making its use easier, more natural, and more widely applicable. Such a prepreprocessor can target different AD systems (like A DIFOR (Bischof et al., 1992) and TAPENADE (Hascoët and Pascual, 2004)), allowing easy porting of code from one AD system to another. It could even mix AD systems, for example 8 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind using TAPENADE to reverse-transform code generated by using A DIFOR in forward mode, capturing their respective advantages for the application at hand. The effort of implementing such retargetings and mixings could then be factored to one developer (of the prepreprocessor) instead of many end users of AD. A more important benefit of extending F ORTRAN with AD syntax and nested subprograms is that a host of notions become reusable abstractions—not just firstorder derivatives, but also their variations, combinations, and uses, e.g., Jacobians, Hessians, Hessian-vector products, filters, edge detectors, Fourier transforms, convolutions, Hamiltonians, optimizations, integration, differential-equation solvers. The interfaces to different methods for these tasks can be made much more uniform because, as our ARGMAX did, they can accept subprograms that just accept the variables of interest (in this case, the argument of maximization) and take any needed side information from their lexical scope; and subprograms such as ARGMAX can obtain any derivative information they wish from AD without having to demand it be passed in as arguments. So different maximization methods can be tried out on the same objective function with ease, regardless of how much derivative information they require; and at the same time, different objective functions, that carry different side information, can be maximized by the same maximization subprogram without having to adjust it to transmit the needed side information. Essentially, derivatives are requested where they are needed, and the implementation does the necessary bookkeeping. These modularity benefits are illustrated by our example program: the FARFEL input is only 64 lines of code, whereas the amount of code it expands into, which is comparable to what would need to be written by hand without these extensions, weighs in at a much more substantial 160 for TAPENADE and 315 for A DIFOR, including the configuration data needed to run the AD preprocessors to produce the needed derivatives. Manually performing the 5 nested applications of AD this example calls for is a tedious, error prone, multi-hour effort, which must be undertaken separately for each preprocessor one wishes to try.2 Existing AD tools do already save the major labor of manually implementing derivative and gradient subprograms, and keeping them in sync with the subprograms being differentiated. The further preprocessing step outlined above leverages these tools into being even more useful. For larger programs, the savings of implementation and maintenance effort would be considerable. The present suggestion is not, of course, limited to F ORTRAN. Nested subprograms have gained wide adoption in programming-language designs from A L GOL 60 and beyond, and have yielded proven gains in programmer productivity. Their advantages for code expressiveness have led to functions with lexical scope being used as a mathematical formalism for reasoning about computing (Church, 1941), to programming languages organized around the function as the primary program construct (Jones, 2003), and to compilers that specialize in the efficient representation and use of functions (Jones et al., 1993; Steele, 1978). 2 A detailed step-by-step discussion of the transformation of this example along with all intermediate code is available at http://www.bcl.hamilton.ie/˜ qobi/fortran/. AD in Fortran: Design Fig. 1 Performance comparison. Smaller is faster. Numeric solution of (2) with above FARFEL code, N = 1000 iterations at each level, FARFALLEN targeting two F ORTRAN -based AD tools; for comparison, the same computation is coded in VLAD (Pearlmutter and Siskind, 2008) and compiled with S TALINGRAD (Siskind and Pearlmutter, 2008b). Computer: Intel i7 870 @ 2.93GHz, G FORTRAN 4.6.29, 64-bit Debian sid, -Ofast -fwhole-program, single precision. See (Radul et al., 2012) for details. 9 CPU Time (seconds) 10 8.92 6.97 5.83 5 0 TAPENADE A DIFOR S TALINGRAD One can also add ADF- and ADR-like constructs to other languages that have preprocessor implementations of AD, for example, C and ADIC (Bischof et al., 1997). One would not even need to add nested subprograms in the preprocessor, because GCC already implements them for GNU C. Doing so would expand the convenience (and therefore reach) of existing AD technology even further. Retrofitting AD onto existing languages by preprocessing is not without its limitations, however. Efficient AD preprocessors must construct a call graph in order to determine which subprograms to transform, along with a variety of other tasks already performed by the compiler. Moreover, optimizing compilers cannot be relied upon to aggressively optimize intricate machine-generated code, as such code often exceeds heuristic cutoffs in various optimization transformations. This imposes a surprisingly serious limitation on AD preprocessors. (Together, these also imply a significant duplication of effort, while providing room for semantic disagreements between AD preprocessors and compilers which can lead to subtle bugs.) This leads us to anticipate considerable performance gains from designing an optimizing compiler with integrated AD. Indeed, translating our concrete example into VLAD (Pearlmutter and Siskind, 2008) and compiling with S TALINGRAD (Siskind and Pearlmutter, 2008b), our prototype AD-enabled compiler, justifies that suspicion (see Fig. 1). We therefore plan to make a VLAD back-end available in version 2 of FARFALLEN. 5 Conclusion We have defined and motivated extensions to F ORTRAN for convenient, modular programming using automatic differentiation. The extensions can be implemented 10 Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind as a prepreprocessor (Radul et al., 2012). This strategy enables modular, flexible use of AD in the context of an existing legacy language and tool chain, without sacrificing the desirable performance characteristics of these tools: only about 20%– 50% slower than a dedicated AD-enabled compiler, depending on which F ORTRAN AD system is used. Acknowledgements This work was supported, in part, by Science Foundation Ireland grant 09/IN.1/I2637, National Science Foundation grant CCF-0438806, the Naval Research Laboratory under Contract Number N00173-10-1-G023, and the Army Research Laboratory accomplished under Cooperative Agreement Number W911NF-10-2-0060. Any views, opinions, findings, conclusions, or recommendations contained or expressed in this document or material are those of the author(s) and do not necessarily reflect or represent the views or official policies, either expressed or implied, of SFI, NSF, NRL, the Office of Naval Research, ARL, or the Irish or U.S. Governments. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes, notwithstanding any copyright notation herein. References J. W. Backus, F. L. Bauer, J. Green, C. Katz, J. McCarthy, P. Naur, A. J. Perlis, H. Rutishauser, K. Samelson, B. Vauquois, J. H. Wegstein, A. van Wijngaarden, and M. Woodger. Revised report on the algorithmic language ALGOL 60. The Computer Journal, 5(4):349–367, 1963. doi: 10.1093/comjnl/5.4.349. Christian H. Bischof, Alan Carle, George F. Corliss, Andreas Griewank, and Paul D. Hovland. ADIFOR: Generating derivative codes from Fortran programs. Scientific Programming, 1(1):11–29, 1992. Christian H. Bischof, Lucas Roh, and Andrew Mauer. ADIC — An extensible automatic differentiation tool for ANSI-C. Software–Practice and Experience, 27(12):1427–1456, 1997. doi: 10.1002/(SICI)1097-024X(199712) 27:12h1427::AID-SPE138i3.0.CO;2-Q. URL http://www-fp.mcs.anl. gov/division/software. Alonzo Church. The Calculi of Lambda Conversion. Princeton University Press, Princeton, NJ, 1941. Laurent Hascoët and Valérie Pascual. TAPENADE 2.1 user’s guide. Rapport technique 300, INRIA, Sophia Antipolis, 2004. URL http://www.inria.fr/ rrrt/rt-0300.html. Simon Peyton Jones. Haskell 98 language and libraries: the revised report. Journal of Functional Programming, 13(1), January 2003. S.L.P. Jones, C. Hall, K. Hammond, W. Partain, and P. Wadler. The Glasgow Haskell compiler: a technical overview. In Proc. UK Joint Framework for Information Technology (JFIT) Technical Conference, volume 93, 1993. Uwe Naumann and Jan Riehme. Computing adjoints with the NAGWare Fortran 95 compiler. In H. M. Bücker, G. Corliss, P. Hovland, U. Naumann, and B. Norris, editors, Automatic Differentiation: Applications, Theory, and Implementations, AD in Fortran: Design 11 volume 50 of Lecture Notes in Computational Science and Engineering, pages 159–169. Springer, New York, NY, 2005. doi: 10.1007/3-540-28438-9 14. Barak A. Pearlmutter and Jeffrey Mark Siskind. Using programming language theory to make automatic differentiation sound and efficient. In Christian H. Bischof, H. Martin Bücker, Paul D. Hovland, Uwe Naumann, and J. Utke, editors, Advances in Automatic Differentiation, volume 64 of Lecture Notes in Computational Science and Engineering, pages 79–90. Springer, Berlin, 2008. ISBN 978-3-540-68935-5. doi: 10.1007/978-3-540-68942-3 8. Alexey Radul, Barak A. Pearlmutter, and Jeffrey Mark Siskind. AD in Fortran, Part 2: Implementation via prepreprocessor. In Advances in Automatic Differentiation, Lecture Notes in Computational Science and Engineering, Berlin, 2012. Springer. To appear. Also arXiv technical report http://arxiv.org/abs/ 1203.1450. Jeffrey Mark Siskind and Barak A. Pearlmutter. Putting the automatic back into AD: Part I, What’s wrong. Technical Report TR-ECE-08-02, School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN, USA, jan 2008a. URL http://docs.lib.purdue.edu/ecetr/368. Jeffrey Mark Siskind and Barak A. Pearlmutter. Using polyvariant union-free flow analysis to compile a higher-order functional-programming language with a firstclass derivative operator to efficient Fortran-like code. Technical Report TRECE-08-01, School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN, USA, jan 2008b. URL http://docs.lib.purdue. edu/ecetr/367. B. Speelpenning. Compiling Fast Partial Derivatives of Functions Given by Algorithms. PhD thesis, Department of Computer Science, University of Illinois at Urbana-Champaign, Urbana-Champaign, IL, January 1980. Guy Lewis Steele, Jr. RABBIT, a compiler for Scheme. Technical Report TR474, Artificial Intelligence Laboratory, Massachusetts Institute of Technology, Cambridge, MA, USA, May 1978. R. Wengert. A simple automatic derivative evaluation program. Communications of the ACM, 7(8):463–464, 1964.
6cs.PL
A Model Predictive Control Approach for Low-Complexity Electric Vehicle Charging Scheduling: Optimality and Scalability Wanrong Tang Student Member, IEEE and Ying Jun (Angela) Zhang, Senior Member, IEEE arXiv:1502.01456v3 [math.OC] 1 Apr 2016 Department of Information Engineering, The Chinese University of Hong Kong Shatin, New Territories, Hong Kong Abstract—With the increasing adoption of plug-in electric vehicles (PEVs), it is critical to develop efficient charging coordination mechanisms that minimize the cost and impact of PEV integration to the power grid. In this paper, we consider the optimal PEV charging scheduling, where the non-causal information about future PEV arrivals is not known in advance, but its statistical information can be estimated. This leads to an “online” charging scheduling problem that is naturally formulated as a finitehorizon dynamic programming with continuous state space and action space. To avoid the prohibitively high complexity of solving such a dynamic programming problem, we provide a Model Predictive Control (MPC) based algorithm with computational complexity O(T 3 ), where T is the total number of time stages. We rigorously analyze the performance gap between the nearoptimal solution of the MPC-based approach and the optimal solution for any distributions of exogenous random variables. Furthermore, our rigorous analysis shows that when the random process describing the arrival of charging demands is first-order periodic, the complexity of proposed algorithm can be reduced to O(1), which is independent of T . Extensive simulations show that the proposed online algorithm performs very closely to the optimal online algorithm. The performance gap is smaller than 0.4% in most cases. I. I NTRODUCTION A. Background and Contributions The massive deployment of PEVs imposes great challenges to smart power grid, such as voltage deviation, increased power losses, and higher peak load demands. It is critical to design PEV charging mechanisms that minimize the cost and impact of PEV integration. Previously, PEV charging coordination has been extensively studied to minimize power loss, minimize load variance, or minimize charging cost, etc [3]–[7]. Ideally, the load demand can be flattened as much as possible if the information about future charging demand is known noncausally when calculating the charging schedule. However, in practice, a PEV charging station only knows the load demand This work was presented in part as [1]. This work was supported in part by the National Basic Research Program (973 program Program number 2013CB336701), and three grants from the Research Grants Council of Hong Kong under General Research Funding (Project number 2150828 and 2150876) and Theme-Based Research Scheme (Project number T23-407/13N). W. Tang is with the Department of Information Engineering, The Chinese University of Hong Kong, Shatin, New Territories, Hong Kong (Email: [email protected]). Y. J. Zhang is with the Department of Information Engineering, The Chinese University of Hong Kong. She is also with Shenzhen Research Institute, The Chinese University of Hong Kong (Email: [email protected]). of the PEVs that have arrived, but not that of the PEVs coming in the future. Fortunately, the statistical information of the future charging demands can often be acquired through historic data, which benefits the control of the PEV charging scheduling in practical scenarios. In this paper, we consider the optimal PEV charging scheduling, assuming that the future charging demand is not known a priori, but its statistical information can be estimated. In particular, we define the cost of PEV charging as a general strictly convex increasing function of the instantaneous load demand. Minimizing such a cost leads to a flattened load demand, which is highly desirable for many reasons [3]–[7]. The online PEV charging scheduling problem is formulated as a finite-horizon dynamic programming problem with continuous state space and action space. To avoid the prohibitively high complexity of solving such a dynamic programming problem, we provide a Model Predictive Control (MPC) approach to obtain a near-optimal solution. Instead of adopting the generic convex optimization algorithms to solve the problem, we propose an algorithm with computational complexity O(T 3 ) by exploring the load flattening feature of the solution, where T is the total number of time stages. We rigorously analyze the performance gap between the near-optimal solution of the MPC-based approach and the optimal solution, and the result applies to any distributions of exogenous random variables. Specially, the performance gap is evaluated by the Value of the Stochastic Solution (VSS), which represents the gap between the solution of the approximate approach and that of dynamic programming problem [8]–[10]. Furthermore, our analysis shows that when the random process describing the arrival of charging demands is first-order periodic, the complexity of proposed algorithm can be reduced to O(1), which is independent of T . Extensive simulations show that the proposed algorithm performs very closely to the optimal solution. The performance gap is smaller than 0.4% in most cases. As such, the proposed algorithm is very appealing for practical implementation due to its scalable computational complexity and close to optimal performance. The rest of the paper is organized as follows. A review of the related work on the PEV charging scheduling with uncertain load demand is presented in Section I-B. We introduce the problem formulations of both offline and online PEV charging problem in Section II. In Section III, we propose a MPC based online algorithm and analyze its performance gap. The O(1)- complexity algorithm is given when the arrival process is firstorder periodic in Section IV. Simulation results are presented in Section V. Finally, the paper is concluded in Section VI. B. Related Work The works on the PEV charging scheduling with uncertain PEV load demand include both simulation-based evaluations [11], [12] and theoretical performance guarantees [13]–[17]. Meanwhile, MPC is one of most commonly approaches for which has been widely adopted in recent studies [12]–[15]. [12] leverages the MPC based method to design a dynamic charging and driving cost control scheme. Both [13] and [14] apply MPC algorithms to minimize the load variation. [15] proposes a plug and play MPC approach to minimize the voltage fluctuations by assuming that the load demand is timeperiodic. Compared to [12]–[15], in this paper we analyze the performance gap between the solution of MPC approach and the optimal solution regardless of the distribution of the load demand. Besides, we provide a more scalable algorithm with O(1)− complexity as well as the optimality analysis for the case when the load demand is first-order periodic. Additionally, the objective functions in [12]–[15] are quadratic forms of load demand. Whereas in this paper, the objective function is a general strictly convex increasing function which reflects both the charging cost and the load variance. As to the amount of information needed, the EV charging scheduling algorithms in [16] and [17] require the probability distribution of the random PEV arrival process. In contrast, the proposed algorithm in this paper only requires the firstorder moment, i.e., the expected values of the random demand patterns. In practice, it is a lot easier to obtain the expected values of random process than to obtain the probability distribution of a random process. Convex cost functions are also considered in [18] and [19]. Both of them devise the online algorithms for battery charging control problems, where there is no charging deadline for the battery. The PEV charging scheduling problem in this paper differs from stationary battery charging in that each PEV has a demand to be satisfied before a certain deadline. II. P ROBLEM F ORMULATION We consider the PEV charging scheduling problem, where PEVs arrive at the charging station at random instants with random charging demands that must be fulfilled before a random departure time. A. Optimal Offline PEV Charging Problem For the ease of understanding, we first introduce an ideal case, where all the non-causal information of based load and the PEVs, including the arrival times, departure times and charging demands are known to the charging station before the system time. The entire system time is divided into T equal-length time slots. Let N denote the set of PEVs that arrive during the system time. Notice that for a given time slot number T , N is itself a random set due to the random arrival of PEVs. We denote by I(t) the set of PEVs that (s) are in the charging station during slot t. Denote by ti and (e) ti the arrival time slot and the departure time slot of PEV i, respectively. di denotes the charging demand that PEV i requires. The charging station needs to decide, the charging rate xit , ∀i ∈ I(t). To satisfy the demand di , xit must satisfy Pt(e) i (s) xit = di . Let st be the total charging rate of time slot t=ti t, i.e., X xit , ∀t = 1, 2, · · · , T, st = (1) i∈I(t) which is also called charging load at time t. The total load consists of both the charging load and the inelastic base load in the same location. The base load, denoted by lt , represents the load of other electricity consumptions at time t except P for PEV charging. Then, the total load at time t is given by i∈It xit + lt . Suppose that the charging cost at time t is a strictly convex increasing function of the total load, denoted by f (st + lt ). The convexity and increasing property of f (st + lt ) reflects the fact that each unit of additional power demand becomes more expensive to obtain and make available to the consumer. For example, in the wholesale market, the instantaneous cost can be modeled as an increasing quadratic function of the instant load [4]–[6]. On the other hand, the convexity of f (st + lt ) also captures the intent of reducing the load fluctuation over time [7]. Then the total cost over time T is computed PT (s) (e) as t=1 f (st + lt ). In the ideal case, assume that lt , ti , ti , and di for all t = 1, · · · , T, i ∈ N are known non-causally at the beginning of the system time. Then, the charging station can solve (2) and obtain the optimal charging rate, denoted by x∗it for all time t and the optimal total cost, denoted by Ψ1 . Such a solution is referred to as an “optimal offline solution”. T X Ψ1 = min xit  f  X xit + lt  (2a) xit = di , ∀i ∈ N , (2b) t=1 i∈I(t) (e) ti X s.t. (s) t=ti (e) (s) xit ≥ 0, ∀t = ti , · · · , ti , ∀i ∈ N . (2c) In particular, the optimal rate, denoted by P total charging ∗ s∗t , is defined as s∗t = x . Note that there are in i∈I(t) it total O(T |I(t)|) variables in (2), where |I(t)| denotes the cardinality of the set I(t). This number can be quite large when the number of cars present at each time slot, |I(t)|, is large. Next, we propose an equivalent transformation of (2) that drastically reduces the number of variables. In particular, the following Theorem 1 shows that as long as we find the optimal s∗t ∀t, the optimal x∗it ∀i, t can be obtained by earliest deadline first (EDF) scheduling. Theorem 1: If a set of st ’s satisfy the following inequality for all n = 1, · · · , T n X t=1 X (e) i∈{i|ti di ≤ =t} n X t=1 st ≤ n X t=1 X (s) i∈{i|ti di , (3) =t} then there exists at least a set of xit ’s that is feasible to (2). One such set of xit ’s can be obtained by EDF scheduling, which charges the PEV i ∈ I(t) with the earliest deadline at a rate st at each time t. Moreover, when st = s∗t , the set of xit ’s obtained by EDF scheduling are the optimal solution, x∗it , to (2). Proof: Please see the detailed proof in Appendix A. To see Theorem 1, note that (3) implies that the total energy charged by any time slot n is no less than the total charging demand that must be satisfied by time n and no more then the total charging demand of PEVs which have arrived up to time n. On the other hand, by EDF scheduling, PEVs with earlier deadlines must be fully charged before those with later deadlines can be charged. Thus, (3) guarantees the fulfillment of the charging demands of each individual PEV. With Theorem 1, we can transform (2) to the following equivalent problem with T variables. Ψ1 = min st s.t. T X t=1 n X f (st + lt ) st ≥ t=1 n X n X j=1 st ≤ t=1 n X j=1 statistical information of the unknown future demands. The charging rate sk , once determined, cannot be changed in the future. Specifically, the remaining charging Pk−1 demand of PEV i at time k is given by dˆki = di − t=t(s) xit . Note that, i dˆki = di for all PEVs that have not yet arrived by time k − 1. A close look at (4) suggests that the charging schedule st only depends on the total charging demand that needs to be finished before a certain time, but not the demand due to individual P PEVs. Thus, for notational simplicity, we define d˜kt = i∈{i|t(e) =t} dˆki , ∀t = k, · · · , T, as the total unfinished i charging demand at time k that must be completed by time t. With this, we define the state of system at time t as Dt = [lt , d˜tt , d˜tt+1 , · · · , d˜tT ], (4a) (5) d˜tt0 X (e) i∈{i|ti di , ∀n = 1, · · · , T. (4b) =j} X where lt is the base load at time t, is the total unfinished charging demand at time t that must be completed by time t0 . Let ξ t represent the random arrival events at time t. ξ t is defined as t ξt = [ιt , ηtt , ηt+1 , · · · , ηet t ], di , ∀n = 1, · · · , T. (4c) (s) i∈{i|ti =j} s∗t to (4) has an interesting feature: it The optimal solution does not change with the cost function f (st + lt ), as long as f is strictly convex. Moreover, s∗t also minimizes the variance of total load subjecting to (4b) and (4c), where the variance PT PT t=1 st +lt 2 of total load is defined as t=1 (st + lt − ) [13], T [14]. This is proved in Theorem 2. Theorem 2: The optimal solution s∗t to (4) does not change with the cost function f (.), as long as f (.) is strictly convex. Moreover, s∗t is a load flattening solution that minimizes the variance of total load. Proof: Please see the detailed proof in Appendix B. Remark 1: In practice, a capacity constraint on st + lt is present for each t due to the hardware limitations and security concerns. The constraint is omitted in our formulation for the following reason. Theorem 2 indicates that the optimal solution s∗t to (4) minimizes the variance of total load. That is, any other scheduling solution would have a higher peak load, and therefore is more likely to violate the capacity constraint. In this sense, the optimal solution s∗t to (4) is “capacity optimal” in the sense that if the optimal solution to Problem 4 (or equivalently Problem 2) violates the capacity constraint, then there does not exist any other scheduling solutions that satisfy the capacity constraint. B. Online PEV Charging problem For the online PEV charging problem, the charging schedule only depends on the statistic information of future load demand, the current based load and the remaining charging demands and deadlines of the PEVs that have arrived so far. In contrast to the ideal case in the last subsection, in practice the charging station only knows the remaining charging demands and departure deadlines of the PEVs that have already arrived, as well as the current base load. The online charging scheduling algorithm computes the charging rate sk at each time slot k based on the known causal information and the (6) where ιt is the base load at time t, ηtt0 is the total charging demand that arrive at time t and must be fulfilled by time t0 , et is the latest deadline among the PEVs that arrive at time t. Then, the state transition, defined as Dt+1 := g(st , Dt , ξt+1 ), (7) is calculated as follows: lt+1 = ιt+1 (8) and   = d˜tt0 − st − d˜t+1 t0 0 tX −1 + + , ∀t0 = t+1, · · · , T. (9) d˜tj   +ηtt+1 0 j=t + Here, [x] = max{x, 0}. With the above definitions of system state and state transition, we are now ready to rewrite (4) into the following finite-horizon dynamic programming problem. Qk (Dk ) = min sk f (sk + lk ) + Eξk+1 [Qk+1 (g(sk , Dk , ξk+1 ))] (10a) s. t. d˜kk ≤ sk ≤ T X d˜kt , (10b) t=k where Qk (Dk ) is the optimal value of the dynamic programming at time k. The left side of (10b) ensures all charging demands to be satisfied before their deadlines. The right side of (10b) implies that the total charging power up to a certain time cannot exceed the total demands that have arrived up to that time. By slight abuse of notation, in the rest of the paper we denote the optimal solutions to both the online and offline problems as s∗k , when no confusion arises. The actual meaning of s∗k will be clear from the context. Suppose that s∗k is the optimal solution to (10) at stage k. Then, the total cost at the end of system time, denoted by Ψ2 , is provided by Ψ2 = T X k=1 f (s∗k + lk ). (11) Note that (10a) comprises nested expectations with respect to the random PEV arrivals in the future time stages. Except for few special cases, it is hard to provide the closed-form of the optimal solution to (10). On the other hand, (10) can be solved by the standard numerical methods, such as backward reduction and the sample average approximation (SAA) based on Monte Carlo sampling techniques [8]–[10], [22]. These algorithms typically incur a computational complexity that grows exponentially with both the time span T and the dimensions of state and decision spaces. Note that (10) involves continuous state and decision spaces. Discretization of these spaces leads to a curse of dimensionality, rendering the computational complexity prohibitively high. III. MPC- BASED O NLINE C HARGING A LGORITHM In view of the extremely high complexity of standard numerical methods, we are motivated to obtain a near-optimal solution by solving a much simpler problem, which replace all exogenous random variables by their expected values. This is referred to as the expected value problem [8]–[10] or the MPC approach [12]–[15] in the literature. Notice that the firstorder moment, i.e., expectation, of a random process is much easier to estimate than the other statistics, e.g., variance or the probability distribution. Thus, the assumption of knowing the expected values is weaker than the assumptions in other EVcharging algorithms [20], which assume that the probability distributions of the random processes are known. Instead of solving the problem using generic convex optimization approaches, we propose a low-complexity online Expected Load Flattening (ELF) algorithm by exploring the load flattening feature of the optimal solution to the expected value problem, as shown in Section III-A. Section III-B provides the theoretical analysis of the performance gap between the optimal solution to the expected value problem and the optimal solution to (10). end of system time, denoted by Ψ3 , is defined as Ψ3 = min sk s. t. f (sk + lk ) + T X f (st + νt ) (12a) t=k+1 j X st ≥ j X t=k t=k j T X X t=k st ≤ t=k d˜kt + j X j X µm n , ∀j j d˜kt + X em X 0 d¯tt00 = µm n , ∀j = k, · · · , T. (12c) In each time k, we solve problem (12) and obtain the optimal charging solution s∗k . Then, problem (12) is resolved with the updated d˜kt according to the realization of the PEVs arrived in next time. So on and so forth, we obtain the optimal charging solution s∗k for time stage k = 2, · · · , T . The total cost at the ( 0 d˜tt00 , for t00 = k, · · · , T, t0 = k, 0 µtt00 , for t00 = t0 , · · · , T, t0 = k + 1, · · · , T . (14) The key idea of online ELF algorithm is to balance the charging load among all time slots k, · · · , T . Specifically, step 3 - 5 is to search the time interval [i∗ , j ∗ ] that has the maximum load density among current time slots and record the maximum load density. The time slots with maximum load density are then deleted, and the process is repeated until the current time slot k belongs to the maximum-density interval, i.e., i∗ = k. Algorithm 1: Online ELF Algorithm 1 2 3 4 input : Dk , µt , t = k + 1, · · · , T output: sk initialization i = 0, j = 0; repeat For all time slot i = k, · · · , T, j = i, · · · , T , compute Pj P 0 ( jt00 =t0 d¯tt00 + νt0 ) 0 i∗ , j ∗ = arg max { t =i }. (15) k≤i≤j≤T j−i+1 Set y∗ = 5 m=k+1 n=m (13) where s∗k is the optimal solution to (12) at time stage k. The solution to (12) is always feasible to (10) in the sense that it always guarantees fulfilling the charging demand of the current parking PEVs before their departures. This is because the constraints of sk in (10) are included in (12). Due to the convexity of f (·), the optimal solution is the one that flattens the total load as much as possible. By exploiting the load flattening feature of the solution, we present in Algorithm 1 the online ELF algorithm that solves (12) with complexity O(T 3 ). The online ELF algorithm have a lower computational complexity than generic convex optimization algorithms, such as the interior point method, which has a complexity O(T 3.5 ) [21]. Notice that similar algorithms have been proposed in the literature of speed scaling problems [23], [24] and PEV charging problems [5]. The optimality and the complexity of the algorithm have been proved therein, and hence omitted here. The algorithm presented here, however, paves the way for further complexity reduction to O(1) in Section IV. For notation brevity, we denote in the online ELF algorithm = k, · · · , T, (12b) m=k+1 n=m f (s∗k + lk ), k=1 A. Algorithm Description Denote the expectation of ξ t as µt = [νt , µtt , · · · , µtT ], where νt = E[ιt ], µtt0 = E[ηtt0 ], ∀t0 = t, · · · , T. Replacing ξ t in (10) with µt , we obtain the following deterministic problem: T X 6 7 Pj ∗ Pj ∗ ¯t0 t00 =t0 dt00 j ∗ − i∗ + 1 t0 =i∗ ( + νt0 ) . (16) Delete time slot i∗ , · · · , j ∗ and relabel the existing time slot t > j ∗ as t − j ∗ + i∗ − 1. until i∗ = k; Set sk = y ∗ − lk . B. Optimality Analysis In this subsection, we analyze the optimality of the solution to (12). Notice that MPC approximates the non-causal random variables by their expected values regardless of their distribution functions. As a result, such approximation may lead to unacceptably large performance loss, depending on the distribution of the random variables. Therefore, the MPC approximation is not always justifiable. A well-accepted metric, Value of the Stochastic Solution (VSS) is adopted to evaluate optimality gap between the optimal online solution and the solution to the expected value problem [8]–[10]. Previous work, e.g., [9], [10], mainly evaluates VSS using numerical simulations. Whereas in our analysis, we show that VSS is always bounded regardless of the distribution of the future EV charging demands. This provides a strong theoretical justification of adopting MPC approximation to solve our problem. Let Ξ denote a scenario, which is defined as a possible realization of the sequence of random load demand [22], Ξ = [ξ2 , ξ3 , · · · , ξT ]. (17) Here, we treat ξ 1 as deterministic information since the demand of PEVs arrived at the first stage is known by the scheduler. Let Φ1 , Φ2 and Φ3 be the expectation of the optimal value of the offline problem (4), the online problem (10) and the expected value problem (12), respectively, where the expectation is taken over the random scenarios. That is, Φ1 = EΞ [Ψ1 (Ξ)] , Φ2 = EΞ [Ψ2 (Ξ)] , Φ3 = EΞ [Ψ3 (Ξ)] . (18) It has been proved previously [8], [9] that Φ1 ≤ Φ2 ≤ Φ3 . (19) To assess the benefit of knowing and using the distributions of the future outcomes, the VSS is defined as VSS = Φ3 − Φ2 . (20) To show that the online ELF algorithm yields a bounded VSS, we need to bound Φ3 and Φ2 . Generally, it is hard to calculate Φ2 or analyze the lower bound of Φ2 directly [9], [10]. Thus, we choose to analyze the lower bound of Φ1 instead, since (19) shows that the lower bound of Φ1 is also the bound of Φ2 . In what follows, we will show the lower bound of Φ1 in Proposition 1 and the upper bound of Φ3 in Proposition 2. Proposition 1: Φ1 ≥ T f ! Pe1 ˜1 PT Pet j PT t=1 dt + t=2 j=t µt + t=1 νt T . (21) Proof: Please see the detailed proof in Appendix C. Let O(t) be the set that O(t) = {(m, n)|em ≥ t, m = 1, · · · , t, n = t, · · · , em }. Then, we show that Φ3 is bounded by Proposition 2. Proposition 2: For any distribution of ξ t , t = 1, · · · , T , there is  Φ3 ≤ E  T X t=1  f  X ηnm + ιt  . (22) (m,n)∈O(t) Proof: Please see the detailed proof in Appendix D. Now, we are ready to present Theorem 3, which states that the VSS is bounded for any distribution of random variables. Theorem 3: For any distribution of random vector ξ t , t = 1, · · · , T, n = t, · · · , T, there is  VSS ≤ E  T X t=1  f  X ηnm + ιt  − T f (m,n)∈O(t)  Γ T  , (23) Pe1 ˜1 PT Pet j PT dt + t=2 j=t µt + t=1 νt . where Γ = t=1 Theorem 3 can be easily derived by Proposition 1 and Proposition 2. In practice, the performance gap between the online ELF algorithm and the optimal online algorithm is often much smaller than the bound of VSS. This will be elaborated in the numerical results in Section V. IV. O NLINE ELF A LGORITHM UNDER F IRST- ORDER P ERIODIC R ANDOM P ROCESSES Notice that the complexity of O(T 3 ) of online ELF algorithm mainly comes from step 3, which exhaustively searches the maximum-density period [i∗ , j ∗ ] over all subintervals within [k, T ]. When the random arrival process is first-order periodic stochastically 1 , we argue that the searching scope can be reduced to one period from the whole system time T . Thus, the complexity of step 3 is limited by the length of a period instead of T . As a result, the complexity of the algorithm reduces from O(T 3 ) to O(1), implying that it does not increase with the system time T , and thus the algorithm is perfectly scalable. In practice, the arrival process of the charging demands are usually periodic stochastically. For example, the arrival of charging demands at a particular location is statistically identical at the same time every day during weekdays (or weekends). the National Household Travel Survey (NHTS) 2009 gathers information about daily travel patterns of different types of households in 2009, and shows that the daily travel statistics (e.g., Average Vehicle Trip Length, Average Time Spent Driving, Person Trips, Person Miles of Travel) are very similar for each weekday or weekend, but different between weekday and weekend [28]. In Section IV-A, we investigate the case when the random load demand process is first-order periodic. In Section IV-B, we provide a closed-form solution to (12) for a special case when the load demand process is the first-order stationary. A. First-Order Periodic Process In this subsection, we consider the case when the arrival process is first-order periodic. Specifically, the first-order periodic process means that the first-order moment (i.e., mean) of the random process is periodic. That is, at current time stage k, for all t = k + 1, · · · , T, we have µt = E[ξ t ] = µt+p , (24) where ξ t is the random arrival events at time t, µt is the expectation of ξ t , and p is the length of period. Then, instead 1 The first-order periodic stochastic process is defined as a stochastic process whose first-order moment, i.e., mean is periodic. That is, the mean of the random arrival events, i.e., µt is periodic. However, the actual realizations of the arrival events ξt are uncertain and not periodic. of considering µt for t = k + 1, · · · , T , we only need to consider µt for one period, i.e., for t = k + 1, k + p: k+1 k+1 µk+1 = [νk+1 , µk+1 k+1 , µk+2 , · · · , µk+e1 , 0, · · · , 0], .. . (25) k+p k+p µk+p = [νk+p , µk+p k+p , µk+p+1 , · · · , µk+ep , 0, · · · , 0]. Here, en ≤ T, n = 1, · · · , p is the maximum parking time for PEVs arriving at time k + n. Specially, we define ê as ê = max{ek+1 , ek+2 , · · · , ek+p }. We decompose the search region {i, j|i = k, · · · , T, j = i, · · · , T } into three subregions, defined as Π1 = {i, j|i = k, j = k, · · · , k + ê}, Π2 = {i, j|i = k, j = k + ê + 1, · · · , T } and Π3 = {i, j|i = k + 1, · · · , T, j = i, · · · , T }, respectively. We denote by X̂, Ŷ , Ẑ the maximum densities of region Π1 , Π2 , Π3 , respectively. Indeed, the largest of X̂, Ŷ , Ẑ is the maximum density of the interval [i∗ , j ∗ ] ⊆ [k, T ] over all possible pairs i, j ∈ {i = k, · · · , T, j = i, · · · , T }. Let [î1 , ĵ1 ], [î2 , ĵ2 ], [î3 , ĵ3 ] be the intervals with the maximum density over region Π1 , Π2 , Π3 , respectively. By definition, î1 = î2 = k. Similar to the stationary case, X̂ can be calculated by searching ĵ1 over {k, · · · , k + ê}. That is, ˜k n=k (dn Pt X̂ = max k≤t≤k+ê P P + νn ) + tn=k tm=n µn m . n−k+1 (26) Moreover, Lemma 1 shows that Ŷ and Ẑ can be calculated once the maximum density of interval [k + 1, k + ê] has been obtained. First, we introduce some definitions which help to show Lemma 1. Let Π4 be a subset of Π3 , where Π4 is defines as Π4 = {i, j|i = k + 1, · · · , k + ê, j = i, · · · , k + ê}, and [ī, j̄] be the interval with maximum density of region Π4 , i.e., Pk+en n Pj m=n µm +νn ) n=i ( ī, j̄ = arg max . j−i+1 k+1≤i≤j≤k+ê Lemma 1: The maximum densities of Π2 and Π3 are calculated by Pĵ2 Ŷ = n=k ( Pk+en m=n µn m + νn ) ĵ2 − k + 1 Pĵ3 , Ẑ = n=î3 ( Pk+en m=n µn m + νn ) ĵ3 − î3 + 1 , (27) respectively, where î3 = ī, ĵ2 = and ( max{j̄, k + ê + 1}, if j̄ < ī + p, j̄ + (r − 1)p, otherwise. ( j̄, if j̄ < ī + p, ĵ3 = j̄ + (r − 1)p, otherwise. (28) (29) Proof: Please see the detailed proof in Appendix E. Based on Lemma 1, we can modified the searching region of step 3 of online ELF algorithm as follows: • if j̄ < ī + p, the interval with the maximum density during time stages [k + 1, T ] is [ī, j̄]. Then, in step 3 of the online ELF algorithm, the search region of i, j is reduced from {i, j|i = k, · · · , T, j = i, · · · , T } to {i, j|i = k, · · · , ī, j = i, · · · , ī, j̄}. • If j̄ ≥ ī+p, the interval with the maximum density during time stages [k + 1, T ] is [ī, j̄ + (r − 1)p]. Then, in step 3 of the online ELF algorithm, the search region of i, j can be reduced from {i, j|i = k, · · · , T, j = i, · · · , T } to {i, j|i = k, · · · , ī, j = i, · · · , ī, j̄ + (r − 1)p}. As a result, the searching region of the online ELF algorithm is only related to [k + 1, k + ê] instead of T . Thus, the computational complexity of the online ELF algorithm is O(1) instead of O(T 3 ) under first-order periodic process. B. First-order Stationary Process In this subsection, we show that the optimal solution to (12) can be calculated in closed form if the arrival process is first-order stationary. Due to the page limit, we only provide the main results here. By first-order stationary, we mean that the statistical mean of ξ t , i.e., νt and µtt0 , t0 = t, · · · , T only depends on the relative time difference τ = t0 − t, but not the absolute value of t. We can then replace νt by ν and replace µtt0 by µτ , where τ = t0 − t. Then, µt is no longer a function of t, and can be represented as µ = [ν, µ1 , µ2 , · · · , µē , 0, · · · , 0], (30) where ē is the maximum parking time of a PEV. We denote by X, Y, Z the maximum densities of region Π1 , Π2 , Π3 , respectively. Then, X is calculated by X= ( Pn t=k max P d˜kt + n j=1 (n − k − j + 1)µj + lk − ν n−k+1 k≤n≤k+ē ) +ν , (31) and Y, Z are provided in Lemma 2. Lemma 2: The maximum densities of Π2 and Π3 are achieved by setting i2 = k, j2 = T, i3 = k + 1, j3 = T , and calculated by Y = Pk+ē ˜k Pk+ē t=k dt + j=1 (T − k − j + 1)µj + lk − ν T −k+1 (T − k − j + 1)µj j=1 + ν. T −k + ν, (32a) Pk+ē Z= (32b) Proof: Please see the detailed proof in Appendix F. The largest of X, Y, and Z is the maximum density of the interval [i∗ , j ∗ ] ⊆ [k, T ] over all possible pairs i, j ∈ {i = k, · · · , T, j = i, · · · , T }. Specially, if X or Y is the largest one, then k is already contained in the maximum-density interval, and thus X or Y is the optimal charging rate at time k. On the other hand, if Z is the largest, then the maximumdensity interval, i.e., [k + 1, T ], does not include k. Following Algorithm 1, we will delete the maximum-density interval and repeat the process. Now, time slot k is the only remaining time slot after deletion. This implies that all charging demands that have arrived by time slot k should be fulfilled during time slot k. These arguments are summarized in Proposition 3, which provides the closed form solution to (12). Proposition 3: When the random load demand process is first-order stationary, the optimal charging schedule to (12) is TABLE I PARAMETER SETTINGS OF THE PEV TRAFFIC PATTERNS (33a) (33b) (33c) t=k V. S IMULATIONS In this section, we investigate the performance of the proposed online ELF algorithm through numerical simulations. All the computations are solved in MATLAB on a computer with an Intel Core i3-2120 3.30GHz CPU and 8 GB of memory. For comparison, we also plot the optimal solution to (10), which is obtained by SAA method [22], and a heuristic solution by the online AVG algorithm [6], which is obtained by charging each PEV at a fixed rate, i.e., its charging demand divided by its parking time. Let the expected cost of AVG algorithm is denoted by Φ4 . Define the relative performance loss of ELF and AVG compared with the optimal online 2 2 and Φ4Φ−Φ , respectively. Similar to [5] solution as Φ3Φ−Φ 2 2 [6], we adopt an increasing quadratic cost function in the simulations, i.e., f (st + lt ) = (st + lt )2 . Note that the cost function is increasing and strictly convex, since the load st +lt is always non-negative. A. Average Performance Evaluation In this subsection, we evaluate the average performance of the online ELF algorithm under three different traffic patterns, i.e., light, moderate, and heavy traffics. In particular, the system time is set to be 24 hours, and each time slot lasts 10 minutes. The PEV arrivals follow a Poisson distribution and the parking time of each PEV follows an exponential distribution [25]–[27]. The mean arrival and parking durations of the three traffic patterns are listed in Table I. The main difference lies in the arrival rates at the two peak hours, i.e. 12 : 00 to 14 : 00 and 18 : 00 to 20 : 00. The settings of the peak hour match with the realistic vehicle trips in National Household Travel Survey (NHTS) 2009 [28]. Specially, the average number of total PEVs simulated in scenario 1, 2 and 3 are 104, 204 and 304, respectively. We choose the base load profile of one day in the service area of South California Edison from [7]. Each PEV’s charging demand is uniformly chosen from [25, 35]kW h. Each point in Fig. 1, Fig. 2 and Table II is an average of 105 independent instances of the scenarios listed in Table I. In Fig. 2, the total loads s∗k are plotted over time. We notice that the total load of the online ELF algorithm follows closely to that of optimal online algorithm, whereas that of the AVG algorithm has a larger gap from the optimal online algorithm. The average costs normalized by that of the optimal online algorithm are plotted in Fig. 1. Moreover, the VSS and the relative performance loss are listed in Table II. Both the figure and the table show that ELF performs very close to the optimal online algorithm. The VSS and the relative performance loss are no more than 0.1536 and 0.38% respectively. In contrast, the relative performance loss of AVG algorithm is up to 5.82%, Arrival Rate (PEVs/hour) S. 1 S. 2 S. 3 Time of Day 08 : 00 − 10 : 00 10 : 00 − 12 : 00 12 : 00 − 14 : 00 14 : 00 − 18 : 00 18 : 00 − 20 : 00 20 : 00 − 24 : 00 24 : 00 − 08 : 00 7 5 10 5 10 5 0 7 5 35 5 35 5 0 Mean Parking Time (hour) 7 5 60 5 60 5 0 10 1/2 2 1/2 2 10 0 TABLE II AVERAGE PERFORMANCE COMPARISON UNDER THREE TRAFFIC PATTERNS Scenario VSS Φ3 −Φ2 Φ2 Φ4 −Φ2 Φ2 1 2 3 0.1178 0.1319 0.1536 0.19% 0.28% 0.38% 3.50% 4.46% 5.82% which is more than 15 times of that of ELF algorithm. The relative performance loss of the approximate online algorithm reflects the percentage of the extra cost compared with the optimal online algorithm. Obviously, the performance loss is always the smaller the better. For example, from the report of Rocky Mountain Institute, the average electricity rate is 11.2cents/kW h, and the average load for a charging station is 100kW [29]. Then, the expected electricity cost of a charging station for one years is $967680. 6% relative performance loss means AVG algorithm leads to $58060 extra cost, while the proposed online algorithm with 0.38% relative performance loss leads to $3677 extra cost, or an annual saving of $54383 compared with the AVG algorithm. B. Complexity of The Online Algorithm ELF In this subsection, we verify the computational complexity of the online ELF algorithm and also compare the complexity of online ELF algorithm with that of the optimal online algorithm and online AVG algorithm, respectively. We still adopt the SAA method as the optimal online algorithm. Since the complexity of SAA is too high, truncation is often adopted in the SAA to reduce the complexity at a cost of performance loss [8]. As such, we also simulate the complexity of truncated SAA with a truncation period of 3 hours. Each PEV’s charging demand is uniformly chosen from [25, 35]kW h, the arrivals follow a Poisson distribution and the parking time of each 1.07 Optimal online Online ELF Online AVG 1.0582 1.06 1.05 1.0446 1.04 Normalized cost given by the following close-form:  X − lk , if X = max{X, Y, Z},      Y − lk , if Y = max{X, Y, Z}, s∗k = k+ē X    d˜kt , otherwise.   1.035 1.03 1.02 1.01 1 1.0019 1 1.0028 1 1.0038 1 0.99 0.98 0.97 Scenario 1 Fig. 1. Scenario 2 Scenario 3 Normalized costs of three algorithms in three scenarios. 120 Total load of optimal online Total load of online ELF Total load of online AVG 65 90 Total load of optimal online Total load of online ELF Total load of online AVG 110 100 60 80 Load (kW) Load (kW) Load (kW) 90 55 70 50 80 70 60 60 45 Total load of optimal online Total load of online ELF Total load of online AVG 50 50 40 40 40 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 Time (hour) 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 Time (hour) (a) Scenario 1: light traffic (b) Scenario 2: moderate traffic Fig. 2. (c) Scenario 3: heavy traffic Base load and total load of three algorithms in three scenarios. 4 10 65 Optimal online without truncation Optimal online with truncation Online ELF Online AVG 3 10 60 Load (kW) Computional time (s) 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 Time (hour) 2 10 55 50 1 10 45 0 10 Total load of optimal online Total load of online ELF Total load of online ORCHARD 40 1 Fig. 3. 2 3 4 5 6 Time (hour) 7 8 9 10 CPU computational time over the system time. PEV follows an exponential distribution, where the arrival rate and mean parking durations are the same as that in the peak hours of scenario 2 in Section V.A. We simulate 10 cases in total, where the system time are set to be 1, 2, · · · , 10 hours. For each algorithm, we record the CPU computational time at each time stage and calculate the average CPU computational time as the sum of CPU computational times of all time stages divided by the number of time stages. Each point in Fig. 3 is an average of 100 independent instances. Fig. 3 shows that the CPU computational time of both the online algorithm ELF and AVG almost grow linearly with the system time. In contrast, for the SAA based online algorithm with or without truncation, the average CPU computational times grow very quickly as system time increases. We notice that when system time increases to 4 hours, the optimal online algorithm without truncation consumes more than 2 hours and the optimal online algorithm with truncation consumes more than 30 minutes. Meanwhile the proposed online algorithm ELF only takes several seconds. It is foreseeable that the computational complexity of optimal online algorithm will become extremely expensive as we further increase the system time. C. Performance Comparison with Online Algorithm ORCHARD [5] In this section, we compare the proposed online algorithm ELF with the online algorithm ORCHARD proposed in refer- 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 Time (hour) Fig. 4. Load comparison of ORCHARD and ELF ence [5] on the properties of the optimality and computational complexity. First, we evaluate the average performance of the proposed online algorithm and online algorithm ORCHARD. To facilitate the comparison, we also adopt the average performance of optimal online algorithm as a bench mark. For the system parameters, we use the default settings of scenario 1 in Section V.A. We simulate 105 cases and plot the total load (the sum of the base load and the PEV charging load) over time for the three online algorithms in Fig. 4. In addition, the average performance ratios normalized against the optimal online solution are shown in Fig. 5 respectively. Fig. 4 shows that compared with online algorithm ELF, the online algorithm ORCHARD always produces a larger gap from the optimal online solution. From Fig. 5, we can see that the proposed online algorithm ELF achieves a much lower expected cost than the online algorithm ORCHARD, which indicates that online algorithm ELF owns a better average performance than online algorithm ORCHARD. To compare the computation complexity of online algorithm ORCHARD and ELF, we adopt the similar case study in Section V.D of reference [5]. Specifically, we simulate the CPU computational time of online algorithms by varying the arrival rates of the PEVs during one day. For the system parameter, we use the same settings as scenario 1 in Section V.A except the arrival rates, which are assumed to be the same during 8 : 00 − 18 : 00 and 0 after 18 : 00. We vary the arrival Optimal online 2 Online ORCHARD Online ELF 1.73 1.8 1.6 Normalized cost 1.4 1.2 1.0019 1 1 0.8 0.6 0.4 0.2 problem. Instead of adopting the standard numerical methods with high complexity, we provide a MPC-based online algorithm with O(T 3 )-complexity. We rigorously analyze the performance gap between the solution of the MPC-based approach and the optimal solution for any distribution of exogenous random variables. Moreover, we show that the proposed algorithm can be made scalable under the first-order periodic process of load demand. Besides, our analyses are validated through extensive simulations. 0 A PPENDIX Fig. 5. ELF Average performance ratios of online algorithm ORCHARD and A. Proof of Theorem 1: 5 Computional time (s) 10 Optimal online without truncation Optimal online with truncation Online ELF Online ORCHARD 4 10 (s) (e) i∈{i|ti =1} 3 10 2 10 100 Fig. 6. We use the inductive method to show that through EDF scheduling, all the PEVs can be fulfilled charging before deadlines. For n = 1, (3) becomes X X di ≥ s1 ≥ di . (34) 150 200 250 300 350 Number of PEVs 400 450 500 Thus, by EDF scheduling, we can first satisfy the demand of PEVs whose deadline at time stage 1. That is, for any PEV (e) i ∈ {i|ti = 1}, we set xi1 = di . CPU computational time over the number of PEVs. rate in 8 : 00−18 : 00 from 10 to 50 (PEVs/hour) that leads to the average number of total PEVs during one day varies from 100 to 500. For each specified average number of PEVs, we simulate the average performance of 108 independent instances for the online ELF algorithm, the optimal online algorithm and the online ORCHARD algorithm, respectively, and record the average CPU computational times of each cases for the three algorithms, respectively. The results are plotted in Fig. 6. Fig. 6 shows that the average CPU computational time of the optimal online algorithm grows quickly as the number of total PEVs increases, while the average CPU computational time of the online ELF algorithm and the online ORCHARD algorithm grows slowly as the number of total PEVs increases. When the number of PEVs is 200, the average CPU computational time of the optimal online algorithm without truncation is more than 24 hours. Even for the the optimal online algorithm with truncation, the average CPU computational time is about 100 minutes. Whereas, the proposed online algorithm ELF only takes about 4 minutes. Fig. 6 also indicates that the computational time of online ELF and online ORCHARD as the number of the PEVs increases. As a conclusion, the case study shows that the online algorithm ELF has a better average performance than online algorithm ORCHARD. It also indicates that the CPU computational time of online ELF and online ORCHARD are similar. VI. C ONCLUSIONS In this paper, we formulate the optimal PEV charging scheduling problem as a finite-horizon dynamic programming i∈{i|ti =1} (35) Assuming that for all time stage m, EDF scheduling can fulfill charge all the PEVs which depart at or before time stage m, i.e., there exists at least a set of xit ’s that satisfy (e) ti X (e) xit = di , ∀i ∈ {i|ti ≤ m}, (36a) (s) t=ti (s) (e) (e) xit ≥ 0, ∀t = ti , · · · , ti , ∀i ∈ {i|ti Since m X st ≥ t=1 m X t=1 X ≤ m}. di , (36b) (37) (e) i∈{i|ti =t} Pm Pm P then, t=1 st − t=1 i∈{i|t(e) =t} di represents the amount i of power which is outputted from the charging station during time stage 1, · · · , m and charged to the PEVs with deadline after time stage m. By EDF scheduling, once the PEVs which depart at time m have been fulfilled charging, we will first charge the PEVs which depart at time stage m + 1. Thus, if m X st − t=1 m X X di ≥ t=1 i∈{i|t(e) =t} i X di , (38) (e) i∈{i|ti =m+1} we finish charging of PEVs with deadline m + 1, and then go to charge the PEVs with deadline m + 2. If m X t=1 st − m X X di < t=1 i∈{i|t(e) =t} i X di , (39) (e) i∈{i|ti =m+1} then the PEVs with m + 1 have been charged as Pm Pmdeadline P power t=1 st − t=1 i∈{i|t(e) =t} di . At time stage m + 1. i Since m+1 X st ≥ t=1 m+1 X t=1 X di , (e) i∈{i|ti (40) =t} 1) If x∗it1 = 0 for a particular PEV i at a time slot t1 ∈ (s) (e) {ti , · · · , ti }, then, by complementary slackness, we have ωit1 > 0. From (47a), f 0 (st1 + lt1 ) = λi + ωit1 . then,  m m X X di −  st − X sm+1 ≥ (e) i∈{i|ti t=1 =m+1} t=1  X (e) i∈{i|ti  di  , (41) =t} which means all the PEVs with deadline m+1 can be fulfilled charging. This is because we will charge the PEVs with deadline m + 1 first by the EDF scheduling. Thus, there exists at least a set of xit ’s that satisfy (48) 2) If x∗it2 > 0 for PEV i during a time slot t2 ∈ (s) (e) {ti , · · · , ti }, we can infer from (47c) that ωit2 = 0. Then, f 0 (st2 + lt2 ) = λi . (49) On the other hand, since f (st +lt ) is a strictly convex function of st + lt , then f 0 (st + lt ) is an increasing function. From the above discussions, we get the following two conclusions: (e) ti X (e) xit = di , ∀i ∈ {i|ti = m + 1}, (42a) 1) If x∗it1 > 0, x∗it2 > 0, then by (49), (s) f 0 (st1 + lt1 ) = f 0 (st2 + lt2 ) = λi . t=ti xi,m+1 ≥ 0, ∀i ∈ (e) {i|ti = m + 1}. (42b) Combining (36) and (42), we get that all the PEVs whose deadline at or before stage m + 1 can be fulfill charging, i.e., there exist at least a set of xit ’s that satisfy Due to the monotonicity of f 0 (st ), we have s∗t1 + lt1 = s∗t2 + lt2 . 2) If x∗it1 = 0, x∗it2 > 0, then by (48) and (49), there is f 0 (st1 + lt1 ) = λi + ωit1 > f 0 (st2 + lt2 ) = λi . (51) (e) ti X (e) xit = di , ∀i ∈ {i|ti ≤ m + 1}, (50) Since f 0 (st ) is a increasing function, we have s∗t1 +lt1 ≥ s∗t2 + lt2 . (43a) (s) t=ti (s) (e) (e) xit ≥ 0, ∀t = ti , · · · , ti , ∀i ∈ {i|ti ≤ m + 1}. (43b) Therefore, we can conclude that by EDF scheduling, there always exists at least a set of xit ’s that is feasible to (2). This completes the proof.  Consider two function fˆ(st + lt ) and f¯(st + lt ). Let x̂∗it and denote the optimal solutions to (2) with f (st +lt ) replaced by fˆ(st + lt ) and f¯(st + lt ), respectively. Define ŝ∗t , s̄∗t as X X ŝ∗t = x̂∗it , s̄∗t = x̄∗it , t = 1, · · · , T, (52) x̄∗it i∈I(t) B. Proof of Theorem 2: First, we show that if there exists a PEV parking in the station at both time t1 and t2 , i.e., (s) (e) t1 , t2 ∈ {ti , · · · , ti }, (44) respectively. Suppose that there exists a time slot t1 such that ŝ∗t1 < s̄∗t1 . Since T X and x∗it1 ≥ 0, x∗it2 > 0, s∗t1 + lt1 ≥ s∗t2 + lt2 . f 0( (s) (e) xit + lt ) − λi − ωit = 0, i ∈ N , t = ti , · · · , ti , s̄∗t = t=1 X di , (54) i∈N ŝ∗t2 > s̄∗t2 (55) ŝ∗t1 + ŝ∗t2 = s̄∗t1 + s̄∗t2 (56) Thus, we can find a PEV i ∈ N such that (47a) x̂∗it1 < x̄∗t1 , x̂∗it2 > x̄∗it2 . (57) x̂∗it2 > 0 (58) As a result, (e) λi (di − T X and i∈I(t) ti X ŝ∗t = (53) there must exist another time slot t2 such that (46) The Karush-Kuhn-Tucker (KKT) conditions to the convex problem (2) are X t=1 (45) then the optimal total loads at time t1 and t2 must satisfy that i∈I(t) xit ) = 0, i ∈ N , (47b) (s) t=ti ωit xit = 0, i ∈ N , t = since (s) ti , · · · (e) , ti , (47c) where λ, ω are the non-negative optimal Lagrangian multipliers corresponding to (2b) and (2c), respectively. We separate our analysis into the following two cases: x̄∗it2 ≥ 0. Based on (46), there is ŝ∗t2 + lt2 ≤ ŝ∗t1 + lt1 . (59) Combining (53)(56)(59), we get s̄∗t2 + lt2 < ŝ∗t2 + lt2 ≤ ŝ∗t1 + lt1 < s̄∗t1 + lt1 . (60) Since f¯(st + lt ) is a strictly convex function of st + lt , then, based on (56) and (60), we have f¯(s̄∗t1 + lt1 ) + f¯(s̄∗t2 + lt2 ) > f¯(ŝ∗t1 + lt1 ) + f¯(ŝ∗t2 + lt2 ). (61) PT t=2 Pet j=t µjt . Then, by Jensen’s inequality [30], Ψ1 (E[Ξ]) ≥ T X f PT s +l which indicates that P t=1T t t is a constant. Then, we see T PT s +l that t=1 (st + lt − t=1T t t )2 is a strictly convex function of st + lt . This completes the proof.  C. Proof of Proposition 1: First, we show that Ψ1 (Ξ) is a convex function of Ξ. For any Ξ, define s∗t (Ξ) as the optimal solution that minimizes Ψ1 (Ξ) subject to (4b) - (4c). For an arbitrary pair of Ξ0 and Ξ00 , let Ξ000 = λΞ0 + (1 − λ)Ξ00 ∀λ ∈ [0, 1]. Then, the charging schedule st (Ξ000 ) such that st (Ξ000 ) = λs∗t (Ξ0 )+(1−λ)s∗t (Ξ00 ) still satisfies (4b) - (4c) with Ξ = Ξ000 due to the linearity of the constraints. Based on the convexity of f (st + lt ), we have T X t=1 ≤λ T X f (s∗t (Ξ0 ) T X + lt ) + (1 − λ) t=1 (63) f (s∗t (Ξ00 ) + lt ) T X f (s∗t (Ξ000 ) + lt ) ≤ t=1 T X f (st (Ξ000 ) + lt ). (64) t=1 Combining (63) and (64), we have T X T X n=t d˜tn ≤ T X t=1 n=t−1 T X ηnt = em X X ηnm , (68) m∈M n=t where the inequality holds since st−1 ≥ d˜t−1 t−1 and M = {m|e ≥ t, m = 1, · · · , t} Thus, we have st ≤ m P m , where O(t) is a bounded set for t = η (m,n)∈O(t) n hP i P T m 1, · · · , T . Therefore, E f ( + ι ) is an η t t=1 (m,n)∈O(t) n upper bound of Φ3 . This completes the proof.  E. Proof of Lemma 1: We provide the proof by discussing the following two cases: 1)If j̄ ≥ ī + p, which means that [ī, j̄] and [ī + p, j̄ + p] overlaps with each other, then the density of interval [ī, j̄ + p] is higher than that of [ī, j̄], and the density of [ī, j̄ + 2p] is higher than that of [ī, j̄ + p]. So on and so forth. Finally, we see that the interval [ī, j̄ + (r − 1)p] has the maximum density over region Π3 . Thus, we have î3 = ī, ĵ3 = j̄ + (r − 1)p, and Pj̄+(r−1)p Pk+en n ( m=n µm + νn ) n=ī . j̄ + (r − 1)p − ī + 1 (69) Likewise, for the region {i, j|i = k, j = k + ê + 1, · · · , T }, we have ĵ2 = j̄ + (r − 1)p, and Ŷ = Pj̄+(r−1)p Pk+en n ( m=n µm + νn ) n=k . j̄ + (r − 1)p − k + 1 (70) 2)If j̄ < ī + p, then, the density of interval [ī, j̄] is higher than that of [ī, j̄ + p], and the density of [ī, j̄ + p] is higher than that of [ī, j̄ + 2p]. So on and so forth. Finally, we see that the interval [ī, j̄] has the maximum density over region Π3 . Thus, we have î3 = ī, ĵ3 = j̄, and the corresponding maximum density n=ī P n n ( k+e m=n µm + νn ) . j̄ − ī + 1 (71) For the region Π2 , if j̄ ≤ k + ê + 1, then f (s∗t (Ξ00 ) + lt ). Thus, we have established the convexity of Ψ1 (Ξ) over the set of Ξ. Therefore, we have E [Ψ1 (Ξ)] ≥ Ψ1 (E[Ξ]). et X n=t (65) t=1 On the other hand, based on 1, · · · , e1 , j = t, · · · , et , we d˜t−1 − d˜t−1 n t−1 + Ẑ = f (s∗t (Ξ0 ) + lt ) + (1 − λ)  D. Proof of Proposition 2: PT st ≤ n=t d˜tn holds for all stage t. On the other hand, we have Pj̄ f (s∗t (Ξ000 ) + lt ) t=1 ≤λ (67a) ! Pe1 ˜1 PT Pet j PT t=1 νt j=t µt + t=2 t=1 dt + . T (67b) This completes the proof. t=1 for all λ ∈ [0, 1]. On the P other hand, let s∗t (Ξ000 ) be the optimal T solution that minimizes t=1 f (st + lt ) subject to (4b) - (4c) 000 with Ξ = Ξ . Then, T X = Tf Ẑ = f (st (Ξ000 ) + lt ) T t=1 s̄∗t This contradicts with the fact that the is the optimal total charging rate for objective function f¯(st + lt ). Therefore, the optimal charging solution s∗t is the same for any strictly convex function f (st + lt ). Next, we show that optimal solution s∗t isPa load flattening solution that minimizes T PT t=1 st +lt 2 ) subjecting to (4b) and (4c). t=1 (st + lt − T Based on the argument that s∗t is the same for any strictly convex function fP(st + lt ), then it is equivalent to show that T PT t=1 st +lt 2 ) is a strictly convex function of t=1 (st + lt − T st + lt . Since P PT PT i∈N di + t=1 lt t=1 st + lt = , (62) T T ! Pe1 ˜1 PT Pet j PT j=t µt + t=1 νt t=2 t=1 dt + Pk+ê+1 Pk+en n n=k ( m=n µm + νn ) Ŷ = . ê + 2 If j̄ > k + ê + 1, then (66) the definition of st ,P d˜it , µjt , i PT e1 ˜1 have t=1 st = t=1 dt Pj̄ Ŷ = = + (72) n=k ( Pk+en This completes the proof. µn m + νn ) . j̄ − k + 1 m=n (73)  we have F. Proof of Lemma 2: Pj−i+2 µt (j − i + 2 − t)µt + t=1 +ν j−i+2 Pj−i+1 (82) (j − i + 2 − t)µt t=1 ≥ +ν j−i+1 = ρ(i, j), Pj−i+1 ρ(i, j + 1) = Let ρ(i, j) denote the maximum density of [i, j]. For any i = k, j = k + ē + 1, · · · , T , the density of interval [i, j] is given by Pk+ē Pj−k Pj−2k+1 µt + t=k d˜kt + lk + (j − k)ν ρ(i, j) = k=1 t=1 j−k+1 Pk+ē Pj−k (j − k + 1 − t)µt + t=k d˜kt + lk − ν + ν. = t=1 j−k+1 (74) To prove that the maximum density is achieved by setting j = T , we only need to show ρ(i, j) is a non-decreasing function of j for each given i, i.e., ρ(i, j) ≤ ρ(i, j + 1), ∀k + ē + 1 ≤ j ≤ T − 1. Since Pj−k t=1 (j − k + 1 − t)µt + j−k Pk+ē ˜k t=k dt ≤ j−k+1 X µt , t=1 (75) (76) we have ρ(i, j + 1) Pj−k P ˜k Pj−k+1 µt + lk − ν (j − k + 1 − t)µt + k+ē t=k dt + t=1 +ν = t=1 j−k+1 Pj−k Pk+ē ˜k (j − k + 1 − t)µt + t=k dt + lk − ν +ν ≥ t=1 j−k =ρ(i, j), (77) which implies (75). Hence, Y is the maximum density of [k, j], j = k + ē + 1, · · · , T . Next, we show that Z is the maximum density of [k + 1, T ]. For any k + 1 ≤ i ≤ j ≤ T , the density of interval [i, j] is given by Pj−i+1 Pj−i+2−k µt t=1 ρ(i, j) = k=1 +ν j−i+1 (78) Pj−i+1 t=1 (j − i + 2 − t)µt = + ν. j−i+1 To prove that the maximum density is achieved by setting i = k + 1, j = T , we only need to show ρ(i, j) is a nondecreasing function of j for each given i, i.e., (79) and a non-increasing function of i for each given j, i.e., ρ(i, j) ≥ ρ(i + 1, j), ∀k + 1 ≤ i + 1 ≤ j ≤ T. which implies (79). On the other hand, as Pj−i j−i+1 X t=1 (j − i + 1 − t)µt ≤ µt , ∀k + 1 ≤ i ≤ j ≤ T, j−i t=1 (83) then Pj−i (j − i + 1 − t)µt ρ(i + 1, j) = t=1 +ν j−i Pj−i Pj−i+1 µt t=1 (j − i + 1 − t)µt + t=1 +ν ≤ j−i+1 = ρ(i, j), (84) which implies (80). This completes the proof.  R EFERENCES k + ē + 1 ≤ j ≤ T − 1, ρ(i, j) ≤ ρ(i, j + 1), ∀k + 1 ≤ i ≤ j ≤ T − 1, t=1 (80) On one hand, since Pj−i+1 j−i+2 X t=1 (j − i + 2 − t)µt ≤ µt , ∀k + 1 ≤ i ≤ j ≤ T, j−i+1 t=1 (81) [1] W. Tang and Y. J. Zhang, “Online electric vehicle charging control with multistage stochastic programming,” in IEEE 48th Annu. Conf. Information Sciences and Systems (CISS), pp. 1-6, Mar. 2014. [2] J. A. P. Lopes, F. J. Soares, and P. M. R. Almeida, “Integration of electric vehicles in the electric power system,” Proc. of the IEEE, vol. 99, no. 1, pp. 168-183, 2011. [3] E. Sortomme, M. M. Hindi, S. D. J. MacPherson, and S. S. Venkata, “Coordinated charging of plug-in hybrid electric vehicles to minimize distribution system losses,” IEEE Trans. on Smart Grid, vol.2, no.1, pp. 198-205, 2011. [4] Z. Ma, D. Callaway, and I. Hiskens, “Decentralized charging control of large populations of plug-in electric vehicles,” IEEE Trans. on Control Systems Technology, vol. 21, no. 1, pp. 67-78, 2013. [5] W. Tang, S. Bi, and Y. J. Zhang, “Online coordinated charging decision algorithm for electric vehicles without future information,” IEEE Trans. on Smart Grid, vol. 5, no. 6, pp. 2810 - 2824, 2014. [6] Y. He, B. Venkatesh, and L. Guan, “Optimal scheduling for charging and discharging of electric vehicles,” IEEE Trans. on Smart Grid, vol. 3, no. 3, pp. 1095-1105, 2012. [7] L. Gan, U. Topcu, and S. H. Low, “Optimal decentralized protocol for electric vehicle charging,” IEEE Trans. on Power System, vol.28, iss. 2, pp. 940-951, 2012. [8] J. R. Birge and F. Louveaux, Introduction to Stochastic Programming, New York: Springer, 1997. [9] B. Defourny, D. Ernst, and L. Wehenkel, “Multistage stochastic programming: a scenario tree based approach to planning under uncertainty,” Decision Theory Models for Applications in Artificial Intelligence: Concepts and Solutions, 2011. [10] F. Maggioni and S. Wallace, “Analyzing the quality of the expected value solution in stochastic programming,” Annals of Operations Research, pp. 37-54, 2012. [11] R. Leou, C. Su, and C. Lu, “Stochastic analyses of electric vehicle charging impacts on distribution network,” IEEE Trans. on Power System, vol. 29, no. 3, pp. 1055-1063, May 2014. [12] L. Rao and J. Yao, “SmartCar: smart charging and driving control for electric vehicles in the smart grid,” IEEE Global Communications Conference (GLOBECOM), pp. 2709-2714, Dec. 2014. [13] N. Chen, L. Gan, S. H. Low, and A. Wierman, “Distributional analysis for model predictive deferrable load control,” 53rd IEEE Conference on Decision and Control (CDC), pp. 6433-6438, Dec. 2014. [14] L. Gan, A. Wierman, U. Topcu, N. Chen, and S. H. Low, “Realtime deferrable load control: handling the uncertainties of renewable generation,” in Proceedings of the fourth international conference on Future energy systems (ACM e-Energy) , pp. 113-124, May 2013. [15] S. Bansal, M. N. Zeilinger, and C. J. Tomlin, “Plug-and-play model predictive control for electric vehicle charging and voltage control in smart grids,” 53rd IEEE Conference on Decision and Control (CDC), pp. 5894-5900, 2014. [16] G. Li and X. Zhang, “Modeling of Plug-in Hybrid Electric Vehicle Charging Demand in Probabilistic Power Flow Calculations,” IEEE Trans. on Vehicular Technology, vol. 63, no. 6, pp. 2600-2612, 2014. [17] T. Zhang, W. Chen, Z. Han, and Z. Cao, “Charging scheduling of electric vehicles with local renewable energy under uncertain electric vehicle arrival and grid power price,” IEEE Trans. on Smart Grid, vol. 3, no. 1, pp. 492-499, 2012. [18] I. Koutsopoulos, V. Hatzi, and L. Tassiulas, “Optimal energy storage control policies for the smart power grid,” in Proc. of IEEE International Conference on Smart Grid Communications (SmartGridComm), pp. 475480, 2011. [19] L. Huang, J. Walrand, and K. Ramchandran, “Optimal demand response with energy storage management,” http://arxiv.org/pdf/1205.4297.pdf, 2012. [20] W. Feller, An introduction to probability theory and its applications, John Wiley & Sons, 2008. [21] Y. Ye, Interior Point Algorithms: Theory and Analysis, WileyInterscience Press, 1997. [22] A. Shapiro, D. Dentcheva, and A. Ruszczynski, Lectures on Stochastic Programming: Modeling and Theory, MPS-SIAM, Philadelphia, 2009. [23] F. Yao, A. Demers, and S. Shenker, “A scheduling model for reduced cpu energy,” in Proc. IEEE Symp. Foundations of Computer Science, pp. 374-382, 1995. [24] N. Bansal, T. Kimbrel, and K. Pruhs, “Speed scaling to manage energy and temperature,” Journal of the ACM (JACM), vol. 54, no. 1, pp. 1-39, 2007. [25] M. Alizadeh, A. Scaglione, J. Davies, and K. S. Kurani, “A scalable stochastic model for the electricity demand of electric and plug-in hybrid vehicles,” IEEE Trans. on Smart Grid, vol. 5, no. 2, pp. 848-860, 2014. [26] X. Zhang and S. Grijalva, “An Advanced Data Driven Model for Residential Electric Vehicle Charging Demand,” technique report, Georgia Institute of Technology, 2015. [27] S. Chen and L. Tong, “iEMS for large scale charging of electric vehicles architecture and optimal online scheduling,” in Proc. IEEE Int. Conf. Smart Grid Commun. (SmartGridComm), pp. 629-634, Nov. 2012. [28] A. Santos, A. N. McGuckin, H. Y. Nakamoto, D. Gray, and S. Lis, Summary of travel trends: 2009 national household travel survey, Federal Highway Administration, Washington, DC, 2011. [29] James W. May and Matt Mattila, “Plugging In: A Stakeholder Investment Guide for Public Electric-Vehicle Charging Infrastructure,” Rocky Mountain Institute, 2009. [30] S. Boyd and L. Vandenberghe, Convex optimization, Cambridge university press, 2004.
3cs.SY
arXiv:1802.02074v1 [math.ST] 6 Feb 2018 ORIGINAL ARTICLE Splitting models for multivariate count data Pierre Fernique1∗ | Jean Peyhardi2∗ | Jean-Baptiste Durand3 1 UMR AGAP, Cirad Inra, Univ. Montpellier, Montpellier, 34000, France 2 IGF, Univ. Montpellier, CNRS, INSERM, Montpellier, France. 3 Univ. Grenoble Alpes, CNRS, Inria, Grenoble INP? , LJK, 38000 Grenoble, France ? Institute of Engineering Univ. Grenoble Alpes Correspondence Jean Peyhardi, Université de Montpellier, 34000, France Email: [email protected] Funding information Considering discrete models, the univariate framework has been studied in depth compared to the multivariate one. This paper first proposes two criteria to define a sensu stricto multivariate discrete distribution. It then introduces the class of splitting distributions that encompasses all usual multivariate discrete distributions (multinomial, negative multinomial, multivariate hypergeometric, multivariate negative hypergeometric, etc . . . ) and contains several new. Many advantages derive from the compound aspect of splitting distributions. It simplifies the study of their characteristics, inferences, interpretations and extensions to regression models. Moreover, splitting models can be estimated only by combining existing methods, as illustrated on three datasets with reproducible studies. KEYWORDS singular distribution, convolution distribution, compound distribution, discrete multivariate regression 1 | INTRODUCTION The analysis of multivariate count data is a crucial issue in numerous application settings, particularly in the fields of biology (Allen and Liu, 2012), ecology (Digby and Kempton, 2012) and econometrics (Winkelmann, 2013). Multivariate count data are defined as the number of items of different categories issued from sampling within a population, which individuals are grouped. Denoting by J this number of categories, multivariate count data analysis relies on modeling the joint distribution of the discrete random vector Y = (Y1 , . . . ,YJ ). In genomics for instance, the data obtained from sequencing technologies are often summarized by the counts of DNA or RNA fragments within a genomic interval (e.g., ∗ Equally contributing authors. 1 2 PIERRE FERNIQUE ET AL . RNA seq data). The most usual models in this situation, are multinomial and Dirichlet multinomial regression to take account of some environmental covariate effects on these counts. In this way, Xia et al. (2013) and Chen and Li (2013) studied the microbiome composition (whose output are J bacterial taxa counts) and Zhang et al. (2017) studied the expression count of J exon sets. However, the multinomial and Dirichlet multinomial distributions are not appropriate for multivariate count data n o Í because of their support: the discrete simplex ∆n = y ∈ ÎJ : jJ=1 y j = n . This kind of distributions are said to be singular and will be denoted by S∆n (θ). The parameter n being related to the support, is intentionally noted as an index of the distribution, distinguishing it from other parameters θ used to described the probability mass function (pmf). In this case, any component Yj is deterministic when the J − 1 other components are known. Note that initially, singular versions of some multivariate distributions have been defined by Patil (1968) and Janardan and Patil (1972). But these distinctions were unheeded until now, leading to misuse of these distributions (Zhang et al., 2017). Therefore, a distribution will be considered as a J -multivariate distribution if 1. the dimension of its support is equal to the number of variables (i.e., dim{Supp(Y )} = J ). If no confusion could arise, J will be omitted in the former notations. Another problem that occurs when defining multivariate distributions is the independence relationships between components Y1 , . . . ,YJ . For instance, the multiple Poisson distribution described by Patil and Bildikar (1967), involves J mutually independent variables. Therefore, a multivariate distribution will be considered as a sensu stricto multivariate distribution if: 2. its probabilistic graphical model is connected (i.e., there is a path between every pair of variables). Additionally, such a distribution is considered as an extension of a given univariate distribution if: 3. all the univariate marginal distributions belong to the same family (extension), 4. all the multivariate marginal distributions belong to the same family (natural extension). Even if a singular distribution is not a sensu stricto J -multivariate distribution, it is very powerful as soon as the parameter n is considered as a random variable. It then becomes a map between spaces of univariate and multivariate distributions. Assuming that n follows an univariate distribution L(ψ) (e.g., binomial, negative binomial, Poisson etc . . . ), the resulting compound distribution, denoted by S∆N (θ) ∧ L(ψ), is called splitting distribution. Under mild hypothesis, N splitting distributions can be considered as sensu stricto multivariate distributions. They include all usual multivariate discrete distributions and several news. Many advantages derive from the compound aspect of splitting distributions. The interpretation is simply decomposed into two parts: the sum distribution (intensity of the distribution) and the singular distribution (repartition into the J components). The log-likelihood can also be decomposed according to these two parts and thus easily computed. All usual characteristics (support, pmf, expectation, covariance and probability generative function (pgf)) are also easily obtained using this decomposition. Finally, the generalization to regression models is naturally made by compounding a singular regression by an univariate regression. This article is organized as follows. In Section 2 notations used all along the paper are introduced. The definition of singular distributions is used as a building block to introduce splitting distributions. Positive and symmetric singular distributions are introduced, easing respectively the study of criteria 1-2 and 3-4 for resulting splitting distributions. In Section 3 the subclass of symmetric convolution distributions is introduced (e.g., the generalized Dirichlet multinomial is a singular distribution but is not symmetric). Additive and proportional convolution distributions are then introduced PIERRE FERNIQUE ET AL . 3 Positive Symmetric Multinomial × × Dirichlet multinomial × × Multivariate hypergeometric × Generalized Dirichlet multinomial TA B L E 1 × Properties of four singular distributions. to simplify respectively the calculation of marginal distributions and the inference procedure. Sections 4 and 5 focus on splitting distributions obtained with the multinomial and the Dirichlet multinomial distributions since they are both positive and additive (e.g., the multivariate hypergeometric is additive convolution distribution but not positive). This leads us to precisely describe fifteen multivariate extensions (among which five are natural extensions) of usual univariate distributions giving their usual characteristics. In Section 6, the splitting distributions are extended to regression models. In Section 7 a comparison of these regression models on two benchmark datasets and an application on a mango tree dataset are proposed. 2 | SPLITTING DISTRIBUTIONS Notations All along the paper focus will be made only on non-negative discrete distributions (and regression models). ÍJ j =1 Yj denote the sum of the For notational convenience, the term discrete will therefore be omitted. Let |Y | = random vector Y and assume that |Y | ∼ L(ψ). Let y = (y 1 , . . . , y J ) ∈ ÎJ denote an outcome of the random vector Y . Let PB (A) denotes the conditional probability of A given B. Let E | Y | (Y ) and Cov | Y | (Y ) denote respectively the  conditional expectation and covariance of the random vector Y given the sum |Y |. Let NnJ = y ∈ ÎJ : |y | ≤ n denote the discrete corner of the hypercube. If no confusion could arise, J will be omitted in the former notations. Let ÎJ n y = n!/(n − |y |)! j =1 y j ! denote the multinomial coefficient defined for y ∈ Nn . This notation replaces the usual  Î notation yn = n!/ jJ=1 y j ! which is defined only for y ∈ ∆n . Let (a)n = Γ(a + n)/Γ(a) denote the Pochhammer symbol ÎJ and B(α) = j =1 Γ(αj )/Γ( |α|) the multivariate beta function. Let J 0 0 2 F 2 {(a, a ); b; (c, c ); s} Õ (a) | y | (a 0 ) | y | = y ∈ÎJ ÎJ j =1 (b j ) y j (c) | y | (c 0 ) | y | y J s j Ö j j =1 yj ! denote a multivariate hypergeometric function. Remark that a 0 = c 0 lead to 1J F1 (a; b; c; s) the Lauricella’s type D function (Lauricella, 1893). Moreover, if J = 1 then it turns out to be the usual Gauss hypergeometric function 2 F1 (a; b; c; s) or the confluent hypergeometric 1 F1 (b; c; s). Definitions The random vector Y is said to follow a splitting distribution1 if there exists a singular distribution S∆n (θ) and an univariate distribution L(ψ) such that Y follows the compound distribution S∆N (θ) ∧ L (ψ). The pmf is then N given by P (Y = y) = P (|Y | = |y |)P | Y |=| y | (Y = y) assuming that |Y | follows L(ψ) and Y given |Y | = n follows S∆n (θ). Moreover, a singular distribution is said to be: 1 It is named splitting distribution since an outcome y ∈ Î of the univariate distribution L(ψ) is split into the J components. 4 PIERRE FERNIQUE ET AL . • positive, if its support is the whole simplex, • symmetric, if it is invariant under any permutation of its components. If the singular distribution is symmetric, then it is possible to define a non-singular extension2 having as support a subset of Nn (if the singular distribution is positive, then the support of the non-singular version is exactly Nn ). Such a distribution for the random vector Y , denoted by SNn (θ, γ), is such that (Y , n − |Y |) ∼ S∆J +1 (θ, γ). Remark that all n univariate distributions bounded by n (denoted by Ln (θ)) are non-singular distributions. The variable Y is said to follow a damage distribution3 if there exists a bounded distribution Ln (θ) and a distribution L(ψ) such that Y follows the compound distribution LN (θ) ∧ L (ψ). N Examples The multinomial, the Dirichlet multinomial (also known as the multivariate negative hypergeometric), the multivariate hypergeometric and the generalized Dirichlet multinomial distributions are four examples of singular distributions (see Table 1). Contrarily to others, the multivariate hypergeometric distribution with parameters n ∈ Î and k ∈ ÎJ , is not positive since its support is the intersection of the simplex ∆n and the hyper-rectangle k = {y ∈ ÎJ : y 1 ≤ k 1 , . . . , y J ≤ k J }. Contrarily to others, the generalized Dirichlet multinomial distribution is not symmetric. 2.1 | Support Splitting distributions as sensu stricto multivariate extensions Firstly, let us remark that a singular distribution could be viewed as particular splitting distribution if the sum follows a Dirac distribution, i.e. S∆n (θ) = S∆N (θ) ∧ 1n . Assume that the dimension of a set A ⊆ ÎJ is defined as the N dimension of the smaller Ò-vectorial space including A. The dimension of the support of a positive splitting distribution is depending on the support of the sum distribution as follows:   dim Supp S∆N (θ) ∧ L(ψ) N    0     = J −1     J  ifL(ψ) = 10 , ifL(ψ) = 1n with n ∈ Î∗ , otherwise. Therefore all positive splitting distributions are considered as multivariate distribution (the criterion 1 holds) when the sum is not a Dirac distribution (only non-Dirac distributions will therefore be considered all along the paper). For nonpositive splitting distributions, the dimension also depends on the support of the singular distribution. In order to study the support of splitting distributions in a general way, the singular distribution is thus assumed to be positive (e.g., the case of the multivariate hypergeometric splitting distributions is omitted). The support of Y can be expressed in terms of the sum support. If supp ( |Y |) = {a, · · · , b } (with a ∈ Î, b ∈ Î ∪ {∞} and a < b) then supp (Y ) = Nb \ Na−1 . But, for  any j = 1, . . . , J , the marginal support is supp Yj = Nb . It can thus be interesting to consider a shifted sum |Y | = Z + δ, with Z ∼ L(ψ), supp (Z ) ⊆ {b + 1, . . . , ∞} and δ ∈ {−b, . . . , ∞}. As illustrated on Figure 1, such distributions can be useful for splitting distributions since they enable their supports to be modified. In particular, for sum distributions with a = 0 (e.g., binomial, negative binomial and Poisson distributions), δ = 1 enable to remove the null vector from the joint support while it is kept in marginal supports. Conversely, for sum distributions with a = 1 (e.g., geometric and logarithmic series distributions), δ = −1 enable to add the null vector to the joint support. If multivariate zeros are from one structural source, it is possible to use splitting models with shifted sums to extend hurdle models described by Mullahy (1986). 2 The symmetry ensures that the choice of the last category to complete the vector, has no impact on the distribution. 3 It is named damage distribution since an outcome y ∈ Î of the distribution L(ψ) is damaged into a smaller value. PIERRE FERNIQUE ET AL . a+δ (a) 5 b+δ a (b) a+δ b b+δ (c) F I G U R E 1 Illustration of the effect of shifting the sum distribution on the support of positive splitting distributions. The support of the sum distribution is {a, · · · , b }. Vectors of integers that are part of the shifted support are represented by dark circles. Vectors of integers that were part of the non-shifted support but are not part of the shifted support are represented by white circles. (a) The splitting distribution support with a negative shift (i.e., δ < 0). (b) The splitting distribution support without any shift. (c) the splitting distribution support with a positive shift (i.e., δ > 0). Graphical model A probabilistic graphical model (or graphical model, in short) is defined by a distribution and a graph such that all independence assertions that are derived from the graph using the global Markov property hold in the distribution Koller and Friedman (2009). A graphical model is said to be minimal, if any edge removal in the graph induces an independence assertion that is not held in the distribution. A graphical model is said to be connected if there exists a path containing all its vertices (i.e., there is no pair of independent variables). This is a necessary condition (criterion 2) to obtain a sensu stricto multivariate distribution. Peyhardi and Fernique (2017) characterized the graphical model of multinomial and Dirichlet multinomial splitting distributions according to the sum distribution. But, when the graphical model is unknown, it is sufficient to show that covariances are strictly positive to obtain a graph with at least one path between every pair of random variables. Moments can be derived using the law of total expectation    E (Y ) = E E | Y | (Y ) and covariance Cov (Y ) = E Cov | Y | (Y ) + Cov E | Y | (Y ) . This method could be used for multivariate hypergeometric and generalized Dirichlet multinomial splitting distributions since their graphical models have not yet been characterized. Similarly, the pgf of splitting distributions can be obtain from the pgf of the singular  distribution since G Y (s) = E Ḡ Y (s) where s = (s 1 , . . . , s J ) and Ḡ Y denotes the pgf of Y given the sum |Y |. Marginal distributions Splitting distributions that are sensu stricto multivariate distributions (i.e., with criteria 1 and 2) are not necessarily multivariate extensions. To be considered as a multivariate extension of a specific family, marginal distributions ofYj must belong to this family. The symmetry of the singular distribution is a sufficient condition to obtain a multivariate extension. In fact, marginals of symmetric splitting distributions follow the same damage distribution but with different parameters (see Appendix A for details). 6 PIERRE FERNIQUE ET AL . Distribution Notation Parameter Inference Binomial Bn (p) See Blumenthal and Dahiya (1981) Negative binomial N B (r , p) See Dai et al. (2012) Poisson P (λ) See Johnson et al. (1993) Logarithmic series L (p) See Johnson et al. (1993) Beta binomial β Bn (a, b) See Tripathi et al. (1994); Lesnoff et al. (2012) for n known Beta negative binomial β N B (r , a, b) See Irwin (1968) Beta Poisson β λ P (a, b) See Gurland (1958); Vu et al. (2016) TA B L E 2 | 2.2 References of parameter inference procedures for seven usual univariate discrete distributions. Inference If the parameters θ and ψ are unrelated, the log-likelihood of the splitting distribution, denoted by L (θ, ψ; y), can be decomposed into log-likelihoods for the singular distribution and the sum distribution:  L (θ, ψ; y) = log P | Y |=| y | (Y = y) + log {P ( |Y | = |y |)} , L (θ, ψ; y) = L (θ; y) + L (ψ; |y |) . (1) Therefore, the maximum likelihood estimator (maximum likelihood estimator (MLE)) of a splitting distribution with unrelated parameters can be obtained separately using respectively the MLE of the singular distribution and the MLE of the sum distribution. Hence, with C estimators of singular distributions and L estimators of univariate distributions, one is able to estimate C × L multivariate distributions, with time complexity in O (C + L). Let us remark that decomposition (1) stays true for decomposable scores such as AIC and BIC. Hence model selection using decomposable scores is also reduced to two separate model selection problems and has the same linear time and space complexity. To limit the scope of this paper, focus will be given only to parametrization and inference of singular distributions. Sum distributions considered in this paper are usual power series distributions and some beta compound distributions (see Appendix C for definitions and Table 2 for some inference references). 3 | CONVOLUTION SPLITTING DISTRIBUTIONS In order to study thoroughly the graphical models and the marginals of splitting distributions, additional assumptions are necessary concerning the parametric form of the singular distribution. Convolution splitting distributions have been introduced by Shanbhag (1977) for J = 2 and extended by Rao and Srivastava (1979) for J ≥ 2, but were only used as a tool for characterizing univariate discrete distributions L(ψ). We here consider convolution splitting distributions as a general family of multivariate discrete distributions. PIERRE FERNIQUE ET AL . 7 Definition The random vector Y given |Y | = n is said to follow a (singular) convolution distribution if there exists a non-negative parametric sequence a := {a θ (y )} y ∈Î such that for all y ∈ ∆n we have P | Y |=n (Y = y) = J 1 Ö a θj (y j ), c θ (n) j =1 where c θ denotes the normalizing constant (i.e., the convolution of a θ1 , . . . , a θJ over the simplex ∆n ). This convolution distribution, characterized by the parametric sequence a = {a θ (y )} y ∈Î , is denoted by C∆n (a; θ) where θ = (θ1 , . . . , θJ ) ∈ ΘJ . If the distribution of |Y | belongs to a family of univariate parametric distribution L(ψ) then, we note this compound distribution as follows Y ∼ C∆N (a; θ) ∧ L(ψ). Remark that a convolution distribution is positive if and only if a θ (y ) > 0 N for all θ ∈ Θ and all y ∈ Î. Moreover, a convolution distribution is said to be: • additive, if c (θ,θ0 ) (n) = a θ+θ0 (n) for all (θ, θ 0 ) ∈ Θ2 and all n ∈ Î, • proportional, if C∆N (a; θ) = C∆N (a; λ · θ) for all θ ∈ ΘJ and all λ ∈ Θ. Thanks to the symmetry, the non-singular extension denoted by CNn (a; θ, γ) is well defined. Its pmf is given by J P (Y = y) = Ö 1 a γ (n − |y |) a θj (y j ), c θ,γ (n) j =1 for all y ∈ Nn . If the non-singular convolution distribution is univariate then it is denoted by Cn (a; θ, γ). The random variable Y is said to follow a convolution damage distribution if there exists a latent variable N such that Y given N = n follows Cn (a; θ, γ) for all n ∈ Î. Moreover if N ∼ L (ψ), we denote this compound distribution as follows: Y ∼ CN (a; θ, γ) ∧ L (ψ). N Examples Remark that these convolutions distributions are symmetric by construction. The generalized Dirichlet multinomial distribution thus not belong to this family. The three other singular distributions are additive convolution distributions; details for the multinomial and Dirichlet multinomial distributions are given in the next two sections. Additivity is necessary to easily determine the marginal distributions of corresponding splitting distributions. Among those four distributions, only the multinomial distribution is a proportional convolution distribution (details are given in the next section); see Table 3 for summary of these properties. For the univariate case, the binomial, beta binomial (negative hypergeometric) and hypergeometric distributions are three non-singular convolutions distributions. 3.1 | Properties of convolution splitting distributions Graphical model Until recently, only marginal independence have been studied through the well-known Rao-Rubin condition (Radhakrishna Rao and Rubin, 1964). Peyhardi and Fernique (2017) generalized this condition for conditional independence and deduced the graphical models for positive convolution distributions under mild hypotheses. In this case, it has been shown that there exists only one univariate distribution L(ψ) = (p k∗ )k ∈Î such that the minimal graphical model for Y is empty. This distribution belongs to the family of power series distributions since there exists some α > 0 such that p k∗ = p 0∗ α k c θ (k )/c θ (0), for all k ∈ Î. In this case and only this case, the resulting convolution splitting distribution is not a senso stricto multivariate distribution. For all other univariate distributions L(ψ) , (p k∗ )k ∈Î , the graphical model is complete (the criterion 2 holds) and thus the resulting convolution splitting distribution is a sensu 8 PIERRE FERNIQUE ET AL . stricto multivariate distribution. This characterization of the graphical model (Peyhardi and Fernique, 2017, Theorem 4) holds for multinomial and Dirichlet multinomial splitting distributions. But if the convolution is not positive (e.g., the multivariate hypergeometric distribution), this characterization does not hold anymore and stays an open issue. Derived distributions Several stability properties hold for additive convolution splitting distributions including results of Patil (1968); Janardan and Patil (1972); Xekalaki (1986) as particular cases. Theorem 1 Let Y follow an additive convolution splitting distribution Y ∼ C∆N (a; θ) ∧ L(ψ) then: N 1. The marginal sum |YI | follows the damage distribution CN (a; |θI |, |θ−I |) ∧ L(ψ). 2. The subvector YI given |YI | = n follows the singular convolution distribution C∆n (a; θI ). 3. The subvector YI follows the convolution splitting damage distribution N   C∆N (a; θI ) ∧ CN 0 (a; |θI |, |θ−I |) ∧0 L(ψ) . N 4. N The subvector YI given Y−I = y−I follows the convolution splitting truncated and shifted distribution h i C∆N (a; θI ) ∧ T S | y−I | { L(ψ)} . N 5. The subvector YI given Y J = y J follows the convolution splitting truncated and shifted damage distribution    C∆N (a; θI ) ∧ T S | y J | CN 0 (a; |θI∪J |, |θ−I∪J |) ∧0 L(ψ) . N N where I ⊂ {1, . . . , J }, −I = {1, . . . , J } \ I, J ⊂ −I and T S δ { L(ψ)} denotes the truncated and shifted distribution L(ψ) with parameter δ ∈ Î (i.e., X ∼ T S δ { L(ψ)} means that P (X = x ) = P Z ≥δ (Z = δ + x ) with Z ∼ L(ψ)). Corollary 2 An additive convolution splitting distribution C∆N (a; θ) ∧ L(ψ) is a natural multivariate extension of L(ψ) if N the latter is stable under the damage process CN (a; |θI |, |θ−I |) ∧ (·) for any subset I ⊂ {1, . . . , J }. Univariate marginals are thus following the distribution L(ψj ) for some ψj ∈ Ψ. N Corollary 3 The non-singular version of an additive convolution distribution is a specific convolution splitting distribution: C∆N (a; θ) ∧ Cn (a; |θ | , γ) = CNn (a; θ, γ) . N The proof of the three previous result are given in Appendix A. As a consequence from Corollary 3, the univariate distribution L(ψ) = Cn (a; |θ | , γ) is considered as the canonical case for a given convolution distribution. The parameters of the convolution distribution and the univariate bounded distribution are independent given the sum |θ |. This property can be benefited from into parameter inference procedures. Such dependence disappears when the convolution distribution is proportional, implying that inference procedure of the non-singular distribution is separable into two independent parts. Note that univariate marginals follow the convolution damage distribution: Yj ∼ CN (a; θj , |θ−j |) ∧ L(ψ). It is thus easy to highlight multivariate extensions studying these marginal distributions. N PIERRE FERNIQUE ET AL . 9 Positive Additive Proportional Multinomial × × × Dirichlet multinomial × × Multivariate hypergeometric TA B L E 3 4 | × Properties differentiating three convolutions distributions. MULTINOMIAL SPLITTING DISTRIBUTIONS In this section the multinomial distribution is introduced as a positive, additive and proportional convolution distribution. Then, the general case of multinomial splitting distributions (i.e., for any sum distribution L(ψ)) is addressed. For six specific sum distributions, the usual characteristics of multinomial splitting distributions are described in Tables 4 and 5. Finally, the canonical case of binomial sum distribution is detailed, with particular emphasize on parameter inference. Multinomial distribution Let a θ (y ) = θ y /y ! be the parametric sequence that characterizes the multinomial distribution as a convolution distribution. It is positive since θ y /y ! > 0 for all θ ∈ Θ = (0, ∞) and all y ∈ Î. It is additive, as a  Í consequence from the binomial theorem: (θ + γ)n = ny =0 yn θ y γ n−y . It implies, by induction on n, that the normalizing constant is c θ (n) = a | θ | (n) = |θ | n /n!. The pmf of the singular multinomial distribution is thus given by P | Y |=n (Y = y) =  Ö  J  θj y j n · 1∆n (y), |θ | y (2) j =1 and is denoted by M∆n (θ) with θ ∈ (0, ∞)J . This convolution is proportional, implying that the equivalence class of distributions {M∆n (λ · θ), λ ∈ (0, ∞)} can be summarized by the representative element M∆n (π) where π = The parameters vector π lies in the continuous simplex c∆ = {π ∈ (0, 1)J 1 |θ | · θ. : |π | = 1} and the pmf reduces to its usual form. The pmf of the non-singular multinomial distribution, denoted by MNn (θ, γ), is given by P (Y = y) =    n−| y | Ö  yj J  θj n γ · 1Nn (y). y |θ | + γ |θ | + γ j =1 In the same way there exists a representative element MNn (π ∗ , γ ∗ ) with (π ∗ , γ ∗ ) ∈ (0, 1)J +1 such that |π ∗ | + γ ∗ = 1. Knowing this constraint, the last parameter γ ∗ = 1 − |π ∗ | could be let aside to ease the notation and obtain MNn (π ∗ ) where the parameters vector π ∗ lies in the continuous corner of the open hypercube cN = {π ∗ ∈ (0, 1)J : |π ∗ | < 1}. As a particular case of the non-singular multinomial distribution (when J = 1), the binomial distribution is finally denoted by Bn (p) with p ∈ (0, 1) (which is also the representative element of its class). Even if this new definition of multinomial distributions based on equivalence classes seems quite artificial, it is necessary to obtained all the properties that hold for convolution splitting distributions. For instance Corollary 3 becomes M∆N (π) ∧ Bn (p) = MNn (p · π) , N (3) with representative element notations (see Appendix A for the proof). A second point that is important to highlight is the difference between singular and non-singular multinomial distributions. Contrarily to the widely held view that the 10 PIERRE FERNIQUE ET AL . multinomial distribution is the extension of the binomial distribution (Johnson et al., 1997), only the non-singular one should be considered as the natural extension. In fact, criterion 4 does not hold for the singular multinomial distribution (multivariate marginals follow non-singular multinomial distributions). Moreover, when confronted to multivariate counts, the usual inference of multinomial distributions (Johnson et al., 1997; Zhang et al., 2017) is the inference of singular multinomial distributions such that [n ∈ Î the random vector Y given |Y | = n follows M∆n (π). Such a point of view therefore limits the possibility of comparing these distributions to other classical discrete multivariate distributions such as the negative multinomial distribution (Johnson et al., 1997) or the multivariate Poisson distributions (Karlis and Meligkotsidou, 2005) used for modeling the joint distribution of Y . The singular multinomial distribution must not be considered as a J -multivariate distribution since criterion 1 does not hold. Properties of multinomial splitting distributions Let Y follow a multinomial splitting distribution M∆N (π) ∧ L(ψ). The criteria 1 and 3 hold, as a consequence from the positivity and the symmetry. The pmf is given by P (Y = y) = P ( |Y | = |y |)  N  J |y | Ö y j πj . y (4) j =1 The expectation and covariance are given by E (Y ) = µ 1 · π, Cov (Y ) = (5) µ 1 · diag(π) + (µ2 − µ 12 ) · ππ , t (6) where π t denotes the transposition of the vector π and µ k denotes the factorial moments of the sum distribution for k = 1, 2. Moreover, using the pgf formula of the singular multinomial distribution (Johnson et al., 1997) we obtain the pgf of multinomial splitting distributions as n o  G Y (s) = E (π t s) | Y | = G | Y | π t s , (7) where G | Y | denote the pgf of the sum distribution. The graphical model is characterized by the following property. Property 1 (Peyhardi and Fernique, 2017) The minimal graphical model for a multinomial splitting distribution is empty if the sum follows a Poisson distribution and is complete otherwise. Therefore, all multinomial splitting distribution are sensu stricto multivariate distributions (the criteria 2 holds) except when the sum follows a Poisson distribution. As a consequence from additivity, Theorem 1 holds and yields the marginals distributions in Corollary . Corollary 4 Let Y follow a multinomial splitting distribution, Y ∼ M∆N (π) ∧ L(ψ). Then, the marginals follow the binomial damage distribution Yj ∼ BN (πj ) ∧ L(ψ). Moreover, for y ∈ Î N N y  πj (y ) G (1 − πj ), P Yj = y = y ! |Y | (8) (y ) where G | Y | denotes the y -th derivative of the pgf of the sum distribution L(ψ). Using equation (8), it is easy to study the action of the binomial distribution among the set of univariate distribution. Assume that L(ψ) is a power series distribution denoted by P S D {g (α)}. It can be seen by identifiability that the PIERRE FERNIQUE ET AL . 11 resulting distribution of Y is exactly the multivariate sum-symmetric power series distribution (MSSPSD) introduced by Patil (1968) with M∆N (π) ∧ P S D {g (α)} = MSSPSD{α · π }. The non-singular multinomial distribution, the negative N multinomial distribution and the multivariate logarithmic series distribution are thereby encompassed in multinomial splitting distributions (see Table 4). Assume now that L(ψ) is a standard beta compound distribution. We obtaine three new multivariate distributions which are multivariate extensions of the non-standard beta binomial, non-standard beta negative binomial and beta Poisson distributions (see Table 5 for details about these three multivariate distributions and Appendix C for definitions of the non-standard beta binomial and the non-standard beta negative binomial distributions). All the characteristics of these six multinomial splitting distributions (pmf, expectation, covariance, pgf and marginal distributions) have been calculated using equations (4), (5), (6), (7), (8) according to the sum distribution L(ψ). The singular multinomial distribution belongs to the exponential family. For any j ∈ {1, . . . , J } the MLEs πbj are given by the following closed-form expression: Í π bj = Í Canonical case of binomial sum distribution. y ∈N yj y ∈N |y | . (9) The case L(ψ) = Bn (p) is considered as the canonical case since the binomial distribution is the univariate version of the non-singular multinomial distribution. Usual characteristics of the multinomial splitting binomial distribution are obtained using equations (4), (5), (6), (7), (8) with L(ψ) = Bn (p). It should be remarked that the constraint between parameters of the singular distribution and the sum distribution described in Corollary 3 disappears in this case, as for equation (3). More generally the constraint disappears when the convolution is proportional. Relation (3) and equation (1) allow parameters of non-singular multinomial distributions to be inferred using a parameter inference procedure for singular multinomial and binomial distributions. In particular, this enables us to propose joint or conditional maximum likelihood estimation of parameters n and π of the non-singular multinomial distribution directly by combining MLE inference for the binomial distribution (Blumenthal and Dahiya, 1981) with the closed-form expression given in equation (9). Moreover, equation (1) allows us to generalize studies related to parameter inference in binomial distributions (Deriggi, 1983) to parameter inference in the non-singular multinomial distributions. If the sum dataset is • overdispersed, the likelihood is an increasing function of n and there is no finite MLE of n, • underdispersed, the likelihood is either a decreasing function of n, or has an unique maximum and there is a finite MLE of n. Note that some previous works considered the joint estimation of parameters n and π for non-singular multinomial distributions (Sanathanan, 1972; Royle et al., 2007) but only MLEs for specific constraints were derived. j =1 (pπj ) ÎJ ·π n · diag(π) + r 1−p 1−p π t s p 1−p p 1−p Yj ∼ N B(r , pπj )4 r  r (1 − p)r yj o p 1−p · ππ t yj j =1 πj Yj ∼ L (p 0, ω) 5 ln(1−p·π t s) ln(1−p) −p (1−p) ln(1−p) ·π n · diag(π) + | y | ln(1−p) −p (1−p) ln(1−p) y ÎJ \ (0, . . . , 0) ÎJ |y |  −1 | y |+r −1 y M L(p · π) ÎJ L(p) p {1−ln(1−p)} (1−p) ln(1−p) Yj ∼ β πj Bn (a, b) Marginals · ππ t o y j j =1 πj ÎJ N (b) Yj ∼ β πj N B(r , a, b) b a−1 ·π6 n o (b−1)−b−1 b r a−1 · diag(π) + a(b+r +1)+r · ππ t 7 (a−1)(a−2)  a (b) t (r +a) 2 F 1 (r , b); r + a + b; π s r | y |+r −1 B(r +a,| y |+b) y,r −1 B(a,b) ÎJ β N B(r , a, b) Y ∼ M∆N (π) ∧ L(ψ) o + |y |, a + b + |y |; −λ) · ππ t Yj ∼ β πj λ P(a, b) yj πj j =1 y j ! ÎJ a λ a+b ·π n o a b λ a+b · diag(π) + λ (a+b)(a+b+1) · ππ t  t 1 F 1 a; a + b; λ(π s − 1) (a) | y | λ | y | (a+b) | y | 1 F 1 (a ÎJ β λ P(a, b) Usual characteristics of multinomial splitting beta binomial, beta negative binomial and beta Poisson distribution. 2 F 1 {(−n, a); α TA B L E 5 b(n−1)−a(a+b+1) (a+b)(a+b+1) y j j =1 πj ÎJ + b; 1 − π t s} a n a+b ·π n a n a+b · diag(π) + G Y (s) Cov(Y ) E(Y ) n  B(| y |+a,n−| y |+b) y B(α,b) Nn Supp(Y ) P (Y = y) β Bn (a, b) L(ψ) Distribution TA B L E 4 yj N N M(r , p · π) N B(r , p) Y ∼ M∆N (π) ∧ L(ψ) Usual characteristics of multinomial splitting binomial, negative binomial and logarithmic series distribution. Yj ∼ Bn (pπj ) 4 Marginals G Y (s) Cov(Y ) j =1 (pπj ) ÎJ np · π  np · diag(π) − p · ππ t n 1 − p + p πt s E(Y ) (1 − p)n−| y | Nn n Supp(Y ) y MNn (p · π) Re-parametrization P (Y = y) Bn (p) L(ψ) Distribution 12 PIERRE FERNIQUE ET AL . PIERRE FERNIQUE ET AL . 5 | 13 DIRICHLET MULTINOMIAL SPLITTING MODELS In this section the Dirichlet multinomial distribution is introduced as a positive and additive convolution distribution. Then, the general case of Dirichlet multinomial splitting distributions is studied. For six specific sum distributions, the usual characteristics of Dirichlet multinomial splitting distributions are described in Tables 6, 7, 8, and 9. Finally, the canonical case of beta binomial sum distribution is detailed, with particular emphasis on parameter inference. Dirichlet multinomial distribution Let a θ (y ) = y +θ−1 y be the parametric sequence that characterizes the Dirichlet  multinomial distribution as a convolution distribution. It is positive since y +θ−1 > 0 for all θ ∈ Θ = (0, ∞) and all y ∈ Î. y  Ín  n−y +γ−1 It is additive, as a consequence from the convolution identity of Hagen and Rothe: n+θ+γ−1 = y =0 y +θ−1 . n y n−y  It implies, by induction on n, that the normalizing constant is c θ (n) = a | θ | (n) = n+| θn |−1 . In order to respect the usual notation, parameter α will be used instead of θ, and thus the Dirichlet multinomial distribution will be denoted by D M ∆n (α) with n ∈ Î and α ∈ (0, ∞)J . The non-singular Dirichlet multinomial distribution will be denoted by D M Nn (α, b) with b ∈ (0, ∞). The beta binomial distribution will be denoted by β Bn (a, b) with (a, b) ∈ (0, ∞)2 . For similar reasons as in the multinomial case, the non-singular Dirichlet multinomial distribution should be considered as the natural extension of the beta binomial distribution, rather than the singular one. Note that a Dirichlet multinomial distribution is exactly a multivariate negative hypergeometric distribution. Dirichlet multinomial splitting distributions In this paragraph let Y follow a Dirichlet multinomial splitting distribution D M ∆N (α) ∧ L(ψ). Criteria 1 and 3 hold, as a consequence of positivity and symmetry. The pmf is given N by P (Y = y) =  J  P ( |Y | = |y |) Ö y j + αj − 1 .  | y |+| α |−1 yj |y | (10) j =1 The expectation and covariance are given by µ1 · α, |α |     |α | + 1 2 1 Cov (Y ) = · {( |α| + 1)µ1 + µ 2 } · diag(α) + µ 2 − µ 1 · ααt . |α |( |α | + 1) |α| E (Y ) = (11) (12) The pgf is given by G Y (s) = Õ ÎJ Γ (|y | + 1) P (|Y | = |y |) y ∈ÎJ j =1 (αj ) y j ( |α |) | y | y J s j Ö j j =1 yj ! . (13) The graphical model is characterized by the following property. Property 2 (Peyhardi and Fernique, 2017) Let Y follow a Dirichlet multinomial splitting distribution with parameter α ∈ (0, ∞)J . The minimal graphical model for Y is empty if the sum follows a negative binomial distribution with parameters ( |α |, p) for some p ∈ (0, 1) and is complete otherwise. Therefore, all Dirichlet multinomial splitting distribution are senso stricto multivariate distributions except when the sum follows a negative binomial distribution N B(r , p) with the specific constraint r = |α|. Finally, due to additivity, Property 1 can be applied to describe the marginal distributions. 14 PIERRE FERNIQUE ET AL . Corollary 5 Let Y follow a Dirichlet multinomial splitting distribution, Y ∼ D M ∆N (α) ∧ L(ψ) with α ∈ (0, ∞)J . Then, the marginals follow the beta-binomial damage distribution Yj ∼ β BN (αj , |α−j |) ∧ L(ψ). N N Using the Fubini theorem, it can be shown that   Yj ∼ BN (π) ∧ L(ψ) ∧ β (αj , |α−j |), π N (14) since N and π are independent latent variables. Therefore, results previously obtained for the binomial damage distributions can be used to describe the beta-binomial damage distributions. Assume that L(ψ) is a standard beta compound distribution. Four new and two already known multivariate distributions are obtained or recovered (see Tables 6, 7 and 8). In particular, natural multivariate extensions of three beta compound distributions are described. The non-singular Dirichlet multinomial is recovered when L(ψ) = β Bn (a, b) with the specific constraint a = |α |. The multivariate generalized waring distribution, introduced by Xekalaki (1986), is recovered when L(ψ) = β N B(r , a, b) with the specific constraint r = |α |. Finally, a multivariate extension of the beta Poisson distribution is proposed when L(ψ) = β λ P(a, b) with the specific constraint a = |α |. Assume now that L(ψ) is a power series distributions leading to three new multivariate extensions (see Table 9). Remark that several multivariate extensions of the same univariate distribution could be defined. For instance the multinomial splitting beta binomial distribution M∆N (π) ∧ β Bn (a, b) and the Dirichlet multinomial splitting binomial N distribution D M ∆N (α) ∧ Bn (p) are two multivariate extensions of the non-standard beta binomial distribution (see N Tables 5 and 9). Note that the singular Dirichlet multinomial distribution does not belongs to the exponential family. Either if |α | is known or not, MLEs αbj can be computed using various iterative methods (Minka, 2000; Sklar, 2014). Canonical case of beta binomial sum distribution The case L(ψ) = β Bn (a, b) is considered as the canonical case since the beta binomial distribution is the univariate version of the non-singular Dirichlet multinomial distribution. Usual characteristics of the Dirichlet multinomial splitting beta binomial distribution are derived from equations (10), (11), (12), (13) and (14) with L(ψ) = β Bn (a, b). According to Corollary 3, the Dirichlet multinomial splitting beta binomial distribution with the specific constraint a = |α | is exactly the non-singular Dirichlet multinomial distribution: D M ∆N (α) ∧ β Bn (|α|, b) = D M Nn (α, b) . N (15) The constraint a = |α | has to be taken into account in the inference procedure, either on the singular distribution or on the sum distribution. We propose to use the first alternative since the inference procedure of a constrained Dirichlet multinomial distribution (i.e., with a fixed sum |α |) has already been proposed by Minka (2000). The sum distribution β Bn (a, b) can then be estimated without constraint on parameters a or b (see Table 2). Note that, if no constraint between parameters of singular and sum distributions is assumed then the inference procedure is straightforward, since it can be separated into two independent procedures. The resulting splitting distribution is more general, including the non-singular Dirichlet multinomial distribution as a special case. As a consequence from equation (14), the marginals follow beta square binomial distributions β 2 Bn (αj , |α−j |, a, b) and β Bn (αj , |α−j | + b) when the constraint a = |α| is assumed (see Appendices B and C for definition of beta square distribution and beta square compound distributions). Identifying these two distributions we obtain a property about the product of two independent beta distributions. Property 3 For (a, b, c) ∈ (0, ∞)3 , let X ∼ β (a, b) and Y ∼ β (a + b, c) be two independent random variables. Then XY ∼ β (a, b + c). This result can be extended by induction for a product of n independent beta distributions. na a+b + |α | · diag(α) i o b(a+b+n) (a+b)(a+b+1) − Yj ∼ β 2 Bn αj , |α−j |, a, b o − 1 · ααt − n + 1, |α|); s}  na | α |(a+b) + ·α n hn Yj ∼ β Bn + rb a−1 TA B L E 7 o − 1 · ααt n |α| | α |+b o i − 1 · ααt + o + |α | · diag(α) 8 o + |α | · diag(α) i n hn yj ! (αj ) y j b a−1 Yj ∼ β N B αj , a, b 4 + | α |b a−1 o + |α| · diag(α) i o − 1 · ααt 9 |α| + a + b; s) − (| α |+a−1)(a+b−1) (a−1)(a−2) (| α |+a−1)(a+b−1) (a−1)(a−2) · (a) | α | J (a+b) | α | 1 F 1 (b; α; + b (| α |+1)(a−1) j =1 ÎJ Usual characteristics of Dirichlet multinomial splitting standard beta negative binomial distribution respectively without constraint and with r = |α|.  + a + b, |α |); s} rb | α |(a−1) Yj ∼ β 2 N B r , αj , |α−j |, a, b − (r +a−1)(a+b−1) (a−1)(a−2) Marginals (r +a−1)(a+b−1) (a−1)(a−2) hn (a)r J (a+b)r 2 F 2 {(r , b); α; (r n · G Y (s) + rb | α |(| α |+1)(a−1) b (| α |+1)(a−1) α (a) | α | (b) | y | (a+b) | α | (| α |+a+b) | y | E(Y ) yj ! rb | α |(| α |+1)(a−1) α j =1 (r ) | y | (b) | y | (a)r (a+b)r (r +a+b) | y | (| α |) | y | P (Y = y) ÎJ ÎJ (αj ) y j ÎJ r = |α | N Supp(Y ) no constraint Y ∼ D M ∆N (α) ∧ β N B(r , a, b) MGWD(b, α, a) Cov(Y ) n | α |+b − n + 1; s)  αj , |α−j | + b 4 − b(| α |+b+n) (| α |+b)(| α |+b+1) b(| α |+b+n) (| α |+b)(| α |+b+1) · (b)n J (| α |+b)n 1 F 1 (−n; α; −b + y j +αj −1 ) yj (n+|αn|+b−1) n (| α |+1)(| α |+b) n |α| | α |(| α |+b) j =1 ( ÎJ Re-parametrization Constraint n · b(a+b+n) (a+b)(a+b+1) (b)n J (a+b)n 2 F 2 {(−n, a); α; (−b + na | α |(| α |+1)(a+b) |−1 (n+|α ) n n−| y |+b−1 n−| y | Usual characteristics of Dirichlet multinomial splitting standard beta binomial distribution respectively without constraint and with a = |α | . Distribution TA B L E 6 Marginals G Y (s) Cov(Y ) E(Y ) hn na | α |(a+b) ·α n  B(a+| y |,b+n−| y |) |y | B(a,b) P (Y = y) Nn y j +αj −1 ) j =1 ( y j ÎJ Supp(Y ) Nn N a = |α | D M Nn (α, b) no constraint Y ∼ D M ∆N (α) ∧ β Bn (a, b) Re-parametrization Constraint Distribution PIERRE FERNIQUE ET AL . 15 (a) | y | (a+b) | y | (| α |) | y | λa | α |(a+b) P (Y = y) E(Y )  np |α| E(Y ) yj ! Î j ∈J y (λs j ) j yj ! n · hn Yj ∼ β λ P αj , |α−j | + b 4 + |y |); a + b; (λ · s, −λ)} o λ| α | + |α |+b + |α | + 1 · diag(α) o i λ − a+b · ααt + |y |; a + b + |y |; −λ) λb (| α |+b)(| α |+b+1) y j ! 1 F 1 (a (αj ) y j λb (| α |+b)(| α |+b+1) J +1 F {(α, a 0 1 + λ (| α |+1)(a+b) ·α j =1 ÎJ ·α (r ) | y | (| α |) | y | p |y | j =1 ÎJ yj ! (αj ) y j N Yj ∼ β p N B(r , αj , |α−j |) (1 − p)r 1J F1 (r ; α; |α |; p · s)  (r −| α |)p+| α |+1 rp 1−p | α |(| α |+1)(1−p) ·  (| α |−r )p + | α |(1−p) · ααt rp | α |(1−p) (1 − p)r ÎJ N B(r , p)10 · diag(α) Y ∼ D M ∆N (α) ∧ L(ψ) ·α yj ! (αj ) y j n · (λ + |α | + 1) · diag(α) − j =1 ÎJ Yj ∼ β λ P(αj , |α−j |) e −λ 0J F1 (α; |α |; λ · s) λ | α |(| α |+1) λ |α| |y | |y | λ e −λ (| α |) ÎJ P(λ) Usual characteristics of Dirichlet multinomial splitting binomial, negative binomial and Poisson distribution. Yj ∼ β p Bn (αj , |α−j |) p Marginals · ααt (1 − p)n 1J F1 (−n; α; |α |; − 1−p · s) np | α |(| α |+1) p(n+| α |) − |α| j =1 ÎJ (αj ) y j G Y (s) TA B L E 9 i + |α| + 1 · diag(α) · {(n − 1)p + |α | + 1} · diag(α) Γ(n+1)p | y | (1−p)n−| y | Γ(n−| y |+1)(| α |) | y | P (Y = y)  Nn Supp(Y ) ·α Bn (p) L(ψ) Distribution Cov(Y ) k! + λa a+b λ | α |+b λ |y | (a+b) | y | ÎJ Usual characteristics of Dirichlet multinomial splitting beta Poisson distribution respectively without constraint and with a = |α |. Yj ∼ β λ2 P αj , |α−j |, a, b TA B L E 8 o k ∈Î (a+b) | y |+k (| α |) | y | Marginals Í − λb (a+b)(a+b+1) o N a = |α | Y ∼ D M ∆N (α) ∧ β λ P(a, b) + |y |; a + b + |y |; −λ) λa t | α |(a+b) · αα ÎJ (a) | y |+k j =1 (αj ) y j (−λ)k λb (a+b)(a+b+1) y ∈ÎJ n · hn y j ! 1 F 1 (a Í + λa | α |(| α |+1)(a+b) ·α j =1 ÎJ (αj ) y j G Y (s) Cov(Y ) ÎJ Supp(Y ) λ |y | no constraint Constraint Distribution λ |α| · ααt o 16 PIERRE FERNIQUE ET AL . PIERRE FERNIQUE ET AL . 17 (a) Regression Link function Multinomial πj = Dirichlet multinomial exp(xt βj ) , 1+exp(xt βj ) j = 1, . . . , J − 1 αj = exp(xt βj ), j = 1, . . . , J Generalized Dirichlet multinomial aj = exp(xt β1,j ), j = 1, . . . , J − 1 bj = exp(xt β j = 1, . . . , J − 1 2,j ), Parameter inference See Zhang et al. (2017) see Zhang et al. (2017) see Zhang et al. (2017) (b) Regression Link function Parameter inference Poisson λ = exp(xt β) See McCullagh and Nelder (1989) Binomial Negative binomial p= exp(xt β ) 1+exp(xt β ) See McCullagh and Nelder (1989) for n known p = exp(xt β) Beta Poisson a a+b Beta binomial a a+b Beta negative binomial a a+b See Hilbe (2011) = exp(xt β ) 1+exp(xt β ) See Vu et al. (2016) = exp(xt β ) 1+exp(xt β ) See Forcina and Franconi (1988) = exp(xt β ) 1+exp(xt β ) and Lesnoff et al. (2012) for n known See Rodríguez-Avi et al. (2009) and Saez-Castillo et al. (2017) TA B L E 1 0 6 | References of inference procedures for (a) singular regressions and (b) univariate regressions. SPLITTING REGRESSION MODELS Let us consider the regression framework, with the discrete multivariate response variable Y and the vector of Q  explanatory variables X = X 1 , . . . , XQ . The random vector Y is said to follow a splitting regression if there exists ψ : Supp(X) → Ψ and θ : Supp(X) → Θ such that: • the random vector Y given |Y | = n and X = x follows the singular regression S∆n {θ (x)} for all n ∈ Î. • the sum |Y | given X = x follow the univariate regression L {ψ (x)}. Such a compound regression model will be denoted by Y | X = x ∼ S∆N {θ (x)} ∧ L {ψ (x)}. The decomposition of N log-likelihood (1) still holds when considering covariates if parametrizations of the singular distribution and the sum distribution are unrelated. Table 10 gives some references for parameter inference and variable selection adapted to three singular regressions and six univariate regressions. The choice of the link function for the singular regression is related to the symmetry of the resulting splitting regression. Using the singular multinomial regression for instance, only the canonical link function implies the symmetry of the splitting regression (see Peyhardi et al. (2015) for details about invariance properties of categorical regression models). Note that all generalized Dirichlet multinomial splitting regressions are not symmetric since the singular distribution is not. 18 7 PIERRE FERNIQUE ET AL . | EMPIRICAL STUDIES All studies presented in this section are reproducible. Packages used are installable using the conda package management system and each study is available as a Jupyter notebook (see Appendix D). 7.1 | A comparison of multivariate models for count data In order to illustrate the variety of splitting models, we considered two datasets used in the literature to illustrate models for count data. The first one consists in outcomes of football games (Karlis and Ntzoufras, 2005) and the second one consists in simulated data mimicking data obtained from sequencing techonologies such as RNA-seq data (Zhang et al., 2017). The goal being to compare distributions and regressions models, comparisons were performed when considering all covariates or none of the covariates (see Table 11). Remark that variable selection (Zhang et al., 2017, e.g., using regularization methods) is possible, but is out of the scope of this paper. Let us first remark that the inference methodology for multinomial, Dirichlet multinomial and generalized Dirichlet multinomial regressions presented by Zhang et al. (2017) and implemented by Zhang and Zhou (2017) is only valid for singular versions. Their comparisons of these models against the negative multinomial is therefore invalid since the first three models focus on Y given |Y | and the latter focuses on Y . Hence, we only compared our results to their unique J -multivariate model that is the negative multinomial model and the multivariate Poisson model defined by Karlis and Meligkotsidou (2005). By limiting the number of sum models to 7 and the number of singular models to 6, we were able to propose 42 splitting models. Among those 42 models, only 4 models were not sensu stricto multivariate models since multinomial splitting Poisson models induce independent response variables. For the first dataset, the best splitting model is a singular multinomial regression compounded by a Poisson distribution with a BIC of 508.14 + 1, 130.64 = 1, 638.78. This score is inferior to the one of the best multivariate Poisson model (i.e., 1, 710.05) and the one of the best negative multinomial model (i.e., 1, 705.93). This indicates that there is no relationship between football team goals. For the second dataset, the best splitting model is a singular generalized Dirichlet multinomial regression compounded by a negative binomial regression with a BIC of 8843.48 + 2514.3 = 11, 357.78. This score is also inferior to the one of the best negative multinomial model (i.e., 17, 657.63). 7.2 | An application to mango patchiness analysis Recently, a statistical methodology has been proposed to characterize plant patchiness at the plant scale (Fernique et al., 2016). However, little is known about patchiness at the whole population scale. To characterize patchiness at the plant scale, a segmentation/clustering of tree-indexed data method has been proposed in order to split an heterogeneous tree into multiple homogeneous subtrees. After the clustering, the tree can be summarized into a multivariate count denoting the number of subtrees in each cluster (i.e., patch type). Mixture of multinomial splitting distributions can therefore be considered to recover the different types of tree patchiness that can be found in the plant population. Such a mixture model is of high interest since it enables to discriminate the types of tree patchiness according to the : • number of patches present on trees, by fitting different sum distributions within components of the mixture model, • distribution of these patches among types, by fitting different singular distributions within components of the mixture model. We here consider results presented by Fernique et al. (2016) to conduct our post-hoc analysis. Three different types of PIERRE FERNIQUE ET AL . 19 (a) (b) Y given |Y | = n and X = x BIC0 BIC1 |Y | given X = x BIC0 BIC1 M∆n (π) 574.18 38, 767.91 P (λ) 1, 130.64 13, 074.12 D M ∆n (α) 579.49 9, 969.121 Bn (p) 1, 165.6 26, 474.38 G D M ∆n (α, β) 579.49 9, 735.45 N B (r , p) 1, 131.85 2, 678.55 M∆n {π (x)} 508.14 15, 145.24 L (p) 1, 370.84 3, 513.92 D M ∆n {α (x)} 836.4 8, 932.83 P {λ (x)} 1, 258.65 6, 353.13 G D M ∆n {α (x) , β (x)} 836.4 8, 843.479 Bn {p (x)} 1, 272.7 12, 999.47 N B {r , p (x)} 1, 264.38 2, 514.30 (c) (d) Y given X = x BIC0 BIC1 Y given X = x BIC0 BIC1 M P (λ) 1, 710.05   M N (r , π) 1, 705.93 41, 384.52 M P {λ (x)} 1, 956.10   M N {r , π (x)} 2, 176.3 17, 657.63 TA B L E 1 1 Bayesian Information Criteria (BIC) obtained for the first dataset (Karlis and Ntzoufras, 2005, BIC0 ) and the second one (Zhang et al., 2017, BIC1 ) for (a) singular models, (b) sum models , (c) Poisson and (d) negative multinomial models. Multivariate Poisson models could not be fit to the second dataset since, to our knowledge, there is no implementation available in R for more than 2 response variables (Karlis and Ntzoufras, 2005). patches have been identified for mango trees: vegetative patches which contain almost only vegetative growth units (GU, plant elementary component), reproductive patches which contain almost only GUs that flowered or fructified and quiescent patches which contain GUs that did not burst, flowered nor fructified. Multinomial splitting distributions of mixture components were therefore of dimension 3, where N 0 (resp. N 1 and N 2 ) denotes the number of vegetative (resp. reproductive and quiescent) patches observed within a tree. Since there is at least one patch in a mango tree (i.e., the tree itself), shifted singular multinomial splitting distributions were considered with a shift equal to 1 for binomial, negative binomial and Poisson sum distributions but without shift for geometric and logarithmic distributions. Within each component the parametric form of the sum distribution was selected using the BIC. The mixture model selected using BIC has two components (see Figure 2) with weights P (L = 1) = 0.44 and P (L = 2) = 0.56. In the two components i = 1, 2, the number of patches followed a multinomial splitting shifted negative binomial distribution Y | L = i ∼ M∆N (πi ) ∧ N B (r i , p i ; δi ) with estimations π̂1 = (0.21, 0.00, 0.79), rˆ1 = 0.16, p̂ 1 = 0.76, N δ̂ 1 = 1 for the first component and π̂2 = (0.54, 0.17, 0.28), rˆ2 = 3.96, p̂ 2 = 0.40, δ̂ 2 = 1 for the second component. This mixture of two components indicates that the population of mango trees can be separated into two types of trees (see Figure 3): • mango trees with a relatively low number of patches that can be either vegetative or quiescent but not reproductive (component 1), • mango trees with a relatively high number of patches that can be of any type and in particular reproductives (component 2). 20 PIERRE FERNIQUE ET AL . BIC -400 -600 -800 1 FIGURE 2 2 3 Number of mixture components 4 5 BIC according to the number of multinomial splitting components of mixtures. Frequency 80 60 40 20 0 2 4 6 n 8 10 12 F I G U R E 3 Representation of the mixture of sum distributions estimated (with a solid line) confronted to data frequencies (gray bars). Note that the sum distribution of the first (resp. second) component is represented with a dotted (resp. dashed) line. These types of trees are almost equally represented in the period considered (52% for the first component against 48%). This result tends to imply that the reproductive period of mango trees leads to an increase in patch number increase while the vegetative period leads to a decrease in patch number. 8 | DISCUSSION Convolutions splitting distributions that are positive and additive, have been studied in depth in this paper since their graphical models and their marginal distributions are easily obtained. The characterization of the graphical model of hypergeometric splitting distributions stay an open issue because of the non-positivity. But thanks to the additivity, Theorem 1 still holds. It would be interesting to instantiate some univariate distributions L(ψ) and precisely describe the resulting splitting distributions. More generally, the multivariate Polya distribution with parameters n ∈ Î, θ ∈ Θ and c ∈ Ò encompasses the multivariate hypergeometric (c = −1), the multinomial (c = 0) and the Dirichlet multinomial (c = 1) distributions (Janardan and Patil, 1970). It would therefore be interesting to study the properties of multivariate Polya splitting distributions according to the c value. Otherwise, non-symmetric convolution distributions could be defined (including the generalized Dirichlet multinomial distribution as a special case) to ease the study of corresponding PIERRE FERNIQUE ET AL . 21 splitting distributions. Another alternative to define new singular distributions is to consider their mixture. Finite mixture can be inferred using classical expectation-maximization algorithm for multivariate distributions. Moreover, in an application context the principle of mixture models is quite interesting for splitting models. If we consider the mango tree application, we inferred mixture of splitting distributions in order to characterize plant patchiness at the plant scale. This relied on the assumption that tree patchiness is both expressed in terms of number of patches and their type distribution. One the one hand, if tree patchiness is only a phenomenon expressed in term of number of patches, a mixture of sum distributions could be considered to distinguish trees. On the other hand, if tree patchiness is only a phenomenon expressed in term of patch type distribution, singular distributions constructed using mixture of singular distributions could be of most interest. Finally, this work could be used for learning graphical models with discrete variables, which is an open issue. Although the graphical models for convolution splitting distributions are basic (complete or empty), they could be used as building blocks for partially directed acyclic graphical models. Therefore, the procedure of learning partially directed acyclic graphical models described by Fernique et al. (2014) could be used for learning graphical models based on convolution splitting distributions and regressions. It could be used for instance to infer gene co-expression network from RNA seq dataset. REFERENCES Allen, G. I. and Liu, Z. (2012) A log-linear graphical model for inferring genetic networks from high-throughput sequencing data. In IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 1–6. IEEE. Blumenthal, S. and Dahiya, R. C. (1981) Estimating the binomial parameter n. Journal of the American Statistical Association, 76, 903–909. Chen, J. and Li, H. (2013) Variable selection for sparse dirichlet-multinomial regression with an application to microbiome data analysis. The Annals of Applied Statistics, 7, 418–442. Dai, H., Bao, Y. and Bao, M. (2012) Maximum likelihood estimate for the dispersion parameter of the negative binomial distribution. Statistics & Probability Letters, 83, 21–27. Deriggi, D. F. (1983) Unimodality of likelihood functions for the binomial distribution. Journal of the American Statistical Association, 78, 181–183. Digby, P. and Kempton, R. A. (2012) Multivariate analysis of ecological communities, vol. 5. Springer Science & Business Media. Dunkl, C. F. (2013) Products of Beta distributed random variables. ArXiv e-prints. Fernique, P., Dambreville, A., Durand, J.-B., Pradal, C., Lauri, P.-E., Normand, F. and Guédon, Y. (2016) Characterization of mango tree patchiness using a tree-segmentation/clustering approach. In 2016 IEEE International Conference on FunctionalStructural Plant Growth Modeling, Simulation, Visualization and Applications (FSPMA), 68–74. IEEE. Fernique, P., Durand, J.-B. and Guédon, Y. (2014) Estimation of discrete partially directed acyclic graphical models in multitype branching processes. In COMPSTAT 2014, 21st International Conference on Computational Statistics. Forcina, A. and Franconi, L. (1988) Regression analysis with the beta-binomial distribution. Rivista di Statistica Applicata, 21. Gurland, J. (1958) A generalized class of contagious distributions. Biometrics, 14, 229–249. Hilbe, J. M. (2011) Negative binomial regression. Cambridge University Press. 22 PIERRE FERNIQUE ET AL . Irwin, J. O. (1968) The generalized waring distribution applied to accident theory. Journal of the Royal Statistical Society. Series A (General), 205–225. Janardan, K. G. and Patil, G. P. (1970) On the multivariate polya distribution: a model of contagion for data with multiple counts. Random Count in Scientific Work, 3, 143–161. — (1972) A unified approach for a class of multivariate hypergeometric models. Sankhyā: The Indian Journal of Statistics, Series A (1961-2002), 34, 363–376. URL: http://www.jstor.org/stable/25049821. Johnson, N., Kemp, A. and Kotz, S. (1993) Univariate discrete distributions. Wiley-Interscience. Johnson, N., Kotz, S. and Balakrishnan, N. (1997) Discrete multivariate distributions. Wiley New York. Karlis, D. and Meligkotsidou, L. (2005) Multivariate Poisson regression with covariance structure. Statistics and Computing, 15, 255–265. Karlis, D. and Ntzoufras, I. (2005) Bivariate poisson and diagonal inflated bivariate Poisson regression models in R. Journal of Statistical Software, 14, 1–36. Koller, D. and Friedman, N. (2009) Probabilistic Graphical Models. The MIT Press. Lauricella, G. (1893) Sulle funzioni ipergeometriche a piu variabili. Rendiconti del Circolo Matematico di Palermo, 7, 111–158. URL: https://doi.org/10.1007/BF03012437. Lesnoff, M., Lancelot and R. (2012) aod: Analysis of Overdispersed Data. URL: http://cran.r-project.org/package=aod. R package version 1.3. McCullagh, P. and Nelder, J. (1989) Generalized linear models. Monographs on Statistics and Applied Probability 37. Chapman & Hall, London. Merkel, D. (2014) Docker: Lightweight Linux Containers for Consistent Development and Deployment. Linux Journal, 2014, 2. Minka, T. (2000) Estimating a dirichlet distribution. Mullahy, J. (1986) Specification and testing of some modified count data models. Journal of econometrics, 33, 341–365. Patil, G. (1968) On sampling with replacement from populations with multiple characters. The Indian Journal of Statistics, Series B, 30, 355–366. Patil, G. P. and Bildikar, S. (1967) Multivariate logarithmic series distribution as a probability model in population and community ecology and some of its statistical properties. Journal of the American Statistical Association, 62, 655–674. Peyhardi, J. and Fernique, P. (2017) Characterization of convolution splitting graphical models. Statistics & Probability Letters, 126, 59–64. Peyhardi, J., Trottier, C. and Guédon, Y. (2015) A new specification of generalized linear models for categorical responses. Biometrika, 102, 889–906. Radhakrishna Rao, C. and Rubin, H. (1964) On a characterization of the Poisson distribution. Sankhyā Ser. A, 26, 295–298. Rao, C. R. and Srivastava, R. (1979) Some characterizations based on a multivariate splitting model. Sankhyā: The Indian Journal of Statistics, Series A, 124–128. Rodríguez-Avi, J., Conde-Sánchez, A., Sáez-Castillo, A., Olmo-Jiménez, M. and Martínez-Rodríguez, A. M. (2009) A generalized waring regression model for count data. Computational Statistics & Data Analysis, 53, 3717–3725. Royle, J. A., Dorazio, R. M. and Link, W. A. (2007) Analysis of multinomial models with unknown index using data augmentation. Journal of Computational and Graphical Statistics, 16, 67–85. URL: http://dx.doi.org/10.1198/106186007X181425. PIERRE FERNIQUE ET AL . 23 Saez-Castillo, A. J., Vilchez-Lopez, S., Olmo-Jimenez, M. J., Rodriguez-Avi, J., Conde-Sanchez, A. and Martinez-Rodriguez, A. M. (2017) GWRM: Generalized Waring Regression Model for Count Data. URL: https://cran.r-project.org/package=GWRM. GWRM R package version 2.1.0.3. Sanathanan, L. (1972) Estimating the size of a multinomial population. The Annals of Mathematical Statistics, 43, 142–152. URL: http://www.jstor.org/stable/2239906. Shanbhag, D. N. (1977) An extension of the Rao-Rubin characterization of the Poisson distribution. J. Appl. Probability, 14, 640–646. Sklar, M. (2014) Fast mle computation for the dirichlet multinomial. arXiv preprint arXiv:1405.0099. Tripathi, R. C., Gupta, R. C. and Gurland, J. (1994) Estimation of parameters in the beta binomial model. Annals of the Institute of Statistical Mathematics, 46, 317–331. Vu, T. N., Wills, Q. F., Kalari, K. R., Niu, N., Wang, L., Rantalainen, M. and Pawitan, Y. (2016) Beta-poisson model for single-cell rna-seq data analyses. Bioinformatics, 32, 2128–2135. Whitby, O. (1972) Estimation of parameters in the generalized beta distribution. Winkelmann, R. (2013) Econometric analysis of count data. Springer Science & Business Media. Xekalaki, E. (1981) Chance mechanisms for the univariate generalized waring distribution and related characterizations. In Statistical distributions in scientific work, 157–171. Springer. — (1986) The multivariate generalized waring distribution. Communications in Statistics - Theory and Methods, 15, 1047–1064. Xia, F., Chen, J., Fung, W. K. and Li, H. (2013) A logistic normal multinomial regression model for microbiome compositional data analysis. Biometrics, 69, 1053–1063. Zhang, Y. and Zhou, H. (2017) MGLM: Multivariate Response Generalized Linear Models. URL: https://CRAN.R-project.org/ package=MGLM. R package version 0.0.8. Zhang, Y., Zhou, H., Zhou, J. and Sun, W. (2017) Regression models for multivariate count data. Journal of Computational and Graphical Statistics, 26, 1–13. A | PROOFS Details about marginal of symmetric splitting distributions For any j ∈ {1, . . . , J } and y j ∈ Î we have P (Yj = y j ) = Õ P (Y = y), y−j = Õ n ≥y j P (Yj = y j ) = Õ P ( |Y | = n) Õ P | Y |=n (Y = y), y−j P ( |Y | = n)P | Y |=n (Yj = y j ), n ≥y j The marginal distribution of the singular distribution, i.e., the distribution of Yj given |Y | = n, is a distribution bounded by n. Its parametrization has the same form fj (θ) for all marginals Yj given |Y | = n, since the singular distribution is symmetric. It implies that all marginals Yj follow the damage distribution LN {fj (θ)} ∧ L(ψ). N 24 PIERRE FERNIQUE ET AL . Proof of Theorem 1 Let I denote a subset of {1, . . . , J } withI , {1, . . . , J }. Let −I denote the subset {1, . . . , J } \ I and yI (respectively y−I ) denote the corresponding sub-vectors. Proof of 1 P ( |YI | = n) = Õ P (YI = yI ) yI ∈∆n = Õ Õ P (Y = y) yI ∈∆n y−I = Õ P | Y |=k (Y = y) Õ P ( |Y | = k ) Õ Ö a θj (y j ) c θ (k ) yI ∈∆n j ∈I k ≥n P ( |YI | = n) = Õ yI ∈∆n y−I ∈∆k −n k ≥n = Õ P ( |Y | = k ) Õ c θ (n)c θ (k − n) −I I c θ (k ) k ≥n Õ Ö a θj (y j ) y−I ∈∆k −n j ∈−I P ( |Y | = k ) where c θI (n) denotes the convolution of (a θj )j ∈I over the simplex ∆n . Since the convolution distribution is assumed to be additive, we obtain by recursion on j ∈ I (resp. j ∈ −I and j ∈ {1, . . . , J }) that P ( |YI | = n) = Õ a | θ | (n)a | θ | (k − n) I −I a | θ | (k ) k ≥n Moreover we obtain the convolution identity Ík n=0 P ( |Y | = k ) (16) a | θI | (n)a | θ−I | (k − n) = a | θ | (k ) and thus the last equation well defines the desired convolution damage distribution ∼ CN (a; |θI |, |θ−I |) ∧ L(ψ). N Proof of 2 and 3 P (YI = yI , |YI | = n) = P (YI = yI )1∆n (yI ) Õ = 1∆n (yI ) P ( |Y | = k ) Ö a θj (y j )1∆n (yI ) j ∈I P (YI = yI , |YI | = n) = Ö P | Y |=k (Y = y) y−I ∈∆k −n k ≥n = Õ Õ P ( |Y | = k ) c θ (k ) k ≥n a θj (y j )1∆n (yI ) j ∈I Õ y−I ∈∆k −n j ∈−I Õ a | θ | (k − n) −I k ≥n a | θ | (k ) P ( |Y | = k ) Using equation 16 we obtain the conditional probability P | YI |=n (YI = yI ) = 1 Ö a | θI | (n) j ∈I Ö a θj (y j )1∆n (yI ), and thus 2 holds. Remark that 1 and 2 imply 3 by definition of a splitting distribution. a θj (y j ) PIERRE FERNIQUE ET AL . 25 Proof of 4 and 5 P Y−I =y−I (YI = yI ) = PY−I =y−I , | YI |=| yI | (YI = yI )PY−I =y−I ( |YI | = |yI |) Since the sum |Y | is independent of the vector Y−I given its sum |Y−I | it can be shown that PY−I =y−I (YI = yI ) = P | YI |=| yI | (YI = yI )P | Y−I |=| y−I | ( |YI | = |yI |) Thanks to the result 2, the left part of this product is given by the singular convolution distribution. Remarking that P | Y−I |=| y−I | ( |YI | = |yI |) = P | Y |≥a ( |Y | = a + |yI |) with a = |y−I | the left part is given by the truncated and shifted distribution T S a { L(ψ)} and thus 4 holds. Remark that 3 and 4 imply 5. Proof of corollary 2 Assume that L(ψ) is stable under the damage process CN (a; |θI |, |θ−I |) ∧ (·) for any subset I ⊂ {1, . . . , J }. Thanks N to the additivity of the convolution distribution, Theorem 1 can be applied. Using the property 3, it is easily seen that multivariate marginals are stable. The criterion 4 holds and the convolution splitting distribution is considered as a natural multivariate extension of L(ψ). In particular, L(ψ) is stable under CN (a; |θj |, |θ−j |) ∧ (·) and thus the univariate N marginal follow L(ψj ) for some ψj ∈ Ψ. Proof of corollary 3 Let Y follow the non-singular version of an additive convolution distribution: Y ∼ CNn (a θ ; θ, θ). It means that the completed vector (Y , n − |Y |) follow the additive convolution C∆J +1 (a θ ; θ, θ). Otherwise this singular distribution can n seen as a particular splitting Dirac distribution, i.e., C∆J +1 (a θ ; θ, θ) = C∆J +1 (a θ ; θ, θ) ∧ 1n . Thanks to the additivity, the n N N Theorem 1 can be applied on the completed vector (Y , n − |Y |) to describe the distribution of Y (property 3):   Y ∼ C∆N (a θ ; θ) ∧ CN 0 (a θ ; |θ |, θ) ∧0 1n , N N ⇔ Y ∼ C∆N (a θ ; θ) ∧ Cn (a θ ; |θ |, θ). N Proof of equality (3) Using the Corollary 3 with a θ (y ) = θ y /y ! we obtain for θ ∈ (0, ∞)J and γ ∈ (0, ∞) M∆N (θ) ∧ Bn (|θ |, γ) = MNn (θ, γ) . N Denoting by π = 1 |θ | · θ, p = |θ | | θ |+γ and π ∗ = 1 | θ |+γ · θ and using the proportionality we obtain equivalently  M∆N (π) ∧ Bn (p, 1 − p) = MNn π ∗ , 1 − |π ∗ | . N The notation of the binomial and the non-singular multinomial are then simplified by letting aside the last parameter without loss of generality, i.e. we have M∆N (π) ∧ Bn (p) = MNn (π ∗ ). Finally remarking that π ∗ = p · π we obtain the desired result. N 26 B PIERRE FERNIQUE ET AL . | REMARKABLE CONTINUOUS UNIVARIATE DISTRIBUTION Let us recall the definition of the (generalized) beta distribution with positive real parameters c, α and b, denoted by β c (a, b). Its probability density function described by Whitby (1972) is given by f (x ) = 1 x a−1 (c − x )b−1 · 1(0,c) (x ). B (a, b) c a+b−1 Note that Z = dX with d ∈ (0, ∞) and X ∼ β c (a, b) implies that Z ∼ β cd (a, b). The parameter c of the beta distribution can thus be interpreted as a rescaling parameter of the standard beta distribution. By convention the standard beta distribution (i.e., defined with c = 1) will be denoted by β (a, b). Let us introduce the definition of the (generalized) beta square distribution with parameters (a 1 , b 1 , a 2 , b 2 ) ∈ (0, ∞)4 and c ∈ (0, ∞), denoted by β c2 (a 1 , b 1 , a 2 , b 2 ), as the product of the two independent beta distributions β (a 1 , b 1 ) and β (a 2 , b 2 ) normalized on (0, c); see Dunkl (2013) for details. It is named the standard beta square distribution when c = 1 and denoted by β 2 (a 1 , b 1 , a 2 , b 2 ). More generally the product of m beta distributions could be defined. C C.1 | REMARKABLE DISCRETE UNIVARIATE DISTRIBUTIONS | Power series distributions Let (b y ) y ∈Î be a non-negative real sequence such that the series Í y ≥0 b y θ y converges toward g (θ) for all θ ∈ D = (0, R ), where R is the radius of convergence. The discrete random variable Z is said to follow a power series distribution if for all y ∈ Î P (Y = y ) = by θy , g (θ) and is denoted by Y ∼ P S D {g (θ)}. Several usual discrete distributions fall into the family of power series distributions: 1. 2. 3. The Poisson distribution P(λ) with b y = 1/y !, θ = λ, g (θ) = e θ and D = (0, ∞).  The binomial distribution Bn (p) with b y = yn 1 y ≤n , θ = p/(1 − p), g (θ) = (1 + θ)n and D = (0, ∞).  The negative binomial distribution N B(r , p) with b y = r +yy −1 , θ = p, g (θ) = (1 − θ)−r and D = (0, 1). 4. The geometric distribution G(p) with b y = 1 y ≥1 , θ = 1 − p, g (θ) = θ/(1 − θ) and D = (0, 1). 5. The logarithmic series distribution L(p) with b y = 1 y ≥1 1/y , θ = p, g (θ) = − ln(1 − θ) and D = (0, 1). When the support is a subset of Î, the b y values can be weighted by an indicator function as for binomial, geometric and logarithmic distributions. The b y must be independent of θ but they may depend on other parameters as for binomial and negative binomial distributions. Zero modified logarithmic series Johnson et al. (1997) The discrete variable Y is said to follow a zero modified logarithmic series distribution with parameter ω ∈ [0, 1) and p ∈ (0, 1) if the its probabilities are given by P (Y = 0) = ω, P (Y = y ) = (1 − ω)p y , y ≥ 1. −y ln(1 − p) PIERRE FERNIQUE ET AL . 27 This distribution will be denoted by L(p, ω). Note that if ω = 0 this is the logarithmic series distribution: L(p, 0) = L(p). C.2 | Beta compound distributions Usual characteristics of the standard beta binomial (Tripathi et al., 1994), standard beta negative binomial - also described by Xekalaki (1981) as the univariate generalized waring distribution (UGWD) - and the beta Poisson distributions (Gurland, 1958) are first recalled in Table 12. Then we introduce these beta compound distributions in a general way, i.e. using the generalized beta distribution (see Appendix B). For the Poisson case we obtain the same distribution since P(λp) ∧ β (a, b) = P(θ) ∧ β λ (a, b). The two other case lead us to new distributions (13 for usual characteristics). Remark p θ that if π = 1 then, the generalized beta binomial (resp. generalized beta negative binomial) turns out to be the standard beta binomial (resp. standard negative binomial distribution). In opposition, if π < 1, the non-standard beta binomial distribution (respectively non-standard beta negative binomial distribution) is obtained. Generalized beta binomial distribution Let n ∈ Î, a ∈ (0, ∞), b ∈ (0, ∞) and π ∈ (0, 1) and consider the compound distribution Bn (p) ∧ β π (a, b) denoted by p β π Bn (a, b). Considering π as a rescaling parameter, we have β π Bn (a, b) = Bn (πp) ∧ β (a, b). Moreover, using the pgf of p the binomial distribution in equation (8), it can be shown that Bn (πp) = BN (π) ∧ Bn (p). Finally, using the Fubini theorem N we obtain   β π Bn (a, b) = BN (π) ∧ Bn (p) ∧ β (a, b), p N   = BN (π) ∧ Bn (p) ∧ β (a, b) , N p β π Bn (a, b) = BN (π) ∧ β Bn (a, b) . N This is a binomial damage distribution whose the latent variable N follows a standard beta binomial distribution. The equation (8) can thus be used to compute the probability mass function. The y t h derivative of the pgf of the standard beta binomial distribution is thus needed (y ) G N (s) = (−n) y (a) y (b)n 2 F 1 {(−n + y , a + y ); −b − n + 1 + y ; s }, (a + b)n (−b − n + 1) y obtained by induction on y ∈ Î. The moments are obtained with the total law of expectation and variance given the latent variable N of the binomial damage distribution. In the same way, we obtain the pgf as GY (s) = G N (1 − π + πs). A similar proof holds for the generalized beta negative binomial case. Generalized beta square compound distributions It is also possible to define the (generalized) beta square distribution, as the product of two independent beta distributions (Dunkl, 2013), and then define the (generalized) beta square compound distributions. • The standard beta square binomial distribution is defined as Bn (p)∧β 2 (a 1 , b 1 , a 2 , b 2 ) and denoted by β 2 Bn (a 1 , b 1 , a 2 , b 2 ). • The standard beta square negative binomial distribution is defined as N B(r , p) ∧ β 2 (a 1 , b 1 , a 2 , b 2 ) and denoted by p p β 2 N B(r , a 1 , b 1 , a 2 , b 2 ). • The generalized beta square binomial distribution is defined as Bn (p)∧β π2 (a 1 , b 1 , a 2 , b 2 ) and denoted by β π2 Bn (a 1 , b 1 , a 2 , b 2 ) p 28 • PIERRE FERNIQUE ET AL . The generalized beta square negative binomial distribution is defined as N B(r , p) ∧ β π2 (a 1 , b 1 , a 2 , b 2 ) and denoted p by β π2 N B(r , a 1 , b 1 , a 2 , b 2 ) • The beta square Poisson distribution is defined as P(θ) ∧ β λ2 (a 1 , b 1 , a 2 , b 2 ) and denoted by β λ2 P(a 1 , b 1 , a 2 , b 2 ). θ D | REPRODUCIBILITY The source code (written in C++ and Python) used for the inference of splitting distributions is available on GitHub (https://github.com/StatisKit) and binaries can be installed using the Conda package management system ((http: //conda.pydata.org)). Refers to the documentation for more information ((http://statiskit.rtfd.io)). Our analyses performed with the Python interface or R packages is available in the Jupyter notebook format as supplementary materials and can be reproduced using the Docker (Merkel, 2014) image statiskit/FPD18 (see https://hub.docker.com/r/statiskit/FPD18 for image and the documentation for more information). β Bn (a, b) Notation p + a + b; s } 1 F 1 {a; a (b)n (−n) y (a) y π y (a+b)n (−b−n+1) y y ! 2 F 1 {(−n a nπ a+b b(a+b+n) a nπ a+b π (a+b)(a+b+1) +1−π (b)n (a+b)n 2 F 1 {(−n, a); −b P (Y = y ) E(Y ) V(Y ) GY (s) − n + 1; 1 + π(s − 1)} 14 + y , b + y ); r + a + b + y ; 1 − π } (a)r (a+b)r 2 F 1 {(r , b); r + a + b; 1 + π(s − 1)} n o −1)(a+b−1) b r π a−1 π (a+r + 1 − π 15 (a−2)(a−1) b r π a−1 β π N B (r , a, b) + y ; a + b + y ; −λ) Usual characteristics of the generalized beta binomial and the generalized beta negative binomial distributions. n o (a)r (r ) y (b) y π y (a+b)r (r +a+b) y y ! 2 F 1 {(r {0, 1, . . . , n } Supp(Y ) + y , a + y ); −b − n + 1 + y ; 1 − π } Î β π Bn (a, b) p N B (r , p) ∧ β π (a, b) Notation p Bn (p) ∧ β π (a, b) Definition Generalized beta negative binomial Generalized beta binomial Name TA B L E 1 3 + b; λ(s − 1)} Usual characteristics of the standard beta compound binomial, negative binomial and Poisson distributions. GY (s) TA B L E 1 2 (a)r (a+b)r 2 F 1 {(r , b); r (b)n (a+b)n 2 F 1 {(−n, a); −b V(Y ) o n a b λ a+b 1 + λ (a+b)(a+b+1) n ab(a+b+n) (a+b)2 (a+b+1) b(a+r −1)(a+b−1) 13 (a−1)2 (a−2) r n E(Y ) r (a) y λ y (a+b) y y ! 1 F 1 (a a λ a+b P (Y = y ) b 12 a−1 P (Y = y ) = (a)b (r ) y (b) y 1 11 (a+r )b (r +a+b) y y ! (b)n (−n) y (a) y 1 (a+b)n (−b−n+1) y y ! a a+b Î Î {0, 1, . . . , n } Supp(Y ) β Pλ (a, b) P (λp) ∧ β (a, b) beta Poisson UGWD(r , b, a) β N B (r , a, b) p N B (r , p) ∧ β (a, b) Standard beta negative binomial Re-parametrization − n + 1; s } Bn (p) ∧ β (a, b) Definition p Standard beta binomial Name PIERRE FERNIQUE ET AL . 29
10math.ST
Estimation in the convolution structure density model. Part I: oracle inequalities. arXiv:1704.04418v1 [math.ST] 14 Apr 2017 O.V. Lepski ∗ T. Willer ∗ Institut de Mathématique de Marseille Aix-Marseille Université 39, rue F. Joliot-Curie 13453 Marseille, France e-mail: [email protected] e-mail: [email protected] Abstract: We study the problem of nonparametric estimation under Lp -loss, p ∈ [1, ∞), in the framework of the convolution structure density model on Rd . This observation scheme is a generalization of two classical statistical models, namely density estimation under direct and indirect observations. In Part I the original pointwise selection rule from a family of ”kernel-type” estimators is proposed. For the selected estimator, we prove an Lp -norm oracle inequality and several of its consequences. In Part II the problem of adaptive minimax estimation under Lp –loss over the scale of anisotropic Nikol’skii classes is addressed. We fully characterize the behavior of the minimax risk for different relationships between regularity parameters and norm indexes in the definitions of the functional class and of the risk. We prove that the selection rule proposed in Part I leads to the construction of an optimally or nearly optimally (up to logarithmic factor) adaptive estimator. AMS 2000 subject classifications: 62G05, 62G20. Keywords and phrases: deconvolution model, density estimation, oracle inequality, adaptive estimation, kernel estimators, Lp –risk, anisotropic Nikol’skii class. 1. Introduction In the present paper we will investigate the following observation scheme introduced in Lepski and Willer (2017). Suppose that we observe i.i.d. vectors Zi ∈ Rd , i = 1, . . . , n, with a common probability density p satisfying the following structural assumption p = (1 − α)f + α[f ⋆ g], f ∈ Fg (R), α ∈ [0, 1], (1.1) where α ∈ [0, 1] and g : Rd → R are supposed to be known and f : Rd → R is the function to be estimated. We will call the observation scheme (1.1)  convolution structure density model. Here and later, for two functions f, g ∈ L1 Rd Z   f (x − z)g(z)νd (dz), x ∈ Rd , f ⋆ g (x) = Rd  and for any α ∈ [0, 1], g ∈ L1 Rd and R > 1, n o Fg (R) = f ∈ B1,d (R) : (1 − α)f + α[f ⋆ g] ∈ P Rd .  Here P Rd denotes the set of probability densities on Rd , Bs,d (R) is the ball of radius R > 0 in  Ls Rd := Ls Rd , νd , 1 ≤ s ≤ ∞ and νd is the Lebesgue measure on Rd . ∗ This work has been carried out in the framework of the Labex Archimède (ANR-11-LABX-0033) and of the A*MIDEX project (ANR-11-IDEX-0001-02), funded by the ”Investissements d’Avenir” French Government program managed by the French National Research Agency (ANR). 1 imsart-generic ver. 2014/10/16 file: DSDM-oracle-arXiv.tex date: April 17, 2017  We remark that if one assumes additionally that f, g ∈ P Rd , this model can be interpreted as follows. The observations Zi ∈ Rd , i = 1, . . . , n, can be written as a sum of two independent random vectors, that is, Zi = Xi + ǫi Yi , i = 1, . . . , n, (1.2) where Xi , i = 1, . . . , n, are i.i.d. d-dimensional random vectors with a common density f , to be estimated. The noise variables Yi , i = 1, . . . , n, are i.i.d. d-dimensional random vectors with a known common density g. At last εi ∈ {0, 1}, i = 1, . . . , n, are i.i.d. Bernoulli random variables with P(ε1 = 1) = α, where α ∈ [0, 1] is supposed to be known. The sequences {Xi , i = 1, . . . , n}, {Yi , i = 1, . . . , n} and {ǫi , i = 1, . . . , n} are supposed to be mutually independent. The observation scheme (1.2) can be viewed as the generalization of two classical statistical models. Indeed, the case α = 1 corresponds to the standard deconvolution model Zi = Xi + Yi , i = 1, . . . , n. Another ”extreme” case α = 0 corresponds to the direct observation scheme Zi = Xi , i = 1, . . . , n. The ”intermediate” case α ∈ (0, 1), considered for the first time in Hesse (1995), can be treated as the mathematical modeling of the following situation. One part of the data, namely (1−α)n, is observed without noise, while the other part is contaminated by additional noise. If the indexes corresponding to that first part were known, the density f could be estimated using only this part of the data, with the accuracy corresponding to the direct case. The question we address now is: can one obtain the same accuracy if the latter information is not available? We will see that the answer to the aforementioned question is positive, but the construction of optimal estimation procedures is based upon ideas corresponding to the ”pure” deconvolution model. The convolution structure density model (1.1) will be studied for an arbitrary g ∈ L1 Rd and f ∈ Fg (R). Then, except in the case α = 0, the function f is not necessarily a probability density. We want to estimate f using the observations Z (n) = (Z1 , . . . , Zn ). By estimator, we mean any  Z (n) -measurable map fˆ : Rn → Lp Rd . The accuracy of an estimator fˆ is measured by the Lp –risk 1/p  , p ∈ [1, ∞), Rn(p) [fˆ, f ] := Ef kfˆ − f kpp where Ef denotes the expectation with respect to the probability measure Pf of the observations Z (n) = (Z1 , . . . , Zn ). Also, k · kp , p ∈ [1, ∞), is the Lp -norm on Rd and without further mentioning we will assume that f ∈ Lp Rd . The objective is to construct an estimator of f with a small Lp –risk. 1.1. Oracle approach via local selection. Objectives of Part I  Let F = fˆt , t ∈ T be a family of estimators built from the observation Z (n) . The goal is to propose a data-driven (based on Z (n) ) selection procedure from the collection F and to establish for it an Lp -norm oracle inequality. More precisely, we want to construct a Z (n) -measurable random map t̂ : Rd → T and prove that for any p ∈ [1, ∞) and n ≥ 1   Rn(p) fˆt̂(·) ; f ≤ C1 inf An (f, t, ·) t∈T 1 p + C2 n − 2 ,  ∀f ∈ Lp Rd . (1.3) Here C1 and C2 are numerical constants which may depend on d, p and T only. We call (1.3) an Lp -norm oracle inequality obtained by local selection, and in Part I we provide  with an explicit expression of the functional An (·, ·, x), x ∈ Rd in the case where F = F Hd is the family of ”kernel-type” estimators parameterized by a collection of multi-bandwidths Hd . The selection from the latter family is done pointwisely, i.e. for any x ∈ Rd , which allows to take into account the ”local structure” of the function to be estimated. The Lp -norm oracle inequality is 2 then obtained by the integration of the pointwise risk of the proposed estimator, which is a kernel estimator with the bandwidth being a multivariate random function. This, in its turn, allows us to derive different minimax adaptive results presented in Part II of the paper. They are obtained thanks to an unique Lp -norm oracle inequality. Our selection rule presented in Section 2.1 can be viewed as a generalization and modification of some statistical procedures proposed in Kerkyacharian et al. (2001) and Goldenshluger and Lepski (2014). As we mentioned above, establishing (1.3) is the main objective of Part I. We will see however that although An (·, ·, x), x ∈ Rd will be presented explicitly, its computation in particular problems is not a simple task. The main difficulty here is mostly related to the fact that (1.3) is proved without any assumption (except for the model requirements) imposed on the underlying function f . It turns out that under some nonrestrictive assumptions imposed on f , the obtained bounds can be considerably simplified, see Section 2.3. Moreover these new inequalities allow to better understand the methodology for obtaining minimax adaptive results by the use of the oracle approach. 1.2. Adaptive estimation. Objectives of Part II   (p)  Let F be a given subset of Lp Rd . For any estimator f˜n , define its maximal risk by Rn f˜n ; F =  (p)  supf ∈F Rn f˜n ; f and its minimax risk on F is given by  φn (F) := inf Rn(p) f˜n ; F . (1.4) f˜n Here, the infimum is taken over all possible estimators. An estimator whose maximal risk is bounded,  up to some constant factor, by φn (F), is called minimax on F. d Let Fϑ , ϑ ∈ Θ be a collection of subsets of Lp R , νd , where ϑ is a nuisance parameter which may have a very complicated structure. The problem of adaptive estimation can be formulated as follows: is it possible to construct a single estimator fˆn which would be simultaneously minimax on each class Fϑ , ϑ ∈ Θ, i.e.   (p) ˆ lim sup φ−1 n (Fϑ )Rn fn ; Fϑ < ∞, ∀ϑ ∈ Θ? n→∞ We refer to this question as the problem of minimax adaptive estimation over the scale of {Fϑ , ϑ ∈ Θ}. If such an estimator exists, we will call it optimally adaptive. From oracle approach to adaptation. Let the oracle inequality (1.3) be established. Define  1 Rn Fϑ = sup inf An (f, t, ·) + n− 2 , ϑ ∈ Θ. f ∈Fϑ t∈T p We immediately deduce from (1.3) that for any ϑ ∈ Θ    lim sup Rn−1 Fϑ Rn(p) fˆt̂(·) ; Fϑ < ∞. n→∞ Hence, the minimax adaptive optimality of the estimator fˆt̂(·) is reduced to the comparison of the  normalization Rn Fϑ with the minimax risk φn (Fϑ ). Indeed, if one proves that for any ϑ ∈ Θ  lim inf Rn Fϑ φ−1 n (Fϑ ) < ∞, n→∞  then the estimator fˆt̂(·) is optimally adaptive over the scale Fϑ , ϑ ∈ Θ . Objectives. In the framework of the convolution structure density model, we will be interested in adaptive estimation over the scale 3   ~ L ~ ~r, L, ~ ∩ Fg (R), ϑ = β, ~ R , Fϑ = N~r,d β,  ~ L ~ is the anisotropic Nikolskii class (its exact definition will be presented in Part II). where N~r,d β,  ~ L ~ the coordinate βi of the vector β~ = (β1 , . . . , βd ) ∈ Here we only mention that for any f ∈ N~r,d β, (0, ∞)d represents the smoothness of f in the direction i and the coordinate ri of the vector ~r = ~ L ~ (r1 , . . . , rd ) ∈ [1, ∞]d represents the index of the norm in which βi is measured. Moreover, N~r,d β, ~ ∈ (0, ∞)d represents the is the intersection of balls in some semi-metric space and the vector L radii of these balls. The aforementioned dependence on the direction is usually referred to anisotropy of the underlying function and the corresponding functional class. The use of the integral norm in the definition of the smoothness is referred to inhomogeneity of the underlying function. The latter means that the function f can be sufficiently smooth on some part of the observation domain   and rather  ~ L ~ ~r, L ~ , β, ~ ∈ irregular on another part. Thus, the adaptive estimation over the scale N~r,d β, (0, ∞)d × [1, ∞]d × (0, ∞)d can be viewed as the adaptation to anisotropy and inhomogeneity of the function to be estimated.   ~ L ~ ~r, L, ~ ∩ Fg (R) ∩ B∞,d (Q), ϑ = β, ~ R, Q . It will Additionally, we will consider Fϑ = N~r,d β, allow us to understand how the boundedness of the underlying function may affect the accuracy of estimation. The minimax adaptive estimation is a very active area of mathematical statistics, and the theory of adaptation was developed considerably over the past three decades. Several estimation procedures were proposed in various statistical models, such that Efroimovich-Pinsker method, Efroimovich and Pinsker (1984), Efroimovich (1986), Lepski method, Lepskii (1991) and its generalizations, Kerkyacharian et al. (2001), Goldenshluger and Lepski (2009), unbiased risk minimization, Golubev (1992), wavelet thresholding, Donoho et al. (1996), model selection, Barron et al. (1999), Birgé and Massart (2001), blockwise Stein method, Cai (1999), aggregation of estimators, Nemirovski (2000), Wegkamp (2003), Tsybakov (2003), Goldenshluger (2009), exponential weights, Leung and Barron (2006), Dalalyan and Tsybakov (2008), risk hull method, Cavalier and Golubev (2006), among many others. The interested reader can find a very detailed overview as well as several open problems in adaptive estimation in the recent paper, Lepski (2015). As already said, the convolution structure density model includes itself the density estimation under direct and indirect observations. In Part II we compare in detail our minimax adaptive results to those already existing in both statistical models. Here we only mention that more developed results can be found in Goldenshluger and Lepski (2011), Goldenshluger and Lepski (2014) (density model) and in Comte and Lacour (2013), Rebelles (2016) (density deconvolution). 1.3. Assumption on the function g Pd  R Later on for any U ∈ L1 Rd , let Ǔ denote its Fourier transform, defined as Ǔ (t) := Rd U (x)e−i j=1 xj tj νd (dx), t ∈ Rd . The selection rule from the family of kernel estimators, the Lp -norm oracle inequality as well as the adaptive results presented in Part II are established under the following condition. Assumption 1. (1) if α 6= 1 then there exists ε > 0 such that 1 − α + αǧ(t) ≥ ε, ∀t ∈ Rd ; (2) if α = 1 then there exists µ ~ = (µ1 , . . . , µd ) ∈ (0, ∞)d and Υ0 > 0 such that 4 |ǧ(t)| ≥ Υ0 d Y (1 + t2j )− µj 2 , j=1 ∀t = (t1 , . . . , td ) ∈ Rd . Remind that the following assumption is well-known in the literature: Υ0 d Y (1 + t2j )− µj 2 j=1 ≤ |ǧ(t)| ≤ Υ d Y (1 + t2j )− µj 2 , j=1 ∀t ∈ Rd . It is referred to as a moderately ill-posed statistical problem. In particular, the assumption is satisfied for the centered multivariate Laplace law. Note that Assumption 1 (1) is very weak and it is verified for many distributions, including centered multivariate Laplace and Gaussian ones. Note also that this assumption always holds with ε = 1 − 2α if α < 1/2. Additionally, it holds with ε = 1 − α if ǧ is a real positive function. The latter is true, in particular, for any probability law obtained by an even number of convolutions of a symmetric distribution with itself. 2. Pointwise selection rule and Lp -norm oracle inequality ~ (α) = µ ~ (α) = (0, . . . , 0), α ∈ [0, 1). To present our results in an unified way, let us define µ ~, α R = 1, µ Let K : Rd → R be a continuous function belonging to L1 Rd , R K = 1, and such that its Fourier transform Ǩ satisfies the following condition. Assumption 2. There exist k1 > 0 and k2 > 0 such that Z Rd Ǩ(t) d Y (1 + t2j ) j=1 µj (α) 2 dt ≤ k1 , Z Rd Ǩ(t) 2 d Y (1 + t2j )µj (α) dt ≤ k22 . (2.1) j=1   Set H = ek , k ∈ Z and let Hd = ~h = (h1 , . . . , hd ) : hj ∈ H, j = 1, . . . , d . Define for any ~h = (h1 , . . . , hd ) ∈ Hd d Y  hj . K~h (t) = V~−1 K t1 /h1 , . . . , td /hd , t ∈ Rd , V~h = h j=1 Rd Later on for any u, v ∈ the operations and relations u/v, uv, u ∨ v,u ∧ v, u ≥ v, au, a ∈ R, are understood in coordinate-wise sense. In particular u ≥ v means that uj ≥ vj for any j = 1, . . . , d. 2.1. Pointwise selection rule from the family of kernel estimators  For any ~h ∈ (0, ∞)d let M ·, ~h satisfy the operator equation Z   ~ g(t − y)M t, ~h dt, y ∈ Rd . (2.2) K~h (y) = (1 − α)M y, h + α Rd  P For any ~h ∈ Hd and x ∈ Rd introduce the estimator fb~h (x) = n−1 ni=1 M Zi − x, ~h . Our first goal is to propose x ∈ Rd a data-driven selection rule from the family of   for any given d d b ~ kernel estimators F H = f~h (x), h ∈ H . Define for any ~h ∈ Hd 5  bn x, ~h = U s    b2 x, ~h 2λn ~h σ 4M∞ λn ~h + , Q n 3n dj=1 hj (hj ∧ 1)µj (α)  λn ~h = 4 ln(M∞ ) + 6 ln (n) + (8p + 26)  −d M∞ = (2π) Pointwise selection rule introduce  −1 ε Ǩ 1 1 α6=1 d X j=1 n   1X 2 M Zi − x, ~h ; σ b2 x, ~h = n i=1   1 + µj (α) ln(hj ) ; + Υ−1 0 k1 1α=1  ∨ 1. Let H be an arbitrary subset of Hd . For any ~h ∈ H and x ∈ Rd h i  bn x, ~η b~ (x) = sup fb~ (x) − fb~η (x) − 4U bn x, ~h ∨ ~η − 4U ; R h h∨~ η and define  + η ∈H ~ b ∗ x, ~h = U n sup η ∈H: ~ ~ η≥~h  bn x, ~η , U h i ~ b ∗ x, ~h . b~ (x) + 8U h(x) = arg inf R n h (2.3) ~h∈H Our final estimator is fb~h(x) (x), x ∈ Rd and we will call (2.3) the pointwise selection rule.  d since ~ b Note that the estimator fbh(·) ~ (·) does not necessarily belong to the collection f~h (·), h ∈ H the multi-bandwidth ~ h(·) is a d-variate function, which is not necessarily constant on Rd . The latter fact allows to take into account the ”local structure” of the function to be estimated. Moreover, ~h(·) is chosen with respect to the observations, and therefore it is a random vector-function. 2.2. Lp -norm oracle inequality Introduce for any x ∈ Rd and ~h ∈ Hd  Un∗ x, ~h = sup η ∈Hd : ~ ~ η≥~h  Un x, ~η , S~h (x, f ) = where we have put s     4M∞ λn ~η η 2λn ~η σ 2 x, ~ Un x, ~η = + , Q n 3n dj=1 ηj (ηj ∧ 1)µj (α) For any H ⊆ Hd , ~h ∈ H and x ∈ Rd introduce also B~h∗ (x, f ) = sup S~h∨~η (x, f ) − S~η (x, f ) , η ∈H ~ Z Rd K~h (t − x)f (t)νd (dt);  σ 2 x, ~η = Z Rd  M 2 t − x, ~η p(t)νd (dt). B~h (x, f ) = S~h (x, f ) − f (x) . (2.4) Theorem 1. Let Assumptions 1 and 2 be fulfilled. Then for any H ⊆ Hd , n ≥ 3 and p ∈ [1, ∞), n o 1 ∀f ∈ Fg (R), Rn(p) [fb~h(·) , f ] ≤ inf 2B~h∗ (·, f ) + B~h (·, f ) + 49Un∗ ·, ~h + Cp n− 2 . ~h∈H p 6 The explicit expression for the constant Cp can be found in the proof of the theorem. Later on we will pay attention to a special choice for the collection of multi-bandwidths, namely  d Hisotr := ~h ∈ Hd : ~h = (h, . . . , h), h ∈ H . More precisely, in Part II, the selection from the corresponding family of kernel estimators will be used for the adaptive estimation over the collection of isotropic Nikolskii classes. Note also that if d d H = Hisotr then obviously for any ~h = (h, . . . , h) ∈ Hisotr B~h∗ (·, f ) ≤ 2 sup η ∈Hdisotr : η≤h ~ B~η (·, f ) and we come to the following corollary of Theorem 1. Corollary 1. Let Assumptions 1 and 2 be fulfilled. Then for any n ≥ 3 and p ∈ [1, ∞)    1 (p) b ∗ ~ Rn [f~h(·) , f ] ≤ inf 5 sup B~η (·, f ) + 49Un ·, h + Cp n− 2 , ∀f ∈ Fg (R). ~h∈Hd isotr η ∈Hdisotr : η≤h ~ p The oracle inequality proved in Theorem 1 is particularly useful since it does not require any assumption on the underlying function f (except for the restrictions ensuring the existence of the model and of the risk). However, the quantity appearing in the right hand side of this inequality, namely n o inf 2B~h∗ (·, f ) + B~h (·, f ) + 49Un∗ ·, ~h ~h∈H p is not easy to analyze. In particular, in order to use the result of Theorem 1 for adaptive estimation, one has to be able to compute n o sup inf 2B~h∗ (·, f ) + B~h (·, f ) + 49Un∗ ·, ~h f ∈F ~h∈H p  d . It turns out that under for a given class F ⊂ Lp Rd ∩ Fg (R) with either H = Hd or H = Hisotr some nonrestrictive assumptions imposed on f , the obtained bounds can be considerably simplified. Moreover, the new inequality obtained below will allow us to better understand the way for proving adaptive results. 2.3. Some consequences of Theorem 1 Thus, furthermore we will assume that f ∈ Fg,u (R, D) ∩ Bq,d (D), q, u ∈ [1, ∞], D > 0, where o n (∞) Fg,u (R, D) := f ∈ Fg (R) : (1 − α)f + α[f ⋆ g] ∈ Bu,d (D) ,  (∞) and Bu,d (D) denotes the ball of radius D in the weak-type space Lu,∞ Rd , i.e.    (∞) Bu,d (D) = λ : Rd → R : kλku,∞ < D , kλku,∞ = inf C : νd x : |T (x)| > z ≤ C u z−u , ∀z > 0 . (∞) (∞) As usual B∞,d (D) = B∞,d (D) and obviously Bu,d (D) ⊃ Bu,d (D). Note also that Fg,1 (R, D) = Fg (R) for any D ≥ 1. It is worth noting that the assumption f ∈ Fg,u (R, D) simply means that the common (∞) density of the observations p belongs to Bu,d (D).  Remark 1. It is easily seen that Fg,∞ R, Rkgk∞ = Fg (R) if α = 1 and kgk∞ < ∞. Note also that Fg,∞ (R, Qkgk1 ) ⊃ Fg (R) ∩ B∞,d (Q) for any α ∈ [0, 1] and Q > 0. 7 2.3.1. Oracle inequality over Fg,u (R, D) ∩ Bq,d (D) For any ~h ∈ Hd and any v > 0, let  A(~h, f, v) = x ∈ Rd : B~h (x, f ) ≥ 2−1 v , B~h (·, f ) = 2B~h∗ (·, f ) + B~h (·, f ), q P ln n + dj=1 | ln hj |  , Fn ~h = √ Q 1 d µj (α) 2 n j=1 hj (hj ∧ 1)  Gn ~h = P ln n + dj=1 | ln hj | . Q n dj=1 hj (hj ∧ 1)µj (α) d Furthermore let H be either Hd or Hisotr and for any v, z > 0 define   H(v) = ~h ∈ H : Gn ~h ≤ av ,   H(v, z) = ~h ∈ H(v) : Fn ~h ≤ avz −1/2 . (2.5) Here a > 0 is a numerical constant whose explicit expression is given in the beginning of Section 3.2. Introduce for any v > 0 and f ∈ Fg,u (R, D) h  i Λ(v, f ) = inf νd A(~h, f, v) + v −2 Fn2 ~h ; ~h∈H(v) Λ(v, f, u) = inf inf z≥2 ~h∈H(v,z) Λp (v, f, u) = inf inf z≥2 ~h∈H(v,z) h i  νd A(~h, f, v) + z −u ; Z p A(~h,f,v) p −u B~h (x, f ) νd (dx) + v z  . Remark 2. Note that H(v) 6= ∅ and H(v, z) 6= ∅ whatever the values of v > 0 and z ≥ 2. Indeed, for any v > 0 and z > 2 one can find b > 1 such that    ln n + d ln b (nbd )−1 ≤ a2 v 2 z −1 ∧ av. The latter means that ~b = (b, . . . , b) ∈ H(v, z) ∩ H(v). Thus, we conclude that the quantities Λ(v, f ), Λ(v, f, u) and Λp (v, f, u) are well-defined for all v > 0. Also, It is easily seen that for any v > 0 and f ∈ Fg,∞ (R, D) Λ(v, f, ∞) = inf ~h∈H(v,2)  νd A(~h, f, v) , Λp (v, f, ∞) = inf ~h∈H(v,2) Z p A(~h,f,v) B~h (x, f ) νd (dx). (2.6) Put at last for any v > 0, lH (v) = v p−1 (1 + | ln (v)|)t(H) , where t(H) = d − 1 if H = Hd and t(H) = 0 d if H = Hisotr . Theorem 2. Let the assumptions of Theorem 1 be fulfilled and let K be a compactly supported function. Then for any n ≥ 3, p > 1, q > 1, R > 1, D > 0, 0 < v ≤ v < ∞, u ∈ (p/2, ∞], u ≥ q and any f ∈ Fg,u (R, D) ∩ Bq,d (D) Rn(p) [fb~h(·) , f ] ≤C (1)  lH (v) + Z v v v p−1 1 p 1 {Λ(v, f ) ∧ Λ(v, f, u)}dv + Λp (v, f, u) + Cp n− 2 . Here C (1) is a universal constant independent of f and n. Its explicit expression can be found in the proof of the theorem. We remark also that only this constant depends on q. 8 The result announced in Theorem 2 suggests a way for establishing minimax and minimax adaptive properties of the pointwise selection rule given in (2.3). For a given F ⊂ Fg,u (R, D) ∩ Bq,d (D) it mostly consists in finding a careful estimate for   S ~h, z := sup νd x ∈ Rd : B~h (x, f ) ≥ z , ∀~h ∈ H, ∀z > 0. f ∈F The choice of v, v > 0 is a delicate problem and it depends on S(·, ·). In the next section we present several results concerning some useful upper estimates for the quantities sup{Λ(v, f ) ∧ Λ(v, f, u)}, sup Λp (v, f, u), v > 0. f ∈F f ∈F We would like to underline that these bounds will be established for an arbitrary F and, therefore, they can be applied to the adaptation over different scales of functional classes. In particular, the results obtained below form the basis for our consideration in Part II. 2.3.2. Application to the minimax adaptive estimation (p) Our objective now is to bound from above supf ∈F Rn [fb~h(·) , f ] for any F ⊂ Fg,u (R, D) ∩ Bq,d (D). All the results in this section will be proved under an additional condition imposed on the kernel K. R Assumption 3. Let K : R → R be a compactly supported, bounded function and K = 1. Then d Y K(xj ), ∀x ∈ Rd . K(x) = j=1 Without loss of generality we will assume that kKk∞ ≥ 1 and supp(K) ⊂ [−cK , cK ] with cK ≥ 1. Introduce the following notations. Set for any h ∈ H, x ∈ Rd and j = 1, . . . , d Z  ∗ bh,f,j (x) = K(u)f x + uhej ν1 (du) − f (x) , bh,f,j (x) = sup b∗η,f,j (x) η∈H: η≤h R where (e1 , . . . , ed ) denotes the canonical basis of Rd . For any s ∈ [1, ∞] introduce X B∗j,s,F(h) = sup b∗h,f,j s , Bj,s,F (h) = sup bh,f,j s , j = 1, . . . , d. f ∈F h∈H: h≤h f ∈F Set for any ~h ∈ Hd , v > 0 and j = 1, . . . , d,    J ~h, v = j ∈ {1, . . . , d} : hj ∈ Vj (v) , Vj (v) = h ∈ H : Bj,∞,F(h) ≤ cv ,   −d where c = (20d)−1 max(2cK kKk∞ , kKk1 ) . As usual the complement of J ~h, v will be denoted  by J¯ ~h, v . Furthermore, the summation over the empty set is supposed to be zero. For any ~s = (s1 , . . . , sd ) ∈ [1, ∞)d , u ≥ 1 and v > 0 introduce  X   sj −sj −u v Bj,sj ,F hj Λ~s (v, F, u) = inf inf +z ; (2.7) z≥2 ~h∈H(v,z)  Λ~s v, F = inf ~h∈H(v)  X ¯ ~h,v) j∈J( v −sj ¯ ~h,v) j∈J( 9  Bj,sj ,F hj sj +v −2 Fn2   ~h . (2.8) Theorem 3. Let assumptions of Theorem 2 be fulfilled and suppose additionally that K satisfies Assumption 3. Then for any n ≥ 3, p > 1, q > 1, R > 1, D > 0, 0 < v ≤ v < ∞, u ∈ (p/2, ∞], u ≥ q, ~s ∈ (1, ∞)d , ~q ∈ [p, ∞)d and any F ⊂ Bq,d (D) ∩ Fg,u (R, D) sup Rn(p) [fb~h(·) , f ] f ∈F ≤C (2)  lH (v) + Z v v p−1 v If additionally q ∈ (p, ∞) one has also sup Rn(p) [fb~h(·) , f ] f ∈F ≤C (2)  lH (v) + ≤C (2)  v v 1 p  1 p Λ~s (v, F, u) ∧ Λ~s (v, F) dv + v Λ~q (v, F, u) + Cp n− 2 . p−1 v Moreover, if q = ∞ one has sup Rn(p) [fb~h(·) , f ] f ∈F Z  lH (v) + Z v v p−1 v    Λ~s (v, F, u) ∧ Λ~s (v, F) dv + v p−q 1 p 1 + Cp n− 2 . 1 p  1 Λ~s (v, F, u) ∧ Λ~s (v, F) dv + Λ~s (v, F, u) + Cp n− 2 . d Finally, if H = Hisotr all the assertions above remain true for any ~s ∈ [1, ∞)d if one replaces in (2.7)–(2.8) Bj,sj ,F (·) by B∗j,sj ,F (·). It is important to emphasize that C (2) depends only on ~s, ~q, g, K, d, R, D, u and q. Note also that the assertions of the theorem remain true if we minimize right hand sides of obtained inequalities w.r.t ~s, ~q since their left hand sides are independent of ~s and ~q. In this context it is important to realize that C (2) = C (2) (~s, · · · ) is bounded for any ~s ∈ (1, ∞)d but C (2) (~s, · · · ) = ∞ if there exists d j = 1, . . . , d such that sj = 1. Contrary to that C (2) (~s, · · · ) < ∞ for any ~s ∈ [1, ∞)d if H = Hisotr and it explains in particular the fourth assertion of the theorem. Note also that D, R, u, q are not involved in the construction of our pointwise selection rule. That means that one and the same estimator can be actually applied on any [ F⊂ Bq,d (D) ∩ Fg,u (R, D). R,D,u,q Moreover, the assertion of the theorem has a non-asymptotical nature; we do not suppose that the number of observations n is large. Discussion As we see, the application of our results to some functional class is mainly reduced to the computation of the functions B∗j,s,F(·) j = 1, . . . , d, for some properly chosen s. Note however that this task is not necessary for many functional classes used in nonparametric statistics, at least for the classes defined by the help of kernel approximation. Indeed, a typical description of F can be summarized as follows. Let λj : R+ → R+ , be such that λj (0) = 0, λj ↑ for any j = 1, . . . , d.   Then, the functional class, say FK ~λ(·), ~r can be defined as a collection of functions satisfying bh,f,j rj ≤ λj (h), ∀h ∈ H, (2.9) for some ~r ∈ [1, ∞]. It yields obviously Bj,rj ,F (·) ≤ λj (·), j = 1, . . . , d, and the result of Theorem 3 remains valid if we replace formally Bj,rj ,F (·) by λj (·) in all the expressions appearing in this theorem. In Part II we show that for some particular kernel K ∗ , the 10  ~ L ~ is included into the class defined by (2.9) with λj (h) = Lj hβj , anisotropic Nikol’skii class N~r,d β, ~ L ~ and ~r. whatever the values of β, Denote ϑ = (~λ(·), ~r) and remark that in many cases FK [ϑ] ⊂ Bq,d (D) for any ϑ ∈ Θ for some class parameter Θ and q ≥ p, D > 0. Then, replacing Bj,r  in (2.7) and (2.8) and  j ,F (·) by λj (·) choosing ~q = (q, . . . , q) we come to the quantities Λ v, u, ϑ and Λq v, ϑ , completely determined by the functions λj (·), j = 1, . . . , d, the vector ~r and the number q. Therefore, putting  1 Z v p     1 p−1 p p−q lH (v) + v Λ(v, u, θ) ∧ Λ(v, θ) dv + v Λq v, u, ϑ ∧ v ψn ϑ = + n− 2 inf 0<v≤v<∞ v we deduce from the first and the second assertions of Theorem 3 for any ~λ(·) and ~r and n ≥ 3 sup Rn(p) [fb~h(·) , f ] ≤ C (3) ψn (ϑ). (2.10) f ∈FK [ϑ] Since the estimator fb~h(·) is completely data-driven and, therefore, is independent of ~λ(·) and ~r, the  bound (2.10) holds for the scale of functional classes FK [ϑ] ϑ .  If φn FK [ϑ] is the minimax risk defined in (1.4) and  lim sup ψn (ϑ)φ−1 ∀ϑ ∈ Θ, (2.11) n FK [ϑ] < ∞, n→∞  we can assert that our estimator is optimally adaptive over the considered scale FK [ϑ], ϑ ∈ Θ . To illustrate the powerfulness of our approach, let us consider a particular scale of functional classes defined by (2.9). ~ ∈ (0, ∞)d be given vectors. Classes of Hölderian type Let β~ ∈ (0, ∞)d and L  ~ L ~ , where K satisfies Assumption Definition 1. We say that a function f belongs to the class FK β, 3, if f ∈ B∞,d maxj=1,...,d Lj and for any j = 1, . . . , d bh,f,j ∞ ≤ Lj v β j , ∀h ∈ H. We remark that this class is a particular case of the one defined in (2.9), since it corresponds to λj (h) = Lj hj and rj = ∞ for any j = . . . , d. Moreover let us introduce the following notations 2µj (α)+1 d d 1 X Y 2µj (α) + 1 1 β 2+1/β(α) −1 Lj j . = , L(α) = ϕn = δn , δn = L(α)n ln (n), β(α) βj j=1 j=1 Then the following result is a direct consequence of Theorem 3. Its simple and short proof is postponed to Section 3.4. Assertion 1. Let the assumptions of Theorem 3 be fulfilled. Then for any n ≥ 3, p > 1, β~ ∈ (0, ∞)d , ~ ∈ [L0 , L∞ ]d there exists C > 0 independent of L ~ such that 0 < L0 ≤ L∞ < ∞ and L  ~ L ~ lim sup ψn−1 β, sup Rn(p) [fb~h(·) , f ] ≤ C, n→∞ ~L ~) f ∈FK (β, where we have denoted  t(H) (1−1/p)β(α)    ln(n) p δn β(α)+1 , 2 + 1/β(α) > p;     1∨t(H) (1−1/p)β(α) ~ L ~ = ψn β, (2.12) ln(n) p δn β(α)+1 , 2 + 1/β(α) = p;    β(α)    2 + 1/β(α) < p. δ 2β(α)+1 , n 11 It is interesting to note that the obtained bound, being a very particular case of our consideration in Part II, is completely new if α 6= 0. As we already mentioned, for some particular choice of the ~ L ~ is included in the class FK ∗ ~λ(·), ~r with kernel K ∗ , the anisotropic Nikol’skii class N~r,d β, ~ L ~ and ~r. Therefore, the aforementioned result holds on an λj (v) = Lj vβj , whatever the values of β,  ~ L ~ . Comparing the result of Assertion 1 with the lower bound for arbitrary Hölder class N∞,d β, ~ the minimax risk obtained in Lepski and Willer (2017), we can state that it differs only by some logarithmic factor. Using the modern statistical language, we say that the estimator fb~h(·) is nearly optimally-adaptive over the scale of Hölder classes. 3. Proofs 3.1. Proof of Theorem 1 The main ingredients of the proof of the theorem are given in Proposition 1. Their proofs are postponed to Section 3.1.2. Introduce for any ~h ∈ Hd n   1 X M Zi − x, ~h − Ef M Zi − x, ~h , n  ξn x, ~h = i=1 x ∈ Rd . Proposition 1. Let Assumptions 1 and 2 be fulfilled. Then for any n ≥ 3 and any p > 1 Z n p o   p Ef sup ξn x, ~h − Un x, ~h + νd (dx) ≤ Cp n− 2 ; (i) Rd (ii) Z Rd (iii) Z ~h∈Hd Ef Rd n Ef  o   bn x, ~h − 3Un x, ~h p νd (dx) ≤ Cp′ n− p2 ; sup U + ~h∈Hd n    o bn x, ~h p νd (dx) ≤ C ′ n− p2 . sup Un x, ~h − 4U p + ~h∈Hd The explicit expression of constant Cp and Cp′ can be found in the proof. 3.1.1. Proof of the theorem We start by proving the so-called pointwise oracle inequality. Pointwise oracle inequality. Let ~h ∈ H and x ∈ Rd be fixed. We have in view of the triangle inequality fb~h(x) (x) − f (x) ≤ fb~h(x)∨~h (x) − fb~h(x) (x) + fb~h(x)∨~h (x) − fb~h (x) + fb~h (x) − f (x) . (3.1) 10 . First, note that obviously fb~h(x)∨~h (x) = fb~h∨~h(x) (x) and, therefore,   bn x, ~h(x) . bn x, ~h(x) ∨ ~h + 4U b~ (x) + 4U fb~h(x)∨~h (x) − fb~h(x) (x) = fb~h∨~h(x) (x) − fb~h(x) (x) ≤ R h   b ∗ x, ~η for any ~η ∈ Hd . bn x, ~ η ≤U Moreover by definition, U n    bn x, ~h ∨ ~η ≤ U b ∗ x, ~h ∧ U b ∗ x, ~η . Thus, we obtain Next, for any ~h, ~ η ∈ Hd we have obviously U n n  b ∗ x, ~h(x) . b~ (x) + 8U fb~h(x)∨~h (x) − fb~h(x) (x) ≤ R n h 12 (3.2) Similarly we have  b ~ (x) + 8U b ∗ x, ~h . fb~h(x)∨~h (x) − fb~h (x) ≤ R n h(x) (3.3) The definition of ~h(x) implies that for any ~h ∈ H    b ~ (x) + 8U b ∗ x, ~h(x) + R b~ (x) + 8U b ∗ x, ~h ≤ 2R b~ (x) + 16U b ∗ x, ~h R n n n h(x) h h and we get from (3.1), (3.2) and (3.3) for any ~h ∈ H  b~ (x) + 16U bn∗ x, ~h + fb~ (x) − f (x) . fb~h(x) (x) − f (x) ≤ 2R h h (3.4) 20 . We obviously have for any ~h, ~ η ∈ Hd     fb~h∨~η (x) − fb~η (x) ≤ Ef M Z1 − x, ~h ∨ ~η − Ef M Z1 − x, ~η + ξn x, ~h ∨ ~η + ξn x, ~η . Note that for any h ∈ Hd Ef M Z1 − x, ~h  := = Z  M t − x, ~h p(t)νd (dt) Rd Z Z  M t − x, ~h f (t)νd (dt) + α (1 − α) Rd Rd   M t − x, ~h f ⋆ g (t)νd (dt), in view of the structural assumption (1.1) imposed on the density p. Note that Z Z    ~ M t − x, ~h f ⋆ g (t)νd (dt) M t − x, h f (t)νd (dt) + α (1 − α) d Rd   Z R Z   M u, ~h g(u − [z − x])νd (du) νd (dz) f (z) (1 − α)M z − x, ~h + α = Rd Rd  and, therefore, in view of the definition of M ·, ~h , c.f. (2.2), we obtain for any h ∈ Hd Z  ~ K~h (z − x)f (z)νd (dz) =: S~h (x, f ). Ef M Z1 − x, h = (3.5) Rd We deduce from (3.5) that   Ef M Z1 − x, ~h ∨ ~η − Ef M Z1 − x, ~η = S~h∨~η (x, f ) − S~η (x, f ) and, therefore, for any ~h, ~ η ∈ Hd fb~h∨~η (x) − fb~η (x) ≤ S~h∨~η (x, f ) − S~η (x, f ) + ξn x, ~h ∨ ~η 30 . Set for any ~h ∈ Hd and any x ∈ Rd υ(x) = sup   η ~ ∈Hd  bn x, ~h ̟1 (x) = sup Un x, ~h − 4U ~h∈Hd ξn x, ~η  , + 13  − Un x, ~η    + ξn x, ~η . +   bn x, ~h − 3Un x, ~h ̟2 (x) = sup U + ~h∈Hd  (3.6) We obtain in view of (3.6) that for any ~h ∈ H (since obviously ~h ∨ ~η ∈ Hd for any ~h, ~η ∈ Hd ) b~ (x) ≤ B ∗ (x, f ) + 2υ(x) + 2̟1 (x). R ~h h (3.7) Note also that in view of the obvious inequality (supα Fα − supα Gα )+ ≤ supα (Fα − Gα )+  ∗      b x, ~h − 3U ∗ x, ~h bn x, ~η − 3Un x, ~η U =: ̟2 (x) ≤ sup U n n + + (3.8) η ∈Hd ~ We get from (3.4), (3.7) and (3.8)  fb~h(x) (x) − f (x) ≤ 2B~h∗ (x, f ) + 4υ(x) + 4̟1 (x) + 48Un∗ x, ~h + 16̟2 (x) + fb~h (x) − f (x) . It remains to note that fb~h (x) − f (x) ≤ B~h (x, f ) + ξn x, ~h and we obtain for any ~h ∈ H and x ∈ Rd   ≤ B~h (x, f ) + Un x, ~h + υ(x),  fb~h(x) (x) − f (x) ≤ 2B~h∗ (x, f ) + B~h (x, f ) + 5υ(x) + 4̟1 (x) + 49Un∗ x, ~h + 16̟2 (x). Noting that the left hand side of the latter inequality is independent of ~h we obtain for any x ∈ Rd n o fb~h(x) (x) − f (x) ≤ inf 2B~h∗ (x, f ) + B~h (x, f ) + 49Un∗ x, ~h + 5υ(x) + 4̟1 (x) + 16̟2 (x). (3.9) ~h∈H This is the pointwise oracle inequality. Application of Proposition 1. Set for any x ∈ Rd n o Rn (x) = inf 2B~h∗ (x, f ) + B~h (x, f ) + 49Un∗ x, ~h ~h∈H Applying Proposition 1 we obtain in view of (3.9) and the triangle inequality Rn(p) [fb~h(·) , f ] ≤ Rn ≤ Rn Z +5 p p 1 Ef υ(x) Rd − 21 + Cp n  , p 1 p Z +4 Rd  Ef ̟1 (x) p 1 p Z + 16 Rd  Ef ̟2 (x) 1 where Cp = 5(Cp ) p + 20(Cp′ ) p . The theorem is proved. 3.1.2. Proof of Proposition 1 Since the proof of the proposition is quite long and technical, we divide it into several steps. 14 p 1 p  Preliminaries 10 . We start the proof with the following simple remark. Let M̌ t, ~h , t ∈ Rd ,   denote the Fourier transform of M ·, ~h . Then, we obtain in view of the definition of M ·, ~h   −1 M̌ t, ~h = Ǩ t~h (1 − α) + αǧ(−t) , t ∈ Rd . (3.10)    Note that Assumptions 1 and 2 guarantee that M̌ ·, ~h ∈ L1 Rd ∩ L2 Rd for any ~h ∈ Hd and, therefore,     M ·, ~h ∞ ≤ (2π)−d M̌ ·, ~h 1 , M ·, ~h 2 = (2π)−d M̌ ·, ~h 2 . Thus, putting d Y  −µj (α) M∞ (~h = M∞ h−1 , j (hj ∧ 1) j=1 we obtain in view of Assumptions 1 and 2 for any ~h ∈ Hd M ·, ~h  ∞  ≤ M∞ (~h ,   where M2 = (2π)−d ε−1 Ǩ M ·, ~h  4 4 1 2 α6=1 ≤ M ·, ~h  2 ∞ M ·, ~h  2  + Υ−1 0 k2 1α=1 M ·, ~h  2 2 ≤ ≤ M2 d Y j=1 −1 hj 2 (hj ∧ 1)−µj (α) , (3.11) ∨ 1. Additionally we deduce from (3.11) 2 M22 M∞ d Y j=1 ∀~h ∈ Hd .(3.12) −4µj (α) h−3 , j (hj ∧ 1)       Let L ·, ~h be either M ·, ~h or M 2 ·, ~h and let L∞ ~h denote either M∞ ~h or M2∞ ~h . We have in view of (3.11) P   2 2 dj=1 (1+µj (α))| ln(hj )| ~ ~ ≤ M∞ e , ∀~h ∈ Hd . L−1 ∞ h ∨ L∞ h (3.13) Additionally, we get from (3.11) and (3.12) L ·, ~h Set σL  2 2 2 4 ≤ M22 M∞ e Pd j=1 (1+µj (α))| ln(hj )| , ∀~h ∈ Hd . (3.14)   qR d 2 ~ ~ ~ x, h = Rd L t − x, h p(t)νd (dt) and note that in view of (3.14) for any h ∈ H Z Rd  σ L x, ~h 2 νd (dx) = L ·, ~h Next, we have in view of (3.13) σ L ·, ~h  ∞  2 2 2 4 ≤ M22 M∞ e Pd j=1 (1+µj (α))| ln(hj )| P  2 2 dj=1 (1+µj (α))| ln(hj )| ≤ L∞ ~h ≤ M∞ e . 20 . Define for any x ∈ Rd and ~h ∈ Hd 15 . (3.15) (3.16) n X     ξ L x, ~h = n−1 L Zi − x, ~h − EL Zi − x, ~h ; i=1 d X         ~ . 1 + µj (α) ln(hj ) + 2 ln σ L x, ~h ∨ n−3/2 L∞ ~h zn x, h = 3 ln(n) + (8p + 22) j=1 s    4zn x, ~h L∞ ~h 2zn x, ~h V + ; n 3n s    ~h ~h L∞ ~h   2λ 4λ n n L L + , U x, ~h = σ x, ~h n 3n    P where remind λn ~h = 4 ln(M∞ ) + 6 ln (n) + (8p + 26) dj=1 1 + µj (α) ln(hj ) . L   x, ~h = σ L x, ~h Noting that supz∈[a,b] | ln z| ≤ | ln a| ∨ | ln b| for any 0 < a < b < ∞ we deduce from (3.16)   zn x, ~h ≤ λn ~h for any x ∈ Rd and, therefore, for any ~h ∈ Hd   V L x, ~h ≤ U L x, ~h . (3.17) First step Let x ∈ Rd and ~h ∈ Hd be fixed and put b = 8p + 22. We obtain for any z ≥ 1 and q ≥ 1 by the integration of the Bernstein inequality √     √ L ~  4zL∞ ~h q 4L∞ ~h q 2zσ L x, ~h 2σ x, h L ~ √ √ Ef ζ x, h − ≤ 2Γ(q + 1) exp {−z}, − + 3n 3n n n + where Γ is the Gamma-function.  10 . Choose z = zn x, ~h . Noting that for any n ∈ N∗ and x ∈ Rd √ L    1 2σ x, ~h 4L∞ ~h √ + ≤ 3L∞ ~h n− 2 n 3n and taking into account that exp {−| ln(y)|} ≤ y for any y > 0, we get    q Ef ζ L x, ~h − V L x, ~h +  Pd     2 q ≤ 2 × 3q Γ(q + 1)n− 2 −3 Lq∞ ~h eb j=1 (1+µj (α))| ln(hj )| σ L x, ~h ∨ n−3/2 L∞ ~h q ≤ Cq(1) n− 2 −3 e(2q−b) Pd j=1 (1+µj (α))| ln(hj )|  2  L   . σ x, ~h ∨ n−3/2 L∞ ~h (1) (3.18) 2q q Here to get the second inequality we have used (3.13) and put Cq = 2M∞ 3 Γ(q + 1).       Set X ~h = x ∈ Rd : σ L x, ~h ≥ n−3/2 L∞ ~h , X̄ ~h = Rd \ X ~h and later on the integration over the empty set is supposed to be zero. We have in view of (3.17), (3.15) and (3.18) applied with q = p that for any ~h ∈ Hd Z P  L   p (2) − p (2p+4−b) dj=1 (1+µj (α))| ln(hj )| L . (3.19)  Ef ζ x, ~h − U x, ~h + νd (dx) ≤ Cp n 2 e X ~h (2) (1) 2 . where Cp = Cp M22 M∞ 16 20 . Introduce the following notations. For any i = 1, . . . , n set n o    Ψi x, ~h = 1 L Zi − x, ~h − EL Zi − x, ~h ≥ n−1 L∞ ~h , nP o   n ~h ≥ 2 . As usual, the complimentary and introduce the random event D x, ~h = x, Ψ i i=1     event will be denoted by D̄ x, ~h . Set finally π x, ~h = Pf Ψ1 x, ~h = 1 . We obviously have ζ  x, ~h 1 L and, therefore, D̄  ~h  3L ∞ ≤ < U L ~h ~ x,h n     ζ L x, ~h − U L x, ~h 1 D̄ x,~h p + = 0. Applying Cauchy-Schwartz inequality, we deduce from (3.20) that h       p Ef ζ L x, ~h − U L x, ~h + ≤ Ef ζ L x, ~h − U L x, ~h  Using (3.18) with q = 2p and (3.13) we obtain for any x ∈ X̄ ~h Ef  ζ L x, ~h  − U L x, ~h  p + p ≤ Cp(3) n− 2 −3 e(2p+2−b/2) (3.20) 2p + Pd   i 21 . Pf D x, ~h j=1 (1+µj (α))| ln(hj )| h   i 12 Pf D x, ~h , (3.21)  (1)  1 2 (3) where we have put Cp = C2p 2 M∞ . For any λ > 0 we have in view of the exponential Markov inequality n o nX    n   = Pf Ψi x, ~h ≥ 2 ≤ e−2λ eλ π x, ~h + 1 − π x, ~h Pf D x, ~h i=1 λ   n (e − 1)π x, ~h + 1 ≤ exp{−2λ + n(eλ − 1)π x, ~h }.   L  ~ ~ 2 . It yields We get applying the Tchebychev inequality π x, ~h ≤ n2 L−2 ∞ h σ x, h     L  ~ ~ 2 (eλ − 1) , ∀~h ∈ Hd . Pf D x, ~h ≤ exp − 2λ + n3 L−2 ∞ h σ x, h     ~h σ L x, ~h 2 < 1 for any x ∈ X̄ ~h . Hence, Note that the definition of X̄ ~h implies n3 L−2 ∞    ~ L ~ choosing λ = ln 2 − 2 ln n3/2 L−1 we have ∞ h σ x, h    L   ~ 4 , ∀x ∈ X̄ ~h . Pf D x, ~h ≤ (e2 /4)n6 L−4 ∞ σ x, h −2λ = e  It yields, together with (3.13), (3.15) and (3.21) and for any ~h ∈ Hd Z P  L   p (4) − p (2p+10−b/2) dj=1 (1+µj (α))| ln(hj )| L (3.22)  Ef ζ x, ~h − U x, ~h + νd (dx) ≤ Cp n 2 e X¯ ~h (4) (3) (5) (2) (4) 6 M 2 . Putting C where Cp = Cp (e/2)M∞ p = Cp + Cp and noting that 2p + 10 − b/2 < 0 we 2 ~ obtain from (3.19) and (3.22) for any h ∈ Hd Z Pd    p p Ef ζ L x, ~h − U L x, ~h + νd (dx) ≤ Cp(5) n− 2 e(2p+10−b/2) j=1 (1+µj (α))| ln(hj )| . (3.23) Rd 30 . Choosing L = M and L∞ = M∞ we get from (3.23) and the definition of b Z Pd    p p Ef ξn x, ~h − Un x, ~h + νd (dx) ≤ Cp(5) n− 2 e− j=1 (1+µj (α))| ln(hj )| , ∀~h ∈ Hd .(3.24) Rd (5) P The first assertion of the proposition follows from (3.24) with Cp = Cp 17 k∈Zd e− Pd j=1 |kj | . Second step     2  b x, ~h − σ 2 x, ~h − Un x, ~h + , where Denoting χ x, ~h = σ s    ~h M2 ~h ~h   4λ 2λ 2 n n ∞ M + , x, ~h Un x, ~h = σ n 3n and choosing L = M 2 and L∞ = M2∞ , we get from (3.23) Z Pd   p Ef χp x, ~h νd (dx) ≤ Cp(5) n− 2 e(2p+10−b/2) j=1 (1+µj (α))| ln(hj )| , ∀~h ∈ Hd . (3.25) Rd    2 Note that σ M x, ~h ≤ M∞ ~h σ x, ~h and, therefore, for any x ∈ Rd and any ~h ∈ Hd    Un x, ~h ≤ M∞ ~h Un x, ~h . (3.26) This implies,   2         b x, ~h 2λn ~h σ 2λn ~h σ 2 x, ~h 2λn ~h M∞ ~h Un x, ~h 2λn ~h M∞ ~h χ∗ (x, ~h ≤ + + , n n n n    ~ ~ where we have denoted χ∗ (x, ~h = M−1 ∞ h χ(x, h . Hence s       2λn ~h M∞ ~h Un x, ~h + χ∗ (x, ~h ~ ~ b Un x, h ≤ Un x, h + . (3.27) n By the same reason s     ~h M∞ ~h Un x, ~h + χ∗ x, ~h 2λ n bn x, ~h + . Un x, ~h ≤ U n   bn x, ~h and Un x, ~h implies that Note that the definition of U   (3.28)      2λn ~h M∞ ~h bn x, ~h , Un x, ~h . (3.29) ≤ (3/2) min U n p Using the inequality |ab| ≤ 2−1 (|ay| + |b/y|), y > 0 we get from (3.27), (3.28) and (3.29) p     bn x, ~h ≤ 1 + 3/2 + (3/4)y Un x, ~h + (2y)−1 χ∗ x, ~h ; U      bn x, ~h + (2y)−1 Un x, ~h + (2y)−1 χ∗ x, ~h . Un x, ~h ≤ 1 + (3/4)y U Choosing y = 1/2 in the first inequality and y = 1 in the second we get for any x ∈ Rd and ~h ∈ Hd     ∗ ~h ; bn x, ~h − 3Un x, ~h ≤ χ (x, (3.30) U +     ∗ bn x, ~h ≤ χ (x, ~h . (3.31) Un x, ~h − 4U + Remembering that b = 8p + 22 we obtain from (3.30), (3.31), (3.25) and (3.13) for any ~h ∈ Hd Z P    2p (5) − p2 − dj=1 (1+µj (α))| ln(hj )| bn x, ~h − 3Un x, ~h p νd (dx) ≤ M∞ C n Ef U e ; (3.32) p + d ZR P    2p (5) − p2 − dj=1 (1+µj (α))| ln(hj )| bn x, ~h p νd (dx) ≤ M∞ C n e . (3.33) Ef Un x, ~h − 4U p + Rd (5) 2p Cp . The second and third assertions follow from (3.32) and (3.33) with Cp′ = M∞ 18 3.2. Proof of Theorem 2 Let f ∈ Fg,u (R, D). Introduce the following notations: √ where c1 = M2 2D, c2 = 3.2.1. Preliminaries 4M∞ 3 n  √ o−1 a = 196 (c1 c3 ) ∨ (c2 c3 ) ,  and c3 = 2 max 4 ln(M∞ ), (8p + 26) maxj=1,...,d [1 + µj (α)] . Recall that for any locally integrable function λ : Rd → R its strong maximal function is defined as Z 1 M[λ](x) := sup λ(t)dt, x ∈ Rd , (3.34) H νd (H) H where the supremum is taken over all possible rectangles H in Rd with sides parallel to the coordinate axes, containing point x. It is well known that the strong maximal operator λ 7→ M[λ] is of the strong (t, t)–type for all 1 < t ≤ ∞, i.e., if λ ∈ Lt (Rd ) then M[λ] ∈ Lt (Rd ) and there exists a constant Ct depending on t only such that (3.35) M[λ] t ≤ Ct kλkt , t ∈ (1, ∞]. Let m[λ] be defined by (3.34), where, instead of rectangles, the supremum is taken over all possible cubes H in Rd with sides parallel to the coordinate axes, containing point x. Then, it is known that λ 7→ m[λ] is of the weak (1, 1)-type, i.e. there exists C1 depending on d only such that for any λ ∈ L1 (Rd ) n o νd x : m[λ](x) ≥ z ≤ C1 z−1 kλk1 , ∀z > 0. (3.36) The results presented below deal with the weak property of the strong maximal function. The following inequality can be found in Guzman (1975). There exists a constant C > 0 depending on d only such that Z n o νd x : M[λ](x) ≥ z ≤ C Rd     |λ(x)| |λ(x)| d−1 1 + ln+ dx, z z z > 0, where for all z ∈ R, ln+ (z) := max{ln(z), 0}. Lemma 1. For any given d ≥ 1, R > 0, Q > 0 and q ∈ (1, ∞] there exists C(d, q, R, Q) such that for any λ ∈ B1,d (R) ∩ Bq,d (Q) n o d−1 νd x : M[λ](x) ≥ z ≤ C(d, q, R, Q)z−1 1 + | ln(z)| , ∀z > 0. The proof of the lemma is an elementary consequence of the aforementioned result and can be omitted. Recall also the particular case of the Young inequality for weak-type spaces, see Grafakos (2008),  Theorem 1.2.13. For any u ∈ (1, ∞] there exists Cu > 0 such that for any λ1 ∈ L1 Rd and  λ2 ∈ Lu,∞ Rd one has kλ1 ⋆ λ2 ku,∞ ≤ Cu kλ1 k1 kλ2 ku,∞ . (3.37) 19 Auxiliary results Let us prove several simple facts. First note that for any n ≥ 3 for any ~h ∈ Hd d i h X  ln(ηj ) . λn ~h ≤ c3 ln (n) + (3.38) j=1 Second it is easy to see that for any any n ≥ 3, r        ~ η ≤ Fn h l V~η /V~h , Gn ~η ≤ Gn ~h l V~η /V~h , Fn ~ ∀~η, ~h ∈ (0, ∞)d : ~η ≥ ~h, where l(v) = v −1 (1 + ln v). Since η~ ≥ ~h implies V~η ≥ V~h and l(v) ≤ 1 if v ≥ 1, we have     Fn ~η ≤ Fn ~h , Gn ~η ≤ Gn ~h , ∀~η, ~h ∈ (0, ∞)d : η~ ≥ ~h. Then by (3.38) and the second inequality in (3.39), we have:   4M∞ λn ~η ~h . sup ≤ c c G Qd 2 3 n µj (α) η ∈Hd : ~ ~ η ≥~h 3n j=1 ηj (ηj ∧ 1) (3.39) (3.40)  Now let us establish two bounds for kUn∗ ·, ~h k∞ . 10 a. Let u = ∞. We have in view of the second inequality in (3.11) for any ~η ∈ Hd   √ η σ x, ~ η ≤ D M ·, ~ 2 d √ Y −1 ≤ M2 D ηj 2 (ηj ∧ 1)−µj (α) , j=1 ∀x ∈ Rd . It yields for any x ∈ Rd in view of the first inequality in (3.39) s     η σ 2 x, ~ η 2λn ~ √ √ ≤ sup c1 c3 Fn ~η ≤ c1 c3 Fn ~h . sup n η ∈Hd : ~ ~ η≥~h η ∈Hd : ~ ~ η ≥~h (3.41) Then gathering (3.40), (3.41) and by definition of a, we have     (3.42) kUn∗ ·, ~h k∞ ≤ (196a)−1 Fn ~h + Gn ~h .  10 b. Another bound for kUn∗ ·, ~h k∞ is available regardless of the value of u. Indeed for any ~η ∈ Hd in view of the first inequality in (3.11)  σ x, ~ η ≤ M ·, ~ η  ∞ ≤ M∞ d Y j=1 ηj−1 (ηj ∧ 1)−µj (α) , ∀x ∈ Rd . It yields for any x ∈ Rd and any n ≥ 3 q s P   2 ln (n) + dj=1 ln(ηj )  √ √ η 2λn ~η σ x, ~ ~h . sup 2c3 M∞ √ Qd 2c nM G ≤ sup ≤ 3 ∞ n n n j=1 ηj (ηj ∧ 1)µj (α) η ∈Hd : ~ ~ η ≥~h η∈Hd : ~ ~ η ≥~h    √ Then gathering with (3.40) again, we have kUn∗ ·, ~h k∞ ≤ ( 2c3 nM∞ ) ∨ (c2 c3 ) Gn ~h for any ~h ∈ Hd and, therefore,  inf kUn∗ ·, ~h k∞ = 0. (3.43) ~h∈H 20 To get this it suffices to choose ~h = (b, . . . , b) and to make b tend to infinity. 20 . Let now u < ∞. Let us prove that for any z > 0, s ∈ {1, u} and any f ∈ Fg,u (R, D)     −2 2 s d e νd x ∈ R : sup Un x, ~η , f ≥ z ≤ c5 Dz Fn ~h , (3.44) η ~∈Hd : ~ η ≥~h    e = 1 if s = 1 and D e = D if s = u. where we have put Un2 ·, ~ η , f = 2n−1 λn ~η σ 2 ·, ~η and D Indeed, if s = 1, applying the Markov inequality, we obtain in view of the second inequality in η ∈ Hd (3.11) for any ~ Z      2 −1 d σ 2 x, ~η νd (dx) (3.45) η , f ≥ z ≤ 2(nz ) λn ~η νd x ∈ R : Un x, ~ Rd   2   λn ~η −2 2 = 2(nz2 )−1 λn ~η M ·, ~ η 2 ≤ 2M22 (nz2 )−1 Qd ≤ c z F ~ η . 6 n 2µj (α) η (η ∧ 1) j j j=1 Here we have put c6 = 2M22 c21 c3 and to get the last inequality  we 2haveused (3.38).  2 To get the similar result if s = u we remark that σ ·, ~η = M ·, ~η ⋆ p(·) and that M 2 ·, ~ η ∈  L1 Rd in view of the second inequality in (3.11). It remains to note that f ∈ Fg,u (R, D) implies (∞) p ∈ Bu,d (D) and to apply the inequality (3.37). It yields together with the second inequality in (3.11) for any ~η ∈ Hd     u νd x ∈ Rd : Un x, ~η , f ≥ z ≤ c6 Cu Dz−2 Fn2 ~η . e = 1 if s = 1 and C e = Cu if s = u, we get from (3.45) and (3.46) Thus, denoting C   X     e Dz e −2 s Fn2s η~ . νd x ∈ R d : sup Un x, ~η, f ≥ z ≤ c6 C η ∈Hd : η ~ ~≥~h (3.46) (3.47) η ∈Hd : ~ ~ η ≥~h It remains to note that since ~ η , ~h ∈ Hd and ~η ≥ ~h we can write ηj = emj hj with mj ≥ 0 for any j = 1, . . . , d. It yields together with the first inequality in (3.39) X η∈Hd : ~ ~ η ≥~h   Fn2s ~η ≤ Fn2s ~h X (m1 ,...,md )∈Nd  1+ d X j=1 mj s e−s Pd j=1 mj  =: c7 Fn2s ~h . e s follows from (3.47). Hence, (3.44) with c5 = c7 [c6 C] 30 . Let cK ≥ 1 be such that supp(K) ⊂ [−cK , cK ]d . We have Z K~h (t − x)f (t)νd (dt) ≤ (2cK )d kKkd∞ M[|f |](x), S~h (x, f ) = Rd ∀~h ∈ (0, ∞)d . If ~h = (h, . . . , h), h ∈ (0, ∞), the latter inequality holds with m[|f |] instead of M[|f |]. Thus, sup B~h (x, f ) ≤ 3(2cK )d kKk∞ MH [|f |](x) + |f (x)|, ~h∈H ∀x ∈ Rd , (3.48) d where we have denoted MH = M if H = Hd and MH = m if H = Hisotr .  Moreover, we deduce from (3.48) and (3.43) putting T~h (x, f ) = B~h (x, f ) + 49Un∗ ·, ~h that inf T~h (x, f ) ≤ 3(2cK )d kKk∞ MH [|f |](x) + |f (x)|. ~h∈H 21 (3.49) 3.2.2. Proof of the theorem  For any v > 0 set Cv (f ) = x ∈ Rd : T(x, f ) ≥ v , where we have put T(x, f ) = inf~h∈H |T~h (x, f )|. For any given v > 0 one obviously has Z Z v  p−1 p v νd Cv (f ) dv + |T(x, f )|p νd (dx) (3.50) kT(·, f )kp ≤ p Cv (f ) 0  Denoting Wv (~h, f ) = {x ∈ Rd : 49Un∗ x, ~h ≥ 2−1 v} we obviously have for any ~h ∈ H and v > 0    νd Cv (f ) ≤ νd A(~h, f, v) + νd Wv (~h, f ) ; (3.51) p p |T(x, f )|p 1Cv (f ) (x) ≤ 2p B~h (x, f ) 1A(~h,f,v) + 98p Un∗ x, ~h 1Wv (~h,f ) (x);    νd Cv (f ) ≤ νd x ∈ Rd : 3(2cK )d kKk∞ MH [|f |](x) + |f (x)| > v .   The last inequality follows from (3.49). Set Un∗ x, ~h, f = sup~η∈Hd : ~η≥~h Un x, ~η, f .    10 . Noting that Un∗ x, ~h ≤ Un∗ x, ~h, f + (196a)−1 Gn ~h in view of (3.40), we get n o  fv (~h, f ), ∀~h ∈ H(v). Wv (~h, f ) ⊆ x ∈ Rd : 49Un∗ x, ~h ≥ 4−1 v := W Applying (3.44) with s = 1 we deduce from (3.51) that    νd Cv (f ) ≤ νd A(~h, f, v) + 1962 c5 v −2 Fn2 ~h , (3.52) (3.53) (3.54) ∀~h ∈ H(v). Noting that the left hand side of the latter inequality is independent of ~h we get  νd Cv (f ) ≤ max[1, 1962 c5 ]Λ(v, f ). (3.55) and for any u ∈ (p/2, ∞], Z  |T(x, f )|p νd (dx) ≤ max[2p , 98p c9 ]Λp v, f, u , (3.57) 20 . Let us establish the following bounds, where c9 is given in the paragraph 20 b. below. For any u ∈ [1, ∞],  (3.56) νd Cv (f ) ≤ max[1, c5 1962 , c5 1962u D u a2u ]{Λ(v, f ) ∧ Λ(v, f, u)}, ∀v > 0. Cv (f ) ∀v > 0. 20 a. Let u = ∞. We remark that Wv (~h, f ) = ∅ for any ~h ∈ H(v, 2) in view of (3.42). Thus, we deduce from (3.51), (3.52) and (2.6), taking into account that the left hand sides of both inequalities are independent of ~h Z  |T(x, f )|p νd (dx) ≤ Λp (v, f, ∞). (3.58) νd Cv (f ) ≤ Λ(v, f, ∞), Cv (f ) This inequality and (3.55) ensure that (3.56) and (3.57) hold if u = ∞. 22 20 b. Let u < ∞. Applying (3.44) with s = u, we obtain in view of (3.54)   νd Wv (~h, f ) ≤ c5 1962u D u v −2u Fn2u ~h ≤ c5 1962u D u a2u z −u , ∀~h ∈ H(v, z) It yields together with (3.51)  νd Cv (f ) ≤ max[1, c5 1962u D u a2u ]Λ(v, f, u). (3.59) This inequality and (3.55) ensure that (3.56) holds if u < ∞. What is more, we have in view of (3.40) and (3.54) for any ~h ∈ H(v) p p Un∗ x, ~h 1Wv (~h,f ) ≤ 2p Un∗ x, ~h, f 1W fv (~h,f ) Moreover, applying (3.44) with s = u, we have for any y > 0 and ~h ∈ H(v, z)   fy (~h, f ) ≤ c5 1962u D u y −2u F 2u ~h ≤ c5 1962u D u y −2u (av)2u z −u . νd W n Hence, if additionally u > p/2, we have for any ~h ∈ H(v, z) Z ∞ Z  p ∗ p ~ fy (~h, f ) dy y p−1 νd W Un x, h νd (dx) ≤ 2 p v Wv (~h,f ) Z ∞ = c5 1962u D u a2u 2p pv 2u z −u y p−1−2u dy =: c9 v p z −u . v This yields together with (3.52) Z  |T(x, f )|p νd (dx) ≤ max[2p , 98p c9 ]Λp v, f, u . (3.60) Cv (f ) This inequality ensures that (3.57) holds if u < ∞. 30 . Recall that f ∈ Fg (R) implies that f ∈ B1,d (R). Since additionally f ∈ Bq,d (D), q > 1, Lemma 1 as well as (3.36) is applicable and we obtain in view of (3.53)  νd Cv (f ) ≤ c10 v −1 (1 + | ln v|)t(H) , ∀v > 0. It yields for any v > 0 and p > 1 Z Z v  p−1 v νd Cv (f ) dv ≤ c10 p p 0 v 0 v p−2 (1 + | ln v|)t(H) dv ≤ c11 v p−1 (1 + | ln v|)t(H) . (3.61) In the case of t(H) = 0 the last inequality is obvious and if t(H) = d − 1 it follows by integration by parts. The assertion of the theorem follows now from (3.50), where the bound (3.61) is used for any v < v, the estimate (3.56) for any v ∈ [v, v] and the bound (3.57) with v = v. 3.3. Proof of Theorem 3 The proof of the theorem is based essentially on some auxiliary statements formulated in Section 3.3.1 below. Some properties related to the kernel approximation of the underlying function f are summarized in Lemma 2 and in formulae (3.62). The results presented in Lemma 1 and in formulae (3.63) deal with the properties of the strong maximal function. In the subsequent proof c1 , c2 , . . ., stand for constants depending only on ~s, ~ q , g, K, d, R, D, u and q. 23 3.3.1. Auxiliary results Let J denote the set of all the subsets of {1, . . . d} endowed with the empty set ∅. For any J ∈ J and y ∈ Rd set yJ = {yj , j ∈ J} ∈ R|J| and we will write y = yJ , yJ¯ , where as usual J¯ = {1, . . . d} \ J. For any j = 1, . . . , d introduce the d × d matrix P Ej = (0, . . . , ej , . . . , 0) where, recall, (e1 , . . . , ed ) denotes the canonical basis of Rd . Set also E[J] = j∈J Ej . Later on E0 = E[∅] denotes the matrix with zero entries. To any J ∈ J and any λ : Rd → R associate the function   λJ yJ , zJ¯ = λ z + E[J](y − z) , y, z ∈ Rd , with the obvious agreement λJ ≡ λ if J = {1, . . . d}, Q which is always the  case if d = 1. d For any ~h ∈ Hd and J ⊆ {1, . . . d} set K~h,J (uJ ) = j∈J h−1 K u /h j j and define for any y ∈ R j Z     K~h,J¯(uJ¯ − yJ¯)λ yJ , uJ¯ ν|J| K~h ◦ λ J (y) = ¯ duJ¯ , R|J¯| ¯ |J| where ν|J| h, ~η ∈ Hd set ¯ is the Lebesgue measure on R . For any ~ B~h,~η (x, f ) = |S~h∨~η (x, f ) − S~η (x, f )|.  Lemma 2. Let Assumption 3 hold. One can find k ∈ {1, . . . d} and a collection of indexes j1 < j2 < · · · < jk ∈ {1, . . . , d} such that for any x ∈ Rd and any f : Rd → R B~h,~η (x, f ) ≤ B~h (x, f ) ≤ k h X l=1 k h X l=1 K~h∨~η ◦ bhjl ,f,jl K~h ◦ bhjl ,f,jl i Jl i Jl (x), (x) + h K~η ◦ bhjl ,f,jl i Jl  (x) ; Jl = {j1 , . . . , jl }. The proof of the lemma can be found in Lepski (2015), Lemma 2. Also, let us mention the following bound which is a trivial consequence of the Young inequality and the Fubini theorem. If λ ∈ Lt (Rd ) then for any t ∈ [1, ∞]   (3.62) sup K~h ◦ λ J t ≤ kKkd1 kλkt , ∀~h ∈ Hd . J∈J To any J ∈ J and any locally integrable function λ : Rd → R+ we associate the operator Z  1 (3.63) λ t + E[J][x − t] ν|J| MJ [λ](x) = sup ¯ (dtJ¯) ¯ (H|J| ¯ ) H|J| H|J¯| ν|J| ¯ ¯ ¯ and with where the supremum is taken over all hyper-rectangles in R|J| containing xJ¯ = (xj , j ∈ J) sides parallel to the axis. As we see MJ [λ] is the strong maximal operator applied to the function obtained from λ by fixing the coordinates whose indices belong to J. It is obvious that M∅ [λ] ≡ M[λ] and M{1,...,d} [λ] ≡ λ. The following result is a direct consequence of (3.35) and of the Fubini theorem. For any t ∈ (1, ∞] there exists Ct such that for any λ ∈ Lt Rd ) sup MJ [λ] J∈J t ≤ Ct kλkt . Obviously this inequality holds if t = ∞ with C∞ = 1. 24 (3.64) 3.3.2. Proof of the theorem 10 . We start with the following obvious observation. For any λ : Rd → R+ , ~u ∈ Rd and J ∈ J [K~u ◦ λ]J (x) ≤ (2cK kKk∞ )d MJ [λ](x), ∀x ∈ Rd . (3.65) Putting C1 = (2cK kKk∞ )d we get for any ~h, ~η ∈ Hd and x ∈ Rd in view of (3.65) and assertions of Lemma 2 that B~h,~η (x, f ) ≤ 2C1 d X   sup MJ bhj ,f,j (x), j=1 J∈J B~h (x, f ) ≤ C1 d X   sup MJ bhj ,f,j (x). j=1 J∈J Thus noting that the right hand side of the first inequality above is independent of ~η , we obtain B~h (x, f ) ≤ 5C1 d X   sup MJ bhj ,f,j (x), j=1 J∈J ∀x ∈ Rd , ∀~h ∈ Hd . (3.66) Applying (3.64) with t = ∞, we have for any v > 0 in view of the definition of J(~h, v) X X     sup MJ bhj ,f,j (x) + 5C1 sup MJ bhj ,f,j B~h (x, f ) ≤ 5C1 ¯ ~h,v) j∈J( ≤ 5C1 ≤ 5C1 X ¯ ~h,v) j∈J( X ¯ ~h,v) j∈J( J∈J   sup MJ bhj ,f,j (x) + 5C1 J∈J j∈J(~h,v) X ∞ J∈J Bj,∞,F hj j∈J(~h,v)   sup MJ bhj ,f,j (x) + 4−1 v, J∈J  ∀f ∈ F. (3.67) We obtain for any f ∈ F, v > 0 and ~s = (s1 , . . . , sd ) ∈ (1, ∞)d , applying consecutively the Markov inequality and (3.64) with t = sj , o n  n   o −1 ≤ νd ∪J∈J ∪j∈J( νd A ~h, f, v ¯ ~h,v) x : 5C1 MJ bhj ,f,j (x) ≥ (4d) v h X X  is j s v −sj Bj,sj ,F hj . (3.68) v −sj bhj ,f,j sj ≤ c1 ≤ c1 j ¯ ~h,v) j∈J( ¯ ~h,v) j∈J( Noting that the right hand side of the latter inequality is independent of f and the left hand side is independent of ~s, we get c−1 s (v, F), 1 sup{Λ(v, f ) ∧ Λ(v, f, u)} ≤ Λ~s (v, F, u) ∧ Λ~ f ∈F ∀v > 0, ~s ∈ (1, ∞)d . (3.69) 20 . Note also that in view of (3.67), we have for any v > 0 Z p  B~h (x, f ) νd (dx) A ~h,f,v ≤ c2 ≤ c4 Z A ~h,f,v "  ¯ ~h,v) j∈J( X Z ¯ ~h,v) j∈J( X A ~h,f,v p n   o sup MJ bhj ,f,j (x) νd (dx) + c3 v p νd A ~h, f, v J∈J   p n p  sup MJ bhj ,f,j (x) νd (dx) + v νd A ~h, f, v J∈J 25 o # . (3.70) For any v > 0 and j = 1, . . . , d, introduce o n   Aj (v) = x ∈ Rd : sup MJ bhj ,f,j (x) ≥ (40C1 )−1 v , J∈J  Aj (v) = A ~h, f, v ∩ Āj (v). ¯ ~h, v) Noting that in view of (3.67) for any v > 0 and any j ∈ J( ( ) X   d sup MJ bhj ,f,k (x) ≥ v/8 Aj (v) ⊆ x ∈ R : 5C1 ¯ ~h,v), k6=j k∈J( ( x ∈ Rd : 5C1 ⊆ X ¯ ~h,v) k∈J( J∈J  sup MJ bhj ,f,k (x) ≥ v/8 J∈J q ∈ [p, ∞)d we deduce from (3.70) that for any ~ Z X Z p  B~h (x, f ) νd (dx) ≤ c4 A ~h,f,v ≤ c6 X Aj (v) ¯ ~h,v) j∈J( v p−qj  =: A∗ ~h, f, v , p   sup MJ bhj ,f,j (x) νd (dx) J∈J n h n o i o +c5 v p νd A∗ ~h, f, v + νd A ~h, f, v n h n o i o  qj  . (3.71) + c5 v p νd A∗ ~h, f, v + νd A ~h, f, v sup MJ bhj ,f,j qj J∈J ¯ ~h,v) j∈J( )  It remains to note that similarly (3.68) for any ~s ∈ (1, ∞)d n X o v −sj bhj ,f,j νd A∗ ~h, f, v ≤ c7 sj sj ¯ ~h,v) j∈J( and to apply (3.64) with t = qj to the each term in the sum appeared in (3.71). All of this together with (3.68), applied with ~s = ~ q yields for any v > 0 and ~q ∈ [p, ∞)d Z h X X iqj p qj p−qj p−qj . h B v b B (x, f ) ν (dx) ≤ c v ≤ c  ~h j,qj ,F j 9 9 hj ,f,j qj d A ~h,f,v ¯ ~h,v) j∈J( ¯ ~h,v) j∈J( Noting that the right hand side of the latter inequality is independent of f and the left hand side is independent of ~ q , the we get sup Λp (v, f, u) ≤ c9 v p Λ~q (v, F, u), f ∈F ∀v > 0, ~q ∈ [p, ∞)d . (3.72) The first assertion of the theorem follows from (3.69), (3.72) and Theorem 2. 30 . Remark that in view of (3.48) and (3.35) f ∈ Bq,d (D) implies B~h (·, f ) q   ≤ 3(2cK )d kKkd∞ Cq + 1 D, ∀~h ∈ (0, ∞)d , where Cq is the constant which appeared in (3.35). Hence for any v > 0 and q ∈ [p, ∞) Z p q q−p p−q v B~h (·, f ) q ≤ c10 v p−q .  B~h (x, f ) νd (dx) ≤ 2 A ~h,f,v 26 (3.73) (3.74) Remind that H(v) 6= ∅, H(v, z) 6= ∅ whatever v > 0 and z ≥ 2, see Remark 2. Hence, in view of (3.74) for any f   Λp (v, f, u) ≤ inf c10 v p−q + z −u = c10 v p−q . z≥2 It remains to note that the right hand side of the obtained inequality is independent of f and the second assertion of the theorem follows from this inequality, (3.69) and Theorem 2. 40 . Since C∞ = 1 we obtain in view of (3.73) for all f ∈ B∞,d (D) B~h (·, f ) ∞   ≤ 3(2cK )d kKkd∞ + 1 D, ∀~h ∈ (0, ∞)d . It yields for any ~s ∈ (1, ∞) in view of (3.68) if q = ∞ Z n o p ~ ≤ c12 ν (dx) ≤ c ν A h, f, v (x, f ) B  ~h 11 d d A ~h,f,v X ¯ ~h,v) j∈J( h isj . v −sj Bj,s,F hj Since the left hand side of the obtained inequality is independent of f and the left hand side is independent of ~s we conclude that sup Λp (v, f, u) ≤ c12 Λ~s (v, F, u), f ∈F ∀v > 0, ~s ∈ (1, ∞)d . (3.75) The third assertion of the theorem follows now from (3.69), (3.75) and Theorem 2. 50 . We have already seen (Corollary 1), that B~∗ (·, f ) ≤ 2 supη∈H:η≤h B~η (·, f ) if ~h = (h, . . . , h) ∈ h d Hisotr . Therefore by definition of B~h (·, f ): B~h (·, f ) ≤ 5 sup η∈H:η≤h B~η (·, f ) ≤ 5 sup d X   sup K~η ◦ b∗η,f,j J (x). (3.76) η∈H:η≤h j=1 J∈J d where, remind ~ η = (η, . . . , η) ∈ Hisotr . We remark that (3.76) is similar to (3.66) but the maximal operator is not involved in this bound. This, in its turn, allows to consider ~s ∈ [1, ∞)d . Indeed, similarly to (3.67) we have for any v > 0, applying (3.62) with t = ∞ X   (3.77) sup K~η ◦ b∗η,f,j J (x) + 4−1 v, ∀f ∈ F. B~h (x, f ) ≤ 5 sup η∈H:η≤h ¯ ~h,v) j∈J( J∈J We obtain for any f ∈ F, v > 0 and ~s = (s1 , . . . , sd ) ∈ [1, ∞)d applying consecutively the Markov inequality and (3.62) with t = sj h  X X X  is j  s v −sj . v −sj B∗j,sj ,F h b∗η,f,j sj ≤ c14 νd A ~h, f, v ≤ c13 j ¯ ~h,v) j∈J( η∈H:η≤h ¯ j∈J(h,y) We note that the obtained inequality coincides with (3.68) if one replaces Bj,sj ,F (·) by B∗j,sj ,F (·). It remains to remark that Bj,sj ,F (·) ≤ B∗j,sj ,F (·). Indeed, bv,f,j (x) = lim sup k→∞ h∈H: e−k ≤h≤v 27 b∗h,f,j (x). Therefore, by the monotone convergence theorem and the triangle inequality for any s ∈ [1, ∞) Bj,s,F (h) := sup kbv,f,j ks = sup lim f ∈F k→∞ f ∈F ≤ X sup lim f ∈F k→∞ sup h∈H: e−k ≤h≤h b∗h,f,j h∈H: e−k ≤h≤h s b∗h,f,j = sup s X f ∈F h∈H: h≤h b∗h,f,j s =: B∗j,s,F(v). The fourth statement of the theorem follows now from (3.69), (3.72), (3.74) and Theorem 2. 3.4. Proof of Assertion 1  ~ L ~ ⊂ B∞,d (L∞ ). Thus, we can choose D = L∞ and q = ∞, which implies u = ∞. Obviously FK β,  ~ For any v > 0 let h(v) = h1 (v), . . . , hd (v) , where  1/βj hj (v) = max h ∈ H : h ≤ LL0 L−1 , j = 1, . . . , d, j v and L ∈ (0, 1) is chosen to satisfy LL0 ≤ c. This in its turn implies LL0 < 1. ~ ~ L ~ implies that This choice of h(v) together with the definition of the class FK β,  ~ J h(v), v = {1, . . . , d}, ∀v > 0; ~ h(v) ∈ (0, 1]d , ∀v ∈ (0, L−1 ]. (3.78) (3.79)  ~ such that Moreover, there exists T1 := T1 β~ < ∞ independent of L −1 lim sup (ln n) n→∞ d Then set T2 = e 2 + Pm j=1 sup d X v∈Vn j=1 µj (α) √ i h β(α) Vn = δn1+β(α) , 1 .  ln hj (v) ≤ T1 , 1 − 2β(α) T1 + 2(LL0 ) . We have in view of (3.79) and (3.80) for all n large enough and any v ∈ Vn p p − 1  (T1 + 2) ln n Fn ~ h(v) ≤ √ Q ≤ T2 δn v 2β(α) 1  +µ (α) n dj=1 hj (v) 2 j  h(v) ≤ Gn ~ n (3.80) (T1 + 2) ln n (T1 + 2) ln n − 1 2 1+µj (α) ≤ Qd 1+2µj (α) ≤ T2 δn v β(α) . n j=1 hj (v) j=1 hj (v) Qd (3.81) (3.82) 2β(α) β(α) √ Setting T3 = ( 2a−1 T2 ) 2β(α)+1 and T4 = (a−1 T22 ) β(α)+1 we obtain in view of (3.81) and (3.82) for all n large enough β(α) i h ~ h(v) ∈ H(v), ∀v ∈ T4 δn1+β(α) , 1 ,   ~h(v) ∈ H(v, 2), ∀v ∈ T3 ϕn , 1 . β(α) It is worth noting that T2 > 1, which implies T4 > 1, and δn1+β(α) ϕ−1 n → 0, n → ∞. Choose β(α) v = T4 δn1+β(α) , v = T3 ϕn . 28 (3.83) ~ Since h(v) ∈ H(v) for any v ∈ [v, v] in view of (3.83), we deduce from (3.78) and (3.81) for any ~s   ~ L ~ ≤ v −2 F 2 ~h(v) ≤ T 2 δn v −2−1/β(α) , ∀v ∈ [v, v]. Λ~s v, FK β, n 2 This, in its turn, yields for any ~s Z v v  ~ L ~ dv ≤ T5 δn Z(v, v), v p−1 Λ~s v, FK β, (3.84)  where we have denoted T5 = T22 1 ∨ |p − 2 − 1/β(α)|−1 and Z(v, v) = v p−2−1/β(α) 1{p>2+1/β(α)} + v p−2−1/β(α) 1{p<2+1/β(α)} + ln (v/v)1{p=2+1/β(α)} . ~ ∈ H(v, 2) in view of (3.83), we deduce from (3.78) that for any ~s Moreover, since h(v)   ~ L ~ , ∞ = 0. Λ~s v, FK β, (3.85) At last, putting T6 = T4p−1 (1 + ln T4 )t(H) , we obtain (p−1)β(α) lH (v) := v p−1 (1 + | ln (v)|)t(H) ≤ T6 δn 1+β(α) (1 + ln n)t(H) . (3.86) Applying the third assertion of Theorem 3, we deduce from (3.84), (3.85) and (3.86) that Rn(p) [fb~h(·) , f ] ≤C (1)  (p−1)β(α) 1+β(α) T6 δn t(H) (1 + ln n) 1 p 1 + T5 δn Z(v, v) + Cp n− 2 . After elementary computations we come to the statement of Assertion 1. References Barron, A., Birgé, L. and Massart, P. (1999). Risk bounds for model selection via penalization. Probab. Theory Related Fields 113, 301–413. Birgé, L. and Massart, P. (2001). Gaussian model selection. J. Eur. Math. Soc. (JEMS) 3, 3, 203-268. Cai, T. T. (1999). Adaptive wavelet estimation: a block thresholding and oracle inequality approach. Ann. Statist. 27, 3, 898–924. Cavalier, L. and Golubev, G.K. (2006). Risk hull method and regularization by projections of ill-posed inverse problems. Ann. Statist. 34, 1653–1677. Comte, F. and Lacour, C. (2013). Anisotropic adaptive kernel deconvolution. Ann. Inst. H. Poincaré Probab. Statist. 49, 2, 569–609. Dalalyan, A. and Tsybakov, A.B. (2008). Aggregation by exponential weighting, sharp PACBayesian bounds and sparsity. Machine Learning 72, 39–61. Donoho, D. L., Johnstone, I. M., Kerkyacharian, G. and Picard, D. (1996). Density estimation by wavelet thresholding. Ann. Statist. 24, 508–539. Efroimovich, S. Yu. and Pinsker M.S. (1984). An adaptive algorithm of nonparametric filtering. Automat.Remote Control 45, 58–65. Efroimovich, S. Yu. (1986). Non-parametric estimation of the density with unknown smoothness. Theory Probab. Appl. 30, 557–568. 29 Goldenshluger, A. (2009). A universal procedure for aggregating estimators. Ann. Statist. 37, 1, 542-568. Goldenshluger, A. and Lepski, O.V. (2009). Structural adaptation via Lp -norm oracle inequalities. Probab. Theory Related Fields 143, 41-71. Goldenshluger, A. and Lepski, O.V. (2011). Bandwidth selection in kernel density estimation: oracle inequalities and adaptive minimax optimality. Ann. Statist. 39, 1608–1632. Goldenshluger, A. and Lepski, O.V. (2014). On adaptive minimax density estimation on Rd . Probab. Theory Related Fields, 159, 479–543. Golubev, G.K. (1992). Non-parametric estimation of smooth probability densities. Probl. Inform. Transm. 1, 52–62. Grafakos, L. (2008). Classical Fourier Analysis. Graduate texts in Mathematics, second edition, Vol.249. Springer scence+Business media. de Guzman, M. (1975). Differentiation of Integrals in Rn . With appendices by Antonio Crdoba, and Robert Fefferman, and two by Roberto Moriyn. Lecture Notes in Mathematics, Vol. 481. Springer-Verlag, Berlin-New York. Hesse, C. H. (1995). Deconvolving a density from partially contaminated observations. Journal of Multivariate Analysis 55, 246–260. Kerkyacharian, G., Lepski, O. and Picard, D. (2001). Nonlinear estimation in anisotropic multi–index denoising. Probab. Theory Related Fields 121, 137–170. Lepskii, O. V. (1991). Asymptotically minimax adaptive estimation. I. Upper bounds. Optimally adaptive estimates. Theory Probab. Appl. 36, 682–697. Lepski, O.V. (2015). Adaptive estimation over anisotropic functional classes via oracle approach. Ann. Statist. 43, 3, 1178–1242. Lepski, O.V., and Willer T. (2017). Lower bounds in the convolution structure density model Bernoulli, 23, 2, 884-926. Leung, G. and Barron, A. R. (2006). Information theory and mixing least-squares regressions. IEEE Trans. Inform. Theory 52, 8, 3396-3410. Nemirovski, A. S. (2000). Topics in non-parametric statistics. In Lectures on probability theory and statistics (Saint-Flour, 1998) Lecture Notes in Math. Springer, Berlin 1738, 85-277. Rebelles, G. (2016) Structural adaptive deconvolution under Lp -losses. Math. Methods Statist. 25, 1, 26-53. Tsybakov, A. (2003). Optimal rate of aggregation. Proc. COLT. Lecture Notes in Artificial Intelligence 2777, 303–313. Wegkamp, M.H. (2003). Model selection in nonparametric regression. Ann. Statist. 31, 252-273. 30
10math.ST
On Behaviors of Maximal Dimension arXiv:1801.08327v2 [math.GR] 26 Jan 2018 Wenjun Niu∗ Fudan University Shanghai, China, 200433 January 29, 2018 Abstract In this paper, we investigate behaviors of Maximal Dimension, a group invariant involving certain configuration of maximal subgroups, which we denote by MaxDim. We prove that in some special cases, MaxDim(G × H) = MaxDim(G) + MaxDim(H). We also prove a conjecture stated by Ellie Thieu which shows that groups with m < MaxDim can be constructed from groups with m < i. 1 Introduction and background For a group G, a subset s ⊆ G of elements in G is a generating set if hg, g ∈ si = G. s is said to be irredundant if hg, g ∈ s \ {h}i = 6 hg, g ∈ si for each h ∈ s. Thus for a finite group G, any generating set s contains an irredundant generating set, simply by removing the redundant elements one at a time from s. Note that this is generally not true for infinite groups, as has been mentioned in [7] by R. Fernando. In what follows, we consider exclusively only finite groups, which will not be mentioned again in the statements. With these in mind, we introduce two different notions of “dimension” for a group, whose associations has been studied for long. Denote by m(G) the maximal size of an irredundant generating set of G, and i(G) the maximal size of an irredundant set of G. By definition one clearly has m(G) ≤ i(G). It is not hard to see that these functions are not always equal, for example, if G = Zp ≀ Zp , then m(G) = 2 but i(G) = p. There are several reasons these functions are called “dimension”. First, one may observe that these functions generalizes dimension of a vector space, on which these conceptions coincide. Second, these functions clearly measure how “large” a group may be. Finally, thanks to the work of several mathematicians, it has been shown that these functions behave nicely on groups, e.g., m(G × H) = m(G) + m(H) and i(G × H) = i(G) + i(H)1 . There is another counterpart of dimension for finite groups, which comes somehow naturally from generating sequences, and will be our main gradient. In order to define this function, let us introduce the following definition: ∗ This material is based on work at 2017 Cornell University Math REU Program. The author want to express his acknowledgement to Professor R. Keith Dennis and graduate mentor Ravi Fernando for their guidance and encouragement. 1 The conclusion for i is more straightforward from Whiston’s Lemma. For m, see [9] or [4]. 1 Definition 1.1. Let G be a group, and {Hi | 1 ≤ i ≤ n} a set of subgroups of G. | 1 ≤ i ≤ n} is said to be in general position if for any 1 ≤ j ≤ n, T {Hi T Hi ) Hi . i6=j i In other words, a set of subgroups of G is in general position if the intersection of subgroups from any proper subset strictly contains the intersection of the subgroups from the whole set. Now we define: Definition 1.2. Let G be a group, the maximal dimension of G, denoted by MaxDim(G), is defined by: MaxDim(G) = max |S| S (1) where S ranges over collections of maximal subgroups of G that are in general position. One may recognize the counterpart of this definition in linear algebra. This function is related to generation of finite groups by the following proposition: Proposition 1.3. Let G be a group, then m(G) ≤ MaxDim(G) ≤ i(G). Proof. First, we prove that m(G) ≤ MaxDim(G). Let s = {g1 , . . . , gn } be an irredundant generating set of G with n = m(G). For any 1 ≤ i ≤ n, choose Mi maximal such that s \ {gi } ⊆ Mi , which is possible because s \ {gi } generates a proper subgroup. One observe that gi ∈ / Mi otherwise Mi would contain a generating set. We claim that {Mi , 1 ≤ i ≤ n} are in general position. For any j, we indeed have ∩i6=j Mi ) ∩i Mi because the first subgroup contains gj while the second doesn’t. Hence the claim holds and m(G) = n ≤ MaxDim(G). Next, we prove that MaxDim(G) ≤ i(G). Let S = {M1 , . . . , Mk } be maximal subgroups of G with k = MaxDim(G). By definition, for any i, ∩j6=i Mj \ Mi is not empty, hence one can choose gi in this set. We claim that s = {g1 , . . . , gm } is irredundant. Indeed, the subgroup generated by s\{gi } is contained in Mi which does not contain gi , hence itself cannot contain gi , so the claim is true. Thus MaxDim(G) = k ≤ i(G). Remark 1.4. We say s in the above proof certifies S. In light of Proposition 1.3, R. Keith Dennis suggested a way of seeking generating sets by looking for maximal subgroups in general position attaining maximal length, and then use the above machinery. But unfortunately, the behavior of this function has not been studied very profoundly and adapting this machinery can be risky. R. Fernando([7]), E. Detomi and A. Lucchini([5]) exhibit groups with m ≪ MaxDim, and proved that m = MaxDim for a large family of groups. Computation by R. Keith Dennis reveals that this function may have nice behavior on product of groups. We will present a partial result in this direction. But before going to next section, let us introduce the following definition: Definition 1.5. Let G be a group. The Frattini Subgroup of G, denoted by Φ(G), is defined as the intersection of all maximal subgroups of G. The importance of Φ(G) for us is that it is negligible in computing m and MaxDim. We say G is Frattini Free if Φ(G) is trivial. It is not restrictive to always assume that G is Frattini Free when computing these functions because G/Φ(G) is always Frattini Free. We will do so when necessary. 2 2 On additivity of MaxDim In this section, we will prove that MaxDim(H × K) = MaxDim(H) + MaxDim(K) for appropriate H and K, and will present the obstacle to generality. First, we will introduce the following: Lemma 2.1 (Goursat). Let H and K be groups. Then maximal subgroups of H × K come from one of the following two types: (1). M × K for M maximal in H or H × M ′ for M ′ maximal in K. (2). There exists a tuple (S, N, N ′ , α), where S is a simple group, N and N ′ are normal subgroups of H and K respectively, and α : H/N → K/N ′ ∼ = S is an isomorphism, such that ∆ ⊆ H × K is defined by ∆ = {(h, k) | α(h̄) = k̄}. Remark 2.2. Subgroups in (1) will be called standard subgroups, and subgroups in (2) will be called pullback subgroups2 . Lemma 2.1 partially explains the reason why MaxDim is difficult to understand: one has to deal with pullback subgroups, which involves common simple quotients of H and K. One easy observation will be that if pullback subgroups do not exist, in other words, if H and K are coprime, then MaxDim(H ×K) = MaxDim(H)+MaxDim(K). This in fact can be generalized slightly to the following: Theorem 2.3. Let H and K be groups admitting no common nonabelian simple quotient. The following identity holds: MaxDim(H × K) = MaxDim(H) + MaxDim(K) with which a corollary: Corollary 2.4. Let H and K be groups such that one of them is solvable, then MaxDim(H × K) = MaxDim(H) + MaxDim(K). Thus with the help of Theorem 2.3, the additivity of MaxDim on product of finite solvable groups has been settled. We proceed to the proof of Theorem 2.3, beginning with a lemma: Lemma 2.5. Let H be a group and N be a normal subgroup of H. Let M1 , . . . , Mk be maximal subgroups of H in general position, then it is possible to rearrange them, so that M1 ∩ N, . . . , Ml ∩ N are in general position and for any j > l, Mj ∩ N contains ∩1≤i≤l Mi ∩N . Moreover, if we let π : H → H/N be the projection and R = ∩1≤i≤l Mi , then π(R ∩ Mj ) for j > l are in general position in H/N . Proof. Without loss of generality we assume that Mi ∩ N are in general position for 1 ≤ i ≤ l and Mj ∩ N contains the intersection of them for any j > l. So it remains to show that π(R ∩ Mj ) for j > l are in general position. For this purpose, one need only show that for any l < j ≤ k, π(R ∩ Mj ) does not contain \ π(R ∩ Mt ) l<t≤k t6=j Without loss of generality assume j = k. Since clearly \ \ π(R ∩ Mt ) ⊇ π( Mt ∩ R) l<t≤k−1 2 This l<t≤k−1 terminology comes from the fact that such groups are pullbacks in the category of groups. 3 we need only show that π(R ∩ Mk ) does not contain the latter group, which is equivalent to that \ (R ∩ Mk )N + Mt ∩ R l<t≤k−1 Denote by T the group on the right. If (R ∩ Mk )N ⊇ T then (R ∩ Mk )(R ∩ N ) ⊇ T and by assumption R ∩ N ⊆ Mk ∩ N which implies that Mk ⊇ T , violating the fact that M1 , . . . , Mk are in general position. Hence π(R ∩ Mj ) for j > l are in general position. This lemma is very similar to Whiston’s argument3 , but here we are working on a set of subgroups, hence readers may notice that the direction changes. Now we can prove Theorem 2.3: Proof of Theorem 2.3. The proof is by the following strategy: given any set of maximal subgroups in general position, we replace pullback subgroups by standard subgroups in a way that does not change the total number of subgroups in question , so that the resulting set of maximal subgroups is still in general position. Let S = {M1 , . . . , Mk } be a collection of maximal subgroups of H × K in general position, if no maximal subgroups are pullbacks then k ≤ MaxDim(H) + MaxDim(K) and we are done. So suppose among S there is a pullback subgroup, say Mk of the form ∆(N,N ′ ,α) induced by N ✁ H and N ′ ✁ K and α : H/N ∼ = Zp (By our = K/N ′ ∼ assumption, pullback maximal subgroups must be of this form). Abbreviate it by ∆, we know that necessarily ∆ ∩ (N × N ′ ) = N × N ′ and must contain the intersection of Mj ∩ (N × N ′ ) for j < k. This, together with Lemma 2.5, and the fact that Z2p is flat with i = 2, indicates that we may assume without loss of generality, either Mj ∩ (N × N ′ ) for j < k are in general position, or Mj ∩ (N × N ′ ) for j < k − 1 are in general position and Mk−1 contains the intersection of them. Let us now consider separately these two cases. Case 1. Suppose Mj ∩ (N × N ′ ) for j < k are in general position. Let \ R= Mj 1≤j<k and π : H × K → H × K/(N × N ′ ) be the projection, then π(R) must be a nontrivial subgroup of H × K/(N × N ′ ) ∼ = Z2p , otherwise R ⊆ N × N ′ ⊆ ∆, violating the fact that S is in general position. Because π(R) is nontrivial, but H/N ∩ K/N ′ is trivial in the quotient, π(R) is not contained in at least one of them, say H/N . We claim in this case that S ′ = {M1 , . . . , Mk−1 , H × N ′ } is in general position. Indeed, since Mi ∩ (H × N ′ ) for 1 ≤ i < k are in general position, and H × N ′ does not contain R which is the intersection of Mi for 1 ≤ i < k, we see immediately that S ′ is in general position. Case 2. Suppose Mj ∩ (N × N ′ ) for j < k − 1 are in general position and Mk−1 contains the intersection of them. Let \ R= Mj 1≤j<k−1 and π as in the first case, we claim that π(R) = H/N × K/N ′ . Indeed, by Lemma 2.5, π(R ∩ Mk−1 ) and π(R ∩ ∆) are in general position, which implies that i(π(R)) = 2. 3 Interested readers may refer to [10] or [2] for more information 4 But the only subgroup of Z2p having i = 2 is the whole group, hence the claim holds. Now it is not hard to show, by the same argument as in the first case, that the set S ′ = {M1 , . . . , Mk−2 , H × N ′ , N × K} is in general position. This shows that in any case we can replace pullback subgroups by standard subgroups, and a repeated application of this gives k ≤ MaxDim(H) + MaxDim(K). This is true for any collection of maximal subgroups of the direct product, and we conclude that MaxDim(H × K) ≤ MaxDim(H) + MaxDim(K). On the other hand, it is trivial that MaxDim(H × K) ≥ MaxDim(H) + MaxDim(K), hence MaxDim(H × K) = MaxDim(H) + MaxDim(K). This completes the proof. Lemma 2.5 also yield the following: Proposition 2.6. Suppose H and K are groups and MaxDim(K) = i(K), then: MaxDim(H × K) = MaxDim(H) + MaxDim(K) Proof. Let G = H × K and let M1 , . . . , Mk be maximal subgroups that are in general position. Now after rearranging we may assume that M1 ∩ H, . . . , Ml ∩ H are in general position and Mj contains their intersection for j > l. This together with Lemma 1.3 gives the bound k − l ≤ i(G/H) = i(K) = MaxDim(K). Now for any maximal subgroup Mi , i ≤ l, since {Mi ∩ H|1 ≤ i ≤ l} is in general position, Mi is either a standard subgroup induced by some maximal M < H, or a pullback. In both cases, H ∩ Mi will be an intersection of maximal subgroups. Indeed, if Mi = ∆(N,N ′ ,α) , then Mi ∩H = N , which is the intersection of all maximal subgroups containing N because H/N is simple therefore Frattini Free; but if Mi = M × K then Mi ∩ H = M . We show that l ≤ MaxDim(H). Let Hi = Mi ∩ H for 1 ≤ i ≤ l. Now we claim that we can choose a maximal subgroup M ⊇ H1 such that M, H2 , . . . , Hl are in general position. This is enough to show that l ≤ MaxDim(H). Suppose for any such M , the sequence fail to be in general position, then the only possibility is that M ⊇ ∩1<i≤l Hi , since if H1 ∩ Hi are in general position for 1 < i ≤ l, so are M ∩ Hi for any M ⊇ H1 . But this implies that H1 ⊇ ∩1<i≤l Hi since H1 equals the intersection of maximal subgroups containing it. This contradicts the fact that Hi are in general position, so the claim holds. These arguments together give k ≤ MaxDim(H) + MaxDim(K). This is true for any set of maximal subgroups in general position, hence MaxDim(G) ≤ MaxDim(H) + MaxDim(K). Since the other inequality is trivial, the proof is complete. Theorem 2.3 and Proposition 2.6 cover a wide range of groups, e.g., all solvable groups, Mathieu groups, Janko groups J1 , J2 and all symmetric and alternating groups satisfy assumptions of Theorem 2.3 or Proposition 2.64 , hence MaxDim(H × K) = MaxDim(H) + MaxDim(K) if K is one of the above groups. These all provide strong evidence that in general, MaxDim is additive on product of groups. It is not known yet in general, but in proving it or disproving it, one might need to consider S × S for S a simple group. There are some reasons for this: first of all, 4 The results for Mathieu groups M11 and M12 is proved by T. Brooks([1]). The results for Mathieu group M22 and Janko groups are joint work of Sophie Le, Tianyue Liu and me(to appear). The result for M23 is from the work of Sophie Le(to appear), and the result for M24 is from a remarkable theoretical proof of Tianyue Liu and R. Keith Dennis([8]). For alternating and symmetric groups, see [10] by J. Whiston. 5 MaxDim is additive automatically on S ×S ′ if S and S ′ are simple but not isomorphic; second, for any group G, one has the conception of rumpf, denoted by R(G), which is defined as the intersection of maximal normal subgroups, and it is easily seen that pullback subgroups are determined by G/R(G), which is a product of simple groups. To this direction, the biggest family of non-flat simple groups is that of linear groups, and we deal with a part of this family in the following: Proposition 2.7. Let PSL(2, p) be the projective special linear group over the field with p ≥ 5 elements, where p is a prime. Then the following identity holds: MaxDim(PSL(2, p) × PSL(2, p)) = 2MaxDim(PSL(2, p)) Before coming to the proof, it is worthwhile to introduce some important results about PSL(2, p) that will be used in the proof. The first one is Dickson’s complete classification of maximal subgroups of PSL(2, p). Theorem 2.8 (Dickson). Maximal subgroups of PSL(2, p) comes from one of the following types: (1). Point stabilizers Ga for a ∈ P1 (Fp ), isomorphic to Zp ⋊ Z p−1 . 2 (2). Stabilizers of a pair G{a,b} for a, b ∈ P1 (Fp ), isomorphic to Dp−1 , dihedral group of order p − 1. (3). Stabilizers of a pair G{a,b} for a, b ∈ P1 (Fp2 ), isomorphic to Dp+1 , dihedral group of order p + 1. (4). Subgroups isomorphic to A4 , S4 or A5 . Readers may refer to [6] for more details. In [11], J. Whiston and J. Saxl proved that 3 ≤ m(PSL(2, p)) ≤ 4. This is in fact also true for MaxDim. In fact, in [3], D. Collins computed explicitly the intersection of maximal subgroups of the first three types. The result can be summarized as the following: Proposition 2.9 (D. Collins). Intersections of maximal subgroups of PSL(2, p) of first three types are: (1). Ga ∩ Gb ∼ = Z(p−1)/2 . (2). Ga ∩ Gb ∩ Gc is trivial. (3). Ga ∩ G{b,c} is either trivial or isomorphic to Z2 . (4). G{a,b} ∩ G{c,d} is isomorphic to Z2 × Z2 , the Klein 4-group. In the following proof, we view PSL(2, p) both as matrices and as mobius functions on the space Fp ∪ {∞} interchangebly. In any case, Ga will be point stabiliser, and G{a,b} will be the elements that stabilize the set {a, b}. Proof of Proposition 2.7. Denote by G the group PSL(2, p). Let us first note that MaxDim(G) ≤ 4. Indeed, if MaxDim(G) > 4, then because i(A5 ) = i(S4 ) = 3, the set of subgroups attaining maximal length would all come from first three types in Theorem 2.8. But by Proposition 2.9, the intersection of any three maximal subgroups from first three types is a subgroup of Z2 if they are in general position. This is a contradiction. Hence MaxDim(G) ≤ 4. We fix some notations LM = M × G and RM ′ = G × M ′ , and ∆σ = {(g, σ(g) | g ∈ G)}. These are the only maximal subgroups of G × G. Since the conclusion is trivial if no pullback subgroup is included, in what follows we assume that there is a pullback subgroup. Let LM1 , · · · , LMk and RM1′ , · · · , RMs′ be standard maximal subgroups induced by Mi , Mj′ < G, and ∆id , ∆σ1 , · · · , ∆σn be pullback subgroups 6 induced by id, σi , such that these subgroups are in general position(note that we can always assume that ∆id is included by applying appropriate automorphism), we wish to show that k + s + n + 1 ≤ 2MaxDim(G). First note that {∆id ∩ LMi , ∆id ∩ RMj′ } is in general position, then {Mi , Mj′ } is in general position in PSL(2, p). On the other hand, by Proposition 2.9, it is easily seen that if four maximal subgroups are in general position, then their intersection must be trivial. This indicates that if k + s = 4, then n = 0 and the cardinality of the whole set is less than 2MaxDim(G). So we may assume that k + s does not attain 4. But before working directly with all maximal subgroups, it seems convenient to first deal with ∆σi ’s. In the following, we prove that in order that ∩i ∆σi ∩ ∆id be nontrivial, n must be less than or equal to 4. We begin with pullback subgroups that are induced by inner homomorphism. Now let ∆id , ∆h1 , ∆h2 , · · · , ∆hn be maximal subgroups that are in general position, where ∆hi is induced by the conjugation of hi , such that their intersection is not trivial. We show that n ≤ 3. It is easily seen that their intersection is {(g, g) | g commutes with h1 , · · · , hk }. Also note that {h1 , · · · , hk } is irredundant. Let C(S) be the subgroup consists of elements commuting with S. Let H be the subgroup generated by all hi . If H = G then since G is simple, C(G) is trivial and hence the intersection is trivial. This shows that in order that the subgroups above have nontrivial intersection, H must be proper. We assume first that H is contained in some maximal subgroup of the first three kind. But before going on, we will list here some observations that will be used throughout the proof: (a). Suppose h = diag{x, x−1 }, where x2 6= 1, then C(h) consists of only diagonal matrices iff x4 6= 1. If x4 = 1, then C(h) consists of all diagonal matrices as well as matrices of the form   0 y −y −1 0 which we will denote by Ad{y, −y −1}. (b). Suppose h = Ad{y, −y −1 } then C(h) consists of matrices of the form   x −zy 2 z x as well as  x z zy 2 −x  where each matrix must have determinant one. If H < Ga for some a, then consider C(h1 ), it is a subgroup commuting with h1 . Since h1 fixes a, it also fixes ga for g ∈ C(h1 ), hence in order that h1 be nontrivial, all elements in C(h1 ) can only possibly fix a or move a to another b(This is true by (2) of Proposition 2.9). If for all hi , all elements in C(hi ) fixes a, we show that n ≤ 2. 2 Under appropriate conjugation, we may assume that a = ∞ and Ga ∼ = Zp ⋊ (Z× p) where the second factor acts by multiplying on the left(viewed as subgroup of the unit elements in Zp ). Let h1 = (x1 , y12 ) and h2 = (x2 , y22 ). Let (x, y 2 ) be an element that commute with both h1 and h2 , then we have the formula: ( x1 + y12 x = x + y 2 x1 x2 + y22 x = x + y 2 x2 7 and more precisely the following matrix equation:      x 1 − y12 x1 x1 = y2 1 − y22 x2 x2 If the matrix on the left has determinant zero, then the two rows are linearly dependent, in which case C(h1 ) = C(h2 ), which cannot happen since the subgroups are in general position. Hence the only possibility is that the matrix is invertible, which means that there is only one possible solution for the above equation, i.e., (0, 1). Hence C(h1 ) ∩ C(h2 ) = 1 and n ≤ 2. If C(h1 ) consists of elements fixing a and switching {a, b}, then h1 ∈ Ga ∩ Gb , and under appropriate conjugation, we may assume that h1 is diagonal. If h2 is not in this intersection, then h2 maps b to some c, in which case any element g in C(h1 ) ∩ C(h2 ) will need to fix {a, b} and satisfy gc = gh2 b = h2 gb which equals either c or a. But since g fixes {a, b}, g must also fix c, in which case C(h1 ) ∩ C(h2 ) ⊆ Z2 and nothing else can be added otherwise the intersection will be trivial. Now consider the other case, where all hi lies in Ga ∩ Gb , and hence all hi are diagonalisable. In this case, by the observation (1), we conclude that C(h1 ) = C(h2 ) or C(h1 ) ⊇ C(h2 ) or C(h1 ) ⊆ C(h2 ). This contradicts the fact that the subgroups are in general position. Up to now the first case is all done and the conclusion is that whenever H < Ga , n ≤ 2, or to say, for any three of the C(hi ), if they are in general position, their intersection must be trivial. Now consider the case where H < G{a,b} . Here we may well work at PSL(2, Fp2) which unifies type (2) and (3) in Theorem 2.8, because the above observations are still true here. Without loss of generality, we may assume that H consists of matrix of the form diag{x, x−1 } and Ad{y, −y −1}. By same argument as in the above case, we know that there will at most be one hi of diagonal form. Suppose h1 is of diagonal form −1 diag{x1 , x−1 1 } and h2 is of the form Ad{y2 , −y2 }. Direct computation by observation (2) shows that C(h1 ) ∩ C(h2 ) either contains only diag{x, x−1 } with x4 = 1(if C(h1 ) contains only diagonal matrices) or contains these together with those Ad{y, −y −1} such that y 4 = y24 . In the first case, C(h1 ) ∩ C(h2 ) = Z2 and nothing more can be added to the sequence. In the second case, if we choose h3 = Ad{y3 , −y3−1 } with y34 = y24 , then C(h2 ) ∩ C(h1 ) = C(h3 ) ∩ C(h1 ) which contradicts the fact that they are in general position. Hence we must choose h3 such that y34 6= y24 , which means that C(h1 ) ∩ C(h2 ) ∩ C(h3 ) contains only elements of the form diag{x, x−1 } with x4 = 1, and so C(h1 ) ∩ C(h2 ) ∩ C(h3 ) = Z2 . And we cannot add any more hi in otherwise the intersection will be trivial. Finally, if we only choose element of antidiagonal form, and assume that we have chosen hi = Ad{yi , −yi−1 } for 1 ≤ i ≤ 3, and yi4 are not all equal, then it is possible using same argument as above to show that C(h1 ) ∩ C(h2 ) ∩ C(h3 ) ⊆ Z2 . This finishes the case where H < G{a,b} . If H < S4 or A5 , and if n = 3, then the hi ’s form an irredundant generating sequence for respective groups. Because in either case the group is strongly flat and has trivial center, the intersection will have to be trivial. Hence in order that the intersection being nontrivial, n ≤ 2. The same is true if H < A4 . The conclusion here is that if ∆id , ∆h1 , ∆h2 , ∆h3 are in general position, there intersection is a subset of Z2 . We now apply an argument similar to Whiston’s to pass the information to Aut(G)5 . Suppose we have ∆σ1 , · · · , ∆σ4 together with ∆id are in general position, and one of the σi , say σ1 is not an inner-morphism. 5 Here we use the fact that Out(G) = Z2 . 8 Then we can multiply σ1 appropriately to σj ’s to make them inner, say σ1si σj is inner, and we have Rad(∆σ1 , . . . , ∆σ4 , ∆id )6 = Rad(∆σ1 , ∆σ1s2 σ2 , · · · , ∆σ1s4 σ4 , ∆id ). Consider ∆id ∩ ∆σsj σj for j > 1. We claim that they are in general position. If not, 1 say ∆id ∩ ∆σ1s1 σ2 ∩ ∆σ1s3 σ3 < ∆id ∩ ∆σ1s4 σ4 , then Rad(∆σ1 , ∆σ1s2 σ2 , · · · , ∆σ1s4 σ4 , ∆id ) = Rad(∆σ1 , ∆σ1s2 σ2 , ∆σ1s3 σ3 , ∆id ), which implies ∩i ∆σi ∩ ∆id = ∩i<4 ∆σi ∩ ∆id . This contradicts the fact that the five subgroups are in general position. But if ∆id ∩ ∆σsj σj for j > 1 are in general position, then their intersection lies inside Z2 as has 1 been shown above. Hence if ∆σi for 1 ≤ i ≤ 4 and ∆id are in general position, their intersection is a subset of Z2 . Now we can finish the proof of the proposition. Suppose we are given some ′ collections of maximal subgroups LM1 , · · · , LMk and RM1′ , · · · , RM with k + s ≤ 3, s ∆id , ∆σ1 , ∆σ2 , ∆σ3 , ∆σ4 where σi ’s are nontrivial automorphisms. We are done if MaxDim(G) = 4 since the argument above indicates that any time if pullback subgroups are included, the total number of maximal subgroups has to be no more than 8. If MaxDim(G) = 3, then in order that the equality fails, all but one of the maximal subgroups of the above need to be included. We show that this is impossible. Suppose we use all the ∆σi , then the above argument shows that the intersection of these subgroups with ∆id is either Z2 or trivial, indicating that we can only possibly add one more in the set. So no more than three ∆σi ’s other than ∆id can be included, and in order to attain 7, we need to use all standard maximal subgroups above, that is LMi and RMj′ . If the Mi , Mj′ are all from first three types, then by easy computation, their intersection will be either trivial or isomorphic to Z2 , in which case only 5 maximal subgroups can be included. Hence we must have some A5 or S4 in Mi , Mj′ . But in this case, since i(A5 ) = i(S4 ) = 3 we conclude that we can possibly have 3 more choices of other types other than ∆id . In either case, k + s + n + 1 ≤ 6 ≤ 2MaxDim(G). This is true for any set of maximal subgroups in which there is one pullback subgroup, and because it is trivially true if no pullback subgroup is used, we conclude that MaxDim(G × G) ≤ 2MaxDim(G). Since the other inequality is trivial, the proof is complete. We conclude this section by some comments. First of all, it seems to the author that in proving or disproving MaxDim(S 2 ) = 2MaxDim(S) for simple S one will inevitably use classification theorem. Second, it is not hard to show that for a simple S, if MaxDim(S 2 ) = 2MaxDim(S), then MaxDim(S n ) = nMaxDim(S). Third, even if the identity holds for simple groups, there is no obvious evidence that it should be true in general. So before going into the proof for all simple groups, I think it is worthwhile to build the bridge from simple groups to general groups. R. Keith Dennis, on the other hand, suggested that one should first focus on simple groups and look for stronger properties than that in Proposition 2.7, among which there might be illustrations toward general situations. This is possibly doable because in Proposition 2.7, it seems very likely that once a pullback subgroup is included, the number of subgroups in general position is no greater than MaxDim(S) + 1. It will be great if such conclusion does hold, but by now we only know this holds for a small number of groups, i.e., flat simple groups. This is the following proposition proved by R. Fernando in Cornell 2017 summer REU program: Proposition 2.10 (R. Fernando). Let S be a simple group. If M1 , . . . , Mk are max6 Rad means the radical, i.e., taking intersection. 9 imal subgroups of S × S that are in general position, then we have:   if Mi are all standard  2MaxDim(S) k≤   i(S) + 1 if some Mi is a pullback Proof. If all Mi are of standard form, it is trivial that one has k ≤ 2MaxDim(S). If some Mi , say M1 is a pullback, then M1 ∼ = S and because Mi ∩ M1 are in general position for i > 1, we have k − 1 ≤ i(S), hence k ≤ i(S) + 1. This completes the proof. 3 Relative versions of MaxDim This section serves as a transition between Section 2 and Section 4, some definitions and results will be introduced and will be used in next section. In order to further understand Maximal Dimension, inspired by [4], we come to the definition of relative versions of this function. The first one is the following: Definition 3.1. Let G be a group and H < G, then the maximal dimension of G relative to H, which we denote by MaxDim(G, H), is defined by: MaxDim(G, H) = max |S| S where the maximum is taken over all S = {M1 , . . . , Mk }, collections of maximal subgroups of G such that {M1 ∩ H, . . . , Mk ∩ H} is in general position. The naturality of this definition can be seen in Lemma 2.5. There is another version, which comes naturally when studying group extensions: Definition 3.2. Let G be a group and H another group acting on G. Define the maximal dimension of G under H, which is denoted by MaxDimH (G), by: MaxDimH (G) = max |S| S where the maximum is taken over all S = {M1 , . . . , Mk }, collections of maximal Hinvariant subgroups of G that are in general position. Our goal in this and next section is to use these two conceptions to study behaviors of maximal dimension under group extensions, especially extensions by abelian groups. To this vein, we prove the following: Proposition 3.3. Let N ✁ H and π : H → H/N . Let M1 , . . . , Mk be maximal subgroups of H that are in general position, such that M1 ∩N, . . . , Ml ∩N are in general position and Mj contains ∩1≤i≤l Mi ∩N for any j > l. Let R = ∩1≤i≤l Mi and π : H → H/N be the projection. Then l ≤ MaxDim(H) − MaxDim(H/N, π(R)). Moreover, if N/Φ(N ) is abelian, l ≤ MaxDim(H) − MaxDim(H/N ), and l ≤ MaxDimH (N ). Proof. For the first statement, suppose M1′ , . . . , Ms′ are maximal subgroups of H containing N such that π(M1′ ) ∩ π(R), . . . , π(Ms′ ) ∩ π(R) are in general position, it 10 is not hard to show that {M1 , . . . , Ml , M1′ , . . . , Ms′ } are in general position, hence l ≤ MaxDim(H) − s. Taking s to be maximal, we get l ≤ MaxDim(H) − MaxDim(H/N, π(R)) For the second statement, since Φ(N ) < Φ(H), we assume that H is Frattini free, which implies by our assumption that N is abelian. Note that if M is a maximal subgroup of H not containing N , we claim that M ∩ N is a maximal H-invariant subgroup of N . It is indeed H-invariant because M N = H, so we only need to show that M ∩ N is maximal. If not, say M ∩ N ( N ′ ( N for some N ′ ✁ H. Since M is maximal, M N ′ = H and H/N = M/(M ∩ N ) = M N ′ /N ′ = H/N ′ , a contradiction. Hence M ∩ N is maximal H-invariant. This gives the bound l ≤ MaxDimH (N ). Now we proceed to prove that π(R) = H/N , which will complete the proof of the Proposition. Suppose R′ is a subgroup of H such that π(R′ ) = H/N , and M a maximal subgroup of H not containing N such that M ∩ N + R′ ∩ N . We claim that π(M ∩ R′ ) = H/N . First of all, since M ∩ N is maximal invariant, (M ∩ N )(R′ ∩ N ) = N . Now for any h ∈ H/N , there exists m ∈ M and r ∈ R′ such that π(m) = π(r) = h. This indicates that mr−1 ∈ N = (M ∩ N )(R′ ∩ N ), hence there exists n1 ∈ M ∩ N ′ and n2 ∈ R′ ∩ N such that mr−1 = n−1 1 n2 , which indicates that n1 m = n2 r ∈ R ∩ M . This element has image h. This shows that every element in H/N has a pre-image in R′ ∩ M , hence π(R′ ∩ M ) = H/N , and the proof is complete. Proposition 3.3 gives several bounds on l, a value coming from Lemma 2.5 depending on the collection of maximal subgroups. There is a corollary to this which is also related to the previous section: Corollary 3.4. Suppose H and K are groups with R(H) and R(K) abelian, and both H/R(H) and K/R(K) are product of flat simple groups. Then MaxDim(H × K) = MaxDim(H) + MaxDim(K). Proof. Let M1 , . . . , Mn be maximal subgroups of H × K that are in general position, and consider N = R(H) × R(K). Suppose M1 ∩ N, . . . , Mk ∩ N are in general position, and Mj contains the intersection of them. These Mi must be type (1) subgroups either not containing R(H) × K(if they are induced by M < H), or not containing H × R(K)(if they are induced by M ′ < K). Hence by Proposition 3.5, k ≤ MaxDim(H)+MaxDim(K)−MaxDim(H/R(H))−MaxDim(K/R(K)). On the other hand, by Lemma 1.3, n − k ≤ i(H/R(H) × K/R(K)) = i(H/R(H)) + i(K/R(K)), which is equal to MaxDim(H/R(H)) + MaxDim(K/R(K)) by flatness. Combining these inequalities we get the desired result. Proposition 3.3 also yield the following corollary, which will be used in next section. Corollary 3.5. Suppose H = N ⋊ T where N is abelian and T is flat. Then MaxDim(H) = MaxDimT (N ) + MaxDim(T ) Proof. Note that Proposition 3.5 gives the bound MaxDim(H) ≤ MaxDimT (N ) + MaxDim(T ). But since the sequence splits, it is very easy to demonstrate a sequence of that length, which consist of N1 ⋊ T, . . . , Nk ⋊ T and N ⋊ M1 , . . . , N ⋊ Mt where k = MaxDimT (N ) and t = MaxDim(T ). 11 4 Groups with MaxDim = m and groups with MaxDim > m In this section, we will give another proof, using the results and techniques in Section 3, the theorem that has been proved by E. Detomi and A. Lucchini in [5], stating that if G′ is nilpotent, then m(G) = MaxDim(G). Also, we will prove a proposition conjectured by Ellie Thieu in 2017 Cornell summer SPUR forum, which not only exhibits a connection between groups with m < MaxDim and groups with m < i, but also explains the reason that the group R = smallgroup(720, 774) found by R. Fernando in [7] is the smallest solvable group with m < MaxDim. In fact, the proof of this proposition is based on computations on GAP for R. To begin with, we introduce the following version of Goursat lemma: Lemma 4.1 (Goursat Lemma for G-groups). Let G be a group acting on H and K. Let π1 : H × K → H and π2 : H × K → K. Suppose ∆ is a proper G-invariant subgroup of H × K such that π1 (∆) = H and π2 (∆) = K, then there exists invariant normal subgroups N ✁ H and N ′ ✁ K, and a G-isomorphism α : H/N → K/N ′ such that ∆ = {(h, k)|α(h̄) = k̄}. Proof. Let N = ∆∩H ×1. This is a G-invariant subgroup, and by definition a normal subgroup of ∆, being the kernel of the projection π2 . Since ∆ projects on the first factor, N ✁ H. The same reason indicates that N ′ = ∆ ∩ 1 × K is normal. The rest of the statements will be routine check and will be omitted. Another lemma important to us is a structure theorem for groups with nilpotent commutator subgroups: Lemma 4.2. Let G be a finite group with G′ nilpotent, and suppose Φ(G) = 1. Then there are abelian subgroups F, H < G such that F ✁ G and G = F ⋊ H. Moreover, F can be decomposed into minimal H-groups. Proof. See [5]. Theorem 4.3. Let G be a group with G′ nilpotent, then MaxDim(G) = m(G). Proof. Write G = F ⋊ H as in Lemma 4.2 and assume that G is Frattini Free, which implies that F can be decomposed into minimal H vector spaces. Since H is abelian, Corollary 3.5 is applied and we get that MaxDim(G) = MaxDimH (F ) + m(H). Since m(G) = m(H)+number of irreducible H components of F 7 , we are only left to prove that MaxDimH (F ) is exactly the number of complemented chief factors contained in F (i.e., the number of irreducible components of F ). For this purpose, we may assume without loss of generality, that F = V n for some minimal H module V and some n > 0. Let U be a maximal H-invariant subgroup of F , then by Lemma 4.1, U either discard one of the factors V totally(i.e., U = V n−1 ), or is determined by diagonally linking two copies of them(by some automorphism of V ). We show by induction that the number of maximal invariant subgroups used should always be less than or equal to the number of irreducible component. Now take any maximal subgroup U that is used, we deviate two cases. First, suppose U = V n−1 , i.e., U is of normal type. For 7 See, for example, [9], or [4, p. 52] Proposition 3.4.1 12 any other W , since W 6= U , W either discard another copy of V , or is determined by diagonally linking two copies of V . In the first case, W ∩ U is clearly maximal in U . In the second case, if W links two copies of V that are both inside of U , then W ∩ U is a maximal invariant subspace of U determined by diagonally linking two copies of V . Otherwise W links two copies of V one of which is the complement of U . In this case, W ∩ U is the direct sum of V n−1 and the subspace of V consisting of fixed points of a nontrivial H-automorphism. Since V is minimal this latter space is trivial. Hence W ∩ U is maximal again. In either case W ∩ U is maximal and inductive hypothesis can be applied to give the bound. Second, suppose U is a diagonal subspace. In this case we also have that U ∼ = V n−1 . For any other W , if W is a normal form or is determined by diagonally linking a pair different from that of U , then W ∩ U is maximal. If W is determined by diagonally linking the same pair as U , but in a different way, then W ∩ U is again the direct sum of V n−2 with a diagonal subgroup determined by the fixed point space of a nontrivial H-automorphism of V , which is trivial by the same reason as above. Hence W ∩ U is maximal, and the inductive hypothesis can be applied. This proves that MaxDimH (F ) is indeed the number of irreducible components of F , and the proof is complete. In [4], D. Collins used relative versions of m to deal with m(G) − m(G/N ), by which he proved that m(G × H) = m(G) + m(H). In [9], A. Lucchini investigated more closely the quantity m(G) − m(G/N ) for minimal normal N , and showed that this quantity only depends on the action of G on N . The above results come from the same idea, i.e., to look at MaxDim(G) − MaxDim(G/N ). But A. Lucchini proved(in private communication) that this value can be arbitrarily large even for minimal normal abelian N , so we are still not close to fully understanding this value. Next result is based on computations for R, which also gives a way to construct infinite class of groups with m < MaxDim. Proposition 4.4. Let S be a non flat group. There exists a semi-simple S-group V such that MaxDim(V ⋊ S) = MaxDimS (V ) + i(S). Clearly because m(V ⋊ S) = MaxDimS (V ) + m(S), if S is flat, this indeed gives an example of groups with m < MaxDim, and somehow they are as many as groups with m < i. We need a lemma to prove the result: Lemma 4.5. Let H < S be a subgroup, and p a prime not dividing the cardinality of S. Then there exists a finite S-space V over Fp and a vector v ∈ V such that Stab(v) = H. Proof. Let V0 = Fp , viewed as the trivial H module. Let us consider the induced module V = indSH (V0 ). An element f ∈ V is defined as a map f : S → V0 such that f (gh) = h−1 (f (g)) = f (g) since V0 is a trivial H module, which is equivalent to that f takes constant value along the left cosets of H. Now let us choose such a function f ∈ V , taking 0 on H and 1 on all other left cosets. This is a nontrivial element in V . We claim that Stab(f ) = H. Pick s ∈ Stab(f ), then by definition sf (g) = f (g) for all g ∈ S. Taking g = 1 we see that sf (1) = f (s−1 ) = f (1), hence f (s−1 ) = 0 and so s ∈ H. On the other hand, for any h ∈ H, hf (g) = f (h−1 g) = f (h−1 gh) = f (g) as can be easily seen. Hence indeed Stab(f ) = H and the proof is complete. 13 Proof. (of Proposition 4.4) Fix a prime p not dividing the cardinality of S, and let H1 , . . . , Hn be subgroups of S that are in general position with n = i(S). For each i, there exists Vi over Fp and vi ∈ Vi such that Stab(vi ) = Hi . For each i, we can decompose Vi into irreducible subspaces and the elements that stabilize vi stabilize all factors in the decomposition. Meanwhile, if ∩1≤i≤t Mi , N2 , . . . , Nk are in general position, there must be some i such that Mi , N2 , . . . , Nk are also in general position. Hence we may assume that each vi spans an irreducible component of Vi under the action of S. Let V = V1 ⊕ V2 ⊕ · · · ⊕ Vn , and consider G = V ⋊ S. First of all, it is easily seen using Lemma 1.3 that MaxDim(G) ≤ MaxDimS (V ) + i(S), so we must prove the other direction. We do this by exhibiting a sequence of this length. Fix a decomposition of V , say W1 ⊕W2 ⊕· · ·⊕Wm such that the first n factors are just Wi = spanS (vi ), the irreducible subspaces generated by each vi . Define maximal subgroups of G by M Mi = ( Wj ) ⋊ S j6=i for 1 ≤ i ≤ m and M Tk = ( Wj )vk Svk−1 j6=k for 1 ≤ k ≤ n. We claim that Mi , Tk are in general position. Let π : G → S be the projection. First, any Tk does not contain the intersection of the other, since π(∩1≤i≤n Mi ∩ Tk ) = π({vk svk−1 |s ∈ Hk }) = Hk and we know that all Hk are in general position. Next, Mj for j > n does not contain the intersection of the other, since the intersection of all except Mj contains Wj but Mj doesn’t. Finally, Mi for each 1 ≤ i ≤ n does not contain the intersection of the other. Without loss of generality, consider M1 , and let R = ∩j>1 Mj ∩ T1 , by calculation this is just v1 Sv1−1 , and we see that π(R ∩ M1 ) = H1 . What is π(R ∩ Tk ) for k > 1? For instance, for any v1 sv1−1 ∈ R, if it is in Tk , then (v1 sv1−1 s−1 )s = (wvk svk−1 s−1 )s for some w ∈ ⊕j6=k Wj , and so v1 sv1−1 s−1 − vk svk−1 s−1 = w for some w ∈ ⊕j6=k Wj . But since the k-th component of w is trivial by definition, vk svk−1 s−1 = 0 and so s ∈ Hk . Now it is easily seen that π(R ∩ Tk ) = Hk for k > 1, and because Hk are in general position, M1 ∩ R does not contain the intersection of R ∩ Tk for k > 1. This indicates that the subgroups are in general position. Counting the number of subgroups in question we see that MaxDim(V ⋊ S) ≥ MaxDimS (V ) + i(S), and the result follows from these two inequalities. In fact, the pattern of subgroups of R is exactly of this form, and the reason m(R) < MaxDim(R) is because R has a non flat top S(smallest non flat group, in fact, by computation in GAP) and a bottom V which S acts on, such that stabilizers of elements in V play a role in making MaxDim one larger. This also shows that in Lemma 2.5, the subgroups π(R∩Mj ) are not predictable in the quotient, in particular not necessarily maximal. 14 5 Acknowledgement The author wants to take this chance to express his gratitude for many people, especially for Professor R. Keith Dennis and graduate mentor Ravi Fernando, for their encouragements and advise, as well as all Cornell 2017 REU participants, for many insightful comments and fruitful discussions. The author also wants to thank Professor Andrea Lucchini for his private communication with the author, giving the author many new perspectives on this topic. The author is also very thankful for Michael Vincent Crea for being a friend to the author and providing much support during this summer. 15 References [1] Thomas Brooks. Generating sets of mathieu groups. 2013. [2] Peter J Cameron and Philippe Cara. Independent generating sets and geometries for symmetric groups. Journal of Algebra, 258(2):641–650, 2002. [3] Dan Collins. Finite Groups. 2017. [4] Dan Collins. Generating Sequences of Finite Groups. 2017. [5] Eloisa Detomi and Andrea Lucchini. Maximal subgroups of finite soluble groups in general position. Annali di Matematica Pura ed Applicata (1923-), 195(4):1177–1183, 2016. [6] Leonard Eugene Dickson. Linear groups: With an exposition of the Galois field theory. Courier Corporation, 2003. [7] Ravi Fernando. On an inequality of dimension-like invariants for finite groups. arXiv preprint arXiv:1502.00360, 2015. [8] Tianyue Liu and R Keith Dennis. Maxdim of some simple groups. arXiv preprint arXiv:1712.04553, 2017. [9] Andrea Lucchini. The largest size of a minimal generating set of a finite group. Archiv der Mathematik, 101(1):1–8, 2013. [10] Julius Whiston. Maximal independent generating sets of the symmetric group. Journal of Algebra, 232(1):255–268, 2000. [11] Julius Whiston and Jan Saxl. On the maximal size of independent generating sets of psl2 (q). Journal of Algebra, 258(2):651–657, 2002. 16
4math.GR
1 Backlash Identification in Two-Mass Systems by Delayed Relay Feedback arXiv:1802.06246v1 [cs.SY] 17 Feb 2018 Michael Ruderman, Shota Yamada, Hiroshi Fujimoto Abstract—Backlash, also known as mechanical play, is a piecewise differentiable nonlinearity which exists in several actuated systems, comprising, e.g., rack-and-pinion drives, shaft couplings, toothed gears, and other elements. Generally, the backlash is nested between the moving elements of a complex dynamic system, which handicaps its proper detection and identification. A classical example is the two-mass system which can approximate numerous mechanisms connected by a shaft (or link) with relatively high stiffness and backlash in series. Information about the presence and extent of the backlash is seldom exactly known and is rather conditional upon factors such as wear, fatigue and incipient failures in components. This paper proposes a novel backlash identification method using one-side sensing of a twomass system. The method is based on the delayed relay operator in feedback that allows stable and controllable limit cycles to be induced, operating within the unknown backlash gap. The system model, with structural transformations required for the one-side backlash measurements, is given, along with the analysis of the delayed relay in velocity feedback. Experimental evaluations are shown for a two-inertia motor bench with gear coupling, with a low backlash gap of about one degree. Index Terms—backlash, two-mass system, relay, identification, play operator, nonlinearities, limit cycles, online estimation I. I NTRODUCTION Mechanical backlash, i.e., the phenomenon of play between adjacent movable parts, is well known in control systems and causes rather disturbing side-effects such as lost motion, undesired limit cycles in a closed control loop, reduction of the apparent natural frequencies of systems and other effects. For a review of this phenomenon we refer to [1]. One possibility is that progressive wear and fatigue-related cracks in mechanical structures can develop over the operation time of an actuated system with backlash. This may occur in addition to the appearance of parasitic noise; see, e.g., [2]. Moreover, increasing backlash leads to more strongly pronounced chaotic behavior [3] that, in general, mitigates against accurate motion control of the system. Two-mass systems with backlash, as schematically shown in Fig. 1, constitute a rather large class of motion systems with related issues. Here, a driving member, which is generally a motor or actuator, is coupled to the driven member (load) by various construction elements, i.e., gears, couplings or kinematic pairs. The latter contain a finite gap, here denoted by 2β , usually of a small size. Within this gap, both moving M. Ruderman is with University of Agder, Norway correspondence to: [email protected] S. Yamada and H. Fujimoto are with the University of Tokyo, Japan This work has received funding from the European Unions Horizon 2020 research and innovation programme (H2020-MSCA-RISE-2016) under the Marie Sklodowska-Curie grant agreement No 734832. masses become decoupled from each other. It is important to note that this structure has a backlash feedback system which differs significantly from feedthrough systems where a static backlash element appears either in the input or output channel. These types of systems with backlash have also attracted considerable attention in systems analysis and control, see, e.g., [4], [5]. However, they should not be confused with the types of backlash feedback systems depicted in Fig. 1 and addressed in the following. Some previous studies which consider analysis and control of backlash feedback systems can be found in, e.g., [6]–[8]. x ! Fig. 1. Two-mass system with backlash. Despite the fact that the fundamental understanding of backlash mechanisms appears to be something of a solved problem, case-specific modeling, and above all, reliable detection and identification, still remain relevant and open-ended problems in systems and control engineering. Applications can be found in industrial robotic manipulators, e.g., [9], flexible medical robots, e.g., [10], servo drive systems, e.g., [11], [12], automotive power trains, e.g., [13] and other areas. Information about the presence and extent of backlash, which is a rather undesirable structural element, is seldom exactly known, and usually requires identification under normal operational conditions. When both the motor-side and the loadside of a two-mass (two-inertia) system are equipped with high-resolution position sensors (encoders) (see for instance [14]), the identification of backlash becomes a trivial task which can be accomplished under various quasi-static, lowexcitation conditions. A frequently encountered case, however, is when load-side sensing is not available, or is associated with special auxiliary measures which can differ markedly from the normal operational conditions. A typical situation occurs when only the driving actuator is equipped with an encoder or other position-giving sensor, while the total drive train, presumably with backlash, has no access to the additional measurements. In the last two decades, various strategies for estimation, and hence identification, of the backlash between two moving members, have been developed. A very early study and analysis of the backlash phenomenon in geared mechanisms was 2 made by [15]. A specially designed impulse excitation and motor current filtering method was proposed in [11] for highprecision servo systems. While straightforward in realization, the method relies on the assumption that the torque impulses are sufficient to move the motor and, at the same time, to keep the load immobile. For systems with high and uncertain damping and additional elasticity modes, such excitation can be challenging with regard to the realization and manifestation of the backlash. The nonlinear observation of backlash states was proposed and evaluated in [16], though both motor-side and load-side measurements were required. An identification approach based on the ridges and skeletons of wavelet transforms was demonstrated by [17]. The method requires a relatively broadband frequency excitation and a combined time-frequency analysis that can be challenging in a practical application. One of the most established strategies of backlash identification, using motor-side sensing only, was reported in [12]. It should be noted, however, that the underlying ideas were previously provided in [15]. This approach will also be taken as a reference method for experimental evaluation in the present work. Another, more frequency-domain-related approach for analyzing backlash by approximating with a describing function, can be found in [18]. This relies on the socalled ”exact backlash mode” introduced in [19]. Describing the function analysis of systems with impact and backlash can be found in [20]. An experimental comparison of several backlash identification methods, mainly based on the previous works of [11]–[13], can be found in [21]. The authors concluded that the method of integration of speed [12] was the most accurate of those under evaluation. The objective of this paper is to introduce a new strategy for identifying the backlash in two-mass systems when only motor-side sensing is available. In addition, this method does not require a large excitation of the motion dynamics, in contrast to the case of [12]. This can be advantageous for various machines and mechanisms where the load cannot be driven at higher velocities and accelerations. The proposed method relies on the appearance of stable and controllable limit cycles, while using a delayed relay in the velocity feedback loop. We recall that relay feedback systems have been intensively studied since the earlier pioneering works [22], [23] and successfully applied in, e.g., auto-tuning of controllers [24] and other purposes such as mass identification [25]. In the present study, the uncertainties and parasitic effects of the system dynamics are not explicitly taken into account, but the relay in feedback provides the necessary robustification, which is also confirmed by experiments. Further, we note that attempts to use relay feedback for identifying backlash in twomass systems were also made in [26]. However, the relay feedback was solely used for inducing a large-amplitude periodic motion, while the underlying identification strategy relied on the motor speed pattern analysis, as in [12]. Furthermore, exact detection of the zero-crossing and extremum instants is required, along with the ratio of the masses (inertias). The rest of the paper is organized as follows. In section II we describe the underlying modeling approach for two-mass systems with backlash, and the required structural transformations which allow consideration of the two-mass system as a plant with motor-side sensing only. Section III contains a detailed analysis of the feedback relay system and induced limit cycles, including controllable drifting, which enables motor operation within and beyond the backlash gap. An experimental case study with the minimal necessary identification of system parameters and relay-based backlash identification is provided in section IV, together with a comparison with the method reported in [12]. The study is summarized, and the conclusions drawn in section V. II. T WO -M ASS S YSTEM WITH BACKLASH The block diagram of a generalized two-mass system with backlash is shown in Fig. 2. Note that this encompasses the principal structure introduced in section I, (compare with Fig. 1). The motor-side and load-side dynamics, described by the relative coordinates xm and xL respectively, are given by mẍm + d ẋm + f sign(ẋm ) = u − τ , (1) M ẍL + DẋL + Fsign(ẋL ) = τ . (2) Both are coupled in the forward and feedback manner by the overall transmitted force τ , which is often referred to as a link (or joint) force. Note that in the following we will use the single terms force, displacement and velocity while keeping in mind the generalized forces corresponding to generalized motion variables. Thus, the rotary coordinates and corresponding rotary degrees of freedom will also be considered without changing the notation of the introduced variables, for example, in the case study of the two-inertia system presented in section IV. Clearly, the parameters m, M, d, D, f and F are the motor and load masses, damping and Coulomb friction coefficients respectively. We will also denote the known invertible mapping (u − τ ) 7→ xm by Gm and τ 7→ xL by GL . Here, we explicitly avoid any notations of the transfer function since the dynamics of (1) and (2) include also the nonlinear terms of Coulomb friction. Using the nonlinear function g(·), where parameters are unknown but the structure may be assumed, we will elucidate the force transmission characteristics of the link. " " " ! u " " " Gm xm ! g #! " GL " xL " " Fig. 2. Block diagram of two-mass system with backlash in the link. Commonly, the link is excited by the relative displacement δ = xm − xL (3) between the motor and load. We assume that the link transfer characteristics offer a relatively high but finite stiffness, and incorporate a backlash connected in series. Under high stiffness conditions we detect and identify the first resonance peak of the measurable frequency range which is sufficiently beyond the input frequencies and control bandwidth of the system. We assume that the backlash itself is sufficiently damped so that the relative displacement between the ”impact pair” is 3 not subject to any long-term oscillations when the mechanics engage. Here, we recall that the simplest modeling approach for the backlash in two-mass systems, used for instance in [12], [14], applies the dead-zone operator only to δ , while the deadzone output is subsequently gained from the stiffness coefficient of the link. This arrangement results in proper backlash behavior at lower frequencies but tends to produce spurious δ oscillations at higher harmonics. More detailed consideration of the backlash in two-mass systems incorporates a nonlinear damping at impact [8], for which advanced impact models can be found, e.g., in [27], [28]. Note also that in [19], an inelastic impact was considered when the backlash gap was closed, and the switching case distinction for gap and contact modes was made (compare further with eq. (4)). The above assumption of sufficient backlash damping allows a simple structural transformation of the block diagram shown in Fig. 2 to be made. Assuming rigid coupling at the backlash contacts and loss-of-force transmission at the backlash gap, an equivalent model can be obtained, as shown in Fig. 3. Obviously, the consideration of the backlash element in Fig. 3 is purely kinematic, so that an ideal play-type hysteresis [29], [30] is assumed between the motor and load displacements. The kinematic backlash, which is the Prandtl-Ishlinskii operator of the play type, can be written in differential form  ẋm if xL = xm − β , ẋm > 0 ,     ẋ m if xL = xm + β , ẋm < 0 , ẋL = (4)  0 if xm − β < xL < xm + β ,    0 otherwise , as in [9], [31], where the total gap is 2β . Note that the backlash acts as a structure-switching nonlinearity xL = P[xm ], so that two operational modes are distinguished. The first mode is within the backlash gap, i.e., when |δ | < β , implies zero feedback of the G−1 L dynamics. The second mode, is during mechanics engagement, i.e., |δ | = β provides the feedback coupling by G−1 L , so that the system performs as a single mass with lumped parameters (m+M) and (d +D). During the switching between modes the play operator (4) becomes nondifferentiable. That is, the first time-derivative of the P-output to an inherently C 2 -smooth motor position input contains step discontinuities. Correspondingly, the second time-derivative constitutes the weighted delta impulses, in terms of the distribution theory. These impulses can be interpreted as an instantaneous impact force τ which excites the motor dynamics when the backlash switches between gap and engagement, and vice versa. We should stress that this switching mechanism does not explicitly account for the link stiffness and damping at impact, as previously mentioned. However, this is not critical at lower frequencies, since the link stiffness is assumed to be sufficiently high, and the motor and load dynamics are subject to viscous and Coulomb friction damping; see (1) and (2). Also we note that the hybrid approach, with a switching structure for the gap and engagement, was also used in [32] for modeling and control of mechanical systems with backlash. A significant feature of the equivalent model shown in Fig. 3 is that it allows the two-mass system with backlash to be considered as a single closed loop, while assuming that only GL ! u ! xm xL Gm Fig. 3. Equivalent block diagram for modeling the two-mass system with backlash described by the play-type hysteresis operator. the motor-side measurement is available. This is the decisive property we will make use of when identifying backlash using one-side sensing of the two-mass system. It should be recalled that the loop is closed during the engagement mode and open during the gap mode of the backlash. This results in an impulsive behavior during mode switching. Therefore, the motor dynamics are disturbed periodically when a controllable stable limit cycle occurs. We analyze this situation further in section III-C. III. D ELAYED R ELAY F EEDBACK The proposed backlash identification is based on the delayed relay in the feedback of the motor velocity. Consider the relay feedback system as shown in Fig. 4. Note that the structure represents our system, as introduced in section II, when operating in the backlash gap mode, i.e., y = 0. From the point of view of a control loop with relay, the switching feedback force (see Fig. 3) can be seen as an exogenous signal y. The non-ideal relay, also known as a hysteron [29], switches between two output values ±h, while the switching input is ”delayed” by the predefined threshold values ±e. Therefore 2e is the relay width, corresponding to the size of the hysteron, and h is the amplification gain of the relay operator. The hysteron with input z is defined, according to [33], as: h  i H(t) = h min sign(z + e), max H(t− ), sign(z − e) , (5) while its initial state at t0 is given by (  h sign z(t0 ) , if z(t0 ) ∈ (−∞, −e] ∨ [e, ∞), H(t0 ) = {−h, +h}, otherwise. (6) It can be seen that the hysteron has a memory of the previous state at t − and keeps its value as long as z ∈ (−e, e). In the following, we will first assume that the relay feedback system from Fig. 4 is self-sustaining, i.e., without a disturbing factor, i.e., y = 0. Subsequently, in sections III-B and III-C we will allow for y 6= 0 and analyze the resulting behavior while approaching the proposed strategy of backlash identification. Note that y 6= 0 corresponds to the engagement mode of the backlash, with reference to our original system from Fig. 3. A. Symmetric Unimodal Stable Limit Cycle It is well known that relay feedback systems can possess a stable limit cycle [34]. For a single-input-single-output (SISO) 4 are matched operators of one and the same argument ẋm . Both are discrete switching operators, so that y xm Gm h> f u is required for the relay to overcome the Coulomb friction. It is essential that the velocity sign changes while the (delayed) relay simultaneously keeps its control value. For the boundary case f < h → f , the relay feedback system with, e.g., H < 0 becomes mẍm = −d ẋm + 2 f after the velocity sign changes from positive to negative. Based on this, the condition for the relay threshold results in linear time invariant (LTI) system we write = Ax + Bu, z = Cx, (7) (8) assuming the n × n system matrix A is a Hurwitz matrix, and assuming that the input and output coupling vectors B and C satisfy CB > 0. When a relay u = −H[z] closes the feedback loop, the state space obtains two parallel switching surfaces which partition the state space into the corresponding cells. For H > 0, the system dynamics is given by ẋ = Ax − Bh, and for H < 0 by ẋ = Ax + Bh, while the total amplitude of the relay switching is 2h, see (5). If the relay in (5) is non-ideal, i.e., e > 0, then the existence of a solution of (7) and (8) with relay (5) in feedback is guaranteed [35], and the state trajectory will reach one of the switching surfaces for an arbitrary initial state. The necessary condition for globally stable limit cycles of the relay feedback system with a relay gain h, is given by CA−1 Bh + e < 0, (9) (compare with [35]). Otherwise, a trajectory starting at A−1 BH would not converge to the limit cycle. In the following, we describe the most significant characteristics of the stable limit cycles of the relay feedback system as shown in Fig. 4, based on the above assumptions and conditions from the literature. For more details on the existence and analysis of limit cycles in relay feedback systems we refer to [34]–[36]. The limit cycle existence condition in control systems with backlash and friction has also been studied in [37]. Considering the motor velocity dynamics (1), first without Coulomb friction, and the relay (5) in negative feedback, the condition for stable limit cycles (9) becomes e< h . d 2f , (12) d while following the same line of development as that for deriving (10) from (9). Note that all three conditions (10)(12) should hold, in order to guarantee the existence of a stable limit cycle once the Coulomb friction is incorporated. For determining the position amplitude of the limit cycles whose velocity amplitude is 2e by definition, consider the state trajectories of the system mẍm + d ẋm + f sign(ẋm ) = −h. The corresponding initial velocity is e, immediately after the relay switches down to −h. It can easily be shown that the associated phase portrait of state trajectories is given by e< xm = − −0.5mẋ2m . d ẋm + h + f sign(ẋm ) (13) Solving (13) for three characteristic velocities ẋm = {e, 0, −e} the start, maximal and minimal positions of a limit cycle are obtained –x3, x4, and x2 respectively –as shown in Fig. 5. Note that in the case of d, f = 0, the points x2 and e m Fig. 4. Relay feedback system with motor dynamics in the loop. dx /dt t ẋ (11) 0 −e x1 x2 x x3 x4 m Fig. 5. Symmetric unimodal limit cycle. (10) In fact, the velocity threshold |e| should be first reachable for a given system damping and excitation force provided during the last switching of the relay. Therefore, (10) specifies the boundaries for parameterization of the relay, in order to ensure that the trajectory reaches one of the switching surfaces ±e independently of the initial state. In cases where the motor damping is not well known, its upper bound can be assumed, thus capturing the ”worst case” of an overdamped system. Once the Coulomb friction contributes equally in (1), the condition in (10) becomes a necessary but not sufficient condition. Obviously, sufficient conditions should relate the motor Coulomb friction coefficient f to the relay, as in (5), since both x3 coincide with each other. Since the symmetric relay (5) induces a symmetric unimodal limit cycle, the second halfcycle can be obtained by mirroring the first one, derived using (13); once across the axis connecting both switching points at ±e and once across the orthogonal axis going through its center (see Fig. 5). The intersection of the axes constitutes the origin of the limit cycles, which is the manifold {xm , | ẋm = 0}. Obviously, the xm coordinate depends on the initial conditions and the system excitation. We also recall that the limit cycle is symmetric if ξ (t + t ∗ ) = −ξ (t) where ξ (t) is a nontrivial periodic solution of (5)-(8) with period 2t ∗ . The limit cycle is also called unimodal when it switches only twice per period; see [35] for details. The symmetry and 5 unimodality of the limit cycle, as depicted in Fig. 5, implies that x4 − x3 = x2 − x1. Therefore the total position amplitude, denoted by Xξ , becomes 2(x4 − x3) + (x3 − x2). Evaluating x2, x3, x4 points, computed by (13), yields Xξ = − e2 h m . ( f + h + d e)( f − h + d e) xm xe xs e xm (14) For determining the period of the limit cycle, the same differential equation mẍm + d ẋm + f sign(ẋm ) = −h is solved with respect to time, together with those for the initial and final values ẋm (0) = e and ẋm (t ∗ ) = −e respectively. This yields  f + h i de  mh  + ln . (15) t ∗ = − ln 1 + d f −h f +h+de B. Drifting Limit Cycle In the previous subsection, the conditions for a unimodal limit cycle of the system as shown in Fig. 4 were derived, and the characteristic features in terms of the displacement amplitude and period, were given by (14) and (15). We note that the limit cycle can appear within the gap mode of backlash, (see section II), provided Xξ < 2β , so that the motor dynamics and load remain decoupled (compare with Fig. 3). In order to realize a drifting limit cycle, consider a modified relay from (5) and (6) so that the amplitude becomes  α+ h0 , if sign(H) > 0, h= (16) α− h0 , if sign(H) < 0. Here, h0 is the amplitude of the underlying symmetric relay (5) and (6), and α+ , α− ≥ 1 with α+ 6= α− scales this, so as to provide an unbalanced control effort when switching. This leads to differing acceleration and deceleration phases of the limit cycle, so that the trajectory does not close after one period (compare with Fig. 5), and becomes continuously drifting as in the example shown in Fig. 6. Note that the case where α− > α+ is illustrated here. As in section III-A, one can solve the trajectories between two consecutive switches separately for α− h0 and α+ h0 , and obtain the relative shift XC = xe − xs of the limit cycle per period as follows: −e2 h20 m(α−2 − α+2 ) ( f + d e) . (−α−2 h20 + d 2 e2 + 2de + f 2)(−α+2 h20 + d 2e2 + 2de + f 2) (17) Following the same line of developments as in section III-A, the period of the drifting limit cycle, i.e., the time of arrival at xe can be obtained, according to: f + de − α−h0 m f + α− h0 + ln + TC = − ln d f + de + α−h0 f − α− h0 f + α+ h0 f + de − α+h0  + ln + ln (18) f + de + α+h0 f − α+ h0 XC = Obviously, the average drifting velocity of the limit cycle can be computed from (17) and (18) as ẊC ≈ XC /TC . Note that (17) and (18) characterize the drifting limit cycle which proceeds within the backlash gap without impact with the load side. The impact behavior of drifting limit cycles is addressed below, from the associated relative load displacement point of view. e XC Fig. 6. Drifting limit cycle of amplitude-asymmetric relay (α− > α+ ) C. Impact Behavior at Limit Cycles In order to analyze the impact behavior at limit cycles, i.e., the situation where the load side is permanently shifted, as it is periodically excited by the drifting limit cycle, consider first the impact phenomenon of two colliding masses m and M. Note that when considering the impact and the engagement mode of the backlash, the conditions (10)-(12) are not explicitly re-evaluated due to nontrivial (and also possibly chaotic) explicit solutions. However, making some smooth assumptions below, we evaluate the impact behavior at the limit cycles and show their persistence within numerical simulations and later in experiments. Introducing the coefficient of restitution 0 ≤ ε ≤ 1 and denoting the velocities immediately after impact by the superscript ”+ ” one can show that ẋL (1 − ε )M + ẋm (m − ε M) , (19) M+m ẋL (M − ε m) + ẋm (1 + ε )m ẋ+ = . (20) L M+m The above velocity jumps directly follow from Newton’s law and the conservation of momentum. See, e.g., [20] for details. Recall that a zero coefficient of restitution means a fully plastic collision, while ε = 1 constitutes the ideal elastic case. For the relatively low velocities at impact (since small backlash gaps are usually assumed) and stiff (metallic) backlash structures, we take ε ≈ 1 (compare with [27]). Further, we assume the load velocity to be zero and the motor velocity amplitude to be (in the worst case) maximal, i.e., max |ẋm | = e, immediately before the impact. Due to above assumptions, the load velocity (20) after impact can be determined as an upper bound: 2me . (21) ẋ¯+ L = M+m Note that (21) constitutes an ideal case without any structural and frictional damping at impact, whereas a real load velocity after impact will generally be lower in amplitude than (21). Nevertheless, (21) provides a reasonable measure of the relative load motion immediately after the backlash engages. Solving the unidirectional motion M ẍL + DẋL + F = 0, which, for zero final velocity and an initial motion given by (21), yields the relative displacement of the load in the idle state as  2M e m F(M + m) FM  + . (22) XL = 2 ln D F(M + m) + 2D e m D(M + m) ẋ+ m = 6 nor stiction of the load is taken into account. Thus, in a real two-mass system with backlash, a nonuniform motion during engagement mode is expected to differ markedly from that within the backlash gap, (see the experiments in section IV). −3 x 10 gap mode engagement mode 0 xm, xL (−) Intuitively, assuming well-damped (through F and D) load dynamics, the load displacement XL due to a single impulse at the impact should be relatively low. At the same time, it can be seen that the logarithmic contribution with negative sign in the first summand of (22) is balanced by the linear increase of the second summand, depending on the parameter e. In the sum, the quadratic shape of XL as a function of e occurs at lower values of e, and it approaches a linear slope once e grows (see Fig. 7). Hence, the e parameter should be kept as low-valued as possible, given the system parameters m, M, D and F. This will ensure a displacement of the load which is as low as possible, i.e., XL → 0, induced by the single impulse at impact. Furthermore, low values of e are required firstly to fulfill the necessary and sufficient conditions (10) and (12) of the limit cycle, and secondly to keep the amplitude as low as possible and therefore within the backlash gap (see (14)). −2 −4 −6 0 motor load 0.1 0.2 time (s) 0.3 Fig. 8. Motor and load displacement during the gap and engagement modes. X L IV. E XPERIMENTAL C ASE S TUDY 0 0 e Fig. 7. Relative displacement of the load after the backlash impact as a function of the relay parameter e according to (22); qualitative example. Obviously, the maximal load displacement (22) will be induced periodically by the drifting limit cycle, (see section III-B), each time the impact occurs. In fact, the motor side, which is moving in a drifting limit cycle, produces a sequence of impulses that continuously ”push” the load side once the instantaneous impulse can overcome the system stiction. The resulting load motion, though periodic due to the drifting limit cycle, can be rather chaotic, due to the amplitude and phase shifts produced by the series of impulses. Due to the inherent uncertainties of the Coulomb friction, viscous damping [38] and non-deterministic system stiction, an exact (analytic) computation of the resulting load motion appears to be only marginally feasible, with unsystematic errors that reveal the predicted trajectory as less credible. At the same time, it can be shown that for the h amplitude selection to be close to f + F, a continuous propulsion of the load should occur in the direction of ẊC . An example of a numerical simulation of the system (1) and (2) with backlash and an asymmetric relay (5), (6) and (16) in feedback, is shown in Fig. 8. It can be seen that the motor displacement exhibits a uniform drifting limit cycle during the gap mode, until it reaches the backlash boundary and begins to interact with the load side. It is evident that the average drifting velocity of the limit cycle ẊC , corresponding to the slope in Fig. 8, differs between the gap and engagement modes. This makes the backlash boundary easily detectable based on the motor displacement trajectory only. Note that in the numerical simulation shown, neither damping uncertainties This section is devoted to an experimental case study on detecting and identifying backlash in a two-inertia system, using only motor-side sensing. The parameters of linear system dynamics, i.e., inertia and damping, are first identified from the frequency response function. The total Coulomb friction level required for the analysis of stable limit cycles (see section III), is estimated using simple unidirectional motion experiments. In addition, the steady limit cycles previously analyzed are induced and confirmed with experiments for unconstrained operation within the backlash gap. The nominal backlash size was measured by means of both motor-side and load-side encoders and used as a reference for identification. The proposed backlash identification approach, as described in section III, was followed and evaluated in the laboratory setup. In addition, the reference method [12] was evaluated experimentally for two different excitation conditions and compared with the proposed method. A. Laboratory Setup An experimental laboratory setup (see picture in Fig. 9), consisting of two identical motors, each with a 20-bit highresolution encoder, was used in this study. Note that only Fig. 9. Experimental setup with a gear coupling. the motor-side encoder is utilized for the required system identification and for evaluation of the proposed backlash 7 estimation method. The load-side encoder is used for reference measurements only. In this setup, the backlash can be added or removed by replacing the rigid coupling with the gear coupling shown in the picture. A standard proportional-integral (PI) current controller is implemented on-board with the motor amplifier, with a bandwidth of 1.2 kHz. In the experiments, the sampling frequency is set to 2.5 kHz and the control parts are discretized using the Tustin method. B. System Identification 1) Two-Mass System Parameters: The parameters of the two-mass system, i.e., m, d, M and D, can be identified by measuring the frequency response function (FRF) on the motor side. It is worth emphasizing that the identified motor inertia and damping are sufficient for analyzing and applying the proposed backlash identification approach. Thus, if the above parameters are available or otherwise previously identified, the FRF-based identification discussed below will not be required. The measured frequency characteristics shown in Fig. 10, show the antiresonance and resonance behavior. The 0 -50 -100 -150 101 102 103 102 103 0 -200 -400 -600 101 The measured FRF shows that the setup can be modeled as a two-mass system which has an antiresonance frequency of 409 Hz and a resonance frequency of 583 Hz. The fitted model response is indicated in Fig. 10 by the blue solid line, while the measurement results are indicated by the red dashed line. A visible discrepancy in the phase response is due to an inherent time delay in the digital control system. However, this becomes significant in a higher frequency range. The identified parameters are listed in Table I. 2) Coulomb Friction: The combined motor-side and loadside Coulomb friction f + F is identified by measuring the motor torque when the motor-side velocity is controlled for constant reference values. Figure 11 shows the obtained torque-velocity measurements. Blue circles indicate the measured data, captured from multiple constant velocity drive experiments, and the red line indicates the linear slope fitted by the least-squares method. Here, the Coulomb friction torque of 0.1 Nm is determined from the intercept of the fitted line with the torque axis. In the same way, the friction-velocity curve is determined for the negative velocity range, not shown here due to its similarity. The determined Coulomb friction value is −0.0993 Nm which demonstrates that the friction behavior of the total drive is sufficiently symmetrical around zero. An average value of f + F = 0.0999 Nm is further assumed, while a very rough estimation of the motor-side Coulomb friction is half of the total value, i.e., f ≈ 0.05 Nm. Note that an exact knowledge of f is not required to satisfy the conditions derived in section III. Knowledge of the total Coulomb friction coefficient f + F alone is sufficient for applying the relay feedback system. 0.135 0.13 Fig. 10. Frequency characteristics measurements of the setup from the motor torque to the motor-side angle versus the fitted two-mass system model. 0.125 0.12 0.115 TABLE I I DENTIFIED PARAMETERS OF TWO - MASS SYSTEM . 2 Motor-side inertia m 8.78e-4 kgm Motor-side damping coefficient d 6.20e-2 Nms/rad Load-side inertia M 8.78e-4 kgm2 Load-side damping coefficient D 3.60e-2 Nms/rad 0.11 0.105 2 parameters of the two-mass (two-inertia) system are identified by fitting both peak regions. Here, the frequency characteristics from the motor torque to the motor-side angle are determined for the setup equipped with rigid coupling (without backlash). This corresponds to the case of a nominal plant where no backlash disturbance develops during the operation. Note that for a sufficient system excitation, similar FRF characteristics can also be obtained in the presence of a small backlash. Otherwise, the basic parameters, such as lumped mass and damping of the motor and load sides, are assumed to be available from the manufacturer’s data sheets and additional design or manufacturing data. 3 4 5 6 7 8 9 10 11 12 Fig. 11. Friction-velocity identification measurements. 3) Nominal Backlash Size: For evaluation of the proposed method, the nominal backlash size is first identified using both the motor- and load-side encoders. Figure 12 shows the measured (xm , xL ) map when the motor-side position is open-loop controlled by a low-amplitude and low-frequency sinusoidal wave. The detected backlash is 2β = 19.05 mrad, which can be seen as a low value, i.e., below one degree. It should be emphasized that when the motor is moving forwards after a negative direction reversal, the load side is at first moving together with the motor side, even though both are within the backlash gap (see the lower left-hand range in Fig. 12). This spurious side-effect can be explained by adhesion between the motor and load sides and the specific structure 8 10 5 0 -5 -10 -10 -5 0 5 10 15 20 25 Fig. 12. Nominal backlash identified using both encoders. of the gear coupling. Since the gear coupling used in the setup consists of an internal tooth ring and two external tooth gears, it exhibits, so to speak, a double backlash, which cannot be exactly captured by the standard modeling assumptions previously made for a two-mass system with backlash. It is evident that the forward transitions, as depicted in Fig. 12 and further in Fig. 16 and Fig. 17, exhibit some nondeterministic creep-like behavior that cannot be attributed to backlash nonlinearity as assumed. Therefore, in order to be able to consider the backlash effect without adhesive disturbances, only the backward-moving phases are regarded as suitable for evaluation. delay of the control system so that the actual switchings do not occur exactly at ±e = ±0.1 rad/sec as required by the relay parameterization. Rather, they appear at ±0.2 rad/sec, which is double the set relay parameter value e. Nevertheless, the limit cycle remains stable, almost without drifting, and displays the expected characteristic shape as shown in Fig. 5. Here, we note that the gear coupling with backlash was installed, so that the steady limit cycle as shown in Fig. 13 clearly occurs within the backlash gap, without impact with the load side. The halfperiod t ∗ , determined from the measurements, corresponds to about six or seven samplings, i.e., 2.4 to 2.8 msec, and is in accordance with that computed by (15). Recall that knowledge of t ∗ is significant for deciding the sufficiency of the sampling rate with regard to the relay control parameters. D. Motor-Side Backlash Identification The proposed backlash identification method is implemented and evaluated experimentally. The results are evaluated for two different sets of relay parameters. The two cases are defined as follows. Case 1: h0 =0.12, e=0.1, α = 2, and Case 2: h0 =0.1, e=0.1, α = 2.5. The α values are selected by trial and error when operating the feedback relay system and observing sufficient movement (drift) of the resulting limit cycle (see Fig. 8). Note that a periodic sequence for which the relay asymmetry coefficients α+ and α− alternate, for example, [α+ , α− ] = [2, 1] for the first five seconds followed by [α+ , α− ] = [1, 2] for the next five seconds, and so on, has been applied. This allows for changing the drift direction of the limit cycles, C. Steady Limit Cycle As described in Section III-A, the delayed relay feedback produces steady limit cycles. The experimentally measured cycle is shown in Fig. 13. The assumed relay parameters 15 10 5 0.3 0 0.2 -5 0.1 -10 0 -15 0 2 4 6 8 10 12 14 16 18 20 -0.1 -0.2 Fig. 14. Backlash identification using the proposed method, Case 1. -0.3 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 Fig. 13. Steady limit cycle caused by delayed relay feedback. h = 0.1 and e = 0.1 satisfy (10)-(12). The total amplitude Xξ of the limit cycle is required to be small compared to the backlash size. In addition, the period of the limit cycle 2t ∗ is required to be large enough, with respect to the sampling rate, so as to ensure a sufficient number of samples per period of the limit cycle. The values computed according to (14) and (15) are Xξ = 0.128 mrad and t ∗ = 2.45 msec respectively. The average Xξ value, determined from the example measurements shown in Fig. 13, is about 0.28 mrad. This is not surprising, since the measured steady limit cycle is subject to the time and therefore exploring the backlash gap in both directions as well as beyond the gap, i.e., during the engagement mode. As stated in section IV-B, only the backward-moving phases are evaluated in order to estimate the backlash without adhesion side-effects. The motor position responses in Case 1 and Case 2 are shown in Fig. 14 and Fig. 15 respectively. The full backlash width 2β can be determined by the sudden change of the motor position’s slope. The slope of the motor position is steep and uniform within the backlash gap, since the load is decoupled from the motor side. When the impact between them occurs, the slope suddenly changes and becomes less steep and also irregular. The determined 2β values in Case 1 and Case 2 are 19.30 mrad and 23.62 mrad respectively, 9 limit cycles generated by the delayed relay with asymmetric amplitudes are drifting controllably along all transitions of the backlash. Only the forward-moving phases suffer from adhesion side-effects, while the backwards phases coincide exactly with the backlash shape (see Fig. 12). 25 20 15 10 5 0 E. Comparison with Reference Method -5 -10 -15 0 2 4 6 8 10 12 14 16 18 20 Fig. 15. Backlash identification using the proposed method, Case 2. while the nominal backlash width identified using the loadside encoder, as in section IV-B, is 19.05 mrad. This confirms that the proposed method can identify the backlash width using the motor-side information only. Note that the recorded motor position pattern is subject to various deviations between the slopes over multiple periods which mitigates against an exact read-off of the backlash size value (see Fig. 14 and Fig. 15). For accuracy enhancement and correspondingly better generalization, the 2β values read off over multiple periods can be averaged. Figures 16 and 17 show the corresponding 2 0 -2 -4 In order to assess the performance of the proposed method, a well-established backlash identification strategy [12] has been taken as reference method. This method also uses the motor-side information only when identifying the backlash in a two-inertia system. The basics of the reference method are described below. For more details we refer to [12], [15]. The reference method applies the triangular-wave reference velocity to the PI motor velocity controller. Considering the controlled plant as a one-inertia system, i.e., with the lumped parameters m + M and d + D, the PI velocity controller is designed by the pole placement such that its control bandwidth is set to 5 Hz. After the sign of the motor-side acceleration changes, due to the triangular velocity reference, the motor side moves back from one end to the opposite end of the backlash gap. At the same time, the load side continues to (freely) move in the initial direction until the backlash impact. The instant when the motor and load sides are decoupled is defined as t1 and the instant when the motor and load sides are in contact again is defined as t2 (see Fig. 18 and Fig. 19). The reference method identifies the backlash width by integrating the relative motor velocity between these two instants. If the load-side viscosity is small enough, and t2 −t1 is short enough, the decrease of the load-side velocity during t2 − t1 can be neglected. Therefore, one can assume ẋL (t) = ẋˆL = ẋm (t1 ) for t1 ≤ t ≤ t2 . Then, the total backlash width is estimated as -6 2β = -8 -15 -10 -5 0 5 10 15 Fig. 16. Measured xL -xm map in Case 1. 10 5 0 -5 -10 -15 -10 -5 0 5 10 15 20 25 Fig. 17. Measured xL -xm map in Case 2. (xm , xL ) maps, as a reference measurement, for both experimental cases. Recall that the load-side encoder signal is not used for backlash identification. Both figures indicate that the Zt2 t1  ẋL (t) − ẋm (t) dt ≃ Ts k2 ∑ k1  ẋˆL − ẋm (k) , (23) where Ts is the sampling time and k1t = t1 and k2t = t2 . The results from two different triangular waves are evaluated. Here, two cases are defined as Case 3 –for which the triangular wave slope is 1400 and the period is 0.2 s, and Case 4 –for which the triangular wave slope is 500 and the period is 0.4 s. Obviously, Case 3 is more ”aggressive” in terms of the system excitation, as regards the higher reference acceleration/deceleration of the total drive. Fig. 18 and Fig. 19 show the measured velocity responses of Case 3 and Case 4 respectively. Since the acceleration in Case 3 is larger than that in Case 4, the decrease in ẋL (t) for t1 ≤ t ≤ t2 is smaller, which reduces the estimation error. According to (23), the 2β values are calculated as 31.0 mrad and 42.6 mrad for Case 3 and Case 4 respectively. Inherently, the reference method provides an overestimated backlash width, as is apparent from Fig. 18 and Fig. 19. In order to reduce the estimation error, which is mainly driven by the assumption ẋL (t) = ẋˆL = ẋm (t1 ), the reference method requires larger accelerations, to make the decoupling between the motor-side and load-side faster once the sign of the motor acceleration changes. Therefore, the reference method inherently requires more ”aggressive” 10 70 65 60 55 50 45 40 0.07 0.08 0.09 0.1 0.11 0.12 0.13 Fig. 18. Backlash identification using the reference method, Case 3. 55 for inducing the stable limit cycles of amplitudes significantly lower than the backlash gap. The limit cycles can then be operated as drifting while being controlled by an asymmetric relay amplitude. We provide a detailed analysis of steady and drifting limit cycles for two-mass systems with backlash, and derive the conditions for the minimal set of system parameters which can be easily identified. The experimental evaluation of the method is performed on a test bench with two coupled motors, where the rigid coupling is replaceable by one with a small backlash gap of about one degree. The known identification method reported in [12] is taken as a reference for comparison. Several advantages of the proposed method, in terms of less aggressive system excitations and no need for high-speed motions of the overall two-mass system, are shown and discussed along with the experimental results. 54 R EFERENCES 53 52 51 50 49 48 47 46 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 Fig. 19. Backlash identification using the reference method, Case 4. system excitations and generally larger load inertias to allow for a free, correspondingly decoupled, load motion phase. At the same time, higher and uncertain damping and Coulomb friction values will lead to higher errors when estimating 2β according to (23). The backlash identification results for all four cases, i.e., Case 1 and Case 2 for the proposed method, and Case 3 and Case 4 for the reference method, are summarized in Table II, while the nominal backlash size was measured as 19.05 mrad. TABLE II BACKLASH IDENTIFICATION RESULTS SUMMARY Case 1 Case 2 Case 3 Case 4 19.3 mrad 23.6 mrad 31.0 mrad 42.6 mrad V. C ONCLUSIONS A new approach for identifying the backlash in two-mass systems is proposed, with the principal advantage of using the motor-side sensing only, which is a common practice for various machines and mechanisms. The method is based on the delayed relay in feedback of the motor velocity, which allows [1] M. Nordin and P.-O. Gutman, “Controlling mechanical systems with backlash a survey,” Automatica, vol. 38, no. 10, pp. 1633–1649, 2002. [2] J.-L. Dion, S. Le Moyne, G. Chevallier, and H. Sebbah, “Gear impacts and idle gear noise: Experimental study and non-linear dynamic model,” Mech. Syst. and Sign. Process., vol. 23, no. 8, pp. 2608–2628, 2009. [3] T. Tjahjowidodo, F. Al-Bender, and H. Van Brussel, “Quantifying chaotic responses of mechanical systems with backlash component,” Mech. Syst. and Sign. Process., vol. 21, no. 2, pp. 973–993, 2007. [4] G. Tao and P. V. Kokotovic, “Continuous-time adaptive control of systems with unknown backlash,” IEEE Transactions on Automatic Control, vol. 40, no. 6, pp. 1083–1087, 1995. [5] T. Hägglund, “Automatic on-line estimation of backlash in control loops,” Journal of Process Control, vol. 17, no. 6, pp. 489–499, 2007. [6] G. Brandenburg, H. Unger, and A. Wagenpfeil, “Stability problems of a speed controlled drive in an elastic system with backlash and corrective measures by a load observer,” in International conference on electrical machines, 1986, pp. 523–527. [7] Y. Hori, H. Iseki, and K. Sugiura, “Basic consideration of vibration suppression and disturbance rejection control of multi-inertia system using sflac (state feedback and load acceleration control),” IEEE Transactions on Industry Applications, vol. 30, no. 4, pp. 889–896, 1994. [8] J. C. Gerdes and V. Kumar, “An impact model of mechanical backlash for control system analysis,” in American Control Conference, vol. 5, 1995, pp. 3311–3315. [9] M. Ruderman, F. Hoffmann, and T. Bertram, “Modeling and identification of elastic robot joints with hysteresis and backlash,” IEEE Trans. on Industrial Electronics, vol. 56, no. 10, pp. 3840–3847, 2009. [10] T. K. Morimoto, E. W. Hawkes, and A. M. Okamura, “Design of a compact actuation and control system for flexible medical robots,” IEEE Robotics and Automation Letters, vol. 2, no. 3, pp. 1579–1585, 2017. [11] D. Gebler and J. Holtz, “Identification and compensation of gear backlash without output position sensor in high-precision servo systems,” in IEEE 24th Annual Conference of the Industrial Electronics Society (IECON’98), 1998, pp. 662–666. [12] S. Villwock and M. Pacas, “Time-domain identification method for detecting mechanical backlash in electrical drives,” IEEE Trans. on Industrial Electronics, vol. 56, no. 2, pp. 568–573, 2009. [13] A. Lagerberg and B. Egardt, “Backlash estimation with application to automotive powertrains,” IEEE Transactions on Control Systems Technology, vol. 15, no. 3, pp. 483–493, 2007. [14] S. Yamada and H. Fujimoto, “Proposal of high backdrivable control using load-side encoder and backlash,” in IEEE 42nd Annual Conference of Industrial Electronics Society (IECON2016), 2016, pp. 6429–6434. [15] A. Tustin, “The effects of backlash and of speed-dependent friction on the stability of closed-cycle control systems,” Journal of the Institution of Electrical Engineers - Part IIA: Automatic Regulators and Servo Mechanisms, vol. 94, pp. 143–151, 1947. [16] R. Merzouki, J. Davila, L. Fridman, and J. Cadiou, “Backlash phenomenon observation and identification in electromechanical system,” Control Engineering Practice, vol. 15, no. 4, pp. 447–457, 2007. [17] T. Tjahjowidodo, F. Al-Bender, and H. Van Brussel, “Experimental dynamic identification of backlash using skeleton methods,” Mech. Syst. and Sign. Process., vol. 21, no. 2, pp. 959–972, 2007. 11 [18] A. Lichtsinder and P.-O. Gutman, “Closed-form sinusoidal-input describing function for the exact backlash model,” IFAC-PapersOnLine, vol. 49, no. 18, pp. 422–427, 2016. [19] M. Nordin, J. Galic’, and P.-O. Gutman, “New models for backlash and gear play,” International journal of adaptive control and signal processing, vol. 11, no. 1, pp. 49–63, 1997. [20] R. S. Barbosa and J. T. Machado, “Describing function analysis of systems with impacts and backlash,” Nonlinear Dynamics, vol. 29, no. 1, pp. 235–250, 2002. [21] M. Yang, S. Tang, J. Tan, and D. Xu, “Study of on-line backlash identification for pmsm servo system,” in IECON 38th Annual Conference on IEEE Industrial Electronics Society (IECON), 2012, pp. 2036–2042. [22] A. A. Andronov and S. Khajkin, Theory of oscillations. Princeton Univ Press, 1949. [23] J. F. Mullin and I. E. Jury, “A phase-plane approach to relay sampleddata feedback systems,” Transactions of the American Institute of Electrical Engineers, Part II: Applications and Industry, vol. 77, no. 6, pp. 517–524, 1959. [24] C. Hang, K. Astrom, and Q. Wang, “Relay feedback auto-tuning of process controllers a tutorial review,” Journal of process control, vol. 12, no. 1, pp. 143–162, 2002. [25] T. Mizuno, T. Adachi, M. Takasaki, and Y. Ishino, “Mass measurement system using relay feedback with hysteresis,” Journal of System Design and Dynamics, vol. 2, no. 1, pp. 188–196, 2008. [26] Y. Han, C. Liu, and J. Wu, “Backlash identification for pmsm servo system based on relay feedback,” Nonlinear Dynamics, vol. 84, no. 4, pp. 2363–2375, 2016. [27] K. Hunt and F. Crossley, “Coefficient of restitution interpreted as damping in vibroimpact,” Journal of Applied Mechanics, Trans. ASME, vol. 42, no. 2, pp. 440–445, 1975. [28] H. M. Lankarani and P. E. Nikravesh, “Continuous contact force models for impact analysis in multibody systems,” Nonlinear Dynamics, vol. 5, no. 2, pp. 193–207, 1994. [29] A. Visintin, Differential models of hysteresis. Springer, 1994. [30] P. Krejci, Hysteresis, Convexity and Dissipation in Hyperbolic Equations. Tokyo: Gattötoscho, 1996. [31] 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. [32] P. Rostalski, T. Besselmann, M. Barić, F. V. Belzen, and M. Morari, “A hybrid approach to modelling, control and state estimation of mechanical systems with backlash,” International Journal of Control, vol. 80, no. 11, pp. 1729–1740, 2007. [33] M. Ruderman and M. Iwasaki, “Observer of nonlinear friction dynamics for motion control,” IEEE Transactions on Industrial Electronics, vol. 62, no. 9, pp. 5941–5949, 2015. [34] K. J. Åström, “Oscillations in systems with relay feedback,” in Adaptive Control, Filtering, and Signal Processing, 1995, pp. 1–25. [35] J. M. Gonçalves, A. Megretski, and M. A. Dahleh, “Global stability of relay feedback systems,” IEEE Transactions on Automatic Control, vol. 46, no. 4, pp. 550–562, 2001. [36] K. H. Johansson, A. Rantzer, and K. J. Åström, “Fast switches in relay feedback systems,” Automatica, vol. 35, no. 4, pp. 539–552, 1999. [37] A. Lichtsinder and P.-O. Gutman, “Limit cycle existence condition in control systems with backlash and friction,” IFAC Proceedings Volumes, vol. 43, no. 14, pp. 469–474, 2010. [38] M. Ruderman, “Computationally efficient formulation of relay operator for Preisach hysteresis modeling,” IEEE Transactions on Magnetics, vol. 51, no. 12, pp. 1–4, 2015.
3cs.SY
Sequence-Length Requirement of Distance-Based Phylogeny Reconstruction: Breaking the Polynomial Barrier∗ Sébastien Roch† arXiv:0908.2061v1 [math.PR] 14 Aug 2009 February 22, 2018 Abstract We introduce a new distance-based phylogeny reconstruction technique which provably achieves, at sufficiently short branch lengths, a polylogarithmic sequence-length requirement—improving significantly over previous polynomial bounds for distance-based methods. The technique is based on an averaging procedure that implicitly reconstructs ancestral sequences. In the same token, we extend previous results on phase transitions in phylogeny reconstruction to general time-reversible models. More precisely, we show that in the so-called Kesten-Stigum zone (roughly, a region of the parameter space where ancestral sequences are well approximated by “linear combinations” of the observed sequences) sequences of length poly(log n) suffice for reconstruction when branch lengths are discretized. Here n is the number of extant species. Our results challenge, to some extent, the conventional wisdom that estimates of evolutionary distances alone carry significantly less information about phylogenies than full sequence datasets. Keywords: Phylogenetics, distance-based methods, phase transitions, reconstruction problem. ∗ The current manuscript is the full version with proofs of [Roc08]. In subsequent work [Roc09] the results stated here were improved to logarithmic sequence length, thereby matching the best results for general methods. † Department of Mathematics, UCLA. 1 Introduction The evolutionary history of a group of organisms is generally represented by a phylogenetic tree or phylogeny [Fel04, SS03]. The leaves of the tree represent the current species. Each branching indicates a speciation event. Many of the most popular techniques for reconstructing phylogenies from molecular data, e.g. UPGMA, Neighbor-Joining, and BIO-NJ [SS63, SN87, Gas97], are examples of what are known as distance-matrix methods. The main advantage of these methods is their speed, which stems from a straightforward approach: 1) the estimation of a distance matrix from observed molecular sequences; and 2) the repeated agglomeration of the closest clusters of species. Each entry of the distance matrix is an estimate of the evolutionary distance between the corresponding pair of species, that is, roughly the time elapsed since their most recent common ancestor. This estimate is typically obtained by comparing aligned homologous DNA sequences extracted from the extant species—the basic insight being, the closer the species, the more similar their sequences. Most distance methods run in time polynomial in n, the number of leaves, and in k, the sequence length. This performance compares very favorably to that of the other two main classes of reconstruction methods, likelihood and parsimony methods, which are known to be computationally intractable [GF82, DS86, Day87, MV05, CT06, Roc06]. The question we address in this paper is the following: Is there a price to pay for this speed and simplicity? There are strong combinatorial [SHP88] and statistical [Fel04] reasons to believe that distance methods are not as accurate as more elaborate reconstruction techniques, notably maximum likelihood estimation (MLE). Indeed, in a typical instance of the phylogenetic reconstruction problem, we are given aligned DNA sequences {(ξli )ki=1 }l∈L , one sequence for each leaf l ∈ L, from which we seek to infer the phylogeny on L. Generally, all sites (ξli )l∈L , for i = 1, . . . , k, are assumed to be independent and identically distributed according to a Markov model on a tree (see Section 1.1). For a subset W ⊆ L, we denote by µW the distribution of (ξli )l∈W under this model. Through their use of the distance matrix, distance methods reduce the data to pairwise sequence correlations, that is, they only use estimates of µ2 = {µW : W ⊆ L, |W | = 2}. In doing so, they seemingly fail to take into account more subtle patterns in the data involving three or more species at a time. In contrast, MLE for example outputs a model that maximizes the joint probability of all observed sequences. We call methods that explicitly use the full dataset, such as MLE, holistic methods. It is important to note that the issue is not one of consistency: when the sequence length tends to infinity, the estimate provided by distance methods—just like MLE—typically converges to the correct phylogeny. In particular, under mild assumptions, it suffices to know the pairwise site distributions µ2 to recover the topology of the phylogeny [CH91, Cha96]. Rather the question is: how fast is this convergence? Or more precisely, how should k scale as a function of n to guarantee a correct reconstruction with high probability? And are distance methods significantly slower to converge than holistic methods? Although we do not give a complete answer to these questions of practical interest here, we do provide strong evidence that some of the suspicions against distance methods are based on a simplistic view of the distance matrix. In particular, we open up the surprising possibility that distance methods actually exhibit optimal convergence rates. Context. It is well-known that some of the most popular distance-matrix methods actually suffer from a prohibitive sequence-length requirement [Att99, LC06]. Nevertheless, over the past decade, much progress has been made in the design of fast-converging distance-matrix techniques, starting with the seminal work of Erdös et al. [ESSW99a]. The key insight behind the algorithm in [ESSW99a], often dubbed the Short Quartet Method (SQM), is that it discards long evolutionary distances, which are known to be statistically unreliable. The algorithm works by first building subtrees of small diameter and, in a second stage, putting the pieces back together. The SQM algorithm runs in polynomial time and guarantees the correct reconstruction with high probability of any phylogeny (modulo reasonable assumptions) when k = poly(n). This is currently the best known convergence rate for distance methods. (See also [DMR06, DHJ+ 06, Mos07, GMS08, DMR09b] for faster-converging algorithms involving partial reconstruction of the phylogeny.) 2 Although little is known about the sequence-length requirement of MLE [SS99, SS02], recent results of Mossel [Mos04], Daskalakis et al. [DMR06, DMR09a], and Mihaescu et al. [MHR09] on a conjecture of Steel [Ste01] indicate that convergence rates as low as k = O(log n) can be achieved when the branch lengths are sufficiently short and discretized, using insights from statistical physics. We briefly describe these results. As mentioned above, the classical model of DNA sequence evolution is a Markov model on a tree that is closely related to stochastic models used to study particle systems [Lig85, Geo88]. This type of model undergoes a phase transition that has been extensively studied in probability theory and statistical physics: at short branch lengths (in the binary symmetric case, up to 15% divergence per edge), in what is called the reconstruction phase, good estimates of the ancestral sequences can be obtained from the observed sequences; on the other hand, outside the reconstruction phase, very little information about ancestral states diffuses to the leaves. See e.g. [EKPS00] and references therein. The new algorithms in [Mos04, DMR06, DMR09a, MHR09] exploit this phenomenon by alternately 1) reconstructing a few levels of the tree using distancematrix techniques and 2) estimating distances between internal nodes by reconstructing ancestral sequences at the newly uncovered nodes. The overall algorithm is not distance-based, however, as the ancestral sequence reconstruction is performed using a complex function of the observed sequences named recursive majority. The rate k = O(log n) achieved by these algorithms is known to be necessary in general. Moreover, the slower rate k = poly(n) is in fact necessary for all methods—distance-based or holistic—outside the reconstruction phase [Mos03]. In particular, note that distance methods are in some sense “optimal” outside the reconstruction phase by the results of [ESSW99a]. Beyond the oracle view of the distance matrix. It is an outstanding open problem to determine whether distance methods can achieve k = O(log n) in the reconstruction phase1 . From previous work on fast-converging distance methods, it is tempting to conjecture that k = poly(n) is the best one can hope for. Indeed, all previous algorithms use the following “oracle view” of the distance matrix, as formalized by King et al. [KZZ03] and Mossel [Mos07]. As mentioned above, the reliability of distance estimates depends on the true evolutionary distances. From standard concentration inequalities, it follows that if leaves a and b are at distance τ (a, b), then the usual distance estimate τ̂ (a, b) (see Section 1.1) satisfies: if τ (a, b) < D + ε or τ̂ (a, b) < D + ε then |τ (a, b) − τ̂ (a, b)| < ε, (1) for ε, D such that k ∝ (1−e−ε )−2 e2D . Fix ε > 0 small and k  poly(n). Let T be a complete binary tree with log2 n levels. Imagine that the distance matrix is given by the following oracle: on input a pair of leaves (a, b) the oracle returns an estimate τ̂ (a, b) which satisfies (1). Now, notice that for any tree T 0 which is identical to T on the first log2 n/2 levels above the leaves, the oracle is allowed to return the same distance estimate as for T . That is, we cannot distinguish T and T 0 in this model unless k = poly(n). (This argument can be made more formal along the lines of [KZZ03].) What the oracle model ignores is that, under the assumption that the sequences are generated by a Markov model of evolution, the distance estimates (τ̂ (a, b))a,b∈[n] are in fact correlated random variables. More concretely, for leaves a, b, c, d, note that the joint distribution of (τ̂ (a, b), τ̂ (c, d)) depends in a nontrivial way on the joint site distribution µW at W = {a, b, c, d}. In other words, even though the distance matrix is— seemingly—only an estimate of the pairwise correlations µ2 , it actually contains some information about all joint distributions. Note however that it is not immediately clear how to exploit this extra information or even how useful it could be. As it turns out, the correlation structure of the distance matrix is in fact very informative at short branch lengths. More precisely, we introduce in this paper a new distance-based method with a convergence rate of k = poly(log n) in the reconstruction phase (to be more accurate, in the so-called Kesten-Stigum phase; see 1 Mike Steel offers a 100$ reward for the solution of this problem. 3 below)—improving significantly over previous poly(n) results. Note that the oracle model allows only the reconstruction of a o(1) fraction of the levels in that case. Our new algorithm involves a distance averaging procedure that implicitly reconstructs ancestral sequences, thereby taking advantage of the phase transition discussed above. We also obtain the first results on Steel’s conjecture beyond the simple symmetric models studied by Daskalakis et al. [DMR06, DMR09a, MHR09] (the so-called CFN and Jukes-Cantor models). In the next subsections, we introduce general definitions and state our results more formally. We also give an overview of the proof. Further related work. For further related work on efficient phylogenetic tree reconstruction, see [ESSW99b, HNW99, CK01, Csu02]. 1.1 Definitions Phylogenies. We define phylogenies and evolutionary distances more formally. Definition 1 (Phylogeny) A phylogeny is a rooted, edge-weighted, leaf-labeled tree T = (V, E, [n], ρ; τ ) where: V is the set of vertices; E is the set of edges; L = [n] = {0, . . . , n − 1} is the set of leaves; ρ is the root; τ : E → (0, +∞) is a positive edge weight function. We further assume that all internal nodes in T have degree 3 except for the root ρ which has degree 2. We let Yn be the set of all such phylogenies on n leaves and we denote Y = {Yn }n≥1 . Definition 2 (Tree Metric) For two leaves a, b ∈ [n], we denote by Path(a, b) the set of edges on the unique path between a and b. A tree metric on a set [n] is a positive function d : [n] × [n] → (0, +∞) such that there exists a tree T = (V, E) with leaf set [n] and an edge weight function w : E → (0, +∞) satisfying the following: for all leaves a, b ∈ [n] X d(a, b) = we . e∈Path(a,b) For convenience, we denote by (τ (a, b))a,b∈[n] the tree metric corresponding to the phylogeny T = (V, E, [n], ρ; τ ). We extend τ (u, v) to all vertices u, v ∈ V in the obvious way. Example 1 (Homogeneous Tree) For an integer h ≥ 0, we denote by T (h) = (V (h) , E (h) , L(h) , ρ(h) ; τ ) a rooted phylogeny where T (h) is the h-level complete binary tree with arbitrary edge weight function τ and (h) L(h) = [2h ]. For 0 ≤ h0 ≤ h, we let Lh0 be the vertices on level h − h0 (from the root). In particular, (h) (h) L0 = L(h) and Lh = {ρ(h) }. We let HY = {HYn }n≥1 be the set of all phylogenies with homogeneous underlying trees. Model of molecular sequence evolution. Phylogenies are reconstructed from molecular sequences extracted from the observed species. The standard model of evolution for such sequences is a Markov model on a tree (MMT). Definition 3 (Markov Model on a Tree) Let Φ be a finite set of character states with ϕ = |Φ|. Typically Φ = {+1, −1} or Φ = {A, G, C, T}. Let n ≥ 1 and let T = (V, E, [n], ρ) be a rooted tree with leaves labeled in [n]. For each edge e ∈ E, we are given a ϕ × ϕ stochastic matrix M e = (Mije )i,j∈Φ , with fixed stationary distribution π = (πi )i∈Φ . An MMT ({M e }e∈E , T ) associates a state σv in Φ to each vertex v in V as follows: pick a state for the root ρ according to π; moving away from the root, choose a state for each vertex v independently according to the distribution (Mσeu ,j )j∈Φ , with e = (u, v) where u is the parent of v. 4 The most common MMT used in phylogenetics is the so-called general time-reversible (GTR) model. Definition 4 (GTR Model) Let Φ be a set of character states with ϕ = |Φ| and π be a distribution on Φ satisfying πi > 0 for all i ∈ Φ. For n ≥ 1, let T = (V, E, [n], ρ; τ ) be a phylogeny. Let Q be a ϕ × ϕ rate matrix, that is, Qij > 0 for all i 6= j and X Qij = 0, j∈Φ for all i ∈ Φ. Assume Q is reversible with respect to π, that is, πi Qij = πj Qji , for all i, j ∈ Φ. The GTR model on T with rate matrix Q is an MMT on T = (V, E, [n], ρ) with transition matrices M e = eτe Q , for all e ∈ E. By the reversibility assumption, Q has ϕ real eigenvalues 0 = Λ1 > Λ2 ≥ · · · ≥ Λϕ . We normalize Q by fixing Λ2 = −1. We denote by Qϕ the set of all such rate matrices. We let Gn,ϕ = Yn ⊗ Qϕ be the set of all ϕ-state GTR models on n leaves. We denote Gϕ = {Gn,ϕ }n≥1 . We denote by ξW the vector of states on the vertices W ⊆ V . In particular, ξ[n] are the states at the leaves. We denote by LT ,Q the distribution of ξ[n] . GTR models include as special cases many popular models such as the CFN model. Example 2 (CFN Model) The CFN model is the GTR model with ϕ = 2, π = (1/2, 1/2), and   −1/2 1/2 CFN . Q=Q ≡ 1/2 −1/2 Example 3 (Binary Asymmetric Channel) More generally, letting Φ = {+, −} and π = (π+ , π− ), with π+ , π− > 0, we can take   −π− π− Q= . π+ −π+ Phylogenetic reconstruction. A standard assumption in molecular evolution is that each site in a sequence (DNA, protein, etc.) evolves independently according to a Markov model on a tree, such as the GTR model above. Because of the reversibility assumption, the root of the phylogeny cannot be identified and we reconstruct phylogenies up to their root. e = {Y e n }n≥1 be a subset of phylogenies and Q eϕ Definition 5 (Phylogenetic Reconstruction Problem) Let Y e be a subset of rate matrices on ϕ states. Let T = (V, E, [n], ρ; τ ) ∈ Y. If T = (V, E, [n], ρ) is the rooted tree underlying T , we denote by T− [T ] the tree T where the root is removed: that is, we replace the two edges adjacent to the root by a single edge. We denote by Tn the set of all leaf-labeled trees on n leaves with internal degrees 3 and we let T = {Tn }n≥1 . A phylogenetic reconstruction algorithm is a collection of i )k [n] k maps A = {An,k }n,k≥1 from sequences (ξ[n] i=1 ∈ (Φ ) to leaf-labeled trees T ∈ Tn . We only consider algorithms A computable in time polynomial in n and k. Let k(n) be an increasing function of n. We say that e ⊗Q e ϕ with sequence length k = k(n) if for all δ > 0, A solves the phylogenetic reconstruction problem on Y e n, Q ∈ Q e ϕ, there is n0 ≥ 1 such that for all n ≥ n0 , T ∈ Y h   i i k(n) P An,k(n) (ξ[n] )i=1 = T− [T ] ≥ 1 − δ, k(n) i ) where (ξ[n] i=1 are i.i.d. samples from LT ,Q . 5 An important result of this kind was given by Erdos et al. [ESSW99a]. Theorem 1 (Polynomial Reconstruction [ESSW99a]) Let 0 < f ≤ g < +∞ and denote by Yf,g the set of all phylogenies T = (V, E, [n], ρ; τ ) satisfying f ≤ τe ≤ g, ∀e ∈ E. Then, for all ϕ ≥ 2 and all 0 < f ≤ g < +∞, the phylogenetic reconstruction problem on Yf,g ⊗ Qϕ can be solved with k = poly(n). This result was recently improved by Daskalakis et al. [DMR06, DMR09a] (see also [MHR09]) in the so-called √ Kesten-Stigum reconstruction phase, that is, when g < ln 2. Definition 6 (∆-Branch Model) Let 0 < ∆ ≤ f ≤ g < +∞ and denote by Yf,g ∆ the set of all phylogenies T = (V, E, [n], ρ; τ ) satisfying f ≤ τe ≤ g where τe is an integer multiple of ∆, for all e ∈ E. For ϕ ≥ 2 and Q ∈ Qϕ , we call Yf,g ∆ ⊗ {Q} the ∆-Branch Model (∆-BM). √ Theorem 2 (Logarithmic Reconstruction [DMR06, DMR09a]. See also [MHR09].) Let g ∗ = ln 2. Then, CFN } can be solved with for all 0 < ∆ ≤ f ≤ g < g ∗ , the phylogenetic reconstruction problem on Yf,g ∆ ⊗ {Q k = O(log n)2 . Distance methods. The proof of Theorem 1 uses distance methods, which we now define formally. Definition 7 (Correlation Matrix) Let Φ be a finite set with ϕ ≥ 2. Let (ξai )ki=1 , (ξbi )ki=1 ∈ Φk be the sequences at a, b ∈ [n]. For υ1 , υ2 ∈ Φ, we define the correlation matrix between a and b by k 1X ab b Fυ1 υ2 = 1{ξai = υ1 , ξbi = υ2 }, k i=1 and Fbab = (Fbυab1 υ2 )υ1 ,υ2 ∈Φ . Definition 8 (Distance Method) A phylogenetic reconstruction algorithm A = {An,k }n,k≥1 is said to be i )k [n] k bab distance-based if A depends on the data (ξ[n] i=1 ∈ (Φ ) only through the correlation matrices {F }a,b∈[n] . The previous definition takes a very general view of distance-based methods: any method that uses only pairwise sequence comparisons. In practice, most distance-based approaches actually use a specific distance estimator, that is, a function of Fbab that converges to τ (a, b) in probability as n → +∞. We give two classical examples below. Example 4 (CFN Metric) In the CFN case with state space Φ = {+, −}, a standard distance estimator (up to a constant) is   D(Fb) = − ln 1 − 2(Fb+− + Fb−+ ) . Example 5 (Log-Det Distance [BH87, Lak94, LSHP94, Ste94]) More generally, a common distance estimator (up to scaling) is the so-called log-det distance D(Fb) = − ln | det Fb|. Loosely speaking, the log-det distance can be thought as a generalization of the CFN metric. We will use a different generalization of the CFN metric. See section 1.3. 2 The correct statement of this result appears in [DMR09a]. Because of different conventions, our edge weights are scaled by a factor of 2 compared to those in [DMR09a]. The dependence of k in ∆ is ∆−2 . 6 1.2 Results In our main result, we prove that phylogenies under GTR models of mutation can be inferred using a distancebased method from k = poly(log n). Theorem 3 (Main Result) For all ϕ ≥ 2, 0 < ∆ ≤ f ≤ g < g ∗ and Q ∈ Qϕ , there is a distance-based 3 method solving the phylogenetic reconstruction problem on Yf,g ∆ ⊗ {Q} with k = poly(log n). Note that this result is a substantial improvement over Theorem 1—at least, in a certain range of parameters— and that it almost matches the bound obtained in Theorem 2. The result is also novel in two ways over Theorem 2: only the distance matrix is used; the result applies to a larger class of mutation matrices. A slightly weaker version of the result stated here appeared without proof as [Roc08]. Note that in [Roc08] the result was stated without the discretization assumption which is in fact needed for the final step of the proof. This is further explained in Section 7.3 of [DMR09a]. In subsequent work [Roc09], the result stated here was improved to logarithmic sequence length, thereby matching Theorem 2. This new result follows a similar high-level proof but involves stronger concentration arguments [PR09], as well as a simplified algorithm. In an attempt to keep the paper as self-contained as possible we first give a proof in the special case of homogeneous trees. This allows to keep the algorithmic details to a minimum. The proof appears in Section 3. We extend the result to general trees in Appendix A. The more general result relies on a combinatorial algorithm of [DMR09a]. 1.3 Proof Overview Distance averaging. The basic insight behind Steel’s conjecture is that the accurate reconstruction of ancestral sequences in the reconstruction phase can be harnessed to perform a better reconstruction of the phylogeny itself. For now, consider the CFN model with character space {+1, −1} and assume that our phylogeny is homogeneous with uniform branch lengths ω. Generate k i.i.d. samples (σVi )ki=1 . Let a, b be two internal vertices on level h − h0 < h (from the root). Suppose we seek to estimate the distance between a and b. This estimation cannot be performed directly because the sequences at a and b are not known. However, we can try to estimate these internal sequences. Denote by A, B the leaf set below a and b respectively. An estimate of the sequence at a is the (properly normalized) “site-wise average” of the sequences at A σ̄ai = 1 X σai 0 , |A| 0 e−ωh0 (2) a ∈A for i = 1, . . . , k, and similarly for b. It is not immediately clear how such a site-wise procedure involving simultaneously a large number of leaves can be performed using the more aggregated information in the correlation matrices {Fbuv }u,v∈[n] . Nevertheless, note that the quantity we are ultimately interested in computing is the following estimate of the CFN metric between a and b ! k 1X i i σ̄a σ̄b . τ̄ (a, b) = − ln k i=1 3 As in Theorem 2, the dependence of k in ∆ is ∆−2 . 7 Our results are based on the following observation: τ̄ (a, b) = − ln k 1X k i=1 = − ln 1 X σai 0 |A| 0 e−ωh0 a ∈A X X 1 0 |A||B|e−2ωh 0 0 a ∈A b ∈B = − ln ! 1 X σbi 0 |B| 0 e−ωh0 b ∈B !! k 1X i i σa0 σb0 k i=1 ! X X 1 0 0 e−τ̂ (a ,b ) 0 −2ωh |A||B|e 0 0 !! , a ∈A b ∈B where note that the last line depends only on distance estimates τ̂ (a0 , b0 ) between leaves a0 , b0 in A, B. In other words, through this procedure, which we call exponential averaging, we perform an implicit ancestral sequence reconstruction using only distance estimates. One can also think of this as a variance reduction technique. When the branch lengths are not uniform, one needs to use a weighted version of (2). This requires the estimation of path lengths. GTR models. In the case of GTR models, the standard log-det estimator does not lend itself well to the exponential averaging procedure described above. Instead, we use an estimator involving the right eigenvector ν corresponding to the second eigenvalue Λ2 of Q. For a, b ∈ [n], we consider the estimator   τ̂ (a, b) = − ln ν > Fbab ν . (3) This choice is justified by a generalization of (2) introduced in [MP03]. Note that ν may need to be estimated. Concentration. There is a further complication in that to obtain results with high probability, one needs to show that τ̄ (a, b) is highly concentrated. However, one cannot directly apply standard concentration inequalities because σ̄a is not bounded. Classical results on the reconstruction problem imply that the variance of σ̄a is finite—which is not quite enough. To amplify the accuracy, we “go down” log log n levels and compute O(log n) distance estimates with conditionally independent biases. By performing a majority procedure, we finally obtain a concentrated estimate. 1.4 Organization In Section 2, we provide a detailed account of the connection between ancestral sequence reconstruction and distance averaging. We then give a proof of our main result in the case of homogeneous trees in Section 3. Finally, in Appendix A, we give a sketch of the proof in the general case. All proofs are relegated to Appendix B. 2 Ancestral Reconstruction and Distance Averaging √ Let ϕ ≥ 2, 0 < ∆ ≤ f ≤ g < g ∗ = ln 2, and Q ∈ Qϕ with corresponding stationary distribution π > 0. In this section we restrict ourselves to the homogeneous case T = T (h) = (V, E, [n], ρ; τ ) where we take h = log2 n and f ≤ τe ≤ g and τe is an integer multiple of ∆, ∀e ∈ E. (See Examples 1 and 2 and Theorem 2.)4 4 Note that, without loss of generality, we can consider performing ancestral state reconstruction on a homogeneous tree as it is always possible to “complete” a general tree with zero-length edges. We come back to this point in Appendix A. 8 Throughout this section, we use a sequence length k > logκ n where κ > 1 is a constant to be determined later. We generate k i.i.d. samples (ξVi )ki=1 from the GTR model (T , Q) with state space Φ. All proofs are relegated to Appendix B. 2.1 Distance Estimator The standard log-det estimator does not lend itself well to the averaging procedure discussed above. For reconstruction purposes, we instead use an estimator involving the right eigenvector ν corresponding to the second eigenvalue Λ2 of Q. For a, b ∈ [n], consider the estimator   τ̂ (a, b) = − ln ν > Fbab ν , (4) where the correlation matrix Fbab was introduced in Definition 7. We first give a proof that this is indeed a legitimate distance estimator. For more on connections between eigenvalues of the rate matrix and distance estimation, see e.g. [GL96, GL98, GMY09]. Lemma 1 (Distance Estimator) Let τ̂ be as above. For all a, b ∈ [n], we have E[e−τ̂ (a,b) ] = e−τ (a,b) . For a ∈ [n] and i = 1, . . . , k, let σai = νξai . Then (4) is equivalent to k 1X i i σa σb k τ̂ (a, b) = − ln ! . (5) i=1 Note that in the CFN case, we have simply ν = of the CFN metric. Let (1, −1)> and hence (5) can be interpreted as a generalization π̄ = min πι , ι and 1 ν̄ ≡ max |νi | ≤ √ . i π̄ The following lemmas show that the distance estimate above with sequence length poly(log n) is concentrated for path lengths of order O(log log n). Lemma 2 (Distorted Metric: Short Distances) Let δ > 0, ε > 0, and γ > 0. There exists κ > 1, such that if the following conditions hold for u, v ∈ V : • [Small Diameter] τ (u, v) < δ log log(n), • [Sequence Length] k > logκ (n), then |τ (u, v) − τ̂ (u, v)| < ε, with probability at least 1 − n−γ . 9 Lemma 3 (Distorted Metric: Diameter Test) Let D > 0, W > 5, δ > 0, and γ > 0. Let u, v ∈ V not descendants of each other. Let u0 , v0 ∈ V be descendants of u, v respectively. there exists κ > 1, such that if the following conditions hold: • [Large Diameter] τ (u0 , v0 ) > D + ln W , • [Close Descendants] τ (u0 , u), τ (v0 , v) < δ log log(n), • [Sequence Length] k > logκ (n), then W , 2 with probability at least 1 − n−γ . On the other hand, if the first condition above is replaced by τ̂ (u, v) − τ (u0 , u) − τ (v0 , v) > D + ln • [Small Diameter] τ (u0 , v0 ) < D + ln W 5 , then τ̂ (u, v) − τ (u0 , u) − τ (v0 , v) ≤ D + ln W , 4 with probability at least 1 − n−γ . 2.2 Ancestral Sequence Reconstruction Let e = (x, y) ∈ E and assume that x is closest to ρ (in topological distance). We define Path(ρ, e) = Path(ρ, y), |e|ρ = |Path(v, e)|, and  Rρ (e) = 1 − θe2 Θ−1 ρ,y , where Θρ,y = e−τ (ρ,y) and θe = e−τ (e) . Proposition 1 below is a variant of Lemma 5.3 in [MP03]. For completeness, we give a proof. Proposition 1 (Weighted Majority: GTR Version) Let ξ[n] be a sample from LT ,Q (see Definition 4) with corresponding σ[n] . For a unit flow Ψ from ρ to [n], consider the estimator S= X Ψ(x)σx . Θρ,x x∈[n] Then, we have E[S] = 0, E[S | σρ ] = σρ , and Var[S] = 1 + KΨ , where KΨ = X Rρ (e)Ψ(e)2 . e∈E 10 Let Ψ be a unit flow from ρ to [n]. We will use the following multiplicative decomposition of Ψ: If Ψ(x) > 0, we let Ψ(y) ψ(e) = , Ψ(x) and, if instead Ψ(x) = 0, we let ψ(y) = 0. Denoting x↑ the immediate ancestor of x ∈ V and letting −τ θx = e (x↑ ,x) , it will be useful to re-write KΨ = h−1 X X Y (1 − θx2 ) h0 =0 x∈L(h) e∈Path(ρ,x) h0 ψ(e)2 , θe2 (6) and to define the following recursion from the leaves. For x ∈ [n], Kx,Ψ = 0. Then, let u ∈ V − [n] with children v1 , v2 with corresponding edges e1 , e2 and define   X ψ(eα )2 . Ku,Ψ = ((1 − θv2α ) + Kvα ,Ψ ) θe2α α=1,2 Note that, from (6), we have Kρ,Ψ = KΨ . Lemma 4 (Uniform Bound on KΨ ) Let Ψ be the homogeneous flow from ρ to [n]. Then, we have KΨ ≤ 2.3 1 < +∞. 1 − e−2(g∗ −g) Distance Averaging The input to our tree reconstruction algorithm is the matrix of all estimated distances between pairs of leaves {τ̂ (a, b)}a,b,∈[n] . For short sequences, these estimated distances are known to be accurate for leaves that are close enough. We now show how to compute distances between internal nodes in a way that involves only {τ̂ (a, b)}a,b,∈[n] (and previously computed internal weights) using Proposition 1. However, the second-moment guarantee in Proposition 1 is not enough to obtain good estimates with high probability. To remedy this situation, we perform a large number of conditionally independent distance computations, as we now describe. Let α > 1 and assume h0 > bα log2 log2 nc. Let 0 ≤ h00 < h0 such that ∆h ≡ h0 − h00 = bα log2 log2 nc. (h) (h) Let a0 , b0 ∈ Lh0 . For x ∈ {a, b}, denote by x1 , . . . , x2∆h , the vertices in Lh00 that are below x0 and, for j = 1, . . . , 2∆h , let Xj be the leaves of T (h) below xj . See Figure 1. Assume that we are given Θa0 ,· , Θb0 ,· . For 1 ≤ j ≤ 2∆h , we estimate τ (a0 , b0 ) as follows   X X 1 −1 −τ̂ (a0 ,b0 )  τ̄ (aj , bj ) ≡ − ln  Θ−1 . a0 ,a0 Θb0 ,b0 e |Aj ||Bj | 0 0 a ∈Aj b ∈Bj This choice of estimator is suggested by the following observation X X 00 −1 −τ̂ (a0 ,b0 ) e−τ̄ (aj ,bj ) ≡ 2−2h Θ−1 a0 ,a0 Θb0 ,b0 e a0 ∈Aj b0 ∈Bj    00 i 00 i k −h −h X X X 2 σa0   2 σb0  1  = e−τ (a0 ,aj )−τ (b0 ,bj )  . k Θaj ,a0 Θbj ,b0 0 0  i=1 11 a ∈Aj b ∈Bj bα log2 log2 nc aj a1 ··· A1 b0 a0 ··· Aj bj b1 a2∆h ··· B1 A2∆h b2∆h ··· Bj B2∆h Figure 1: Accuracy amplification. τ (a0 , b0 ) rj∗ j j 0 r∗0 j Figure 2: Examples of dense balls with six points. The estimate in this case would be one of the central points. 12 Note that the first line depends only on estimates (τ̂ (u, v))u,v∈[n] and {Θv,· }v∈Va0 ∪Vb0 . The last line is the empirical distance between the reconstructed states at a and b when the flow is chosen to be uniform in Proposition 1. For d ∈ R and r > 0, let Br (d) be the ball of radius r around d. We define the dense ball around j to be ∆h the smallest ball around τ̄ (aj , bj ) containing at least 2/3 of J = {τ̄ (aj 0 , bj 0 )}j20 =1 (as a multiset). The radius of the dense ball around j is   2 ∆h ∗ rj = inf r : |Br (τ̄ (aj , bj )) ∩ J | ≥ (2 ) , 3 for j = 1, . . . , 2∆h . We define our estimate of τ (a0 , b0 ) to be τ̄ 0 (a0 , b0 ) = τ̄ (aj ∗ , bj ∗ ), where j ∗ = arg minj rj∗ . See Figure 2. For D > 0, W > 5, we define     W 1 −∆h j : τ̄ (aj , bj ) ≤ D + ln > . SD(a0 , b0 ) = 1 2 3 2 We extend Lemmas 2 and 3 to τ̄ 0 (a0 , b0 ) and SD(a0 , b0 ). Proposition 2 (Deep Distance Computation: Small Diameter) Let α > 1, D > 0, γ > 0, and ε > 0. Let (h) a0 , b0 ∈ Lh0 as above. There exist κ > 1 such that if the following conditions hold: • [Small Diameter] τ (a0 , b0 ) < D, • [Sequence Length] k > logκ (n), then |τ̄ 0 (a0 , b0 ) − τ (a0 , b0 )| < ε, with probability at least 1 − O(n−γ ). Proposition 3 (Deep Distance Computation: Diameter Test) Let α > 1, D > 0, W > 5, and γ > 0. Let (h) a0 , b0 ∈ Lh0 as above. There exists κ > 1 such that if the following conditions hold: • [Large Diameter] τ (a0 , b0 ) > D + ln W , • [Sequence Length] k > logκ (n), then SD(a0 , b0 ) = 0, with probability at least 1 − n−γ . On the other hand, if the first condition above is replaced by • [Small Diameter] τ (a0 , b0 ) < D + ln W 5 , then SD(a0 , b0 ) = 1, with probability at least 1 − n−γ . 13 3 Reconstructing Homogeneous Trees In this section, we prove our main result in the case of homogeneous trees. More precisely, we prove the following. Theorem 4 (Main Result: Homogeneous Case) Let 0 < ∆ ≤ f ≤ g < +∞ and denote by HYf,g ∆ the set of all homogeneous phylogenies T = (V, E, [n], ρ; τ ) satisfying f ≤ τ ≤ g and τ is an integer multiple of ∆, e e √ ∀e ∈ E. Let g ∗ = ln 2. Then, for all ϕ ≥ 2, 0 < ∆ ≤ f ≤ g < g ∗ and Q ∈ Qϕ , there is a distance-based method solving the phylogenetic reconstruction problem on HYf,g ∆ ⊗ {Q} with k = poly(log n). All proofs are relegated to Appendix B. In the homogeneous case, we can build the tree level by level using simple “four-point” techniques [Bun71]. See e.g. [SS03, Fel04] for background and details. See also Section 3.2 below. The underlying combinatorial algorithm we use here is essentially identical to the one used by Mossel in [Mos04]. From Propositions 2 and 3, we get that the “local metric” on each level is accurate as long as we compute adequate weights. We summarize this fact in the next proposition. For ∆ > 0 and z ∈ R+ , we let [z]∆ be the closest multiple of ∆ to z (breaking ties arbitrarily). We define  0 [τ̄ (a0 , b0 )]∆ , if SD(a0 , b0 ) = 1, d(a0 , b0 ) = +∞, o.w. Proposition 4 (Deep Distorted Metric) Let D > 0, W > 5, and γ > 0. Let T = (V, E, [n], ρ; τ ) ∈ HYf,g ∆ (h) with g < g ∗ . Let a0 , b0 ∈ Lh0 for 0 ≤ h0 < h. Assume we are given, for x = a, b, θe for all e ∈ Vx . There exists κ > 0, such that if the following condition holds: • [Sequence Length] The sequence length is k > logκ (n), then we have, with probability at least 1 − O(n−γ ), d(a0 , b0 ) = τ (a0 , b0 ) under either of the following two conditions: 1. [Small Diameter] τ (a0 , b0 ) < D, or 2. [Finite Estimate] d(a0 , b0 ) < +∞. It remains to show how to compute the weights, which is the purpose of the next section. 3.1 Estimating Averaging Weights Proposition 4 relies on the prior computation of the weights θe for all e ∈ Vx , for x = a, b. In this section, we show how this estimation is performed. (h) Let a0 , b0 , c0 ∈ Lh0 . Denote by z the meeting point of the paths joining a0 , b0 , c0 . We define the “threepoint” estimate   1 θ̂z,a0 = O(a0 ; b0 , c0 ) ≡ exp − [d(a0 , b0 ) + d(a0 , c0 ) − d(b0 , c0 )] . 2 Note that the expression in parenthesis is an estimate of the distance between a0 and z. 14 (h) Proposition 5 (Averaging Weight Estimation) Let a0 , b0 , c0 ∈ Lh0 as above. Assume that the assumptions of Propositions 2, 3, 4 hold. Assume further that the following condition hold: • [Small Diameter] τ (a0 , b0 ), τ (a0 , c0 ), τ (b0 , c0 ) < D + ln W , then θ̂z,a0 = θz,a0 , with probability at least 1 − O(n−γ ) where θ̂z,a0 = O(a0 ; b0 , c0 ). 3.2 Putting it All Together (h) Let 0 ≤ h0 < h and Q = {a0 , b0 , c0 , d0 } ⊆ Lh0 . The topology of T (h) restricted to Q is completely characterized by a bi-partition or quartet split q of the form: a0 b0 |c0 d0 , a0 c0 |b0 d0 or a0 d0 |b0 c0 . The most basic operation in quartet-based reconstruction algorithms is the inference of such quartet splits. In distance-based methods in particular, this is usually done by performing the so-called four-point test: letting 1 F(a0 b0 |c0 d0 ) = [τ (a0 , c0 ) + τ (b0 , d0 ) − τ (a0 , b0 ) − τ (c0 , d0 )], 2 we have   a0 b0 |c0 d0 if F(a0 , b0 |c0 , d0 ) > 0 a0 c0 |b0 d0 if F(a0 , b0 |c0 , d0 ) < 0 q=  a0 d0 |b0 c0 o.w. Of course, we cannot compute F(a0 , b0 |c0 , d0 ) directly unless h0 = 0. Instead we use Proposition 4. Deep Four-Point Test. Assume we have previously computed weights θe for all e ∈ Vx , for x = a, b, c, d. We let 1 F(a0 b0 |c0 d0 ) = [d(a0 , c0 ) + d(b0 , d0 ) − d(a0 , b0 ) − d(c0 , d0 )], (7) 2 and we define the deep four-point test FP(a0 , b0 |c0 , d0 ) = 1{F(a0 b0 |c0 d0 ) > f /2}, with FP(a0 , b0 |c0 , d0 ) = 0 if any of the distances in (7) is infinite. Also, we extend the diameter test SD to arbitrary subsets by letting SD(S) = 1 if and only if SD(x, y) = 1 for all pairs x, y ∈ S. Algorithm. Fix α > 1, D > 4g, W > 5, γ > 3. Choose κ so as to satisfy Propositions 4 and 5. Let Z0 be the set of leaves. The algorithm—a standard cherry picking algorithm—is detailed in Figure 3. Acknowledgments This work was triggered by a discussion with Elchanan Mossel on lower bounds for distance methods, following a talk of Joseph Felsenstein. In particular, Elchanan pointed out that the distance matrix has a potentially useful correlation structure. 15 Algorithm Input: Distance estimates {τ̂ (a, b)}a,b∈[n] ; Output: Tree; • For h0 = 1, . . . , h − 1, 1. Four-Point Test. Let Rh0 = {q = ab|cd : ∀a, b, c, d ∈ Zh0 distinct such that FP(q) = 1}. 2. Cherry Picking. Identify the cherries in Rh0 , that is, those pairs of vertices that only appear on the same side of the quartet splits in Rh0 . Let (h0 +1) Zh0 +1 = {a1 (h0 +1) , . . . , a2h−(h0 +1) }, be the parents of the cherries in Zh0 3. Weight Estimation. For all z ∈ Zh0 +1 , (a) Let x, y be the children of z. Choose w to be any other vertex in Zh0 with SD({x, y, w}) = 1. (b) Compute θ̂z,x = O(x; y, w). (c) Repeat the previous step interchanging the role of x and y. Figure 3: Algorithm. References [Att99] K. Atteson. The performance of neighbor-joining methods of phylogenetic reconstruction. Algorithmica, 25(2-3):251–278, 1999. [BH87] Daniel Barry and J. A. Hartigan. Statistical analysis of hominoid molecular evolution. Statist. Sci., 2(2):191–210, 1987. With comments by Stephen Portnoy and Joseph Felsenstein and a reply by the authors. [Bun71] P. Buneman. The recovery of trees from measures of dissimilarity. In Mathematics in the Archaelogical and Historical Sciences, pages 187–395. Edinburgh University Press, Edinburgh, 1971. [CH91] Joseph T. Chang and John A. Hartigan. Reconstruction of evolutionary trees from pairwise distributions on current species, 1991. [Cha96] Joseph T. Chang. Full reconstruction of Markov models on evolutionary trees: identifiability and consistency. Math. Biosci., 137(1):51–73, 1996. [CK01] Miklós Csurös and Ming-Yang Kao. Provably fast and accurate recovery of evolutionary trees through harmonic greedy triplets. SIAM Journal on Computing, 31(1):306–322, 2001. [Csu02] M. Csurös. Fast recovery of evolutionary trees with thousands of nodes. J. Comput. Biol., 9(2):277–97, 2002. [CT06] Benny Chor and Tamir Tuller. Finding a maximum likelihood tree is hard. J. ACM, 53(5):722–744, 2006. [Day87] William H. E. Day. Computational complexity of inferring phylogenies from dissimilarity matrices. Bull. Math. Biol., 49(4):461–467, 1987. 16 [DHJ+ 06] Constantinos Daskalakis, Cameron Hill, Alexander Jaffe, Radu Mihaescu, Elchanan Mossel, and Satish Rao. Maximal accurate forests from distance matrices. In RECOMB, pages 281–295, 2006. [DMR06] Constantinos Daskalakis, Elchanan Mossel, and Sébastien Roch. Optimal phylogenetic reconstruction. In STOC’06: Proceedings of the 38th Annual ACM Symposium on Theory of Computing, pages 159–168, New York, 2006. ACM. [DMR09a] Constantinos Daskalakis, Elchanan Mossel, and Sébastien Roch. Evolutionaty trees and the Ising model on the Bethe lattice: a proof of Steel’s conjecture. Preprint, 2009. [DMR09b] Constantinos Daskalakis, Elchanan Mossel, and Sébastien Roch. Phylogenies without branch bounds: Contracting the short, pruning the deep. In RECOMB, pages 451–465, 2009. [DS86] William H. E. Day and David Sankoff. Computational complexity of inferring phylogenies by compatibility. Syst. Zool., 35(2):224–229, 1986. [EKPS00] W. S. Evans, C. Kenyon, Y. Peres, and L. J. Schulman. Broadcasting on trees and the Ising model. Ann. Appl. Probab., 10(2):410–433, 2000. [ESSW99a] P. L. Erdös, M. A. Steel, L. A. Székely, and T. A. Warnow. A few logs suffice to build (almost) all trees (part 1). Random Struct. Algor., 14(2):153–184, 1999. [ESSW99b] P. L. Erdös, M. A. Steel, L. A. Székely, and T. A. Warnow. A few logs suffice to build (almost) all trees (part 2). Theor. Comput. Sci., 221:77–118, 1999. [Fel04] J. Felsenstein. Inferring Phylogenies. Sinauer, Sunderland, MA, 2004. [Gas97] O. Gascuel. BIO-NJ: An improved version of the NJ algorithm based on a simple model of sequence data. Mol. Biol. Evol., 14(7):685–695, 1997. [Geo88] H. O. Georgii. Gibbs measures and phase transitions, volume 9 of de Gruyter Studies in Mathematics. Walter de Gruyter & Co., Berlin, 1988. [GF82] R. L. Graham. and L. R. Foulds. Unlikelihood that minimal phylogenies for a realistic biological study can be constructed in reasonable computational time. Math. Biosci., 60:133–142, 1982. [GL96] X Gu and W H Li. A general additive distance with time-reversibility and rate variation among nucleotide sites. Proceedings of the National Academy of Sciences of the United States of America, 93(10):4671–4676, 1996. [GL98] Xun Gu and Wen-Hsiung Li. Estimation of evolutionary distances under stationary and nonstationary models of nucleotide substitution. Proceedings of the National Academy of Sciences of the United States of America, 95(11):5899–5905, 1998. [GMS08] Ilan Gronau, Shlomo Moran, and Sagi Snir. Fast and reliable reconstruction of phylogenetic trees with very short edges. In SODA ’08: Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 379–388, Philadelphia, PA, USA, 2008. Society for Industrial and Applied Mathematics. [GMY09] Ilan Gronau, Shlomo Moran, and Irad Yavneh. Towards optimal distance functions for stochastic substitutions models. Preprint, 2009. [HNW99] D. H. Huson, S. H. Nettles, and T. J. Warnow. Disk-covering, a fast-converging method for phylogenetic tree reconstruction. J. Comput. Biol., 6(3–4), 1999. 17 [KZZ03] Valerie King, Li Zhang, and Yunhong Zhou. On the complexity of distance-based evolutionary tree reconstruction. In SODA ’03: Proceedings of the fourteenth annual ACM-SIAM symposium on Discrete algorithms, pages 444–453, Philadelphia, PA, USA, 2003. Society for Industrial and Applied Mathematics. [Lak94] JA Lake. Reconstructing Evolutionary Trees from DNA and Protein Sequences: Paralinear Distances. Proceedings of the National Academy of Sciences, 91(4):1455–1459, 1994. [LC06] Michelle R. Lacey and Joseph T. Chang. A signal-to-noise analysis of phylogeny estimation by neighbor-joining: insufficiency of polynomial length sequences. Math. Biosci., 199(2):188–215, 2006. [Lig85] Thomas M. Liggett. Interacting particle systems, volume 276 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. Springer-Verlag, New York, 1985. [LSHP94] PJ Lockhart, MA Steel, MD Hendy, and D Penny. Recovering Evolutionary Trees under a More Realistic Model of Sequence. Mol Biol Evol, 11(4):605–612, 1994. [MHR09] R. Mihaescu, C. Hill, and S. Rao. Fast phylogeny reconstruction through learning of ancestral sequences. Preprint, 2009. [Mos03] E. Mossel. On the impossibility of reconstructing ancestral data and phylogenies. J. Comput. Biol., 10(5):669–678, 2003. [Mos04] E. Mossel. Phase transitions in phylogeny. Trans. Amer. Math. Soc., 356(6):2379–2404, 2004. [Mos07] E. Mossel. Distorted metrics on trees and phylogenetic forests. IEEE/ACM Trans. Comput. Bio. Bioinform., 4(1):108–116, 2007. [MP03] E. Mossel and Y. Peres. Information flow on trees. Ann. Appl. Probab., 13(3):817–844, 2003. [MV05] Elchanan Mossel and Eric Vigoda. Phylogenetic MCMC Algorithms Are Misleading on Mixtures of Trees. Science, 309(5744):2207–2209, 2005. [PR09] Y. Peres and S. Roch. Reconstruction on trees: Exponential moment bounds for linear estimators. Preprint, 2009. [Roc06] Sébastien Roch. A short proof that phylogenetic tree reconstruction by maximum likelihood is hard. IEEE/ACM Trans. Comput. Biology Bioinform., 3(1):92–94, 2006. [Roc08] Sébastien Roch. Sequence-length requirement for distance-based phylogeny reconstruction: Breaking the polynomial barrier. In FOCS, pages 729–738, 2008. [Roc09] Sébastien Roch. Phase transition in distance-based phylogeny reconstruction. Preprint, 2009. [SHP88] M. A. Steel, M. D. Hendy, and D. Penny. Loss of information in genetic distances. Nature, 336(6195):118, 1988. [SN87] N. Saitou and M. Nei. The neighbor-joining method: A new method for reconstructing phylogenetic trees. Mol. Biol. Evol., 4(4):406–425, 1987. [SS63] R. Sokal and P. Sneath. Principles of Numerical Taxonomy. W. H. Freeman and Co., San Francisco, Calif., 1963. 18 [SS99] Michael A. Steel and László A. Székely. Inverting random functions. Ann. Comb., 3(1):103–113, 1999. Combinatorics and biology (Los Alamos, NM, 1998). [SS02] M. A. Steel and L. A. Székely. Inverting random functions. II. Explicit bounds for discrete maximum likelihood estimation, with applications. SIAM J. Discrete Math., 15(4):562–575 (electronic), 2002. [SS03] C. Semple and M. Steel. Phylogenetics, volume 22 of Mathematics and its Applications series. Oxford University Press, 2003. [Ste94] M. Steel. Recovering a tree from the leaf colourations it generates under a Markov model. Appl. Math. Lett., 7(2):19–23, 1994. [Ste01] M. Steel. My Favourite Conjecture. Preprint, 2001. 19 A Extending to General Trees It is possible to generalize the previous arguments to general trees, using a combinatorial algorithm of [DMR09a], thereby giving a proof of Theorem 3. To apply the algorithm of [DMR09a] we need to obtain a generalization of Proposition 4 for disjoint subtrees in “general position.” This is somewhat straightforward and we give a quick sketch in this section. A.1 Basic Definitions The algorithm in [DMR09a] is called Blindfolded Cherry Picking. We refer the reader to [DMR09a] for a full description of the algorithm, which is somewhat involved. It is very similar in spirit to the algorithm introduced in Section 3.2, except for complications due to the non-homogeneity of the tree. The proof in [DMR09a] is modular and relies on two main components: a distance-based combinatorial argument which remains unchanged in our setting; and a statistical argument which we now adapt. The key to the latter is [DMR09a, Proposition 4]. Note that [DMR09a, Proposition 4] is not distance-based as it relies on a complex ancestral reconstruction function—recursive majority. Our main contribution in this section is to show how this result can be obtained using the techniques of the previous sections—leading to a fully distance-based reconstruction algorithm. In order to explain the complications due to the non-homogeneity of the tree and state our main result, we first need to borrow a few definitions from [DMR09a]. Basic Definitions. Fix 0 < ∆ ≤ f ≤ g < g ∗ as in Theorem 3. Let T = (V, E, [n], ρ; τ ) ∈ Yf,g ∆ be a phylogeny with underlying tree T = (V, E). In this section, we sometimes refer to the edge set, vertex set and leaf set of a tree T 0 as E(T 0 ), V(T 0 ), and L(T 0 ) respectively. Definition 9 (Restricted Subtree) Let V 0 ⊆ V be a subset of the vertices of T . The subtree of T restricted to V 0 is the tree T 0 obtained by 1) keeping only nodes and edges on paths between vertices in V 0 and 2) by then contracting all paths composed of vertices of degree 2, except the nodes in V 0 . We sometimes use the notation T 0 = T |V 0 . See Figure 4 for an example. Definition 10 (Edge Disjointness) Denote by PathT (x, y) the path (sequence of edges) connecting x to y in T . We say that two restricted subtrees T1 , T2 of T are edge disjoint if PathT (x1 , y1 ) ∩ PathT (x2 , y2 ) = ∅, for all x1 , y1 ∈ L(T1 ) and x2 , y2 ∈ L(T2 ). We say that T1 , T2 are edge sharing if they are not edge disjoint. See Figure 5 for an example. Definition 11 (Legal Subforest) We say that a tree is a rooted full binary tree if all its internal nodes have degree 3 except the root which has degree 2. A restricted subtree T1 of T is a legal subtree of T if it is also a rooted full binary tree. We say that a forest F = {T1 , T2 , . . .}, is legal subforest of T if the Tι ’s are edge-disjoint legal subtrees of T . We denote by ρ(F) the set of roots of F. Definition 12 (Dangling Subtrees) We say that two edge-disjoint legal subtrees T1 , T2 of T are dangling if there is a choice of root for T not in T1 or T2 that is consistent with the rooting of both T1 and T2 . See Figure 6 below for an example where two legal, edge-disjoint subtrees are not dangling. 20 Figure 4: Restricting the top tree to its white nodes. u3 u2 u4 u1 u5 u7 u8 u6 Figure 5: The subtrees T |{u1 ,u2 ,u3 ,u8 } and T |{u4 ,u5 ,u6 ,u7 } are edge-disjoint. The subtrees T |{u1 ,u5 ,u6 ,u8 } and T |{u2 ,u3 ,u4 ,u7 } are edge-sharing. 21 x2 z2 y2 x1 y1 z1 u2 w2 v2 u1 w1 v1 T2 T1 Figure 6: Basic Disjoint Setup (General). The rooted subtrees T1 , T2 are edge-disjoint but are not assumed to be dangling. The white nodes may not be in the restricted subtrees T1 , T2 . The case w1 = x1 and/or w2 = x2 is possible. Note that if we root the tree at any node along the dashed path, the subtrees rooted at y1 and y2 are edge-disjoint and dangling (unlike T1 and T2 ). Definition 13 (Basic Disjoint Setup (General)) Let T1 = Tx1 and T2 = Tx2 be two restricted subtrees of T rooted at x1 and x2 respectively. Assume further that T1 and T2 are edge-disjoint, but not necessarily dangling. Denote by yι , zι the children of xι in Tι , ι = 1, 2. Let wι be the node in T where the path between T1 and T2 meets Tι , ι = 1, 2. Note that wι may not be in Tι since Tι is restricted, ι = 1, 2. If wι 6= xι , assume without loss of generality that wι is in the subtree of T rooted at zι , ι = 1, 2. We call this configuration the Basic Disjoint Setup (General). See Figure 6. Let τ (T1 , T2 ) be the length of the path between w1 and w2 in the metric τ . A.2 Deep Distorted Metric Our reconstruction algorithm for homogeneous trees (see Section 3) builds the tree level by level and only encounters situations where one has to compute the distance between two dangling subtrees (that is, the path connecting the subtrees “goes above them”). However, when reconstructing general trees by growing a subforest from the leaves, more general situations such as the one depicted in Figure 6 cannot be avoided and have to be dealt with carefully. Hence, our goal in this subsection is to compute the distance between the internal nodes x1 and x2 in the Basic Disjoint Setup (General). We have already shown how to perform this computation when T1 and T2 are dangling, as this case is handled easily by Proposition 4 (after a slight modification of the distance estimate; see below). However, in the general case depicted in Figure 6, there is a complication. When T1 and T2 are not dangling, the reconstructed sequences at x1 and x2 are not conditionally independent. But it can be shown that for the algorithm Blindfolded Cherry Picking to work properly, we need: 1) to compute the distance between x1 and x2 correctly when the two subtrees are close and dangling; 2) detect when the two subtrees are far apart (but an accurate distance estimate is not required in that case). This turns out to be enough because the algorithm Blindfolded Cherry Picking ensures roughly that close reconstructed subtrees are always dangling. We refer the reader to [DMR09a] for details. The key point is the following: if one computes the distance between y1 and y2 rather than the distance between x1 and x2 , then the dangling assumption is satisfied (re-root the tree at any node along the path 22 connecting w1 and w2 ). However, when the algorithm has only reconstructed T1 and T2 , we cannot tell which pair in {y1 , z1 } × {y2 , z2 } is the right one to use for the distance estimation. Instead, we compute the distance for all pairs in {y1 , z1 } × {y2 , z2 } and the following then holds: in the dangling case, all these distances will agree (after subtracting the length of the edges between x1 , x2 and {y1 , z1 , y2 , z2 }); in the general case, at least one is correct. This is the basic observation behind the routine D ISTORTED M ETRIC in Figure 7 and the proof of Proposition 6 below. We slightly modify the definitions of Section 3. Using the notation of Definition 13, fix (a0 , b0 ) ∈ {y1 , z1 } × {y2 , z2 }. For v ∈ V and ` ∈ L, denote by |`|v be the graph distance (that is, the number of edges) between v and leaf `. Assume that we are given θe for all e ∈ E(Ta0 ) ∪ E(Tb0 ). Let α > 1 and ∆h = bα log2 log2 nc. Imagine (minimally) completing the subtrees below a0 and b0 with 0-length edges so that the leaves below a0 and b0 are at distance at least ∆h. For x ∈ {a, b}, denote by x1 , . . . , x2∆h , the vertices below x0 at distance ∆h from x0 and, for j = 1, . . . , 2∆h , let Xj be the leaves of T below xj . For 1 ≤ j ≤ 2∆h , we estimate τ (a0 , b0 ) as follows   X X 1 −1 −τ̂ (a0 ,b0 )  τ̄ (aj , bj ) ≡ − ln  Θ−1 . 0 Θb ,b0 e a ,a 0 0 |Aj ||Bj | 0 0 a ∈Aj b ∈Bj Note that, because the tree is binary, it holds that X −|a0 | X −|b0 | X X −|a0 | −|b0 | aj bj aj bj 2 = 2 2 = 1, a0 ∈Aj b0 ∈Bj a0 ∈Aj b0 ∈Bj and we can think of the weights on Aj (similarly for Bj ) as resulting from a homogeneous flow Ψaj from aj to Aj . Then, the bound on the variance of X −|a0 | aj 0 Saj ≡ 2 Θ−1 aj ,a0 σa , a0 ∈Aj in Proposition 1 still holds with Kaj ,Ψaj = X Raj (e)Ψ(e)2 . e∈E(Taj ) Moreover Kaj ,Ψaj is uniformly bounded following an argument identical to (8) in the proof of Lemma 4. For d ∈ R and r > 0, let Br (d) be the ball of radius r around d. We define the dense ball around j to be the smallest ∆h ball around τ̄ (aj , bj ) containing at least 2/3 of J = {τ̄ (aj 0 , bj 0 )}2j 0 =1 (as a multiset). The radius of the dense ball around j is   2 ∆h ∗ rj = inf r : |Br (τ̄ (aj , bj )) ∩ J | ≥ (2 ) , 3 for j = 1, . . . , 2∆h . We define our estimate of τ (a0 , b0 ) to be τ̄ 0 (a0 , b0 ) = τ̄ (aj ∗ , bj ∗ ), where j ∗ = arg minj rj∗ . See Figure 2. For D > 0, W > 5, we define     W 1 −∆h SD(a0 , b0 ) = 1 2 j : τ̄ (aj , bj ) ≤ D + ln > , 3 2 and we let  d(a0 , b0 ) = [τ̄ 0 (a0 , b0 )]∆ , if SD(a0 , b0 ) = 1, +∞, o.w. Proposition 6 (Accuracy of D ISTORTED M ETRIC) Let α > 1, D > 0, W > 5, γ > 0 and g < g 0 < g ∗ . Consider the Basic Disjoint Setup (General) with F = {T1 , T2 } and Q = {y1 , z1 , y2 , z2 }. Assume we are given θe for all e ∈ E(T1 ) ∪ E(T2 ). Let Υ denote the output of D ISTORTED M ETRIC in Figure 7. There exists κ > 0, such that if the following condition holds: 23 Algorithm D ISTORTED M ETRIC Input: Rooted forest F = {T1 , T2 } rooted at vertices x1 , x2 ; weights τe , for all e ∈ E(T1 ) ∪ E(T2 ); Output: Distance Υ; • [Children] Let yι , zι be the children of xι in F for ι = 1, 2 (if xι is a leaf, set zι = yι = xι ); • [Distance Computations] For all pairs (a, b) ∈ {y1 , z1 } × {y2 , z2 }, compute D(a, b) := d(a, b) − τ (a, x1 ) − τ (b, x2 ); • [Multiple Test] If (1) (1) (2) (2) max{ D(r1 , r2 ) − D(r1 , r2 ) : (ι) (ι) (r1 , r2 ) ∈ {y1 , z1 } × {y2 , z2 }, ι = 1, 2} = 0, return Υ := D(z1 , z2 ), otherwise return Υ := +∞ (return Υ := +∞ if any of the distances above is +∞). Figure 7: Routine D ISTORTED M ETRIC. • [Edge Length] It holds that τ (e) ≤ g 0 , ∀e ∈ E(Tx ), x ∈ Q5 ; • [Sequence Length] The sequence length is k > logκ (n), then we have, with probability at least 1 − O(n−γ ), Υ = τ (x1 , x2 ) under either of the following two conditions: 1. [Dangling Case] T1 and T2 are dangling and τ (T1 , T2 ) < D, or 2. [Finite Estimate] Υ < +∞. The proof, which is a simple combination of the proof of Proposition 4 and the remarks above the statement of Proposition 6, is left out. Full Algorithm. The rest of the Blindfolded Cherry Picking algorithm is unchanged except for an additional step to compute averaging weights as in the algorithm of Section 3. This concludes our sketch of the proof of Theorem 3. 5 For technical reasons explained in [DMR09a], we allow edges slightly longer than the upper bound g. 24 B Proofs Proof of Lemma 1: Note that E[Fbijab ] = πi e−τ (a,b)Q  ij . Then i  h X X  νi πi e−τ (a,b)Q νj E ν > Fbab ν = i∈Φ = X ij j∈Φ νi (πi e−τ (a,b) νi ) i∈Φ = e−τ (a,b) X πi νi2 i∈Φ = e −τ (a,b) .  Proof of Lemma 2: By Azuma’s inequality we get P [τ̂ (u, v) > τ (u, v) + ε] " k # 1X i i =P σu σv < e−τ (u,v)−ε k i=1 # " k 1X i i σu σv < e−τ (u,v) − (1 − e−ε )e−τ (u,v) =P k i=1 " k # 1X i i 1 1 −ε −δ log log(n) ≤P σu σv < E[σu σv ] − (1 − e )e k i=1 2 ! (1 − e−ε )e−δ log log(n) ≤ exp − 2k(2ν̄/k)2 ≤ n−γ , for κ large enough depending on δ, ε, γ. Above, we used that τ (u, v) = − ln E[σu1 σv1 ]. A similar inequality holds for the other direction.  25 Proof of Lemma 3: Assume the first three conditions hold. By Azuma’s inequality we get   W P τ̂ (u, v) − τ (u0 , u) − τ (v0 , v) ≤ D + ln 2 " k # 1X i i =P σu σv ≥ 2W −1 e−D e−τ (u0 ,u)−τ (v0 ,v) k i=1 # " k 1X i i −τ (u,v) −1 −D −τ (u0 ,u)−τ (v0 ,v) σu σv ≥ e +W e e ≤P k i=1 # " k X 1 σui σvi ≥ E[σu1 σv1 ] + W −1 e−D e−τ (u0 ,u)−τ (v0 ,v) =P k i=1 2 ! W −1 e−D e−τ (u0 ,u)−τ (v0 ,v) ≤ exp − 2k(2ν̄/k)2 ≤ n−γ , for κ large enough. A similar argument gives the second claim.  Proof of Proposition 1: We follow the proofs of [EKPS00, MP03]. Let ēi be the unit vector in direction i. Let x ∈ [n], then > τ (ρ,x)Q . E[ē> ξx | ξρ ] = ēξρ e Therefore, τ (ρ,x)Q ν = σρ e−τ (ρ,x) , E[σx | σρ ] = ē> ξρ e and E[S | σρ ] = X Ψ(x)σρ e−τ (ρ,x) X = σρ Ψ(x) = σρ . Θρ,x x∈[n] x∈[n] In particular, X E[S] = πi νi = 0. ι∈Φ For x, y ∈ [n], let x ∧ y be the meeting point of the paths between ρ, x, y. We have X E[σx σy ] = P[ξx∧y = ι]E[σx σy | ξx∧y = ι] ι∈Φ = X πι E[σx | ξx∧y = ι]E[σy | ξx∧y = ι] ι∈Φ = X πι e−τ (x∧y,x) νι e−τ (x∧y,y) νι ι∈Φ = e−τ (x,y) X πι νι2 ι∈Φ −τ (x,y) = e . 26 Then Var[S] = E[S 2 ] X Ψ(x)Ψ(y) = E[σx σy ] Θρ,x Θρ,y x,y∈[n] X Ψ(x)Ψ(y)e2τ (ρ,x∧y) . = x,y∈[n] For e ∈ E, let e = (e↑ , e↓ ) where e↑ is the vertex closest to ρ. Then, by a telescoping sum, for u ∈ V X X X e2τ (ρ,e↑ ) e2τ (ρ,e↓ ) − Rρ (e) = e∈Path(ρ,u) e∈Path(ρ,u) e∈Path(ρ,u) 2τ (ρ,u) = e − 1, and therefore E[S 2 ] = X Ψ(x)Ψ(y)e2τ (v,x∧y) x,y∈[n]  = X  Ψ(x)Ψ(y) 1 + x,y∈[n] = 1+ = 1+ X X Rρ (e) e∈Path(ρ,x∧y) Rρ (e) 1{e ∈ Path(ρ, x ∧ y)}Ψ(x)Ψ(y) X e∈E x,y∈[n] X Rρ (e)Ψ(e)2 . e∈E  Proof of Lemma 4: From (6), we have Kρ,Ψ ≤ h−1 X (1 − e−2g )2h−i i=0 ≤ h X e2jg e−(2 ln √ e2(h−i)g 22(h−i) 2)j j=1 = h X e2j(g−g ∗) j=1 ≤ +∞ X (e−2(g ∗ −g) )j j=0 = 1 < +∞, 1 − e−2(g∗ −g) √ where recall that g ∗ = ln 2.  Proof of Proposition 2: Let ∆h ∆h Z = {aj }2j=1 ∪ {bj }2j=1 , 27 (8) and i k E = {(σZ )i=1 }. For j = 1, . . . , 2∆h , let e −τ̂ (aj ,bj ) k 1X i i = σaj σbj . k i=1 Note that E[e−τ̂ (aj ,bj ) ] = e−τ (aj ,bj ) , by Lemma 1. For i = 1, . . . , k, j = 1, . . . , 2∆h , and x ∈ {a, b}, let σ̄xi j = X 2−h00 σ i 0 x . Θ xj ,x0 0 x ∈Xj By the Markov property, it follows that, conditioned on E, {σ̄xi j : i = 1, . . . , k, j = 1, . . . , 2∆h , x ∈ {a, b}}, are mutually independent. Moreover, by Proposition 1, we have E[σ̄xi j | E] = σxi j , and E[(σ̄xi j )2 | E] ≤ 2π̄ −1 1 1− e−2(g∗ −g) . Therefore, for any ζ > 0 there exists κ > 1 such that E[e −τ̄ (aj ,bj ) τ (a0 ,aj )+τ (b0 ,bj ) | E] = e = eτ (a0 ,aj )+τ (b0 ,bj ) ! k 1X i i E[σ̄aj σ̄bj | E] k 1 k i=1 k X ! E[σ̄ai j | E]E[σ̄bi j | E] i=1 −(τ̂ (aj ,bj )−τ (aj ,a0 )−τ (bj ,b0 )) = e , and −τ̄ (aj ,bj ) Var[e ! k 1 X i i Var[σ̄aj σ̄bj | E] k2 2τ (a0 ,aj )+2τ (b0 ,bj ) | E] = e ≤ e2τ (a0 ,aj )+2τ (b0 ,bj ) ≤ e2τ (a0 ,aj )+2τ (b0 ,bj ) k e4gbα log2 log2 nc k ≤ ζ.  ≤ 28 1 k2  i=1 k X ! E[(σ̄ai j )2 | E]E[(σ̄bi j )2 | E] i=1 2 1 − e−2(g∗ −g) 2 2 1 − e−2(g∗ −g) 2 Take κ large enough such that Lemma 2 holds for diameter 2gbα log2 log2 nc+D, precision ε/6 and failure probability O(n−(γ+1) ). Then, we have |τ̂ (aj , bj ) − τ (aj , bj )| < ε/6, ∀j = 1, . . . , 2∆h , (9) with probability 1 − O(n−γ ). Let E 0 be the event that (9) holds. Note that E[e−τ̄ (aj ,bj ) | E ∩ E 0 ] = e−(τ̂ (aj ,bj )−τ (aj ,a0 )−τ (bj ,b0 )) . Let ε0 = min{(eε/3 − eε/6 )e−D , (e−ε/6 − e−ε/3 )e−D }. By Chebyshev’s inequality, we have that   1 0 P τ̄ (aj , bj ) < τ (a0 , b0 ) − ε | E ∩ E 3 h i ≤ P e−τ̄ (aj ,bj ) > e−τ (a0 ,b0 )+ε/3 | E ∩ E 0 i h ≤ P e−τ̄ (aj ,bj ) − E[e−τ̄ (aj ,bj ) | E ∩ E 0 ] > [e−τ (a0 ,b0 )+ε/3 − e−(τ̂ (aj ,bj )−τ (aj ,a0 )−τ (bj ,b0 )) ] | E ∩ E 0 i h ≤ P e−τ̄ (aj ,bj ) − E[e−τ̄ (aj ,bj ) | E ∩ E 0 ] > e−τ (a0 ,b0 ) [eε/3 − eτ (aj ,bj )−τ̂ (aj ,bj ) ] | E ∩ E 0 i h ≤ P e−τ̄ (aj ,bj ) − E[e−τ̄ (aj ,bj ) | E ∩ E 0 ] > e−D [eε/3 − eε/6 ] | E ∩ E 0 h i ≤ P e−τ̄ (aj ,bj ) − E[e−τ̄ (aj ,bj ) | E ∩ E 0 ] > ε0 | E ∩ E 0 ≤ 1/12, for ζ small enough. A similar argument holds for   1 0 P τ̄ (aj , bj ) > τ (a0 , b0 ) + ε | E ∩ E ≤ 1/12. 3 Conditioned on E ∩ E 0 , −∆h L=2  2∆h  X 1 1 |τ̄ (aj , bj ) − τ (a0 , b0 )| < ε 3 j=1 is a sum of independent {0, 1}-variables with average at least 5/6. By Azuma’s inequality, we have P[L ≤ 2/3 | E ∩ E 0 ] ≤ P[L − E[L | E ∩ E 0 ] < −1/6 | E ∩ E 0 ]   (1/6)2 ≤ exp − −∆h 2 ∆h 2(2 ) 2 α ≤ exp (−O(log2 n)) ≤ O(n−γ ), where we used that α > 1. This implies that with (unconditional) probability at least 1 − O(n−γ )   2 1 |τ̄ (aj , bj ) − τ (a0 , b0 )| < ε > (2∆h ). 3 3 29 In particular, there exists j such that   2 2 0 j : |τ̄ (aj 0 , bj 0 ) − τ̄ (aj , bj )| < ε > (2∆h ), 3 3 and for all j such that |τ̄ (aj , bj ) − τ (a0 , b0 )| > ε, we have that  2 j : |τ̄ (aj 0 , bj 0 ) − τ̄ (aj , bj )| < ε 3 0  1 ≤ (2∆h ). 3 Finally, we get that |τ̄ 0 (a0 , b0 ) − τ (a0 , b0 )| ≤ ε.  Proof of Proposition 3: The proof is similar to the proof of Lemma 3 and Proposition 2.  Proof of Proposition 4: We let ε < ∆/2. The first part of the proposition follows immediately from Proposition 2 and the second part of Proposition 3. Note that Propositions 2 and 3 are still valid when h0 < bα log2 log2 nc if we take instead ∆h = min{h0 , bα log2 log2 nc}. Indeed, in that case there is no need to perform an implicit ancestral sequence reconstruction and the proofs of the lemmas follow immediately from Lemmas 2 and 3. For the second part, choose κ so as to satisfy the conditions of Proposition 2 with diameter D + ln W and apply the first part of Proposition 3.  Proof of Proposition 5: The proof follows immediately from Proposition 4 and the remark above the statement of Proposition 5.  Proof of Theorem 4: The proof of Theorem 4 follows from Propositions 4 and 5. Indeed, at each level h0 , we are guaranteed by the above to compute a distorted metric with a radius large enough to detect all cherries on the next level using four-point tests. The proof follows by induction.  30
5cs.CE
Operational Semantics of Process Monitors arXiv:1705.05137v1 [cs.PL] 15 May 2017 Jun Inoue and Yoriyuki Yamagata National Institute of Advanced Industrial Science and Technology (AIST), 1-8-31 Midorigaoka, Ikeda, Osaka 563-8577 Japan {jun.inoue, yoriyuki.yamagata}@aist.go.jp Abstract. CSPE is a specification language for runtime monitors that can directly express concurrency in a bottom-up manner that composes the system from simpler, interacting components. It includes constructs to explicitly flag failures to the monitor, which unlike deadlocks and livelocks in conventional process algebras, propagate globally and aborts the whole system’s execution. Although CSPE has a trace semantics along with an implementation demonstrating acceptable performance, it lacks an operational semantics. An operational semantics is not only more accessible than trace semantics but also indispensable for ensuring the correctness of the implementation. Furthermore, a process algebra like CSPE admits multiple denotational semantics appropriate for different purposes, and an operational semantics is the basis for justifying such semantics’ integrity and relevance. In this paper, we develop an SOS-style operational semantics for CSPE , which properly accounts for explicit failures and will serve as a basis for further study of its properties, its optimization, and its use in runtime verification. Keywords: Operational Semantics, Concurrency, Runtime Monitoring, Communicating Sequential Processes 1 Introduction Specification-based runtime monitoring [5] checks a program’s execution trace against a formal specification. Often more rigorous than testing due to the presence of a formal specification, this technique is also computationally much cheaper than formal verification methods like model checking, as it only needs to look at concrete program runs with instrumentation. CSPE [10] is a language based on Hoare’s Communicating Sequential Processes [6] for developing the formal specification. Unlike many other languages in this niche, CSPE can directly express concurrency. Moreover, it builds up the specification in a bottom-up manner by composing smaller, interacting components, helping to model complex behavior. CSPE ’s main appeal as a specification language, compared to plain CSP, is a FAIL construct that signals a global failure, aborting all processes in the model at once. This construct can be used like assert(false) in C or Java, allowing to code invariants that mark some states as (should-be) unreachable. By contrast, Event Event Variable Term Event Set Event Set Param e∈Σ x∈X P, Q ∈ Terms ::= STOP | FAIL | ?x : E → P | P  Q | P ||E Q E ::= f (y1 , . . . , yn ) where f : Σ n → 2Σ is computable y ::= x | e Fig. 1. Syntax of CSPE . deadlocks and livelocks, the conventional notions of failure in CSP, affect only the deadlocked or livelocked process(es). These failures are thus very difficult to propagate into a failure for the entire system, as desired for assertion failures. However, the semantics of how FAIL propagates throughout the model requires special treatment. Because the propagation preempts all other activities, normal execution rules must apply only when FAIL is not currently propagating. This is a negative constraint, which is generally problematic [4]. While earlier work [10] demonstrated a trace semantics and a reasonably efficient implementation for CSPE , an operational semantics has been lacking. Developing an operational semantics is highly desirable for several reasons. Firstly, though a trace semantics more naturally defines the set of behaviors (i.e. traces) that comply with a CSPE specification, an operational semantics more directly defines the implementation. Secondly, process algebras admit multiple denotational semantics capturing different aspects of operationally defined behavior [3]. Investigating the full spectrum of such semantics requires an operational semantics. Finally, an operational semantics provides a more accessible presentation of the semantics than denotational semantics. 1.1 Contributions In this paper, after reviewing the syntax and trace semantics of CSPE (Section 2), we present the following contributions. – We define an operational semantics in SOS format [8], which properly captures the propagation of FAIL while avoiding the complexities of rules with negative premises (Section 3). – We prove that the operational semantics induces the previously published trace semantics (Section 4). 2 Syntax and Trace Semantics of CSPE This section reviews the syntax and trace semantics of CSPE . Figure 1 presents the syntax. A CSPE term represents a process, which is an entity that successively emits events drawn from an alphabet Σ. Terms are built from the following constructs, with the indicated meanings. For a thorougher explanation, see [10]. – The stuck term STOP does not emit anything. – The failing term FAIL aborts all processes. Trace Trace Set Trace Set Operations s, t ∈ Σ ∗ T ∈ TraceSets ::= prefix-closed subsets of Σ ∗ eT := {ε} ∪ {et | t ∈ T } T (e) := {t | et ∈ T } ∅ ||E T := T ||E ∅ := ∅ [ T1 ||E T2 := e(T1 (e) ||E T2 (e)) ∪ e∈E [ (1) (e(T1 (e) ||E T2 ) ∪ e(T1 ||E T2 (e))) (2) e∈Σ−E Trace Semantics JSTOPK := {ε} JP  QK := JP K ∪ JQK JFAILK := ∅ JP ||E QK := JP K ||E JQK J?x : E → P K := {ε} ∪ [ eJ[e/x]P K e∈E Fig. 2. Trace semantics of CSPE . Equation (1) takes precedence over eq. (2), so the latter applies only if the former does not. – Prefix ?x : E → P chooses and emits an event e ∈ E, then executes [e/x]P . – Choice P  Q executes P or Q, whichever manages to emit something first. – Parallel composition P ||E Q executes P and Q in parallel. Their events are interleaved arbitrarily, except events in E are synchronized. An event set E can be specified by any computable function parametrized by the x’s bound by surrounding prefix operators. In this short paper, we omit recursion and the terminating action X in the interest of conciseness. This paper’s focus is on analyzing FAIL, and X complicates the presentation substantially without adding anything of conceptual significance. Recursion seems to be similar, though it is still under investigation. Figure 2 presents the trace semantics. A trace is a (possibly empty) sequence of events, and Σ ∗ is the set of all traces. The concatenation of traces s and t is written st. A trace set is any prefix-closed set of traces, which can be empty, unlike in conventional process algebras. The trace semantics of CSPE assigns to each term P a trace set JP K, which is intuitively the set of traces P can emit. The semantic map uses some operations on trace sets. If T is a trace set, eT prepends e to all members of T and adjoins ε, while T (e) discards all traces in T that do not start with e and drops the leading e from all remaining traces. The ||E operator is defined by eqs. (1) and (2). Though significantly simplified, these equations are equivalent to the ones found in [10] modulo the absence of X. In [10], this operator was defined “coinductively”, which was correct but misleading. Formally, by the Knaster-Tarski Theorem, the defining equations (1) and (2) have a greatest solution in the complete lattice of total binary functions on TraceSets ordered by point-wise inclusion, which was taken to be ||E . However, ′′ ′ if ||E and ||E are any two solutions of these equations, then for any T1 and T2 , ′′ ′ every trace in T1 ||E T2 is also in T1 ||E T2 , by straightforward induction on the trace’s length. Thus, the solution is unique, and ||E is this unique solution. a ::= e | τ D ∈ Doomed ::= FAIL | D  D | D ||E P | P ||E D P̂ , Q̂ ∈ Terms − Doomed Action Doomed Term Viable Term Operational Semantics e∈E e e e e e P̂ 7→ P ′ e e P̂ ||E Q̂ 7→ P ′ ||E Q′ τ FAIL  FAIL 7→ FAIL P  Q 7→ P  Q′ a Q 7→ Q′ a 6∈ E τ D1 7→ P1 τ D2 7→ P2 τ τ τ FAIL ||E P 7→ FAIL s as a 6∈ E a P̂ ||E Q 7→ P̂ ||E Q′ D1 ||E D2 7→ P1 ||E D2 a ε τ a P 7→ P ′ Z⇒ P ′′ P Z⇒ P τ P ||E Q̂ 7→ P ′ ||E Q̂ e∈E e τ P 7→ P ′ P  Q 7→ Q′ Q̂ 7→ Q′ Q 7→ Q′ a Q 7→ Q′ P  Q 7→ P ′ τ P  Q 7→ P ′  Q (?x : E → P ) 7→ [e/x]P P 7→ P ′ P 7→ P ′ P Z⇒ P ′′ D1 ||E D2 7→ D1 ||E P2 τ P ||E FAIL 7→ FAIL τ s P 7→ P ′ Z⇒ P ′′ s P Z⇒ P ′′ Fig. 3. Operational semantics of CSPE . S S S Lemma 1. ||E is continuous, i.e. ( S1 ) ||E ( S2 ) = T1 ∈S1 ,T2 ∈S2 T1 ||E T2 . Proof. The defining equations (1) and (2) preserve continuity, so in fact the Knaster-Tarski construction can be carried out in the space of continuous binary operators, which is also a complete lattice under point-wise inclusion. 3 Operational Semantics This section presents the operational semantics. The semantics is given in Figa ure 3, which defines internal transitions P 7→ Q between terms. Some transitions do not emit events but instead emit the silent action τ . A visible transition s P Z⇒ Q happens when P internally transitions to Q in zero or more steps, and the non-τ actions it emits along the way forms s. The main challenge in this semantics is capturing the propagation of FAIL. For example, in P ||∅ FAIL, the P must not be allowed to keep emitting events, for then P could do so indefinitely, withholding the propagation of FAIL. Instead, FAIL should kill all processes including P , transitioning the whole term to FAIL. To achieve this effect, the usual rule that allows the left operand to transition must apply only when the right operand is not failing. This constraint is tricky to capture because it is a negative constraint. In our semantics, the constraint is captured by the viability annotation P̂ . This annotation restricts the range of the metavariable P̂ to exclude doomed terms, i.e. terms for which transitioning to FAIL has become inevitable and are now propagating FAIL within themselves. These annotations are placed so that when a term is doomed, rules that propagate FAIL become the only applicable ones, thus forcing the propagation to take place. Proposition 2. A doomed process always transitions to FAIL while emitting nothing but τ . a Proof. D 7→ P implies a = τ ∧ P ∈ Doomed ∧ |D| > |P |, where |P | denotes term size, by induction on D. Thus, a doomed term can only τ -transition, and only finitely many times, while staying doomed. Another induction shows ∀D 6= τ FAIL. ∃D′ . D 7→ D′ , so a doomed term keeps transitioning until it reaches FAIL. 4 Correspondence Between the Semantics This section establishes a correspondence between the two semantics: a process’ denotation is precisely the set of traces it can emit, up to but not including any transitions that doom the process. This means that the monitor comparing a system to P can declare a failure as soon as the system’s trace strays out of JP K. s Theorem 3. JP K = {s | ∃M. P Z⇒ M 6∈ Doomed}. A special case of this theorem is particularly illuminating: the doomed set is precisely the set of terms with empty trace sets, corresponding to the fact that doomed terms silently transition to FAIL. Proposition 4. P ∈ Doomed ⇐⇒ JP K = ∅. Proof. Induction on P . Furthermore, trace sets faithfully follow non-silent transitions, in that the traces which follow an event e in JP K are precisely the traces of terms Q that follow P after a sequence of transitions that emit e. S e Lemma 5. JP K(e) = P Z⇒ JQK. Q Proof. Induction on the size of P , where event sets do not count toward size, e.g. |?x : E → P ′ | := |P ′ |+1. This way, |[e/x]P ′ | = |P ′ |, so when P = (?x : E → P ′ ), the inductive hypothesis applies to [e/x]P ′ , despite it not being a subterm. Several lemmas are needed along the way, two of which are of particular note. Take for example P = PS JP2 K 6= ∅ and e ∈ E. Inductive hypotheses 1 ||E P2 with JP1 K,S e e give JP K(e) = ( P1 Z⇒ JQ K) || ( JQ2 K). Then, continuity (Lemma 1) E P2 Z⇒Q2 SQ1 1 S e e lets us commute the and ||E , equating this to P1 Z⇒ (JQ1 K ||E JQ2 K). Q1 ,P2 Z⇒Q2 S e e Then, a lemma characterizing those Q with P Z⇒ Q equates this to P Z⇒ JQK. Q Theorem 3 is a straightforward consequence of these facts. s Proof (of Theorem 3). We show s ∈ JP K ⇐⇒ ∃Q. P Z⇒ Q 6∈ Doomed by induction on s. For the base case, ε ∈ JP K ⇐⇒ P 6∈ Doomed by Proposition 4. If ε P 6∈ Doomed, then P Z⇒ P 6∈ Doomed, and if P ∈ Doomed, then P can only transition inside Doomed as noted in the proof of Proposition 2. For the inductive step, s breaks down as s = es′ , and s ∈ JP K ⇐⇒ s′ ∈ JP K(e). By Lemma 5, this e is equivalent to having s′ ∈ JP ′ K and P Z⇒ P ′ for some P ′ , which by inductive e s′ hypothesis is equivalent to ∃P ′ , Q. P Z⇒ P ′ Z⇒ Q 6∈ Doomed. 5 Related Works The main issue with CSPE semantics is the propagation of FAIL, which entails the negative constraint that normal computation rules apply only if FAILa propagation rules do not. Negative premises of the form P 7→ 6 come quite naturally as a means for codifying such constraints, but negative premises are generally quite problematic. A transition relation satisfying negative rules may be not-existent, or non-unique, with no obvious guiding principle (such as minimality) in choosing the “right” one. Some formats do guarantee well-definedness, such as GSOS with the witnessing constraint [2] and ntyft/ntyxt [4]. But even then, negative rules tend to betray desirable properties such as compositionality of some forms of bisimulation [1]. Our approach exploits the fact that we only have a very specific negative constraint – the absence of doomed subprocesses – and encodes it with a restriction on the range of metavariables in transition rules. With trick, we manage to avoid negative premises altogether, essentially turning the system into a positive one. This approach is very commonly employed, e.g. in reduction rules for the call-by-value λ calculus [7], where the argument in a function application should be evaluated only if the function expression cannot be evaluated any further. We identify FAIL-induced failures by transitions into FAIL, but an alternative approach would be to have FAIL emit a special event ̥, just as termination is signalled by X. Though we have not pursued this idea in detail, the central concern there will be to give ̥ higher priority than all other events. Prioritized transition also involves a negative constraint but is known to be quite wellbehaved, being translatable to plain CSP [9]. At the moment, it is not clear if FAIL propagation can be translated to the prioritized-transition primitive in [9]. 6 Conclusion We gave an operational semantics for CSPE that adequately captures the behavior of FAIL, the global failure operator, with positive operational rules. This semantics induces the previously defined trace semantics. As noted in the introduction, this development enables studies of other types of denotational semantics, while informing the implementation. An interesting direction of future work is to see if FAIL can be specified by priorities, and if that approach yields better-behaved semantics. Acknowledgment The authors would like to thank Yoshinao Isobe for comments on an earlier draft of this paper and stimulating discussions. References 1. Bloom, B.: Structural operational semantics for weak bisimulations. Theoretical Computer Science 146(1), 25–68 (1995) 2. Bloom, B., Istrail, S., Meyer, A.R.: Bisimulation can’t be traced. Journal of the ACM 42(1), 232–268 (1995) 3. van Glabbeek, R.J.: The linear time - branching time spectrum I. The semantics of concrete, sequential processes, chap. 1, pp. 3–100. Elsevier (2001) 4. Groote, J.F.: Transition system specifications with negative premises. Theoretical Computer Science 118(2), 263 – 299 (1993) 5. Havelund, K., Reger, G.: Specification of parametric monitors, pp. 151–189. Springer Fachmedien Wiesbaden, Wiesbaden (2015) 6. Hoare, C.A.R.: Communicating Sequential Processes. Prentice-Hall, Inc., Upper Saddle River, NJ, USA (1985) 7. Mitchell, J.C.: Foundations for Programming Languages. MIT Press (1996) 8. Plotkin, G.D.: A structural approach to operational semantics. The Journal of Logic and Algebraic Programming 60, 17–139 (2004) 9. Roscoe, A.: The expressiveness of CSP with priority. Electronic Notes in Theoretical Computer Science 319, 387 – 401 (2015) 10. Yamagata, Y., Artho, C., Hagiya, M., Inoue, J., Ma, L., Tanabe, Y., Yamamoto, M.: Runtime Monitoring for Concurrent Systems, pp. 386–403. Springer International Publishing, Cham (2016)
6cs.PL
arXiv:1512.07526v2 [math.GR] 30 Jun 2016 On the acylindrical hyperbolicity of the tame automorphism group of SL2(C) Alexandre Martin Abstract We introduce the notion of über-contracting element, a strengthening of the notion of strongly contracting element which yields a particularly tractable criterion to show the acylindrical hyperbolicity, and thus a strong form of non-simplicity, of groups acting on non locally compact spaces of arbitrary dimension. We also give a simple local criterion to construct über-contracting elements for groups acting on complexes with unbounded links of vertices. As an application, we show the acylindrical hyperbolicity of the tame automorphism group of SL2 (C), a subgroup of the 3-dimensional Cremona group Bir(P3 (C)), through its action on a CAT(0) square complex recently introduced by Bisi–Furter–Lamy. Cremona groups are groups of birationnal transformations of projective spaces over arbitrary fields, and as such are central objects in birational geometry. These groups have a long history, going back to work of Castelnouvo, Cremona, Enriques and Noether among others. A lot of work has been devoted to Cremona groups in dimension 2, and a rather clear picture is now available regarding the structure of such groups: Many results, such as the Tits alternative [6], the computation of their automorphism groups [11], the Hopf property [12], as well as their algebraic non-simplicity [7,16], have been proved. While classical approaches to these groups involve methods from birational geometry and dynamical systems, methods from geometric group theory have proved very fruitful in recent years to unveil more of the structure of these groups. Indeed, the group Bir(P2 (C)) acts by isometries on a hyperbolic space of infinite dimension, a subspace of the Picard–Manin space, and such an action can be used to derive many more properties of the group. For instance, Cantat–Lamy used methods from hyperbolic geometry (more precisely, ideas reminiscent of small cancellation theory) to show the non-simplicity of the plane Cremona group over an arbitrary closed field [7], a result recently extended to arbitrary fields by Lonjou [16]. In another direction, Minasyan–Osin used the action of the group Aut(C2 ) of polynomial automorphism group of C2 on the Bass–Serre tree associated to its decomposition as an amalgamated product (a decomposition due to Jung and van der Kilk [14, 24]) to obtain, among other things, a strong form of non-simplicity for this group [19]. By contrast, the situation is much more mysterious in higher dimension, and very few results are known for Cremona groups of dimension at least 3. A first step would be to 1 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) understand subgroups of higher Cremona groups. An interesting subgroup of Bir(Pn (C)) is the automorphism groups of Cn , or more generally the automorphism group of a space birationally equivalent to Cn . An even smaller subgroup is the group of tame automorphisms of Cn , that is, the subgroup generated by the affine group of Cn and transformations of the form (x1 , . . . , xn ) 7→ (x1 + P (x2 , . . . , xn ), . . . , xn ) for some polynomial P in n − 1 variables. This definition of tame automorphisms was recently extended to a general affine quadric threefold by Lamy–Vénéreau [15]. Further methods from geometric group theory have been used recently by Bisi–Furter–Lamy to study the structure of the group Tame(SL2 (C)) of tame automorphisms of SL2 (C), a subgroup of Bir(P3 (C)), through its action on a CAT(0) square complex [3]. Such complexes have an extremely rich combinatorial geometry, and this action was used to obtain for instance the Tits alternative for the group, as well as the linearisability of its finite subgroups. In this article, we explain how further methods from geometric group theory allow us to get a better understanding of the geometry and structure of Tame(SL2 (C)). The aim of this article is thus twofold. On the birational geometric side, we wish to convince the reader of the general interest of the wider use of tools coming from geometric group theory in the study of Cremona groups and their subgroups. On the geometric group theoretical side, we wish to convince the reader of the interest of studying a group through its non-proper actions on non locally finite complexes of arbitrary dimension. Indeed, while a lot of work has been done to study groups either through their proper actions on metric spaces, or through their actions on simplicial trees, few general results and techniques are available to study actions in a more general setting. Allowing non-proper actions raises serious geometric obstacles, as this most often implies working with non locally finite spaces of arbitrary dimension. We show however that, under mild geometric assumptions - assumptions that are satisfied by large classes of complexes with a reasonable combinatorial geometry, it is possible to obtain simple and useful tools to study such general actions. In this article, we shall focus on the hyperbolic-like features of Tame(SL2 (C)), and more precisely on the notion of acylindrical hyperbolicity. It is a theme which has come to the forefront of geometric group theory in recent years: Indeed, it is a notion sufficiently general to encompass large classes of groups (mapping class groups [4], Out(Fn ) [2], many CAT(0) groups [22], etc.), unifying many previously known results, and yet has strong consequences: acylindrically hyperbolic groups are SQ-universal (that is, every countable group embeds in a suitable quotient of the group), the associated reduced C ∗ -algebra is simple in the case of a countable torsion-free group, etc. [10]. We refer the reader to [20] for more details. It is thus non surprising to witness a wealth of tools being developed to prove the acylindrical hyperbolicity of ever larger classes of groups. Acylindrical hyperbolicity is defined in terms of an acylindrical action of a group on a hyperbolic space, a dynamical condition which is generally cumbersome to check, particularly for actions on non locally compact spaces: Indeed, while these conditions for actions 2 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) on trees can be reformulated in terms of pointwise stabilisers of pairs of points (this was the original definition of Sela [21]), they involve coarse stabilisers of pairs of points for more general actions, that is, group elements moving a pair of point by a given amount. Controlling such coarse stabilisers generally requires understanding the set of geodesics between two non-compact metric balls, a substantial geometric obstacle in absence of local compactness. What is more, few actions naturally associated to a group turn out to be acylindrical (let us mention nonetheless the action of mapping class groups on their associated curve complexes [4], as well as the action of Higman groups on n ≥ 5 generators on their associated CAT(-1) polygonal complexes [17]). Instead, when given an action of a group presumed to be acylindrically hyperbolic on a geodesic metric space, one generally tries to show that a sufficient criterion is satisfied, namely the existence of a WPD element with a strongly contracting orbit (see [1, Theorem H]). This approach was for instance followed in [2,8,13,19]. Here again, checking the WPD condition for a given element turns out to be highly non-trivial for actions on non-locally compact spaces of dimension at least two. As often in geometric group theory, the situation is much easier to handle in the case of actions on simplicial trees, that is, for groups admitting a splitting. In this case, Minasyan– Osin obtained a very simple and useful criterion [19, Theorem 4.17], which was used to show the acylindrical hyperbolicity of large classes of groups: some one-relator groups, the affine Cremona group in dimension 2, the Higman group, many 3-manifold groups, etc. For simplicity, we only state it for amalgamated products: Consider an amalgamated product G of the form A ∗C B, where the edge group C is strictly contained in both A and B and is weakly malnormal in G, meaning that there exists an element g ∈ G such that C ∩ gCg −1 is finite. Then G is either virtually cyclic or acylindically hyperbolic. In order to get an idea on how one could generalise such a criterion to more general actions, it is useful to outline its proof: Considering two distinct edges e, e0 of the associated Bass–Serre tree with finite common stabiliser, one can extend the minimal geodesic segment P containing e and e0 into a geodesic line L which is the axis of some element g ∈ G acting hyperbolically. Such an element turns out to satisfy the WPD identity. Indeed, given two balls of radius r whose projection on L are sufficiently far apart with respect to r, any geodesic between two points in these balls must contain a translate of P , and one concludes using weak malnormality. At the heart of this proof is the very particular geometry of trees, and in particular the existence of cut-points, which “force” geodesics to go through a prescribed set of vertices. Such a behaviour cannot a priori be expected from actions on higher-dimensional spaces. In this article, we to show that it is possible to obtain a generalisation of the aforementioned criterion for groups acting on higher dimensional complexes, under a mild geometric assumption on the complex acted upon. Following what happens for trees, we want conditions that force large portions of a geodesic to be prescribed by a coarse information about their endpoints. In particular, we want to force geodesics to go through certain fi3 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) nite subcomplexes. We will be interested in the following strengthening of the notion of strongly contracting element: We consider a hyperbolic element such that one of its axes comes equipped with a set of checkpoints, a collection of uniformly finite subcomplexes whose union is coarsely equivalent to the axis and such that for every two points of the spaces whose projections on the axis are far enough, every geodesic between them must meet sufficiently many checkpoints between their respective projections (this will be made precise in Definition 1.3). Such elements will be called über-contractions. The advantage of such a notion of an über-contraction is that it allows for a more tractable criterion to prove the acylindrical hyperbolicity of a group. Recall that the standard criterion of Bestvina–Bromberg–Fujiwara [1, Theorem H] is to find a strongly contracting element satisfying the so-called WPD condition (see Theorem 1.1). If ones considers only über-contractions, it is enough to check a weaker dynamical condition, which is much easier to check, as it is formulated purely in terms of stabilisers of pairs of points. Our main criterion is the following: Theorem A. Let G be a group acting by isometries on a geodesic metric space X. Let g be an infinite order element which has quasi-isometrically embedded orbits, and assume that the following holds: • g is an über-contraction with respect to a set S of checkpoints, • g satisfies the following weakening of the WPD condition: There exists a constant m0 such that for every point s ∈ S and every m ≥ m0 , only finitely many elements of G fix pointwise s and g m s. Then G is either virtually cyclic or acylindrically hyperbolic. With such a theorem at hand, it is now important to understand how to construct übercontractions. Forcing geodesics to go through given complexes is reasonably manageable in a CAT(0) space as geodesics can be understood locally: In a CAT(0) space, if two geodesics meet along a vertex v and make a very large angle at v, then the concatenation of these two geodesics is again a geodesic, and what is more, any geodesic between points close enough to the endpoints of this concatenation will also have to go through v. For spaces which do not have such a rich geometry, we also provide a way to construct übercontractions, by mimicking what happens in a space with a CAT(0) geometry: We want to construct a hyperbolic element with an axis such that the “angle” made at some special vertices of this axis is so large that it will force geodesics between two arbitrary points having sufficiently far apart projections on this axis to go through these special vertices. As it turns out, a quite mild geometric condition ensures that such a “strong concatenation of geodesics” phenomenon occurs: We say that a complex has a bounded angle of view if, roughly speaking, there is a uniform bound on the angle between two arbitrary vertices v and v 0 , seen from any point that does not lie on a geodesic between v and v 0 (see Definition 2.6). Having a bounded angle of view holds for CAT(0) metric spaces and other complexes with a 4 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) more combinatorial notion of non-positive curvature (C 0 (1/6)-polygonal complexes, systolic complexes). It implies in particular a Strong Concatenation Property of combinatorial geodesics (see Definition 2.2), a property also satisfied by hyperbolic complexes satisfying a very weak form of isoperimetric inequality (see Proposition 2.10). Under such a mild assumption, we have a very simple way of constructing über-contraction (see Proposition 2.4). This is turn allows us to obtain a second, more local, criterion for acylindrical hyperbolicity which generalises the aforementioned Minasyan–Osin criterion to actions on very general metric spaces: Theorem B (“Link Criterion” for acylindrical hyperbolicity). Let X be a simply connected hyperbolic polyhedral complex satisfying the Strong Concatenation Property, together with an action by polyhedral isomorphisms of a group G. Assume that there exists a vertex v of X and a group element g such that: 1) the action of Gv on the 1-skeleton of the link of v has unbounded orbits (for the simplicial metric on the 1-skeleton lk(v) where every edge has length 1), 2) Gv is weakly malnormal, that is, the intersection Gv ∩ gGv g −1 is finite. Then G is either virtually cyclic or acylindrically hyperbolic. It is this criterion that we use to prove the acylindrical hyperbolicity of Tame(SL2 (C)), using its aforementioned action on a CAT(0) square complex. Theorem C. The group Tame(SL2 (C)) is acylindrically hyperbolic. In particular, it is SQ-universal and admits free normal subgroups. The article is organised as follows. In Section 1, after recalling standard definitions and results about acylindrical hyperbolicity, we introduce über-contractions and prove Theorem A. In Section 2, we introduce the Strong Concatenation Property and prove Theorem B. Finally, Section 3 deals with the acylindrical hyperbolicity of Tame(SL2 ) by means of its action on the CAT(0) square complex introduced by Bisi–Furter–Lamy. Acknowledgement. We gratefully thank S. Lamy for remarks on a first version of this article, as well as I. Chatterji for many discussions and suggestions about this article. This work was partially supported by the European Research Council (ERC) grant no. 259527 of G. Arzhantseva and by the Austrian Science Fund (FWF) grant M 1810-N25. 1 A criterion for acylindrical hyperbolicity via über-contractions In this section, we give a tractable criterion implying acylindrical hyperbolicity for groups acting on (not necessarily locally compact) geodesic metric spaces. 5 A. Martin 1.1 On the acylindrical hyperbolicity of Tame(SL2 (C)) Contracting properties of quasi-lines As many others, our criterion relies on the existence of of a group element whose orbits possesses hyperbolic-like features. We start by recalling various “contracting” poperties of a quasi-line in a metric space. Definition 1.1. Let X be a metric space and Λ a quasi-line of X, i.e. the image by a quasi-isometric embedding of the real line. For a closed subset Y of X, we denote by πΛ (Y ) the set of points of Λ realising the distance to Y , called the closest-point projection of Y on Λ. The quasi-line Λ is Morse if for every K, L ≥ 0 there exists a constant C(K, L) such that any (K, L) quasi-geodesic with endpoints in Λ stays in the C(K, L)-neighbourhood of Λ. We say that an isometry of X is Morse if it is a hyperbolic isometry, i.e. its has quasi-isometrically embedded orbits, and if one (hence every) of its orbits is Morse. The quasi-line Λ is strongly contracting if there exists a constant C such that every ball of X disjoint from Λ has a closest-point projection on Λ of diameter at most C. We say that an isometry of X is strongly contracting if it is a hyperbolic isometry and if one (hence every) of its orbits is strongly contracting. Remark 1.2. A strongly contracting quasi-geodesic is Morse. We now introduce a strengthening of the notion of strongly contracting isometry, which is central in this article. Definition 1.3 (system of checkpoints, über-contracting isometry). Let X be a geodesic metric space, let h be an isometry of X with quasi-isometrically embedded orbits. A system of checkpoints for h is the S data of a finite subset S of X, an error constant L ≥ 0, and a quasi-isometry f : Λ := i∈Z hi S → R such that the following holds: Let x, y be points of X and x0 , y 0 be projections on Λ of x, y respectively. For every checkpoint Si := hi S, i ∈ Z such that: • Si coarsely separates x0 and y 0 , that is, f (x0 ) and f (y 0 ) lie in different unbounded connected components of R \ f (Si ), • Si is at distance at least L from x0 and y 0 , then every geodesic between x and y meets Si . A hyperbolic isometry h of X is über-contracting, or is an über-contraction, if it admits a system of checkpoints. Example 1.4. If X is a simplicial tree and h is a hyperbolic isometry, the h-translates of any vertex on the axis of h yields a system of checkpoints. Example 1.5. By standard arguments of hyperbolic geometry, if X is a δ-hyperbolic geodesic metric space and h is a hyperbolic isometry, the h-translates of any ball of radius 2δ yields a system of checkpoints. 6 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) We mention a couple of immediate properties: Remark 1.6. If h is an über-contraction and Λ the hhi-orbit of some finite subset, then there is coarsely well-defined closest-point projection on Λ, as the diameter of the set of projections of a given point is uniformly bounded above. Remark 1.7. An über-contracting isometry is strongly contracting. In particular, it is Morse by Remark 1.2. 1.2 Acylindrical hyperbolicity in presence of über-contractions We start by recalling some standard definitions. Definition 1.8 (acylindricity, acylindrically hyperbolic group). Let G be a group acting on a geodesic metric space X. We say that the action is acylindrical if for every r ≥ 0 there exist constants L(r), N (r) ≥ 0 such that for every points x, y of X at distance at least L(r), there are at most N (r) elements h of G such that d(x, hx), d(y, hy) ≤ r. A non virtually cyclic group is acylindrically hyperbolic if it admits an acylindrical action with unbounded orbits on a hyperbolic metric space. Our goal is to obtain a criterion for acylindrical hyperbolicity for groups admitting übercontractions under additional assumptions. We start by recalling some standard criterion. Definition 1.9. Let G be a group acting on a geodesic metric space X. Let g be an element of G of infinite order with quasi-isometrically embedded orbits. We say that g satisfies the WPD condition if for every r ≥ 0 and every point x of X, there exists an integer m0 such that there exists only finitely many elements h of G such that d(x, hx), d(g m0 x, hg m0 x) ≤ r. Remark 1.10. If g is a Morse element, then the WPD condition is equivalent to the following strengthening, by [22, Lemma 2.7]: For every r ≥ 0 and every point x of X, there exists an integer m0 such that for every m ≥ m0 , there exists only finitely many elements h of G such that d(x, hx), d(g m x, hg m x) ≤ r. Let us now recall a useful criterion of Bestvina–Bromberg–Fujiwara to prove the acylindrical hyperbolicity of a group: Theorem 1.1 ( [1, Theorem H]). Let G be a group acting by isometries on a geodesic metric space X and let g be an infinite order element with quasi-isometrically embedded orbits. Assume that the following holds: • g is a strongly contracting element. • g satisfies the WPD condition. Then G is either virtually cyclic or acylindrically hyperbolic. 7 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) We are now ready to state our main criterion: Theorem 1.2 (Criterion for acylindrical hyperbolicity). Let G be a group acting by isometries on a geodesic metric space X. Let g be an infinite order element with quasi-isometrically embedded orbits. Assume that the following holds: • g is über-contracting (with respect to a system of checkpoints (hi S)i∈Z ), • g satisfies the following weakening of the WPD condition: There exists a constant m0 such that for every point s ∈ S and every m ≥ m0 , only finitely many elements of G fix pointwise s and g m s. Then G is either virtually cyclic or acylindrically hyperbolic. Before starting the proof, let us recall an elementary property of coarse projections on strongly contracting quasi-lines: Lemma 1.11 (coarsely Lipschitz projection). Let Λ be a strongly contracting quasi-line, and C a constant such that balls disjoint from γ project on Λ to subsets of diameter at most C. Let x, y two points of X and let π(x), π(y) be two closest-point projections on Λ. Then d(π(x), π(y)) ≤ max(C, 4d(x, y)). Proof. Let x, y be two points of X and consider the ball of radius d(x, y) around x. Then either this ball is disjoint from Λ, in which we case the strongly contracting assumption immediately implies that d(π(x), π(y)) ≤ C, or it contains a point of Λ, in which case the distance from x (respectively y) to any of its projection on Λ is at most d(x, y) (respectively 2d(x, y)), and thus d(π(x), π(y)) ≤ 4d(x, y). Before proving Proposition 1.2, we present a key lemma, which reduces the proof of the WPD condition to the WPD condition for points of the checkpoints. Lemma 1.12. Let g be an über-contracting element with system of checkpoints (Si )i∈Z and error constant L ≥ 0. Assume that there exists a constant m0 such that for every point s ∈ S and every m ≥ m0 , only finitely many elements of G fix pointwise s and g m s. Then g satisfies the WPD condition. Proof. Fix r > 0 and x ∈ X. We want to show that there exists an integer m ≥ 1 such that the coarse stabiliser Stabr (x, g m x), that is, the set of group elements gi such that d(x, gi x), d(g m x, gi g m x) ≤ r, is finite. S Let C be a constant such that balls disjoint from Λ := i Si project on Λ to subsets of diameter at most C. Let m := 8r + 2C + m0 (|S| + 1) + 2L, and consider group elements gi in Stabr (x, g m x). Let Qx be a geodesic path between x and g m x. The constant m has been chosen so that closest-point projections on Λ of gi x and gi g m x are at distance at least m0 |g|(|S|+1)+2L by 8 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) Lemma 1.11. Let S1 , . . . , Sk be the checkpoints of Λ coarsely separating πΛ (x) and πΛ (g m x) and which are at distance at least L from πΛ (x) and πΛ (g m x). Note that k ≥ m0 (|S|+1) by construction. In particular, for each gi ∈ Stabr (x, g m x) there exist two distinct checkpoints of Λ, say S, S 0 ∈ {S1 , . . . , Sk }, and two points s ∈ S and s0 ∈ S 0 such that s0 = g m s with m ≥ m0 , such that gi Qx contains s and s0 . This allows us to define a map φ (using the same notation as in the previous paragraph): Stabr (x, g m x) → ∪1≤j≤k Sj × ∪1≤j≤k Sj × Qx × Qx 0 gi 7→ (s, s , gi−1 s, gi−1 s0 ). (1) (2) Notice that the target is finite. Let F be the preimage of an element in the image of φ. Choose an element f0 ∈ F and consider the set F f0−1 of elements of G of the form f f0−1 , f ∈ F . Then elements of F f0−1 fix both s and s0 by construction. As s0 = g m s with m ≥ m0 , it follows that F f0−1 , and hence F , is finite by the weak WPD condition. It now follows that Stabr (x, g m x) is finite. Proof of Proposition 1.2. Let g be an element of G as in the statement of the Theorem and let (Si )i∈Z and L ≥ 0 be a system of checkpoints as in Definition 1.3. By [1, Theorem H], it is enough to show that g is strongly contracting and satisfies the WPD condition. The first part follows directly from Remark 1.7. Since there are only finitely many elements in ∪Si modulo the action of hgi, we choose m0 ≥ 1 such that for every point s ∈ ∪Si such that for every m > m0 , there exists only finitely many elements fixing both s and g m s. The second part follows directly from Lemma 1.12 2 A local criterion In this section, we give a method for constructing über-contractions for groups acting on polyhedral complexes with some vertices having unbounded links. This allows us to give a second, more local, criterion for proving the acylindrical hyperbolicity of such groups. 2.1 The Strong Concantenation Property Definition 2.1 (angle). Let X be a polyhedral complex. The angle at a vertex v between two edges of X containing v is their (possibly infinite) distance in the 1-skeleton of the link of v (where each edge of that graph is given length 1). For two geodesic paths γ, γ 0 starting at a vertex v, the angle at v between γ and γ 0 , denoted ∠v (γ, γ 0 ), is the angle at v between the associated edges of γ and γ 0 . Finally, for vertices v, w, w0 of X, we define the angle ∠v (w, w0 ) as the minimum of the angle ∠v (γ, γ 0 ) where γ (respectively γ 0 ) ranges over the combinatorial geodesics between v and w (respectively w0 ). The following definition mimicks the strong properties of geodesics in CAT(0) spaces. 9 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) Definition 2.2. We say that a complex satisfies the Strong Concatenation Property with constants (A, R) if the following two conditions hold: • Let γ1 , γ2 be to geodesics of X meeting at a vertex v. If ∠v (γ1 , γ2 ) > A, then γ1 ∪ γ2 is a geodesic of X. • Let γ be a geodesic segment of X, v a vertex of γ. Let x, y be two vertices of X, π(x), π(y) be projections of x, y respectively on γ such that π(x) and π(y) are at distance strictly more than R from v. If γ makes an angle greater than A at v, then every geodesic between x and y contains v. Note that this property has the following immediate consequence, which allows for the construction of many über-contractions: Lemma 2.3 (Local criterion for über-contractions). Let X be a simply connected complex with the Strong Concatenation Property with constants (A, R). Then there exists a constant C such that the following holds: Let h be a hyperbolic isometry of X with axis γ and assume that for some vertex v of γ, the angle made by γ at v is at least C. Then h is über-contracting with respect to the system of checkpoints (hi v)i∈Z . This allows to give a local criterion to show the acylindrical hyperbolicity of a group: Proposition 2.4 (Link criterion for acylindrical hyperbolicity). Let X be a simply connected hyperbolic complex with the Strong Concatenation Property, together with an action by isometries of a group G. Assume that there exists a vertex v of X and a group element g such that: 1) the action of Gv on the link of v has unbounded orbits (for the simplicial metric on lk(v) where every edge has length 1), 2) the intersection Gv ∩ gGv g −1 is finite. Then G is either virtually cyclic or acylindrically hyperbolic. Remark 2.5. In the first item, one could require that the action of Gv on the link of v has large orbits, where large is defined in terms of constants appearing in the Strong Concatenation Property. Proof of Proposition 2.4. Choose a vertex v and a group element g satisfying 1) and 2). Choose an integer N greater than 8δ, where δ is the hyperbolicity constant of X. Let P be a geodesic between v and gv. By condition 1), choose an element h ∈ Gv such that P and ghP make an angle at least A. Then the element gh is an über-contraction, with ((gh)n v)n∈Z as a system of gates. for every i, (gh)i P and (gh)i+1 P make an S Indeed, angle of at least A. In particular, i∈Z (gh)i P is a geodesic by the Strong Concatenation 10 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) Property and thus gh is a hyperbolic isometry with axis γ. Such an axis turns out to be über-contracting by Lemma 2.3. Moreover, gh satisfies the so-called WPD condition by condition 2) and Lemma 1.12. Hence the result follows from Proposition 1.2. 2.2 Complexes with the Strong Concatenation Property We now give two simple properties that imply the Strong Concatenation Property. The first one is reminiscent of features of CAT(0) spaces. Definition 2.6 (bounded angle of view). We say that a simply connected complex X has an angle of view of at most A ≥ 0 if there exists a constant A such that for every vertices x, y of X and every vertex z of X which does not lie on a geodesic between x and y, we have ∠z (x, y) ≤ A. We say that X has a bounded angle of view if there exists a constant A ≥ 0 such that X has an angle of view of at most A. Example 2.7. CAT(0) spaces have an angle of view of at most π. This weak condition seems to be satisfied by many natural examples of complexes that are non-positively curved in a broad sense. For instance, it follows from the classification of geodesic triangles by Strebel [23] that simply connected C 0 (1/6) complexes in the sense of McCammond–Wise [18] have a bounded angle of view. The result also holds for systolic complexes. Lemma 2.8. Simply connected complexes with an angle of view at most A have the Strong Concatenation Property with constants (3A, 0). Proof. From the bounded angle of view condition, it is immediate that the concatenation of two geodesics making an angle greater than A is again a geodesic. Let us now consider the case of a geodesic segment γ of X, and let v be a vertex of γ. Let x, y be two vertices of X, π(x), π(y) be projections of x, y respectively on γ such that π(x) and π(y) are distinct from v. If there exists a geodesic γx,y between x and y not containing v, we choose geodesics γv,x , γv,y between v and x (respectively between v and y), geodesics γx , γy between x and a point x0 of πγ (x) (respectively between y and a pointy 0 of πγ (y)), and let γv,x0 , γv,y0 be the sub-segments of γ between v and x0 (respectively between v and y 0 ). By assumption, v does not belong to γx ∪ γx,y ∪ γy , so we get ∠v (γ) ≤ ∠v (γv,x0 , γv,x ) + ∠v (γv,x , γv,y ) + ∠v (γv,y , γv,y0 ) ≤ 3A, which concludes the proof. Remark 2.9. If X has a bounded angle of view, it is not necessary to require the S space to be hyperbolic in the statement of Proposition 2.4, as one can check directly that i∈Z (gh)i P is a geodesic in the proof of Proposition 2.4. 11 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) The second property, more algorithmic in nature, is particularly suitable for hyperbolic complexes which are not known to have such a rich combinatorial geometry. Definition 2.10. We say that a simply connected polyhedral complex satisfies an isoperimetric inequality if there exists a function ϕ : N → N such that every embedded loop of length n can be filled by a combinatorial disc of area at most ϕ(n). Lemma 2.11. Simply connected hyperbolic complexes satisfying an isoperimetric inequality have the Strong Concatenation Property. Proof. Let δ be the hyperbolic constant of X, and ϕ its isoperimetric function. We start by the first condition. Let γ1 , γ2 be two geodesics of X meeting at a vertex v, and γ a geodesic between the two endpoints of the path γ1 ∪ γ2 . For i ∈ {1, 2}, if |γi | > 2δ, choose the point xi ∈ γi at distance 2δ from v. By the hyperbolicity condition, xi is at distance at most δ from the other two sides of the geodesic triangle γ1 ∪ γ2 ∪ γ, so choose a point ui ∈ γ1 ∪ γ2 ∪ γ at distance at most δ from vi , and which is not on γi . Choose a geodesic path τui ,vi between ui and vi . If |γi | ≤ 2δ, set vi = ui to be the endpoint of γi distinct from v. If γ does not contain v, then one could extract from the loop (γ1 )v,v1 ∪ τv1 ,u1 ∪ (γ)u1 ,u2 ∪ τu2 ,v2 ∪ (γ2 )v2 ,v an embedded loop of length at most 12δ containing a neighbourhood of v in γ1 ∪ γ2 . In particular, this implies that ∠v (γ1 , γ2 ) ≤ ϕ(12δ). Let us now show the second condition. Let γ be a geodesic segment of X, v a vertex of γ. Let x, y be two vertices of X, π(x), π(y) be projections of x, y respectively on γ, such that π(x) and π(y) are at distance at least 100δ from v. Let us assume that there exists a geodesic γx,y between x and y which does not contain v. Let γ 0 be the sub-segment of γ centred at v and of length 100δ. Using the theorem of approximation by trees in a hyperbolic space [9, Thm. 1 Ch. 8] , it follows that there 0 0 exists a sub-segment γx,y of γx,y such that γ 0 and γx,y are at Hausdorff distance at most 8δ. 0 0 Projecting the endpoints of γ to γx,y , it is thus possible to construct an embedded loop of X, of length at most 300δ, which contains γ 0 . By filling this loop, it follows that the angle of γ at v is bounded above by ϕ(300δ). Thus X satisfies the Strong Concatenation Property with constants (ϕ(300δ), 100δ). Remark 2.12. Note that non locally finite hyperbolic complexes do not necessarily satisfy any isoperimetric inequality, let alone a linear one. For instance, consider the suspension of the simplicial real line, with its triangular complex structure. Given any number n, there exists a geodesic bigon of length 4 between the two apices that require at least n triangles to be filled. 12 A. Martin 3 On the acylindrical hyperbolicity of Tame(SL2 (C)) Application: The tame automorphism group of SL2 (C) Here we use the Criterion 2.4 to study the subgroup Tame(SL2 ) ⊂ Bir(P3 (C)). We prove the following: Theorem 3.1. The group Tame(SL2 ) is acylindrically hyperbolic. Recall that Tame(SL2 ) can be defined (see [3, Proposition 4.19]) as the subgroup Tameq (C4 ) of Aut(C4 ) generated by the orthogonal group O(q) associated to the quadratic form q(x1 , x2 , x3 , x4 ) = x1 x4 − x2 x3 and the subgroup consisting of automorphisms of the form (x1 , x2 , x3 , x4 ) 7→ (x1 , x2 + x1 P (x1 , x3 ), x3 , x4 + x3 P (x1 , x3 )), P ∈ C[x1 , x3 ]. This group was studied in [3] from the point of view of its action on a CAT(0) square complex X, which we now describe. Vertices of X. To each element (f1 , f2 , f3 , f4 ) of Tame(SL2 (C)), one associates: • a vertex [f1 ], said of type 1, corresponding to the orbit C∗ · f1 , • a vertex [f1 , f2 ], said of type 2, corresponding to the orbit GL2 (C) · (f1 , f2 ), • a vertex [f1 , f2 , f3 , f4 ], said of type 3, corresponding to the orbit O(q) · (f1 , f2 , f3 , f4 ). Edges of X. To each element (f1 , f2 , f3 , f4 ) of Tame(SL2 (C)), one associates: • an edge joining the type 1 vertex [f1 ] and the type 2 vertex [f1 , f2 ]. • an edge joining the type 2 vertex [f1 , f2 ] and the type 3 vertex [f1 , f2 , f3 , f4 ]. Squares of X. To each element (f1 , f2 , f3 , f4 ) of Tame(SL2 (C)), one associates a square with vertex set being, in cyclic order, [f1 ], [f1 , f2 ], [f1 , f2 , f3 , f4 ], [f1 , f3 ]. Action of Tame(SL2 (C)). The group Tame(SL2 (C)) acts by isometries on X as follows. For every element (f1 , f2 , f3 , f4 ) of Tame(SL2 (C)) and every g of Tame(SL2 (C)), we set: • g · [f1 ] := [f1 ◦ g −1 ], • g · [f1 , f2 ] := [f1 ◦ g −1 , f2 ◦ g −1 ], • g · [f1 , f2 , f3 , f4 ] := [f1 ◦ g −1 , f2 ◦ g −1 , f3 ◦ g −1 , f4 ◦ g −1 ]. A central result of [3] is the following: Theorem 3.2. The square complex X is CAT(0) and hyperbolic. 13 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) We recall further properties of the action that we will need. Proposition 3.1 ( [3, Lemma 2.7] ). The action is transitive on the squares of X, and the pointwise stabiliser of a given square is conjugate to the subgroup {(x1 , x2 , x3 , x4 ) 7→ (ax1 , b(x2 +cx1 ), b−1 (x3 +dx1 ), a−1 (x4 +cx3 +dx2 )), a, b, c, d ∈ C, ab 6= 0} of Tame(SL2 ). Proposition 3.2 ( [3, Propositions 3.6, 3.7 and 4.1] ). The link of a vertex of type 1 has infinite diameter. Moreover, the action of the stabiliser of such a vertex on its link has unbounded orbits. We want to construct a super-contraction for this action. To that end, we will use the following hyperbolic isometry considered in [3]: Lemma 3.3 ( [3, Example 6.2] ). The element g ∈ Tame(SL2 ) defined by g(x1 , x2 , x3 , x4 ) =:= (x4 + x3 x21 + x2 x21 + x51 , x2 + x31 , x3 + x31 , x1 ) acts hyperbolically on X. More precisely, there exists a 4 × 4 grid isometrically embedded in X and a vertex v of type 1, such that the vertices v, gv, g 2 v are as in Figure 1. v C gv gC g2v Figure 1: The 4 × 4 grid K isometrically embedded in X, together with vertices v, gv and g 2 v (black dots), and squares C and gC (shaded). 14 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) Proof of Theorem 3.1. Let v, K be the vertex and 4 × 4 grid of X mentioned in Lemma 3.3. We show that we can apply the Criterion 2.4 to g 2 and v. Note that Item 1) of Criterion 2.4 follows from Proposition 3.2. We now show that v and g 2 v have a finite common stabiliser, that is, that their stabilisers intersect along a finite subgroup. Let C be the top-left square of K, as indicated in Figure 1. We start by showing that C and gC have a finite common stabiliser. Indeed, Stab(C) is conjugated to the subgroup defined by elements of the form f (x1 , x2 , x3 , x4 ) = (ax1 , b(x2 +cx1 ), b−1 (x3 +dx1 ), a−1 (x4 +cx3 +dx2 )), a, b, c, d ∈ C, ab 6= 0, by Proposition 3.1. Now an equation of the form gf = f 0 g, with f, f 0 of the previous form, with coefficients a, b, c, d and a0 , b0 , c0 , d0 respectively, yields the following equation, when isolating the first coordinate: a−1 (x4 +cx3 +dx2 )+a2 b−1 x21 (x3 +dx2 )+a2 bx21 (x2 +cx1 )+a5 x5 = a0 (x4 +x3 x21 +x2 x21 +x51 ). Isolating the various monomials, we successively get a6 = 1, b6 = 1 and c = d = 0 (and analogous equalities for a0 , b0 , c0 , d0 ), hence Stab(C) ∩ gStab(C)g −1 is finite, and thus C and gC have a finite common stabiliser. This in turn implies that v and g 2 v have a finite common stabiliser. Indeed, the combinatorial interval between v and g 2 v is exactly K, as combinatorial intervals embed isometrically in R2 with its square structure by [5, Theorem 1.16]. Thus, up taking a finite index subgroup, elements fixing v and g 2 v will fix pointwise K, and in particular C and gC. Since CAT(0) spaces a have bounded angle of view by Example 2.7, one can thus apply Criterion 2.4 to conclude. REFERENCES [1] M. Bestvina, K. Bromberg, and K. Fujiwara. Constructing group actions on quasi-trees and applications to mapping class groups. Publ. Math. Inst. Hautes Études Sci., in press, 2014. [2] M. Bestvina and M. Feighn. A hyperbolic Out(Fn )-complex. Groups Geom. Dyn., 4(1):31–58, 2010. [3] C. Bisi, J.-P. Furter, and S. Lamy. The tame automorphism group of an affine quadric threefold acting on a square complex. Journal de l’Ecole Polytechnique, 1:161–223, 2014. [4] B. H. Bowditch. Tight geodesics in the curve complex. Invent. Math., 171(2):281–300, 2008, doi:10.1007/s00222-007-0081-y. [5] J. Brodzki, S. J. Campbell, E. Guentner, G. A. Niblo, and N. J. Wright. Property A and CAT(0) cube complexes. J. Funct. Anal., 256(5):1408–1431, 2009. [6] S. Cantat. Sur les groupes de transformations birationnelles des surfaces. Ann. of Math. (2), 174(1):299–340, 2011. [7] S. Cantat and S. Lamy. Normal subgroups in the Cremona group. Acta Math., 210(1):31–94, 2013. With an appendix by Yves de Cornulier. [8] P.-E. Caprace and D. Hume. Orthogonal forms of Kac-Moody groups are acylindrically hyperbolic. Ann. Inst. Fourier, in press, 2015. 15 A. Martin On the acylindrical hyperbolicity of Tame(SL2 (C)) [9] M. Coornaert, T. Delzant, and A. Papadopoulos. Géométrie et théorie des groupes, volume 1441 of Lecture Notes in Mathematics. Springer-Verlag, Berlin, 1990. Les groupes hyperboliques de Gromov. [Gromov hyperbolic groups], With an English summary. [10] F. Dahmani, V. Guirardel, and D. Osin. Hyperbolically embedded subgroups and rotating families in groups acting on hyperbolic spaces. Mem. Amer. Math. Soc., in press, 2012. [11] J. Déserti. Sur les automorphismes du groupe de Cremona. Compos. Math., 142(6):1459–1478, 2006. [12] J. Déserti. Le groupe de Cremona est hopfien. C. R. Math. Acad. Sci. Paris, 344(3):153–156, 2007. [13] D. Gruber and A. Sisto. Infinitely presented graphical small cancellation groups are acylindrically hyperbolic. arXiv:1408.4488v2, 2014. [14] H. W. E. Jung. Über ganze birationale Transformationen der Ebene. J. Reine Angew. Math., 184:161– 174, 1942. [15] S. Lamy and S. Vénéreau. The tame and the wild automorphisms of an affine quadric threefold. J. Math. Soc. Japan, 65(1):299–320, 2013. [16] A. Lonjou. Non simplicité du groupe de Cremona sur tout corps. arXiv:1503.03731v2, 2015. [17] A. Martin. Acylindrical actions on CAT(0) square complexes. arXiv: 1509.03131, 2015. [18] J. P. McCammond and D. T. Wise. Fans and ladders in small cancellation theory. Proc. London Math. Soc. (3), 84(3):599–644, 2002, doi:10.1112/S0024611502013424. [19] A. Minasyan and D. Osin. Acylindrically hyperbolic groups acting on trees. Math. Ann., in press, 2015. [20] D. Osin. Acylindrically hyperbolic groups. Trans. Amer. Math. Soc., in press, 2015. [21] Z. Sela. Acylindrical accessibility for groups. Invent. Math., 129(3):527–565, 1997, doi:10.1007/s002220050172. [22] A. Sisto. Contracting elements and random walks. to be published in Crelle, arXiv:1112.2666v2, 2013. [23] R. Strebel. Appendix. Small cancellation groups. In Sur les groupes hyperboliques d’après Mikhael Gromov (Bern, 1988), volume 83 of Progr. Math., pages 227–273. Birkhäuser Boston, Boston, MA, 1990. [24] W. van der Kulk. On polynomial rings in two variables. Nieuw Arch. Wiskunde (3), 1:33–41, 1953. 16
4math.GR
ROOT DATA WITH GROUP ACTIONS arXiv:1707.01935v1 [math.RT] 6 Jul 2017 JEFFREY D. ADLER AND JOSHUA M. LANSKY Abstract. Suppose k is a field, G is a connected reductive algebraic k-group, T is a maximal k-torus in G, and Γ is a finite group that acts on (G, T ). From the above, one obtains a root datum Ψ on which Gal(k)×Γ acts. Provided that Γ preserves a positive system in Ψ, not necessarily invariant under Gal(k), we construct an inverse to this process. That is, given a root datum on which Gal(k) × Γ acts, we show how to construct a pair (G, T ), on which Γ acts as above. Although the pair (G, T ) and the action of Γ are canonical only up to an equivalence relation, we construct a particular pair for which G is k-quasisplit and Γ fixes a Gal(k)-stable pinning of G. Using these choices, we can define a notion of taking “Γ-fixed points” at the level of equivalence classes, and this process is compatible with a general “restriction” process for root data with Γ-action. 1. Introduction Let k be a field with separable closure ksep . Let Γ be a finite group. Suppose Ψ is a (reduced) based root datum on which the absolute Galois group Gal(k) acts. Then it is well known ([7, Theorem 6.2.7]) that there exists a connected, reductive, k-quasisplit k-group G, uniquely determined up to k-isomorphism, such that the root datum of G (with respect to a maximal k-torus contained in a Borel k-subgroup) is isomorphic to Ψ and carries the same action of Gal(k). We generalize this result in two directions. (A) Suppose G is a connected reductive k-group, and T is an arbitrary maximal torus. Then the root datum Ψ(G, T ) carries an action of Gal(k). We show that one can reverse this process. That is, given a root datum Ψ with an action of Gal(k), one can obtain a pair (G, T ) that gives rise to Ψ. In general, the pair (G, T ) need not be uniquely determined up to k-isomorphism. However, we can always choose G to be k-quasisplit, and all possibilities for G must be k-inner forms of each other. (B) Now suppose that Γ acts on a pair (G, T ) as above via k-automorphisms. Then Γ acts on the root datum Ψ(G, T ), and the actions of Γ and Gal(k) commute. We show that one can reverse this process under mild Date: February 22, 2018. 2010 Mathematics Subject Classification. Primary 20G15, 20G40. Secondary 20C33. Key words and phrases. Reductive algebraic group, root datum, quasi-semisimple automorphisms. 1 2 JEFFREY D. ADLER AND JOSHUA M. LANSKY conditions. That is, suppose that Ψ is a root datum with an action of Gal(k) × Γ. Assume that Γ (but not necessarily Gal(k)) preserves a base. Then one can obtain a pair (G, T ) as above, carrying an action of Γ. That is, under appropriate conditions, we can lift an action of Γ from a root datum to a reductive group. Moreover, one can choose G to be k-quasisplit, and can choose the action of Γ to preserve a pinning. The above are all contained in our main result, Theorem 1. In order to state it more precisely, let us consider the collection of abstract root data Ψ that carry an action of Gal(k) × Γ such that the action of Γ stabilizes a base for Ψ. We consider two data Ψ and Ψ′ with such actions to be equivalent if there is a Gal(k) × Γ-equivariant isomorphism Ψ −→ Ψ′ . Let RΓ denote the set of equivalence classes of reduced data with such actions. Let G be a connected reductive k-group and T ⊆ G a maximal k-torus. Suppose there exists some Borel subgroup B ⊆ G (not necessarily defined over k) containing T , and a homomorphism ϕ from Γ to the group Autk (G, B, T ) of k-automorphisms of G stabilizing T and B. Suppose G′ , T ′ , and ϕ′ are defined similarly. We say that the triples (G, T, ϕ) and (G′ , T ′ , ϕ′ ) are equivalent if there exists an isomorphism ν : G −→ G′ whose restriction gives a Γ-equivariant k-isomorphism T −→ T ′ . (In this situation, ν must be an inner twisting by [5, §3.2].) Let TΓ be the set of equivalence classes of such triples (G, T, ϕ). A triple (G, T, ϕ) as above naturally determines a root datum with appropriate actions of Gal(k) and Γ, hence an element of RΓ . It is easily seen that if (G′ , T ′ , ϕ′ ) and (G, T, ϕ) are equivalent, then they determine the same class in RΓ . Hence we have a natural map rΓ : TΓ −→ RΓ . Our main result is the following: Theorem 1. The map rΓ : TΓ −→ RΓ is a bijection. We also prove a generalization of a second well-known result. Suppose char k = 0, and Γ is a finite, cyclic group acting algebraically on a connected reductive group G. Then Γ must fix a Borel-torus pair (B, T ) in G. If Γ fixes a pinning, then the root system of the connected part Ḡ := (GΓ )◦ of the group of fixed points is obtained as follows. The set of restrictions of roots of G from T to T̄ := (T Γ )◦ is a root system, not necessarily reduced, but there is a preferred way to choose a maximal reduced subsystem. We generalize the above result in several directions. (C) Instead of assuming char k = 0, we impose the weaker condition that Γ fix a Borel-torus pair. (D) The group Γ need not be cyclic. (E) We describe the root datum, not just the root system, of Ḡ with respect to T̄ . The above are all contained in Theorem 2. To state this result more precisely, suppose that the triple (G, T, ϕ) represents an element of TΓ . Then we know [1, Proposition 3.5] that Ḡ is a connected reductive k-group, ROOT DATA WITH GROUP ACTIONS 3 and T̄ is a maximal k-torus in Ḡ. Thus, if we let “1” represent the map from the trivial group 1 to Aut(G), then the triple (Ḡ, T̄ , 1) represents an element of T1 . The equivalence class of (G, T, ϕ) does not determine that of (Ḡ, T̄ , 1), or even the ksep -isomorphism class of Ḡ. Nonetheless, we can obtain a well-defined map TΓ −→ T1 as follows: From Remark 25, we will see that every class in TΓ contains a triple (G, T, ϕ) such G is k-quasisplit and ϕ fixes a Gal(k)-invariant pinning. Use this choice of triple to define Ḡ and T̄ , and it is straightforward to show that our choices determine Ḡ and T̄ up to k-isomorphism. Suppose that the root datum Ψ represents an element of RΓ . We will see in §2 that the action of Γ on Ψ allows us to construct a “restricted” root datum Ψ̄ that has a preferred choice of reduced subdatum. We thus obtain a map RΓ −→ R1 . Theorem 2. Our maps TΓ −→ T1 and RΓ −→ R1 above are compatible with the maps of Theorem 1, in the sense that the following diagram commutes: rΓ // RΓ TΓ  T1 r1  // R1 We prove both theorems in §4. 2. Restrictions of root data Let Ψ = (X ∗ , Φ, X∗ , Φ∨ ) be a root datum. (We do not assume that Φ is reduced.) Let Γ denote a finite group of automorphisms of Ψ. We assume that there exists a Γ-stable set ∆ of simple roots in Φ. Let V ∗ = X ∗ ⊗ Q and V∗ = X∗ ⊗ Q. Let i∗ denote the quotient map from V ∗ to its space V̄ ∗ := VΓ∗ of Γ-coinvariants. From [1, §2], there is an embedding ι : V̄ ∗ −→ V ∗ with image V ∗ Γ given by 1 X ι(v̄) = γv, |Γ| ∗ γ∈Γ V̄ ∗ . Let where v is any preimage in V of v̄ ∈ X̄ ∗ and Φ̄ denote the images ∗ ∗ ∗ of X and Φ under i . Then X̄ is the torsion-free part of the module XΓ∗ of Γ-coinvariants of X ∗ . It is straightforward to see that X̄ ∗ and X̄∗ := X∗Γ , and thus V̄ ∗ and V̄∗ := V∗Γ , are in duality via the pairing given by hx̄, λ̄i := hιx̄, i∗ λ̄i, where i∗ : X̄∗ −→ X∗ is the inclusion map. With respect to these pairings, i∗ is the transpose of i∗ . For each β ∈ Φ, let wβ denote the automorphism of X ∗ defined by wβ (x) = x − hx, β ∨ iβ. Let W denote the Weyl group of Ψ, i.e., the (finite) subgroup of Aut(X ∗ ) generated by the wβ . Then Γ acts naturally on W , and W acts on X ∗ . The group W Γ of Γ-fixed elements of W acts on on both V̄ ∗ and X̄ ∗ via the rule 4 JEFFREY D. ADLER AND JOSHUA M. LANSKY w(i∗ x) := i∗ (w(x)) for w ∈ W Γ and x ∈ X ∗ . Equivalently, for x̄ ∈ X̄ ∗ and w ∈ W Γ , we have ι(w(x̄)) = w(ιx̄). Lemma 3 (cf. [8, §1.32(a)]). The natural action of W Γ on X̄ ∗ is faithful. Proof. Let w be a nontrivial element of W Γ . Then there exists a positive root β ∈ Φ such that w(β) is negative. Since Γ stabilizes ∆, it follows that w(γ ·β) = γ ·(wβ) is also negative for every γ ∈ Γ. Thus ι(w(i∗ β)) is a linear combination of roots in ∆ in which all of the coefficients are nonpositive, so w(i∗ β) 6= i∗ β.  Notation 4. For each root β ∈ Φ, define a Γ-orbit Ξβ in Φ as in [1, §5]. That is, let Ξβ = Γ · β if this is an orthogonal set. Otherwise, for each θ ∈ Γ · β, there exists a unique root θ ′ 6= θ in Γ · β such that θ and θ ′ are not orthogonal. Moreover, θ + θ ′ is a root in Φ and does not belong to Γ · β. In this case, let Ξβ = {θ + θ ′ | θ ∈ Γ · β}. Remark 5. Thus, in all cases, Ξβ is an orthogonal Γ-orbit of roots. Lemma 6. If α ∈ Φ̄, then i∗−1 (α) is a Γ-orbit of roots in Φ. Proof. This argument is similar to but more general than that given in the proof of [6, Lemma 10.3.2(ii)]. Suppose β ∈ Φ and i∗ (β) = α. Then clearly i∗ θ = α for any θ ∈ Γ · β. Now suppose β ′ ∈ Φ, β ′ 6= β, and i∗ β ′ = α. Since ι(i∗ (β ′ − β)) = 0 and since Γ preserves ∆, when β ′ − β is written as a linear combination of simple roots, the coefficients must sum to 0. In particular, β ′ − β ∈ / Φ. Since β ′ ′ ∨ cannot be multiple of β, we have that hβ , β i ≤ 0 by standard results about root systems. Similarly, hβ ′ , θ ∨ i ≤ 0 for all θ 6= β ′ in Γ · β. Therefore, D E D E X X X E D β ′ − β, θ ∨ = i∗ (β ′ − β), θ ∨ = β ′ − β, i∗ θ∨ , θ∈Γ·β θ∈Γ·β i∗ (β ′ θ∈Γ·β ′ ∨ and since − β) = 0, this pairing vanishes. Thus θ∈Γ·β hβ , θ i = P ∨ θ∈Γ·β hβ, θ i = 2 or 1, depending on whether or not Γ · β is orthogonal. (This follows from the properties of root orbits discussed in [1, §5].) Since hβ ′ , θ ∨ i ≤ 0 for all θ 6= β ′ in Γ · β, it follows that β ′ ∈ Γ · β.  P For each α ∈ Φ̄, define α∨ = |Γ · β| X ∨ ξ ∈ X̄∗ , |Ξβ | ξ∈Ξβ where β is any element of Φ such that i∗ β = α. The element of X̄∗ defined by the above formula is independent of the particular choice of β by Lemma 6. Note that α∨ does indeed lie in X̄∗ since |Γ · β|/|Ξβ | = 1 or 2. Let Φ̄∨ = {α∨ | α ∈ Φ̄}. Theorem 7. With the above notation, Ψ̄ := (X̄ ∗ , Φ̄, X̄∗ , Φ̄∨ ) is a root datum. ROOT DATA WITH GROUP ACTIONS 5 Remark 8. If Ψ comes equipped with an action of Gal(k), and the action of Γ commutes with that of Gal(k), then it is clear that the action of Gal(k) preserves Ψ̄. Proof of Theorem 7. According to [5, §1.1], it suffices to show that • X̄ ∗ and X̄∗ are in duality (which we have already observed), • hα, α∨ i = 2 for all α ∈ Φ̄, and • The automorphisms wα of X̄ ∗ of the form wα (x̄) = x̄ − hx̄, α∨ iα (for α ∈ Φ̄) stabilize Φ̄ and generate a finite subgroup of Aut(X̄ ∗ ). Let α ∈ Φ̄. Choose β ∈ Φ such that i∗ β = α, and choose ξ0 ∈ Ξβ . Then we have hα, α∨ i = hια, i∗ α∨ i D 1 X |Γ · β| X ∨ E ξ θ, = |Γ · β| |Ξβ | θ∈Γ·β ξ∈Ξβ E D X X 1 = ξ∨ θ, |Ξβ | θ∈Γ·β ξ∈Ξβ 1 D X ′ X ∨E = ξ, ξ |Ξβ | ′ ξ ∈Ξβ (by the definition of Ξβ ) θ∈Ξβ hξ0 , ξ0∨ i = = 2, (by Remark 5) as desired. Now let x̄ ∈ X̄ ∗ , and choose x ∈ X ∗ such that i∗ x = x̄. Then (9) hx̄, α∨ i = hx, i∗ α∨ i D |Γ · β| X E (by Remark 5) ξ∨ = x, |Ξβ | ξ∈Ξβ |Γ · β| X hx, ξ ∨ i. = |Ξβ | ξ∈Ξβ 6 JEFFREY D. ADLER AND JOSHUA M. LANSKY It follows that wα (x̄) = x̄ − hx̄, α∨ iα = i∗ x − hx̄, α∨ ii∗ β hx̄, α∨ i ∗  X  i θ = i∗ x − |Γ · β| (by Lemma 6) θ∈Γ·β hx̄, α∨ i ∗  X ′  ξ i |Γ · β| ξ ′ ∈Ξβ X  1 X = i∗ x − hx, ξ ∨ ii∗ ξ′ |Ξβ | ξ∈Ξβ ξ ′ ∈Ξβ  1 X  X ξ′ . hx, ξ ∨ ii∗ = i∗ x − |Ξβ | ′ = i∗ x − ξ∈Ξβ (by the definition of Ξβ ) (by (9)) ξ ∈Ξβ But by Remark 5, for any ξ ∈ Ξβ ,  1 X  i∗ ξ ′ = i∗ ξ, |Ξβ | ′ ξ ∈Ξβ so we have (10)   X wα (x̄) = i∗ x − x, ξ ∨ ξ . ξ∈Ξβ Also by Remark 5, the reflections wξ ∈ W for ξ ∈ Ξβ all commute with one another. If w denotes their product, then X hx, ξ ∨ iξ = w(x), x− ξ∈Ξβ so by (10), we have (11) wα (x̄) = i∗ (w(x)). In particular, if α′ ∈ Φ̄, and β ′ ∈ Φ satisfies i∗ β ′ = α′ , then wα (α′ ) = i∗ (w(β ′ )) ∈ i∗ (Φ) = Φ̄, so Φ̄ is stable under the action of wα , as desired. It remains to show that the group W̄ := hwα | α ∈ Φ̄i ⊂ Aut(X̄ ∗ ) is finite. To accomplish this, we show that W̄ embeds naturally in the finite group W Γ . By Lemma 3, there is a natural injection W Γ −→ Aut(X̄ ∗ ). To construct an embedding W̄ −→ W Γ , it is therefore enough to show that the image of this injection contains W̄ . Thus, given w̄ ∈ W̄ , we will show that there exists w ∈ W Γ whose action on X̄ ∗ coincides with that of w̄. It suffices to prove the existence of w only in the caseQin which w̄ is a reflection wα through a root α ∈ Φ̄. In this case, let w = ξ∈Ξβ wξ , where β ∈ Φ is ROOT DATA WITH GROUP ACTIONS 7 such that i∗ β = α. It follows from Remark 5 that w ∈ W Γ , and it follows from (11) that for any x ∈ X ∗ , wα (i∗ x) = i∗ (w(x)) = w(i∗ x). This establishes the existence of the desired embedding.  Remark 12. If Φ is reduced, then so is the root system Φ̄ constructed above, unless Φ has an irreducible factor of type A2n whose stabilizer in Γ acts upon it nontrivially. To see this, it is easy to reduce to the case where Φ is irreducible and Γ is cyclic (see [1, Proposition 3.5]). The result then follows from [3, §1.3]. Remark 13. There is a way to choose a maximal reduced subsystem that we will later see is preferred. Specficially, take only the nondivisible (resp. nonmultipliable) roots of Φ̄ according as char k is not two (resp. two). Lemma 14. The map i∗ induces a bijection between the set of Γ-invariant positive systems in Φ and the set of positive systems in Φ̄. Proof. Let Π ⊆ Φ be a Γ-invariant positive system. Let Π̄ = i∗ (Π) ⊆ Φ̄. Then there is some vector v ∈ V∗ such that for every root β ∈ Φ, we have that hβ, vi = 6 0, and P hβ, vi > 0 if and only if β ∈ Π. Since Π is Γ-invariant, we may replace v by γ∈Γ γv, and thus assume that v is Γ-invariant, and so lies in V̄∗ . Suppose α ∈ Φ̄. Then α = i∗ β for some β ∈ Φ, so hα, vi = hβ, vi. Thus, hα, vi = 6 0, and hα, vi > 0 if and only if α ∈ Π̄. This shows that Π̄ is a positive system in Φ̄. Conversely, suppose that Π̄ ⊆ Φ̄ is a positive system, and let Π = i∗ −1 Π̄. Then there is some vector v̄ ∈ V̄∗ such that for every root α ∈ Φ̄, we have that hα, v̄i = 6 0, and hα, v̄i > 0 if and only if α ∈ Π̄. For every root β ∈ Φ, we have hβ, i∗ vi = hi∗ β, vi, which is never zero, and is positive if and only if β ∈ Π. Thus, Π ⊂ Φ is a positive system. Since i∗ v is Γ-invariant, so is Π.  Corollary 15. Let W̄ be the Weyl group of Ψ̄. Then the embedding of W̄ into W Γ in the proof of Theorem 7 is an isomorphism. Proof. Since W̄ acts simply transitively on the set of positive systems in Φ̄, and W Γ acts simply transitively on the set of Γ-invariant positive systems in Φ, the result follows from Lemma 14.  3. From automorphisms of root data to automorphisms of reductive groups Let Ψ = (X ∗ , Φ, X∗ , Φ∨ ) be a root datum on which a group Λ acts via automorphisms. Choosing a root basis ∆ of Φ, we obtain a corresponding based root datum Ψ̇. Then Ψ̇ also carries an action of Λ. Namely, for σ ∈ Λ, there exists a unique element c(σ) in the Weyl group W (Ψ) of Ψ such that σ(∆) = c(σ)(∆). If we define σ ⋆ to be the automorphism of Ψ̇ given by (16) σ ⋆ χ = c(σ)−1 (σχ) 8 JEFFREY D. ADLER AND JOSHUA M. LANSKY for χ ∈ X ∗ , then the action of Λ on Ψ̇ is given by σ 7→ σ ⋆ . Since Λ acts on Ψ and Ψ̇, it acts naturally on Aut(Ψ) and Aut(Ψ̇), as well as on the Weyl groups W (Ψ) ⊂ Aut(Ψ) and W (Ψ̇) ⊂ Aut(Ψ̇). Just as the actions of Λ on Ψ̇ and on Ψ differ, so the actions of Λ on W (Ψ̇) and on W (Ψ) differ, even though the Weyl groups themselves are equal. For σ ∈ Λ and w ∈ W (Ψ̇), let (σ, w) 7→ σ ⋆ (w) denote the action of Λ on W (Ψ̇). Then we have σw = c(σ) (σ ⋆ w) c(σ)−1 . One can check readily that map c : Λ −→ W (Ψ̇) is a cocycle in Z 1 (k, W (Ψ̇)). We now turn our attention to based root data arising from reductive algebraic groups. Let G be a connected reductive k-group, B a Borel subgroup of G, and T ⊆ B a maximal torus of G. Let Ψ̇(G, B, T ) denote the corresponding based root datum. Any map ϑ ∈ Aut(G) determines an obvious isomorphism ϑ∗ : Ψ̇(G, B, T ) −→ Ψ̇(G, ϑ(B), ϑ(T )). There is a natural homomorphism π : Aut(G) −→ Aut(Ψ̇(G, B, T )) defined as follows. For ϑ ∈ Aut(G), choose gϑ ∈ G(ksep ) such that Int(gϑ ) takes ϑ(B) to B, and ϑ(T ) to T . Then Int(gϑ ) ◦ ϑ stabilizes B and T , and we let π(ϑ) be the automorphism (Int(gϑ ) ◦ ϑ)∗ of Ψ̇(G, B, T ) (which is, in fact, independent of the choice of gϑ ). Now suppose that T is defined over k. Then an element σ ∈ Gal(k) naturally determines an automorphism of Ψ(G, T ) hence an automorphism σ ⋆ of Ψ̇(G, B, T ) as defined in (16). We thus obtain an action of Gal(k) on Ψ̇(G, B, T ), hence one on Aut(Ψ̇(G, B, T )) as above. These actions are independent of the particular choice of B and T in the sense that if g ∈ G(ksep ) and σ ∈ Gal(k), then we have (17) σ ⋆ ◦ Int(g)∗ = Int(g)∗ ◦ σ ⋆ , where we use the notation σ ⋆ to denote both the action of σ on Ψ̇(G, B, T ) and on Ψ̇(G, g B, g T ). There is a well-known exact sequence (18) π 1 −→ Inn(G) −→ Aut(G) −→ Aut(Ψ̇(G, B, T )) −→ 1. We note that the homomorphisms in (18) are Gal(k)-equivariant. Remark 19. Let ∆ be the set of simple roots for (G, B, T ). Let {Xα }α∈∆ ⊂ Lie(G)(ksep ) be a pinning. It is well known [5, Cor. 2.14] that {Xα } determines a unique splitting ψ of (18). Namely, if f ∈ Aut(Ψ̇(G, B, T )), define ψ(f ) to be the automorphism of G such that • ψ(f ) stabilizes B and T , • the restriction of ψ(f ) to T is determined by the automorphism of X ∗ (T ) given by f , and ROOT DATA WITH GROUP ACTIONS 9 • ψ(f )(Xα ) = Xf (α) . Thus im ψ lies in the subgroup Aut(G, B, T, {Xα }) of Aut(G) consisting of automorphisms that stabilize B, T , and the pinning {Xα }. If B and T are defined over k, and {Xα } is Gal(k)-stable, it follows from [2, §3.10] that ψ is Gal(k)-equivariant. Lemma 20. Retain the notation of the previous remark, and assume that B and T are defined over k, and {Xα } is Gal(k)-stable. Suppose a group Γ acts on G via k-automorphisms, preserving B, T , and {Xα }. Then Ḡ = (GΓ )◦ is a reductive k-group, B̄ = (B Γ )◦ is a Borel k-subgroup of G, T̄ = (T Γ )◦ is a maximal k-torus in B, and W (G, T )Γ = W (Ḡ, T̄ ). We prove this result by reducing to the well-known case where Γ is cyclic. Proof. The statements about Ḡ and T̄ follow from [1, Proposition 3.5]. The lemma follows for G if it holds for a central quotient of G. Therefore, we may assume that (over ksep ) G is a direct product of almost simple groups. We can also reduce to the case where Γ acts transitively on the factors of G. As in the proof loc. cit., we may identify the factors of G with each other, and replace Γ by a group S × Γ1 such that Ḡ = (GS×Γ1 )◦ , where S acts by permuting the factors in our product decomposition of G, and Γ1 preserves each factor and acts in the same way on each. It is clear from the construction that S × Γ1 preserves {Xα }. Working in stages, we may assume that Γ is simple. Thus, either Γ acts by permutation of the factors of G, or G is simple. In the former case, our result is trivial, so assume that G is simple. Then G has a connected Dynkin diagram, whose automorphism group is solvable. Since Γ embeds in this automorphism group, it must be cyclic. We let Ψ = (X ∗ (T ), Φ(G, T ), X∗ (T ), Φ∨ (G, T )) and will freely use the notation of §2. We may identify X̄ ∗ with X ∗ (T̄ ). Under this identification, the restriction βres of a root β ∈ Φ(G, T ) to T̄ corresponds to i∗ β. It follows from [8, §8.2(2)] that since Γ fixes a pinning (i.e., cβ = 1 for each β ∈ ∆, in the terminology loc. cit.), then for each β ∈ Φ(G, T ), there exists a root α ∈ Φ(Ḡ, T̄ ) proportional to βres . Meanwhile, it follows from [1, Proposition 3.5(iv)] that every root in Φ(Ḡ, T̄ ) is the restriction of a root in Φ(G, T ). It follows that the Weyl group W̄ of Ψ̄ is equal to W (Ḡ, T̄ ). But W̄ is canonically isomorphic to W (G, T )Γ by Corollary 15.  4. Proofs of Theorems Proof of Theorem 1. Consider an abstract root datum Ψ = (X ∗ , Φ, X∗ , Φ∨ ) with an action of Gal(k) × Γ. Suppose that ∆ is a Γ-stable base for Ψ. Let Ψ̇ be the corresponding based root datum. As discussed in §3, the action of Gal(k) × Γ on Ψ determines one of Gal(k) × Γ on Ψ̇. Since ∆ is Γ-stable, the actions of Γ on Ψ and Ψ̇ coincide. In the notation of (16) with Λ = Gal(k), the elements c(σ) ∈ W (Ψ̇) that arise from the action of Gal(k) on Ψ̇ must lie in W (Ψ̇)Γ since this action commutes with that of Γ. Therefore, the 10 JEFFREY D. ADLER AND JOSHUA M. LANSKY map c : Gal(k) −→ W (Ψ̇)Γ is a cocycle in Z 1 (k, W (Ψ̇)Γ ). We note that the Gal(k) × Γ-isomorphism class of Ψ̇ depends only on that of Ψ. By [7, Theorem 6.2.7], there exists a triple (G, B0 , T0 ), unique up to kisomorphism, consisting of a k-quasisplit connected reductive group G, a Borel k-subgroup B0 of G, and a maximal k-torus T0 of B0 , such that the associated based root datum Ψ̇(G, B0 , T0 ) is Gal(k)-isomorphic to Ψ̇. We will identify Ψ̇ and Ψ̇(G, B0 , T0 ) via such an isomorphism. Let {Xα } be a Gal(k)-stable pinning for G relative to B0 and T0 . The action of Γ on Ψ̇ determines a homomorphism φ : Γ −→ Aut(Ψ̇). Let ϕ be the composition φ ψ ϕ : Γ −→ Aut(Ψ̇) = Aut(Ψ̇(G, B0 , T0 )) −→ Aut(G, B0 , T0 , {Xα }), where ψ : Aut(Ψ̇(G, B0 , T0 )) −→ Aut(G, B0 , T0 , {Xα }) is the homomorphism from Remark 19.  ◦ ϕ(Γ) ◦ Let Ḡ = Gϕ(Γ) and T̄0 = T0 . By Lemma 20, Ḡ is a k-quasisplit reductive group, T̄0 a maximal k-torus of Ḡ, and W (Ψ̇)Γ = W (G, T0 )ϕ(Γ) = W (Ḡ, T̄0 ). Thus we may view c as a cocycle in Z 1 (k, W (Ḡ, T̄0 )). By [4, Theorem 1.1], there is some g ∈ Ḡ(ksep ) such that for all σ ∈ Gal(k), g−1 σ(g) lies in the normalizer NḠ (T̄0 )(ksep ), and the image of g −1 σ(g) in W (Ḡ, T̄0 ) is equal to c(σ). Let T = g T0 and B = g B0 . Since g is ϕ(Γ)fixed, T is a ϕ(Γ)-stable maximal k-torus of G, and B is a ϕ(Γ)-stable Borel subgroup of G containing T . We have therefore associated to Ψ a triple (G, T, ϕ) of the required type. Suppose we vary the arbitrary choices made in the above construction of (G, T, ϕ). That is, suppose we choose • another based root datum Ψ̇′ with underlying datum Ψ, and hence a cocycle c′ in Z 1 (k, W (Ψ̇′ )Γ ); • another triple of k-groups (G′ , B0′ , T0′ ) k-isomorphic to (G, B0 , T0 ) and an identification of Ψ̇(G′ , B0′ , T0′ ) with Ψ̇′ ; and • a Gal(k)-stable pinning {Xα′ } of G′ relative to B0′ and T0′ , along with the associated map ψ ′ : Aut(Ψ̇(G′ , B0′ , T0′ )) −→ Aut(G′ , B0′ , T0′ , {Xα′ }) from Remark 19. We will show that these choices lead to a triple (G′ , T ′ , ϕ′ ) that is equivalent to (G, T, ϕ). We note that replacing Ψ by another datum in its Gal(k) × Γisomorphism class has no additional effect on the triple arising from the construction. Use a particular k-isomorphism between (G′ , B0′ , T0′ ) and (G, B0 , T0 ) to identify these triples. Following the above construction, we obtain a homomorphism ϕ′ : Γ −→ Aut(G, B0 , T0 , {Xα′ }), as well as an element g ′ ∈ ′ ′ (Γ) ◦ ϕ and a k-torus T ′ = g T0 , analogous to g and T , respectively. G There is a unique element w ∈ W (Ψ) mapping Ψ̇ to Ψ̇′ , and by uniqueness, w must in fact lie in W (Ψ)Γ , and the mapping it induces is equivariant with ROOT DATA WITH GROUP ACTIONS 11 respect to the actions of Gal(k) on these based root data. Via conjugation, the element w induces Γ-equivariant isomorphisms W (Ψ̇) −→ W (Ψ̇′ ) and τ : Z 1 (k, W (Ψ̇)) −→ Z 1 (k, W (Ψ̇′ )). We have a unique element κ of Autk (Ψ̇(G, B0 , T0 )) that produces a commutative square (21) Ψ̇ // Ψ̇(G, B0 , T0 ) κ w   Ψ̇′ // Ψ̇(G, B0 , T0 ) Here the horizontal arrows are the identifications chosen in the respective constuctions of ϕ and ϕ′ . (That κ is Gal(k)-equivariant follows from the equivariance of the other three maps in the square.) We therefore obtain a diagram (22) ♥66 ♥♥♥ ♥ ♥ ♥♥♥ ♥♥♥ Γ // Aut(Ψ̇) ∩ Aut(Ψ̇′ ) PPP PPP PPP PPP (( Aut(Ψ̇) // Aut(Ψ̇(G, B0 , T0 ))   // Aut(Ψ̇(G, B0 , T0 )) Aut(Ψ̇′ ) in which the square on the right is induced by (21) (and hence commutes), the vertical maps are given respectively by conjugation by w and κ, the diagonal maps are given by inclusion, and the map out of Γ is given by the action of Γ on Ψ. The map τ (c) : σ 7→ wc(σ)w−1 is a cocycle in Z 1 (k, W (Ψ̇′ )Γ ), cohomologous to c′ ; more precisely, for σ ∈ Gal(k), c′ (σ) = w−1 (wc(σ)w−1 )σ ⋆′ (w) = w−1 (τ (c)(σ))σ ⋆′ (w), where σ ⋆′ denotes the result of the action of σ on w, viewed as an element of W (Ψ̇′ ). Identifying c and c′ respectively with cocycles in Z 1 (k, W (G, T0 )ϕ(Γ) ) ′ and Z 1 (k, W (G, T0 )ϕ (Γ) ) as in the above construction, it follows from (22) that (23) c′ (σ) = w−1 (κ ◦ c(σ) ◦ κ−1 )σ(w), where σ(w) here denotes the result of σ ∈ Gal(k) acting on the element w ∈ W (Ψ̇′ ) via the identification of this group with the concrete Weyl group W (G, T0 ) in (22). Let n ∈ NḠ (T̄0 )(ksep ) be a representative for w and set µ = ψ(κ) ∈ Autk (G, B0 , T0 ). Then by (23), g ′ −1 σ(g′ ) and n−1 µ(g−1 σ(g))σ(n) have the same image in W (G, T0 ). Rearranging terms and letting h = g′ n−1 µ(g)−1 , 12 JEFFREY D. ADLER AND JOSHUA M. LANSKY we obtain that σ(h) and h have the same image modulo (24) σ(µ(g)n) T0 = σ(µ(g)n T0 ) = σ(µ(g) T0 ) = σ(µ(g T0 )) = σ(µ(T )) = µ(T ). Let ν = Int(h) ◦ µ. Since −1 ν(T ) = Int(h)(µ(T )) = Int(g ′ n−1 µ(g)−1 )(µ(T )) = Int(g ′ n−1 )(µ(g T )) ′ = Int(g′ n−1 )(µ(T0 )) = Int(g ′ n−1 )(T0 ) = g T0 = T ′ , it follows from (24) that ν gives a k-isomorphism T −→ T ′ . To show that (G′ , T ′ , ϕ′ ) is equivalent to (G, T, ϕ), it remains to show that ν is Γ-equivariant. It follows from the construction of ϕ that π ◦ ϕ is equal to the composition Γ −→ Aut(Ψ̇) −→ Aut(Ψ̇(G, B0 , T0 )) appearing in (22). Similarly, π ◦ ϕ′ is equal to the analogous composition Γ −→ Aut(Ψ̇′ ) −→ Aut(Ψ̇(G, B0 , T0 )). Thus for any γ ∈ Γ, π(ϕ′ (γ)) = κ ◦ π(ϕ(γ)) ◦ κ−1 . Applying ψ to this equality and noting that ψ ◦ π ◦ ϕ = ϕ by construction, we obtain ψ(π(ϕ′ (γ))) = µ ◦ ϕ(γ) ◦ µ−1 . Note that by definition, ψ(f ) and ψ ′ (f ) agree on T0 for any f ∈ Aut(Ψ̇(G, B0 , T0 )). Therefore, as automorphisms of T0 , we have ϕ′ (γ) = ψ ′ (π(ϕ′ (γ))) = ψ(π(ϕ′ (γ))) = µ ◦ ϕ(γ) ◦ µ−1 . It follows that, as maps on T , ϕ′ (γ) ◦ ν = ϕ′ (γ) ◦ Int(h) ◦ µ = ϕ′ (γ) ◦ Int(g ′ n−1 µ(g)−1 ) ◦ µ = Int(g ′ ) ◦ ϕ′ (γ) ◦ Int(µ(g)n)−1 ◦ µ = Int(g ′ ) ◦ µ ◦ ϕ(γ) ◦ µ−1 ◦ Int(µ(g)n)−1 ◦ µ = Int(g ′ ) ◦ µ ◦ ϕ(γ) ◦ Int(gµ−1 (n))−1 = Int(g ′ ) ◦ µ ◦ Int(gµ−1 (n))−1 ◦ ϕ(γ), where the last equality above comes from the fact that g ∈ Ḡ(ksep ) and Int(µ−1 (n)) ∈ W (G, T0 )ϕ(Γ) . Thus ϕ′ (γ) ◦ ν is equal to Int(g ′ n−1 µ(g)−1 ) ◦ µ ◦ ϕ(γ) = ν ◦ ϕ(γ), showing that ν is Γ-equivariant. Therefore, (G′ , T ′ , ϕ′ ) is equivalent to (G, T, ϕ), and our construction induces a well-defined map sΓ : RΓ −→ TΓ . We now show that rΓ ◦sΓ is the identity map on RΓ . Let Ψ be a root datum representing some class in RΓ , and let (G, T, ϕ) be a triple representing the image of the class of Ψ under sΓ . We need to show that Ψ(G, T ) is Gal(k)×Γisomorphic to Ψ. We will make free use of the notation developed in the construction of sΓ . ROOT DATA WITH GROUP ACTIONS 13 The Gal(k)-equivariant isomorphism of based root data Ψ̇ −→ Ψ̇(G, B0 , T0 ) chosen in the definition of sΓ is Γ-equivariant by construction (where the action of Γ on Ψ̇(G, B0 , T0 ) is induced by ϕ). We may therefore identify Ψ̇ and Ψ̇(G, B0 , T0 ) as based root data with Gal(k)×Γ-action via this isomorphism. This allows us to identify Ψ and Ψ(G, T0 ) as root data with Γ-action (but not necessarily with Gal(k)-action since the actions of Gal(k) on Ψ̇ and Ψ differ in general). Recall the element g ∈ Ḡ(ksep ) chosen in the definition of sΓ . The map Int(g)∗ : Ψ = Ψ(G, T0 ) −→ Ψ(G, T ) is Γ-equivariant since g is ϕ(Γ)-fixed. Furthermore, Int(g)∗ is Gal(k)-equivariant since for σ ∈ Gal(k) and χ ∈ X ∗ (T0 ),  Int(g)∗ (σχ) = Int(g)∗ c(σ)(σ ⋆ χ) = gg −1 σ(g) (σ ⋆ χ) = σ(g) (σ ⋆ χ) = σ(g χ) = σ(Int(g)∗ (χ)). Thus Ψ(G, T ) is Gal(k) × Γ-isomorphic to Ψ, as desired. Finally, we show that sΓ ◦ rΓ is the identity map on TΓ . Let (G, T, ϕ) represent a class in TΓ , and let (G′ , T ′ , ϕ′ ) represent the image of this class under sΓ ◦ rΓ . Since rΓ ◦ (sΓ ◦ rΓ ) = (rΓ ◦ sΓ ) ◦ rΓ = rΓ , it follows that there is a Gal(k) × Γ isomorphism Ψ(G, T ) −→ Ψ(G′ , T ′ ). By [5, Theorem 2.9], this isomorphism is induced by an isomorphism ν : G −→ G′ that restricts to a Γ-equivariant k-isomorphism T −→ T ′ . Thus (G, T, ϕ) and (G′ , T ′ , ϕ′ ) are equivalent.  Remark 25. Observe that in the definition of the map sΓ above, the triple (G, T, ϕ) is constructed in such a way that G is k-quasisplit and ϕ fixes a Gal(k)-invariant pinning of G. Thus, since sΓ ◦ πΓ is the identity map on TΓ , we see that every equivalence class in TΓ contains such a triple. Moreover, suppose that (G, T, ϕ) is a triple of this kind. Applying the construction of sΓ ◦ rΓ to this triple, we see that the triple we obtain is precisely (G, T, ϕ), provided that we make appropriate choices. Remark 26. Recall that in the proof, it is shown that if (G, T, ϕ) and (G′ , T ′ , ϕ′ ) are two triples that arise by applying the sΓ construction to a root datum Ψ, then (G, T, ϕ) and (G′ , T ′ , ϕ′ ) are equivalent. We note that the equivalence ν constructed in this case is of a special kind. Namely, ν is of the form Int(h) ◦ µ, where h ∈ G(ksep ) and µ ∈ Autk (G, B0 , T0 ). Now suppose that (G, T, ϕ) and (G′ , T ′ , ϕ′ ) are arbitrary equivalent triples with the properties that G and G′ are k-quasisplit and ϕ and ϕ′ fix Gal(k)invariant pinnings for G and G′ , respectively. Then combining the first part of this remark with Remark 25, it follows that there is an equivalence ν between (G, T, ϕ) and (G′ , T ′ , ϕ′ ) of the above special form. 14 JEFFREY D. ADLER AND JOSHUA M. LANSKY Remark 27. Suppose that G′ is k-quasisplit and T ′ is a maximal k-torus of G′ . Suppose that the finite group Γ acts via Gal(k)-equivariant automorphisms on Ψ(G′ , T ′ ) preserving a base. Then the equivalence class of Ψ(G′ , T ′ ) lies in RΓ . Applying the construction in the definition of sΓ to Ψ(G′ , T ′ ), we obtain a triple (G, T, ϕ) where G is k-quasisplit. Since Ψ(G′ , T ′ ) and Ψ(G, T ) are Gal(k)-isomorphic, G′ can be taken to equal G. Moreover, if g ∈ G(ksep ) is chosen such that T ′ = g T0 , then the cocylcle c used to define T can be taken to be the image of σ 7→ g−1 σ(g) in Z 1 (k, W (G, T0 )Γ ). In particular, it follows from [1, Proposition 6.1] that T ′ is stably conjugate to T . Proof of Theorem 2. Consider a class in TΓ . From Remark 25, we can represent this class by a triple (G, T, ϕ), where G is k-quasisplit and the action ϕ of Γ on G fixes a Gal(k)-invariant pinning. Let Ḡ = (Gϕ(Γ) )◦ and T̄ = (T ϕ(Γ) )◦ . Then Ψ = Ψ(G, T ) comes equipped with an action of Γ. Consider the restricted root datum Ψ̄ of Theorem 7. Construct a new root datum Ψ̄′ by replacing the root system Φ̄ of Ψ̄ by a maximal reduced subsystem Φ̄′ as in Remark 13, and do likewise with the coroot system. It is clear from the constructions that the root data Ψ̄′ and Ψ(Ḡ, T̄ ) are equivalent, provided that their root systems are equivalent. As in the proof of Lemma 20, one may reduce to the case where Γ is cyclic. From the proof of [8, §8.2(2′′′′ )], the root system Φ̄′ must contain the root system Φ(Ḡ, T̄ ), with equality since Γ fixes a pinning.  References [1] Jeffrey D. Adler and Joshua M. Lansky, Lifting representations of finite reductive groups I: Semisimple conjugacy classes, Canad. J. Math. 66 (2014), 1201–1224, DOI 10.4153/CJM-2014-013-6, available at arXiv:1106.0706. [2] M. Demazure, Automorphismes des groupes réductifs, Schémas en Groupes (Sém. Géométrie Algébrique, Inst. Hautes Études Sci., 1963/64), Inst. Hautes Études Sci., Paris, 1965, pp. 87 (French). MR0228503 (37 #4083) [3] Robert E. Kottwitz and Diana Shelstad, Foundations of twisted endoscopy, Astérisque 255 (1999), vi+190 (English, with English and French summaries). MR1687096 (2000k:22024) [4] M. S. Raghunathan, Tori in quasi-split groups, J. Ramanujan Math. Soc. 19 (2004), no. 4, 281–287. MR2125504 (2005m:20114) [5] Tonny A. Springer, Reductive groups, Automorphic forms, representations, and Lfunctions. Part 1 (Armand Borel and W. Casselman, eds.), Proceedings of Symposia in Pure Mathematics, XXXIII, American Mathematical Society, Providence, R.I., 1979, pp. 3–27. MR546587 (80h:20062) , Linear algebraic groups, Progress in Mathematics, vol. 9, Birkhäuser Boston [6] Inc., Boston, MA, 1998. MR1642713 (99h:20075) , Linear algebraic groups, Algebraic geometry IV, Encyclopedia of Mathemati[7] cal Sciences, SpringerVerlag, 1994, pp. 1–121. MR1100484 (92g:20061) [8] Robert Steinberg, Endomorphisms of linear algebraic groups, Memoirs of the American Mathematical Society, No. 80, American Mathematical Society, Providence, R.I., 1968. MR0230728 (37 #6288) ROOT DATA WITH GROUP ACTIONS 15 Department of Mathematics and Statistics, American University, Washington, DC 20016-8050 E-mail address, Adler: [email protected] E-mail address, Lansky: [email protected]
4math.GR
An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization Problems Viet Hung Nguyen1 and Paul Weng2 arXiv:1801.07544v1 [cs.DS] 23 Jan 2018 1 Sorbonne Universités, UPMC Univ Paris 06, UMR 7606, LIP6, Paris, France [email protected] 2 SYSU-CMU Joint Institute of Engineering, Guangzhou, China SYSU-CMU Joint Research Institute, Shunde, China School of Electronics and Information Technology, SYSU [email protected] Abstract. We consider a general class of combinatorial optimization problems including among others allocation, multiple knapsack, matching or travelling salesman problems. The standard version of those problems is the maximum weight optimization problem where a sum of values is optimized. However, the sum is not a good aggregation function when the fairness of the distribution of those values (corresponding for example to different agents’ utilities or criteria) is important. In this paper, using the generalized Gini index (GGI), a well-known inequality measure, instead of the sum to model fairness, we formulate a new general problem, that we call fair combinatorial optimization. Although GGI is a non-linear aggregating function, a 0, 1-linear program (IP) can be formulated for finding a GGI-optimal solution by exploiting a linearization of GGI proposed by Ogryczak and Sliwinski [21]. However, the time spent by commercial solvers (e.g., CPLEX, Gurobi...) for solving (IP) increases very quickly with instances’ size and can reach hours even for relatively small-sized ones. As a faster alternative, we propose a heuristic for solving (IP) based on a primal-dual approach using Lagrangian decomposition. We demonstrate the efficiency of our method by evaluating it against the exact solution of (IP) by CPLEX on several fair optimization problems related to matching. The numerical results show that our method outputs in a very short time efficient solutions giving lower bounds that CPLEX may take several orders of magnitude longer to obtain. Moreover, for instances for which we know the optimal value, these solutions are quasi-optimal with optimality gap less than 0.3%. Keywords: Fair Optimization; Generalized Gini Index; Ordered Weighted Averaging; Matching; Subgradient Method. 1 Introduction The solution of a weighted combinatorial optimization problem can be seen as the selection of n values in a combinatorial set X ⊂ Rn . The maximum weight version Pnof such a problem consists in maximizing the sum of these n values (e.g., i=1 ui ). For instance, in a matching problem on a graph, the sum of weights that is optimized corresponds to the sum of weights of the edges 2 Viet Hung Nguyen and Paul Weng selected in a matching. In practice, the vector of weights (u1 , u2 , . . . , un ) could receive different interpretations depending on the actual problem. In a multiagent setting, each value ui represents the utility of an agent i, as in a bi-partite matching problem where n objects have to be assigned to n agents. In a multicriteria context, those n values can be viewed as different dimensions to optimize. For example, in the travelling salesman problem (TSP) with n cities, a feasible solution (i.e., Hamiltonian cycle) is valued by an n-dimensional vector where each component represents the sum of the distances to reach and leave a city. In both interpretations, it is desirable that the vector of values (u1 , u2 , . . . , un ) be both Pareto-optimal (i.e., not improvable on all components at the same time) and balanced (or fair). We call optimization with such concerns fair optimization by adopting the terminology from multi-agent systems. In this paper, we focus on the fair optimization version of a class of combinatorial problems (including allocation, general matching, TSP...). Note that optimizing the sum of the values (i.e., maximum weight problem) yields a Pareto-optimal solution, but does not provide any guarantee on how balanced the vector solution would be. Various approaches have been proposed in the literature to provide such a guarantee with different models for fairness or ”balancedness” (see Section 2 for an overview). In this paper, our approach is based on an inequality measure called Generalized Gini Index (GGI) [29], which is well-known and well-studied in economics and can be used to control for both Pareto-efficiency and fairness. Indeed, fairness has naturally been investigated in economics [17]. In this literature, two important requirements have been identified as essential for fairness: equal treatment of equals and efficiency. The first notion implies that two agents with the same characteristics (notably the same preferences) have to be treated the same way, while the second entails that a fair solution should be Paretooptimal. GGI satisfies both requirements, as it is symmetric in its arguments and increasing with Pareto dominance. The notion of fairness that GGI encodes is based on the Pigou-Dalton transfer principle, which states that a small transfer of resource from a richer agent to a poorer one yields a fairer distribution. To the best of our knowledge, fair optimization in such general combinatorial problems has not been considered so far, although the GGI criterion has been investigated before in some specific problems (allocation [12], capital budgeting [11], Markov decision process [19,20]...). The difficulty of this combinatorial optimization problem lies in the fact that the objective function is non-linear. The contribution of this paper is fourfold: (1) we introduce a new general combinatorial problem (e.g., fair matching in general graph or fair TSP have not been studied so far); (2) we provide an optimality condition and an approximation ratio; (3) we propose a fast general heuristic method based on a primal-dual approach and on Lagrangian decomposition; (4) we evaluate this method on several problems related to matching to understand its efficiency. Although our general combinatorial formulation covers problems whose maximum weight version is NP-hard, we leave for a follow-up work the integration of our fast heuristic with approximation algorithms to solve those NP-hard problems. The paper is organized as follows. Section 2 gives an overview of related work. Section 3 provides a formal definition of our problem, which can be solved by a An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 3 0, 1-linear program. As a faster alternative, we present a heuristic primal-dual solving method based on Lagrangian decomposition in Section 4 and evaluate it experimentally in Section 5. Finally, we conclude in Section 6. 2 Related Work Fair optimization is an active and quite recent research area [18,14] in multiobjective optimization. Fairness can be modeled in different ways. One simple approach is based on maxmin, so called Egalitarian approach, where one aims at maximizing the worse-off component (i.e., objective, agent...). Due to the drowning effects of the min operator, vectors with the same minimum cannot be discriminated. A better approach [24] is based on the lexicographic maxmin, which consists in considering the minimum first when comparing two vectors, then in case of a tie, focusing on the second smallest values and so on. However, due to the noncompensatory nature of the min operator, vector (1, 1, . . . , 1) would be preferred to (0, 100, . . . , 100), which may be debatable. To take into account this observation, one can resort to use a strictly increasing and strictly Schur-concave (see Section 3.2 for definition) aggregation function f (see [18] for examples) that evaluates each vector such that higher values are preferred. In this paper, we focus on the Generalized Gini Index (GGI) proposed in the economics literature [29], because it satisfies natural properties for encoding fairness. GGI is a particular case of a more general family of operators known as Ordered Weighted Averaging (OWA) [31]. Much work in fair optimization has applied the OWA operator and GGI in multiobjective (continuous and combinatorial) optimization problems. To cite a few, it was used in network dimensioning problems [22], capital budgeting [11], allocation problems [12], flow optimization in wireless mesh networks [10] and multiobjective sequential decision-making under uncertainty [19,20]. One common solving technique is based on a linearization trick of the nonlinear objective function based on GGI [21]. Recently, [9] considered a similar setting to ours, but tries to solve its continuous relaxation. In multicriteria decision-making, fair optimization is related to compromise optimization, which generally consists in minimizing a distance to an ideal point [27]. More generally, the ideal point can be replaced by any reference point that a decision maker chooses, as in the reference point method [30]. In this context, a judiciously chosen reference point can help generate a solution with a balanced profile on all criteria. One main approach is based on minimizing the augmented weighted Tchebycheff distance. This method has been applied in many multicriteria problems, for instance, in process planning [25], in sequential decision-making under uncertainty [23], in discrete bicriteria optimization problems [6], in multiobjective multidimensional knapsack problems [15]. Note that our combinatorial optimization problem should not be confused with the multicriteria version of those problems where each scalar weight becomes vectorial and the value of a solution is obtained by aggregating the selected weight vectors with a componentwise sum. For instance, Anand [1] investigated a multicriteria version of the matching problem and proved that the egalitarian approach for vector-valued matching leads to NP-hard problems. In our problem, 4 Viet Hung Nguyen and Paul Weng the weights are scalar and the value of a solution is not obtained by summing its scalar weights, but by aggregating them with GGI. 3 Model In this section, we formally describe the general class of combinatorial problems considered in this paper and provide some concrete illustrative examples in this class. Then we recall the generalized Gini index as a measure of fairness and define the fair combinatorial optimization problems tackled in this paper. We start with some notations. For any integer n, [n] denotes the set {1, 2, . . . n}. For any vector x, its component is denoted xi or xij depending on its dimension. 3.1 General Model We consider a combinatorial optimization problem (e.g., allocation, multiple knapsack, matching, travelling salesman problem...), whose feasible solutions X ⊆ {0, 1}n×m can be expressed as follows: Az ≤ b z ∈ {0, 1}n×m where A ∈ Zp×(nm) , b ∈ Zp , n, m and p are three positive integers, and z is viewed as a one-dimensional vector (z11 , . . . , z1m , z21 , . . . , z2m , . . ., zn1 , . . . , znm )⊺ . Let uij ∈ N be the utility of setting zij to 1. The maximum weight problem defined on combinatorial set X can be written as a 0, 1-linear program (0, 1-LP): max. X X uij zij i∈[n] j∈[m] s.t. z ∈ X Because this general problem includes the travelling salesman problem (TSP), it is NP-hard in general. As mentioned before, this objective function provides no control on the fairness of the obtained solution. Although possibly insufficient, one simple approach to fairness consisting in focusing on the worse-off component is the maxmin problem defined on set X , which can also be written as a 0, 1-LP: max. v s.t. v ≤ X uij zij ∀i ∈ [n] j∈[m] z∈X Even for some polynomial problems like allocation, this version is NP-hard in general [4]. To avoid any confusion, in this paper, allocation refers to matching on a bi-partite graph and matching generally implies a complete graph. For illustration, we now present several instantiations of our general model on allocation and matching problems, some of which will be used for the experimental evaluation of our proposed methods in Section 5. Example 1 (Allocation) Let G = (V1 ∪ V2 , E, u) be a valued bipartite graph where V1 and V2 are respectively an n-vertex set and an m-vertex set with V1 ∩ V2 = ∅, E ⊆ {x, y} | (x, y) ∈ V1 × V2 is a set of non-directed edges and An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 5 u : E → R defines the nonnegative utility (i.e., value to be maximized) of an edge. As there is no risk of confusion, we identify V1 to the set [n] and V2 to the set [m]. An allocation of G is a subset of E such that each vertex i in V1 is connected to αi to βi vertices in V2 and each vertex in V2 is connected to α′j to βj′ vertices in V1 where (α, β) ∈ Nn×n and (α′ , β ′ ) ∈ Nm×m . The assignment problem where n tasks need to be assigned to n agents is a special case where n = m and αi = βi = α′j = βj′ = 1 for i ∈ [n] and j ∈ [n]. The conference paper assignment problem where m papers needs to be reviewed by n reviewers such that each paper is reviewed by 3 reviewers and each reviewer receives at most 6 papers can be represented with αi = 0, βi = 6, α′j = 3 and βj′ = 3 for i ∈ [n] and j ∈ [m]. The Santa Claus problem [3] where m toys needs to be assigned to n children with n ≤ m is also a particular case with αi = 0, βi = m, α′j = βj′ = 1 for i ∈ [n] and j ∈ [m]. The maximum weight problem can be solved with the following 0, 1-LP: X X max. uij zij i∈[n] j∈[m] s.t. αi ≤ X zij ≤ βi ∀i ∈ [n] (3a) X zij ≤ βj′ ∀j ∈ [m] (3b) j∈[m] α′j ≤ i∈[n] z ∈ {0, 1}n×m Interestingly, its solution can be efficiently obtained by solving its continuous relaxation because the matrix defining its constraints (3a)–(3b) is totally unimodular [26]. However, the maxmin version is NP-complete [4]. Example 2 (Matching) Let G = (V,E, u) be a valued graph where V is a 2n-vertex set (with n ∈ N\{0}), E ⊆ {x, y} | (x, y) ∈ V 2 , x 6= y is a set of non-directed edges and u : E → R defines the nonnegative utility of an edge. A matching M of G is a subset of E such that no pair of edges of M are adjacent, i.e., they do not share a common vertex: ∀(e, e′ ) ∈ E 2 , e 6= e′ ⇒ e ∩ e′ = ∅. A perfect matching M is a matching where every vertex of G is incident to an edge of M . Thus, a perfect matching contains n edges. Without loss of generality, we identify V to the set [2n] and denote ∀e = {i, j} ∈ E, uij = u(e) when convenient. The standard maximum weight perfect matching problem aims at finding a perfect matching for which the sum of the utilities of its edges is maximum. Let δ(i) = {{i, j} ∈ E | j ∈ V \{i}} be the set of edges that are incident on vertex i. It is known [13] that this problem can be formalized as a 0, 1-LP (where zij ’s for i > j are unnecessary and can be set to 0):   max.       (PM ) s.t.        X X (4a) uij zij i∈[2n] j∈[2n],j>i X zij = 1 ∀k ∈ [2n] (4b) ∀i ∈ [2n], j = i + 1, . . . , 2n (4c) {i,j}∈δ(k),i<j zij ∈ {0, 1} where (4b) states that in a matching only one edge is incident on any vertex. 6 Viet Hung Nguyen and Paul Weng This problem can be solved as an LP by considering the continuous relaxation of PM and adding the well-known blossom constraints (5b) in order to remove the fractional solutions introduced by the relaxation:    max.         s.t. (RP M )           X X uij zij i∈[2n] j∈[2n],j>i X zij = 1 ∀k ∈ [2n] (5a) z(δ(S)) ≥ 1 ∀S ⊂ V, |S| odd, |S| ≥ 3 (5b) 0 ≤ zij ≤ 1 ∀i ∈ [2n], j = i + 1, . . . , 2n (5c) {i,j}∈δ(k),i<j P where z(δ(S)) = {i,j}∈δ(S),i<j zij and δ(S) = {{i, j} ∈ E | i ∈ S and j ∈ V \S}. Constraints (5a)–(5c) define the so-called perfect matching polytope. In practice, this problem can be efficiently solved with the Blossom algorithm proposed by Edmonds [8]. To the best of our knowledge, the maxmin version of the matching problem (on complete graph) has not been investigated so far. In this paper we focus on a variant of those P combinatorial problems: search for a solution z whose distribution of values j∈[m] uij zij i∈[n] is fair to its components (e.g., different agents’ utilities or criteria). To model fairness we use a special case of the ordered weighted averaging operator that we recall next. 3.2 Ordered Weighted Average and Generalized Gini Index The Ordered Weighted Average (OWA) [31] of v ∈ Rn is defined by: X wk vk↑ OW Aw (v) = k∈[n] where w = (w1 , . . . , wn ) ∈ [0, 1] is the OWA weight vector and v ↑ = (v1↑ , . . . , vn↑ ) is the vector obtained from v by rearranging its components in an increasing order. OWA defines a very general family of operators, e.g., the sum (for wk = 1, ∀k ∈ [n]), the average, the minimum (for w1 = 1 and wk = 0, ∀k > 1), the maximum (for wn = 1 and wk = 0, ∀k < n), the leximin when differences between OWA weights tends to infinity or the augmented weighted Tchebycheff distance [20]. Let the Lorenz components [2] of v be denoted by (L1 (v), . . ., Ln (v)) and be P defined by ∀k ∈ [n], Lk (v) = i∈[k] vi↑ . Interestingly, OWA can be rewritten as: X wk′ Lk (v) (6) OW Aw (v) = n k∈[n] where ∀k ∈ [n], wk′ = wk − wk+1 and wn+1 = 0. With this rewriting, one can see that OWA is simply a weighted sum in the space of Lorenz components. The notion of fairness that we use in this paper is based on the Pigou-Dalton principle [16]. It states that, all other things being equal, we prefer more “balanced” vectors, which implies that any transfer (called Pigou-Dalton transfer) from a richer component to a poorer one without reversing their relative positions yields a preferred vector. Formally, for any v ∈ Rn where vi < vj and for An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 7 cumulative value 100 80 60 40 20 0 0 20 40 60 80 100 cumulative population (in %) Fig. 1. Lorenz curves any ǫ ∈ (0, vj −vi ) we prefer v +ǫ1i −ǫ1j to v where 1i (resp. 1j ) is the canonical vector, null everywhere except in component i (resp. j) where it is equal to 1. When the OWA weights are strictly decreasing and positive [29], OWA is called the Generalized Gini Index (GGI) [29] and denoted Gw . It encodes both: efficiency: Gw is increasing with respect to Pareto-dominance (i.e., if v ∈ Rn Pareto-dominates3 v ′ ∈ Rn , then Gw (v) > Gw (v ′ )); and fairness: Gw is strictly Schur-concave, i.e., it is strictly increasing with PigouDalton transfers (∀v ∈ Rn , vi < vj , ∀ǫ ∈ (0, vj −vi ), Gw (v+ǫ1i −ǫ1j ) > Gw (v)). The classic Gini index, which is a special case of GGI with wi = (2(n − i) + 1)/n2 for all i ∈ [n], enjoys a nice graphical interpretation (see Figure 1). For a given distribution v ∈ Rn+ , let v̄ denote the average of the components of v, i.e., 1 Pn v̄ = n i=1 vi . Distribution v can be represented by the curve going through the points (0, 0) and ( nk , Lk (v)) for k ∈ [n]. The most equitable distribution with the same total sum as that of v (i.e., nv̄) can be represented by the straight line going through the points (0, 0) and ( nk , kv̄) for k ∈ [n]. The value 1 − Gw (v)/v̄ is equal to twice the area between the two curves. Interestingly, the Lorenz components of a vector can be computed by LP [21]. Indeed, the k-th Lorenz component Lk (v) of a vector v can be found as the solution of a knapsack problem, which is obtained by solving the following LP:   min.       (LP k ) s.t.        X aik xi X aik = k i∈[n] i∈[n] 0 ≤ aik ≤ 1 ∀i ∈ [n] Equivalently, this can be solved by its dual: (DLk ) 3    max.     s.t.     krk − X dik i∈[n] rk − dik ≤ vi ∀i ∈ [n] dik ≥ 0 ∀i ∈ [n] Vector v Pareto-dominates vector v ′ if ∀i ∈ [n], vi ≥ vi′ and ∃j ∈ [n], vj > vj′ . 8 Viet Hung Nguyen and Paul Weng The dual formulation is particularly useful. Contrary to the primal, it can be integrated in an LP where the vi ’s are also variables [21]. We will use this technique to formulate a 0, 1-LP to solve our general combinatorial optimization problem. 3.3 Fair Combinatorial Optimization The problem tackled in this paper is defined by using GGI as objective function:  X   Az ≤ b s.t. uij zij i∈[n] max. Gw z ∈ {0, 1}n×m j∈[m] Following Ogryczak and Sliwinski [21], we can combine the rewriting of OWA based on Lorenz components (6) and LPs (DLk ) for k ∈ [2n] to transform the previous non-linear optimization program into a 0, 1-LP: X max. wk′ (krk − X dik ) (9a) i∈[n] k∈[n] s.t. Az ≤ b (9b) z ∈ {0, 1}n×m X uij zij rk − dik ≤ (9c) ∀i ∈ [n], ∀k ∈ [n] (9d) ∀i ∈ [n], ∀k ∈ [n] (9e) j∈[m] dik ≥ 0 Due to the introduction of new constraints (9d)–(9e) from LPs (DLk ), the relaxation of this 0, 1-LP may yield fractional solutions. The naive approach to solve it would be to give it to a 0, 1-LP solver (e.g., Cplex, Gurobi...). Our goal in this paper is to propose an adapted solving method for it, which would be much faster than the naive approach by exploiting the structure of this problem. 4 Alternating Optimization Algorithm Before presenting our approach, which is a heuristic method based on a primaldual technique using a Lagrangian decomposition, we first make an interesting and useful observation. The dual of the continuous relaxation of the previous 0, 1-LP (9) is given by: min. b⊺ v + X X (10a) tij i∈[n] j∈[m] s.t. (v ⊺ A)ij + tij − X ∀i ∈ [n], ∀j ∈ [m] (10b) ∀k ∈ [n] (10c) 0 ≤ yik ≤ wk′ ∀i ∈ [n], ∀k ∈ [n] (10d) vj ≥ 0 ∀j ∈ [p] (10e) tij ≥ 0 ∀i ∈ [n], ∀j ∈ [m] (10f) uij yik ≥ 0 k∈[n] n X yik = kwk′ i=1 An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 9 Interestingly, with fixed yik ’s, the dual of the previous program can be written in the following form, which is simply the continuous relaxation of the original program with modified weights: max. X i∈[n] X yik k∈[n]  X uij zij (11a) j∈[m] s.t. Az ≤ b (11b) n×m z ∈ [0, 1] (11c) Therefore, solving this program with discrete z yields a feasible solution of the original problem. We denote (Py ) the 0, 1-LP (11) defined with y = (yik )i∈[n],k∈[n] . 4.1 Optimality Condition and Approximation Ratio Next we express an optimality condition so that an integer solution z ∗ computed from a dual feasible solution y ∗ of (10) is optimal for program (9). First, note that any extreme solution (v, t, y) of program (10) is such that either yik = 0 or yik = wk′ for all i ∈ [n] and k ∈ [n]. Theorem 1. Let (v, t, y ∗ ) be an extreme solution of (10) and let z ∗ be the P ∗ ∗ ∗ for all i ∈ [n] and optimal solution of program (Py ). Let Ti = j∈[m] uij zij assume without loss of generality that T1∗ ≥ T2∗ ≥ . . . ≥ Tn∗ . ∗ ∗ = 0 for all i ∈ [n − k] = wk′ for all i ≥ n + 1 − k and yik If for all k ∈ [n], yik then z ∗ is an optimal solution of program (9). Proof. Let (v ∗ , t∗ ) be the dual optimal solution associated with z ∗ when solving (Py∗ ). Composing them with y ∗ , we obtain a feasible solution (v ∗ , t∗ , y ∗ ) of (10). By duality P theory P of linear programming, the objective value of this solu′ )Ti∗ . Let us now build a feasible solution tion is equal to i∈[n] ( j∈[i] wn+1−j ∗ ∗ ∗ ∗ (r , d , z ) of (9) based on z as follows. For all k ∈ [n], ∗ and • rk∗ = Tn+1−k  ∗ rk − Ti∗ if i ≥ n + 1 − k • d∗ik = for all i ∈ [n] . 0 otherwise We now show that (r ∗ , d∗ ) satisfy constraints (9d). For any i ∈ [n] and k ∈ [n], ∗ ≤ Ti∗ and d∗ik = 0, we have if i ≤ n + 1 − k then as rk∗ = Tn+1−k X ∗ uij zij . rk∗ − d∗ik ≤ Ti∗ = j∈[m] P ∗ . Hence If i ≥ n + 1 − k then as d∗ik = rk∗ − Ti∗ , rk∗ − d∗ik = Ti∗ = j∈[m] uij zij P ∗ ∗ ∗ ∗ (r , d , z ) is a feasible solution of (9). For any k ∈ [n], krk − i∈[n] d∗ik = P P P ∗ krk∗ − ni=n+1−k d∗ik = krk∗ − (krk∗ − ni=n+1−k Ti∗ ) = ni=n+1−k PTi ). Then it is easy to see that the objective value of this solution, which is k∈[n] wk′ (krk∗ − P P P d∗ik ) is equal to k∈[n] wk′ ni=n−k+1 Ti∗ . This sum is just a rewriting of Pi∈[n] P ′ ∗ i∈[n] ( j∈[i] wn+1−j )Ti . Thus, by duality of linear programming, the solution (r ∗ , d∗ , z ∗ ) is optimal for program (9). ⊓ ⊔ 10 Viet Hung Nguyen and Paul Weng Theorem 1 provides an optimality condition for any feasible solution z ∗ , but does not indicate how to find ”good” solutions. Yet, one may be interested in the quality of some special solutions, e.g., the optimal solution of the maximum weight version. The following theorem establishes an approximation ratio for the latter, which also applies to our method as discussed later. Theorem P 2. Let z̄ be an optimal solution of the maximum weight version. Let T̄i = j∈[m] uij z̄ij for all i ∈ [n] and assume without loss of generality that ′ T̄1 ≥ T̄2 ≥ . . . ≥ T̄n . Let wmax = maxk∈[n] wk′ . Then the GGI value of z̄ is at 2w ′ worst max( (n+1)wn ′ max , (P nT̄n T̄i )) ) of the optimal objective value of program (9). i∈[n] Proof. Let vector ȳ ∈ Rn×n be defined as ȳik = nk wk′ for i, k ∈ [n], which is feasible for program (10). The objective function of (Pȳ ) satisfies: X i∈[n] X k∈[n] ȳik  X uij zij = X X X k ( w′ )uij zij n k i∈[n] j∈[m] k∈[n] j∈[m] ≤ X X X k w′ )uij zij ( n max (12) i∈[n] j∈[m] k∈[n] Program (11) with objective (12) corresponds to the maximum weight version P P ′ /n)× i∈[n] (T̄i ) for solution scaled by a constant. It is equal to k∈[n] (kwmax z̄, which is an upperbound of the objective value associated with ȳ of (10) and hence an upperbound for the optimal value of (9). Proceeding as for Theorem 1, we define a feasible solution of (9) based on z̄: • r̄k = T̄n+1−k for all k ∈ [n], and  r̄k − T̄i if i ≥ n + 1 − k ¯ • dik = for all i ∈ [n], for all k ∈ [n]. 0 otherwise P P ′ )T̄i (see proof of TheThe objective value of this solution i∈[n] ( j∈[i] wn+1−j P P ′ /n)T̄i . orem 1) is to be compared with upperbound i∈[n] ( k∈[n] kwmax By comparing term by term w.r.t. T̄i for i ∈ [n], we can see that the worst case P ′ /n). happens to the term associated with T̄1 with the ratio wn′ /( k∈[n] kwmax 2w ′ Therefore, we obtain the ratio (n+1)wn ′ . This ratio is consistent since when max n = 1, the optimal solution of the maximum weight version coincides with the optimum solution of (9). By comparing term by term with respect to wk′ for k ∈ [n], we can seePthat the n worst case happens to the term associated with w1′ with the ratio nT̄n /( i=1 T̄i ), which can be interpreted as the ratio of the smallest utility over the average utility in the optimal solution of the maximum weight version. This ratio is consistent since in the case of equal utilities in the optimal solution of the maximum weight version, the latter coincides with the optimum solution of (9). ⊓ ⊔ An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 4.2 11 Iterative Algorithm The previous discussion motivates us to design an alternating optimization algorithm that starts with a feasible y for (10), computes the associated z and uses the latter to iteratively improve y. Formally, it can be sketched as follows: 1: t ← 0 2: compute y (0) 3: repeat 4: t←t+1 5: solve 0, 1-LP (Pyt−1 ) to obtain feasible solution z (t) 6: update y (t) based on y (t−1) and z (t) (t) 7: until max iteration has been reached or change on yik is small 8: return z (t) with highest GGI Interestingly, lines 2 and 6 can be performed in different ways. For line 2, an initial y (0) can be obtained by solving the dual LP (10). Another approach is to solve the maximum weight version of our combinatorial problem and get the dual solution variables for y (0) . Note that Theorem 2 then provides a guarantee on the final solution, as it is at least as good as that of the maximum weight problem. For line 6, one approach is to solve (9) with z fixed to z (t) in order to get dual solution variables y (t) . A better approach as observed in the experiments and explained next is based on Lagrangian relaxation. The Lagrangian relaxation of (9) with respect to constraint (9d) can be written as follows with Lagrangian multipliers λ = (λik )i∈[n],k∈[n] : L(λ) = max. X (wk′ k − X λik )rk − X + i∈[n] X (wk′ − λik )dik (13a) k∈[n] i∈[n] i∈[n] k∈[n] X X λik  X (13b) uij zij j∈[m] k∈[n] s.t. Az ≤ b (13c) z ∈ {0, 1}n×m (13d) dik ≥ 0 (13e) ∀i ∈ [n], ∀k ∈ [n] The Lagrangian dual of (13) is then given by: min. L(λ) s.t. λik ≥ 0 ∀i ∈ [n], ∀k ∈ [n] (14) n×n For an optimal solution z ∗ , r ∗ , d∗ of the 0, 1-LP (9), we have for any λ ∈ R+ : X k∈[n] wk′ (krk∗ − X i∈[n] d∗ik ) ≤ X (wk′ k − λik )rk − X i∈[n] X k∈[n] λik X X (wk′ − λik )dik k∈[n] i∈[n] i∈[n] k∈[n] + X  X uij zij ≤ L(λ) j∈[m] The first inequality holds because of the nonnegativity of λ and the feasibility of z ∗ , r ∗ , d∗ . The second is true because of the maximization in (13). Therefore 12 Viet Hung Nguyen and Paul Weng the best upperbound is provided by the solution of the Lagrangian dual (14), though this problem is not easy to solve due to the integrality condition over z. An inspection of program (13) leads to two observations: (i) it can be decomposed into two maximization problems, one over z and the other over r and d; (ii) for program (13) to yield a useful upperbound, λ should satisfy two constraints (otherwise L(λ) = ∞): X λik = kwk′ ∀k ∈ [n] and λik ≤ wk′ ∀i ∈ [n], ∀k ∈ [n] i∈[n] Interestingly, in the above decomposition, the maximization problem over z corresponds to (Pλ ) and therefore λ can be identified to the dual variable y. Based on those observations, line 6 can be performed as follows. Given λ (or y), the upperbound L(λ) can be improved by updating λ so as to decrease (13a), which can be simply done by a projected sub-gradient step: X uij zij ) ∀i ∈ [n], k ∈ [n] (15) λ′ik ← λik − γ(rk − dik − j∈[m] ′ λ ← arg min ||λ − λ|| (16) λ∈L where γ is the sub-gradient of λ′ on P step and (16)′ is the Euclidean projection n×n ′ L = {λ ∈ R+ | ∀k ∈ [n], i∈[n] λik = kwk , ∀i ∈ [n], λik ≤ wk }. Projection (16) can be performed efficiently by exploiting the structure of L: X X (λ′ik − λik )2 arg min ||λ′ − λ|| = arg min ||λ′ − λ||2 = arg min λ∈L = arg min λk ∈Lk λ∈L X i∈[n] (λ′ik λ∈L i∈[n] k∈[n] X λ′  λik  ( ik′ − ′ )2 k∈[n] − λik )2 k∈[n] = arg min wk wk λk ∈Lk (17) i∈[n] P where Lk = {λk ∈ Rn+ | i∈[n] λik /wk′ = k, ∀i ∈ [n], λik /wk′ ≤ 1}. Equation (17) states that projection (16) can be efficiently performed by n projections on capped simplices [28]. The complexity of this step would be in O(n3 ), which is much faster than solving the quadratic problem (16). Besides, the n projections can be easily computed in a parallel way. We can provide a simple interpretation to the variable λ (or y). Considering programs (10) and (11), we can observe that y corresponds to an allocation of weights wk′ ’s over the different component i’s. Indeed, an optimal solution of (10) would yield an extreme point of L (for a given k ∈ [n], exactly k terms among (y1k , . . . , ynk ) are equal to wk′ and the other ones are null). The projected subgradient method allows to search for an optimal solution of our fair combinatorial problem by moving inside the convex hull of those extreme points. 5 Experimental Results We evaluated our method on two different problems: assignment and matching. The LPs and 0, 1-LPs were solved using CPLEX 12.7 on a PC (Intel Core i7-6700 An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization Instance CPLEX CPU1 CPU2 1.02 1.02 3.14 3.14 64.95 14.26 1054.14 100.23 0.89 0.89 8.83 8.83 590.66 45.93 1.55 1.55 342.78 342.78 AlterOpt CPU Gap 0.23 0% 0.26 0% 0.45 0.28% 0.65 0.26% 0.2 0% 0.3 0.015% 0.48 0.13% 0.18 0% 0.94 0% 13 Instance CPLEX AlterOpt CPU1 CPU2 CPU Gap v50-20 v50-30 0.86 0.86 0.79 0% v50-30 v50-40 2.43 2.43 1.42 0% v50-40 v50-50 5.14 5.14 2.67 0% v50-50 v50-60 148.5 25.45 13.43 0.01% v30-20 v50-70 2406.02 1282.8 17.71 0.005% v30-30 v30-30 1.15 1.15 0.78 0% v30-40 v30-40 7.13 7.13 1.44 0% v10-20 v30-50 81.75 75.5 2.45 0.01% v10-30 v30-60 1003.69 615.16 12.8 0.036% v10-30 5.33 5.33 0.76 0% v10-40 1325.7 806.8 1.4 0.06% v10-50 29617.78 3370.7 2.48 0.053% Table 1. Numerical results for (left) assignment and (right) general matching problems 3.40GHz) with 4 cores and 8 threads and 32 GB of RAM. Default parameters of CPLEX were used with 8 threads. The sub-gradient step γt is computed followt ing the scheme: γt := (val(zt )−bestvalue)ρ where val(zt ) is the objective value of sqn the program (11) with solution zt , bestvalue is the best known objective value of the program (9) so far and sqn is the square of the Euclidean norm of the subgradient vector. The parameter ρt is divided by two every 3 consecutive iterations in which the upperbound L(λ) has not been improved. The GGI weights were defined as follows: wk = 1/k 2 for k ∈ [n] so that they decrease fast in order to enforce more balanced solutions. Assignment To demonstrate the efficiency of our heuristic method, we generate hard random instances for the assignment problem. A random instance of this problem corresponds to a random generation of the uij ’s, which are generated as follows. For all i ∈ [n], ui1 follows a uniform distribution over [100] and for all j ∈ [n], uij = ui1 + ǫ where ǫ is a random variable following a uniform distribution over integers between −d and d (with d a positive integer parameter). With such a generation scheme, agents’ preferences over objects are positively correlated and the solution of the fair optimization problem is harder due to the difficulty of finding a feasible solution that satisfies everyone. Matching We use the lemon library [7] for solving the maximum weight matching problem. For the generation of the matching problem (in a complete graph with 2n nodes), we follow a similar idea to the assignment problem. Recall we only need uij (and zij ) for i < j. For all i ∈ [n], for all j ∈ [n] with i < j, uij = −1000. For all i ∈ [n], ui,n+1 follows a uniform distribution over [100] and for all j ≥ max(i + 1, n + 2), uij = ui,n+1 + ǫ where ǫ is defined as above. Explanations The name of the instances is of the form ”vd-x” where d denotes the deviation parameter mentioned above and x the number of the vertices of the graphs (i.e., n = x/2). Column “CPLEX” regroups CPLEX’s results. Subcol- 14 Viet Hung Nguyen and Paul Weng umn “CPU1” reports the time (in seconds) that CPLEX spent to solve program (9) to optimal. Subcolumn “CPU2” reports the times needed by the primal heuristic of CPLEX to obtain a feasible integer solution that is better than or equal to the solution given by our algorithm. Column “AlterOpt” reports our algorithm’s results. Subcolumn “CPU” is the time spent by our algorithm. Subcolumn “Gap” reports the gap in percentage between Sol and Opt, which is equal to (Opt − Sol) × 100/Opt% where Opt is the optimal value and Sol is the value of the solution given by our algorithm. The times and the gaps reported are averaged over 10 executions corresponding to 10 random instances. Table 1 shows that the CPU time spent by CPLEX (subcolumn CPU1) for solving program (9) increases exponentially with n and can quickly reach up to around 10 hours. Moreover, the smaller the deviation x, the more difficult the problem. For example, for x = 50, we cannot solve instances with more than 50 and more than 70 vertices for respectively the fair assignment and general matching problems within 10 hours of CPU time. For x = 10, this limit is respectively 30 and 50 vertices. In contrast, the CPU time spent by our algorithm (subcolumn CPU) seems to increase linearly with n and remains within tens or so seconds. The quality of the solutions output by our algorithm is very good as the gap is at maximum around 0.3% for fair assignment. This is even better for fair general matching, in all cases the gap is smaller than 0.1%. Moreover, the CPU time that CPLEX needs to find a feasible integer solution of similar quality by primal heuristic is much longer than the CPU time of our algorithm (up to hundreds times longer). It is interesting to notice that the fair assignment seems to be more difficult in our experiments than the fair general matching. This contrasts with the classical maximum weight version where the assignment problem is generally easier than the general maximum matching. 6 Conclusion We formulated the fair optimization with the Generalized Gini Index for a large class of combinatorial problem for which we proposed a primal-dual algorithm based on a Lagrangian decomposition. We demonstrated its efficiency on several problems. We also provided some theoretical bounds on its performance. As future work, we plan to improve those bounds and investigate other updates for the Lagrangian multipliers. Another interesting direction is to consider other linearization techniques such as the one proposed by Chassein and Goerigk [5]. Finally, we will also apply our method to problems whose maximum weight version is NP-hard. References 1. Anand, S.: The multi-criteria bipartite matching problem (2006) 2. Arnold, B.: Majorization and the Lorenz Order. Springer (1987) 3. Bansal, N., Sviridenko, M.: The Santa Claus problem. In: STOC. pp. 31–40 (2006) An Efficient Primal-Dual Algorithm for Fair Combinatorial Optimization 15 4. Bezakova, I., Dani, V.: Allocating indivisible goods. ACM SIGecom Exchanges 5(3), 11–18 (2005) 5. Chassein, A., Goerigk, M.: Alternative formulations for the ordered weighted averaging objective. Information Processing Letters pp. 604–608 (2015) 6. Dachert, K., Gorski, J., Klamroth, K.: An augmented weighted Tchebycheff method with adaptively chosen parameters for discrete bicriteria optimization problems. Computers and Operations Research 39(12), 2929–2943 (2012) 7. Dezs, B., Juttner, A., Kovacs, P.: LEMON - an open source C++ graph template library. Electronic notes in theoretical computer science 264(5), 23–45 (2011) 8. Edmonds, J.: Maximum matching and a polyhedron with 0, 1-vertices. Journal Res Nat Bureau Standards 69B, 125–130 (1965) 9. Gilbert, H., Spanjaard O.: A Game-Theoretic View of Randomized Fair MultiAgent Optimization. IJCAI Algorithmic Game Theory Workshop (2017) 10. Hurkala, J., Sliwinski, T.: Fair flow optimization with advanced aggregation operators in wireless mesh networks. In: Federated Conference on Computer Science and Information Systems. pp. 415–421 (2012) 11. Kostreva, M., Ogryczak, W., Wierzbicki, A.: Equitable aggregations and multiple criteria analysis. Eur. J. Operational Research 158, 362–367 (2004) 12. Lesca, J., Perny, P.: Lp solvable models for multiagent fair allocation problems. In: ECAI (2011) 13. Lovász, L., Plummer, M.: Matching Theory. North Holland (1986) 14. Luss, H.: Equitable Resource Allocation. Wiley (2012) 15. Lust, T., Teghem, J.: The multiobjective multidimensional knapsack problem: a survey and a new approach. Intl. Trans. in Op. Res. pp. 1–26 (2012) 16. Moulin, H.: Axioms of cooperative decision making. Cambridge Univ. Press (1988) 17. Moulin, H.: Fair Division and Collective Welfare. MIT Press (2004) 18. Ogryczak, W., Luss, H., Pióro, M., Nace, D., Tomaszewski, A.: Fair optimization and networks: A survey. Journal of Applied Mathematics 2014 (2014) 19. Ogryczak, W., Perny, P., Weng, P.: On minimizing ordered weighted regrets in multiobjective Markov decision processes. In: ADT. Lecture Notes in Artificial Intelligence, vol. 6992, pp. 190–204. Springer (2011) 20. Ogryczak, W., Perny, P., Weng, P.: A compromise programming approach to multiobjective Markov decision processes. IJITDM 12, 1021–1053 (2013) 21. Ogryczak, W., Sliwinski, T.: On solving linear programs with the ordered weighted averaging objective. Eur. J. Operational Research 148, 80–91 (2003) 22. Ogryczak, W., Sliwinski, T., Wierzbicki, A.: Fair resource allocation schemes and network dimensioning problems. J. of Telecom. & Info. Tech. 2003(3), 34–42 (2003) 23. Perny, P., Weng, P.: On finding compromise solutions in multiobjective Markov decision processes. In: ECAI (short paper) (2010) 24. Rawls, J.: The Theory of Justice. Havard university press (1971) 25. Rodera, H., Bagajewicz, M.J., Trafalis, T.B.: Mixed-integer multiobjective process planning under uncertainty. Ind. Eng. Chem. Res. 41(16), 4075–4084 (2002) 26. Schrijver, A.: Theory of Linear and Integer Programming. John Wiley (1998) 27. Steuer, R.: Multiple criteria optimization. John Wiley (1986) 28. Wang, W., Lu, C.: Projection onto the capped simplex (2015), arXiv:1503.01002 29. Weymark, J.: Generalized Gini inequality indices. Math. Social Sciences 1 (1981) 30. Wierzbicki, A.: A mathematical basis for satisficing decision making. Mathematical Modelling 3, 391–405 (1982) 31. Yager, R.: On ordered weighted averaging aggregation operators in multi-criteria decision making. IEEE Trans. on Syst., Man and Cyb. 18, 183–190 (1988)
8cs.DS
ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS arXiv:1508.05761v3 [math.AC] 29 Dec 2017 LAIACHI EL KAOUTIT Abstract. This paper contributes to the characterization of a certain class of commutative Hopf algebroids. It is shown that a commutative flat Hopf algebroid with a non zero base ring and a nonempty character groupoid is geometrically transitive if and only if any base change morphism is a weak equivalence (in particular, if any extension of the base ring is Landweber exact), if and only if any trivial bundle is a principal bi-bundle, and if and only if any two objects are fpqc locally isomorphic. As a consequence, any two isotropy Hopf algebras of a geometrically transitive Hopf algebroid (as above) are weakly equivalent. Furthermore, the character groupoid is transitive and any two isotropy Hopf algebras are conjugated. Several other characterizations of these Hopf algebroids in relation to transitive groupoids are also given. Contents 1. Introduction 1.1. Motivation and overview 1.2. Description of the main results 2. Abstract groupoids: General notions and basic properties 2.1. Notations, basic notions and examples 2.2. Groupoids actions, equivariant maps and the orbits sets 2.3. Principal groupoid-bisets and the two sided translation groupoid 2.4. Principal groupoids-biset versus weak equivalences 2.5. Transitive groupoids are characterized by weak equivalences 2.6. Correspondence between transitive groupoids and principal group-sets 3. Hopf algebroids: comodules algebras, principal bundles, and weak equivalences 3.1. Preliminaries and basic notations 3.2. The 2-category of Hopf algebroids 3.3. Comodules, bicomodules (algebras), and presheaves of orbit sets 3.4. Weak equivalences and principal bundles between Hopf algebroids 3.5. Dualizable right comodules 3.6. Dualizable comodule whose endomorphism ring is a principal bundle 4. Geometrically transitive Hopf algebroid: Definition, basic properties and the result 4.1. Definition and basic properties 4.2. Characterization by means of weak equivalences 5. More properties of geometrically transitive Hopf algebroids 5.1. The isotropy Hopf algebras are weakly equivalent 5.2. The transitivity of the character groupoid 5.3. GT Hopf algebroids and principal bundles over Hopf algebras 5.4. GT Hopf algebroids with empty character groupoid 5.5. Dualizable comodules over GT Hopf algebroids are locally free of constant rank References 1 1 3 5 5 7 7 9 10 11 11 12 12 15 16 17 18 18 18 21 22 23 25 26 27 29 30 1. Introduction 1.1. Motivation and overview. A commutative Hopf algebroid can be thought as an affine groupoid scheme, that is, a groupoid scheme [10, Définition page 299] in which the schemes defining objects and morphisms are affine schemes. In other words, this is a representable presheaf of groupoids in the category of affine schemes, or a prestack of groupoids whose ”stackification” leads to a stack in the fpqc (fidèlement plate et quasi-compacte) topology. For instance, an action of an affine group scheme on an affine scheme Date: January 3, 2018. 2010 Mathematics Subject Classification. Primary 16D90, 16T15, 18B40, 18D35, 18D10; Secondary 14M17, 20L05, 58H05. Key words and phrases. Transitive groupoids; groupoid bisets; weak equivalences; Landweber exactness; geometrically transitive Hopf algebroids; principal bi-bundles; isotropy Hopf algebras; character groupoid. Research supported by the Spanish Ministerio de Economı́a y Competitividad and FEDER, grants MTM2016-77033-P and MTM2013-41992-P. 1 2 LAIACHI EL KAOUTIT leads to an affine groupoid scheme which gives rise (by passage to the coordinate rings) to a commutative Hopf algebroid, known as split Hopf algebroid ([26, Appendix A.1], see also [19]). More examples of commutative Hopf algebroids can be performed using Set-theoretically constructions in groupoids. Hopf algebroids in relation with groupoids are fundamental objects in both algebraic topology and algebraic geometry. They appear in the study of stable homotopy theory [26, 17, 24, 25] (see also the references therein), and prove to be very useful in studying quotients of preschemes, prestacks of groupoids over affine schemes as well as (commutative) Tannakian categories [14, 9, 4, 1, 20]. As in the case of affine group schemes [10], several constructions and results on groupoids have a certain geometric meaning in presheaves of groupoids and then a possible algebraic interpretation at the level of Hopf algebroids. In this way, Hopf algebroids are better understood when looking to classical results in groupoids, or by mimicking well-known results on classical geometric groupoids, e.g. topological or Lie groupoids. The main motivation of this paper fits into these lines of research. Specifically, we study a class of commutative Hopf algebroids called geometrically transitive (see below), by means of transitive groupoids and their properties, obtaining in this way several new characterizations of these Hopf algebroids. Besides, much of the properties of transitive groupoids hereby developed and used in the study of Hopf algebroids can be also seen as a contribution to the theory of groupoids. The notion of transitivity varies depending on the context. In groupoid theory, a (small) groupoid is said to be transitive when the cartesian product of the source and the target is a surjective map. A Lie groupoid is called locally trivial (or a transitive Lie groupoid), when this map is a surjective submersion [21, 8]. For groupoid schemes, the meaning of the abstract notion of transitivity was introduced by Deligne in [9, page 114]. More precisely, a groupoid scheme is transitive in the fpqc topology sense if the morphism constituted by the fibred product of the source and the target is a cover in this topology. In [4, Définition page 5850], Bruguières introduced a class of Hopf algebroids referred to as geometrically transitive, where he showed ([4, Théorème 8.2 page 5858]) that in the commutative case (the case which we are interested in) these are Hopf algebroids whose associated affine groupoid schemes are transitive in the fpqc sense. It is also implicitly shown in [4] that a commutative Hopf algebroid is geometrically transitive if and only if the unit map (i.e., the tensor product of the source and the target) is a faithfully flat extension. This, in fact, can be thought of as a proper definition of geometrically transitive (GT for short) commutative Hopf algebroids. Nevertheless, we will use here the original definition of [4] (see Definition 4.2 below) and show using elementary methods that the faithful flatness of the unit characterizes in fact GT Hopf algebroids with nonempty character groupoids (see Theorem A below). Transitive groupoids are also characterized by the fact that any two objects are isomorphic, or equivalently: a groupoid with only one connected component, or connected groupoid in the terminology of [16]. From the geometric point of view, that is, for presheaves of groupoids, this means that any two objects are locally isomorphic in the fpqc topology, see [9, Proposition 3.3]. At the level of Hopf algebroids, this property can be directly expressed in terms of faithfully flat extensions (see Definition 3.6 below), which in turn characterizes GT Hopf algebroids with nonempty character groupoids, as we will see in the sequel by using elementary (algebraic) arguments. Our methods, in fact, lead us also to recover other results on equivalences of categories stated in [9, §3.5] (see the paragraph after Theorem A). From their very definition one can then see that GT Hopf algebroids can be understood as a natural algebro-geometric substitute of transitive groupoids. Under this point of view, it is reasonable to expect that most of the properties or characterizations of transitive groupoids could have an analogous counterpart at the level of GT Hopf algebroids. However, apart from the basic definition, there are still several characterizations of transitive groupoids which, up to our knowledge, are not known for GT Hopf algebroids. In the following, we describe the two most interesting of these characterizations. / s ι A perhaps well-known result (see Proposition 2.15 for details) says that a groupoid G : G1 o / G0 t ς is transitive if and only if for any map ς : X → G0 the induced morphism of groupoids G → G is a weak equivalence (i.e., an essentially surjective and fully faithful functor), where G ς is the induced groupoid whose set of objects is X and its set of arrows is the fibred product X ς × t G1 s × ς X, that is, G ς is the pullback groupoid of G along ς (see [21, §2.3] and [16] for a dual construction). Another more interesting and perhaps not yet known characterization of the transitivity is by means of principal groupoid-bisets; for the precise definition see Definitions 2.6, 2.7, and 2.8. This notion is in fact an abstract formulation of the notion of principal bi-bundles in the context of topological and Lie groupoids [22, 18], or that of ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 3 bi-torsors in sheaf theory [10, 15], which is of course based on the natural generalization of the notion of group-bisets [7] to the context of groupoids. The aforementioned characterization can be expressed as follows: a groupoid G is transitive if and only if for any map ς : X → G0 the pull-back groupoid-biset G1 s × ς X is a principal (G , G ς )-biset, see again Proposition 2.15. The main aim of this paper is to investigate GT Hopf algebroids by means of transitive groupoids. Our aim is in part to see how the previous characterizations of transitive groupoids can be transferred, by means of weak equivalences and principal groupoids-bisets, to the commutative Hopf algebroid framework. 1.2. Description of the main results. Let k be the ground field. The term algebra in the following stands for a commutative k-algebra, as usual the unadorned tensor product ⊗ denotes the tensor product over k. Our main result is summarized in the following theorem, which includes Theorem 4.8 below: Theorem A. Let (A, H) be a commutative flat Hopf algebroid over k with A , 0 and denote by H its associated presheaf of groupoids. Assume that H0 (k) , ∅. Then the following are equivalent: (i) η = s ⊗ t : A ⊗ A → H is a faithfully flat extension; (ii) Any two objects of H are fpqc locally isomorphic (see Definition 3.6); (iii) For any extension φ : A → B, the extension α : A → Ht ⊗A φ B, a 7→ s(a) ⊗A 1B is faithfully flat; (iv) (A, H) is geometrically transitive (see Definition 4.2); (v) For any extension φ : A → B, the canonical morphism φ : (A, H) → (B, Hφ) of Hopf algebroids is a weak equivalence, that is, the induced functor φ∗ : ComodH → ComodHφ is an equivalence of symmetric monoidal k-linear categories of comodules, where Hφ = B ⊗A H ⊗A B; (vi) For any extension φ : A → B, the trivial principal left (H, Hφ )-bundle H ⊗A B is a principal bi-bundle (see subsection 3.4). The flatness is to ensure that the categories of comodules of the involved Hopf algebroids are Grothendieck ones with exact forgetful functor to the category of modules over the base algebra. As for the hypothesis A , 0, one of the conditions in Definition 4.2 below says that the endomorphisms ring of A viewed as a comodule should coincides with k, so it is reasonable to ask A to be a non zero object. The examples of Hopf algebroids we have in mind and satisfy the assumptions of Theorem A, are the ones which can be obtained from Tannaka’s reconstruction process, by using k-linear representations of a (small) groupoid G and taking A = Map(G0 , k), the set of all maps from G0 to k, as the base algebra. The proof of Theorem A is done by showing the implications (i) ⇒ (ii) ⇒ (iii) ⇒ (iv) ⇒ (i), and using the equivalences (iii) ⇔ (v) ⇔ (vi) from [11, Proposition 5.1]. The assumption H0 (k) , ∅ which ensures that the character groupoid H (k) is nonempty, is needed to prove the implication (iii) ⇒ (iv). Although, the implication (ii) ⇒ (iii) can be shown under the weaker assumption H0 (L) , ∅ for some field extension L of k. Moreover, the equivalent conditions of Theorem A are stable under change of scalars for the class of Hopf algebroids with nonempty character groupoids (i.e., with H0 (k) , ∅). Indeed, if L is a field extension of k and (A, H) is a Hopf algebroid which verifies the assumptions of Theorem A and satisfies one of these conditions say (i), then the Hopf algebroid (AL , HL ) = (A ⊗k L, H ⊗k L) satisfies this condition as well. However, if H0 (k) = ∅ and there is a field extension L such that H0 (L) , ∅, then it is not clear to us how to show the implication (iii) ⇒ (iv), see Remarks 3.7 and 4.10 for more comments on the change of scalars. As we have mention before, saying that (A, H) is GT Hopf algebroid is equivalent to say that the kgroupoid H1 acts transitively on H0 in the fpqc sense. Thus, by Theorem A, this can be now easily deduced by comparing condition (i) with the Definition of [9, §1.6]. On the other hand, there is also a notion of transitivity for Hopf algebroids [4, Définition page 5850] and as was shown in [4, Proposition 7.3 page 5851], a Hopf algebroid (A, H) is geometrically transitive if and only if (AL , HL ) is transitive for any field extension L of k. Perhaps this justifies the terminology, although it is not clear, at least to us, how to express this transitivity at the level of the associated presheaves of groupoids with respect to a certain topology, see Remark 4.5 for more details. Condition (v) in Theorem A implies in particular that any algebra extension B is Landweber exact over A in the sense of [17, Definition 2.1] and shows that certain GT Hopf algebroids do not have a non trivial hereditary torsion theory in the sense of [17, Theorem A]. On the other hand, following the notation of [9, §3.5], we know that the category of comodules ComodH is canonically equivalent, as a symmetric monoidal k-linear category, to the category of linear representations Rep(H0 : H1 ) of the associated affine presheaf of groupoids. So, up to these canonical equivalences, condition (v) gives the ”affine version” of 4 LAIACHI EL KAOUTIT the equivalence of categories stated in [9, (3.5.1) page 130]. Furthermore, Theorem A shows that for affine k-schemes with the induced fpqc topology, the equivalence of categories stated in op.cit., is not only a necessary condition to have a transitive action (for the class of affine k-groupoids H with H0 (k) , ∅), but also a sufficient one. Thus we obtain a new characterization of these transitive affine k-groupoids. The fact that transitive groupoids are characterized by the conjugacy of their isotropy groups, and the analogue of this characterization in the Hopf algebroid context also attracted our attention. More precisely, given a Hopf algebroid (A, H) and denote by H (C) the fiber of H at a commutative algebra C, that is, the groupoid with set of objects H0 (C) = Algk (A, C) and set of arrows H1 (C) = Algk (H, C) (see equation (13) below). Assume as above that the character groupoid H (k) in nonempty (i.e., H0 (k) , ∅), then for any object x : A → k, there is a presheaf of sets which assigns to each algebra C, the isotropy group of the object x∗ (1C ) ∈ H0 (C), where 1C : k → C denotes the unit of C. It turns out that this is an affine group scheme represented by the Hopf algebra (kx , Hx ) which is the base change of (A, H) by the algebra map x (here kx denotes k viewed as an A-algebra via x, and Hx = kx ⊗A H ⊗A kx ). The pair (kx , Hx ) is refereed to as the isotropy Hopf algebra of (A, H) at (the point) x. Now, recall from [17] that two flat Hopf algebroids (A, H) and (B, K) are weakly equivalent if there is a diagram of weak equivalences (A, H) (C, J) i❙ ❙❙❙❙ ❦❦5 ❙ ❦❦❦❦ (B, K), see Subsection 3.4 for more details. The fact that two isotropy groups of a transitive groupoid are isomorphic is translated to the fact that two isotropy Hopf algebras of a GT Hopf algebroid are weakly equivalent; of course, Hopf algebras are considered here as Hopf algebroids where source and target coincide. This result is part of the subsequent corollary of Theorem A which contains both Proposition 5.3 and Corollary 5.17; the last statement in part (2) below follows from Propositions 4.1(GT13) and 4.6. Corollary A. Let (A, H) be a flat Hopf algebroid as in Theorem A with H0 (k) , ∅. Assume that (A, H) is geometrically transitive. Then (1) Any two isotropy Hopf algebras are weakly equivalent. (2) Any dualizable (right) H-comodule is locally free of constant rank. Moreover, any right H-comodule is an inductive limit of dualizable right H-comodules. The notion of the conjugation relation between two isotropy Hopf algebras is not automatic. This relation can be formulated by using 2-isomorphisms in the 2-category of flat Hopf algebroids. More specifically, using the notations and the assumptions of Theorem A, for a given Hopf algebroid (A, H), two isotropy Hopf algebras (kx , Hx ) and (ky , Hy ), at the points x, y ∈ H0 (k) are said to be conjugated provided there is an isomorphism g : (kx , Hx ) → (ky , Hy ) of Hopf algebras such that the following diagram (kx , Hx ) i❙ ❙❙❙❙ ❙ x g (A, H) / (k , H ) ❦5 y y ❦ ❦ ❦ ❦❦ y commutes up to a 2-isomorphism, where x and y are the canonical morphisms attached, respectively, to x and y. The transitivity of the conjugation relation characterizes in fact the transitivity of the character groupoid. This result is also a corollary of Theorem A and stated as Proposition 5.9 below: Corollary B. Let (A, H) be a flat Hopf algebroid as in Theorem A with H0 (k) , ∅. Assume that (A, H) is geometrically transitive. Then the following are equivalent (i) the character groupoid H (k) is transitive; (ii) for any two objects x, y in H0 (k), the left H-comodule algebras H ⊗A kx and H ⊗A ky are isomorphic; (iii) any two isotropy Hopf algebras are conjugated. Furthermore, under the stated assumptions, we have that condition (i) is always fulfilled. Let (A, H) be a flat Hopf algebroid over k with A , 0 and H0 (k) = ∅. If (A, H) satisfies condition (i) of Theorem A and there exists a field extension L of k such that H0 (L) , ∅, then Corollary B can be applied to (AL , HL ) and implies that H (L) is a transitive groupoid, see Proposition 5.14. Transitive groupoids are related to principal group-bisets, in the sense that there is a (non canonical) correspondence between these two notions, see Subsection 2.6. This in fact is an abstract formulation ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 5 of Ehresmann’s well-known result dealing with the correspondence between transitive Lie groupoids and principal fibre bundles, as was expounded in [8]. The analogous correspondence at the level of Hopf algebroids is not always possible and some technical assumptions are required. The formulation of this result is given as follows. For any object x ∈ H0 (k), consider the presheaf of sets which associates to each algebra C the set  Px (C) := t−1 {x∗ (1C )} , where t is the target of the groupoid H (C). In the terminology of [16], this is the left star set of the object x∗ (1C ). Denote by αx : A → Px := H ⊗A kx the algebra map which sends a 7→ s(a) ⊗ 1. It turns out that the presheaf of sets Px is affine, and is up to a natural isomorphism represented by the (H, Hx )-bicomodule algebra Px . The subsequent is a corollary of Theorem A, and formulates the desired result. It is a combination of Lemma 5.10 and Proposition 5.11 below. Corollary C. Let (A, H) be a flat Hopf algebroid as in Theorem A with H0 (k) , ∅. If (A, H) is a GT Hopf algebroid, then for any object x ∈ H0 (k), the comodule algebra (Px , αx ) is a right principal Hx -bundle (i.e., a Hopf-Galois extension). Conversely, let (P, α) be a right principal B-bundle over a Hopf k-algebra B with extension α : A → P. Denote by υ : H := (P ⊗ P)coinvB → P ⊗ P the canonical injection, where P ⊗ P is a right B-comodule algebra via the diagonal coaction (here RcoinvB denotes the subalgebra of coinvariant elements of a right B-comodule algebra R). Assume that υ is a faithfully flat extension and that  coinvB H ⊗A H = (P ⊗ P) ⊗A (P ⊗ P) , where (P ⊗ P) ⊗A (P ⊗ P) is endowed with a canonical right B-comodule algebra structure. Then the pair of algebras (A, H) admits a unique structure of a GT Hopf algebroid such that (α, υ) : (A, H) → (P, P ⊗ P) is a morphism of GT Hopf algebroids. 2. Abstract groupoids: General notions and basic properties This section contains the results about groupoids, which we want to transfer to the context of Hopf algebroids in the forthcoming sections. For sake of completeness we include some of their proofs. 2.1. Notations, basic notions and examples. A groupoid (or abstract groupoid) is a small category where / s ι each morphism is an isomorphism. That is, a pair of two sets G := (G1 , G0 ) with diagram G1 o / G0 , t where s and t are resp. the source and the target of a given arrow, and ι assigns to each object its identity arrow; together with an associative and unital multiplication G2 := G1 s × t G1 → G1 as well as a map G1 → G1 which associates to each arrow its inverse. Given a groupoid G , consider an object x ∈ G0 , the isotropy group of G at x, is the group of loops: n o G x := g ∈ G1 | s(g) = t(g) = x . (1) U x Notice that the disjoint union x ∈ G0 G of all isotropy groups form the set of arrows of a subgroupoid of U G whose source equal to its target, namely, the projection x ∈ G0 G x → G0 . A morphism of groupoids φ : H → G is a functor between the underlying categories. That is, φ = (φ0 , φ1) ), where φ0 : H0 → G0 and φ1 : H1 → G1 satisfying the pertinent compatibility conditions: φ1 ◦ ι = ι ◦ φ0 , φ0 ◦ s = s ◦ φ1 , φ0 ◦ t = t ◦ φ1 , φ1 ( f g) = φ1 ( f )φ1 (g), whenever the multiplication f g in H1 is permitted. Obviously any such a morphism induces morphisms between the isotropy groups: φu : H u → G φ0 (u) , for every u ∈ H0 . Naturally, groupoids, morphism of groupoids, and natural transformations form a 2-category Grpds. Next we describe some typical examples of groupoids and their morphisms. Example 2.1. Let G be a group and fix a set M. Denote by BG M the category whose objects are (left) Gtorsors of the form (P, G, M) and morphisms are G-morphisms. In the terminology of Definition 2.8 below, an object (P, G, M) in BG M is a principal left G-set P. Precisely, this is a left G-set P with projection π : P → M to the set of orbits M and where the canonical map G × P → P π × π P, (g, p) 7→ (gp, p) is bijective. It is clear that any morphism in this category is an isomorphism, thus, BG M is a groupoid (probably not small). The groupoid BG pt plays a crucial role in the representation theory of the group G. Furthermore, when M varies in the category Sets of sets, we obtain the presheaf of groupoids BG : Setsop −→ Grpds, which is known as the classifying stack of the group G. 6 LAIACHI EL KAOUTIT Example 2.2. Assume that R ⊆ X × X is an equivalence relation on a set X. One can construct a groupoid / pr R o prι12 / X, with structure maps as follows. The source and the target are s = pr2 and t = pr1 , the second and the first projections, and the map of identity arrows ι is the diagonal one. The multiplication and the inverse maps use, respectively, the transitivity and reflexivity of R and are given by (x, x′ ) (x′ , x′′ ) = (x, x′′ ), and (x, x′ )−1 = (x′ , x). This is an important class of groupoids known as the groupoid of equivalence relation, see [10, Exemple 1.4, page 301]. A particular situation is when R = X × X, that is, the obtained groupoid is the so called the groupoid of pairs (called fine groupoid in [3] and simplicial groupoid in [16]); or when R is defined by a certain fibred product X ν × ν X for a map ν : X → Y. Example 2.3. Any group G can be considered as a groupoid by taking G1 = G and G0 = {∗} (a set with one element). Now if X is a right G-set with action ρ : X × G → X, then one can define the so called the action groupoid: G1 = X × G and G0 = X, the source and the target are s = ρ and t = pr1 , the identity map sends x 7→ (e, x) = ιx , where e is the identity element of G. The multiplication is given by (x, g)(x′ , g′ ) = (x, gg′ ), whenever xg = x′ , and the inverse is defined by (x, g)−1 = (xg, g−1 ). Clearly the pair of maps (pr2 , ∗) : (G1 , G0 ) → (G, {∗}) defines a morphism of groupoids. Example 2.4. Let G = (G1 , G0 ) be a groupoid and ς : X → G0 a map. Consider the following pair of sets: n o Gς 1 := X ς × t G1 s × ς X = (x, g, x′ ) ∈ X × G1 × X| ς(x) = t(g), ς(x′ ) = s(g) , Gς 0 := X. Then G ς = (Gς 1 , Gς 0 ) is a groupoid, with structure maps: s = pr3 , t = pr1 , ιx = (ς(x), ις(x) , ς(x)), x ∈ X. The multiplication is defined by (x, g, y)(x′, g′ , y′ ) = (x, gg′ , y′ ), whenever y = x′ , and the inverse is given by (x, g, y)−1 = (y, g−1 , x). The groupoid G ς is known as the induced groupoid of G by the map ς, (or the pull-back groupoid of G along ς, see [16] for dual notion). Clearly, there is a canonical morphism φς := (pr2 , ς) : G ς → G of groupoids. Any morphism φ : H → G of groupoids factors through the canonical morphism G φ0 → G , that is we have the following (strict) commutative diagram φ H ( φ′ of groupoids, where φ′0 = idH0 and φ′1 : H1 −→ Gφ0 1 ,  G φ0 /7 G ♦♦♦ ♦ ♦ ♦  h 7−→ t(h), φ1(h), s(h) . A particular and important example of an induced groupoid is the case when G is a groupoid with one object, that is, a group. In this case, to any group G and a set X, one can associated the groupoid (X × G × X, X) as the induced groupoid of (G, {∗}) by the map ∗ : X → {∗}. Recall that a groupoid G = (G1 , G0 ) is said to be transitive if the map (s, t) : G1 → G0 × G0 is surjective. Example 2.5. The groupoid of pairs is clearly transitive, as well as any induced groupoid of the form (X × G × X, X). On other hand, if a group G acts transitively on a set X, then the associated action groupoid is by construction transitive. Let G be a transitive groupoid. Then if x, y ∈ G0 , there is a non-canonical isomorphism of groups G x  G y given by conjugation: Let g ∈ G1 with x = s(g) and t(g) = y, then   G x −→ G y , h 7−→ ghg−1 is an isomorphism of groups. This fact is essential in showing that any transitive groupoid is isomorphic, in a non-canonical way, to an induced groupoid of the form (X ×G × X, X). Indeed, given a transitive groupoid G , fix an object x ∈ G0 with isotropy group G x and chose a family of arrows { fy }y ∈ G0 such that fy ∈ t−1 ({x}) and s( fy ) = y, for y , x while fx = ι(x), for y = x. In this way the morphism h   i  φx : G −→ (G0 × G x × G0 , G0 ), (g, z) 7−→ s(g), ft(g) g fs−1 , t(g) , z (g) establishes an isomorphism of groupoids. ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 7 2.2. Groupoids actions, equivariant maps and the orbits sets. The following definition is a natural generalization to the context of groupoids, of the usual notion of group-set. It is an abstract formulation of that given in [21, Definition 1.6.1] for Lie groupoids, and essentially the same definition based on the Sets-bundles notion given in [27, Definition 1.11]. Definition 2.6. Given a groupoid G , a right G -set is a triple (X, ς, ρ) where X is a set and ς : X → G0 and ρ : X ς × t G1 → X (shortly written as ρ(x, g) := xg) are the structure and action maps respectively. These maps obey the following conditions (1) s(g) = ς(xg), for any x ∈ X and g ∈ G1 with ς(x) = t(g). (2) xις(x) = x, for every x ∈ X. (3) (xg)h = x(gh), for every x ∈ X, g, h ∈ G1 with ς(x) = t(g) and t(h) = s(g). In order to simplify the notation we denote a right G -set by a pair (X, ς), omitting the action ρ. A left groupoid action is analogously defined by interchanging the source with the target and similar notations might be adopted. Obviously, any groupoid G acts over itself on both sides by using the regular action, i.e., the multiplication G1 s × t G1 → G1 . Thus, we have that (G1 , s) is a right G -set and (G1 ,t) is a left G -set. Let (X, ς) be a right G -set, and consider the pair of sets X Y G := X ς × t G1 , X as a groupoid with structure maps s = ρ, t = pr1 , ιx = (x, ις(x) ). The multiplication and the inverse maps are defined by (x, g)(x′ , g′ ) = (x, gg′ ) and (x, g)−1 = (xg, g−1 ). The groupoid X Y G is known as the right translation groupoid of X by G . For sake of completeness let us recall the notion of equivariant maps. A morphism of right G -sets (or G -equivariant map) F : (X, ς) → (X ′ , ς′ ) is a map F : X → X ′ such that the diagrams X ς ♦♦ ♦ ♦ ♦ w♦ F G0 g❖❖ ❖❖❖  ❖ ′ ς X′ X ς × t G1 /X F F × id  X ′ ς′ × t G 1  / X′ (2) commute. Clearly any such a G -equivariant map induces a morphism of groupoids F : X Y G → X ′ Y G . Next we recall the notion of the orbit set attached to a right groupoid-set. This notion is a generalization of the orbit set in the context of group-sets. Here we use the (right) translation groupoid to introduce this set. First we recall the notion of the orbit set of a given groupoid. The orbit set of a groupoid G is the quotient set of G0 by the following equivalence relation: x ∼ y ⇐⇒ ∃ g ∈ G1 such that s(g) = x and t(g) = y. In others words, this is the set of all connected components of G . Given a right G -set (X, ς), the orbit set X/G of (X, ς) is the orbit set of the translation groupoid X Y G . If G = (X × G, X) is an action groupoid as in Example 2.3, then obviously the orbit set of this groupoid coincides with the classical set X/G of orbits. 2.3. Principal groupoid-bisets and the two sided translation groupoid. We give in this subsection an exhaustive survey on principal groupoids bisets and the formal constructions of their bicategories. Let G and H be two groupoids and (X, ς, ϑ) a triple consisting of a set X and two maps ς : X → G0 , ϑ : X → H0 . The following definitions are abstract formulations of those given in [18, 22] for topological and Lie groupoids. Definition 2.7. An (H , G )-biset is a triple (X, ς, ϑ) where (X, ς) is endowed with a right G -action ρ : X ς × t G1 → X and (X, ϑ) with a left H -action λ : H1 s × ϑ X → X such that (1) For any x ∈ X, h ∈ H1 , g ∈ G1 with ϑ(x) = s(h) and ς(x) = t(g), we have ϑ(xg) = ϑ(x) and ς(hx) = ς(x). (2) For any x ∈ X, h ∈ H1 and g ∈ G1 with ς(x) = t(g), ϑ(x) = s(h), we have h(xg) = (hx)g. The two sided translation groupoid associated to a given (H , G )-biset (X, ς, ϑ) is defined to be the groupoid H X X Y G whose set of objects is X and set of arrows is n o H1 s × ϑ X ς × s G1 = (h, x, g) ∈ H1 × X × G1 | s(h) = ϑ(x), s(g) = ς(x) . 8 LAIACHI EL KAOUTIT The structure maps are: s(h, x, g) = x, t(h, x, g) = hxg−1 and ι x = (ιϑ(x) , x, ις(x) ). The multiplication and the inverse are given by: (h, x, g)(h′, x′ , g′ ) = (hh′ , x′ , gg′), (h, x, g)−1 = (h−1 , hxg−1 , g−1 ). Associated to a given (H , G )-biset (X, ς, ϑ), there are two canonical morphisms of groupoids:    Σ : H X X Y G −→ G , (h, x, g), y 7−→ g, ς(y) ,    Θ : H X X Y G −→ H , (h, x, g), y 7−→ h, ϑ(y) . (3) (4) Definition 2.8. Let (X, ς, ϑ) be an (H , G )-biset. We say that (X, ς, ϑ) is a left principal (H , G )-biset if it satisfies the following conditions: (P-1) ς : X → G0 is surjective; (P-2) the canonical map   ∇ : H1 s × ϑ X −→ X ς × ς X, (h, x) 7−→ (hx, x) (5) is bijective. By condition (P-2) we consider the map δ := pr1 ◦ ∇−1 : X ς × ς X → H1 . This map clearly satisfies:  s δ(x, y) = ϑ(y) (6) δ(x, y)y = x, for any x, y ∈ X with ς(x) = ς(y); (7) δ(hx, x) = h, for h ∈ H1 , x ∈ X with s(h) = ϑ(x). (8) Equation (8), shows that the action is in fact free, that is, hx = x only when h = ιϑ(x) . The subsequent lemma is also immediate from this definition. Lemma 2.9. Let (X, ς, ϑ) be a left principal (H , G )-biset. Then the map ς induces a bijection between the orbit set X/H and the set of objects G0 . Analogously one defines right principal (H , G )-biset. A principal (H , G )-biset is both left and right principal biset. For instance, (G1 , t, s) is a left and right principal (G , G )-biset, known as the unit principal biset, which we denote by U (G ). More examples of left principal bisets can be performed, as in the geometric case, by pulling back other left principal bisets. Precisely, assume we are given (X, ς, ϑ) a left principal (H , G )-biset, and let ψ : K → G be a morphism of groupoids. Consider the set Y := X ϑ × ψ0 K0 together with maps pr2 : Y → K0 and e ς := ς ◦ pr1 : Y → H0 . Then the triple (Y, e ς, pr2 ) is an (H , K )-biset with actions   λ : H1 s × ς Y −→ Y, h, (x, u) 7−→ hx, u (9)   ρ : Y eς × t K1 −→ Y, (x, u), f 7−→ xψ1 ( f ), s( f ) , (10) which is actually a left principal (H , K )-biset, and known as the pull-back principal biset of (X, ς, ϑ); we  denote it by ψ∗ (X, ς, ϑ) . A left principal biset is called a trivial left principal biset if it is the pull-back of the unit left principal biset, that is, of the form ψ∗ (U (G )) for some morphism of groupoids ψ : K → G . Next we expound the bicategorical constructions beyond the notion of principal groupoids-bisets. A morphism of left principal (H , G )-bisets F : (X, ς, ϑ) → (X ′ , ς′ , ϑ′ ) is a map F : X → X ′ which is simultaneously G -equivariant and H -equivariant, that is, the following diagrams /X /X X ς × t G1 H1 s × ϑ X X ❖❖❖ϑ ς ♦♦ ❖❖❖ ♦ ♦ ♦ ' w♦ F F id × F F × id F (11) G0 g❖❖ ♦7 H0     ❖❖❖  ♦ ♦ ♦ ′ ′ ′ ′ / ❖ ♦ / ♦ ϑ′ H1 s × ϑ′ X X. X ς′ × t G 1 X ς′ X′ commute. An isomorphism of left principal bisets is a morphism whose underlying map is bijective. As in the geometric case we have: Proposition 2.10. Given two groupoids G and H . Then any morphism between left principal (H , G )bisets is an isomorphism. ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 9 Proof. Let F : (X, ς, ϑ) → (X ′ , ς′ , ϑ′ ) be a morphism of left principal (H , G )-bisets. We first show that F is injective. So take x, y ∈ X such that F(x) = F(y), whence ς(x) = ς(y). By Lemma 2.9, we know that there exists h ∈ H1 with s(h) = ϑ(x) such that hx = y. Therefore, we have F(hx) = F(y) = hF(x) = F(x) and so h = ιϑ(x) , since the left action is free. This shows that x = y. The surjectivity of F is derived as follows. Take an arbitrary element x′ ∈ X ′ and consider its image ς′ (x′ ) ∈ G0 . Since ς is surjective, there exists x ∈ X such that ς(x) = ς′ F(x) = ς′ (x′ ). This means that F(x) and x′ are in the same orbit, so there exists h′ ∈ H1 (with s(h′ ) = ϑ(x)) such that h′ F(x) = F(h′ x) = x′ , which shows that F is surjective.  Remark 2.11. By Proposition 2.10, the category of left principal bisets PBl (H , G ) is actually a groupoid (not necessarly a small category). On the other hand, notice that if (X, ς, ϑ) is a left principal (H , G )-biset, then its opposite (X o , ϑ, ς) is a right principal (G , H )-biset, where the underlying set still the same set X while the actions were switched by using the inverse maps of both groupoids. This in fact establishes an isomorphism of categories between PBl (H , G ) and the category of right principal bisets PBr (G , H ). Remark 2.12. Given (X, ς, ϑ) an (H , G )-biset and (X ′ , ς′ , ϑ′ ) a (G , K )-biset. One can endow the fibre product X ς × ϑ′ X ′ within a structure of an (H , K )-biset. Furthermore, G also acts on this set by the action (x, x′ ).g = (xg, g−1 x′ ), for g ∈ G1 , (x, x′ ) ∈ X ς × ϑ′ X ′ with t(g) = ς(x) = ϑ′ (x′ ). Denote by  X ⊗G X ′ := X ς × ϑ′ X ′ /G its orbit set, then clearly this set inherits a structure of (H , K )-biset. This is the tensor product of bisets, also known as le produit contracté [15, Définition 1.3.1 page 114], [10, Chap.III, §4, 3.1]. It turns out that, if (X, ς, ϑ) is a left principal biset and (X ′ , ς′ , ϑ′ ) is a left principal biset, then X ⊗G X ′ is a left principal (H , K )-biset. Moreover, one can show that the tensor product (over different groupoids) is associative, up to a natural isomorphism. This defines the bicategory PBl of left principal bisets. Analougly, we have the bicategories PBr and PBb (of principal bisets). For a single 0-cell, i.e., a groupoid G , the category PBb (G , G ) turns to be a bigroup (or a categorical group). Moreover, in analogy with the group case, one can construct with the help of Proposition 2.10 and by using morphisms between left translation groupoids, a presheaf BG : Setsop −→ 2-Grpds to the category of 2-groupoids known as the classifying 2-stack of the groupoid G (compare with Example 2.1). 2.4. Principal groupoids-biset versus weak equivalences. A morphism of groupoids φ : H → G is said to be a weak equivalence if it satisfies the following two conditions: (WE-1) The composition map G1 s × φ0 H0 (WE-2) The following diagram is cartesian pr1 t / G1 / G0 is surjective. φ1 H1 / G1 (s,t) (s,t)  H0 × H0 φ0 ×φ0 Equivalently there is a bijection Γ : H1  H0 Γ = (s, t). φ0  / G0 × G0 × s G1 t × φ0 H0 such that pr2 ◦ Γ = φ0 and (pr1 , pr3 ) ◦ In categorical terms, condition (WE-1) says that φ is an essentially surjective functor: Each object of G is isomorphic to the image by φ of an object in H . The second condition, means that φ is fully faithful: If  u, v are two objects in H then φ defines a bijection between the sets of arrows H (u, v) and G φ0 (u), φ0(v) . Both properties classically characterize functors which define equivalences of categories. Two groupoids G and H are said to be weakly equivalent when there exists a third groupoid K with a diagram (i.e., a span) of weak equivalences: G K PP PPP ♦♦♦ ♦ P( ♦ w♦ H. For sake of completeness, next we give a result which relate the notion of principal biset with that of weak equivalence. 10 LAIACHI EL KAOUTIT Proposition 2.13. Let G and H be two groupoids. Assume that there is (X, ς, ϑ) a principal (H , G )-biset. Then the canonical morphisms of groupoids H H X X Y ❚G❚ Θ ✐✐✐ ❚❚❚Σ ❚ ✐ ❚❚* t✐✐✐✐ G are weak equivalences, where Θ, Σ are as in (3) and (4). In particular, G and H are weakly equivalent. Proof. We only show that if (X, ς, ϑ) is a left principal (H , G )-biset, then the canonical morphism    Σ : H X X Y G −→ G , (h, x, g), x 7−→ (g, ς(x) is a weak equivalence. The proof of the fact that Θ is a weak equivalence follows similarly from the assumption that (X, ς, ϑ) is right principal (H , G )-biset. Condition (WE-1) for Σ is clear, since ς is surjective by condition (P-1) of Definition 2.8. Consider the map / X ς × s G1 t × ς X Γ : H1 s × ϑ X ς × s G 1 ✤ / x, g, hxg−1. h, x, g Using the map δ : X ς × ς X → H1 resulting from condition (P-2) on (X, ς, ϑ) and which satisfies equations (6)-(8), we define the inverse of Γ to be the map: Γ−1 : X ς × s G1 t × ς X ✤ x, g, y / H1 s × ϑ X ς × s G 1 / δ(y, xg−1 ), x, g, which gives condition (WE-2) for Σ.  Remark 2.14. As we have seen in Remark 2.11, the opposite of left principal (H , G )-biset is a right principal (G , H )-biset. Thus the opposite of principal biset is also a principal biset. In this way, Proposition 2.13 says that the “equivalence relation” between groupoids defined by ’being connected by a principal biset’ is contained in the equivalence relation defined by ’being weakly equivalent’. An interesting question is then to check if both relations are the same. Precisely, one can ask whether two weakly equivalent groupoids H and G are connected by a certain principal (H , G )-biset. The complete answer was recently given in [11, Theorem 2.9] (see Remark 3.10 below for these equivalence relations in Hopf algebroids context). 2.5. Transitive groupoids are characterized by weak equivalences. This subsection is the main motivation for the forthcoming sections. Here we show perhaps a well known result that characterizes transitive groupoids by means of weak equivalences and principal groupoids-bisets. Proposition 2.15. Let G be a groupoid. Then the following are equivalent: (i) For every map ς : X → G0 , the induced morphism of groupoids φς : G ς → G is a weak equivalence; (ii) G is a transitive groupoid; ∗ (iii) For every map ς : X → G0 , the pull-back biset φς (U (G )) is a principal (G , G ς )-biset. Proof. (i) ⇒ (ii). Is immediate. ∗ (ii) ⇒ (iii). By definition φς (U (G )) is a left principal (G , G ς )-biset. We need then to check that, under  ∗ condition (ii), it is also right principal (G , G ς )-biset. This biset is given by φς (U (G )) = G1 s × ς X,et, pr2 , where et := t ◦ pr1 : G1 s × ς X → G1 → G0 . The left and right actions are given as in equations (9) and (10) by g ⇀ ( f, x) = (g f, x) and ( f, x) ↼ (y, h, x) = ( f h, y), for any ( f, x) ∈ G1 s × ς X, g ∈ G1 with s(g) = t( f ), and h ∈ G1 with s(h) = ς(y), t(h) = ς(x) and s( f ) = t(h). Both conditions (1)-(2) in Definition 2.7 are then clearly satisfied. The right canonical map is defined by     h       i ∇′ : G1 s × ς X pr2 × t Gς 1 −→ G1 s × ς X et ×et G1 s × ς X , f, x , y, h, x 7−→ f, x , f h, y . ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 11 The map et is clearly surjective, since G is transitive. This gives condition (P-1) of Definition 2.8 for ∗ φς (U (G )) as a right principal biset. Now, we need to check that ∇′ is bijective, that is, condition (P-2) is fulfilled. However, the inverse of this map is easily shown to be the following map       h     i ∇′−1 : G1 s × ς X et ×et G1 s × ς X −→ G1 s × ς X pr2 × t Gς 1 , f, x , f ′ , x′ 7−→ f, x , x′ , f −1 f ′ , x . (iii) ⇒ (i). If we assume that φς (U (G )) is a principal (G , G ς )-biset, then the map et above should be surjective. Therefore, the map ∗ G1 s × ς X pr1 / G1 t / G0 is also surjective, which is condition (WE-1) for the morphism φς . Condition (WE-2) for this morphism is trivial, since by definition we know that Gς 1 = X ς × t G1 s × ς X.  2.6. Correspondence between transitive groupoids and principal group-sets. A particular example of principal groupoids-bisets are, of course, principal group-sets. As we will see below transitive groupoids are characterized by these group-sets. Precisely, there is a (non canonical) correspondence between transitive groupoids and principal group-sets, as we will show in this subsection. Let π : P → G0 be a map and G a group which acts on the left side of P. Recall that the triple (P, G, π) is said to be a left principal G-set, if the following conditions are satisfied: (P’1) π is surjective; (P’2) π(gp) = π(p), for every p ∈ P and g ∈ G; (P’3) The canonical map G × P −→ P π × π P sending (g, p) 7→ (gp, p) is bijective. Equivalently, the action is free and G0 is the orbit set of P. Comparing with Definition 2.7, this means that the triple (P, ∗, π) with ∗ : P → {∗}, is a principal left (G, G0 )-biset, where the group G is considered as a groupoid with one object {∗} and G0 is considered as a groupoid whose underlying category is a discrete category (i.e., category with only identities arrows) with set of objects G0 , and acts trivially on P along π. In the previous situation, consider P × P as a left G-set by the diagonal action and denote by G1 := (P × P)/G its set of orbits. The pair (G1 , G0 ) admits as follows a structure of transitive groupoid. Indeed, let (p, p′ ) ∈ P × P and denote by [(p, p′ )] ∈ (P × P)/G its equivalence class. The source and target   are s [(p, p′ )] = π(p′ ) and t [(p, p′ )] = π(p). The identity arrow of an object x ∈ G0 is given, using conditions (P’1)-(P’2), by the class [(p, p)] where π(p) = x. Let p, q be two equivalence classes in G1 such that s(p) = t(q). Henceforth, if (p, p′ ) is a representative of p, then q can be represented by (p′ , p′′ ). The multiplication pq is then represented by (p, p′′ ). This is a well defined multiplication since the action is free. By conditions (P’1), (P’3), we have that (G1 , G0 ) is a transitive groupoid with a canonical morphism of groupoids / /P P×P o  G1 := (P × P)/G o  / P/G := G0 . / Conversely, given a transitive groupoid G , and fix an object x ∈ G0 . Set G := G x the isotropy group of x and let P := t−1 ({x}) be the set of all arrows with target this x, i.e., the left star set of x. Consider the left G-action G × P → P derived from the multiplication of G . Since G is transitive, the triple (P, G, π) satisfies then the above conditions (P’1)-(P’3), which means that it is a left principal G-set. 3. Hopf algebroids: comodules algebras, principal bundles, and weak equivalences This section contains the definitions of commutative Hopf algebroids and theirs bicomodules algebras. All definitions are given in the algebraic way. Nevertheless, we will use a slightly superficial language of presheaves, sufficiently enough to make clearer the connection with the contents of Section 2. Parallel to subsections 2.3 and 2.4, we present a brief contents on principal bibundles between Hopf algebroids and their connection with weak equivalences. Dualizable objects in the category of (right) comodules are treated in the last subsection, where we also proof some useful lemmata. 12 LAIACHI EL KAOUTIT 3.1. Preliminaries and basic notations. We work over a commutative base field k. Unadorned tensor product − ⊗ − stands for the tensor product of k-vector spaces − ⊗k −. By k-algebra, or algebra, we understand commutative k-algebras, unless otherwise specified. The category of (right) A-modules over an algebra A, is denoted by ModA . The k-vector space of all A-linear maps between two (right) A-modules M and N, is denoted by HomA (M, N). When N = A is the regular module, we denote M ∗ := HomA (M, A). Given two algebras R, S , we denote by S (R) := Algk (S , R) the set of all k-algebra maps from S to R. In what follows, a presheaf of sets (of groups, or of groupoids) stands for a functor from the category of algebras Algk to the category of sets (groups, or groupoids). Clearly, to any algebra A, there is an associated presheaf which sends C → A(C) = Algk (A, C), thus, the presheaf represented by A. For two algebra maps σ : A → T and γ : B → T we denote by σ T γ (respectively, σ T or T γ , if one of the algebra maps is the identity) the underlying (A, B)-bimodule of T (respectively, the underlying A-module of T ) whose left A-action is induced by σ while its right B-action is induced by γ, that is, a . t = σ(a)t, t . b = tγ(b), for every a ∈ A, b ∈ B, t ∈ T. Assume there is an algebra map x ∈ A(R). The extension functor (−)x : ModA → ModR is the functor which sends any A-module M to the extended R-module Mx = M ⊗A R. In order to distinguish between two extension functors, we use the notation Mx := M ⊗x R and My := M ⊗y S , whenever another algebra map y ∈ A(S ) is given. In the sequel we will use the terminology coring (or cogébroı̈de as in [9, 4]) for coalgebra with possibly different left-right structures on its underlying modules over the base ring. We refer to [6] for basic notions and properties of these objects. 3.2. The 2-category of Hopf algebroids. Recall from, e.g., [26] that a commutative Hopf algebroid, or a Hopf algebroid over a field k, is a pair (A, H) of two commutative k-algebras, together with algebra maps η : A ⊗ A → H, ε : H → A, ∆ : s Ht → s Ht ⊗ A s Ht , S : s Ht → t Hs and a structure (s Ht , ∆, ε) of an A-coring with S an A-coring map to the opposite coring. Here the source and the target are the algebra maps s : A → H and t : A → H defined by s(a) = η(a⊗ 1) and t(a) = η(1⊗ a), for every a ∈ A. The map S is called the antipode of H subject to the following equalities: S 2 = Id, t(ε(u)) = S (u(1) )u(2), s(ε(u)) = u(1) S (u(2) ), for every u ∈ H, (12) where we used Sweedler’s notation: ∆(u) = u(1) ⊗A u(2) and summation is understood. The algebras A and H are called, respectively, the base algebra and the total algebra of the Hopf algebroid (A, H). As commutative Hopf algebra leads to an affine group scheme, a Hopf algebroid leads to an affine groupoid scheme (i.e., a presheaf of groupoids). More precisely, given a Hopf algebroid (A, H) and an algebra C, reversing the structure of (A, H) we have, in a natural way, a groupoid structure / s∗ (13) H (C) : H(C) o εt∗∗ / A(C). This structure is explicitly given as follows: the source and the target of a given arrow g ∈ H(C) are, respectively, s∗ (g) = g ◦ s and t∗ (g) = g ◦ t, the inverse is g−1 = g ◦ S . Given another arrow f ∈ H(C) with t∗ ( f ) = s∗ (g), then the groupoid multiplication is defined by the following algebra map   g f : H −→ C, u 7−→ f (u(1) )g(u(2)) , summation always understood. The identity arrow of an object x ∈ A(C) is ε∗ (x) = x ◦ ε. The functor H is referred to as the associated presheaf of groupoids of the Hopf algebroid (A, H), and the groupoids of equation (13) are called the fibres of H . Depending on the handled situation, we will employ different notations for the fibres of H at an algebra C:   H (C) := H(C), A(C) := H1 (C), H0 (C) . The presheaf of groupoids H op is defined to be the presheaf whose fibre at C is the opposite groupoid H (C)op (i.e., the same groupoid with the source interchanged by the target). Examples of Hopf algebroids can be then proportioned using well known constructions in groupoids, as we have seen in subsection 2.1. ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 13 Example 3.1. Let A be an algebra and set H := A ⊗ A. Then the pair (A, H) is clearly a Hopf algebroid with structure s : A → H, a 7→ a ⊗ 1, t : A → H, a 7→ 1 ⊗ a; ∆(a ⊗ a′ ) = (a ⊗ 1) ⊗A (1 ⊗ a′ ), ε(a ⊗ a′ ) = aa′ , S (a ⊗ a′ ) = a′ ⊗ a. Clearly, the fibres of the associated presheaf of groupoids H are groupoids of pairs,  as in Example 2.2. Thus, H  A × A , A an isomorphism of presheaves of groupoids, where A is the presheaf of sets attached to the algebra A. Example 3.2. Let (B, ∆, ε, S) be a commutative Hopf k-algebra and A a commutative right B-comodule algebra with coaction A → A ⊗ B, a 7→ a(0) ⊗ a(1) . This means that A is right B-comodule and the coaction is an algebra map, see [23, §, 4]. Let B be the affine k-group attached to B. To any algebra C, one associated in a natural way, the following action groupoid as in Example 2.3: / (A × B)(C) : A(C) × B(C) o / A(C), where the source is given by the action (x, g) 7→ xg sending a 7→ (xg)(a) = x(a(0) )g(a(1)), and the target is the first projection. Consider, on the other hand, the algebra H = A ⊗ B with algebra extension η : A ⊗ A → H, a′ ⊗ a 7→ a′ a(0) ⊗ a(1) . Then (A, H) has a structure of Hopf algebroid, known as a split Hopf algebroid: ∆(a ⊗ b) = (a ⊗ b(1) ) ⊗A (1A ⊗ b(2) ), ε(a ⊗ b) = aε(b), S (a ⊗ b) = a(0) ⊗ a(1) S(b). Obviously, the associated presheaf of groupoids H op (where H is the one associated to (A, H)) is canon ically isomorphic to the action groupoids A × B. Thus, we have an isomorphism H op  A × B, A of presheaves of groupoids. Example 3.3. Let A be an algebra and consider the commutative polynomial Laurent ring over A ⊗ A, that is, H = (A ⊗ A)[X, X −1] with the canonical injection η : A ⊗ A → H. The pair (A, H) is a Hopf algebroid with structure maps      ∆ (a ⊗ a′ )X = (a ⊗A 1)X ⊗A (1 ⊗ a′ )X , ε (a ⊗ a′ )X = aa′ , S (a ⊗ a′ )X = (a′ ⊗ a)X −1. The fibres of the associated presheaf H are described using the induced groupoid by the multiplicative affine k-group, in the sense of Example 2.4. Precisely, take an algebra C, then H(C) is canonically bijective to the set A(C) × Gm (C) × A(C), where Gm is the multiplicative affine k-group. This in fact induces, in a  natural way, an isomorphisms of groupoids (H(C), A(C))  A(C) × Gm (C) × A(C), A(C) , where the later is the induced groupoid by the group Gm (C), as in Example 2.4. As presheaves of groupoids, we have then  an isomorphism H  A × Gm × A , A , where as above A is the presheaf attached to the algebra A. There is in fact a more general construction: Take any commutative Hopf k-algebra B, then for any algebra A, the pair (A, A ⊗ B ⊗ A) admits a canonical structure of Hopf algebroid whose associated presheaf  is also of the form A × B × A , A , where A and B are as before. Example 3.4 (Change of scalars). Let (A, H) be a Hopf algebroid over k and consider L a field extension of k. Then the pair of algebras (AL , HL ) := (A ⊗k L, H ⊗k L) admits, in a canonical way, a structure of Hopf algebroid over the field L. The structure maps are denoted using the subscript L, i.e., sL , tL , εL , ... If we denote by HL : AlgL → Grpds the presheaf of groupoids associated to (AL , HL ), then the usual homtensor adjunction shows that HL factors through the forgetful functor AlgL → Algk . That is we have a commutative diagram of functors: AlgL O / Alg k H / Grpds. 7 HL The notion of character group in commutative Hopf algebras context is naturally extended to that of character groupoids in commutative Hopf algebroids: Definition 3.5. Let (A, H) be a Hopf algebroid over a field k and H its associated presheaf of groupoids. The character groupoid of (A, H) is the fibre groupoid H (k) = (H(k), A(k)) at the base field k. Notice that the character groupoid might be empty (i.e., could be a category without objects). The following definition, which we will frequently used in the sequel, can be found in [9, page 129]. It is noteworthy to mention that in our case (i.e., the case of affine k-schemes), the base presheaf H0 of the presheaf H associated to a given Hopf algebroid (A, H) with A , 0, is always non empty. That is, the condition H0 , ∅ in op.cit., is satisfied since H0 is represented by A and there is always a field extension L of k such that A(L) , ∅ as A , 0 (i.e., it have maximal ideals). 14 LAIACHI EL KAOUTIT Definition 3.6. Let (A, H) be a Hopf algebroid and H its associated presheaf of groupoids. Given an algebra C, consider the fibre groupoid H (C). Two objects x, y ∈ A(C) are said to be locally isomorphic, in the sense of the fpqc topology (or fpqc locally isomorphic), if there exists a faithfully flat extension p : C → C ′ and an arrow g ∈ H(C ′ ) such that p ◦ x = g ◦ s, and p ◦ y = g ◦ t. We say that any two objects of H are fpqc locally isomorphic (without specifying the algebra C), if for any algebra C and any two objects x, y ∈ A(C), x and y are fpqc locally isomorphic. Remark 3.7. In case we have H (C) = ∅, for some algebra C, the condition of Definition 3.6 is conventionally assumed to be verified for this C. On the other hand, it is not difficult to check that if there exists a field extension L of k such that two objects of HL are fpqc locally isomorphic, then any two objects of H are also fpqc locally isomorphic. The converse is not immediate and follows from Theorem 4.8 below. More precisely, if H0 (k) , ∅ and any two objects of H are fpqc locally isomorphic, then any two objects of HL are also fpqc locally isomorphic for any field extension L of k. If the presheaf H is fibrewise transitive, that is, each of its fibres H (C) is a transitive groupoid, then obviously any two objects of H are fpqc locally isomorphic. For instance, this is the case for the Hopf algebroid (A, A ⊗ A), since in this case each of the groupoid’s H (C) is the groupoid of pairs, see Example 3.1. The same holds true for the class of Hopf algebroids described in Example 3.3. A morphism φ : (A, H) → (B, K) of Hopf algebroids consists of a pair φ = (φ0 , φ1 ) of algebra maps φ0 : A → B and φ1 : H → K that are compatible, in a canonical way, with the structure maps of both H and K. That is, the equalities φ1 ◦ s = s ◦ φ0 , ∆ ◦ φ1 = χ ◦ (φ1 ⊗A φ1 ) ◦ ∆, φ1 ◦ t = t ◦ φ0 , ε ◦ φ1 = φ0 ◦ ε, S ◦ φ1 = φ1 ◦ S , (14) (15) (16) hold, where χ is the obvious map χ : K ⊗A K → K ⊗B K, and where no distinction between the structure maps of H, K was made. Clearly, any morphism φ : (A, H) → (B, K) of Hopf algebroids induces (in the opposite way) a morphism between the associated presheaves of groupoids, which is given over each fibre by (φ0 ∗ , φ1 ∗ ) : K (C) = (K(C), B(C)) −→ H (C) = (H(C), A(C)), sending (g, x) 7→ (g ◦ φ1 , x ◦ φ0 ). In this way, the construction in the following example corresponds to the construction of the induced groupoid as expounded in Example 2.4. Example 3.8 (Base change). Given a Hopf algebroid (A, H) and an algebra map φ : A → B, then the pair of algebras (B, Hφ) := (B, B ⊗A H ⊗A B) is a Hopf algebroid known as the base change Hopf algebroid of (A, H), and (φ, φ1 ) : (A, H) → (B, Hφ) is a morphism of Hopf algebroids, where φ1 : H → Hφ sends u 7→ 1B ⊗A u ⊗A 1B . Moreover, as in the case of groupoids, see subsection 2.1, any morphism φ : (A, H) → (B, K) factors through the base change morphism (A, H) → (B, Hφ0 ), by using the map Hφ0 → K sending b ⊗A u ⊗A b′ 7→ bb′ φ1 (u). The associated presheaf of groupoids Hφ of the Hopf algebroid (B, Hφ) is fiberwise computed as the induced groupoid (see Example 2.4) of H along the map φ : B → A where B and A are the presheveas of sets associated to B and A, respectively. The aforementioned relation with the induced groupoids comes out as follows. Take an algebra C and consider the associated groupoid H (C). Then the map φ∗ : B(C) → A(C) leads, as in Example 2.4, to the ∗ induced groupoid H (C)φ(C) . This in fact determines a presheaf of groupoids C → H (C)φ which can be easily shown to be represented by the pair of algebras (B, Hφ). We finish this subsection by recalling the construction of the 2-category of flat Hopf algebroids. A Hopf algebroid (A, H) is said to be flat, when s H (or Ht ) is a flat A-module. Notice, that in this case s as well as t are faithfully flat extensions. As was mentioned before, groupoids, functors, and natural transformations form a 2-category. Analogously (flat) Hopf algebroids over the ground field k form a ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 15 2-category, as was observed in [24, §3.1]. Precisely, 0-cells are Hopf algebroids, or even flat ones, 1cells are morphisms of Hopf algebroids, and for two 1-cells (φ0 , φ1 ), (ψ0 , ψ1 ) : (A, H) → (B, K), a 2-cell c : (φ0 , φ1 ) → (ψ0 , ψ1 ) is defined to be an algebra map c : H → B that makes the diagrams HO s A c /B ④= ④ ④ ④④ ④④ φ0 HO t A c /B ④= ④ ④ ④④ ④④ ψ0 ∆ H ∆ / H ⊗A H  mK ◦ φ1 ⊗A (t◦c)  H ⊗A H mK ◦ (s◦c) ⊗A ψ1   /K (17) commutative, where mK denotes the multiplication of K. The identity 2-cell for (φ0 , φ1 ) is given by 1φ := φ0 ◦ ε. The tensor product (or vertical composition) of 2-cells is given as c′ ◦ c : (φ0 , φ1 ) c / (ψ0 , ψ1 ) c′ / (ξ0 , ξ1 ), where c′ ◦ c : H → B, u 7→ c(u(1) )c′ (u(2) ). (18) 3.3. Comodules, bicomodules (algebras), and presheaves of orbit sets. A right H-comodule is a pair (M, ̺) consisting of right A-module M and right A-linear map (referred to as the coaction) ̺ : M → M ⊗A s H, m 7→ m(0) ⊗ A m(1) (summation understood) satisfying the usual counitary and coassociativity properties. Morphisms between right H-comodules (or right H-colinear map) are A-linear maps compatible with both coactions. The category of all right H-comodules is denoted by ComodH . This is a symmetric monoidal k-linear category with identity object A endowed with the coaction t : A → Ht  A ⊗A s Ht . The tensor product in ComodH is defined via the so called the diagonal coaction. Precisely, given (M, ̺) and (N, ̺) two (right) H-comodules. Then the tensor product M ⊗A N is endowed with the following (right) H-coaction:   (19) ̺M⊗A N : M ⊗A N −→ (M ⊗A N) ⊗A H, m ⊗A n 7−→ (m(0) ⊗A n(0) ) ⊗A m(1) n(1) . The vector space of all H-colinear maps between two comodules (M, ̺) and (N, ̺) will be denoted by HomH (M, N), and the endomorphism ring by EndH (M). Inductive limit and cokernels do exist in ComodH , and can be computed in A-modules. Furthermore, it is well known that the underlying module s H is flat if and only if ComodH is a Grothendieck category and the forgetful functor UH : ComodH → ModA is exact. As it can be easily checked, the forgetful functor UH has a right adjoint functor − ⊗A s H : ModA → ComodH . The full subcategory of right H-comodules whose underlying A-modules are finitely generated is denoted by comodH . The category of left H-comodules is analogously defined, and it is isomorphic via the antipode to the category of right H-comodules. A (right) H-comodule algebra can be defined as a commutative monoid in the symmetric monoidal category ComodH . This is a commutative algebra extension σ : A → R where the associated A-module Rσ is also a (right) H-comodule whose coaction ̺R : Rσ → Rσ ⊗A s H is an algebra map, which means that ̺R (1R ) = 1R ⊗A 1H , ′ ′ ̺R (rr′ ) = r(0) r(0) ⊗A r(1) r(1) , for every r, r′ ∈ R. This of course induces a (right) H -action on the presheaf of sets R associated to R. Precisely, given an algebra C, consider the map σ∗ : R(C) → A(C) sending x 7→ x ◦ σ, and set R(C) σ∗ × s∗ H1 (C) → R(C), (x, g) 7→ xg, where xg : R → C, r 7→ x(r(0) ) g(r(1) ). (20) Then this defines, in a natural way, a right action of the groupoid H (C) on the set R(C), in the sense of Definition 2.6. Equivalently such an action can be expressed as a pair morphism of presheaves R → H0 and R σ∗ × s∗ H1 → R satisfying pertinent compatibilities. In this way, an action of a presheaf of groupoids on a presheaf of sets, can be seen as a natural generalization to the groupoids framework of the notion of an action of group scheme on a scheme [10, no 3, page 160], or more formally, as a generalization of the notion of ”objet à groupe d’opérateurs à droite” [15, Chapitre III, §1.1]. For a right H-comodule algebra (R, σ), we have the subalgebra of coinvariants defined by o n (21) RcoinvH := r ∈ R| ̺R (r) = r ⊗A 1H . 16 LAIACHI EL KAOUTIT Denote by R H the presheaf of sets represented by the algebra RcoinvH . On the other hand, we have the presheaf defining the orbit sets, which is given as follows: Take an algebra C and consider the action (20), we then obtain the orbits set R(C)/H (C). Clearly this establishes a functor: C −→ R(C)/H (C) yielding a presheaf OH (R) with a canonical morphism of presheaves OH (R) −→ R H . Remark 3.9. An important example of the previous construction is the case of the right H-comodule algebra (A, t). In this case we have a commutative diagram of presheaves: A ❘❘❘ ❘❘❘ ) ζ τ OH (A ) / AH ❦❦5 ❦❦❦❦ where as before A is the presheaf represented by the algebra A and A H is represented by AcoinvH . Notice that the presheaf OH (A ) is not necessarily represented by AcoinvH , thus, the right hand map in the previous diagram is not in general an isomorphism of presheaves, see [25, page 54]. In this direction, both A τ × τ A and A ζ × ζ A enjoy a structure of presheaves of groupoids with fibres are groupoids of pairs described in Examples 2.2. Nevertheless, A ζ × ζ A is not necessarily representable. Furthermore, there is a commutative diagram / A τ× τ A H ❘❘❘ ❘❘❘ ✐✐4 ) ✐✐✐✐ A ζ× ζ A of presheaves of groupoids. Given two Hopf algebroids (A, H) and (B, K), the category of (H, K)-bicomodules is defined as follows. An object in this category is a triple (M, λ, ̺) consisting of left H-comodule (M, λ) and right Kcomodule (M, ̺) such that λ is a morphism of right K-comodules, or equivalently ̺ is a morphism of left H-comodules. Morphisms between bicomodules are simultaneously left and right comodules morphisms. On the other hand, the pair of tensor product (A⊗ B, H o ⊗ K) admits, in a canonical way, a structure of Hopf algebroid, where (A, H o ) is the opposite Hopf algebroid (i.e., the source and the target are interchanged, or equivalently, the fibres of the associated presheaf are the opposite groupoids H (C)op ). This is the tensor product Hopf algebroid, and its category of right comodules is canonically identified with the category of (H, K)-bicomodules. Thus bicomodules form also a symmetric monoidal k-linear category. A bicomodule algebra is a bicomodule which is simultaneously a left comodule algebra and right comodule algebra. As above, by using the actions of equation (20) a bicomodule algebra leads to a presheaf of groupoid bisets. That is, a presheaf with fibres groupoid-bisets, in the sense of Definition 2.7. 3.4. Weak equivalences and principal bundles between Hopf algebroids. Any morphism φ : (A, H) → (B, K) of Hopf algebroids induces a symmetric monoidal k-linear functor φ∗ := UH (−) ⊗A B : ComodH −→ ComodK , where, for any H-comodule (M, ̺), the K-comodule structure of M ⊗A B is given by M ⊗A B −→ (M ⊗A B) ⊗B K, m ⊗A b 7−→ (m(0) ⊗A 1B ) ⊗B φ1 (m(1) )t(b). Following [17, Definition 6.1], φ is said to be a weak equivalence whenever φ∗ is an equivalence of categories. In this case, ComodH and ComodK are equivalent as symmetric monoidal k-linear categories. Notice that if φ is a weak equivalence, then so is the associated morphism between the tensor product Hopf algebroids φo ⊗ φ : (A ⊗ A, H o ⊗ H) → (B ⊗ B, K o ⊗ K), which induces then a symmetric monoidal equivalence between the categories of H-bicomodules and K-bicomodules. Two Hopf algebroids (A, H) and (B, K) are said to be weakly equivalent if there exists a diagram (A, H) (C, J) i❙ ❙❙❙❙ ❦❦5 ❦ ❦ ❙ ❦ ❦ (B, K), of weak equivalences. As was shown in [11] weak equivalences between flat Hopf algebroids are strongly related to principal bi-bundles. Such a relation is in part a consequence of the analogue one for groupoids as was shown in Proposition 2.13 (see Remark 2.14). ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 17 Recall that, for two flat Hopf algebroids (A, H) and (B, K), a left principal (H, K)-bundle is a threetuple (P, α, β) which consists of diagram of commutative algebras α : A → P ← B : β where the (A, B)bimodule α Pβ enjoys a structure of an (H, K)-bicomodule algebra such that (PB1) β : B → P is a faithfully flat extension (the local triviality of the bundle in the fpqc topology); (PB2) the canonical map canP, H : P ⊗B P → H ⊗A P sending p ⊗B p′ 7→ p(0) ⊗A p(1) p′ is bijective. Observe that these two conditions, in conjunction with the faithfully flat descent theorem [13, Theorem 5.9], show that PcoinvH = B, see (21) for the notation. The notion of principal bundles is a natural generalization of the notion of Torsor, where the group object is replaced by groupoid object, see [15, Définition 1.4.1, page 117] and [10, Chapter III, §4]. In case of Hopf algebras over commutative rings, these objects are termed Hopf Galois extensions, see [23, 28]. Right principal bundles and bi-bundles are clearly understood. For instance to each left principal bundle (P, α, β), one can define a right principal bundle on the opposite bicomodule Pco . As in the case of groupoids, see subsection 2.3, a simpler example of left principal bundle is the unit bundle U (H) which is H with its canonical structure of H-bicomodule algebra. A trivial bundle attached to a given morphism of Hopf algebroids φ : (A, H) → (B, K), is the one whose underlying bicomodule algebra is of the form P := H ⊗A B, that is, the pull-back bundle φ∗ (U (H)) of the unit bundle U (H). Parallel to subsection 2.3, for any bicomodule algebra, and thus for any left principal bundle, one can associate the so called the two-sided translation Hopf algebroid, which is denoted by (P, H X P Y K). The underlying pair of algebras is (P, Hs ⊗ α Pβ ⊗ s K) and its structure of Hopf algebroid is given as follows: • the source and target are given by s(p) := 1H ⊗A p ⊗B 1K , t(p) := S (p(−1) ) ⊗A p(0) ⊗B p(1) ; • the comultiplication and counit are given by:     ∆(u ⊗A p ⊗B w) := u(1) ⊗A p ⊗B w(1) ⊗P u(2) ⊗A 1P ⊗B w(2) , ε(u ⊗A p ⊗B w) := α ε(u) pβ ε(w) ; • whereas the antipode is defined as:  S u ⊗A p ⊗B w := S (up(−1) ) ⊗A p(0) ⊗B p(1) S (w). Furthermore, there is a diagram (P, H X P Y K) j❯❯❯β=(β, ❯❯❯❯β1 ) ❯ (22) α=(α, α1✐)✐✐4 (A, H) ✐ ✐✐✐✐ (B, K) of Hopf algebroids, where α1 and β1 are, respectively, the maps u 7→ u ⊗A 1P ⊗B 1K and w 7→ 1H ⊗A 1P ⊗B w. It is easily checked that (P, H X P Y K) is a flat Hopf algebroid whenever (A, H) and (B, K) they are so. Remark 3.10. It is noteworthy to mention that the fibres of the presheaf associated to a left principal bundle are not necessarily principal bisets over the fibres groupoids, in the sense of Definition 2.8 (but possibly the entry presheaf is locally so in the fpqc topology sense). To be precise, let P denote as before the presheaf of sets associated to the algebra P. This is a presheaf of (H , K )-bisets, that is, using left and right actions of equation (20), for any algebra C, we have that the fibre P(C) is actually an (H (C), K (C))-biset as in Definition 2.7. However, P(C) is not necessarily a left principal biset. Nevertheless, it is easily seen that the associated presheaf of two-sided translation groupoids is represented by the two-sided translation Hopf algebroid (P, H X P Y K). Lastly, as in [11], two weakly equivalent flat Hopf algebroids are shown to be connected by a principal bibundle, for which the diagram (22) becomes a diagram of weak equivalences, see op. cit. for more characterizations of weak equivalences. 3.5. Dualizable right comodules. Recall that a (right) H-comodule (M, ̺M ) is said to be dualizable, if there is another (right) H-comodule (N, ̺N ) and two morphisms of comodules ev : (N ⊗A M, ̺N⊗A M ) → (A, t), and db : (A, t) → (M ⊗A N, ̺M⊗A N ) (23) satisfying, up to natural isomorphisms, the usual triangle properties. Taking the underlying A-linear maps (ev, db) and using these triangle properties, one shows that UH (N)  M ∗ = HomA (M, A). Thus, the underlying A-module of any dualizable comodule is finitely generated and projective. Moreover, the dual 18 LAIACHI EL KAOUTIT of (M, ̺M ) in the category ComodH is, up to an isomorphism, the comodule (M ∗ , ̺M∗ ) with the following coaction:   ϕ 7−→ e∗i ⊗A t(ϕ(ei, (0)))S (ei, (1) ) , (24) ̺M∗ : M ∗ → M ∗ ⊗A H, P where {ei , e∗i } is a dual basis for MA , that is, db(1A ) = i ei ⊗A e∗i . The converse holds true as well, that is, dualizable objects in ComodH are, up to natural isomorphisms, precisely the objects of the subcategory comodH which are projective as A-modules. This is a well known fact which will be implicitly used below: Lemma 3.11. Let (M, ̺M ) be a right H-comodule whose underlying A-module M is finitely generated and projective, and consider (M ∗ , ̺M∗ ) as right H-comodule with the coaction given by (24). Then (M, ̺M ) is a dualizable object in ComodH with dual object (M ∗ , ̺M∗ ). In particular, the full subcategory of dualizable right H-comodules consists of those comodules with finitely generated and projective underlying A-modules. The following lemma will be used in the sequel and the k-algebras involved in it are not necessary commutative. Lemma 3.12. Let (A, H) and (A′ , H′ ) be two corings. Assume that there are two bimodules B MA and B′ MA′ ′ such that (M, ̺M ) and (M,′ ̺M′ ) are, respectively, (B, H)-bicomodule and (B′, H′ )-bicomodule (here B and B′ are considered as B-coring and B′ -coring in a trivial way), and that MA , MA′ ′ are finitely generated and projective modules with dual bases, respectively, {mi , m∗i } and {n j , n∗j }. (1) If the associated canonical map:   (25) canM : M ∗ ⊗B M → H, m∗ ⊗A m 7−→ m∗ (m(0) )m(1) ∗ is injective, then EndM ⊗B M (M) = EndH (M), where M ∗ ⊗B M is the standard A-coring [4], or the comatrix A-coring [12]. (2) If both canM and canM′ are injective, B M and B′ M ′ are faithfully flat modules, then ′ ′ EndH⊗H (M ⊗ M ′ )  B ⊗ B′  EndH (M) ⊗ EndH (M ′ ). Proof. (1) is a routine computation. Part (2) uses part (1) and the result [12, Theorem 3.10].  3.6. Dualizable comodule whose endomorphism ring is a principal bundle. This subsection is of independent interest. We give conditions under which the endomorphism ring (of linear maps) of a dualizable right comodule is a left principal bundle. Let (A, H) be a flat Hopf algebroid and (M, ̺) a dualizable right H-comodule. Denote by B := EndH (M) its endomorphism ring of H-colinear maps, and consider the endomorphism ring of A-linear maps EndA (M) as right H-comodule via the isomorphism M ∗ ⊗A M  EndA (M) together with the following obvious algebra maps α : A −→ EndA (M) and β : B ֒→ EndA (M). The proof of the following is left to the reader. Proposition 3.13. Assume that A M, B M are faithfully flat modules and that the canonical map can M of equation (25) is bijective (e.g., when (M, ̺) is a small generator in the category of right H-comodules). Then the triple (EndA (M), α, β) is a right principal (B, H)-bundle (where (B, B) is considered as a trivial Hopf algebroid). 4. Geometrically transitive Hopf algebroid: Definition, basic properties and the result In this section we recall the definition of geometrically transitive Hopf algebroids and prove some of their basic properties. Most of the results presented here are in fact consequences of those stated in [4]. For sake of completeness, we give below slightly different elementary proofs of some of these results. 4.1. Definition and basic properties. We start by proving the following result which will help us to well understand the forthcoming definition. Proposition 4.1 ([4, Proposition 6.2, page 5845]). Let (A, H) be a flat Hopf algebroid. Assume that (A, H) satisfies the following condition (GT1) H is projective as an (A ⊗ A)-module. Then, we have (GT11) Every H-comodule is projective as an A-module; ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 19 (GT12) comodH is an abelian category and the functor UH : comodH → ModA is faithful and exact; (GT13) Every object in ComodH is a filtrated limit of subobjects in comodH . Proof. (GT 11). Let M be a right H-comodule. Then, as a right A-module M is a direct summand of M ⊗A H. Since A HA is a direct summand of a free (A ⊗ A)-module, M is a direct summand of the right A-module M ⊗A (A ⊗ A)  M ⊗ A. Thus MA is projective. The same proof works for left H-comodules. (GT 12). The category comodH is additive with finite product and cokernels. Let us check that comodH do have kernels. So, assume a morphism f : N → M in comodH is given. Then the kernel Ker( f ) is a right H-comodule, since we already know that ComodH is a Grothendieck category. Thus we need to check that the underlying module of this kernel is a finitely generated A-module. However, this follows from the fact that f k : Ker( f ) → N splits in A-modules, as we know, by the isomorphism of right H-comodules N/Ker( f )  Im( f ) and condition (GT 11), that this quotient is projective as an A-modules. The last claim in (GT 12) is now clear. (GT 13). Following [6, §20.1, §20.2], since s H is by condition (GT 11) a projective module, we have that the category of rational left ∗ H-modules is isomorphic to the category of right H-comodules, where ∗ H = HomA (s H, A) is the left convolution A-algebra of H. Since any submodule of a rational module is also rational, every rational module is then a filtrated limit of finitely generated submodules. Therefore, any right H-comodule is a filtrated limit of subcomodules in comodH , as any finitely generated rational module is finitely generated as an A-module.  Recall that a (locally small) k-linear category C is said to be locally of finite type, if any object in C is of finite length and each of the k-vector spaces of morphisms C(c, c′ ) is finite dimensional. Definition 4.2. [Bruguières] Let (A, H) be a flat Hopf algebroid. We say that (A, H) is a geometrically transitive Hopf algebroid (GT for short) if it satisfies the following conditions: (GT1) H is projective as an (A ⊗ A)-module. (GT2) The category comodH is locally of finite type. (GT3) EndH (A)  k. Here EndH (A) denotes the endomorphisms ring of the right H-comodule (A, t) which is identified with the coinvariant subring AcoinvH = {a ∈ A| t(a) = s(a)}. We are implicitly assuming that A , 0 as a comodule. The subsequent lemma gives others consequences of the properties stated in Definition 4.2, which will be used later on. Lemma 4.3. Let (A, H) be a flat Hopf algebroid. (a) If (A, H) satisfies (GT 11) and (GT 3), then A is a simple (right) H-comodule. (b) If (A, H) satisfies (GT 1) and (GT 3), then every (right) H-comodule is faithfully flat as an A-module. Proof. (a). First let us check that, under the assumption (G11), any subcomodule of (A, t) is a direct summand in ComodH . So let (I, ̺I ) be an H-subcomodule of (A, t). Then A/I is an H-comodule which is finitely generated and projective as an A-module, by assumption (GT 11). Therefore, I is a direct summand of A as an A-submodule. Denotes by π : A → I the canonical projection of A-modules, and let e2 = e be an idempotent element in A such that I = eA and π(a) = ea, for every a ∈ A. Next we show that π is a morphism of right H-comodules, which proves that (I, ̺I ) is a direct summand of (A, t). To this end, it suffices to check that s(e) = t(e), since we know that EndH (A) = AcoinvH = {a ∈ A| t(a) = s(a)}. Clearly the coaction of I is entirely defined by the image of e, and we can write ̺I (e) = e ⊗A u, for some element u ∈ H, which satisfies the following equalities s(e) u = t(e)1H , e ⊗A u ⊗A u = e ⊗A u(1) ⊗A u(2) ∈ I ⊗A H ⊗A H, (26) where the first equation comes from the fact that the inclusion I ֒→ A is a morphism of H-comodules. On the other hand, we know by Lemma 3.11 that I is a dualizable right H-comodule. Up to canonical isomorphism, its dual comodule have for the underlying A-module, the module I ∗ = eA with coaction ̺I∗ : eA → eA ⊗A H, sending ea 7→ e ⊗A t(ea)S (u) given by equation (24). The evaluation map ev : I ∗ ⊗A I → A, ea ⊗A ea′ 7→ eaa′ of equation (23), is then a morphism of right H-comodules. Therefore, we have the following equality 1 ⊗A t(e) = e ⊗A t(e)S (u)u ∈ A ⊗A s H  s H. (27) 20 LAIACHI EL KAOUTIT Combining the first equality of equation (26) and equation (27), we get t(e)S (u) = t(e). Hence s(e)u = s(e), and so s(e) = t(e), by the first equality in (26). We have then show that any H-subcomodule of the H-comodule A is a direct summand, since by (GT 3) the endomorphism ring is a field EndH (A)  k, we conclude that A is a simple H-comodule. (b). By Proposition 4.1, we know that (A, H) satisfies conditions (GT 11)-(GT 13). Let us first show that any comodule in comodH is faithfully flat as an A-module. By condition (GT 11), we know that any comodule in this subcategory is finitely generated and projective as A-module, so it is flat as an A-module. Moreover, we know from Lemma 3.11 that the subcategory comodH consists exactly of dualizable right H-comodules. Let us then pick a dualizable comodule M ∈ comodH , and assume that M ⊗A X = 0 for some A-module X. This in particular implies that evM ⊗A X = 0, from which we get that A ⊗A X  X = 0, as evM is surjective, since we already know by item (a) that A is a simple comodule. This shows that every object in comodH is faithfully flat as an A-module. For an arbitrary comodule, we know by condition (GT 13) stated in Proposition 4.1, that any right H-comodule is a filtrated limit of subcomodules in comodH . Therefore, any right H-comodule is a flat A-module. Given now a right H-comodule M and assume that M ⊗A X = 0, for some A-module X. We have that M = lim(Mi ) where {τi j : Mi ֒→ M j }i≤ j ∈ Λ is a filtrated system in comodH with structural morphisms −−→ τi j which are split morphisms of A-modules. This limit is also a filtrated limit of A-modules, and so the equality lim(Mi ⊗A X)  M ⊗A X = 0 implies that there exists some j ∈ Λ, such that M j ⊗A X = 0. Hence −−→ X = 0, since M j is a faithfully flat A-module by the previous argumentation.  Lemma 4.4. Let (A, H) be a flat Hopf algebroid which satisfies conditions (GT 11) and (GT 3). Then the k-algebra map η : A ⊗ A → H is injective. In particular, if (A, H) is geometrically transitive, then η is injective. Proof. We know from Lemma 4.3(a) that A is a simple H-comodule. Therefore, by [5, Theorem 3.1], the following map   HomH (A, H) ⊗ A −→ H, f ⊗k a 7−→ f (a) is a monomorphism, which is, up to the isomorphism HomH (A, H)  A derived from the adjunction between the forgetful functor UH and the functor − ⊗A s H, is exactly the map η. Hence η is injective. The particular case is immediately obtained form Definition 4.2 and Proposition 4.1.  Remark 4.5 (Transitive Hopf algebroids). Recall from [4, Définitions pages 5838, 5850] that a Hopf algebroid (A, H) with A , 0, is said to be transitive if it satisfies conditions (GT 12), (GT 13) and (GT 2), (GT 3) from Proposition 4.1 and Definition 4.2, respectively, and every comodule in comodH is projective. Thus the geometrically transitive property implies the transitive one. The converse holds true if the the center of the division ring of any simple comodule (left or right one) is a separable field extension of k, that is, if (A, H) is a separable Hopf algebroid over k, as introduced in [4, Définition page 5847]. Obviously, over a perfect field k both notions coincide. It is noteworthy to mention that if we consider the associated presheaf H of a transitive Hopf algebroid (A, H), it is not clear, at least to us, how to express the transitivity of (A, H) in terms of certain topology at the level of H . Lastly, let us mention that in general a Hopf algebroid (A, H) is a geometrically transitive if and only if (AL , HL ) is transitive, for any filed extension L of k (see [4, Proposition 7.3 page 5851]), perhaps this justifies the terminology “geometrically transitive”. We finish this section by characterizing dualizable objects over GT Hopf algebroids and by making some useful remarks on these algebroids. Proposition 4.6. Let (A, H) be a flat Hopf algebroid. Assume that (A, H) satisfies the following condition: (GT 11)′ Every finitely generated right H-comodule is projective. Then the full subcategory of ComodH of dualizable objects coincides with comodH . In particular, if (A, H) is geometrically transitive, then the category comodH consists of all dualizable right H-comodules. Proof. By Lemma 3.11, every dualizable right H-comodule is finitely generated and projective as an Amodule. This gives the direct inclusion. Conversely, any object in comodH is, by condition (GT 11)′ and Lemma 3.11, a dualizable right H-comodule, form which we obtain the other inclusion. The particular case of GT Hopf algebroids follows directly from Proposition 4.1.  ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 21 Remark 4.7. Let (A, H) be a GT Hopf algebroid. Then, by condition (GT13) of Proposition 4.1 and Proposition 4.6, the category of comodules ComodH has a set of small projective generators, which we denote by A. Therefore, by applying [13, Theorem 5.7], we obtain that the canonical map can : L (O) → H is an isomorphism of Hopf algebroids, where O : A → proj(A) is the forgetful functor to the category of finitely generated and projective A-modules, and where L (O) is the Hopf algebroid reconstructed from the pair (A, O), see [4] and also [13] for the explicit description of the underlying A-coring of L (O). 4.2. Characterization by means of weak equivalences. This subsection contains our main result. We give several new characterizations of geometrically transitive flat Hopf algebroids. The most striking one is the characterization of these Hopf algebroids by means of weak equivalences, which can be seen as the geometric counterpart of the characterization of transitive groupoids, as we have shown in subsection 2.5, precisely in Proposition 2.15. Theorem 4.8. Let (A, H) be a flat Hopf algebroid over a field k and denote by H its associated presheaf of groupoids. Assume that H0 (k) , ∅. Then the following are equivalent: (i) η : A ⊗ A → H is a faithfully flat extension; (ii) Any two objects of H are fpqc locally isomorphic (see Definition 3.6); (iii) For any extension φ : A → B, the extension α : A → Ht ⊗A φ B, a 7→ s(a) ⊗A 1B is faithfully flat; (iv) (A, H) is geometrically transitive (Definition 4.2). By [11, Proposition 5.1], condition (iii) in Theorem 4.8 is also equivalent to the following ones: (v) For any extension φ : A → B, the associated canonical morphism of φ : (A, H) → (B, Hφ) is a weak equivalence; (vi) The trivial principal left (H, Hφ)-bundle H ⊗A B is a principal bi-bundle. Given a GT Hopf algebroid (A, H) and an extension φ : A → B. Since Hφ is a flat Hopf algebroid, the forgetful functor ComodHφ → ModB is exact. Therefore, condition (v) implies that B is Landweber exact over A, in the sense that the functor UH (−) ⊗A B : ComodH → ModB is exact, see [17, Definition 2.1]. Example 4.9. The following Hopf algebroids (A, A ⊗ A) and (A, (A ⊗ A)[X, X −1]) described, respectively, in Examples 3.1 and 3.3, are clearly geometrically transitive. This is also the case of (A, A ⊗ B ⊗ A) for any Hopf algebra B. On the other hand, if A is a right B-comodule algebra whose canonical map A ⊗ A → A ⊗ B is a faithfully flat extension, then the split Hopf algebroid (A, A ⊗ B) is obviously geometrically transitive. A more elaborade example of GT Hopf algebroid, by using principal bundles over Hopf algebras (i.e., Hopf Galois extensions), is given in Proposition 5.11 below. Next, we give the proof of Theorem 4.8. The proof of (i) ⇒ (ii). Let C be an algebra and x, y two objects in A(C). Denote by x ⊗ y : A ⊗ A → C the associated algebra map and consider the obvious algebra map p : C → C ′ := H ⊗A⊗ A C. By assumption it is clear that p is a faithfully flat extension. Set the algebra map g : H → C ′ which sends u 7→ u ⊗A⊗ A 1C . We then have that p ◦ x = g ◦ s and p ◦ y = g ◦ t, which shows that x and y are locally isomorphic. The proof of (ii) ⇒ (iii). We claim that under hypothesis (ii) the underlying A-module of any (left or right) H-comodule is faithfully flat. In particular, this implies that the comodule H ⊗A B, with coaction ∆⊗A B, is faithfully flat for every A-algebra B, and this gives us condition (iii). Since there is an isomorphism of categories between right H-comodules and left H-comodules, which commutes with forgetful functors, it suffices then to show the above claim for right H-comodules. So let us fix a right H-comodule M and take two objects in different fibres groupoids x ∈ A(T ) and y ∈ A(S ), where T, S are algebras. We claim that M ⊗A x T is faithfully flat T -module if and only if M ⊗A y S is faithfully flat S -module. Clearly our first claim follows from this one since we know that A(k) , ∅ and over a field any module is faithfully flat. Let us then check this second claim; we first assume that R = T = S . In this case, we know that any pair of objects x, y ∈ A(R) are fpqc locally isomorphic, thus there exists a faithfully flat extension p : R → R′ and g ∈ H(R) such that e x := p ◦ x = g ◦ s and e y := p ◦ y = g ◦ t. On the other hand, the map   M ⊗A ex R′ −→ M ⊗A ey R′ , m ⊗A r′ 7−→ m(0) ⊗A g−1 (m(1) )r′ is clearly an isomorphism of R′ -modules. Therefore, M ⊗A ex R′ is a faithfully flat R′ -module if and only if M ⊗A ey R′ it is. However, we know that M ⊗A ex R′  (M ⊗A x R) ⊗R p R′ is faithfully flat R′ -module if and 22 LAIACHI EL KAOUTIT only if M ⊗A x R is faithfully flat R-module, as p is a faithfully flat extension. The same then holds true interchanging x by y. Therefore, M ⊗A x R is faithfully flat R-module if and only if M ⊗A y R so is. For the general case, that is, when T , S with x ∈ A(T ) and y ∈ A(S ), we take R := T ⊗ S and consider the canonical faithfully flat extensions T → R ← S . This leads to the following two objects x : A → T → R and y : A → S → R. Since M ⊗A x T (resp. M ⊗A y S ) is faithfully flat T -module (resp. S -module) if and only if M ⊗A x R (resp. M ⊗A y R) is faithfully flat R-module, we have, by the proof of the previous case, that M ⊗A x T is faithfully flat T -module if and only if M ⊗A y S is faithfully flat S -module, and this finishes the proof of this implication. The proof of (iii) ⇒ (iv). Take an object x in A(k) and denote by kx the base field endowed with its A-algebra structure via the algebra map x : A → k. By assumption A → H ⊗A kx is a faithfully flat extension. Therefore, by [11, Proposition 5.1], we know that the associated base change morphism x : (A, H) → (kx , Hx ), where (kx , Hx ) is the Hopf k-algebra Hx = kx ⊗A H ⊗A kx , is actually a weak equivalence. This means that the induced functor x∗ := UH (−) ⊗A kx : ComodH → ComodHx is a symmetric monoidal equivalence of categories, and thus transforms, up to natural isomorphisms, dualizable H-comodules into dualizable Hx -comodules. Similar property hods true for its inverse functor. In particular, taking an object M ∈ comodH , it is clear that x∗ (M) = M ⊗A kx is finite dimensional k-vector space and so a dualizable right Hx -comodue, see for instance Lemma 3.11. Therefore, M should be a dualizable right H-comodule. The converse is obvious and then the full subcategory comodH coincides with the full subcategory of dualizable right H-comodules, form which we have that comodH and comodHx are equivalent k-linear categories. Hence comodH is locally of finite type, and the endomorphism ring EndH (A)  k. This shows simultaneously conditions (GT 2) and (GT 3). To check condition (GT 1) we use the morphism between the tensor product Hopf algebroids, that is, xo ⊗ x : (A ⊗ A, H o ⊗ H) → (k x ⊗ k x  k, Hx ⊗ Hx ). As we have seen in subsection 3.4, this is also a weak equivalence. Thus the category of right (H o ⊗ H)-comodules is equivalent, as a symmetric monoidal category, to the category of right comodules over the Hopf k-algebra Hx ⊗ Hx , which as in the case of x also implies that comodH o ⊗H and comodHx ⊗Hx are equivalent. Therefore, from one hand, we have by the same reasoning as above that any comodule in comodH o ⊗H is projective as an (A ⊗ A)-module since it is a dualizable comodule. On the other hand, we have that every right (H o ⊗ H)-comodule is a filtrated inductive limit of objects in comodH o ⊗H since right (Hx ⊗ Hx )-comodules satisfies the same property with respect to finite-dimensional right comodules comodHx ⊗Hx . Now, by apply [4, Proposition 5.1(ii)] to the (A ⊗ A)-coring H o ⊗ H, we then conclude that every right (H o ⊗ H)-comodule is projective as an (A ⊗ A)-module. Thus, H is projective as an (A ⊗ A)-module, which shows condition (GT 1). The proof of (iv) ⇒ (i). Set B := A ⊗ A and K := H o ⊗ H. We know that (B, K) is a flat Hopf algebroid. Since H is projective as (A ⊗ A)-module, we have that K is projective as (B ⊗ B)-module. Now, since the map η is injective by Lemma 4.4, we can apply Lemma 3.12 by taking M = A as right H-comodule and M ′ = A as right H o -comodule, to obtain the following chain of isomorphism EndK (B) = EndH o ⊗H o (A ⊗ A)  EndH (A) ⊗ EndH (A)  k ⊗ k  k. This means that the Hopf algebroid (B, K) satisfies the conditions of Lemma 4.3(b). Therefore, any right K-comodule is faithfully flat as a B-module, henceforth, H is a faithfully flat (A⊗ A)-module. This finishes the proof of Theorem 4.8. Remark 4.10. Let (A, H) be a flat Hopf algebroid over k with A , 0 and A(k) = ∅. Then the same proof of the implication (ii) ⇒ (iii) in Theorem 4.8, works for (A, H) by using any field extension L of k such that A(L) , ∅. Assume now that (A, H) satisfies condition (i) of Theorem 4.8 and take a field extension L such that A(L) , ∅. Then (AL , HL ) also satisfies this condition and by Theorem 4.8 we have that (AL , HL ) is a GT Hopf algebroid, as we know that AL (L) = AlgL (AL , L) , ∅. Furthermore, if L is a perfect field, then by applying [4, Théorème 6.1, page 5845] we can show that (A, H) is a GT Hopf algebroid as well. Summing up, given a Hopf algebroid (A, H) as above, if its satisfies condition (i) of Theorem 4.8 and k admits a perfect extension L such that A(L) , ∅, then (A, H) satisfies all the other conditions of this Theorem. 5. More properties of geometrically transitive Hopf algebroids In this section we give more properties of GT Hopf algebroids. First we set up an analogous property of transitive groupoids with respect to the conjugacy of their isotropy groups. To this end we introduce here ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 23 perhaps a known notion of isotropy Hopf algebra. This is the affine group scheme which represents the presheaf of groups defined by the isotropy group at each fibre. Next we show that any two isotropy Hopf algebras are weakly equivalent. The notion of conjugacy between two isotropy Hopf algebras, is not at all obvious, and the 2-category of flat Hopf algebroids is employed in order to make it clearer. In this direction we show that two isotropy Hopf algebras are conjugated if and only if the character groupoid is transitive, and both conditions are fulfilled is the case of GT Hopf algebroids. Lastly, we give an elementary proof of the fact that any dualizable comodule is locally free of constant rank, which in some sense bear out the same property enjoyed by finite dimensional k-representations of a given transitive groupoid. The case when the character groupoid of a GT Hopf algebroid is an empty groupoid, is also analyzed. 5.1. The isotropy Hopf algebras are weakly equivalent. Let (A, H) be a flat Hopf algebroid and H its associated presheaf of groupoids. Assume as before that the base algebra satisfies A , 0 and A(k) , ∅, and consider H (k) the character groupoid of (A, H), see Definition 3.5. As before, for each object x ∈ A(k), we denote by kx the A-algebra k via the extension x, and consider the associated Hopf k-algebra of a base ring extension (given by the k-algebra map x : A → kx ), that is, Hx := kx ⊗A H ⊗A kx . Definition 5.1. Given an object x ∈ A(k). The Hopf algebra (kx , Hx ) is called the isotropy Hopf algebra of (A, H) at the point x. It noteworthy to mention that the associated affine k-group of (kx , Hx ) coincides with the one called groupe d’inertie de x relativement à H as referred to in [10, III, §2, no 2; page 303]. The terminology used in Definition 5.1 is, in relation with groupoids, justified by the following lemma. Fix an object x ∈ A(k), we denoted by 1x the unit element of the A-algebra kx . Take C to be an algebra with unit map 1C : k → C. Composing with x, we have then an object x∗ (1C ) = 1C ◦ x ∈ A(C). Let us denote by ∗ G x (C) := H (C)x (1C ) the isotropy group of the object x∗ (1C ) in the groupoid H (C), see equation (1). This construction is clearly funtorial and so leads to a presheaf of groups G x : Algk → Grps, C → G x (C). Lemma 5.2. For any x ∈ A(k), the presheaf of groups G x is affine, and up to a natural isomorphism, is represented by the Hopf k-algebra Hx . Proof. Given an element g in the group G x (C), that is, an algebra map g : H → C such that g ◦ t = g ◦ s = x∗ (1C), we can define the following algebra map:  κC (g) : Hx −→ C, k1x ⊗A u ⊗A k′ 1x 7−→ kk′ g(u) , which is clearly functorial in C. This leads to a natural transformation κ− : G x (−) −→ Algk (Hx , −). Conversely, to any algebra map h : Hx → C, one associate the algebra map νC (h) := h ◦ τx : H −→ Hx −→ C, where τx : H → Hx sends u 7→ 1 x ⊗A u ⊗A 1x . This construction is also functorial in C, which defines a natural transformation ν− : Algk (Hx , −) −→ G x (−). It is not difficult now to check that both natural transformations κ and ν, are mutually inverse.  Recall that for groupoids the transitivity property is interpreted by means of conjugation between theirs isotropy groups, which means that any two of these groups are isomorphic. Next we show how this last property is reflected at the level of the isotropy Hopf algebras. The conjugacy of the isotropy Hopf algebras, in relation with the transitivity of the character groupoid, will be considered in the next subsection. Proposition 5.3. Let (A, H) be a flat Hopf algebroid with A , 0 and A(k) , ∅. Assume that (A, H) is geometrically transitive. Then any two isotropy Hopf algebras are weakly equivalent. Proof. Take two objects x, y ∈ A(k) and consider as before the following diagram (kx , Hx ) i❙ ❙❙❙❙ ❙ x (A, H) (ky , Hy ) ❦❦5 ❦ ❦ ❦ ❦ y (28) of Hopf algebroids. By Theorem 4.8, both x and y are weak equivalences, in particular, the Hopf algebras (kx , Hx ) and (ky , Hy ) are Morita equivalent, in the sense that their categories of comodules are equivalent as symmetric monoidal k-linear categories. Therefore, (kx , Hx ) and (ky , Hy ) are weakly equivalent by applying [11, Theorem A].  24 LAIACHI EL KAOUTIT Remark 5.4. In the terminology of [28, Definition 3.2.3], the Hopf algebras (kx , Hx ) and (ky , Hy ) are said to be monoidally Morita-Takeuchi equivalent. By applying [28, Corollary 3.2.3], there is a Hopf bi-Galois object, or a principal bi-bundle as in subsection 3.4, connecting Hx and Hy (notice here that the side on comodules is not relevant since the Hopf algebras are commutative). Next, we compute explicitly, by using results from [11], the principal bi-bundle connecting (kx , Hx ) and (ky , Hy ), as was mentioned in the previous Remark. Following [11], any two weakly equivalent flat Hopf algebroids are connected by a two-stage zig-zag of weak equivalences, and this is the case for the previous Hopf algebras. That is, in the situation of Proposition 5.3, diagram (28) can be completed to a square by considering the two-sided translation Hopf algebroid built up by using the principal bibundle connecting (kx , Hx ) and (ky , Hy ), see subsection 3.4. In more specific way, we have the two trivial principal bibundles Px := H ⊗A kx and Py := H ⊗A ky which correspond, respectively, to the weak equivalences x and y. Notice that Px is an (H, Hx )-bicomodule algebra with algebra maps   (29) αx : A → Px , a 7→ s(a) ⊗A 1 and βx : kx → Px , k 7→ 1H ⊗A k1x . Similar notations are applied to the (H, Hy)-bicomodule algebra Py . The cotensor product of these two bibundles Px co H Py is again a principal (Hx , Hy )-bibundle (recall here that Px co is the opposite bundle of Px ). The algebra maps defining this structure are βex : kx −→ Px co H Py ←− ky : βey , given by βex (k) = βx (k) H 1Py , βey (k) = 1Px H βy (k), where the notation is the obvious one. The associated two-sided translation Hopf algebroid is described as follows. First we observe the following general fact in Hopf algebroids with source equal to the target, i.e., Hopf algebras over commutative algebras. Lemma 5.5. Let (R, L) and (R′ , L′ ) be two commutative Hopf algebras, and assume that there is a diagram of Hopf algebroids: ′ ′ (R, L) h❘ 5 (R , L ) ❘❘❘❘ ❧ ❧ ❧ ❧❧❧ω′ ω ❘ (A, H)  Then the pair R ⊗A H ⊗A R′ , L ⊗A H ⊗A L′ of algebras, admits a structure of Hopf algebroid with maps: • the source and target: s(r ⊗A u ⊗A r′ ) := r1L ⊗A u ⊗A r′ 1L′ , t(r ⊗A u ⊗A r′ ) := rω(S (u(1))) ⊗A u(2) ⊗A ω′ (u(3) )r′ ; • comultiplication and counit:   ∆(l ⊗A u ⊗A l′ ) := l(1) ⊗A u ⊗A l′(1) ⊗C l(2) ⊗A 1H ⊗A l′(2) , ε(l ⊗A u ⊗A l′ ) := εL (l) ⊗A u ⊗A εL′ (l′ ); • the antipode:  S (l ⊗A u ⊗A l′ ) := SL l ω(u(1) ) ⊗A u(2) ⊗A ω′ (u(3) )SL′ (l′ ). Proof. These are routine computations.  Now we come back to the situation of Proposition 5.3. Consider the following algebras: Px, y := kx ⊗A H ⊗A ky , Hx, y := Hx ⊗A H ⊗A Hy , with the structure of Hopf algebroid, as in Lemma 5.5. Consider then the following obvious algebra maps   ωx : Hx −→ Hx, y , k1x ⊗A u ⊗A k′ 1x 7−→ k1Hx ⊗A u ⊗A k′ 1Hy ; and   ωy : Hy −→ Hx,y , k1y ⊗A u ⊗A k′ 1y 7−→ k1Hx ⊗A u ⊗A k′ 1Hy . Proposition 5.6. Let (A, H) be as in Proposition 5.3, consider x, y ∈ A(k) and their associated isotropy Hopf algebras (kx , Hx ) and (ky , Hy ). Assume that (A, H) is geometrically transitive. Then there is an isomorphism    Px co H Py , Hx X (Px co H Py ) Y Hy  Px, y , Hx, y ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 25 of Hopf algebroids with the following diagram (Px, y , Hx, y ) ω i❚❚❚❚y ω x ❥❥5 ❚❚ ❥❥❥❥ (kx , Hx ) j❚ 4 (ky , Hy ) ❚❚❚❚ ❥❥❥❥ ❚ ❥ ❥ ❚ ❥ y x (A, H) of weak equivalences. Proof. The stated isomorphism follows directly by comparing the structure of the two-sided translation Hopf algebroid, as given in subsection 3.4, with that of (Px, y , Hx, y ) given in Lemma 5.5. By Proposition 5.3, we know that x and y are weak equivalences. Therefore, ωx and ωy are weak equivalences by applying [11, Proposition 6.3] in conjunction with the previous isomorphism of Hopf algebroids.  Remark 5.7. The diagram stated in Proposition 5.6, is not necessarily strictly commutative; however, it is commutative up to a 2-isomorphism in the 2-category of flat Hopf algebroids described in subsection 3.2. Precisely, one shows by applying [11, Lemma 6.11] that there is a 2-isomorphism ωx ◦ x  ωx ◦ y. 5.2. The transitivity of the character groupoid. Let (A, H) be a flat Hopf algebroid as in the previous subsection and consider its character groupoid H (k) = (H(k), A(k)). We have seen in Theorem 4.8 that (A, H) is geometrically transitive if and only if the attached presheaf of groupoids H is locally transitive, that is, satisfies condition (ii) of that theorem. The aim of this subsection is to characterize the transitivity of the groupoid H (k), by means of the conjugation between the isotropy Hopf algebras. First we introduce the notion of conjugacy. Definition 5.8. Let x, y be two objects in H (k). We say that the isotropy Hopf algebras (k x , Hx ) and (ky , Hy ) are conjugated, provided there is an isomorphism of Hopf algebras g : (k x , Hx ) → (ky , Hy ) such that the following diagram (kx , Hx ) i❘ ❘❘❘❘ ❘ x g (A, H) / (ky , Hy ) ❧5 ❧ ❧ ❧ ❧❧ y is commutative up to a 2-isomorphism, where Hopf k-algebras are considered as 0-cells in the 2-category of flat Hopf algebroids described in subsection 3.2. As in [11, §6.4], this means that there is an algebra map g : H → k such that g ◦ s = x, g ◦ t = y, and u(1) − ⊗A u(1) 0 ⊗A u(1) + g(u(2)) = g(u(1)) ⊗A u(2) ⊗A 1y ∈ Hy (30) where, by denoting the Hopf algebroids map z := g ◦ x : (A, H) → (kx , Hx ), we have z0 = x and z1 (u) = g(1 x ⊗A u ⊗A 1 x ) := u− ⊗A u0 ⊗A u+ (summation understood). Proposition 5.9. Let (A, H) be a flat Hopf algebroid with A , 0 and A(k) , ∅. Assume that (A, H) is geometrically transitive. Then the following are equivalent: (i) the character groupoid H (k) is transitive; (ii) for any two objects x, y in H (k), the algebras H ⊗A kx and H ⊗A ky are isomorphic as left H-comodules algebras; (iii) any two isotropy Hopf algebras are conjugated. Furthermore, under the same assumptions, condition (i) is always fulfilled. Proof. We first check the equivalences between these conditions. So, let x ∈ A(k) = H0 (k) and denote as before by Px := H ⊗A kx the stated left H-comodule algebra. (i) ⇒ (ii). Given x, y ∈ A(k), by assumption there is an algebra map h : H → k such that h ◦ s = x and h ◦ t = y. So we can define the following map    F : Px −→ Py , u ⊗A k1x 7−→ u(1) ⊗A h S (u(2) ) k1y . Clearly F is an A-algebra map, and so it is left A-linear. The fact that F is left H-colinear is also clear, and this shows condition (ii), since F is obviously bijective. 26 LAIACHI EL KAOUTIT (ii) ⇒ (iii). Assume for a given x, y ∈ A(k), there is a left H-comodule algebra isomorphism F : Px → Py . For any u ∈ H, we denote by F(u ⊗A 1x ) = u− ⊗A u+ (summation understood). Consider the k-linear map  g : H → k which sends u 7→ y ε(u− ) u+ . This is a k-algebra map since F it is so. For any a ∈ A, we have    g s(a) = y ε(s(a)− ) s(a)+ = y ε(s(a)) 1 = y(a) and    g t(a) = y ε(t(a)− ) t(a)+ = y ε(1H ) x(a)1 = x(a), as F is k-linear. Define the map g : (k x , Hx ) −→ (ky , Hy ),   (k1x , 1x ⊗A u ⊗A 1x ) 7−→ (k1y , g(S (u(1)))1y ⊗A u(2) ⊗A g(u(3) )1y ) . By using the characterization given in Lemma 5.2, or a direct computation, one can shows that this map is an isomorphism of Hopf algebras. Furthermore, it is easily seen that the pair (g, g) satisfies the equalities of equation (30). Thus, (kx , Hx ) and (ky , Hy ) are conjugated, which means condition (iii). (iii) ⇒ (i). This implication follows immediately from equation (30). Let us check that condition (i) is fulfilled under assumption. For a given element u ∈ H there exists, by the isomorphism of Remark 4.7, a finite family M1 , · · · , Mk of dualizable right H-comodules and finite set P  of elements {(pl , ϕl )}1≤ l ≤k , pl ∈ Ml and ϕl ∈ Ml∗ , such that u is uniquely written as u = l s ϕl (pl(0) ) pl(1) (see [13, Section 4] for more details on the quoted in Remark 4.7). Given now two objects x, y ∈ A(k),  map can   we define g : H → k by g(u) := y s ϕl (pl(0) ) x ε(pl(1) ) . It turns out that g is a well defined algebra map, which satisfies g ◦ s = y and g ◦ t = x. This shows that H (k) is transitive and finishes the proof.  5.3. GT Hopf algebroids and principal bundles over Hopf algebras. Parallel to subsection 2.6 we study here the relationship between GT Hopf algebroids and principal bundles over Hopf algebras (i.e., commutative Hopf Galois extensions [23, §8], [28], or k-torsor as in [15] and [10]). This is a restricted notion of principal bundle, as defined in subsection 3.4, to the case of Hopf algebras. To be precise, let B be a commutative Hopf algebra over k, a pair (P, α) consisting of an algebra extension α : A → P and a right B-comodule algebra P with left A-linear coaction, is said to be a right principal B-bundle provided α is faithfully flat and the canonical map canP : P ⊗A P → P ⊗ H, x ⊗A y 7→ xy(0) ⊗ y(1) is bijective. Notice that if we translate this definition to the associated affine k-schemes, then the outcome characterizes in fact the notion of torsors as it was shown in [10, Corollaire 1.7, page 362], see also [15, Définition 1.4.1, page 117]. Let (A, H) be a Hopf algebroid as in subsection 5.1 and H its associated presheaf of groupoids. Take an object x ∈ A(k) and consider as before Px = H ⊗A kx the right comodule algebra over the isotropy Hopf algebra (kx , Hx ) with the algebra extension αx : A → Px of equation (29). On the other hand denote by Px  the presheaf of sets which associated to each algebra C the set Px (C) := t−1 {1C ◦ x} where t is the target of the groupoid H (C). Lemma 5.10. For any x ∈ A(k), the presheaf of sets Px is affine, and up to a natural isomorphism, is represented by the algebra Px . Furthermore, if (A, H) is geometrically transitive, then (Px , αx ) is a principal right Hx -bundle. Proof. The first claim is an immediate verification. The last one is a consequence of Theorem 4.8.  In contrast with the case of transitive groupoids described in subsection 2.6, the converse in Lemma 5.10 is not obvious. Specifically, it is not automatic to construct a GT Hopf algebroid from a principal bundle over a Hopf algebra. In more details, let (P, α) be a right principal B-bundle over a Hopf algebra B with extension α : A → P, and consider P ⊗ P as a right B-comodule algebra via the diagonal coaction and set o n H := (P ⊗ P)coinvB = u ∈ P ⊗ P| ̺P⊗ P (u) = u ⊗ 1B its coinvariant subalgebra. The map α induces two maps s, t : A → H which going to be the source and the target. The counity is induced by the multiplication of P. The comultiplication is derived from that of (P, P ⊗ P), however, not in an immediate way, because slightly technical assumptions are needed for this. Precisely, consider M := (P ⊗ P) ⊗A (P ⊗ P) as a right B-comodule algebra with the coaction ̺ : M −→ M ⊗ B, (x ⊗ y) ⊗A (u ⊗ v) 7−→ (x(0) ⊗ y(0) ) ⊗A (u(0) ⊗ v(0) ) ⊗ x(1) y(1) u(1) v(1) . ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 27 This is a well defined coaction since we know that PcoinvB  A. Clearly we have that H ⊗A H ⊆ McoinvB , and under the assumption of equality we obtain: Proposition 5.11. Let (P, α) be a right principal B-bundle over a Hopf algebra B with extension α : A → P. Denote by υ : H := (P ⊗ P)coinB → P ⊗ P the canonical injection where P ⊗ P is a right B-comodule algebra via the diagonal coaction. Assume that υ is a faithfully flat extension and that H ⊗A H = McoinB . Then (A, H) admits a unique structure of Hopf algebroid such that (α, υ) : (A, H) → (P, P ⊗ P) is a morphism of GT Hopf algebroids. Proof. First observe that the map s : A → H is a flat extension (and so is t) since α and υ are faithfully flat extension and we have a commutative diagram: υ /H O O 0 s t α /A 0 / P⊗ P O O /P of algebra maps. The fact that (A, H) admits a coassociative comultiplication follows essentially form the second assumption. Indeed, let ∆′ : P ⊗ P → M be the map which sends x ⊗ y 7→ (x ⊗ 1) ⊗A (1 ⊗ y), so it is easily checked that, under the stated assumption, there is a map H → H ⊗A H which completes the diagram: 0 /M O / H ⊗A H O /H −⊗1 // M ⊗ B ∆′ ∆ 0 ̺ υ / P⊗ P This gives a coassociative comultiplication on the A-bimodule H using the structure of A-bimodule derived from the above source and the target s, t. To check that ∆ is counital one uses the following equalities   (p ⊗ 1) ⊗A (1 ⊗ q) = p(0) ⊗ p−(1) q−(1) ⊗A p+(1) q+(1) ⊗ q(0) ∈ (P ⊗ P) ⊗A (P ⊗ P), together with the properties of the translation map δ : B → P ⊗A P, b 7→ b− ⊗A b+ given by the inverse of the canonical map canP . With the previous structure maps, (A, H) is now a Hopf algebroid such that the pair of maps (α, υ) : (A, H) → (P, P ⊗ P) is a morphism of Hopf algebroids with codomain a GT Hopf algebroid. Lastly, since α ⊗ α is a faithfully flat extension, s ⊗ t : A ⊗ A → H is also faithfully flat, and hence (A, H) is by Theorem 4.8 a GT Hopf algebroid as well.  5.4. GT Hopf algebroids with empty character groupoid. Let (A, H) be a flat Hopf algebroid over k with A , 0 and A(k) = ∅. For example, taking any non zero algebra A with A(k) = ∅ and consider the Hopf algebroids given in Examples 3.1 and 3.3. Now, let L be a field extension of k such that A(L) , ∅ and denote by OL : AlgL → Algk the forgetful functor from the category of commutative L-algebras to k-algebras. Next, we will use the notations of Example 3.4. So, fix an algebra map q ∈ A(L) and denote by e q ∈ AL (L) = AlgL (AL , L) its image, that is, the L-algebra map e q : AL → L sending a ⊗ l 7→ q(a)l. Consider the base extension Hopf algebroid (Lq , Lq ⊗A H ⊗A Lq ) := (Lq , Hq ) over k, where Lq is considered as an algebra extension of A via the map q. The associated presheaf of groupoids is denoted by Hq and its fq := Hq ◦ OL . In this way, we get a presheaf of groups composition with OL by H   fq ⋆ : Alg −→ Grps, fq (R)z H R −→ H (31) L fq (R)z is the isotropy where z : L → R is the k-algebra map defining R as an object in AlgL and where H fq (R) attached to the object z. Thus, for any pair (R, z) as before, we have by group of the groupoid H Example 3.8 that   fq (R)z := (z, g, z)| g ∈ H(R) such that gs = gt = zq H where the multiplication is given as in Example 2.4 and the unit is the element (z, zqε, z). 28 LAIACHI EL KAOUTIT On the other hand, following Lemma 5.2 we can define the presheaf of groups attached to the Hopf algebroid (AL , HL ) over L, at the point e q. That is, we can consider the presheaf HL associated to (AL , HL ), and denote by   GLeq : AlgL −→ Grps, R −→ GLeq (R) (32) where GLeq (R) is the isotropy group of the groupoid HL (R) at the point e q ∈ AL (L). Thus   GLeq (R) := h ∈ HL (R) = AlgL (HL , R)| hsL = htL = e q , where the group structure comes from the groupoid HL (R). Proposition 5.12. Given (R, z) as above, then the following morphisms of groups GLeq (R) ✤ h φq, R fq (R)z /H / (z, ĥ, z), where ĥ ∈ H(R) is the k-algebra map sending u 7→ h(u ⊗ 1), establish a natural isomorphism fq φq : GLeq −→ H ⋆ fq ⋆ is represented by the isotropy of presheaves of groups. In particular, up to a natural isomorphism, H Hopf L-algebra (L, HL, eq ) of the Hopf algebroid (AL , HL ) at the point e q. Proof. Let us first check that φq, R is a well defined map. Take h ∈ GLeq , then, for every a ∈ A, we have ĥ ◦ s(a) = h(s(a) ⊗ 1) = h ◦ sL (a ⊗ 1) = h ◦ tL (a ⊗ 1) = h ◦ (t(a) ⊗ 1) = ĥ ◦ t(a) = e q(a) = q(a).1L = zq(a). fq (R)z . The image by φq, R of the identity element e Hence (z, ĥ, z) ∈ H qεL is (z, e qc εL , z) = (z, zqε, z) which is e q z ′ f the identity element of the group Hq (R) . Now, given h, h ∈ GL (R) and u ∈ H, we have that c′ (u) = (hh′ )(u ⊗ 1) = h′ (u ⊗ 1)(1)  h (u ⊗ 1)(2)  = h′ u(1) ⊗ 1 h u(2) ⊗ 1 = ĥ′ (u(1) ) ĥ(u(2)) = (ĥ ĥ′ )(u) hh c′ = ĥ ĥ′ . Therefore, which implies that hh c′ , z), (z, ĥ, z) (z, ĥ′ , z) = (z, ĥhˆ′ , z) = (z, hh which shows that φq, R is a morphism of groups. On the other hand, φq, R is clearly injective and if we take fq (R)z and set h = ĝ : HL → R sending u ⊗ l 7→ g(u) ⊗ l, then we have that an element (z, g, z) ∈ H (z, g, z) = φq, R (h). This shows that φq, R is also surjective, and thus an isomorphism of groups. Lastly, it is immediate to see that φq, − is a natural transformation and so a natural isomorphism as desired. The particular statement follows directly from Lemma 5.2.  Remark 5.13. Let (Lq , Lq ⊗A H ⊗A Lq ) be as above the base change Hopf algebroid of (A, H) and denote by (L, Hq ) its quotient Hopf  L-algebra  where Hq := Lq ⊗A H ⊗A Lq /hs − ti is the quotient modulo the Hopf ideal generated by the set s(l) − t(l) . Then the following map of L-vector spaces l∈L Hq l ⊗A u ⊗A l′ ✤ / HL, eq / 1 ⊗A (u ⊗ ll′ ) ⊗A 1 L L is a surjective morphism of Hopf L-algebras. On the other hand, the presheaf of set Peq : AlgL → Sets defined as in Lemma 5.10 for the Hopf algebroid (AL , HL ) is, up to a natural isomorphisms, represented by the left H-comodule L-algebra H ⊗A Lq which under condition (i) of Theorem 4.8, becomes a principal (H, Hq)-bibundle. Proposition 5.14. Let (A, H) be a flat Hopf algebroid over k with A , 0 and A(k) = ∅, denote by H its associated presheaf of groupoids. Consider L a field extension of k such that A(L) , ∅. Assume that the unit map η = s ⊗ t : A ⊗ A → H is a faithfully flat extension. Then (1) H (L) is a transitive groupoid; (2) For every p, q ∈ A(L), the base change Hopf algebroids (Lq , Hq ) and (L p , H p ) are weakly equivalent. ON GEOMETRICALLY TRANSITIVE HOPF ALGEBROIDS 29 Proof. As we have observed in Remark 4.10, if η is a faithfully flat extension, then so is ηL : AL ⊗L AL → HL . Since AL (L) , ∅, we have by Theorem 4.8, that (AL , HL ) is geometrically transitive Hopf algebroid. Therefore, by applying Proposition 5.9, we know that HL (L) is a transitive groupoid. Now, given p, q ∈ A(L) we obtain two objects e p, e q ∈ AL (L) of this groupoid. Hence, there exists an L-algebra map h ∈ HL (L) such that h ◦ sL = e p and h ◦ tL = e q. Consider the algebra map g = ĥ : H → L sending u 7→ h(u ⊗ 1), so we have that g ◦ s = p and g ◦ t = q. This proves part (1). As for part (2), we know by Remark 4.10 that (A, H) satisfies condition (iii) of Theorem 4.8. Henceforth, the canonical base change maps (A, H) → (L p , H p ) and (A, H) → (Lq , Hq ) are weak equivalences by [11, Proposition 5.1]. Therefore, (L p , H p ) and (Lq , Hq ) are weakly equivalent by applying [11, Theorem A] and this finishes the proof.  5.5. Dualizable comodules over GT Hopf algebroids are locally free of constant rank. The aim of this subsection is to apply Theorem 4.8 in order to give an elementary proof of the well know fact sated in [9, page 114] which implicitly asserts that over a GT Hopf algebroid with non empty character groupoid, any comodule which has a locally free fibre with rank n, then so are other fibres. An important consequence of this fact is that any dualizable comodule over such a Hopf algebroid is locally free with constant rank. This is an algebraic interpretation of a well known property on representations of transitive groupoid in vector spaces. Namely, if a given representation over such a groupoid has a finite dimensional fibre, then so are all other fibres and all the fibres have the same dimension. We start by the following general lemma which will be needed below. Lemma 5.15. Let ϕ : R → T be a faithfully flat extension of commutative algebras. Then, for any R-module P, the following conditions are equivalent. (i) P is locally free R-module of constant rank n; (ii) Pϕ := P ⊗R T is locally free T -module of constant rank n. Proof. By [2, Proposition 12, page 53, and Théorème 1, page 138], we only need to check that P is of a constant rank n if and only if so is Pϕ . So let us first denote by ϕ∗ : Spec(T ) → Spec(R) the associated continuous map of ϕ. Denote by rRP : Spec(R) → Z and rTPϕ : Spec(T ) → Z, the rank functions corresponding, respectively, to P and Pϕ . It suffices to check that rRP is a constant function with value n if and only if rTPϕ is a constant function with the same value. Given a prime ideal a ∈ Spec(T ), consider the localising algebras T a and Rϕ∗ (a) at the prime ideals a and ϕ∗ (a). It is clear that we have an isomorphism of T a -modules P ⊗R T a  Pϕ∗ (a) ⊗Rϕ∗ (a) T a , where ϕa : Rϕ∗ (a) → T a is the associated localisation map of the extension ϕ. Therefore, the free modules P ⊗R T a  and Pϕ∗ (a) have the same rank. Hence, we have rRP ϕ∗ (a) = rTPϕ (a), for any a ∈ Spec(T ), and so rRP ◦ ϕ∗ = rTPϕ . This shows that if rRP is a constant function with value n, then so is rTPϕ . The converse also hods true since we know that ϕ∗ is surjective, because of the faithfully flatness of ϕ, and this finishes the proof.  Proposition 5.16. Let (A, H) be a flat Hopf algebroid with A , 0 and A(k) , ∅. Assume that (A, H) is geometrically transitive, and let M be a (right) H-comodule whose underlying A-module is finitely generated and projective. Given two objects x ∈ A(S ) and y ∈ A(T ), then the following are equivalent (i) Mx := M ⊗A S is locally free S -module of constant rank n; (ii) My := M ⊗A T is locally free T -module of constant rank n. Proof. Let us first show that the stated conditions are equivalent when R = S = T . In this case we know by Theorem 4.8, that the objects x, y ∈ A(R) are locally isomorphic. Therefore, there exists a faithfully flat extension p : R → R′ such that Mex = M ⊗ex R′ is isomorphic as R′ -module to Mey = M ⊗ey R′ , where e x = p◦x and e y = p ◦ y. Thus, Mex and Mey they have the same rank function. On the other hand, by applying Lemma 5.15 to Mx , we get that Mex is locally free R′ -module of constant rank n if and only if Mx is locally free R-module of constant rank n. The same result hold true using My and Mey . Therefore, Mx is locally free R-module of constant rank n if and only if so is My . For the general case S , T , consider R := T ⊗ S and set the algebra maps x := ιS ◦ x, y := ιT ◦ y, where ιS : S → R ← T : ιT are the obvious maps. By the previous case, we know that Mx is locally free R-module of constant rank n if and only if so is My . Now by Lemma 5.15, we have, from one hand, that Mx is locally free R-module of constant rank n if and only if Mx is locally free S -module of constant rank n, and from the other, we have that My is locally free R-module of constant rank n if and only if My is locally 30 LAIACHI EL KAOUTIT free T -module of constant rank n. Therefore, Mx is locally free S -module of constant rank n if and only if My is so as T -module.  As a corollary of Proposition 5.16, we have: Corollary 5.17. Let (A, H) be a flat Hopf algebroid with A , 0 and A(k) , ∅. Assume that (A, H) is geometrically transitive. Then every dualizable (right) H-comodule is a locally free A-module of constant rank. In particular, given a dualizable right H-comodule M and two distinct object x , y ∈ A(k), then Mx and My have the same dimension as k-vector spaces. Aknowledgements: The author would like to thank the referee for her/his thorough review and highly appreciate the comments and suggestions, which significantly contributed to improving the paper. References [1] Leovigilio Alonso Tarrı́o, Ana Jeremı́as López, Marta Pérez Rodrı́guez and Marı́a J. Vale Gonsalves, A funtorial formalism for quasi-coherent sheaves on geometric stacks. Expo. Math. 33 (2015), no. 4, 452–501. [2] N. Bourbaki, Éléments de mathématique. Algèbre commutative. Chapitre 1-4, Actualités Scientifiques et Industrielles, No. 1290, Herman, Paris, 1961. [3] R. Brown, From groups to groupoids: A brief survey. Bull. London Math. Soc. 19 (2), (1987), 113–134. [4] A. Bruguières, Thèorie Tannakienne non commutative, Commun. in Algebra 22 (1994), 5817–5860. [5] T. Brzeziński, Galois comodules, J. Algebra 290 (2005), 503–537. [6] T. Brzeziński and R. Wisbauer, Corings and comodules, London Mathematical Society Lecture Note Series, vol. 309, Cambridge University Press, Cambridge, 2003. [7] S. Bouc, Biset Functors for finite Groups, LNM, vol. 1999. Springer-Verlag Berlin Heidelberg 2010. [8] P. Cartier, Groupoı̈des de Lie et leurs Algèbroı̈des. Séminaire Bourbaki 60e année, 2007-2008, num. 987, 165–196. [9] P. Deligne, Catégories tannakiennes. In The Grothendieck Festschrift (P. Cartier et al., eds.), Progr. Math., 87, vol. II, Birkhäuser, Boston, MA. 1990, pp. 111–195. [10] M. Demazure and P. Gabriel, Groupes algébriques. Tome I: Géométrie algébrique, généralités, groupes commutatifs, Masson & Cie, Éditeur, Paris; North-Holland Publishing Co., Amsterdam, 1970, Avec un appendice Corps de classes local par Michiel Hazewinkel. [11] L. El Kaoutit and N. Kowalzig, Morita theory for Hopf algebroids, principal bibundles, and weak equivalences. Doc. Math. 22 (2017), 551–609. [12] L. El Kaoutit and J. Gómez-Torrecillas, Comatrix corings: Galois corings, descent theory, and a structure theorem for cosemisimple corings. Math. Z., 244 (2003), 887–906. [13] L. El Kaoutit and J. Gómez-Torrecillas, Infinite comatrix corings. Int. Math. Res. Notices, 39 (2004), 2017–2037. [14] P. Gabriel, Construction de preschemas quotient. Exposé V. Propriétés Générales des Schémas en Groupes LNM Vol.151 Springer Verlag 1970 (SGA 3 -I) pp. 252–286. [15] J. Giraud, Cohomologie non-abélienne. Die Grundlehren der mathematischen Wissenschaften in Einzeldarstellungen Band 179. Springer-Verlag Berlin Heidelberg New York 1971. [16] P. J. Higgins, Notes on categories and groupoids, Van Nostrand Reinhold, Mathematical Studies 32, London 1971. [17] M. Hovey and N. Strickland, Comodules and Landweber exact homology theories. Adv. Math. 192 (2005), no. 2, 427–456. [18] B. Jelenc. Serre fibrations in the Morita category of topological groupoids, Topol. Appl. 160 (2013), 9–13. [19] Peter S. Landweber, Associated prime ideals and Hopf algebras, J. Pure Appl. Algebra 3 (1973), 43–58. [20] G. Laumon and L. Moret-Baily, Champs algébriques. Vol. 39, Ergebnisse der Mathematik und ihrer Grenzgebiete. 3. Folge. A Series of Modern Surveys in Mathematicas. Springer-Verlag, Berlin 2000. [21] Kirill C. H. Mackenzie, General Theory of Lie Groupoids and Lie Algebroids, London Math. Soc. Lecture Note Ser., vol. 213, Cambridge Univ. Press, Cambridge, 2005. [22] I. Moerdijk and J. Mrčun, Lie groupoids, sheaves and cohomology, Poisson geometry, deformation quantisation and group representations, London Math. Soc. Lecture Note Ser., vol. 323, Cambridge Univ. Press, Cambridge, 2005, pp. 145–272. [23] S. Montgomery, Hopf algebras and their actions on rings. CBMS Regional Conference Series in Mathematics, 82 American Mathematical Society, Providence, RI, 1993. xiv+238 pp. [24] N. Naumann, The stack of formal groups in stable homotopy theory. Adv. Math. 215 (2007), no. 2, 569–600. [25] Geoffery M. L. Powell, On affine morphisms of Hopf algebroids. Homology, Homotopy Appl. 10 (2008), no. 1, 53–95. [26] D. C. Ravenel, Complex Cobordism and Stable Homotopy Groups of Spheres. Pure and Applied Mathematics Series, Academic Press, San Diego, 1986. [27] J. Renault, A groupoid approach to C ∗ -algebras. Lecture Notes in Mathematics 793, Springer Verlag, 1980. [28] P. Schauenburg, Hopf-Galois and bi-Galois extensions, Galois theory, Hopf algebras, and semiabelian categories, Fields Inst. Commun., vol. 43, Amer. Math. Soc., Providence, RI, 2004, pp. 469–515. Universidad de Granada. Departamento de Álgebra y IEMath-Granada. Facultad de Educación, Econonı́a y Tecnologı́a de Ceuta. Cortadura del Valle, s/n. E-51001 Ceuta, Spain E-mail address: [email protected] URL: http://www.ugr.es/˜kaoutit/
4math.GR
Scalable Partial Least Squares Regression on Grammar-Compressed Data Matrices Yasuo Tabei Hiroto Saigo Japan Science and Technology Agency, Japan Kyushu University, Japan [email protected] Yoshihiro Yamanishi arXiv:1606.05031v1 [cs.DS] 16 Jun 2016 Kyushu University, Japan [email protected] Simon J. Puglisi University of Helsinki, Finland [email protected] [email protected] u.ac.jp ABSTRACT With massive high-dimensional data now commonplace in research and industry, there is a strong and growing demand for more scalable computational techniques for data analysis and knowledge discovery. Key to turning these data into knowledge is the ability to learn statistical models with high interpretability. Current methods for learning statistical models either produce models that are not interpretable or have prohibitive computational costs when applied to massive data. In this paper we address this need by presenting a scalable algorithm for partial least squares regression (PLS), which we call compression-based PLS (cPLS), to learn predictive linear models with a high interpretability from massive high-dimensional data. We propose a novel grammar-compressed representation of data matrices that supports fast row and column access while the data matrix is in a compressed form. The original data matrix is grammarcompressed and then the linear model in PLS is learned on the compressed data matrix, which results in a significant reduction in working space, greatly improving scalability. We experimentally test cPLS on its ability to learn linear models for classification, regression and feature extraction with various massive high-dimensional data, and show that cPLS performs superiorly in terms of prediction accuracy, computational efficiency, and interpretability. 1. INTRODUCTION Massive data are now abundant throughout research and industry, in areas such as biology, chemistry, economics, digital libraries and data management systems. In most of these fields, extracting meaningful knowledge from a vast amount of data is now the key challenge. For example, to remain competitive, e-commerce companies need to constantly analyze huge data of user reviews and purchasing histories [24]. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. KDD ’16, August 13-17, 2016, San Francisco, CA, USA c 2016 ACM. ISBN 978-1-4503-4232-2/16/08. . . $15.00 DOI: http://dx.doi.org/10.1145/2939672.2939864 In biology, detection of functional interactions of compounds and proteins is an important part in genomic drug discovery [29, 7] and requires analysis of a huge number of chemical compounds [3] and proteins coded in fully sequenced genomes [4]. There is thus a strong and growing demand for developing new, more powerful methods to make better use of massive data and to discover meaningful knowledge on a large scale. Learning statistical models from data is an attractive approach for making use of massive high-dimensional data. However, due to high runtime and memory costs, learning of statistical models from massive data — especially models that have high interpretability — remains a challenge. Partial least squares regression (PLS) is a linear statistical model with latent features behind high-dimensional data [26, 35, 36] that greedily finds the latent features by optimizing the objective function under the orthogonal constraint. PLS is suitable for data mining, because extracted latent features in PLS provide a low-dimensional feature representation of the original data, making it easier for practitioners to interpret the results. From a technical viewpoint, the optimization algorithm in PLS depends only on elementary matrix calculations of addition and multiplication. Thus, PLS is more attractive than other machine learning methods that are based on computationally burdensome mathematical programming and complex optimization solvers. In fact, PLS is the most common chemoinformatics method in pharmaceutical research. However, applying PLS to massive high-dimensional data is problematic. While the memory for the optimization algorithm in PLS depends only on the size of the corresponding data matrix, storing all high-dimensional feature vectors in the data matrix consumes a huge amount of memory, which limits large-scale applications of PLS in practice. One can use lossy compression (e.g., PCA [14, 9] and b-bit minwise hashing [12, 20]) to compactly represent data matrices and then learn linear models on the compact data matrices [21]. However, although these lossy compression-based methods effectively reduce memory usage [21, 30], their drawback is that they cannot extract informative features from the learned models, because the original data matrices cannot be recovered from the compressed ones. Grammar compression [2, 27, 16] is a method of lossless compression (i.e., the original data can be completely re- Table 1: Summary of scalable learning methods of linear models. Approach Compression Type # of parameters Interpretability Optimization PCA-SL [14, 9] Orthogonal rotation Lossy 2 Limited Stable bMH-SL [21] Hashing Lossy 3 Unable Stable SGD [33, 8] Sampling 1 Limited Unstable cPLS (this study) Grammar compression Lossless 1 High Stable covered from grammar-compressed data) that also has a wide variety of applications in string processing, such as pattern matching [37], edit-distance computation [13], and q-gram mining [1]. Grammar compression builds a small context-free grammar that generates only the input data and is very effective at compressing sequences that contain many repeats. In addition, the set of grammar rules has a convenient representation as a forest of small binary trees, which enables us to implement various string operations without decompression. To date, grammar compression has been applied only to string (or sequence) data; however, as we will see, there remains high potential for application to other data representations. A fingerprint (or bit vector) is a powerful representation of natural language texts [23], bio-molecules [32], and images [11]. Grammar compression is expected to be effective for compressing a set of fingerprints as well, because fingerprints belonging to the same class share many identical features. Principal component analysis (PCA) [14] is a widely used machine learning tool, and is a method of lossy compression, i.e., the original data cannot be recovered from compressed data. There have been many attempts to extend PCA [31, 28] and present a scalable PCA in distributed settings for analyzing big data [9]. For classification and regression tasks, a data matrix is compressed by PCA, and linear models are learned on the compressed data matrix by a supervised learning method (SL), which is referred to as PCA-SL. Despite these attempts, PCA and its variants do not look at the correlation structure between data and output variables (i.e., class labels/response variables), which results in not only the inability of feature extractions in PCA but also the inaccurate predictions by PCA-SL. Li et al. [21] proposed a compact representation of fingerprints for learning linear models by applying b-bit minwise hashing (bMH). A d-dimensional fingerprint is conceptually equivalent to the set si ⊂ {1, ..., d} that contains element i if and only if the i-th bit in the fingerprint is 1. Li et al.’s Contribution. In this paper, we present a new scalable method works as follows. We first pick h random permutalearning algorithm for PLS, which we call lossless compressiontions πi , i = 1, .., h, each of which maps [1, d] to [1, d]. We based PLS (cPLS), to learn highly-interpretable predictive then apply a random permutation π on a set si , compute the linear models from massive high-dimensional data. A key minimum element as min(π(si )), and take as a hash value idea is to convert high-dimensional data with fingerprint repits lowest b bits. Repeating this process h times generates h resentations into a set of sequences and then build grammar hash values of b bits each. Expanding these h values into a rules for representing the sequences in order to compactly (2b × h)-dimensional fingerprint with exactly h 1’s builds a store data matrices in memory. To achieve this, we propose compact representation of the original fingerprint. a novel grammar-compressed representation of a data maLinear models are learned on the compact fingerprints by trix capable of supporting row and column access while the SL, which is referred to as bMH-SL. Although bMH-SL is data matrix is in a compressed format. The original data applicable to large-scale learning of linear models, bMH is matrix is grammar-compressed, and then a linear model is a method of lossy compression and cannot extract features learned on the compressed data matrix, which allows us to from linear models learned by SL. Other hashing-based apsignificantly reduce working space. cPLS has the following proaches have been proposed such as Count-Min sketch [5], desirable properties: Vowpal Wabbit [34], and Hash-SVM [25]. However, like 1. Scalability: cPLS is applicable to massive high-dimensional bMH-SL, these algorithms cannot extract features, which data. is a serious problem in practical applications. 2. Prediction Accuracy: cPLS can achieve high predicStochastic gradient descent (SGD) [8, 33] is a computation accuracies for both classification and regression. tionally efficient algorithm for learning linear models on a 3. Usability: cPLS has only one hyper parameter, which large-scale. SGD samples ν feature vectors from an input enhances the usability of cPLS. dataset and computes the gradient vector from the sampled 4. Interpretability: Unlike lossy compression-based methfeature vectors. The weight vector in linear models is upods, cPLS can extract features reflecting the correlation dated using the gradient vector and the learning rate µ, and structure between data and class labels/response varithis process is repeated until convergence. Unfortunately ables. however, learning linear models using SGD is numerically We experimentally test cPLS on its ability to learn linear unstable, resulting in low prediction accuracy. This is bemodels for classification, regression and feature extraction cause SGD has three parameters (ν, µ, and C) that must be with various massive high-dimensional data, and show that optimized if high classification accuracy is to be attained. cPLS performs superiorly in terms of prediction accuracy, Online learning is a specific version of SGD that loads an computational efficiency, and interpretability. input dataset from the beginning and updates the weight vector in a linear model for each feature vector. AdaGrad [8] is an efficient online learning that automatically tunes pa2. LITERATURE REVIEW rameters of ν and µ in SGD. Although online learning is Several efficient algorithms have been proposed for learnspace-efficient (owing to its online nature), it is also numering linear models on a large scale. We now briefly review ically unstable. Even worse, AdaGrad is applicable only the state of the art, which is also summarized in Table 1. (i) Input sequence (ii) Compressed sequence and dictionary . The dictionary corresponds to a forest of grammar trees. Figure 1: Illustration of grammar compression. to differentiable loss functions, which limits its applicability to simple linear models, e.g., SVM and logistic regression, making the learned model difficult to interpret. Despite the importance of scalable learning of interpretable linear models, no previous work has been able to achieve high prediction accuracy for classification/regression tasks and high interpretability of the learned models. We present a scalable learning algorithm that meets both these demands and is made possible by learning linear models on grammarcompressed data in the framework of PLS. Details of the proposed method are presented in the next section. 3. GRAMMAR COMPRESSION Given a sequence of integers S, a grammar-compressor generates a context-free grammar (CFG) that generates S and only S. The grammar consists of a set of rules1 . Each rule is of the form Zi → ab. Symbols that appear on the lefthand side of any rule are called non-terminals. The remaining symbols are called terminals, all of which are present in the input sequence. Informally, a rule Zi → ab indicates that on the way to recovering the original sequence from its grammar-compressed representation, occurrences of the symbol Zi should be replaced by the symbol pair ab (the resulting sequence may then be subject to yet more replacements). A data structure storing a set of grammar rules is called a dictionary and is denoted by D. Given a nonterminal, the dictionary supports access to the symbol pair on the right-hand of the corresponding grammar rule, i.e., D[Zi ] returns ab for rule Zi → ab. The original sequence can be recovered from the compressed sequence and D. The set of grammar rules in D can be represented as a forest of (possibly small) binary trees called grammar trees, where each node and its left/right children correspond to a grammar rule. See Figure 1 for an illustration. The size of a grammar is measured as the number of rules plus the size of compressed sequence. The problem of finding the minimal grammar producing a given string is known to be NP-complete [2], but several approximation algorithms exist that produce grammars that are small in practice (see, e.g., [27, 19, 16]). Among these is the simple and elegant Re-Pair [19] algorithm, which we review next. 3.1 Re-Pair Algorithm The Re-Pair grammar compression algorithm by Larsson and Moffat [19] builds a grammar by repeatedly replacing the most frequent symbol pair in an integer sequence with a 1 In this paper we assume without loss of generality that the grammar is in Chomsky Normal Form. new non-terminal. Each iteration of the algorithm consists of the following two steps: (i) find the most frequent pair of symbols in the current sequence, and then (ii) replace the most frequent pair with a new non-terminal symbol, generating a new grammar rule and a new (and possibly much shorter) sequence. Steps (i) and (ii) are then applied to the new sequence and iterated until no pair of adjacent symbols appears twice. Apart from the dictionary D that stores the rules as they are generated, Re-Pair maintains a hash table and a priority queue that together allow the most frequent pair to be found in each iteration. The hash table, denoted by H, holds the frequency of each pair of adjacent symbols ab in the current sequence, i.e., H : ab → N. The priority queue stores the symbol pairs keyed on frequency and allows the most frequent symbol to be found in step (i). In step (ii), a new grammar rule Z1 → ab is generated where ab is the most frequent symbol pair and Z1 is a new non-terminal not appearing in a sequence. The rule is stored in the dictionary D. Every occurrence of ab in the sequence is then replaced by Z1 , generating a new, shorter sequence. This replacement will cause the frequency of some symbol pairs to change, so the hash table and priority queue are then suitably updated. Let sc denote a sequence generated at c-th iteration in the Re-Pair algorithm. For input sequence s in Figure 1, the most frequent pair of symbols is 12. Thus, we generate rule Z1 → 12 to be added to the dictionary D and replace all the occurrences of 12 by non-terminal Z1 in s. After four iterations, the current sequence s4 has no repeated pairs, and thus the algorithm stops. Dictionary D has four grammar rules that correspond to a forest of two small trees. As described by Larsson and Moffat [19], Re-Pair can be implemented to run in linear time in the length of the input sequence, but it requires the use of several heavyweight data structures to track and replace symbol pairs. The overhead of these data structures (at least 128 bits per position) prevents the algorithm from being applied to long sequences, such as the large data matrices. Another problem that arises when applying Re-Pair to long sequences is the memory required for storing the hash table: a considerable number of symbol pairs appear twice in a long sequence, and the hash table stores something for each of them, consuming large amounts of memory. In the next section, we present scalable Re-Pair algorithms that achieve both space-efficiency and fast compression time on large data matrices. Specifically, our algorithms need only constant working space. 4. OUR GRAMMAR-COMPRESSED DATA MATRIX Our goal is to obtain a compressed representation of a data matrix X of n rows and d columns. Let xi denote the ith row of the matrix represented as a fingerprint (i.e. binary vector). An alternative view of a row that will be useful to us is as a sequence of integers si = (p1 , p2 , ..., pm ), p1 < p2 < · · · < pm , where pi ∈ si if and only if xi [pi ] = 1. In other words the sequence si indicates the positions of the 1 bits in xi . In what follows we will deal with a differentially encoded form of si in which the difference for every pair of adjacent elements in si is stored, i.e., si = (p1 , p2 , ..., pm ) is encoded as sgi = (p1 , p2 − p1 , p3 − p2 , ..., pm − pm−1 ). This differ- ential encoding tends to increase the number of repeated symbol pairs, which allows the sequences sgi to be more effectively compressed by the Re-Pair algorithm. A grammar compressor captures the underlying correlation structure of data matrices: by building the same grammar rules for the same (sequences of) integers, it effectively compresses data matrices with many repeated integers. the q-th interval, H(ab) is initialized as qN/` + 1, which ensures that ab is kept until at least the next interval, i.e., the (qN/` + 1)-th interval. Algorithm 1 shows the pseudo-code of lossy counting. The estimated number of symbol pairs in the hash table is O(`) [22], resulting in O(` log `) bits consumed by the hash table. 4.1 Algorithm 1 Lossy counting. H: hash table, N : length of an input string at a time point, `: length of each interval. Note that lossy counting can be used in step (i) in the RePair algorithm. 1: Initialize N = 0 and ∆ = 0 2: function LossyCounting(a, b) 3: N =N +1 4: if H(ab) 6= 0 then 5: H(ab) = H(ab) + 1 6: else 7: H(ab) = ∆ + 1 6 ∆ then 8: if b N` c = 9: ∆ = b N` c 10: for each symbol pair ab in H do 11: if H(ab) < ∆ then 12: Remove ab from H Re-Pair Algorithms in Constant Space We now present two ideas to make Re-Pair scalable without seriously deteriorating its compression performance. Our first idea is to modify the Re-Pair algorithm to identify topk frequent symbol pairs in all rows scgi in step (i) and replace all the occurrences of the top-k symbol pairs in all rows scgi in step (ii), generating new k grammar rules and new rows sc+1 gi . This new replacement process improves scalability by reducing the number of iterations required by roughly a factor of k. Since we cannot replace both frequent symbol pairs ab and bc in triples abc in step (ii), we replace the first appearing symbol pair ab, preferentially. However, such preferential replacement can generate a replacement of a pair only once and can add redundant rules to a dictionary, adversely affecting compression performance. To overcome this problem, we replace the first and second appearances of each frequent pair at the same time and replace the next successive appearance of the frequent pair as usual, which guarantees generating grammar rules that appear at least twice. Our second idea is to reduce the memory of the hash table by removing infrequent symbol pairs. Since our modified Re-Pair algorithm can work storing compressed sequences scgi at each iteration c in a secondary storage device, the hash table consumes most of the memory in execution. Our modified Re-Pair generates grammar rules from only top-k frequent symbol pairs in the hash table, which means only frequent symbol pairs are expected to contribute to the compression. Thus, we remove infrequent symbol pairs from the hash table by leveraging the idea behind stream mining techniques originally proposed in [15, 6, 22] for finding frequent items in data stream. Our method is a counter-based algorithm that computes the frequency of each symbol pair and removes infrequent ones from the hash table at each interval in step (i). We present two Re-Pair algorithms using lossy counting and frequency counting for removing infrequent symbol pairs from the hash table. We shall refer to the Re-Pair algorithms using lossy counting and frequency counting as Lossy-Re-Pair and Freq-Re-Pair, respectively. 4.2 Lossy-Re-Pair The basic idea of lossy counting is to divide a sequence of symbols into intervals of fixed length and keep symbol pairs in successive intervals in accordance with their appearance frequencies in a hash table. Thus, if a symbol pair has appeared h times in the previous intervals, it is going to be kept in the next h successive intervals. Let us suppose a sequence of integers made by concatenating all rows sgi of X and let N be the length of the sequence. We divide the sequence into intervals of fixedlength `. Thus, the number of intervals is N/`. We use hash table H for counting the appearance frequency of each symbol pair in the sequence. If symbol pair ab has count H(ab), it is ensured that ab is kept in hash table H until the next H(ab)-th interval. If symbol pair ab first appears in 4.3 Freq-Re-Pair The basic idea of frequency counting is to place a limit, v, on the maximum number of symbol pairs in hash table H and then keep only the most frequent v symbol pairs in H. Such frequently appearing symbol pairs are candidates to be replaced by new non-terminals, which generates a small number of rules. The hash table counts the appearance frequency for each symbol pair in step (i) of the Re-Pair algorithm. When the number of symbol pairs in the hash table reaches v, FreqRe-Pair removes the bottom  percent of symbol pairs with respect to frequency. We call  the vacancy rate. Algorithm 2 shows the pseudo-code of frequency counting. The space consumption of the hash table is O(v log v) bits. Algorithm 2 Frequency counting. H: hash table, |H|: number of symbol pairs in H, v: the maximum number of symbol pairs in H, : vacancy rate. Note that frequency counting can be used in step (i) in the Re-Pair algorithm. 1: function FrequencyCounting(a, b) 2: if H(ab) 6= 0 then 3: H(ab) = H(ab) + 1 4: else 5: if |H| ≥ v then 6: while v(1 − /100) < |H| do 7: for each symbol pair a0 b0 in H do 8: H(a0 b0 ) = H(a0 b0 ) − 1 9: if H(a0 b0 ) = 0 then 10: Remove a0 b0 from H 11: H(ab) = 1 5. DIRECT ACCESS TO ROW AND COLUMN In this section, we present algorithms for directly accessing rows and columns of a grammar-compressed data matrix, which is essential for us to be able to apply PLS on the compressed matrix in order to learn linear regression models. 5.1 Access to Row Accessing the i-th row corresponds to recovering the original si from grammar-compressed scgi . We compute this operation by traversing the grammar trees. For recovering the i-th row si , we start traversing the grammar tree having a node of the q-th symbol scgi [q] as a root for each q from 1 to |scgi |. Leaves encountered in the traversal must have integers in sequence sgi , which allows us to recover sgi via tree traversals, starting from the nodes with non-terminal scgi [q] for each q ∈ [1, |scgi |]. We recover the original i-th row si from sgi by cumulatively adding integers in sgi from 1 to |sgi |, i.e, si [1] = sgi [1], si [2] = sgi [2] + si [1],...,si [|sgi |] = sgi [|sgi |] + si [|sgi | − 1]. 5.2 Access to Column Accessing the j-th column of a grammar-compressed data matrix requires us to obtain a set of row identifiers R such that xij = 1 for i ∈ [1, n], i.e., R = {i ∈ [1, n]; xij = 1}. This operation enables us to compute the transpose X| from X in compressed format, which is used in the optimization algorithm of PLS. P [Zi ] stores a summation of terminal symbols as integers at the leaves under the node corresponding to terminal symbol Zi in a grammar tree. For example, in Figure 1, P [Z1 ] = 3, P [Z2 ] = 6, P [Z3 ] = 8 and P [Z4 ] = 4. P can be implemented as an array that is randomly accessed from a given non-terminal symbol. We shall refer to P as the weight array. The size of P depends only on the grammar size. The j-th column is accessed to check whether or not xij = 1 in compressed sequence scgi , for each i ∈ [1, n]. We efficiently solve this problem on grammar-compressed data matrix by using the weight array P . Let uq store the summation of weights from the first symbol scgi [1] to the q-th symbol scgi [q], i.e., uq = P [scgi [1]] + P [scgi [2]] + · · · + P [scgi [q]], and let u0 = 0. If uq is not less than j, the grammar tree with the node corresponding to a symbol scgi [q] as a root can encode j at a leaf. Thus, we traverse the tree in depth-first order from the node corresponding to symbol scgi [q] as follows. Suppose Z = scgi [q] and u = uq−1 . Let Z` (resptively Zr ) be a (respectively b) of Z → ab in D. (i) if j < u, we go down to the left child in the tree; (ii) otherwise, i.e., j ≥ u, we add P [Z` ] to u and go down to the right child. We continue the traversal until we reach a leaf. If s = j at a leaf, this should be xij = 1 at row i; thus we add i to solution set R. Algorithm 3 shows the pseudo-code for column access. 6. CPLS In this section we present our cPLS algorithm for learning PLS on grammar-compressed data matrices. We first review the PLS algorithm on uncompressed data matrices. NIPALS [35] is the conventional algorithm for learning PLS and requires the deflation of the data matrix involved. We thus present a non-deflation PLS algorithm for learning PLS on compressed data matrices. 6.1 NIPALS Let us assume a collection of n data samples and their output variables (x1 , y1 ), (x2 , y2 ), ..., (xn , yn ) where yiP ∈ <. The output variables are assumed to be centralized as n i=1 yi = Algorithm 3 Access to the j-th column on grammarcompressed data matrix. R: solution set of row identifiers i at column j s.t. xij = 1. 1: function AccessColumn(j) 2: for i in 1..n do 3: u0 = 0 4: for q in 1..|scgi | do c 5: uq = uq−1 + P [Sgi [q]] 6: if j ≤ uq then 7: Recursion(i, j, scgi [q], uq−1 ) 8: break 1: function Recursion(i,j,Z,u) 2: if Z is a terminal symbol then 3: if u + Z = j then 4: Add i to R 5: return 6: Set Zl (resp. Zr ) as a (resp. b) of Z → ab in D 7: if u + P [Zl ] > j then 8: Recursion(i,j,Zl ,u) . Go to left child 9: else 10: Recursion(i,j,Zr ,u + P [Zl ]) . Go to right child 0. Denote by y ∈ <n the vector of all the training output variables, i.e., y = (y1 , y2 , ..., yn )| . The regression function of PLS is represented by the following special form, f (x) = m X αi wi| x, i=1 where the wi are weight vectors reducing the dimensionality of x; they satisfy the following orthogonality condition:  1 i=j wi| X| Xwj = . (1) 0 i 6= j We have two kinds of variables wi and αi to be optimized. Denote by W ∈ <d×m the weight matrix i-th column of which is weight vector wi , i.e., W = (w1 , w2 , ..., wm ). Let α ∈ <m be a vector whose i-th element is αi , i.e., α = (α1 , α2 , ..., αm )| . Typically, W is first optimized and then α is determined by minimizing the least squares error without regularization, min ||y − XWα||22 . α (2) By computing the derivative of equation (2) with respect to α and setting it to zero, α is obtained as follows: α = (W| X| XW)−1 W| X| y. (3) The weight vectors are determined by the following greedy algorithm. The first vector w1 is obtained by maximizing the squared covariance between the mapped feature Xw and the output variable y as follows: w1 = argmaxw cov 2 (Xw, y), subject to w| X| Xw = 1, where cov(Xw, y) = y | Xw. The problem can be analytically solved as w1 = X| y. For the i-th weight vector, the same optimization problem is solved with additional constraints to maintain orthogonality, wi = argmax cov 2 (Xw, y), (4) w subject to w| X| Xw = 1, w| X| X| wj = 0, j = 1, ..., i − 1. The optimal solution of this problem cannot be obtained analytically, but NIPALS solves it indirectly. Let us define the i-th latent vector as ti = Xwi . The optimal latent vectors ti are obtained first and the corresponding wi is obtained later. NIPALS performs the deflation of design matrix X to ensure the orthogonality between latent components ti as follows, X = X − ti t|i X. Then, the optimal solution has the form, wi = X| y. Due to the deflation, X = X − ti t|i X, NIPALS completely destroys the structure of X. Thus, it cannot be used for learning PLS on grammar-compressed data matrices. 6.2 cPLS Algorithm We present a non-deflation PLS algorithm for learning PLS on grammar-compressed data matrices. Our main idea here is to avoid deflation by leveraging the connection between NIPALS [35] and the Lanczos method [18] which was originally proposed for recursive fitting of residuals without changing the structure of a data matrix. We define residual ri+1 = (ri − (y | ti−1 )ti−1 ) that is initialized as r1 = y. The i-th weight vector is updated as wi = X| (ri−1 − (y | ti−1 )ti−1 ), which means wi can be computed without deflating the original data matrix X. The i-th latent vector is computed as ti = Xwi and is orthogonalized by applying the Gram-Schmidt orthogonalization to the i-th latent vector ti and previous latent vectors t1 ,t2 ,...,ti−1 as follows, ti = (I−Ti−1 T|i−1 )Xwi , where Ti−1 = (t1 , t2 , ..., ti−1 ) ∈ <n×(i−1) . The non-deflation PLS algorithm updates the residual ri instead of deflating X, thus enabling us to learn PLS on grammar-compressed data matrices. cPLS is the non-deflation PLS algorithm that learns PLS on grammar-compressed data matrices. The input data matrix is grammar-compressed and then the PLS is learned on the compressed data matrix by the non-deflation PLS algorithm. Our grammar-compressed data matrix supports row and column accesses directly on the compressed format for computing matrix calculations of addition and multiplication, which enables us to learn PLS by using the nondeflation PLS algorithm. Let XG be the grammar-compressed data matrix of X. Algorithm 4 shows the pseudo-code of cPLS. Since our grammar-compression is lossless, the cPLS algorithm on grammar-compressed data matrices learns the same model as the non-deflation PLS algorithm on uncompressed data matrices and so achieves the same prediction accuracy. Algorithm 4 The cPLS algorithm. XG : the grammarcompressed data matrix of X. 1: r1 = y 2: for i = 1, ..., m do 3: wi = X|G ri . access to column 4: if i = 1 then 5: t1 = XG wi . access to row 6: else 7: ti = (I − Ti−1 T|i−1 )XG wi . access to row 8: ti = ti /||ti ||2 9: ri+1 = ri − (y | ti )ti 10: Compute the coefficients α using equation (3). We perform feature extraction after line 3 at each iteration in Algorithm 4. The features corresponding to the top-u largest weights wi are extracted. Due to the orthogonality condition (1), the extracted features give users a novel insight for analyzing data, which is shown in Section 7. The cPLS algorithm has three kinds of variables to be optimized: wi , ri , and ti . The memory for wm is O(md) and the memory for tm and ri is O(mn). Thus, the total memory for the variables in cPLS is O(m min(n, d)) highly depending on parameter m. The parameter m controls the amount of fitting of the model to the training data and is typically chosen to optimize the cross validation error. Since the cPLS algorithm learns the model parameters efficiently, m can be set to a small value, which results in overall spaceefficiency. 7. EXPERIMENTS In this section, we demonstrate the effectiveness of cPLS with massive datasets. We used five datasets, as shown in Table 2. ”Book-review” consists of 12,886,488 book reviews in English from Amazon [24]. We eliminated stop-words from the reviews and then represented them as 9,253,464 dimensional fingerprints, where each dimension of the fingerprint represents the presence or absence of a word. ”Compound” is a dataset of 42,682 chemical compounds that are represented as labeled graphs. We enumerated all the subgraphs of at most 10 vertices from the chemical graphs by using gSpan [38] and then converted each chemical graph into a 52,099 dimensional fingerprint, where each dimension of the fingerprint represents the presence or absence of a chemical substructure. ”Webspam” is a dataset of 16,609,143 fingerprints of 350,000 dimensions2 . ”CP-interaction” is a dataset of 216,121,626 compound-protein pairs, where each compound-protein pair is represented as a 3,621,623 dimensional fingerprint and 300,202 compound-protein pairs are interacting pairs according to the STITCH database [17]. We used the above four datasets for testing the binary classification ability. ”CP-intensity” consists of 1,329,100 compoundprotein pairs represented as 682,475 dimensional fingerprints, where the information about compound-protein interaction intensity was obtained from several chemical databases (e.g., ChEMBL, BindingDB and PDSP Ki). The intensity was observed by IC50 (half maximal (50%) inhibitory concentration). We used the ”CP-intensity” dataset for testing the regression ability. The number of all the nonzero dimensions in each dataset is summarized in the #nonzero column in Table 2, and the size for storing fingerprints in memory by using 32bits for each element is written in the memory column in Table 2. We implemented all the methods by C++ and performed all the experiments on one core of a quad-core Intel Xeon CPU E5-2680 (2.8GHz). We stopped the execution of each method if it had not finished within 24hours in the experiments. In the experiments, cPLS did not use a secondary storage device for compression, i.e., cPLS compressed data matrices by loading all data in memory. 7.1 Compression Ability and Scalability First, we investigated the influence on compression performance of the top-k parameter in our Re-Pair algorithms. For this setting, we used the Lossy-Re-Pair algorithm, where parameter ` is set to the total length of all rows in an input data matrix in order to keep all the symbols in the hash table. We examined k = {1 × 104 , 2.5 × 104 , 5 × 104 , 7.5 × 104 , 10 × 104 } for the Book-review, Compound and Webspam datasets and examined k = {1 × 105 , 2.5 × 105 , 5 × 105 , 7.5 × 105 , 10 × 105 } for the CP-interaction and CP-intensity datasets. 2 The dataset is downloadable from http://www.csie.ntu. edu.tw/˜cjlin/libsvmtools/datasets/binary.html. 2e+04 4e+04 6e+04 Top−k 8e+04 2e+04 4e+04 6e+04 Top−k 8e+04 1e+05 2e+04 4e+04 6e+04 Top−k 8e+04 1e+05 1000 ● ● ● ● ● 6600 6800 7000 7200 7400 7600 7800 Compression Time (sec) ● ● Compression Size (MB) 400 600 800 ● 200 ● Compression Size (MB) Compression Time (sec) 0 ● 60000 70000 80000 Compression Time (sec) ● 50000 ● ● Compression Size (MB) 4800 5000 5200 5400 ● CP-intensity Compression Size (MB) Compression Time (sec) 4600 25000 10000 ● Compression Size (MB) 800 1000 1200 1400 ● Memory (mega bytes) 2,665 3,489 4,977 125,243 110,111 CP-interaction Compression Size (MB) Compression Time (sec) 600 ● ● 15000 20000 Compression Time (sec) 1000 60000 1e+05 Compression Size (MB) 400 600 800 ● ● 200 ● Webspam Compression Size (MB) Compression Time (sec) 0 ● ● 30000 40000 50000 Compression Time (sec) ● 20000 1000 Compound Compression Size (MB) Compression Time (sec) 1200 Compression Size (MB) 1400 1600 1800 2000 Book-review Table 2: Summary of datasets. Number Dimension #nonzeros 12,886,488 9,253,464 698,794,696 42,682 52,099,292 914,667,811 350,000 16,609,143 1,304,697,446 216,121,626 3,621,623 32,831,736,508 1,329,100 682,475 28,865,055,991 10000 15000 20000 25000 30000 35000 Compression Time (sec) Label type binary binary binary binary real Dataset Book-review Compound Webspam CP-interaction CP-intensity 2e+05 4e+05 6e+05 Top−k 8e+05 1e+06 2e+05 4e+05 6e+05 Top−k 8e+05 1e+06 Figure 2: Compression size in mega bytes (MB) and compression time in seconds (sec) for various top-k Figure 2 shows compression size and compression time for various top-k. We observed a trade-off between compressed size and compression time for all the datasets. The smaller the compressed size, the larger the compression time for larger values of k. In particular, significantly faster compression time was possible at the cost of only slightly worse compression. For example, Lossy-Re-Pair took 57,290 seconds to compress the Book-review dataset and its size was 1,498 mega bytes (MB) for k=10000. When k=100000, compression time dropped to 20,004 seconds (less than half), while compressed size increased negligibly to 1,502MB. The same trends for the Book-review dataset were observed in the other datasets, which suggests that in practice a large value of k can be chosen for fast compression, without adversely affecting compression performance. Notably, we observed our compression method to be particularly effective for the larger datasets: CP-interaction and CP-intensity. The original sizes of CP-interaction and CPintensity were 125GB and 110GB, respectively, while the compressed sizes of CP-interaction and CP-intensity were at most 5GB and at 535MB, respectively. Our compression method thus achieved compression rates of 4% and less than 1% for CP-interaction and CP-intensity, respectively. Such significant reductions in data size enable the PLS algorithm to scale to massive data. Next, we evaluated the performance of Lossy-Re-Pair and Freq-Re-Pair, where parameters `={1MB, 10MB, 100MB, 1000MB} were examined for Lossy-Re-Pair, and parameters v ={1MB, 10MB, 100MB, 1000MB} and  = {30} were examined for Freq-Re-Pair. Table 3 shows the compressed size, compression time and the working space used for the hash table in Lossy-Re-Pair and Freq-Re-Pair. We observed that both Lossy-Re-Pair and Freq-Re-Pair achieved high compression rates using small working space. Such efficiency is crucial when the goal is to compress huge data matrices that exceed the size of RAM; our Re-Pair algorithm can compress data matrices stored in external memory (disk). For compressing the CP-interaction dataset, Lossy-Re-Pair and Freq-Re-Pair consumed 16GB and 13GB, respectively, achieving a compressed size of 5GB. We observed the same tendency for the other datasets (See Table 3). 7.2 Prediction Accuracy We evaluated the classification and regression capabilities of cPLS, PCA-SL, bMH-SL and SGD. Following the previous works [39, 21], we randomly selected 20% of samples for testing and used the remaining 80% of samples for training. cPLS has one parameter m, so we selected the best parameter value among m = {10, 20, ..., 100} that achieved the highest accuracy for each dataset. The PCA phase of PCASL has one parameter deciding the number of principal components m, which was chosen from m = {10, 25, 50, 75, 100} whose maximum value of 100 is the same as that of cPLS’s parameter m. Linear models were learned with LIBLINEAR [10], one of the most efficient implementations of linear classifiers, on PCA’s compact feature vectors, where the hinge loss of linear SVM for classification and the squared error loss for regression were used with L2 -regularization. The learning process of PCA-SL [14, 9] has one parameter C for L2 -regularization, which was chosen from C = {10−5 , 10−4 , ..., 105 }. For PCA-SL [14, 9], we examined all possible combinations of two parameters (m and C) and selected the best combination achieving the highest accuracy for each dataset. The hashing process of bMH-SL [21] has two parameters (the number of hashing values h and the length of bits b), so we examined all possible combinations of h = {10, 30, 100} and b = {8, 16}. As in PCA-SL, linear models were learned with LIBLINEAR [10] on bMH’s compact feature vectors, where the hinge loss of linear SVM for classification and the squared error loss for regression were used with L2 regularization. The learning process of bMH-SL [21] has one parameter C for L2 -regularization, which was chosen from C = {10−5 , 10−4 , ..., 105 }. For bMH-SL, we examined all possible combinations of three parameters (h, b, and C) and selected the best combination achieving the highest accuracy for each dataset. We implemented SGD on the basis of the AdaGrad algorithm [8] using the logistic loss for classification and the squared error loss for regression with L2 -regularization. SGD [8] has one parameter C for L2 -regularization, which was also chosen from C = {10−5 , 10−4 , ..., 105 }. We measured the prediction accuracy by the area under the ROC curve (AUC) for classification and Pearson correlation coefficient (PCC) for regression. Note that AUC and PCC return 1 for perfect inference in classification/regression, while AUC returns 0.5 for random inference and PCC returns 0 for random inference. We report the best test accuracy under the above experimental settings for each method below. Table 3: Compression size in mega bytes (MB), compression time in seconds (sec), and working space for hash table (MB) for varying parameter ` in Lossy-Re-Pair and v in Freq-Re-Pair for each dataset. compression size (MB) compression time (sec) working space (MB) compression size (MB) compression time (sec) working space (MB) compression size (MB) compression time (sec) working space (MB) compression size (MB) compression time (sec) working space (MB) compression size (MB) compression time (sec) working space (MB) Book-review Lossy-RePair `(MB) Freq-RePair v(MB) 1 10 100 1000 1 10 100 1000 1836 1685 1502 1501 2021 1816 1680 1501 9904 12654 19125 20004 2956 2355 3165 21256 1113 1931 7988 8603 292 616 3856 6724 Compound Lossy-RePair `(MB) Freq-RePair v(MB) 1 10 100 1000 1 10 100 1000 1288 859 825 825 1523 1302 825 825 5096 7053 7787 7946 1362 1587 8111 8207 1113 1926 5030 5030 292 616 3535 3535 Webspam Lossy-RePair `(MB) Freq-RePair v(MB) 1 10 100 1000 1 10 100 1000 1427 948 940 940 2328 2089 1050 940 6953 10585 10584 10964 2125 2799 7712 11519 1112 1923 7075 7075 292 616 3856 5539 CP-interaction Lossy-RePair `(MB) Freq-RePair v(MB) 10 100 1000 10000 10 100 1000 10000 5199 5139 5036 20307 9529 5136 5136 24hours 55919 44853 43756 24565 39647 47230 48653 9914 16650 16635 616 3856 13796 13796 CP-intensity Lossy-RePair `(MB) Freq-RePair v(MB) 10 100 1000 10000 10 100 1000 10000 558 543 540 535 588 535 535 535 8103 6479 6494 6657 5423 5848 5859 5923 1936 3552 3722 3738 616 2477 2477 2477 Table 4: Results of cPLS, PCA-SL, bMH-SL and SGD for various datasets. Dspace: the working space for storing data matrix (MB), Ospace: the working space for optimization algorithm and Ltime: learning time (sec). cPLS Data m Dspace(MB) Ospace(MB) Ltime(sec) AUC/PCC Book-review 100 1288 15082 21628 0.96 Compound 20 786 7955 1089 0.83 Webspam 60 890 7736 4171 0.99 CP-interaction 40 4367 53885 35880 0.77 CP-intensity 60 472 10683 33969 0.67 PCA-SL Data m/C Dspace(MB) Ospace(MB) Ltime(sec) AUC/PCC Book-review 100/1 14747 110 6820 0.70 Compound 25/0.1 12 1 6 0.65 Webspam 50/1 200 2 129 0.99 CP-interaction >24hours CP-intensity 100/0.1 1521 11 42 0.11 bMH-SL Data b/h/C Dspace(MB) Ospace(MB) Ltime(sec) AUC/PCC Book-review 100/16/0.01 2457 110 1033 0.95 Compound 30/16/10 2 1 1 0.62 Webspam 30/16/10 20 2 2 0.99 CP-interaction 30/16/0.1 12366 1854 10054 0.77 CP-intensity 100/16/0.1 253 11 45 0.54 SGD Data C Dspace(MB) Ospace(MB) Ltime(sec) AUC/PCC Book-review 10 1694 57 0.96 Compound 10 9539 83 0.82 Webspam 10 3041 85 0.99 CP-interaction 1 663 3163 0.75 CP-intensity 0.1 124 280 0.04 Component1 Component2 Component3                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Component10               Component9         Component8      Component7        Component6         Component5       Component4                   Figure 3: Extracted features for the top 10 latent components in the application of cPLS to the Compound dataset. Each column represents the highly weighted features (chemical substructures) of a latent component. Table 4 shows the prediction accuracy, working space and training time of cPLS, PCA-SL, bMH-SL, and SGD. The working space for the storing data matrix and the working space needed for optimizations were separately evaluated. While PCA-SL and bMH-SL significantly reduced the working space for storing data matrices, the classification and regression accuracies were low. Since PCA-SL and bMH-SL compress data matrices without looking at the correlation structure between data and output variables for compressing data matrices, high classification and regression accuracies were difficult to achieve. SGD significantly reduced the working space, since it did not store data matrices in memory. Classification and regression accuracies of SGD were not high, because of the instability of the optimization algorithm. In addition, SGD is applicable only to simple linear models, making the learned model difficult to interpret. Our proposed cPLS outperformed the other methods (PCASL, bMH-SL, and SGD) in terms of AUC and PCC and significantly reduced the working space. The results showed cPLS’s efficiency for learning PLS on compressed data matrices while looking at the correlation structure between data and output variables. Such a useful property enables us to extract informative features from the learned model. 7.3 Interpretability Figure 3 shows the top-10 highly-weighted features that were extracted for each component in the application of cPLS to the Compound dataset, where one feature corresponds to a compound chemical substructure. It was observed that structurally similar chemical substructures were extracted together as important features in the same component, and the extracted chemical substructures differed between components. This observation corresponds to a unique property of cPLS. Analysing large-scale compound structure data is of importance in pharmaceutical applications, especially for rational drug design. For example, the extracted chemical substructures are beneficial for users who want to identify important chemical fragments involved in therapeutic drug activities or adverse drug reactions. 8. CONCLUSIONS AND FUTURE WORK We presented a scalable algorithm for learning interpretable linear models — called cPLS — which is applicable to largescale regression and classification tasks. Our method has the following appealing properties: 1. Scalability: cPLS is applicable to large numbers of high-dimensional fingerprints (see Sections 7.1 and 7.2). 2. Prediction Accuracy: The optimization of cPLS is numerically stable, which enables us to achieve high prediction accuracies (see Section 7.2). 3. Usability: cPLS has only one hyperparameter to be tuned in cross-validation experiments (see Section 6.2). 4. Interpretability: Unlike lossy compression-based methods, cPLS can extract informative features reflecting the correlation structure between data and class labels (or response variables), which makes the learned models easily interpretable (see Section 7.3). In this study, we applied our proposed grammar compression algorithm to scaling up PLS, but in principle it can be used for scaling up other machine learning methods or data mining techniques. An important direction for future work is therefore the development of scalable learning methods and data mining techniques based on grammar-compression techniques. Such extensions will open the door for machine learning and data mining methods to be applied in various large-scale data problems in research and industry. 9. ACKNOWLEDGMENTS This work was supported by MEXT/JSPS Kakenhi (24700140, 25700004 and 25700029), the JST PRESTO program, the Program to Disseminate Tenure Tracking System, MEXT and Kyushu University Interdisciplinary Programs in Education and Projects in Research Development, and the Academy of Finland via grant 294143. 10. REFERENCES [1] P. Bille, P. H. Cording, and I. L. Gortz. Compact q-gram profiling of compressed strings. In CPM, pages 62–73, 2013. [2] M Charikar, E. Lehman, D. Liu, R. Panigrahy, M. Prabhakaran, A. Sahai, and A. Shelat. The smallest grammar problem. IEEE Transactions on Information Theory, 51:2554–2576, 2005. [3] B. Chen, D. Wild, and R. Guha. PubChem as a source of polypharmacology. JCIM, 49:2044–2055, 2009. [4] The Uniprot Consortium. The universal protein resource (uniprot) in 2010. NAR, 38:D142–D148, 2010. [5] G. Cormode and Muthukrishnan S. An improved data stream summary: the count-min sketch and its applications. Journal of Algorithms, 55:58–75, 2005. [6] D. Demaine, A. López-Ortiz, and I. Munro. Frequency estimation of internet packet streams with limited space. In ESA, pages 348–360, 2002. [7] C.M. Dobson. Chemical space and biology. Nature, 432(7019):824–828, 2004. [8] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011. [9] T. Elgamal, M. Yabandeh, A. Aboulnaga, W. Mustafa, and M. Hefeeda. sPCA: Scalable principal component analysis for big data on distributed platforms. In SIGMOD, 2015. [10] R. Fan, K. W. Chang, C. J. Hsieh, X. R. Wang, and C. J. Lin. LIBLINEAR: A library for large linear classification. JMLR, pages 1871–1874, 2008. [11] D. A. Forsyth and J. Ponce. Computer Vision: A Modern Approach. Prentice Hall Professional Technical Reference, 2002. [12] A. Gionis, P. Indyk, and R. Motwani. Similarity search in high dimensions via hashing. In VLDB, 1999. [13] D. Hermelin, D. H. Landau, and O. Weimann. A unified algorithm for accelerating edit-distance computation via text-compression. In STACS, pages 529–540, 2009. [14] I. T. Jolliffe. Principal Component Analysis. Springer, 1986. [15] R. Karp, S. Shenker, and C. Papadimitriou. A simple algorithm for finding frequent elements in sets and bags. TODS, 28:51–55, 2003. [16] J. C. Kieffer, E. Yang, G. J. Nelson, and P. C. Cosman. Universal lossless compression via multilevel pattern matching. IEEE Transactions on Information Theory, 46(4):1227–1245, 2000. [17] M. Kuhn, D. Szklarczyk, A. Franceschini, M. Campillos, C. von Mering, L.J. Jensen, A. Beyer, and P. Bork. STITCH 2: An interaction network database for small molecules and proteins. NAR, 38(suppl 1):D552–D556, 2010. [18] C. Lanczos. An iteration method for the solution of the eigen value problem of linear differential and integral operators. Journal of Research of the National Bureau of Standards, 45:255–282, 1950. [19] J. Larsson and A. Moffat. Offline dictionary-based compression. In DCC, pages 296–305, 1999. [20] P. Li and A. C. König. b-bit minwise hashing. In WWW, pages 671–680, 2010. [21] P. Li, A. Shrivastava, J. L. Moore, and A. C. König. Hashing algorithms for large-scale learning. In NIPS, pages 2672–2680, 2011. [22] G. Manku and R. Motwani. Approximate frequency counts over data stream. In VLDB, volume 5, pages 346–357, 2002. [23] C. D. Manning and H. Schütze. Foundations of Statistical Natural Language Processing. The MIT Press, 1999. [24] J. McAuley and J. Leskovec. Hidden factors and hidden topics: understanding rating dimensions with review text. In RecSys, 2013. [25] Y. Mu, G. Hua, W. Fan, and S. Chang. Hash-SVM: Scalable kernel machines for large-scale visual classification. In CVPR, pages 979–986, 2014. [26] R. Rosipal and N. Krämer. Overview and recent advances in partial least squares. In Subspace, Latent Structure and Feature Selection, LNCS, pages 34–51. Springer, 2006. [27] W. Rytter. Application of Lempel-Ziv factorization to the approximation of grammar-based compression. TCS, 302(1–3):211–222, 2003. [28] B. Schölkopf, A. Smola, and K. R. Müller. Nonlinear component analysis as a kernel eigenvalue problem. Neural Computation, 10:1299–1319, 1998. [29] B. Stockwell. Chemical genetics: Ligand-based discovery of gene function. Nature Reviews Genetics, 1:116–125, 2000. [30] Y. Tabei and Y. Yamanishi. Scalable prediction of compound-protein interactions using minwise-hashing. BMC Systems Biology, 7:S3, 2013. [31] M. E. Tipping and C. M. Bishop. Mixtures of probabilistic principal component analysers. Neural Computation, 11:443–482, 1999. [32] R. Todeschini and V. Consonni. Handbook of Molecular Descriptors. Wiley-VCH, 2002. [33] Y. Tsuruoka, J. Tsujii, and S. Ananiadou. Stochastic gradient descent training for l1-regularized log-linear models with cumulative penalty. In ACL and AFNLP, pages 477–485, 2009. [34] K. Weinberger, A. Dasgupta, J. Langford, A. Smola, and J. Attenberg. Feature hashing for large scale multitask learning. In ICML, pages 1113–1120, 2009. [35] H. Wold. Path models with latent variables: The NIPALS approach. In Quantitative Sociology: International Perspectives on Mathematical and Statistical Model Building, pages 307–357. Academic Press, 1975. [36] S. Wold, M. Sjöström, and L. Eriksson. PLS-regression: a basic tool of chemometrics. Chemometrics and Intelligent Laboratory Systems, 58:109–130, 2001. [37] T. Yamamoto, H. Bannai, S. Inenaga, and M. Takeda. Faster subsequence and don’t-care pattern maching on compressed texts. In CPM, pages 309–322, 2011. [38] X. Yan and J. Han. gSpan: graph-based substructure pattern mining. In ICDM, pages 721–724, 2002. [39] H.F. Yu, C.J. Hsieh, K.W. Chang, and C.J. Lin. Large linear classification when data cannot fit in memory. In KDD, pages 833–842, 2010.
8cs.DS
Noname manuscript No. (will be inserted by the editor) Stochastic Greedy Algorithms For Multiple Measurement Vectors arXiv:1711.01521v1 [math.OC] 5 Nov 2017 Jing Qin · Shuang Li · Deanna Needell · Anna Ma · Rachel Grotheer · Chenxi Huang · Natalie Durgin Received: date / Accepted: date Abstract Sparse representation of a single measurement vector (SMV) has been explored in a variety of compressive sensing applications. Recently, SMV models have been extended to solve multiple measurement vectors (MMV) problems, where the underlying signal is assumed to have joint sparse structures. To circumvent the NP-hardness of the `0 minimization problem, many deterministic MMV algorithms solve the convex relaxed models with limited efficiency. In this paper, we develop stochastic greedy algorithms for solving the joint sparse MMV reconstruction problem. In particular, we propose the MMV Stochastic Iterative Hard Thresholding (MStoIHT) and MMV Stochastic Gradient Matching Pursuit (MStoGradMP) algorithms, and we also utilize the mini-batching technique to further improve their performance. Convergence analysis indicates that the proposed algorithms are able to converge faster than Jing Qin was supported by the faculty start-up fund from Montana State University. Shuang Li was supported by NSF CAREER grant CCF-1149225. Deanna Needell was partially supported by the Alfred P. Sloan Foundation, NSF CAREER #1348721, and NSF BIGDATA #1740325. Jing Qin Department of Mathematical Sciences Montana State University Bozeman, MT 59717. E-mail: [email protected] Shuang Li Department of Electrical Engineering Colorado School of Mines Golden, CO 80401. Deanna Needell Department of Mathematics University of California, Los Angeles Los Angeles, CA 90095. Anna Ma Department of Mathematics Claremont Graduate University Claremont, CA 91711. Rachel Grotheer Center for Data, Mathematical, and Computational Sciences Goucher College Baltimore, MD 21204. Chenxi Huang Center for Outcomes Research and Evaluation Yale University New Haven, CT 06511. Natalie Durgin Spiceworks, Austin, TX, 78746. 2 Jing Qin et al. their SMV counterparts, i.e., concatenated StoIHT and StoGradMP, under certain conditions. Numerical experiments have illustrated the superior effectiveness of the proposed algorithms over their SMV counterparts. Keywords Multiple measurement vectors (MMV) · stochastic iterative hard thresholding (StoIHT) · stochastic gradient matching pursuit (StoGradMP) · joint sparse signal recovery PACS 02.70.-c · 02.60.-x · 87.19.le Mathematics Subject Classification (2010) 65K10 · 94A12 · 94A08 1 Introduction Reconstruction of sparse signals from limited measurements has been studied extensively with a variety of applications in various imaging sciences, machine learning, computer vision and so on. The major problem is to reconstruct a signal which is sparse by itself or in some transformed domain from a few measurements (or observations) acquired by a certain sensing machine. Let x ∈ Rn be the signal to be reconstructed. Then the sparse signal reconstruction problem can be formulated as an `0 constrained minimization problem minn F (x), s.t. kxk0 ≤ k, (1) x∈R where the sparsity kxk0 counts nonzeros in x. Here F (x) is a loss function measuring the discrepancy between the acquired measurements y ∈ Rm (m  n) and the measurements predicted by the estimated solution. In particular, if the measurements are linearly related to the underlying signal, i.e., there exists a sensing matrix A ∈ Rm×n such that y = Ax + n where n is the Gaussian noise, then the least squares loss function is widely used: 1 2 F (x) = ky − Axk2 . 2 In this case, (1) is a single measurement vector (SMV) sparse signal reconstruction problem. The choice of F depends on the generation mechanism of the measurements. Since the measurements are typically generated continuously in most imaging techniques, it becomes significantly important in practice to reconstruct a collection of sparse signals, expressed as a signal matrix, from multiple measurement vectors (MMV). More precisely, the signal matrix X ∈ Rn×L with k (k ≤ n) nonzero rows can be obtained by solving the following MMV model min F (X), X∈Rn×L s.t. kXkr,0 ≤ k, (2) where kXkr,0 stands for the row-sparsity of X which counts nonzero rows in X. Note that it is possible that certain columns of X have more zero components than zero rows of X. The MMV sparse reconstruction problem was first introduced in magnetoencephalography (MEG) imaging [1, 2], and has been extended to other applications [3, 4, 5, 6, 7, 8, 9]. Many SMV algorithms can be applied to solve MMV problems. The most straightforward way is to use SMV algorithms to reconstruct each signal vector sequentially or simultaneously via parallel computing, and then concatenate all resultant signals to form the estimated signal matrix. We call these types of SMV algorithms, concatenated SMV algorithms. On the other hand, the MMV problem can be converted to an SMV one by columnwise stacking the unknown signal matrix X as a vector and introducing a block diagonal matrix as the new sensing matrix A. However, both approaches do not fully take advantage of the joint sparse structure of the underlying signal matrix, and lack computational efficiency as well. In this paper, we develop MMV algorithms without concatenation of the SMV results or vectorization of the unknown signal matrix. Since the `0 term in (1) and (2) is non-convex and non-differentiable, many classical convex optimization algorithms fail to produce a satisfactory solution. To handle the NP-hardness of the problem, many convex relaxation methods and their MMV extensions have been developed, e.g., the `2 -regularized Stochastic Greedy Algorithms For Multiple Measurement Vectors 3 M-FOCUSS [1], and the `1 -regularized MMV extensions of the alternating direction method of multipliers [10, 11]. By exploiting the relationship between the measurements and the correct atoms, multiple signal classification (MUSIC) [12] and its improved variants [13, 14] have been developed. However, in the rank defective cases when the rank of the measurement matrix Y is much smaller than the desired row-sparsity level, the MUSIC type of methods will mostly fail to identify the correct atoms. The third category of algorithms for solving the `0 constrained problem is the class of greedy algorithms that seek the sparsest solution by updating the support iteratively, including Orthogonal Matching Pursuit (OMP) [15], simultaneous OMP (S-OMP) [16, 17], Compressive Sampling Matching Pursuit (CoSaMP) [18], Regularized OMP (ROMP) [19], Subspace-Pursuit (SP) [20], and Iterative Hard-Thresholding (IHT) [21]. It has been shown that CoSaMP and IHT are more efficient than the convex relaxation methods with strong recovery guarantees. However, most of these algorithms work for compressive sensing applications where F is a least squares loss function. Recently, the Gradient Matching Pursuit (GradMP) [22] has been proposed to extend CoSaMP to handle more general loss functions. To further improve the computational efficiency and consider the non-convex objective function case, Stochastic IHT (StoIHT) and Stochastic GradMP (StoGradMP) have been proposed [23]. Nevertheless, the aforementioned greedy algorithms are designed for solving the SMV problem and the concatenated extension to the MMV versions will result in limited performance especially for large data sets. In this paper, we propose the MMV Stochastic IHT (MStoIHT) and the MMV Stochastic GradMP (MStoGradMP) methods for solving the general MMV joint sparse recovery problem (2). To accelerate convergence, the mini-batching technique is applied to the proposed algorithms. We also show that the proposed algorithms converge faster than their SMV concatenated counterparts under certain conditions. A large variety of numerical experiments on joint sparse matrix recovery and video sequence recovery have demonstrated the superior performance of the proposed algorithms over their SMV counterparts in terms of running time and accuracy. Organization. The rest of the paper is organized as follows. Preliminary knowledge and notation clarifications are provided in Section 2. Section 3 presents the concatenated SMV algorithms, and the proposed stochastic greedy algorithms, i.e., MStoIHT and MStoGradMP, in detail. Section 4 discusses how to apply the mini-batching technique to accelerate the proposed algorithms. Convergence analysis is provided in Section 5. By choosing the widely used least squares loss function as F , joint sparse signal recovery in distributed compressive sensing is discussed in Section 6. Extensive numerical results are shown in Section 7. Finally, some concluding remarks are made in Section 8. 2 Preliminaries To make the paper self-contained, we first introduce some useful notation and definitions, and then briefly describe the related algorithms, i.e., StoIHT and StoGradMP. Let [m] = {1, 2, . . . , m} and |Ω| be the number of elements in the set Ω. Consider a finite atom set D = {d1 , . . . , dN } (a.k.a. the dictionary) with each atom di ∈ Rn . 2.1 Vector Sparsity Assume that a vector x ∈ Rn can be written as a linear combination of di ’s, i.e., x = with   D = d1 · · · dN , α = (α1 , . . . , αN )T . Then the support of x with respect to α and D is defined by suppα,D (x) = {i ∈ [N ] : αi 6= 0} := supp(α). The `0 -norm of x with respect to D is defined as the minimal support size X kxk0,D = min{|T | : x = αi di , T ⊆ [N ]} = min | suppα,D (x)|. α i∈T α PN i=1 αi di = Dα 4 Jing Qin et al. Since absolute homogeneity does not hold in general, i.e., kγxk0,D = |γ| kxk0,D holds if and only if |γ| = 1, this `0 -norm is not a norm. Here the smallest support suppα,D (x) is called the support of x with respect to D, denoted by suppD (x). Thus | suppD (x)| = kxk0,D . Note that the support may not be unique if D is over-complete in that there could be multiple representations of x with respect to the atom set D due to the linear dependence of the atoms in D. The vector x is called k-sparse with respect to D if kxk0,D ≤ k. 2.2 Matrix Sparsity By extending vector sparsity, we define the row sparsity for a matrix X ∈ Rn×L as follows kXkr,0,D = min{|Ω| : Ω = Ω L [ suppD (X·,i )}, i=1 where X·,i is the i-th column of X. Here the minimal common support Ω is called the (row-wise) joint support of X with respect to D, denoted by supprD (X), which satisfies | supprD (X)| = kXkr,0,D . The matrix X is called k-row sparse with respect to D if all columns of X share a joint support of size at most k with respect to D, i.e., kXkr,0,D ≤ k. 2.3 Functions Defined on A Matrix Space Given a function f : Rn×L → R, the matrix derivative is defined by concatenating gradients [24]     ∂f ∂f = = ∇X·,1 f · · · ∇X·,L f , ∂X ∂Xi,j n×L (3) where Xi,j is the (i, j)-th entry of X. Notice that 2 kXkF = n X 2 kXi,· k2 = L X 2 kX·,j k2 = Tr(X T X), j=1 i=1 where Xi,· is the i-th row vector of X, and Tr(·) is the trace operator to add up all the diagonal entries of a matrix. The inner product for any two matrices U, V ∈ Rn×L is defined as hU, V i = Tr(U T V ). Note that the equality 2 2 2 kU + V kF = kU kF + kV kF + 2hU, V i (4) and the Cauchy-Schwartz inequality hU, V i ≤ kU kF kV kF (5) still hold. By generalizing the concepts in [23], we define the D-restricted strong convexity property and the strong smoothness property (a.k.a. the Lipschitz condition on the gradient) for the functions defined on a matrix space. Stochastic Greedy Algorithms For Multiple Measurement Vectors 5 Definition 1 The function f : Rn×L → R satisfies the D-restricted strong convexity (D-RSC) if there exists ρ− k > 0 such that f (X 0 ) − f (X) − E ρ− 2 (X), X 0 − X ≥ k kX 0 − XkF ∂X 2 D ∂f (6) for all matrices X 0 , X ∈ Rn×L with | supprD (X) ∪ supprD (X 0 )| ≤ k. Definition 2 The function f : Rn×L → R satisfies the D-restricted strong smoothness (D-RSS) if there exists ρ+ k > 0 such that ∂f ∂f 0 (X) − (X 0 ) ≤ ρ+ (7) k kX − X kF ∂X ∂X F for all matrices X 0 , X ∈ Rn×L with | supprD (X) ∪ supprD (X 0 )| ≤ k. 2.4 Related Work StoIHT (see Algorithm 1) and StoGradMP (see Algorithm 2) have been proposed to solve the `0 constrained SMV problem [23] minn x∈R M 1 X˜ fi (x), M i=1 subject to kxk0,D ≤ k. (8) At each iteration of StoIHT, one component function f˜i is first randomly selected with probability p(i). Here the input discrete probability distribution p(i)’s satisfy M X and p(i) ≥ 0, i = 1, . . . , M. p(i) = 1, i=1 Next in the “Proxy” step, gradient descent along the selected component is performed. Then the last two steps, i.e., “Identify” and “Estimate”, essentially project the gradient descent result to its best k-sparse approximation. Given w = (w1 , . . . , wn )T and η ≥ 1, the best k-sparse approximation operator acted on w and η, denoted by approxk (w, η), constructs an index set Γ with |Γ | = k such that kPΓ w − wk2 ≤ η w − w(k) 2 where w(k) = argmin kw − yk2 . y∈R(DΓ ) |Γ |≤k Here PΓ w is the orthogonal projection of w onto the subspace R(DΓ ) in Rn spanned by the atoms with indices in Γ , and w(k) is the best k-sparse approximation of w in the subspace R(DΓ ). In particular, if η ≥ 1 and D = {ei : i = 1, 2, . . . , n} with ei = [0, . . . , 1 , . . . , 0]T , then approxk (w, η) returns the index (i) set of the first k largest entries of w in absolute value, i.e., approxk (w, 1) = {i1 , i2 , . . . , ik : |wi1 | ≥ . . . ≥ |wik | ≥ . . . ≥ |win |} := Γb. Then the projection PΓ w reads as in componentwise form (  wj if j ∈ Γb, PΓb (w) j = 0 if j ∈ / Γb. There are two widely used stopping criteria: xt+1 − xt kxt k2 2 < ε, and M 1 X˜ t fi (x ) < ε, M i=1 6 Jing Qin et al. Algorithm 1 Stochastic Iterative Hard Thresholding (StoIHT) Input: k, γ, η, p(i), ε. b = xt . Output: x Initialize: x = 0. for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) γ ∇f˜it (xt ) Proxy: bt = xt − M p(i ) t Identify: Γ t = approxk (bt , η). Estimate: xt+1 = PΓ t (bt ). If the stopping criteria are met, exit. end for where ε > 0 is a small tolerance. It is well known that the first stopping criteria is more robust in practice. Different from StoIHT, StoGradMP involves the gradient matching process, i.e., to find the best k-sparse approximation of the gradient rather than the estimated solution. At the solution estimation step, the original problem is restricted to the components from the estimated support. It has been empirically shown that StoGradMP converges faster than StoIHT due to the more accurate estimation of the support. But StoGradMP requires that the sparsity level k is no more than n/2. Algorithm 2 Stochastic Gradient Matching Pursuit (StoGradMP) Input: k, η1 , η2 , p(i), ε. b = xt . Output: x Initialize: x0 = 0, Λ = 0. for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) Calculate the gradient rt = ∇f˜it (xt ) Γ = approx2k (rt , η1 ) Γb = Γ ∪ Λ 1 PM ˜ bt = argminx M x ∈ R(DΓ̂ ) i=1 fi (x), Λ = approxk (bt , η2 ) xt+1 = PΛ (bt ) If the stopping criteria are met, exit. end for 3 Proposed Stochastic Greedy Algorithms In this section, we present concatenated SMV algorithms, and develop stochastic greedy algorithms for MMV problems based on StoIHT and StoGradMP. Suppose that there are M differentiable and convex functions fi : Rn×L → R that satisfy the D-restricted strong smoothness property (see Definition 2), and their mean M 1 X fi (X) (9) F (X) = M i=1 satisfies the D-restricted strong convexity property (see Definition 1). These assumptions will be used extensively throughout the entire paper. Consider the following row-sparsity constrained MMV problem min X∈Rn×L M 1 X fi (X), M i=1 subject to kXkr,0,D ≤ k. (10) By vectorizing X, i.e., rewriting X as a vector x ∈ RnL by columnwise stacking, we can relax (10) to a sparsity constrained SMV problem of the form (8) where the sparsity level k is replaced by kL. Since kxk0,D ≤ kL does not necessarily guarantee kXkr,0,D ≤ k, the solution to the relaxed problem may not be the same as the vectorization of the solution to (10). On the other hand, the iterative stochastic Stochastic Greedy Algorithms For Multiple Measurement Vectors 7 algorithms such as StoIHT and StoGradMP, can be developed to the concatenated versions for solving (10) under the following assumption on the objective function fi ’s. Assumption 1. The objective function in (10) is separable, in the sense that a collection of functions gi,j : Rn → R exist with fi (X) = L X gi,j (X·,j ), i = 1, . . . , M. (11) j=1 Under this assumption, the concatenated algorithms, i.e., CStoIHT in Algorithm 3 and CStoGradMP in Algorithm 4, can be applied to solve (10), which essentially reconstruct each column of X by solving the SMV problem (8). Notice that the outer loops of CStoIHT and CStoGradMP can be executed in a parallel manner on a multi-core computer, when the order of the inner loop and the outer loop in Algorithm 3 can be swapped. However, if the sparsity level k is very large, then the support sets of X·,j ’s are prone to overlap less initially which results in the less accurate estimation of the joint support and larger errors in the initial iterates. In addition, for some nonlinear function fi (X) which can not be separated as a sum of functions for columns of X, it will be challenging to find an appropriate objective function for the corresponding SMV problem. Algorithm 3 Concatenated Stochastic Iterative Hard Thresholding (CStoIHT) Input: k, γ, η, p(i), ε. b = Xt. Output: X Initialize: X = 0 ∈ Rn×L . for j = 1, . . . , L do for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) γ t − t ) Proxy: bt = X·,j ∇git ,j (X·,j M p(i ) t Identify: Γ t = approxk (bt , η). t+1 Estimate: X·,j = PΓ t (bt ). If the stopping criteria are met, exit. end for end for Algorithm 4 Concatenated Stochastic Gradient Matching Pursuit (CStoGradMP) Input: k, η1 , η2 , p(i), ε. b = Xt. Output: X Initialize: X 0 = 0 ∈ Rn×L , Λ = 0. for j = 1, . . . , L do for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) t ) Calculate the gradient rt = ∇git ,j (X·,j t Γ = approx2k (r , η1 ) Γb = Γ ∪ Λ 1 PM bt = argminx M x ∈ R(DΓ̂ ) i=1 gi,j (x), Λ = approxk (bt , η2 ) t+1 X·,j = PΛ (bt ) If the stopping criteria are met, exit. end for end for To circumvent the aforementioned issues, we first propose the MMV Stochastic Iterative Hard Thresholding algorithm (MStoIHT) detailed in Algorithm 5. Compared to StoIHT, MStoIHT replaces the gradient by the matrix derivative (3). The second significant difference lies in the “Identify” and “Estimate” steps, especially the operator approxk (·, ·). Now we extend the operator approxk (·, ·) from sparse vectors 8 Jing Qin et al. to row-sparse matrices. Given X ∈ Rn×L and η ≥ 1, the best k-row sparse approximation operator acted on X and η, denoted by approxrk (X, η), constructs a row index set Γ such that kPΓ X·,j − X·,j k2 ≤ η kX·,j − (X·,j )k k2 , j = 1, . . . , L, where (X·,j )k is the best k-sparse approximation of the column vector X·,j with respect to D. In particular, if D = {ei : i = 1, . . . , n} and η = 1, approxrk (X, 1) returns the row index set of the first k largest `2 row norms in X, i.e., approxrk (X, 1) = {i1 , i2 , . . . , ik : kXi1 ,· k2 ≥ kXi2 ,· k2 ≥ . . . ≥ kXin ,· k2 } := Γe. By abusing the notation, we define PΓe (X) to be the projection of X onto the subspace of all row-sparse matrices with row indices restricted to Γe. Therefore, we have   PΓe X = PΓe X·,1 PΓe X·,2 . . . PΓe X·,L . Due to the common support Γe, the projection PΓe (X) can be written as in row-wise form (  Xj,· if j ∈ Γe, PΓe (X) j,· = 0 if j ∈ / Γe. Here PΓe (X) returns a k-row sparse matrix, whose nonzero rows correspond to the k rows of X with largest `2 row norms. Algorithm 5 MMV Stochastic Iterative Hard Thresholding (MStoIHT) Input: k, γ, η, p(i), ε. b = Xt. Output: X Initialize: X = 0. for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) ∂fit (X t ) γ M p(it ) ∂X Identify: Γ t = approxrk (B t , η). Estimate: X t+1 = PΓ t (B t ). Proxy: B t = X t − If the stopping criteria are met, exit. end for Next, we propose the MMV Stochastic Gradient Matching Pursuit (MStoGradMP) detailed in Algorithm 6, where the two gradient matching steps involve the operator approxrk (·, ·). The stopping criteria in all proposed algorithms can be set as the same as those in Algorithm 1 and Algorithm 2. Algorithm 6 MMV Stochastic Gradient Matching Pursuit (MStoGradMP) Input: k, η1 , η2 , p(i), ε. b = Xt. Output: X Initialize: X 0 = 0, Λ = 0. for t = 1, 2, . . . , T do Randomly select an index it ∈ {1, 2, . . . , M } with probability p(it ) Calculate the generalized gradient Rt = Γ = approxr2k (Rt , η1 ) Γb = Γ ∪ Λ B t = argminX F (X), X ∈ R(DΓ̂ ) Λ = approxrk (B t , η2 ) X t+1 = PΛ (B t ) If the stopping criteria are met, exit. end for ∂fit (X t ) ∂X Stochastic Greedy Algorithms For Multiple Measurement Vectors 9 4 Batched Acceleration To accelerate computations and improve performance, we apply the mini-batching technique to obtain batched variants of Algorithms 5 and 6. We first partition the index set {1, 2, . . . , M } into a collection of equal-sized batches τ1 , . . . , τd where the batch size |τi | = b for all i = 1, 2, . . . , dM/be := d. For simplicity, we assume that d is an integer. Similar to the approach in [25], we reformulate (9) as   d 1 X 1 X fj (X) . F (X) = d i=1 b j∈τ (12) i Based on this new formulation, we get the batched version of Algorithm 5, which is termed as BMStoIHT, described in Algorithm 7. Here the input probability p(i) satisfies d 1X p(i) = 1 d i=1 and p(i) ≥ 0, i = 1, . . . , d. Likewise, we get a batched version of MStoGradMP, termed as BMStoGradMP, which is detailed in Algorithm 8. It is empirically shown in Section 7 that the increase of the batch size greatly speeds up the convergence of both algorithms, which is more obvious in BMStoIHT. As a by-product, mini-batching can also improve the recovery accuracy. However, there is a trade-off between the batch size and the performance improvement [25]. Algorithm 7 Batched MMV Stochastic Iterative Hard Thresholding (BMStoIHT) Input: k, γ, η, b and p(i). b = Xt. Output: X Initialize: X = 0. for t = 1, 2, . . . , T do Randomly select a batch index τt ⊆ {1, 2, . . . , d} of size b with probability p(τt ) ∂fτt (X t ) γ dp(τt ) ∂X Identify Γ t = approxrk (B t , η). Estimate X t+1 = PΓ t (B t ). Proxy: B t = X t − If the stopping criteria are met, exit. end for Algorithm 8 Batched MMV Stochastic Gradient Matching Pursuit (BMStoGradMP) Input: k, η1 , η2 , b and p(i). b = Xt. Output: X Initialize: X 0 = 0, Λ = 0. for t = 1, 2, . . . , T do Randomly select a batch index τt ⊆ {1, 2, . . . , d} of size b with probability p(τt ) Calculate the generalized gradient Rt = Γ = approxr2k (Rt , η1 ) Γb = Γ ∪ Λ B t = argminX F (X), X ∈ span(DΓ̂ ) Λ = approxrk (B t , η2 ) X t+1 = PΛ (B t ) If the stopping criteria are met, exit. end for ∂fτt (X t ) ∂X 10 Jing Qin et al. 5 Convergence Analysis In this section, we provide the convergence guarantees for the proposed MStoIHT and MStoGradMP, together with their SMV counterparts, i.e., CStoIHT and CStoGradMP. To simplify the discussion, the result at the t-th iteration of CStoIHT/CStoGradMP refers to the result obtained after t inner iterations and L outer iterations of Algorithm 3/Algorithm 4, or equivalently the maximum number of inner iterations is set as t. Furthermore, all convergence results can be extended to their batched versions, i.e., BStoIHT and BMStoGradMP. Comparison of contraction coefficients shows that the proposed algorithms have faster convergence under the D-RSC, D-RSS and separability of the objective function (see Assumption 1). By replacing the `2 -norm and vector inner product with the Frobenius norm and the matrix inner product respectively and using (4) and (5), we get similar convergence results for MStoIHT and MStoGradMP as in [23]: Theorem 1 Let X ∗ be a feasible solution of (10) and X 0 be the initial solution. At the (t+1)-th iteration of Algorithm 5, the expectation of the recovery error is bounded by E X t+1 − X ∗ where F ≤ κt+1 X 0 − X ∗ F σX ∗ , 1−κ + (13) q q − − κ = 2 1 − γ(2 − γα3k )ρ3k + (η 2 − 1)(1 + γ 2 α3k ρ̄+ 3k − 2γρ3k ), αk = max 1≤i≤M ρ+ k (i) , M p(i) + ρ+ k = max ρk (i), ρ̄+ k = 1≤i≤M (14) M 1 X + ρ (i). M i=1 k Thus Algorithm 7 converges linearly. In particular, if η = γ = 1, then q − κ = 2 1 − 2ρ− 3k + α3k ρ3k . (15) To solve the problem (10), CStoIHT uses StoIHT to restore each column of X separately and then concatenate all column vectors to form a matrix. To analyze the convergence of CStoIHT, we first derive ∗ 2 an upper bound for E X·,j − X·,j following the proof in [23, Section 8.2]. Note that we look for the 2 ∗ contraction coefficient of E X·,j − X·,j 2 2 ∗ rather than E X·,j − X·,j 2 . Lemma 1 Let X ∗ be a feasible solution of (10) and X 0 be the initial solution. Under Assumption 1, there exist κj , σj > 0 such that the expectation of the recovery error squared at the t-th iteration of Algorithm 3 for estimating the j-th column of X ∗ is bounded by t+1 ∗ EIt X·,j − X·,j 2 2 0 ∗ ≤ κt+1 X·,j − X·,j j 2 2 + σj , 1 − κj (16) t ∗ 0 where X·,j is the approximation of X·,j at the t-th iteration of StoIHT with the initial guess X·,j , i.e., the result at the t-th inner iteration and j-th outer iteration of Algorithm 3 with the initial guess X 0 . Here It is the set of all indices i1 , . . . , it randomly selected at or before the t-th step of the algorithm. Proof Due to the separable form of fi in Assumption 1, we consider L problems of the form min w M 1 X gi,j (w), M i=1 kwk0,D ≤ k, j = 1, . . . , L, (17) ∗ where gi,j are given in (11). This relaxation is also valid since X·,j is also a feasible solution of (17) if X ∗ t ∗ is a feasible solution of (10). Let wt = X·,j , w∗ = X·,j , x = wt+1 − w∗ 2 , u = wt − w∗ − γ PΩ (∇git ,j (wt ) − ∇git ,j (w∗ )) M p(it ) + 2 γ PΩ ∇git ,j (w∗ ) M p(it ) := u1 + u2 , 2 Stochastic Greedy Algorithms For Multiple Measurement Vectors 11 and v = (η 2 − 1) wt − w∗ − γ ∇git ,j (wt ) M p(it ) 2 . 2 Let v1 = (η 2 − 1) wt − w∗ − v2 = (η 2 − 1) γ (∇git ,j (wt ) − ∇git ,j (w∗ )) M p(it ) γ ∇git ,j (w∗ ) M p(it ) 2 , 2 2 . 2 The inequality (a + b)2 ≤ 2a2 + 2b2 yields that v ≤ 2v1 + 2v2 . By the direct computation, we can show that x2 − 2ux − v ≤ 0, which implies that Thus the inequality a + b ≤ √ x≤u+ p u2 + v. 2a2 + 2b2 yields x2 ≤ 2u2 + 2(u2 + v) = 4u2 + 2v ≤ 8(u21 + u22 ) + 4v1 + 4v2 . By taking the conditional expectation Eit |It−1 on both sides, we obtain Eit |It−1 x2 ≤ 8Eit |It−1 u21 + 8Eit |It−1 u22 + 4Eit |It−1 v1 + 4Eit |It−1 v2 8γ 2 2 Ei |I kPΩ ∇git ,j (w∗ )k2 minit M 2 (p(it ))2 t t−1 4γ 2 (η 2 − 1) 2 − t ∗ 2 + 4(η 2 − 1)(1 + γ 2 α3k,j ρ̄+ Ei k∇git ,j (w∗ )k2 3k,j − 2γρ3k,j ) w − w 2 + minit M 2 (p(it ))2 t   2 + − 2 2 wt − w∗ 2 = 8(1 − (2γ − γ 2 α3k,j )ρ− 3k,j ) + 4(η − 1)(1 + γ α3k,j ρ̄3k,j − 2γρ3k,j )   4γ 2 ∗ 2 2 ∗ 2 + 2E kP ∇g (w )k + (η − 1)E k∇g (w )k i Ω i ,j i i ,j t t t t 2 2 minit M 2 (p(it ))2 t ∗ ≤ 8(1 − (2γ − γ 2 α3k,j )ρ− 3k,j ) w − w := κj wt − w∗ 2 2 2 2 + + σj . + Note that all coefficients α3k,j , ρ− 3k,j and ρ̄3k,j depend on the function gij in (11). Therefore EIt wt+1 − w∗ 2 2 ≤ κj EIt−1 wt − w∗ 2 2 + σj . which implies that t+1 ∗ E X·,j − X·,j 2 2 0 ∗ ≤ κt+1 X·,j − X·,j j 2 2 + σj , 1 − κj j = 1, . . . , L. Here the contraction coefficient is + − 2 2 κj = 8(1 − (2γ − γ 2 α3k,j )ρ− 3k,j ) + 4(η − 1)(1 + γ α3k,j ρ̄3k,j − 2γρ3k,j ), (18) and the tolerance parameter is σj =   4γ 2 2 2 2Eit kPΩ ∇git ,j (w∗ )k2 + (η 2 − 1)Eit k∇git ,j (w∗ )k2 . 2 2 min M (p(it )) 1≤i≤M In particular, if γ = η = 1 and p(i) = 1/M , then − κj = 8(1 − 2ρ− 3k,j + α3k,j ρ3k,j ), σj = M 8 X ∗ PΩ ∇gi,j (X·,j ) M i=1 2 2 . (19) 12 Jing Qin et al. Theorem 2 Let X ∗ be a feasible solution of (10) and X 0 be the initial solution. Under Assumption 1, at the (t + 1)-th iteration of Algorithm 3, the expectation of the recovery error is bounded by E X t+1 − X ∗ F ≤κ bt+1 X 0 − X ∗ F + δ, (20) 0 where X t is the approximation of X ∗ at the t-th iteration of Algorithm 3 with the initial guess X·,j . Here the contraction coefficient κ b and the tolerance parameter δ are defined as v P u L u q j=1 σj t κ b= max κj , δ = , 1≤j≤L 1 − max κj 1≤j≤L where κj is the contraction coefficient for each StoIHT defined in (18). t+1 0 Proof For each j = 1, 2, . . . , L, StoIHT with the initial guess X·,j generates X·,j after t iterations, i.e., the result at the (t + 1)-th inner iteration and j-th outer iteration of Algorithm 3. Then the expectation of the recovery error squared is bounded by 2 t+1 ∗ E X·,j − X·,j 2 0 ∗ ≤ κt+1 X·,j − X·,j j 2 2 + σj , 1 − κj where κj and σj are defined in Lemma 1. Note that κj depends only on the constants in the D-RSC and D-RSS properties of the objective function or its component function gi,j while σj depends on the ∗ feasible solution X·,j . By combining all L components of X t+1 , we get q 2 E X t+1 − X ∗ F ≤ E kX t+1 − X ∗ kF v u L uX t+1 ∗ 2 =t E X·,j − X·,j 2 j=1 v u L  uX t+1 0 − X∗ κj X·,j ≤t ·,j j=1 σj + 2 1 − κj 2 s ( max κj )t+1 kX 0 − ≤ 1≤j≤L t+1  ≤ q max κj 1≤j≤L 2 X ∗ kF X0 − X∗  PL + F j=1 σj 1 − max1≤j≤L κj v P u L u j=1 σj +t 1 − max κj 1≤j≤L t+1 := κ b 0 X −X ∗ F + δ. In particular, if γ = η = 1, then r √ r q − − max κj = max 8(1 − 2ρ− + α ρ ) = 2 2 max (1 − 2ρ− κ b= 3k,j 3k,j 3k,j 3k,j + α3k,j ρ3k,j ). 1≤j≤L 1≤j≤L 1≤j≤L + In the case that ρ− 3k,j = ρ3k , α3k,j = α3k and ρ3k,j = ρ3k , we have √ κ b = 2κ, where κ is defined Theorem 1. This shows that the CStoIHT converges slower than the proposed MStoIHT provided the same coefficients in the strong smoothness and convexity of the objective function, which we show holds for the distributed compressive sensing setting in Section 6. By using the same proof techniques as in Theorem 1, we can get the following convergence result for MStoGradMP. Stochastic Greedy Algorithms For Multiple Measurement Vectors 13 Theorem 3 Let X ∗ be a feasible solution of (10) and X 0 be the initial solution. At the (t+1)-th iteration of Algorithm 6, the expectation of the recovery error is bounded by σX ∗ , (21) E X t+1 − X ∗ F ≤ κt+1 X 0 − X ∗ F + 1−κ where s ! p 2 ρ+ η12 − 1 4k (2η1 − 1) M p(i) −1+ , max 2 1≤i≤M η1 ρ− 4k η2   r α4k ∂fi (1 + η2 ) (X ∗ ) 2 max M p(i) max PΩ − +3 |Ω|≤4k 1≤i≤M ∂X ρ4k min M p(i) 1≤i≤M r α4k κ = (1 + η2 ) ρ− 4k σX ∗ = ρ− 4k p 1≤i≤M . F Thus Algorithm 6 converges linearly. In particular, if η1 = η2 = 1 and p(i) = 1/M , then q − 2 α4k (ρ+ 4k − ρ4k ) κ= . ρ− 4k (22) Similar to CStoIHT, we start the convergence analysis for CStoGradMP by finding the contraction coefficient for the expectation of recovery error squared at each iteration of CStoGradMP. Lemma 2 Let X ∗ be a feasible solution of (12) and X 0 be the initial solution. Under Assumption 1, the expectation of the recovery error squared at the t-th iteration of Algorithm 4 for estimating the j-th column of X ∗ is bounded by ∗ EIt bt − X·,j where β1 = α4k , − α4k 2ρ− 4k δ1 = 2 2 ∗ ≤ β1 EIt PΓ̂ (bt − X·,j ) 2 α4k (2ρ− 4k − α4k ) min M 2 (p(i))2 2 2 + δ1 , (23) EIt Ei PΓb ∇gi,j (X·,j ) 2 2 . (24) 1≤i≤M Here It is the set of all indices i1 , . . . , it randomly selected at or before the t-th step of the algorithm. Proof Consider the problem (17). By the proof in [23, Lemma 2], we get ∗ PΓb (bt − X·,j ) 2 2 t ∗ ≤ 2(1 − (2γ − γ 2 α4k )ρ− 4k b − X·,j 2 2 + 2γ 2 Ei PΓb ∇gi,j (X·,j ) min M 2 (p(i))2 2 2 , 1≤i≤M where we use the inequality (a + b)2 ≤ 2a2 + 2b2 for a, b ∈ R and the expectation inequality (EX)2 ≤ E(X 2 ). Then we have ∗ bt − X·,j 2 2 ∗ = PΓb (bt − X·,j ) 2 2 ∗ ) + PΓbc (bt − X·,j t ∗ ≤ 2(1 − (2γ − γ 2 α4k )ρ− 4k ) b − X·,j 2 2 + 2 2 2γ 2 ∗ Ei PΓb ∇gi,j (X·,j ) min M 2 (p(i))2 2 2 ∗ + PΓbc (bt − X·,j ) 2 2 . 1≤i≤M Moving the first term on the right hand side to the left hand side leads to ∗ bt − X·,j 2 2 ≤ 2γ 2 Ei PΓb ∇gi,j (X·,j ) φ min M 2 (p(i))2 1≤i≤M 2 2 + 1 ∗ PΓbc (bt − X·,j ) φ 2 2 , − 2 where φ = 2ρ− 4k (2γ − γ α4k ) − 1. Maximizing φ with respect to γ yields γ = 1/α4k and φmax = (2ρ4k − α4k )/α4k . By choosing the optimal value of γ and taking the expectation with respect to It on the both sides of the above inequality, we get (23). p Similarly, using the inequality EX ≤ E(X 2 ) and the fact that a ≤ b + c yields a2 ≤ 2b2 + 2c2 , we are able to get the following result, which is different from Lemma 3 in [23] in that we consider the expectation for the `2 -norm squared here rather than that for the `2 -norm. 14 Jing Qin et al. Lemma 3 Let X ∗ be a feasible solution of (12) and X 0 be the initial solution. Under Assumption 1, the expectation of the recovery error squared at the t-th iteration of Algorithm 4 for estimating the j-th column of X ∗ is bounded by ∗ Eit PΓbc (bt − X·,j ) 2 2 2 2 t ∗ ≤ β2 X·,j − X·,j + δ2 , (25) where it is the index randomly selected at the t-th iteration of the CStoGradMP and 2 − (2η12 − 1)ρ+ 2(η12 − 1) 4k − η1 ρ4k + , − 2 1≤i≤M η12 η1 ρ4k  2 max p(i) 1≤i≤M 2 ∗  max PΩ ∇gi,j (X·,j δ2 = 8  − ) 2. |Ω|≤4k ρ4k min p(i) 1≤i≤M β2 = 4 max M p(i) (26) 1≤i≤M Theorem 4 Let X ∗ be a feasible solution of (12) and X 0 be the initial solution. Under Assumption 1, at the (t + 1)-th iteration of Algorithm 4, there exist κ e, η > 0 such that the expectation of the recovery error is bounded by et+1 X 0 − X ∗ F + η, (27) E X t+1 − X ∗ F ≤ κ t ∗ 0 where X·,j is the approximation of X·,j at the t-th iteration of CStoGradMP with the initial guess X·,j . Proof At the t-th iteration of CStoGradMP, i.e., Algorithm 4, we have t+1 X·,j − bt 2 2 ≤ η22 bt(k) − bt 2 2 ∗ ≤ η22 X·,j − bt 2 2 , where bt(k) is the best k-sparse approximation of bt with respect to the atom set D. Therefore, we get t+1 ∗ X·,j − X·,j 2 2 t+1 ∗ − bt + bt − X·,j ≤ X·,j ≤2 t+1 X·,j − 2 bt 2 t 2 2 ∗ + 2 b − X·,j t ∗ ≤ (2 + 2η22 ) b − X·,j 2 2 2 2 . Next we establish the relationships among various expectations t+1 EIt X·,j − X·,j 2 2 ∗ ≤ (2 + 2η22 )EIt bt − X·,j 2 2 2 + δ1 ) 2 ∗ 2 X·,j 2 + δ2 ) + ∗ ≤ (2 + 2η22 )(β1 EIt PΓ̂ (bt − X·,j ) t ≤ (2 + 2η22 )β1 (β2 EIt X·,j − t ∗ := κj X·,j − X·,j 2 2 (2 + 2η22 )δ1 + σj , where the first inequality is guaranteed by Lemma 2 and the second inequality is guaranteed by Lemma 3. Here the contraction coefficient κj and the tolerance parameter σj are defined by κj = (2 + 2η22 )β1 β2 , σj = (2 + 2η22 )β1 δ2 + (2 + 2η22 )δ1 , where β1 , δ1 are defined in (24) and β2 , β2 are defined in (26). Then similar to the proof of Theorem 2, we can derive that E X t+1 − X ∗ F ≤ κ et+1 X 0 − X ∗ F + η where κ e= q max κj , 1≤j≤L v u u and η = t PL j=1 σj 1 − max κj 1≤j≤L . Stochastic Greedy Algorithms For Multiple Measurement Vectors 15 In particular, if η1 = η2 = 1 and p(i) = 1/M , then s κ e=4 − α4k (ρ+ 4k − ρ4k ) . − ρ− 4k (2ρ4k − α4k ) If, in addition, α4k = ρ− 4k , then we have κ e = 2κ, where the contraction coefficient κ for MStoGradMP is given in (22), which implies that MStoGradMP converges faster than CStoGradMP in this case due to the smaller contraction coefficient. Compared with MStoIHT, MStoGradMP has even larger convergence improvement in terms of recovery accuracy and running time. 6 Distributed Compressive Sensing Application In this section, we show that the objective function commonly used in the distributed compressive sensing problem satisfies the D-RSC and D-RSS properties, which paves the theoretical foundation for using the proposed algorithms in this application. Suppose that there are L underlying signals xj ∈ Rn for j = 1, 2, . . . , L, and their measurements are generated by yj = A(j) xj , j = 1, 2, . . . , L where A(j) ∈ Rm×n (m  n) is the measurement matrix (a.k.a. the sensing matrix). For discussion simplicity, we assume all measurement matrices are the same, i.e., A(j) = A = [A·,1 , . . . , A·,n ]. By concatenating all vectors as a matrix, we rewrite the above equation as follows Y = AX, Y = [y1 , . . . , yL ] ∈ Rm×L , X = [x1 , . . . , xL ] ∈ Rn×L . Now assume that the atom set is finite and denote D = {d1 , . . . , dN } with the corresponding dictionary D = [d1 , . . . , dN ]. Consider the following distributed compressive sensing model with common sparse supports [26] L min X 1 X 2 kyj − Axj k2 2m j=1 s.t. xj = Dθj supp(θj ) = Ω ⊆ {1, 2, . . . , N }. (28) Here the objective function has the form F (X) = 1 2 kY − AXkF . 2m (29) Then F (X) can be written as F (X) = M 1 X fi (X), M i=1 where M = m/b and L fi (X) = n X 1 X 1 2 (Yi,j − Ai,k Xk,j )2 = kYi,· − Ai,· Xk2 . 2b j=1 2b k=1 (30) 16 Jing Qin et al. The above expression shows that fi ’s satisfy the Assumption 1 and thereby the concatenated algorithms in Section 3 can be applied. We first compute the partial derivative. For s = 1, 2, . . . , n and t = 1, 2, . . . , L, we have ! n L n X X 1 X ∂fi (X) ∂Xk,j = 2 Ai,k Xk,j − Yi,j Ai,k ∂Xs,t 2b j=1 ∂Xs,t k=1 k=1 ! L n n X 1X X = Ai,k Xk,j − Yi,j Ai,k δk,s δj,t b j=1 k=1 k=1 ! n 1 X Ai,k Xk,t − Yi,t Ai,s . = b k=1 Here δi,j = 1 if i = j and zero otherwise. Thus the generalized gradient of fi (X) with respect to X has the form 1 ∂fi (X) = ATi,· (Ai,· X − Yi,· ). ∂X b Lemma 4 If the sensing matrix A ∈ Rm×n satisfies the Restricted Isometry Property (RIP), i.e., there exists δk > 0 such that 2 2 2 (1 − δk ) kxk2 ≤ kAxk2 ≤ (1 + δk ) kxk2 for any k-sparse vector x ∈ Rn , then the function F (X) defined in (29) satisfies the D-restricted strong convexity property. Proof Let X ∈ Rn×L with k nonzero rows, which implies that each column of X has at most k nonzero components. By the RIP of A, we have 2 2 2 (1 − δk ) kX·,j k2 ≤ kAX·,j k2 ≤ (1 + δk ) kX·,j k2 , 2 Note that kXkF = PL j=1 j = 1, . . . , L. 2 kX·,j k2 . Thus we get 2 2 2 (1 − δk ) kXkF ≤ kAXkF ≤ (1 + δk ) kXkF . For any two X, X 0 ∈ Rn×L with | supprD (X) ∪ supprD (X 0 )| ≤ k, we have E D ∂F (X) , X0 − X F (X 0 ) − F (X) − ∂X  D1 E 1  2 2 = kY − AX 0 kF − kY − AXkF − AT (AX − Y ), X 0 − X 2m m 1 2 = kA(X 0 − X)kF 2m 1 − δk 2 ≥ kX 0 − XkF . 2m Thus F (X) satisfies the D-restricted strong smoothness property with ρ− k = 1−δk 2m . Lemma 5 If the sensing matrix A ∈ Rm×n satisfies the following property: for any k-sparse vector x ∈ Rn , there exists δk > 0 such that 1 ATτi ,· Aτi ,· x b 2 ≤ (1 + δk ) kxk2 where Aτi ,· is formed by extracting rows of A with row indices in τi . Then the function fi (X) defined in (30) satisfies the D-restricted strong convexity property. Stochastic Greedy Algorithms For Multiple Measurement Vectors 17 Proof Let X ∈ Rn×L have k nonzero rows. Then 1 ATτi ,· Aτi ,· X·,j b 2 ≤ (1 + δk ) kX·,j k2 , j = 1, . . . , L, which implies that 1 ATτi ,· Aτi ,· X b F ≤ (1 + δk ) kXkF . For any two X, X 0 ∈ Rn×L with | supprD (X) ∪ supprD (X 0 )| ≤ k, we have ∂fi (X) ∂fi (X 0 ) − ∂X ∂X 1 ATi,· (Ai,· X − Yi,· ) − ATi,· (Ai,· X 0 − Yi,· ) b 1 ATi,· Ai,· (X − X 0 ) F = b ≤ (1 + δk ) kX − X 0 kF . = F F Therefore fi (X) satisfies the D-restricted strong convexity with ρ+ k (i) = 1 + δk . By Lemma 4, Lemma 5 and the convergence analysis in Section 5, the contraction coefficient in the proposed algorithms depends on the coefficient in the RIP condition, whose infimum for some special type of matrices are available [27]. 7 Numerical Experiments In this section, we conduct a variety of numerical experiments to validate the effectiveness of the proposed algorithms. More specifically, our tests include reconstruction of row sparse signals from a linear system and joint sparse video sequence recovery. To compare different results quantitatively, we use the relative error defined as follows kX t − X ∗ kF , ReErr = kX ∗ kF where X ∗ is the ground truth and X t is the estimation of X ∗ at the t-th iteration. Regarding the computational efficiency, we also record the running time which counts all the computation time over a specified number of iterations excluding data loading or generation. Here we use the commands tic and toc in Matlab. To assess the concatenated SMV algorithms, we apply the SMV algorithm sequentially to the same sensing matrix and all columns of the measurement matrix Y , and save all intermediate approximations of each column of X for further computation of the relative error. In all tests, we use the discrete uniform distribution, i.e., p(i) = 1/M for i = 1, 2, . . . , M in the non-batched version and p(i) = 1/d for i = 1, 2, . . . , d in the batched version. The parameter η is fixed as 1. By default, each algorithm is stopped when either the relative error between two subsequent approximations of X ∗ reaches the tolerance or the maximum number of iterations is achieved. All our experiments are performed in a desktop with an Intel R Xeon R CPU E5-2650 v4 @ 2.2GHz and 64GB RAM in double precision. The algorithms are implemented in Matlab 2016a running on Windows 10. 7.1 Joint Sparse Matrix Recovery In the first set of experiments, we compare the proposed algorithms and their concatenated SMV counterparts in terms of reconstruction error and running time. In particular, we investigate the impact of the sparsity level k, and the number of underlying signals L to be reconstructed on the performance of the BStoIHT and BStoGradMP in both concatenated SMV and MMV versions, in terms of relative error and the running time. To reduce randomness in the results, we run 50 trials for each test with fixed parameters and then take the average over the number of trials. 18 Jing Qin et al. 1.2 1.05 StoIHT, k=5 StoIHT, k=10 StoIHT, k=15 StoIHT, k=20 MStoIHT, k=5 MStoIHT, k=10 MStoIHT, k=15 MStoIHT, k=20 0.95 0.8 relative error relative error 1 BStoIHT, k=5 BStoIHT, k=10 BStoIHT, k=15 BStoIHT, k=20 BMStoIHT, k=5 BMStoIHT, k=10 BMStoIHT, k=15 BMStoIHT, k=20 1 0.9 0.6 0.4 0.85 0.2 0 0.8 0 0.05 0.1 0.15 0.2 running time 0.25 0.3 0.35 0.4 0 0.05 0.1 0.15 0.2 running time Fig. 1 Comparison of StoIHT and MStoIHT in both non-batched and batched versions for various sparsity levels k of the signal matrix. From left to right: batch sizes are 1 and 10. First, we compare StoIHT and MStoIHT in both non-batched and batched versions, and fix the maximum number of iterations as 1000 and γ = 1 in both algorithms. To start with, we create a sensing matrix A ∈ R100×200 where each entry follows the normal distribution with zero mean and variance of 1/100 and each column of A is normalized by dividing its `2 -norm. In this way, it can be shown that the spark of A, i.e., the smallest number of linearly dependent columns of A, is 100 with probability one. To create a signal matrix X ∗ ∈ R200×40 , we first generate a Gaussian distributed random matrix of size 200 × 40, and then randomly zero out (200 − k) rows where k is the row sparsity of X ∗ . The measurement matrix Y is created by AX for the noise-free cases. By choosing the sparsity level k ∈ {5, 10, 15, 20} and the batch size b ∈ {1, 10}, we obtain the results shown in Figure 1. Since the initial guess for the signal matrix is set a zero matrix, all the error curves start with the point (0, 1). Notice that to show the computational efficiency, we use the running time in seconds as the horizonal axis rather than the number of iterations. It can be seen that as the sparsity level grows, i.e., the signal matrix is less joint sparse, more running time (or iterations) is required to achieve the provided tolerance in terms of the relative reconstruction error. Meanwhile, as the batch size increases, BMStoIHT performs better than the sequential BStoIHT. With large sparsity levels, the inaccurate joint support obtained in the concatenated SMV algorithms cause large relative errors in the first few iterations (see Figure 1). Next, we fix the sparsity level k as 5 and choose the number of signals as L ∈ {20, 40, 60, 80}. Figure 2 compares the results obtained by BStoIHT and BMStoIHT when the batch size is 1 and 10. In general, BMStoIHT takes less running time than its sequential concatenated SMV counterpart. We can see that mini-batching significantly improves the reconstruction accuracy and reduces the running time of BMStoIHT. After a large number of tests, we also find that the computational speedup of BMStoIHT is almost linear with respect to the number of signals to be reconstructed. Lastly, to test the robustness to noise, we add the Gaussian noise with zero mean and standard deviation (a.k.a. noise level) σ ∈ {0.02, 0.04, 0.06, 0.08} to the measurement matrix Y . The relative errors for all BStoIHT and BMStoIHT results versus running time are shown in Figure 3. It is worth noting that the change of sparsity and noise levels have insignificant impact on the running time, which explains that the curve corresponding to the same algorithm stops almost at the same horizontal coordinate in Figure 1 and Figure 3. By contrast, the running time grows as the number of signals to be recovered increases which suggests that the endpoint of each curve has different horizontal coordinates in Figure 2. In the second set of tests, we compare StoGradMP and MStoGradMP in non-batched and batched versions. It is known that StoGradMP usually converges much faster than StoIHT. We fix the maximum number of iterations as 30, γ = 1, and the batch size as 1 (non-batched version). Similar to the previous tests, we create a 100 × 200 random matrix whose columns are normalized, and fix the number of signals L = 40. Figure 4 shows the results obtained by StoGradMP and MStoGradMP with sparsity level Stochastic Greedy Algorithms For Multiple Measurement Vectors 1 1.05 StoIHT, L=20 StoIHT, L=40 StoIHT, L=60 StoIHT, L=80 MStoIHT, L=20 MStoIHT, L=40 MStoIHT, L=60 MStoIHT, L=80 0.95 BStoIHT, L=20 BStoIHT, L=40 BStoIHT, L=60 BStoIHT, L=80 BMStoIHT, L=20 BMStoIHT, L=40 BMStoIHT, L=60 BMStoIHT, L=80 0.9 0.8 0.7 relative error 1 relative error 19 0.9 0.85 0.6 0.5 0.4 0.3 0.2 0.8 0.1 0 0.75 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0 0.4 0.05 0.1 0.15 0.2 0.25 0.3 0.35 running time running time Fig. 2 Comparison of StoIHT and MStoIHT in both non-batched and batched versions for various numbers of signals L to be reconstructed. From left to right: batch sizes are 1 and 10. 1 1.05 StoIHT, <=0.02 StoIHT, <=0.04 StoIHT, <=0.06 StoIHT, <=0.08 MStoIHT, <=0.02 MStoIHT, <=0.04 MStoIHT, <=0.06 MStoIHT, <=0.08 relative error 0.95 BStoIHT, <=0.02 BStoIHT, <=0.04 BStoIHT, <=0.06 BStoIHT, <=0.08 BMStoIHT, <=0.02 BMStoIHT, <=0.04 BMStoIHT, <=0.06 BMStoIHT, <=0.08 0.9 0.8 0.7 relative error 1 0.9 0.85 0.6 0.5 0.4 0.3 0.8 0.2 0.75 0.1 0 0.7 0 0.1 0.2 0.3 0.4 running time 0.5 0.6 0.7 0.8 0 0.05 0.1 0.15 0.2 0.25 0.3 running time Fig. 3 Comparison of StoIHT and MStoIHT in both non-batched and batched versions for various noise levels σ to the measurement matrix. From left to right: batch sizes are 1 and 10. k ∈ {60, 70, 80, 90}. Note that for better visualization, we skip the starting point (0,1) for all relative error plots, and use the base 10 logarithmic scale for the horizontal axis of running time since the MStoGradMP takes much less running time than StoGradMP after the same number of iterations. Unlike StoIHT and MStoIHT, both StoGradMP and MStoGradMP require that the sparsity level is no more than n/2, i.e., 100 in our case. As the sparsity k increases, the operator pinv for computing the pseudo-inverse matrix becomes more computationally expensive for matrices with more columns than their rank, which results in the significant growth of running time. For sparse signal matrices, StoGradMP performs better than StoIHT in terms of convergence. Next, we set the number of signals as 20, 40, 60, 80, and get the results shown in Figure 5. It can be seen that MStoGradMP always takes less running time with even higher accuracy than the sequential StoGradMP. We also discovered that the computation speedup of MStoIHT is almost constant with respect to the number of signals to be reconstructed. The robustness comparison is shown in Figure 6, where the noise level ranges in {0.02, 0.04, 0.06, 0.08}. Furthermore, it is empirically shown that the BMStoGradMP performs much better than BMStoIHT considering their respective convergence behavior and robustness. 20 Jing Qin et al. 1.6 1.6 StoGradMP, k=60 StoGradMP, k=70 StoGradMP, k=80 StoGradMP, k=90 MStoGradMP, k=60 MStoGradMP, k=70 MStoGradMP, k=80 MStoGradMP, k=90 relative error 1.2 1.2 1 1 0.8 0.8 0.6 0.6 0.4 10 -3 10 -2 10 -1 10 0 BStoGradMP, k=60 BStoGradMP, k=70 BStoGradMP, k=80 BStoGradMP, k=90 BMStoGradMP, k=60 BMStoGradMP, k=70 BMStoGradMP, k=80 BMStoGradMP, k=90 1.4 relative error 1.4 0.4 10 -3 10 1 10 -2 10 -1 running time 10 0 10 1 running time 1.2 1 1.1 0.9 1 0.8 relative error relative error Fig. 4 Comparison of BStoGradMP and BMStoGradMP with various sparsity levels k. From left to right: batch sizes are 1 and 10. 0.9 0.8 StoGradMP, L=20 StoGradMP, L=40 StoGradMP, L=60 StoGradMP, L=80 MStoGradMP, L=20 MStoGradMP, L=40 MStoGradMP, L=60 MStoGradMP, L=80 0.7 0.6 0.5 10 -3 10 -2 10 -1 running time 0.7 0.6 BStoGradMP, L=20 BStoGradMP, L=40 BStoGradMP, L=60 BStoGradMP, L=80 BMStoGradMP, L=20 BMStoGradMP, L=40 BMStoGradMP, L=60 BMStoGradMP, L=80 0.5 0.4 10 0 0.3 10 -3 10 -2 10 -1 10 0 running time Fig. 5 Comparison of BStoGradMP and BMStoGradMP with various numbers of signals L. From left to right: batch sizes are 1 and 10. 7.2 Joint Sparse Video Sequence Recovery In this set of experiments, we compare the proposed Algorithm 8 and the split Bregman algorithm for constrained MMV problem (SBC) [11, Algorithm 2], on joint sparse video sequence reconstruction. We first download a candle video consisting of 75 frames from the Dynamic Texture Toolbox in http: //www.vision.jhu.edu/code/. In order to make the test video sequence possess a joint sparse structure, we extract 11 frames of the original data, i.e., frames 1 to 7, 29, 37, 69 and 70, each of which is of size 80 × 30. Then we create a data matrix X ∈ R2400×11 , whose columns are a vectorization of all video frames. To further obtain a sparse representation of X, the K-SVD algorithm [28] is applied to obtain a dictionary Ψ ∈ R2400×50 for X. The K-SVD dictionary Ψ and the support of the corresponding coefficient matrix Θ for the extracted 11 frames are shown in Figure 7 (a) and (b). Some selected columns of the dictionary Ψ , namely atoms, are reshaped as an image of size 80 × 30 illustrated in Figure 7 (c) and (d). It can be seen that these 11 frames are nearly joint sparse under the learned dictionary. The ΘkF = 0.0870. relative error of using this K-SVD dictionary Ψ to represent the data matrix X is kX−Ψ kXkF 60×2400 A Gaussian random matrix Φ ∈ R with zero mean and unit variance is set as a sensing matrix, Stochastic Greedy Algorithms For Multiple Measurement Vectors 21 1.2 1 StoGradMP, <=0.02 StoGradMP, <=0.04 StoGradMP, <=0.06 StoGradMP, <=0.08 MStoGradMP, <=0.02 MStoGradMP, <=0.04 MStoGradMP, <=0.06 MStoGradMP, <=0.08 relative error 0.8 0.8 0.7 relative error 1 BStoGradMP, <=0.02 BStoGradMP, <=0.04 BStoGradMP, <=0.06 BStoGradMP, <=0.08 BMStoGradMP, <=0.02 BMStoGradMP, <=0.04 BMStoGradMP, <=0.06 BMStoGradMP, <=0.08 0.9 0.6 0.4 0.6 0.5 0.4 0.3 0.2 0.2 0.1 0 10 -3 10 -2 10 -1 running time 10 0 10 1 0 10 -3 10 -2 10 -1 10 0 10 1 running time Fig. 6 Comparison of BStoGradMP and BMStoGradMP with various noise levels σ. From left to right: batch sizes are 1 and 10. which is used to measure this data matrix. In other words, the measurements Y ∈ R60×11 are generated via Y = ΦX. Given the measurements Y and the new sparse representation dictionary A = ΦΨ , we then apply Algorithm 8 and SBC to recover the joint sparse coefficient matrix Θ̂. In Algorithm 8, the sparsity level k is set as 10, and the block size b is set as 3, which implies that there are d = 20 blocks. In addition, we set η1 = η2 = 1. Both algorithms stop when the residual error reaches a tolerance threshold τ = 10−6 , i.e., kY − AΘ̂kF ≤ τ . The first four recovered frames are shown in Figure 8. Regarding the computation time, the proposed Algorithm 8 is about ten times faster than SBC according to our experiments. The proposed algorithm takes less running time than SBC since it stops at the 10-th iteration while SBC stops at the 1691-th iteration. Even surprisingly, although the same error tolerance is set for both algorithms, kX −Ψ Θ̂ k the proposed algorithm yields a smaller relative error ( :,ikX:,i k2:,i 2 ) than SBC. Figure 9 compares the relative discrepancy kY − AΘ̂kF / kY kF versus running time for both algorithms, where we can see the zigzag pattern in the SBC result. 8 Conclusions In this paper, we study the multiple measurement vector sparse reconstruction problem, which is of great importance in a large amount of signal processing applications. We propose two stochastic greedy algorithms, MStoIHT and MStoGradMP, together with their respective accelerated versions by applying the mini-batching technique. Our convergence analysis has shown theoretically that the proposed algorithms converge faster than their concatenated SMV counterparts. A variety of numerical experiments on linear systems and video frame processing have shown that the proposed algorithms outperform the concatenated SMV algorithms in terms of efficiency, accuracy and robustness to the noise. Acknowledgements The initial research for this effort was conducted at the Research Collaboration Workshop for Women in Data Science and Mathematics, July 17-21 held at ICERM. Funding for the workshop was provided by ICERM, AWM and DIMACS (NSF grant CCF-1144502). References 1. S. F. Cotter, B. D. Rao, K. Engan, and K. Kreutz-Delgado, “Sparse solutions to linear inverse problems with multiple measurement vectors,” IEEE Transactions on Signal Processing, vol. 53, no. 7, pp. 2477–2488, 2005. 22 Jing Qin et al. Support of sparse coefficient K-SVD Dictionary 1 0.1 5 0.9 10 0.8 15 0.7 20 0.6 25 0.5 30 0.4 35 0.3 40 0.2 45 0.1 0.08 500 0.06 0.04 1000 0.02 0 1500 -0.02 -0.04 2000 -0.06 -0.08 50 10 20 30 40 50 0 2 (a) 20-th column 24-th column (c) 4 6 8 10 (b) 28-th column 29-th column 33-th column 47-th column (d) Fig. 7 (a) K-SVD dictionary learned from the total 75 frames from the candle video. (b) Support of sparse coefficient matrix for extracted 11 frames. The sparse coefficient matrix has non-zero entries on white area. (c-d) Some columns of the learned K-SVD dictionary. 2. B. D. Rao, K. Engan, and S. Cotter, “Diversity measure minimization based method for computing sparse solutions to linear inverse problems with multiple measurement vectors,” in Acoustics, Speech, and Signal Processing, 2004. Proceedings.(ICASSP’04). IEEE International Conference on, vol. 2, pp. ii–369, IEEE, 2004. 3. Z. He, A. Cichocki, R. Zdunek, and J. Cao, “CG-M-FOCUSS and its application to distributed compressed sensing,” in International Symposium on Neural Networks, pp. 237–245, Springer, 2008. 4. J. A. Bazerque and G. B. Giannakis, “Distributed spectrum sensing for cognitive radio networks by exploiting sparsity,” IEEE Transactions on Signal Processing, vol. 58, no. 3, pp. 1847–1862, 2010. 5. A. Majumdar and R. K. Ward, “Joint reconstruction of multiecho mr images using correlated sparsity,” Magnetic resonance imaging, vol. 29, no. 7, pp. 899–906, 2011. 6. A. Majumdar and R. K. Ward, “Face recognition from video: An MMV recovery approach,” in Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on, pp. 2221–2224, IEEE, 2012. 7. A. Majumdar and R. Ward, “Rank awareness in group-sparse recovery of multi-echo mr images,” Sensors, vol. 13, no. 3, pp. 3902–3921, 2013. 8. M. E. Davies and Y. C. Eldar, “Rank awareness in joint sparse recovery,” IEEE Transactions on Information Theory, vol. 58, no. 2, pp. 1135–1146, 2012. 9. S. Li, D. Yang, G. Tang, and M. B. Wakin, “Atomic norm minimization for modal analysis from random and compressed samples,” arXiv preprint arXiv:1703.00938, 2017. 10. H. Lu, X. Long, and J. Lv, “A fast algorithm for recovery of jointly sparse vectors based on the alternating direction methods,” in Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 461– 469, 2011. 11. Z. Jian, F. Yuli, Z. Qiheng, and L. Haifeng, “Split bregman algorithms for multiple measurement vector problem,” Multidim Syst Sign Process, 2015. Stochastic Greedy Algorithms For Multiple Measurement Vectors Ground truth BMStoGradMP SBC 23 Ground truth BMStoGradMP SBC 10 10 10 10 10 10 20 20 20 20 20 20 30 30 30 30 30 30 40 40 40 40 40 40 50 50 50 50 50 50 60 60 60 60 60 60 70 70 70 70 70 70 80 80 10 20 30 80 10 20 30 80 10 20 30 80 10 20 30 (a) Frame 1 Ground truth 80 10 20 30 10 BMStoGradMP SBC Ground truth BMStoGradMP 10 10 10 10 10 20 20 20 20 20 20 30 30 30 30 30 30 40 40 40 40 40 40 50 50 50 50 50 50 60 60 60 60 60 60 70 70 70 70 70 70 80 10 20 30 80 10 20 (c) Frame 3 30 SBC 10 80 20 (b) Frame 2 30 80 10 20 30 80 10 20 30 80 10 20 30 10 20 30 (d) Frame 4 Fig. 8 The first four frames reconstructed by BMStoGradMP and SBC. The relative reconstruction errors of all BMStoGradMP results, i.e., kX:,i − Ψ Θ̂:,i k2 /kX:,i k2 , are: (a) 1.3819 × 10−15 , (b) 1.3819 × 10−15 , (c) 1.1547 × 10−15 , (d) 4.8385 × 10−15 . By contrast, the relative reconstruction errors of all SBC results are: (a) 5.0906 × 10−15 , (b) 5.0906 × 10−15 , (c) 6.8482 × 10−10 , and (d) 3.5012 × 10−8 . 12. P. Feng and Y. Bresler, “Spectrum-blind minimum-rate sampling and reconstruction of multiband signals,” in Acoustics, Speech and Signal Processing (ICASSP), 1996 IEEE International Conference on, vol. 3, pp. 1688–1691, IEEE, 1996. 13. J. M. Kim, O. K. Lee, and J. C. Ye, “Compressive MUSIC: Revisiting the link between compressive sensing and array signal processing,” IEEE Transactions on Information Theory, vol. 58, no. 1, pp. 278–301, 2012. 14. K. Lee, Y. Bresler, and M. Junge, “Subspace methods for joint sparse recovery,” IEEE Transactions on Information Theory, vol. 58, no. 6, pp. 3613–3641, 2012. 15. J. A. Tropp, “Greed is good: Algorithmic results for sparse approximation,” IEEE Transactions on Information theory, vol. 50, no. 10, pp. 2231–2242, 2004. 16. J. Chen and X. Huo, “Theoretical results on sparse representations of multiple-measurement vectors,” IEEE Transactions on Signal Processing, vol. 54, no. 12, pp. 4634–4643, 2006. 17. J. A. Tropp, A. C. Gilbert, and M. J. Strauss, “Algorithms for simultaneous sparse approximation. part i: Greedy pursuit,” Signal Processing, vol. 86, no. 3, pp. 572–588, 2006. 18. D. Needell and J. A. Tropp, “CoSaMP: Iterative signal recovery from incomplete and inaccurate samples,” Applied and Computational Harmonic Analysis, vol. 26, no. 3, pp. 301–321, 2009. 19. D. Needell and R. Vershynin, “Signal recovery from incomplete and inaccurate measurements via regularized orthogonal matching pursuit,” IEEE Journal of selected topics in signal processing, vol. 4, no. 2, pp. 310–316, 2010. 20. W. Dai and O. Milenkovic, “Subspace pursuit for compressive sensing signal reconstruction,” IEEE Transactions on Information Theory, vol. 55, no. 5, pp. 2230–2249, 2009. 21. T. Blumensath and M. E. Davies, “Iterative hard thresholding for compressed sensing,” Applied and computational harmonic analysis, vol. 27, no. 3, pp. 265–274, 2009. 24 Jing Qin et al. 10 0 10 10 -2 -5 ^ F =kY kF kY ! A#k ^ F =kY kF kY ! A#k 10 10 0 10 -4 -10 10 -6 10 -15 10 -20 10 -8 0 0.2 0.4 0.6 0.8 running time (a) BMStoGradMP 1 1.2 1.4 #10 -3 10 -10 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 running time (b) SBC Fig. 9 Plot of the relative discrepancy kY − AΘ̂kF / kY kF versus the running time for BMStoGradMP and SBC. 22. N. Nguyen, S. Chin, and T. Tran, “A unified iterative greedy algorithm for sparsityconstrainted optimization. 2013.” 23. N. Nguyen, D. Needell, and T. Woolf, “Linear convergence of stochastic iterative greedy algorithms with sparse constraints,” IEEE Transactions on Information Theory, 2017. 24. J. R. Magnus, “On the concept of matrix derivative,” Journal of Multivariate Analysis, vol. 101, no. 9, pp. 2200–2206, 2010. 25. D. Needell and R. Ward, “Batched stochastic gradient descent with weighted sampling,” in Approximation Theory XV: San Antonio 2016, pp. 279–306, Springer, 2016. 26. D. Baron, M. B. Wakin, M. F. Duarte, S. Sarvotham, and R. G. Baraniuk, “Distributed compressed sensing,” IEEE Transactions on Information Theory, vol. 52, no. 12, pp. 5406–5425, 2006. 27. S. Foucart and H. Rauhut, A mathematical introduction to compressive sensing, vol. 1. Birkhäuser Basel, 2013. 28. M. Aharon, M. Elad, and A. Bruckstein, “K-svd: An algorithm for designing overcomplete dictionaries for sparse representation,” IEEE Transactions on signal processing, vol. 54, no. 11, pp. 4311–4322, 2006.
8cs.DS
arXiv:1609.08474v1 [math.GT] 27 Sep 2016 Cubulable Kähler groups Thomas Delzant and Pierre Py September 2016 Abstract We prove that a Kähler group which is cubulable, i.e. which acts properly discontinuously and cocompactly on a CAT(0) cubical complex, has a finite index subgroup isomorphic to a direct product of surface groups, possibly with a free Abelian factor. Similarly, we prove that a closed aspherical Kähler manifold with a cubulable fundamental group has a finite cover which is biholomorphic to a topologically trivial principal torus bundle over a product of Riemann surfaces. Along the way, we prove a factorization result for essential actions of Kähler groups on irreducible, locally finite CAT(0) cubical complexes, under the assumption that there is no fixed point in the visual boundary. Contents 1 Introduction 2 2 Groups acting on CAT(0) cubical complexes 4 2.1 Cubical complexes and hyperplanes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Existence of strongly separated hyperplanes . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Non-amenability of certain Schreier graphs 8 . . . . . . . . . . . . . . . . . . . . . . 3 Fibering Kähler groups acting on CAT(0) cubical complexes 12 3.1 Filtered ends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 The first pluriharmonic map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.3 A second plurisubharmonic map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.4 Producing fibrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4 Cubulable Kähler manifolds and groups 19 4.1 Cubulable Kähler groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.2 Cubulable Kähler manifolds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5 Comments 23 1 1 Introduction The purpose of this text is to characterize fundamental groups of compact Kähler manifolds which are cubulable, i.e. which act properly discontinuously and cocompactly on a CAT(0) cubical complex. For a survey concerning fundamental groups of compact Kähler manifolds, referred to as Kähler groups below, we refer the reader to [2, 13]. For basic definitions about cubical complexes, we refer the reader to [8, I.7] or [50]. We only mention here that cubical complexes form a particular type of polyhedral complexes, and provide an important source of examples in geometric group theory. From now on we will only deal with finite dimensional cubical complexes. Such complexes have a natural complete and geodesic metric. In the 80’s, Gromov gave a combinatorial criterion for this metric to be CAT(0) [28, §4.2]. His work on hyperbolization procedures [28], as well as Davis’ work on reflection groups [18] drew attention to these complexes; see also [3, 19, 20]. Later, Sageev established a link between actions of a group G on a CAT(0) cubical complex and the existence of a multi-ended subgroup of G [49]. More recently, under the influence of Agol, Haglund and Wise, CAT(0) cubical complexes received a lot of attention as the list of examples of cubulated groups increased dramatically and thanks to their applications to 3-dimensional topology. We refer the reader to [1, 5, 6, 32, 33, 54, 55] for some of these developments. On the other hand, as we will see, actions of Kähler groups on CAT(0) cubical complexes are very constrained. Even more, Kähler groups are in a sense orthogonal to groups acting on CAT(0) cubical complexes. The first results in this direction go back to the work of the first author, together with Gromov [23]. Note that most of the results of [23] are not formulated in terms of actions on CAT(0) cubical complex but can be interpreted in terms of such actions thanks to the work of Sageev [49]. In [23], the authors studied codimension one subgroups of hyperbolic Kähler groups. More generally they studied filtered ends, or cuts of hyperbolic Kähler groups, see section 3.1 for the definitions. Some of their results were later generalized by Napier and Ramachandran [46]. Stated informally, the results of [23] show that under suitable hyperbolicity assumptions, the presence of sufficiently many subgroups of a Kähler group Γ whose numbers of filtered ends are greater than 2 implies that a finite index subgroup Γ0 of Γ is a subdirect product of a certain number of surface groups with a free Abelian group. All along this text, the expression surface group stands for the fundamental group of a closed oriented hyperbolic surface. Recall that a subdirect product of groups G1 , . . . , Gm is a subgroup of G1 × · · · × Gm which surjects onto each factor. So, in the previous statement, we mean that Γ0 is a subdirect product of G1 , . . . , Gm where all the Gi ’s are surface groups, except possibly for one of them which could be free Abelian. There is also a particular class of actions of Kähler groups on CAT(0) cubical complexes which are easy to describe. These are the ones given by homomorphisms into right-angled Artin groups. For homomorphisms from Kähler groups to right-angled Artin groups, it is easy to obtain a factorization result through a subdirect product of surface groups, possibly with a free Abelian factor. This relies on the facts that right-angled Artin groups embed into Coxeter groups and that Coxeter groups act properly on the product of finitely many trees. This was observed by the second author in [48]. These results left open the question of describing actions of Kähler groups on general CAT(0) cubical complexes. We answer this question here assuming that the cubical complexes are locally finite and that the actions have no fixed point in the visual boundary. We will briefly discuss in section 5 the need for these two hypothesis. From this, one deduces easily a description of cubulable Kähler groups. The following statements involve various more or less standard notions about cubical complexes: essential actions, irreducible complexes, visual boundaries... We recall all these definitions in section 2.1. 2 Theorem A Let M be a closed Kähler manifold whose fundamental group π1 (M ) acts on a finite dimensional locally finite irreducible CAT(0) cubical complex X. Assume that: • the action is essential, • π1 (M ) has no fixed point in the visual boundary of X, • π1 (M ) does not preserve a Euclidean flat in X. Then there exists a nected fibers F : M1 π1 (Σ) is surjective. fixed point set in X finite cover M1 of M which fibers: there exists a holomorphic map with con→ Σ to a hyperbolic Riemann surface such that the induced map F∗ : π1 (M ) → Moreover the kernel of the homomorphism F∗ acts elliptically on X, i.e. its is nonempty. Hence, up to restricting the action to a convex subset of X, the action factors through the fundamental group of a hyperbolic Riemann surface. Indeed, as a convex subspace one can take the fixed point set of the subgroup Ker(F∗ ); this is a subcomplex of the first cubic subdivision of X. From Theorem A, and using results due to Caprace and Sageev [15] and to Bridson, Howie, Miller and Short [10], we deduce a characterization of cubulable Kähler groups. In the next three statements, we implicitly assume that the cubical complexes are locally finite. Theorem B Suppose that a Kähler group Γ acts properly discontinuously and cocompactly on a CAT(0) cubical complex X. Let X = X1 × · · · × Xr be the decomposition of X into irreducible factors. Assume moreover that the action of Γ on X is essential and that each Xi is unbounded. Then Γ has a finite index subgroup Γ∗ which is isomorphic to a direct product Γ∗ ' H1 × · · · × Hk × G1 × · · · × Gm , (1) where each Hj is isomorphic to Z, each Gj is a surface group, and k + m = r is the number of irreducible factors of X. Moreover the isomorphism (1) can be chosen in such a way that for each i, Xi contains a convex Γ∗ -invariant subset Yi on which the action factors through one of the projections Γ∗ → Gj or Γ∗ → Hj . If a group G acts properly discontinuously and cocompactly on a CAT(0) cubical complex X, one can always find a G-invariant subcomplex Y inside X, on which the action is essential and all of whose irreducible factors are unbounded. This follows from Corollary 6.4 in [15]. This implies the following corollary: Corollary C Suppose that a Kähler group Γ acts properly discontinuously and cocompactly on a CAT(0) cubical complex X. Then Γ has a finite index subgroup which is isomorphic to a direct product of surface groups with a free Abelian group. The conclusion of Theorem B holds after replacing X by a suitable invariant subcomplex. In what follows, we will say that a closed manifold M is cubulable if it has the same homotopy type as the quotient of a finite dimensional CAT(0) cubical complex by a properly discontinuous, free, cocompact group action. Using an argument going back to Siu [53], and the fact that a cubulable manifold is aspherical, we will finally prove the following theorem. Theorem D If a Kähler manifold M is cubulable, it admits a finite cover which is biholomorphic to a topologically trivial principal torus bundle over a product of Riemann surfaces. If M is algebraic, it admits a finite cover which is biholomorphic to a direct product of an Abelian variety with a product of Riemann surfaces. 3 We mention that the factorization result in Theorem A does not rely on the use of harmonic maps unlike most of the factorization results for actions of Kähler groups on symmetric spaces, trees or more general buildings. Indeed, although there is a general theory of harmonic maps with values into CAT(0) spaces [31, 39], the crucial step harmonic ⇒ pluriharmonic namely the use of a Bochner formula to prove that a harmonic map from a Kähler manifold to a certain nonpositively curved space is automatically pluriharmonic is not available when the target space is a CAT(0) cubical complex. Thus, our proof follows a different scheme. The idea is to produce fibrations of our Kähler manifold M over a Riemann surface, in such a way that the kernel N  π1 (M ) of the homomorphism induced by the fibration preserves a certain hyperplane ĥ of the cubical complex. Since N is normal it will have to preserve each hyperplane of the π1 (M )-orbit of ĥ. From this we will deduce that N actually acts elliptically on the CAT(0) cubical complex, i.e. has a fixed point. From the Kähler point of view, the new idea of this paper appears in Section 3.4. It can be summarized as follows. Consider an infinite covering Y of a closed Kähler manifold. Given a proper pluriharmonic function u on Y , one can look for conditions under which the foliation induced by the holomorphic form du1,0 is actually a fibration. Our observation is that it is enough to find on Y a second plurisubharmonic function which is not a function of u. This differs from other fibration criterions in the study of Kähler groups as the second function we need is only required to be plurisubharmonic. In the various Castelnuovo-de Franchis type criterions known so far, one needs two pluriharmonic functions, or two holomorphic 1-forms, see [47] and the references mentioned in the introduction there. The text is organized as follows. In section 2, we recall basic facts on CAT(0) cubical complexes as well as more advanced results due to Caprace and Sageev. Given a group G acting on a CAT(0) cubical complex and satisfying suitable hypothesis, wee also explain how to construct a hyperplane ĥ whose stabilizer H in G has the property that the Schreier graph of H\G is non-amenable. In section 3, we explain how to construct some nontrivial plurisubharmonic functions on certain covering spaces of a Kähler manifold whose fundamental group acts on a CAT(0) cubical complex. The proof of Theorem A is concluded in Section 3.4. In section 4, we prove Theorem B and D. Finally, section 5 contains a few comments about possible improvements of our results. Acknowledgements. We would like to thank Pierre-Emmanuel Caprace, Yves de Cornulier and Misha Sageev for many explanations about CAT(0) cubical complexes as well as Martin Bridson for discussions motivating this work. 2 Groups acting on CAT(0) cubical complexes In this section we recall some basic properties of CAT(0) cubical complexes and some advanced results due to Caprace and Sageev [15]. For a more detailed introduction to these spaces, we refer the reader to [8, I.7] and [50] for instance. From now on and until the end of the text, all CAT(0) cubical complexes will be finite dimensional; we will not mention this hypothesis anymore. By convention, we assume that all cubes of our cubical complexes are isometric to [−1, 1]n for some n. 4 2.1 Cubical complexes and hyperplanes A cubical complex X can be naturally endowed with a distance as follows. If x and y are in X, one considers chains x0 = x, x1 , . . . , xn = y where each pair (xi , xi+1 ) is contained in a cube Ci of X and one defines d(x, y) = inf n−1 X dCi (xi , xi+1 ) i=0 where the inf is taken over all possible chains. Here dCi is the intrinsic distance of the cube; the number dCi (xi , xi+1 ) does not depend on the choice of the cube containing xi and xi+1 . The function d is a distance which is complete and geodesic thanks to the finite dimensionality hypothesis [8, I.7]. From now on, we will always assume that the cube complexes we consider are CAT(0) spaces, when endowed with the previous metric. According to a classical theorem by Gromov [28, §4.2], this is equivalent to the fact that the complex is simply connected and that the link of each vertex is a flag complex. The visual boundary [8, II.8] of a CAT(0) cubical complex X is denoted by ∂∞ X. We now recall the definition of hyperplanes, first introduced by Sageev [49]. We fix a CAT(0) cubical complex X. Let 2 be the equivalence relation on edges of our complex, defined as follows. One says that two edges e and f are equivalent, denoted e2f , if there exists a chain e1 = e, . . . , en = f such that for each i, ei and ei+1 are opposite edges of some 2-dimensional cube. If e is an edge we will denote by [e] its equivalence class. A midcube of a cube C, identified with [−1, 1]n , is the subset of C defined by setting one of the coordinates equal to 0. One says that a midcube and an edge e of a cube C ' [−1, 1]n are transverse if the midcube is defined by ti = 0 and the coordinate ti is the only nonconstant coordinate of the egde e. Now the hyperplane associated to an equivalence class of edges [e] is the union of all midcubes which are transverse to an edge of the class [e]. It is denoted by ĥ([e]). If we want to denote a hyperplane without referring to the edge used to define it, we will denote it by ĥ. Finally we will denote by N (ĥ) the union of the interiors of all cubes which intersect a hyperplane ĥ. One can prove that hyperplanes enjoy the following properties [49]: 1. Each hyperplane intersects a cube in at most one midcube. 2. Each hyperplane ĥ separates X into two connected components, the closures of the two connected components of X − ĥ are called the two half-spaces associated to ĥ. 3. Every hyperplane as well as every halfspace is a convex subset of X for the distance d. 4. For every hyperplane ĥ, the set N (ĥ) is convex and naturally isometric to ĥ × (−1, 1). If t ∈ (−1, 1), the subset of N (ĥ) corresponding to ĥ × {t} under this isometry is called a translated hyperplane of ĥ. 5. If a geodesic segment intersects a hyperplane in two points, it is entirely contained in it. The group Aut(X) of automorphisms of a CAT(0) cubical complex X is the group of all permutations X → X which send isometrically a cube of X to another cube of X. An automorphism of X is automatically an isometry of the distance d introduced earlier. In what follows, every 5 time we will say that a group G acts on a CAT(0) cubical complex, we will mean that we have a homomorphism from the group G to the group Aut(X) of automorphisms of X. In this case, if ĥ is a hyperplane, we will denote by StabG (ĥ) the subgroup of G of elements which globally preserve ĥ and which also preserve each component of the complement of ĥ. Following [15], we say that an action of a group G on a CAT(0) cubical complex X is essential if no G-orbit is contained in a bounded neighborhood of a halfspace. This implies in particular that G has no fixed point in X. We will also use the following convention. If h is a halfspace of X, we will denote by ĥ the associated hyperplane (the boundary of h) and by h∗ the opposite halfspace, i.e. the closure of X \ h. Finally, we mention that there is a natural notion of irreducibility for a CAT(0) cubical complex, see [15, §2.5]. Any finite dimensional CAT(0) cube complex X has a canonical decomposition as a product of finitely many irreducible CAT(0) cubical complexes. Moreover every automorphism of X preserves this decomposition, up to a permutation of possibly isomorphic factors. We refer the reader to [15, §2.5] for a proof of these facts. We will use this decomposition to deduce Theorem B from Theorem A. 2.2 Existence of strongly separated hyperplanes The following definition is due to Behrstock and Charney [4] and is a key notion to study rank 1 phenomena for group actions on CAT(0) cubical complexes. Definition 1 Two hyperplanes ĥ1 and ĥ2 in a CAT(0) cubical complex are strongly separated if they are disjoint and if there is no hyperplane meeting both ĥ1 and ĥ2 . If X is a CAT(0) cubical complex and Y is a closed convex subset of X, we will denote by πY : X → Y the projection onto Y [8, II.2]. The following proposition is also taken from [4]. Proposition 1 If the hyperplanes ĥ1 and ĥ2 are strongly separated, there exists a unique pair of point (p1 , p2 ) ∈ ĥ1 × ĥ2 such that d(p1 , p2 ) = d(ĥ1 , ĥ2 ). The projection of any point of ĥ2 (resp. ĥ1 ) onto ĥ1 (resp. ĥ2 ) is p1 (resp. p2 ). Proof. The first claim is Lemma 2.2 in [4]. The proof given there also shows that if ĥ is a hyperplane distinct from ĥ1 and ĥ2 , no translated hyperplane of ĥ can intersect both ĥ1 and ĥ2 . We now prove the last assertion of the proposition. It is enough to prove that the projection on ĥ1 of each point of ĥ2 is the middle of an edge of the cubical complex. Since ĥ1 is connected, this implies that all points of ĥ1 have the same projection, which must necessarily be the point p1 . Let x ∈ ĥ2 . If the projection q of x onto ĥ1 is not the middle of an edge, than there exists a cube C of dimension at least 3 which contains q as well as the germ at q of the geodesic from q to x. One can identify C with [−1, 1]n in such a way that q = (0, s, s3 , . . . , sn ) with |s| < 1. Since the germ of geodesic going from q to x is orthogonal to ĥ1 , it must be contained in [−1, 1] × {s} × [−1, 1]n−2 . We call m̂ the hyperplane associated to any edge of C parallel to {0} × [−1, 1] × {0}n−2 . Hence the germ of [q, x] at q is contained in a translated hyperplane of m̂. This implies that [q, x] is entirely contained in this translated hyperplane. This contradicts the fact that no translated hyperplane can intersect both hˆ1 and hˆ2 . 2 6 Note that the second point of the proposition can be stated in the following slightly stronger way. If h1 is the half-space defined by ĥ1 and which does not contain ĥ2 , then the projection of any point of h1 onto ĥ2 is equal to p2 . Indeed if q ∈ h1 and if γ is the geodesic from q to πĥ2 (q), there must exist a point q 0 on γ which belongs to ĥ1 . Hence πĥ2 (q) = πĥ2 (q 0 ) = p2 . This proves the claim. The following theorem is due to Caprace and Sageev [15, §1.2]. It gives sufficient conditions for the existence of strongly separated hyperplanes in a CAT(0) cubical complex X. Theorem 2 Assume that the CAT(0) cubical complex is irreducible and that the group Aut(X) acts essentially on X and without fixed point in the visual boundary. Then X contains two strongly separated hyperplanes. In the end of this section, we consider a CAT(0) cubical complex X, two strongly separated hyperplanes ĥ and k̂ in X, and a group G acting on X. We prove a few lemmas which will be used in the next sections. We denote by k the halfspace delimited by k̂ which does not contain ĥ. Lemma 3 Let p be the projection of k̂ (or k) on ĥ. Let h be an element of StabG (ĥ). If h(k) ∩ k is nonempty, then h fixes p. Proof. This is an easy consequence of Proposition 1. Let πĥ : X → ĥ be the projection. We have seen that πĥ (k) = p. Since h ∈ StabG (ĥ), the map πĥ is h-equivariant. Let x ∈ k be such that h(x) ∈ k. We have: πĥ (h(x)) = p since h(x) ∈ k. But we also have πĥ (h(x)) = h(πĥ (x)) = h(p) since x ∈ h. Hence h(p) = p. We now define 2 Σ = {h ∈ StabG (ĥ), h(k) ∩ k 6= ∅} and let A be the subgroup of StabG (ĥ) generated by Σ. According to the previous lemma, every element of A fixes p. Let [ U= a(k) a∈A be the union of all the translates by A of the halfpsace k. Lemma 4 Let h be an element of StabG (ĥ). If h(U ) ∩ U is nonempty, then h ∈ A and h(U ) = U . Proof. Let h be such that h(U ) ∩ U is nonempty. Then there exist a1 and a2 in A such that ha1 (k) ∩ a2 (k) 6= ∅. This implies that a−1 2 2 ha1 is in Σ, hence in A. In particular h is in A. If the space X is proper, there are only finitely many hyperplanes passing through a given ball of X. Since the group A fixes the point p, in this case we get that the family of hyperplanes   a(k̂) a∈A is actually a finite family. This implies that the family of halfspaces (a(k))a∈A is also finite. Note that the same conclusion holds if we assume that the action of G has finite stabilizers instead of assuming the properness of X. Indeed, the whole group A is finite in that case. We record this observation in the following: Proposition 5 If X is locally finite or if the G-action on X has finite stabilizers, then there exists a finite set A1 ⊂ A such that for all a ∈ A, there exists a1 ∈ A1 such that a1 (k) = a(k). We will make an important use of this Proposition in section 3.3. Although we will only use it under the hypothesis that X is locally finite, we decided to remember the fact that the conclusion still holds for actions with finite stabilizers as this might be useful to study proper actions of Kähler groups on non-locally compact CAT(0) cubical complexes. 7 2.3 Non-amenability of certain Schreier graphs In this section we consider an irreducible CAT(0) cubical complex and a finitely generated group G which acts essentially on X, does not preserve any Euclidean subspace of X, and has no fixed point in ∂∞ X. A consequence of the work of Caprace and Sageev [15] is that under these hypothesis, the group G contains a nonabelian free group. We will need the following slight modification of this important fact; see also [38] for a similar statement. To state the next theorem, we need the following definition. Following Caprace and Sageev [15], we say that three halfspaces a, b, c form a facing triple of halfspaces if they are pariwise disjoint. Theorem 6 Let X be an irreducible CAT(0) cubical complex. Assume that G is a finitely generated group of automorphisms of X which satisfies the following three conditions: G does not fix any point in the visual boundary of X, does not preserve any Euclidean subspace of X and acts essentially. Then X contains a facing triple of halfspaces k, h, l such that the three hyperplanes k̂, ĥ, l̂ are strongly separated and such that there exists a non-Abelian free group F < G with the property that F ∩ gStabG (ĥ)g −1 = {1} for all g ∈ G. Besides the facts about CAT(0) cubical complexes already recalled in the previous sections, we will further use the following three results from [15], which apply under the hypothesis of the previous theorem. 1. The space X contains a facing triple of halfspaces, see Theorem E in [15]. 2. We will use the flipping lemma from [15, §1.2]: for any halfspace h, there exists g ∈ G such that h∗ ( g(h). 3. Finally we will also use the double skewer lemma from [15, §1.2]: for any two halfspaces k ⊂ h, there exists g ∈ G such that g(h) ( k ⊂ h. We now turn to the proof of the theorem. Proof of Theorem 6. By 1 above, one can choose a facing triple of halfspaces h, h1 , h2 in X. By the flipping lemma, there exists an element k ∈ G such that k(h∗ ) ( h. We now define h3 = k(h1 ) and h4 = k(h2 ). By construction, h1 , h2 , h3 , h4 is a facing quadruple of halfspaces. We will need to assume moreover that these four halfspaces are strongly separated. This can be done thanks to the following lemma. Lemma 7 There exists half-spaces h0j ⊂ hj (1 ≤ j ≤ 4) such that the h0j s are strongly separated. Proof of Lemma 7. According to Theorem 2, we can find two halfspaces a1 ⊂ a2 such that the corresponding hyperplanes âi are strongly separated. We claim the following: Up to replacing the pair (a1 , a2 ) by the pair (a∗2 , a∗1 ), there exists i ∈ {1, 2, 3, 4} and x ∈ G such that x(a1 ) ⊂ x(a2 ) ⊂ h∗i . Let us prove this claim. First we prove that one of the four halfspaces a1 , a2 , a∗1 , a∗2 is contained in h∗j for some j. If this is false, each of these four halfspaces intersects the interior of each of the hj . In particular ak and a∗k intersect the interior of hj . Since hj is convex, âk intersects it also. Considering two indices j 6= j 0 and a geodesic from a point in âk ∩ hj to a point in âk ∩ hj 0 , one 8 sees that âk intersects each of the hyperplanes ĥj . Since this is true for k = 1, 2, this contradicts the fact that the hyperplanes aˆ1 and aˆ2 are strongly separated. This concludes the proof that one of the four halfspaces a1 , a2 , a∗1 , a∗2 is contained in h∗j for some j. If a2 or a∗1 is contained in one of the h∗j , this proves the claim (with x = 1). Otherwise we assume that a1 ⊂ h∗j (the last case a∗2 ⊂ h∗j being similar). In this case the double skewer lemma applied to a1 ⊂ a2 implies that there exists x ∈ G such that: x(a1 ) ⊂ x(a2 ) ⊂ a1 ⊂ h∗j . This proves our claim. We now write b1 := x(a1 ), b2 := x(a2 ). Since h1 ⊂ h∗2 , the double skewer lemma implies that there exists g ∈ G such that g(h∗2 ) ( h1 . Similarly there exists h ∈ G such that h3 ) h(h∗4 ). Applying one of the four elements g, g −1 , h, h−1 to b1 and b2 , we obtain two halfspaces which are contained in one of the hj . For instance if i = 2 in the claim above, one has g(b1 ) ⊂ g(b2 ) ⊂ h1 . In what follows we continue to assume that we are in this case, the other ones being similar. Since h1 ⊂ h∗4 and since h(h∗4 ) ⊂ h3 , one has hg(b1 ) ⊂ hg(b2 ) ⊂ h3 . Finally by a similar argument we have: g −1 hg(b1 ) ⊂ g −1 hg(b2 ) ⊂ h2 and h−1 g(b1 ) ⊂ h−1 g(b2 ) ⊂ h4 . We now define h01 = g(b1 ), h02 = g −1 hg(b1 ), h03 = hg(b1 ) and h04 = h−1 g(b1 ). We check that the h0j s are strongly separated halfspaces. It is clear that they are pairwise disjoint. We check that the corresponding hyperplanes are strongly separated. We do this for the pair {hˆ01 , hˆ02 }, the other cases being similar. If a hyperplane û intersects both hˆ01 and hˆ02 , it will have to intersect also g(b̂2 ). This contradicts the fact that the pair g(b̂1 ), g(b̂2 ) is strongly separated. Hence hˆ0 and hˆ0 are strongly separated. 2 1 2 We now continue our proof using the facing quadruple of strongly separated hyperplanes constructed in the previous lemma. So, up to replacing hj by h0j , we assume that (hj )1≤j≤4 is a facing quadruple of strongly separated halfspaces which moreover do not intersect ĥ. Exactly as in the proof of the previous lemma, the double skewer lemma implies that there exists g ∈ G such that g(h∗2 ) ( h1 and h ∈ G such that h3 ) h(h∗4 ). Define U = h1 ∪ h2 and V = h3 ∪ h4 . We now see that we have a Schottky pair: since g(V ) ⊂ h1 ⊂ h∗2 , for any positive integer n, we have g n (V ) ⊂ h1 ⊂ U . Also, since g −1 (V ) ⊂ h2 ⊂ h∗1 we have g −n (V ) ⊂ h2 ⊂ U for any positive integer n. Similarly hn (U ) ⊂ V for any non zero integer n. The ping-pong lemma implies that g and h generate a free subgroup of G. Note that this argument is borrowed from the proof of Theorem F in [15]. Now we observe that ĥ ⊂ U c ∩ V c . If we apply one of the four elements {g, g −1 , h, h−1 } to ĥ we obtain a subset of U or a subset of V . This implies that for any nontrivial element γ of hg, hi we have γ(ĥ) ⊂ U or γ(ĥ) ⊂ V . In particular γ(ĥ) ∩ ĥ = ∅, and the intersection of the groups hg, hi and StabG (ĥ) is trivial. We need to prove something slightly stronger. Namely we are looking for a free subgroup of G which intersects trivially every conjugate of StabG (ĥ). So we first make the following observation. Let x be an element of hg, hi which is not conjugate to a power of g or of h. We will prove that x does not belong to any conjugate of StabG (ĥ). Up to changing x into x−1 and up to conjugacy, we can assume that this element has the form: x = g a1 hb1 · · · g ar hbr 9 with ai , bi nonzero integers and r ≥ 1. This implies that any positive power xm of x satisfies xm (U ) ⊂ U . Better, since x(U ) ⊂ g a1 (V ) it follows from the properties of g and of the hi ’s that the distance of x(U ) to the boundary of U is bounded below by some positive number δ. This implies that d(xm (U ), ∂U ) ≥ mδ. (2) Similarly one proves that d(x−m (V ), ∂V ) ≥ mδ 0 (3) 0 for any m ≥ 1 and for some positive number δ . Suppose now by contradiction that x stabilizes a hyperplane û. Assume that û does not intersect U . For p ∈ û we have d(p, U ) = d(xm (p), xm (U )) for any integer m ≥ 1. But since xm (p) is never in U the quantity d(xm (p), xm (U )) is greater or equal to the distance from xm (U ) to ∂U . Hence we obtain, using Equation (2): d(p, U ) ≥ mδ which is a contradiction since the left hand side does not depend on m. This proves that û must intersect U . In a similar way, using Equation (3), one proves that û must intersect V . But this contradicts the fact that the halfspaces (hj )1≤j≤4 are pairwise strongly separated. Hence x does not preserve any hyperplane. In particular x is not contained in any G-conjugate of StabG (ĥ). Now one can consider a normal subgroup N of the free group hg, hi which does not contain any nontrivial power of g or h (for instance its derived subgroup). Any finitely generated subgroup F < N has the property that it intersects trivially every G-conjugate of StabG (ĥ). This proves our claim. We finally construct two halfspaces k and l as in the statement of the Theorem. We simply have to repeat the arguments used in the proof of Lemma 7. Exactly as in the proof of that lemma, one can find two halfspaces b1 ⊂ b2 which are contained in h∗j for some j and such that b̂1 and b̂2 are strongly separated. We assume that j = 2 to simplify. We continue as in the proof of the lemma. Applying the element g to b1 and b2 , we obtain two halfspaces which are contained in h1 : g(b1 ) ⊂ g(b2 ) ⊂ h1 . Since h1 ⊂ h∗4 and since h(h∗4 ) ⊂ h3 , one has hg(a1 ) ⊂ hg(a2 ) ⊂ h3 . Finally by a similar argument we have: g −1 hg(b1 ) ⊂ g −1 hg(b2 ) ⊂ h2 . We now define k = g(b1 ) and l = g −1 hg(b1 ). One now checks that ĥ, l̂, k̂ are strongly separated exactly as in the end of the proof of Lemma 7. 2 In what follows, we will use the following definition. Definition 2 Let G be a finitely generated group acting on a CAT(0) cubical complex X. We say that a hyperplane ĥ of X is stable for G if the Schreier graph StabG (ĥ)\G is nonamenable, i.e. satisfies a linear isoperimetric inequality. We say that a halfspace h is stable for G if the corresponding hyperplane ĥ is stable for G. Note that to define the Schreier graph of StabG (ĥ)\G, one needs to pick a finite generating set for G, but the (non)amenability of this graph is independent of this choice. We refer the reader to [36] for the discussion of various equivalent notions of amenability for Schreier graphs. Here we will only need the following: 10 Lemma 8 Let G be a group, H < G a subgroup, and F < G a finitely generated free group such that F ∩ gHg −1 = {1} for all g ∈ G. Then any Schreier graph of H\G satisfies a linear isoperimetric inequality i.e. is nonamenable. Proof. It is well-known that the Schreier graph of H\G satisfies a linear isoperimetric inequality if and only if the G-action on `2 (G/H) does not have almost invariant vectors. So we will prove this last fact. For this it is enough to prove that the F -action on `2 (G/H) does not have almost invariant vectors. But the hypothesis on F implies that F acts freely on G/H. Hence, as an F -representation, `2 (G/H) is isomorphic to a direct sum of copies of the regular representation of F on `2 (F ). This proves the claim. 2 We will need to record the following corollary of the previous theorem. Corollary 1 Under the hypothesis of Theorem 6, we have: • Any halfspace which is part of a facing triple of halfspaces is stable. • For any halfspace h which is part of a facing triple of halfspaces, and any finite index subgroup G2 of G, there exists γ ∈ G2 such that h and γ(h) are strongly separated. Proof. This is contained in the proof of the previous theorem. Indeed for the first point of the corollary, we observe that we started the proof of the previous theorem with any facing triple of halfspaces and proved that a given halfspace among the three is stable, as a consequence of Lemma 8. For the second point, we consider the triple h, l, k constructed in the previous theorem. We have l ⊂ h∗ . Applying the double skewer lemma to this last pair, we find x ∈ G such that x(h∗ ) ( l. This implies xn (h∗ ) ⊂ l for all n ≥ 1. We pick n0 ≥ 1 such that xn0 ∈ G2 . In particular the hyperplane xn0 (ĥ) is contained in l. Any hyperplane meeting both xn0 (ĥ) and ĥ would have to meet l̂, which is impossible since ĥ and l̂ are strongly separated. Hence xn0 (ĥ) and ĥ are strongly separated. 2 We will also use the following classical fact. Lemma 9 Let M be a closed Riemannian manifold with fundamental group G. Let H < G be a subgroup and let M1 → M be the covering space associated to H. Then the Schreier graph H\G satisfies a linear isoperimetric inequality if and only if M1 satisfies a linear isoperimetric inequality. A proof can be found in [30, Ch. 6]. Note that the proof in [30] is given only is the case when H is trivial, but the arguments apply in general. Combining Theorem 6, Corollary 1, and Lemma 9, we obtain: Proposition 10 Let M be a closed Riemannian manifold with fundamental group G. Suppose that G acts on a CAT(0) cubical complex X, satisfying the hypothesis of Theorem 6. Let h be a halfspace of X which is part of a facing triple of halfspaces and let ĥ be the corresponding hyperplane. Let Mĥ be the covering space of M corresponding to the subgroup StabG (ĥ) < G. Then, Mĥ satisfies a linear isoperimetric inequality. 11 3 Fibering Kähler groups acting on CAT(0) cubical complexes In this section we first give a criterion to produce fibrations of certain open Kähler manifolds over Riemann surfaces (Proposition 11). Although this criterion is well-known to experts, we explain how to deduce its proof from known results about filtered ends of Kähler manifolds. This serves as a pretext to survey this notion and its applications in the study of Kähler groups. Later, in sections 3.2 and 3.3, we explain how to construct pluriharmonic or plurisubharmonic functions on certain covering spaces of a compact Kähler manifold, starting from an action of its fundamental group on a CAT(0) cubical complex. We finally prove Theorem A in section 3.4. 3.1 Filtered ends The aim of this subsection is to recall the proof of the following classical proposition. Proposition 11 let M be a closed Kähler manifold. Let M1 → M be a covering space of M and f → M1 be the universal cover. We assume that there exists a proper, pluriharmonic map let π : M f. e : M1 → I where I is an open interval of R. Let ee := e ◦ π be the lift of e to the universal cover M If some level set of ee is not connected, then there exists a proper holomorphic map with connected fibers M1 → Σ where Σ is a Riemann surface. This applies in particular if some levet set of e is not connected. Before turning to the proof of the proposition, we recall briefly various notions of ends in topology and group theory. Let Y be a noncompact manifold. Recall that the number of ends of Y , denoted by e(Y ), is the supremum of the number of unbounded connected components of Y − K where K runs over the relatively compact open sets of Y with smooth boundary. Now if M is a closed manifold, M1 → M f → M1 the universal covering space, one can look at the number of a covering space, and π : M ends of various spaces, each of which also admits a purely group theoretical description. f; this is also the number of ends of the fundamental group • There is the number of ends of M of M . • There is the number of ends of the space M1 , which is an invariant of the pair π1 (M1 ) < π1 (M ) [34, 51]. When this number is greater than 1, one says that π1 (M1 ) has codimension 1 in π1 (M ) or that it is multi-ended. • There is also a third, less known notion, of filtered ends, which can be associated to a continuous map between two manifolds. Here we will only consider the case where this map is the universal covering map. This leads to the following definition. f → M1 be its universal covering space. A Definition 3 Let M1 be an open manifold and let π : M f → M1 ) is an element of the set filtered end of M1 (or of π : M f − π −1 (K)) lim π0 (M ← where K runs over the relatively compact open sets of M1 with smooth boundary. The number of filtered ends of M1 is denoted by ee(M1 ). 12 As for the previous notions, one can show that in the case where M1 covers a compact manifold M , this number only depends on the pair π1 (M1 ) < π1 (M ). Also, one always has ee(M1 ) ≥ e(M1 ). f → M1 can be greater than The interest in this notion is that the number of filtered ends of π : M 1 even if M1 is 1-ended. A simple example of this situation is obtained as follows. Take M to be a genus 2 closed surface and Σ to be a subsurface of genus 1 with one boundary component. The covering space M1 of M defined by the subgroup π1 (Σ) < π1 (M ) has this property. This notion was first introduced by Kropholler and Roller [40] in a purely group theoretical context. A topological approach to it was later given in the book by Geoghegan [27]. Filtered ends were studied in the context of Kähler groups by Gromov and the first author [23]. There, the name cut was used instead of filtered ends, or rather the term cut was used to indicate the presence of at least two filtered ends for a certain map or covering space, whereas the term Schreier cut referred to the classical notion of relative ends of a pair of groups in [23]. With the notion of filtered ends at our disposal, Proposition 11 will be a simple application of the following theorem. Theorem 12 Let M be a closed Kähler manifold and let M1 → M be an infinite covering space of M . If the number of filtered ends of M1 is greater or equal to 3, then there exists a proper holomorphic mapping with connected fibers M1 → Σ, where Σ is a Riemann surface. This result was proved in [23] under certain additional hypothesis of “stability”. A more general version was later proved by Napier and Ramachandran [46]. Their version includes the theorem stated above but also more general ones which apply to Kähler manifolds which are not necessarily covering spaces of a compact manifold. Before turning to the proof of Proposition 11, we make the following easy observation. Lemma 13 Let V be a complex manifold and f : V → R be a nonconstant smooth pluriharmonic function. Denote by Crit(f ) the set of critical points of f . Then for each t ∈ R, the set Crit(f ) ∩ f −1 (t) is nowhere dense in f −1 (t). The proof is straightforward, once one remembers that the function f is locally the real part of a holomorphic function F and that the critical set of f locally coincides with that of F . Proof of Proposition 11. Note that if M1 has at least three ends, the result follows from much older results, see [44]. Thus, we could assume that M1 has only two ends, although this is not necessary. Let t1 be a real number such that ee−1 (t1 ) is not connected. Let x and y be two points in distinct connected components of ee−1 (t1 ). By Lemma 13, we can assume that x and y are not critical point of f . We claim that at least one of the two sets {e e > t1 }, {e e < t1 } is not connected. Let us assume that this is false. Then one can find a path α from x to y contained in the set {e e ≥ t1 } and a path β from y to x contained in the set {e e ≤ t1 }. We can assume that α and β intersect ee−1 (t1 ) only at their endpoints. Let γ be the path obtained by concatenating α and β. Let γ1 : S 1 → M1 be a smooth map freely homotopic to γ, intersecting ee−1 (t1 ) only at f is simply connected, we can find a the points x and y and transverse to ee−1 (t1 ) there. Since M smooth map f u : D2 → M coinciding with γ1 on the boundary. Pick ε > 0 small enough, such that t1 + ε is a regular value of ee ◦ u. The intersection of the level ee ◦ u = t1 + ε with the boundary of the disc is made of two points aε and bε such that u(aε ) → x and u(bε ) → y when ε goes to 0. Let Iε be the connected 13 component of the set {e e ◦ u = t1 + ε} whose boundary is {aε , bε }. Up to taking a subsequence, we can assume that Iε converges as ε goes to 0 to a compact connected subset I0 ⊂ {e e ◦ u = t1 }. Now the set u(I0 ) is connected, contained in ee−1 (t1 ) and contains x and y. This contradicts the fact that x and y are in distinct components of ee−1 (t1 ). Hence at least one of the two sets {e e > t1 } and {e e < t1 } is not connected. Note that the maximum principle implies that no connected component of these open sets can be at bounded distance from the set ee−1 (t1 ). This is easily seen to imply that M1 has at least three filtered ends. The conclusion now follows from Theorem 12. 2 Remark 1 Note that our Proposition 11 can be applied to the case where e is the primitive of the lift of a harmonic 1-form α on M with integral periods and where M1 is the covering space associated to the kernel of the homomorphism π1 (M ) → Z induced by α. In this case one recovers a particular case of a result due to Simpson [52]. Hence Theorem 12 about filtered ends implies this particular case of the result of Simpson. Proposition 11 can also be thought of as a nonequivariant version of Simpson’s result. 3.2 The first pluriharmonic map We now consider a CAT(0) cubical complex X, assumed to be irreducible and locally finite. Let M be a compact Kähler manifold and let Γ be its fundamental group. We consider a homomorphism % : Γ → Aut(X). We suppose that the Γ-action on X satisfies the three hypothesis of Theorem A, although this will f the universal cover of M . If ĥ is a hyperplane of not be used untill section 3.3. We denote by M f X we will write Mĥ for the quotient of M by the group StabΓ (ĥ): f/StabΓ (ĥ). Mĥ = M Since X is contractible, one can choose a Lipschitz hyperplane ĥ of X and a halfspace h associated to ĥ.   d(x, ĥ) dh (x) =  −d(x, ĥ) (4) f → X. We fix a %-equivariant map ψ : M Define a function dh on X by if x ∈ h, if x ∈ h∗ . f → R be the composition f = dh ◦ ψ. Finally let f be the function induced by f on M . Let f : M ĥ Proposition 14 The map f is proper. In particular the manifold Mĥ has at least two ends. f. We consider the Proof. In the following proof, we let H = StabG (ĥ). We pick a point x0 in M map F : H\G → R defined by F (Hg) = f (g · x0 ). It is enough to prove that F is proper, this is easily seen to imply that f is proper. So let (gn ) be a sequence of elements of G such that |F (Hgn )| ≤ C, (5) for some constant C. We need to prove that the set {Hgn } is a finite subset of H\G. But equation (5) implies that the distance of %(gn )(ψ(x0 )) to ĥ is bounded by C. Put differently this says that each of the hyperplanes (%(gn )−1 (ĥ)) intersects the ball of radius C centered at ψ(x0 ). By our hypothesis of local finiteness of X this implies that the family of hyperplanes (%(gn )−1 (ĥ)) 14 is finite. Hence there exists element x1 , . . . , xr in G such that for all n there exists i such that %(gn )−1 (ĥ) = %(xj )(ĥ). This implies Hgn = Hx−1 2 i . In what follows we will denote by Ends(V ) the space of ends of an open manifold V . We recall that V ∪ Ends(V ) carries a natural topology, see for instance [26, Ch.6]. We now make use of the following classical theorem. Theorem 15 Let V be a complete Riemannian manifold of bounded geometry and satisfying a linear isoperimetric inequality. Let χ : Ends(V ) → {−1, 1} be a continuous map. Then there exists a unique continuous map hχ : V ∪ Ends(V ) → [−1, 1] which extends χ, is harmonic on V , and has finite energy: Z |∇hχ |2 < ∞. V Note that we will not need the precise definition of a Riemannian manifold of bounded geometry; the only important point we need is that a covering space of a closed Riemannian manifold is of bounded geometry. This theorem was proved by Kaimanovich and Woess [35] and by Li and Tam [42] independently. A simple beautiful proof due to M. Ramachandran can be found in the paper by Kapovich [37, §9]. In the case when V is Kähler, the map hχ is pluriharmonic. This follows from a standard integration by part argument, which is valid here because hχ has finite energy, see Lemma 3.1 in [41] or [29, §1.1.B]. We now assume that ĥ is stable for Γ and apply the above to the manifold V = Mĥ . The proper function f defines a partition of the space of ends of this manifold into two open sets: the set of ends of {f ≥ 0} and the set of ends of {f ≤ 0}. Let χ : Ends(V ) → {−1, 1} be the function taking the value 1 on the first open set and −1 on the second open set. Since Mĥ satisfies a linear isoperimetric inequality, we obtain: Proposition 16 There exists a unique function uh : Mĥ → (−1, 1) which is pluriharmonic, of finite energy and satisfies uh (x) → 1 when x → ∞ and f (x) > 0 and uh (x) → −1 when x → ∞ and f (x) < 0. f to M . For t0 ∈ (0, 1) we define: We denote by p the projection from M ĥ f, uh (p(x)) > t0 }. Uh,t0 = {x ∈ M We have: Lemma 17 If t0 is close enough to 1 the set Uh,t0 satisfies ψ(Uh,t0 ) ⊂ h. Proof. By the continuity of uh on Mĥ ∪ Ends(Mĥ ), we have that if t0 is close enough to 1, one has the inclusion {uh > t0 } ⊂ {f ≥ 0}. This implies the conclusion of the lemma. 2 We will ultimately produce a fibration of the manifold Mĥ onto a Riemann surface. To achieve this, we will construct a second plurisubharmonic function defined on Mĥ , which is not a function of uh . We build this second map in the next section. 3.3 A second plurisubharmonic map We consider a facing triple of strongly separated halfspaces h, k, l as given by Theorem 6. According to Corollary 1, h, k and l are stable for Γ. Thus, we can apply the results of section 3.2 to anyone 15 of the three covering spaces Mĥ , Mk̂ , Ml̂ . We recall that these covering spaces were defined by Equation (4). We also make use of the various lemmas proved in section 2.2. In particular we consider the subgroup A < StabΓ (ĥ) generated by Σ = {h ∈ StabΓ (ĥ), h(k) ∩ k 6= ∅}. If a ∈ A, the hyperplane a(k̂) is stable for Γ, as k̂ is. Thus, we can also apply the results of section 3.2 to the covering space Ma(k̂) . So we denote by uh : Mĥ → (−1, 1) and ua(k) : Ma(k̂) → (−1, 1) the proper pluriharmonic maps of finite energy provided by Proposition 16. f f For each a ∈ A, let u ] a(k) be the lift of ua(k) to M . Now define a function βk : M → R by: βk (x) = sup u ] a(k) (x). a∈A Proposition 5 implies that the A-orbit of k is finite, hence the supremum above is actually the supremum of a finite number of smooth pluriharmonic functions. Hence βk is a continuous plurisubharmonic function. We now fix some constant C in (0, 1). Let Vk,C = {βk > C}. f → R is A-invariant. In particular the open set Vk,C ⊂ M f Lemma 18 1. The function βk : M is A-invariant. 2. For each a ∈ A, there exists Ca ∈ (0, 1) such that ψ({ug a(k) > Ca }) ⊂ a(k). 3. If C is close enough to 1, one has ψ(Vk,C ) ⊂ ∪a∈A a(k). Proof. Note that by the uniqueness of the map ua(k) , we have: u ] ek ◦ a−1 . a(k) = u So the function βk is also equal to sup uek ◦ a−1 , a∈A which is A-invariant. This proves the first point. The second point was already proved in Lemma 17 for the harmonic function uh : Mĥ → (−1, 1) and the proof is similar here. As for the third point, if A1 ⊂ A is a finite set such that {a(k)}a∈A = {a(k)}a∈A1 , the constant C = max Ca has the a∈A1 2 desired property. We now assume that the constant C satisfies the conclusion of the previous lemma. Note that ∗ f/A. This open set actually the open set Vk,C naturally defines an open set Vk,C = Vk,C /A inside M f by the bigger subgroup StabΓ (ĥ). Namely: embeds into the quotient of M f/A → M is injective on the closure of V ∗ . Proposition 19 The natural map π : M k,C ĥ Proof. We will check that if h ∈ StabΓ (ĥ) − A then h(Vk,C ) ∩ Vk,C is empty. Let us suppose by contradiction that this is not empty for some h ∈ StabΓ (ĥ) − A. Let x ∈ Vk,C be such that h(x) ∈ Vk,C . By Lemma 18 (3), there exist a1 , a2 ∈ A such that ψ(x) ∈ a1 (k) and ψ(h(x)) ∈ a2 (k). This implies that h(a1 (k)) ∩ a2 (k) 6= ∅. By Lemma 4, h must be in A, a contradiction. 2 ∗ We now define a function γ : Mĥ → R+ as follows. If x ∈ π(Vk,C ), define γ(x) = βk (y) − C, ∗ where y is a lift of x inside Vk,C . If x ∈ / π(Vk,C ), define γ(x) = 0. We have: 16 Lemma 20 If C is close enough to 1, the function γ is continuous and plurisubharmonic. Hence, ∗ Vk,C is a plurimassive set in the sense of [46, Def. 1.1]. f/A → M . Up to taking Proof. As in the previous Proposition, we denote by π the projection M ĥ C closer to 1, we can always assume that there exists C0 ∈ (0, C) such that the conclusion of the third point of Lemma 18 holds for C0 . We claim that F := π(Vk,C /A) is closed. We first conclude the proof of the lemma using this claim. We consider the two open sets π(Vk,C0 /A) and Mĥ − F. They cover Mĥ , hence it is enough to prove that γ is continuous and plurisubharmonic on each of them. On Mĥ − F , γ is 0 so there is nothing to prove. On π(Vk,C0 /A), the function γ is constructed f. It descends to a as follows: one considers the plurisubharmonic function max(βk − C, 0) on M f/A → R+ . The restriction of γ to π(Vk,C /A) is obtained by composing the inverse function q : M 0 of the map π : Vk,C0 /A → π(Vk,C0 /A) with q. Hence it is continuous and plurisubharmonic. We finally prove that F := π(Vk,C /A) is closed. It is enough to see that [ h(Vk,C ) h∈StabΓ (ĥ) is closed. For this it is enough to check that there exists ε > 0 such that for any h ∈ StabΓ (ĥ) − A, the distance from h(Vk,C ) to Vk,C is greater or equal to ε. Applying the map ψ, we see that it is enough to find a positive lower bound, independent of h ∈ StabΓ (ĥ) − A, for the distance from h(U ) to U in X, where U = ∪a∈A a(k), as in section 2.2. But this follows from the fact that there is a uniform positive lower bound for the distance between two disjoint halfspaces in a CAT(0) cubical complex. 2 We started this section considering a facing triple of strongly separated hyperplanes h, k and l. So far, we only used h and k. In the next proposition, we make use of the third hyperplane l. f) are connected. Then, there Proposition 21 Assume that the level sets of u fh (the lift of uh to M exists a finite cover M2 → Mĥ (possibly equal to Mĥ ) and a continuous plurisubharmonic function δ : M2 → R+ such that there exists a level set of the lift of uh to M2 on which δ is not constant. Proof. Note that the function uh is surjective. Assume that the conclusion of the proposition is false when M2 = Mĥ and δ = γ. Then there exists a function ϕ : (−1, 1) → R+ such that γ = ϕ ◦ uh . We claim that the function ϕ is continuous, convex, and vanishes on [t0 , 1) for t0 close enough to 1. Let us prove these claims. First we note that ϕ is continuous in a neighborhood of every real number t such that u−1 h (t) is not contained in the critical set of uh . But every real number t has this property according to Lemma 13. Hence ϕ is continuous on (−1, 1). Note that this argument proves that for each t ∈ (−1, 1), one can find q ∈ Mĥ and local coordinates (z1 , . . . , zn ) centered at q such that γ(z) = ϕ(uh (q) + Re(z1 )). The convexity of ϕ then follows from [24, 5.13]. For the last claim, we pick a f such that uh (p(x)) > t0 . Here and as before p denotes the projection M f → M . If t0 point x ∈ M ĥ is close enough to 1, Lemma 17 implies that ψ(x) ∈ h. Since h and [ a(k) a∈A 17 are disjoint, Lemma 18 implies that h(x) ∈ / Vk,C for any h in StabΓ (ĥ). Hence γ(p(x)) = 0. This proves that ϕ vanishes on [t0 , 1). These three properties of ϕ imply that the level sets of ϕ are connected. In fact the level ϕ = c is a point for c > 0 and is an interval of the form [a0 , 1) for c = 0. This implies, together with the f → R+ are connected. But this hypothesis on the level sets of u fh , that the level sets of γ ◦ p : M implies StabΓ (ĥ) = A. Now since the A-orbit of k is finite, the group H2 = StabΓ (ĥ) ∩ StabΓ (k̂) is of finite index in StabΓ (ĥ). Let M2 → M1 be the corresponding cover and u2 be the lift of uh to M2 . Let δ be the lift of the function uk to M2 . We claim that δ satisfies the conclusion of the proposition. If this is not the case, then δ is a function of u2 . As before one sees that δ = ϕ0 ◦ u2 where ϕ0 is continuous and convex. Actually, since δ is pluriharmonic and not only plurisubharmonic, ϕ0 must be affine. So there exists real numbers a and b such that: δ = au2 + b. Since u2 and δ both take values into (−1, 1) and are onto, one sees that b must be 0 and that a = ±1. We now obtain a contradiction from this fact, making use of the hyperplane l. Let sn be f such that d(ψ(sn ), l̂) goes to infinity and such that ψ(sn ) ∈ l. Such a a sequence of points of M sequence exists because the action is essential. Since d(ψ(sn ), h) ≥ d(ψ(sn ), l̂) we must have that f (p(sn )) → −∞, hence also uh (p(sn )) → −1. f → M2 . In the next paragraph, we denote by x 7→ [x] the covering map M If a = −1, one sees that δ([sn ]) → 1 which implies that ψ(sn ) ∈ k for n large enough. Hence Ψ(sn ) ∈ k ∩ l. This is a contradiction since k and l are disjoint. If a = 1 we argue in a similar way f such that ψ(qn ) ∈ h and d(ψ(qn ), ĥ) → ∞. with the pair (h, k). We take a sequence qn of points of M This implies u2 ([qn ]) → 1. Since δ = u2 this implies that ψ(qn ) ∈ k for n large enough. Since k ∩ h is empty we get a contradiction again. This proves the proposition. 2 3.4 Producing fibrations We continue with the notations and hypothesis from section 3.3. Our aim is now to prove the following: Proposition 22 The manifold Mĥ fibers: there exists a proper holomorphic map Mĥ → Σ with connected fibers onto a Riemann surface Σ. Proof. By Proposition 11, we can assume that the level sets of the lift of the map uh : Mĥ → (−1, 1) to the universal cover are connected, otherwise the conclusion is already known. By Proposition 21, we can first replace Mĥ by a finite cover p : M2 → Mĥ such that there exists a function δ : M2 → R+ which is continuous, plurisubharmonic and not constant on the set {uh ◦p = t} for some real number t. Note that if this is true for some number t, one can always find a number t0 , close to t, which has the same property and moreover satisfies that t0 is a regular value of uh ◦ p. Let F be the foliation of M2 defined by the (1, 0) part of the differential of uh ◦ p. Note that d(uh ◦ p) might have zeros; we refer to [2, p.55] for the precise definition of F . We now consider the manifold Xt0 = (uh ◦ p)−1 (t0 ). 18 It is invariant by the foliation F . Hence on Xt0 we have a real codimension 1 foliation defined by the nonsingular closed 1-form which is the restriction of dC (uh ◦ p) to Xt0 . Such a foliation has all its leaves closed or all its leaves dense; this is an elementary particular case of the theory of Riemannian foliations. We must thus show that the restriction of F to Xt0 cannot have all its leaves dense. Let q be a point where the restriction of δ to Xt0 reaches its maximum m. Let L(q) be the leaf of F through q. The maximum principle implies that δ is constant on L(q). Hence the closure of L(q) is contained in the set δ = m. Since δ is not constant on Xt0 , L(q) cannot be dense in Xt0 , hence is closed. We have found a compact leaf of the foliation F . This compact leaf projects to a compact leaf of the foliation Fĥ defined by du1,0 h on Mĥ . But it is now classical that this implies that the foliation Fĥ is actually a fibration. See for instance [14, (7.4)] or [23, §4.1].2 Now we will apply the following result: Let V be a closed Kähler manifold. Assume that V has a covering space V1 → V which admits a proper holomorphic mapping to a Riemann surface, with connected fibers: π1 : V1 → Σ1 . Then π1 descends to a finite cover of V : there exists a finite cover V2 of V such that V1 → V decomposes as V1 → V2 → V , V2 admits a holomorphic mapping π2 : V2 → Σ2 with connected fibers and there exists a holomorphic map Σ1 → Σ2 which makes the following diagram commutative: V1 / Σ1  V2  / Σ2 . This fact is now well-known, we refer the reader to [23, §5.6] or [45, Prop. 4.1] for a proof. Applying this result to V = M and to the cover V1 = Mĥ we obtain a finite cover M2 → M and a fibration π2 : M2 → Σ onto a Riemann surface. By replacing M2 by another finite cover, we can assume that the fundamental group of a smooth fiber of π2 surjects onto the kernel of the map (π2 )∗ : π1 (M2 ) → π1 (Σ). Note that a smooth fiber of the fibration of Mĥ obtained in Proposition 22 projects onto a smooth fiber of π2 . This implies that the normal subgroup N := Ker((π2 )∗ : π1 (M2 ) → π1 (Σ)) is contained in the stabilizer of ĥ inside π1 (M2 ). In what follows, we write Γ2 = π1 (M2 ). To conclude the proof of Theorem A, we only have to establish the next proposition. Proposition 23 The normal subgroup N acts as an elliptic subgroup of Aut(X) i.e. the fixed point set of N in X is nonempty. Proof. We know that N is contained in the group StabΓ2 (ĥ). But since N is normal in Γ2 , N is contained in StabΓ2 (γ(ĥ)) for all γ in Γ2 . By Corollary 1, we can pick γ ∈ Γ2 such that ĥ and γ(ĥ) are strongly separated. Since N preserves ĥ and γ(ĥ) it must preserve the projection of ĥ onto γ(ĥ), which is a point according to Proposition 1. Hence N is elliptic. 2 4 4.1 Cubulable Kähler manifolds and groups Cubulable Kähler groups We first recall a few definitions concerning finiteness properties of groups as well as a result by Bridson, Howie, Miller and Short [10]. These will be used in the proof of Theorem B. A group G 19 is of type FPn if there is an exact sequence Pn → Pn−1 → · · · → P0 → Z → 0 of ZG-modules, where the Pi are finitely generated and projective and where Z is considered as a trivial ZG-module. It is of type FP∞ if it is of type FPn for all n. See [12, §VIII.5] for more details on these notions. We simply mention that the fundamental group of a closed aspherical manifold is of type FP∞ . It is proved in [10] that if H1 , . . . , Hn are either finitely generated free groups or surface groups and if G is a subgroup of the direct product H1 × · · · × Hn which is of type FPn , then G is virtually isomorphic to a direct product of at most n groups, each of which is either a surface group of a finitely generated free group. We also refer the reader to [9, 11] for more general results. Note that the idea of applying the results from [10] to Kähler groups is not new. This possibility was already discussed in [9, 11], and put into use in [48]. We also mention here that there exist Kähler groups which are subgroups of direct products of surface groups but which are not of type FP∞ , see [25, 43]. We now prove Theorem B. So let Γ and X be as in the statement of the theorem. Let X = X1 × · · · × Xr be the decomposition of X into a product of irreducible CAT(0) cubical complexes. There is a finite index subgroup Γ1 of Γ which preserves this decomposition. Note that the action of Γ1 on each of the Xi is essential since the original action is essential on X. We will make use of the following two results from [15]: • The group Γ1 contains an element γ0 which acts as a rank 1 isometry on each irreducible factor. • The group Γ1 contains a copy of Zr . See [15], Theorem C and Corollary D for these statements. We recall here that a rank 1 isometry of a CAT(0) space is a hyperbolic isometry none of whose axis bounds a flat half-plane. Proposition 24 Let i ∈ {1, . . . , r}. Exactly one of the following two cases occurs: 1. The action of Γ1 preserves a geodesic line in Xi . 2. The action of Γ1 has no invariant Euclidean flat in Xi and fixes no point in the viusal boundary of Xi . Proof. Since Γ1 contains a rank 1 isometry, if Γ1 preserves a Euclidean flat in Xi , this flat must be a geodesic line. According to Proposition 7.3 from [15] (see also the proof of that proposition), if Γ1 does not preserve a geodesic line in Xi , it does not have any fixed point in the visual boundary of Xi . 2 Up to replacing Γ1 by a finite index subgroup, we assume that whenever Γ1 preserves a geodesic line Li in some Xi , it acts by translations on it. In this case, the translation group is discrete as follows from [7] for instance. Hence the action of Γ1 on Li factors through a homomorphism to Z. We now continue the proof of Theorem B. We change the numbering of the factors Xi ’s so that for 1 ≤ i ≤ k, Γ1 preserves a geodesic line in Xi and acts by translations on it, whereas for i > k, 20 it fixes no point in the visual boundary of Xi and preserves no flat. Hence for j > k, the Γ1 -action on Xj satisfies all the hypothesis of Theorem A. Using Theorem A we get a finite index subgroup Γ2 < Γ1 and a homomorphism ψ : Γ2 → Zk × π1 (Σ1 ) × · · · × π1 (Σr−k ) (6) with the following properties: 1. The homomorphism Γ2 → π1 (Σj ) induced by ψ is surjective for each k + 1 ≤ j ≤ r. 2. For each i, there exists a convex cobounded subset Yi ⊂ Xi on which the Γ2 -action factors through the coordinate number i of the homomorphism Γ2 → Zk if i ≤ k or through the homomorphism Γ2 → π1 (Σi−k ) if i > k. Since the action of Γ2 is proper, the kernel N of ψ is finite. By replacing Γ2 by a finite index subgroup Γ3 , we can assume that N ∩ Γ3 is central in Γ3 . We thus have a central extension: {0} / N ∩ Γ3 / Γ3 / ψ(Γ3 ) / {0}. Lemma 25 The group ψ(Γ3 ) is of type FP∞ . Proof. Let Y ⊂ X be the fixed point set of N . This is a subcomplex of the first cubical subdivision of X. Since ψ(Γ3 ) is torsion-free, it acts freely on Y . The quotient Y /ψ(Γ3 ) is a finite complex, hence ψ(Γ3 ) is of type FL, in particular FP∞ . See [12, VIII.6] for the definition of the FL condition and its relation to the FPn and FP∞ conditions. 2 Now the result of [10] implies that ψ(Γ3 ) itself is isomorphic to a direct product of surface groups and finitely generated free groups. No non-Abelian free factor can appear, but since this is not needed for the next lemma, we will postpone a little bit the explanation of this fact. Lemma 26 The group Γ3 has a finite index subgroup Γ4 which does not intersect N . In particular Γ4 ' ψ(Γ4 ). Proof. It is enough to prove that the central extension of ψ(Γ3 ) by N ∩Γ3 appearing above becomes trivial on a finite index subgroup of ψ(Γ3 ). Being isomorphic to a direct product of surface groups and free groups, ψ(Γ3 ) has torsion-free H1 . Hence the universal coefficient theorem implies that H 2 (ψ(Γ3 ), N ∩ Γ3 ) is isomorphic to Hom(H2 (ψ(Γ3 ), Z), N ∩ Γ3 ). If H < ψ(Γ3 ) is a subgroup of finite index such that every element in the image of the map H2 (H, Z) → H2 (ψ(Γ3 ), Z) is divisible by a large enough integer p, the pull-back map Hom(H2 (ψ(Γ3 ), Z), N ∩ Γ3 ) → Hom(H2 (H, Z), N ∩ Γ3 ) is trivial. Hence the desired central extension is trivial on H. 2 As in Lemma 25, one proves that Γ4 is of type FP∞ . Applying again the result of [10], we get that Γ4 is isomorphic to a direct product of surface groups, possibly with a free Abelian factor. To obtain the more precise statement of Theorem B, and to justify the fact Γ4 does not contain any free non-Abelian factor, we argue as follows. We will call direct factor of the product Zk × π1 (Σ1 ) × · · · × π1 (Σr−k ). (7) either one of the groups π1 (Σs ) or one of the Z copy of Zk . The intersection of Γ4 with each of the r direct factors in (7) must be nontrivial because Γ4 contains a copy of Zr . Indeed if one of these intersections was trivial, Γ4 would embed into a direct product which does not contain Zr . We call L1 , . . . , Lr these intersections, where Li < Z for 1 ≤ i ≤ k and where Li < π1 (Σi−k ) for i ≥ k + 1. The proof of [10, p. 101] shows that for i ≥ k + 1, Li is finitely generated and of finite index inside π1 (Σi−k ). This implies that Γ4 contains a finite index subgroup Γ∗ which is the direct product of each of its intersections with the factors in (7). The group Γ∗ now satisfies the conclusion of Theorem B. 21 4.2 Cubulable Kähler manifolds We now turn to the proof of Theorem D. Let M be as in the statement of the theorem. Note that in particular, M is aspherical. Applying Corollary C, we see that a finite cover M1 of M has fundamental group isomorphic to a product of the form Z2l × π1 (S1 ) × · · · × π1 (Sm ) (8) where the Si ’s are closed surfaces of genus greater than 1. We fix such an isomorphism and we denote by πi (1 ≤ i ≤ m) the projection from π1 (M1 ) onto π1 (Si ). From now on the proof will not make any further use of CAT(0) cubical complexes. We only use arguments from Kähler geometry. First, we will need the following classical result, see Theorem 5.14 in [16]: Theorem 27 Let X be a Kähler manifold, S a topological surface of genus > 2, and π : π1 (X) → π1 (S) a surjective homomorphism with finitely generated kernel. Then, there exists a complex structure on S and a holomorphic map with connected fibers p : X → S such that the map p∗ : π1 (X) → π1 (S) induced by p is equal to π. Applying this theorem to the various πi ’s we obtain that the surfaces Si ’s can be endowed with complex structures such that one has holomorphic maps pi : M1 → Si inducing the homomorphisms πi at the level of fundamental group. Let A be the Albanese torus of M1 and let α : M1 → A be the Albanese map, which is welldefined up to translation. We also denote by Ai the Albanese torus (or Jacobian) of the Riemann surface Si and by αi : Si → Ai the corresponding map. By definition of the Albanese maps, for each i there exists a holomorphic map ϕi : A → Ai which makes the following diagram commutative: M1 α /A αi  / Ai . pi  Si ϕi We denote by ϕ : A → A1 × · · · × Am the product of the maps ϕi and by β : S1 × · · · × Sm → A1 × · · · × Am the product of the maps αi . Up to composing the maps αi ’s with some translations, we can and do assume that ϕ maps the origin of A to the origin of A1 × · · · × Am , hence is a group homomorphism. Let Y be the following submanifold of A: Y = {y ∈ A, ϕ(y) ∈ Im(β)} This is indeed a submanifold since β is an embedding and ϕ is a submersion. Now by construction the Albanese map α of M1 can be written as: α=i◦Φ where i is the inclusion of Y in A and Φ : M1 → Y is holomorphic. We now have: Lemma 28 The map Φ is a homotopy equivalence between M1 and Y . Proof. Let B be the kernel of the map ϕ. The complex dimension of B is equal to   m X 1 b1 (M1 ) − b1 (Sj ) 2 j=1 22 which equals the number l appearing in Equation (8). One can find a C ∞ diffeomorphism θ : A → B × A1 × · · · × Am such that ϕ ◦ θ−1 is equal to the natural projection B × A1 × · · · × Am → A1 × · · · × Am . This implies that the complex manifold Y is C ∞ diffeomorphic to B × S1 × · · · × Sm . In particular, Y and M1 have isomorphic fundamental groups. We finally prove that Φ induces an isomorphism on fundamental groups. It follows from our description of Y that one can choose identifications of π1 (M1 ) and π1 (Y ) with Z2l × π1 (S1 ) × · · · × π1 (Sm ) in such a way that Φ∗ preserves each of the projections onto the groups π1 (Sj ). This implies that Φ∗ induces an isomorphism between the quotients of π1 (M1 ) and π1 (Y ) by their respective centers. To conclude, it is enough to check that Φ∗ induces an isomorphism between the centers of π1 (M1 ) and π1 (Y ). But the composition of Φ∗ with the projection from π1 (Y ) onto its abelianization coincides with the map α∗ : π1 (M1 ) → π1 (A) ' H1 (M1 , Z). Since the center of π1 (M1 ) injects in H1 (M1 , Z), the restriction of Φ∗ to the center of π1 (M1 ) must be injective. Now using the fact that the quotient of H1 (M1 , Z) by the image of the center of π1 (M1 ) in H1 (M1 , Z) is torsionfree, one sees easily that Φ∗ (Z(π1 (M1 ))) must be equal to the center of π1 (Y ). This concludes the proof that Φ∗ is an isomorphism. The manifold M1 is aspherical by hypothesis. The manifold Y is also aspherical since it is diffeomorphic to B × S1 × · · · × Sm . Since Φ induces an isomorphism on fundamental group, it is a homotopy equivalence. This concludes the proof of the lemma. 2 We now conclude the proof using the following fact due to Siu and contained in the proof of Theorem 8 from [53]: Let f : Z1 → Z2 be a holomorphic map between two compact Kähler manifolds of dimension n. Assume that f is of degree 1 and that the induced map H2n−2 (Z1 , R) → H2n−2 (Z2 , R) is injective. Then f is a holomorphic diffeomorphism. The conclusion holds in particular if f is a homotopy equivalence. Applying Siu’s result to the map Φ : M1 → Y we obtain that M1 and Y are biholomorphic. This proves the first statement in Theorem D. When the original manifold M is algebraic, an easy application of Poincaré’s reducibility theorem [21, VI.8] shows that a finite cover of M1 is actually biholomorphic to a product of a torus with finitely many Riemann surfaces. This concludes the proof of Theorem D. 5 Comments We discuss here some possible improvements to our results. First, one would like to remove the hypothesis of local finiteness in Theorem A. We summarize at which points this hypothesis was used: 1. It was used for the first time in Proposition 5. However in this place, we have seen that it can be replaced by the hypothesis that the group action under consideration has finite stabilizers. Note that Proposition 5 is used later in section 3.3 to prove that a certain function defined as a supremum of continuous plurisubharmonic functions is actually the supremum of a finite number of continuous functions, hence is continuous. 23 2. It is also used in the proof of Proposition 14 to show that the signed distance function to a hyperplane induces a proper function on a suitable covering space of the manifold under consideration. Second, one could try to remove the hypothesis that there is no fixed point in the visual boundary in Theorem A. There is a well-known strategy to achieve this, see [17, §2.H] as well as appendix B by Caprace in [17]. If a group G acts without fixed point on a CAT(0) cubical complex X but with a fixed point in the visual boundary ∂∞ X, one can construct another CAT(0) cubical complex X1 , of smaller dimension, on which G acts and such that X1 embeds in the Roller boundary of X. By applying this construction repeatedly, one can obtain a description of actions having a fixed point in the visual boundary. The reason why we cannot use this method here is that the passage from X to X1 does not preserve the local finiteness of the complex. We thank PierreEmmanuel Caprace for useful discussions concerning this point. Thus, one sees that removing the hypothesis of local finiteness from Theorem A should also allow to describe parabolic actions of Kähler groups on CAT(0) cubical complexes. Note that parabolic actions of Kähler groups on trees are already understood [22]. References [1] I. Agol, The virtual Haken conjecture, with an appendix by I. Agol, D. Groves and J. Manning, Doc. Math. 18 (2013), 1045–1087. – cited on p. 2 [2] J. Amoros, M. Burger, K. Corlette, D. Kotschick and D. Toledo, Fundamental groups of compact Kähler manifolds, Mathematical Surveys and Monographs 44, American Mathematical Scoiety, Providence, RI, 1996. – cited on p. 2, 18 [3] W. Ballmann and J. Swiatkowski, On groups acting on nonpositively curved cubical complexes, Enseign. Math. (2) 45, No. 1-2 (1999), 51–81. – cited on p. 2 [4] J. Behrstock and R. Charney, Divergence and quasimorphisms of right-angled Artin groups, Math. Ann. 352, No. 2 (2012), 339–356. – cited on p. 6 [5] N. Bergeron, F. Haglund and D. T. Wise, Hyperplane sections in arithmetic hyperbolic manifolds, J. Lond. Math. Soc. (2) 83, No. 2 (2011), 431–448. – cited on p. 2 [6] N. Bergeron and D. T. Wise, A boundary criterion for cubulation, Amer. J. Math. 134, No. 3 (2012), 843–859. – cited on p. 2 [7] M. Bridson,On the semisimplicity of polyhedral isometries, Proc. Amer. Math. Soc. 127, No. 7 (1999), 2143–2146. – cited on p. 20 [8] M. Bridson and A. Haefliger, metric spaces of nonpositive curvature, Grundlehren der Mathematischen Wissenschaften 319, Springer-Verlag, Berlin (1999). – cited on p. 2, 4, 5, 6 [9] M. Bridson and J. Howie, Subgroups of direct products of elementarily free groups, Geom. Funct. Anal. 17, No. 2 (2007), 385–403. – cited on p. 20 [10] M. Bridson, J. Howie, C. F. Miller III and H. Short, The subgroups of direct products of surface groups, Dedicated to John Stallings on the occasion of his 65th birthday, Geom. Dedicata 92 (2002), 95–103. – cited on p. 3, 19, 20, 21 [11] M. Bridson, J. Howie, C. F. Miller III and H. Short, Subgroups of direct products of limit groups, Ann. of Math. (2) 170, No. 3 (2009), 1447–1467. – cited on p. 20 24 [12] K. S. Brown, Cohomology of groups, Corrected reprint of the 1982 original, Graduate Texts in Mathematics 87, Springer-Verlag, New York, (1994). – cited on p. 20, 21 [13] M. Burger, Fundamental groups of Kähler manifolds and geometric group theory, Bourbaki Seminar No. 1022, Astérisque No. 339 (2011). – cited on p. 2 [14] J. Carlson and D. Toledo, Harmonic mappings of Kähler manifolds to locally symmetric spaces, Inst. Hautes Études Sci. Publ. Math. No. 69 (1989), 173–201. – cited on p. 19 [15] P.-E. Caprace and M. Sageev, Rank rigidity for CAT(0) cube complexes, Geom. Funct. Anal. 21, No. 4 (2011), 851–891. – cited on p. 3, 4, 6, 7, 8, 9, 20 [16] F. Catanese, Differentiable and deformation type of algebraic surfaces, real and symplectic structures, Symplectic 4-manifolds and algebraic surfaces, Lecture Notes in Math. 1938, Srpinger, Berlin (2008), 55–167. – cited on p. 22 [17] I. Chatterji, T. Fernos and A. Iozzi, The median class and superrigidity of actions on CAT(0) cubes complexes, with an appendix by P.-E. Caprace, J. Topol. 9, No. 2 (2016), 349–400. – cited on p. 24 [18] M. Davis, Groups generated by reflections and aspherical manifolds not covered by Euclidean space, Ann. of Math. (2) 117, No. 2 (1983), 293–324. – cited on p. 2 [19] M. Davis and T. Januszkiewicz, Hyperbolization of polyhedra, J. Differential Geom. 34, No. 2 (1991), 347–388. – cited on p. 2 [20] M. Davis, T. Januszkiewicz and R. Scott, Nonpositive curvature of blow-ups, Selecta Math. N.S. 4, No. 4 (1998), 491–547. – cited on p. 2 [21] O. Debarre, Tores et variétés abéliennes complexes, Cours Spécialisés 6, Société Mathématique de France, Paris, EDP Sciences, Les Ulis (1999). – cited on p. 23 [22] T. Delzant, Trees, valuations and the Green-Lazarsfeld set, Geom. Funct. Anal. 18, No. 4 (2008), 1236–1250. – cited on p. 24 [23] T. Delzant and M. Gromov, Cuts in Kähler groups, Infinite groups: geometric, combinatorial and dynamical aspects, Progr. Math. 248, Birkhäuser, Basel (2005), 31–55. – cited on p. 2, 13, 19 [24] J.-P. Demailly, Complex analytic and differential geometry, book available on https://www-fourier.ujf-grenoble.fr/∼demailly/documents.html. – cited on p. 17 [25] A. Dimca, S. Papadima and A. Suciu, Non-finiteness properties of fundamental groups of smooth projective varieties, J. Reine Angew. Math. 629 (2009), 89–105. – cited on p. 20 [26] C. Drutu and M. Kapovich, Lectures on Geometric Group Theory, book in preparation, available at https://www.math.ucdavis.edu/∼kapovich/papers.html. – cited on p. 15 [27] R. Geoghegan, Topological methods in group theory, Graduate Texts in Mathematics 243, Springer, New York (2008). – cited on p. 13 [28] M. Gromov, Hyperbolic groups, Essays in group theory, Math. Sci. Res. Inst. Publ. 8, Springer, New York (1987), 75–263. – cited on p. 2, 5 [29] M. Gromov, Kähler hyperbolicity and L2 -Hodge theory, J. Differential Geom. 33, No. 1 (1991), 263–292. – cited on p. 15 25 [30] M. Gromov, Metric structures for Riemannian and non-Riemannian spaces, based on the 1981 french original, with appendices by M. Katz, P. Pansu and S. Semmes, Progress in Mathematics 52, Birkhäuser Boston (1999). – cited on p. 11 [31] M. Gromov and R. Schoen, Harmonic maps into singular spaces and p-adic superrigidity for lattices in groups of rank one, Inst. Hautes Études Sci. Publ. Math. 76 (1992), 165–246. – cited on p. 4 [32] M. Hagen and D. Wise, Cubulating hyperbolic free-by-cyclic groups: the general case, Geom. Funct. Anal. 25, No. 1 (2015), 134–179. – cited on p. 2 [33] F. Haglund and D. Wise, Special cube complexes, Geom. Funct. Anal. 17, No. 5 (2008), 1551– 1620. – cited on p. 2 [34] C. H. Houghton, Ends of locally compact groups and their coset spaces, J. Austral. Math. Soc. 17 (1974), 274–284. – cited on p. 12 [35] V. Kaimanovich and W. Woess, The Dirichlet problem at infinity for random walks on graphs with a strong isoperimetric inequality, Probab. Theory Related Fields 91, No. 3-4 (1992), 445–466. – cited on p. 15 [36] I. Kapovich, The nonamenability of Schreier graphs for infinite index quasiconvex subgroups of hyperbolic groups, Enseign. Math. (2) 48, No. 3-4 (2002), 359–375. – cited on p. 10 [37] M. Kapovich, Energy of harmonic functions and Gromov’s proof of Stallings’ theorem, Georgian Math. J. 21, No. 3 (2014), 281–296. – cited on p. 15 [38] A. Kar and M. Sageev, Ping-pong on CAT(0) cube complexes, preprint 2016, arXiv:1507.05744. – cited on p. 8 [39] N. J. Korevaar and R. M. Schoen, Sobolev spaces and harmonic maps for metric spaces targets, Comm. Anal. Geom. 1, No. 3-4 (1993), 561–659. – cited on p. 4 [40] P. H. Kropholler and M. A. Roller, Relative ends and duality groups, J. Pure Appl. Algebra 61, No. 2 (1989), 197–210. – cited on p. 13 [41] P. Li, On the structure of complete Kähler manifolds with nonnegative curvature near infinity, Invent. Math. 99, No. 3 (1990), 579–600. – cited on p. 15 [42] P. Li and L.-F. Tam Harmonic functions and the structure of complete manifolds, J. Differential Geom. 35, No. 2 (1992), 359–383. – cited on p. 15 [43] C. Llosa Isenrich, Branched covers of elliptic curves and Kähler groups with exotic finiteness properties, preprint 2016, arXiv:1606:03142. – cited on p. 20 [44] T. Napier and M. Ramachandran, Structure theorems for complete Kähler manifolds and applications to Lefschetz type theorems, Geom. Funct. Anal. 5, No. 5 (1995), 809–851. – cited on p. 13 [45] T. Napier and M. Ramachandran, Hyperbolic Kähler manifolds and proper holomorphic mappings to Riemann surfaces, Geom. Funct. Anal. 11, No. 2 (2001), 382–406. – cited on p. 19 [46] T. Napier and M. Ramachandran, Filtered ends, proper holomorphic mappings of Kähler manifolds to Riemann surfaces, and Kähler groups, Geom. Funct. Anal. 17, No. 5 (2008), 1621–1654. – cited on p. 2, 13, 17 [47] T. Napier and M. Ramachandran, L2 Castelnuovo-de Franchis, the cup product lemma, and filtered ends of Kähler manifolds, J. Topol. Anal. 1, No. 1 (2009), 29–64. – cited on p. 4 26 [48] P. Py, Coxeter groups and Kähler groups, Math. Proc. Cambridge Philos. Soc. 155, No. 3 (2013), 557–566. – cited on p. 2, 20 [49] M. Sageev, Ends of group pairs and non-positively curved complexes, Proc. London Math. Soc. (3) 71, No. 3 (1995), 585–617. – cited on p. 2, 5 [50] M. Sageev, CAT(0) cube complexes and groups, Geometric group theory, IAS/Park City Math. Ser. 21, Amer. Math. Soc. Providence, RI (2014), 7–54. – cited on p. 2, 4 [51] P. Scott, Ends of pairs of groups, J. Pure Appl. Algebra 11, No. 1–3 (1977-1978), 179–198. – cited on p. 12 [52] C. Simpson, Lefschetz theorems for the integral leaves of a holomorphic one-form, Compositio Math. 87, No. 1 (1993), 99–113. – cited on p. 14 [53] Y.-T. Siu, The complex-analyticity of harmonic maps and the strong rigidity of compact Kähler manifolds, Ann. of Math. (2) 112, No. 1 (1980), 73–111. – cited on p. 3, 23 [54] D. Wise, Cubulating small cancellation groups, Geom. Funct. Anal. 14, No. 1 (2004), 150–214. – cited on p. 2 [55] D. Wise, From riches to raags: 3-manifolds, right-angled Arting groups, and cubical geometry, CBMS Regional Conference Series in Mathematics 117, Published for the Conference Board of the Mathematical Sciences, Washington, DC, by the American Mathematical Society, Providence, RI (2012). – cited on p. 2 Thomas Delzant Pierre Py IRMA Instituto de Matemáticas Université de Strasbourg & CNRS Universidad Nacional Autónoma de México 67084 Strasbourg, France Ciudad Universitaria, 04510 México DF, México [email protected] [email protected] 27
4math.GR
arXiv:1703.07809v1 [math.NA] 22 Mar 2017 Empirical Risk Minimization as Parameter Choice Rule for General Linear Regularization Methods Housen Li [email protected] National University of Defense Technology, Changsha, China Frank Werner1 [email protected] Max Planck Institute for Biophysical Chemistry, Göttingen, Germany and Felix Bernstein Institute for Mathematical Statistics in the Bioscience, University of Goettingen, Germany We consider the statistical inverse problem to recover f from noisy measurements Y = T f +σξ where ξ is Gaussian white noise and T a compact operator between Hilbert spaces. Considering general reconstruction methods of the form fˆα = qα (T ∗ T ) T ∗ Y with an ordered filter qα , we investigate the choice of the regularization parameter h i α by minimizing an unbiased estimate of the predictive risk E kT f − T fˆα k2 . The corresponding parameter αpred and its usage are well-known in the literature, but oracle inequalities and optimality results in this general setting areh unknown. We i prove a (generalized) oracle inequality, which relates the direct risk E kf − fˆαpred k2 with the i h oracle prediction risk inf α>0 E kT f − T fˆα k2 . From this oracle inequality we are then able to conclude that the investigated parameter choice rule is of optimal order. Finally we also present numerical simulations, which support the order optimality of the method and the quality of the parameter choice in finite sample situations. Keywords: statistical inverse problem, regularization method, filter-based inversion, a-posteriori parameter choice rule, order optimality, exponential bounds, oracle inequality. AMS classification numbers: Primary 62G05; Secondary 62G20, 65J22, 65J20. 1 Introduction Suppose we want to recover an unknown function f ∈ X from noisy measurements Y = T f + σξ (1) where T : X → Y is an operator between Hilbert spaces X and Y, ξ is a standard Gaussian white noise process and σ > 0 denotes the noise level. In fact, (1) has to be understood in a weak sense as ξ ∈ / Y, i.e. for each y ∈ Y we have access to observations of the form Yy := hT f, yiY + σ hξ, yiY ∗ ×Y   2 where hξ, yi ∼ N 0, kykY and E [hξ, y1 i hξ, y2 i] = hy1 , y2 i for all y1 , y2 ∈ Y. Models of the form (1) underly a plenitude of applications, see e.g. (O’Sullivan, 1986), and have been considered by Mathé and Pereverzev (2001); Bissantz et al. (2007); Ingster et al. (2012, 2014); Werner (2015). 1 Corresponding author 1 Throughout the paper we will assume that the operator T is injective, compact and HilbertSchmidt, i.e. the squares of its singular values are summable. Especially, this implies that its singular values tend to 0 and hence the inversion of T is unstable, i.e. the problem to recover f from (1) is ill-posed and regularization is needed, see Cavalier (2011); Engl et al. (1996) and the references therein. In the literature many different approaches for estimation of f can be found, including methods based on a singular value decomposition (SVD) of T , see e.g. (Johnstone and Silverman, 1991; Mair and Ruymgaart, 1996; Johnstone et al., 2004; Cavalier and Golubev, 2006), waveletvaguelette (Donoho, 1995) and vaguelette-wavelet methods (Abramovich and Silverman, 1998), and Galerkin-type methods (Cohen et al., 2004). In this paper we follow a common paradigm and consider regularization methods written in terms of an ordered filter qα : [0, kT ∗ T k] → R parametrized by α > 0 (see e.g. Definition 1 for the precise requirements on qα ), meaning that the regularized solution is given by fˆα = qα (T ∗ T ) T ∗ Y. (2) Regularization methods of the form (2) include famous examples like spectral cut-off and Tikhonov regularization, and have been studied extensively in the literature, see (Engl et al., 1996) and the references therein, and (Bissantz et al., 2007). Choosing an appropriate parameter α in (2) is an important problem in regularization theory as it dramatically influences the performance of the estimator fˆα . Bissantz et al. (2007) show that estimators of the form (2) are order-optimal over certain smoothness classes W ⊂ X , if the parameter α = α∗ is chosen in a reasonable a-priori way (depending on properties of W). ˆ This  means fα∗ achieves the best possible rate of convergence w.r.t. the direct risk R (α, f ) := E fˆα − f 2 X in these classes. In practice, the parameter α has to be chosen without any knowledge of f (and hence of W), which makes a-priori parameter choice rules useless. Therefore, a-posteriori parameter choice rules are of interest, as they make only use of the data Y and the noise level σ > 0. As a-posteriori parameter choice rules have to adapt to the unknown properties of W (and hence of f ), this issue is also known as adaptivity. For simplicity, we will assume here that σ is known. In practice, the parameter σ can typically be estimated sufficiently fast from the data or the measurement setting, see e.g. (Rice, 1984; Hall et al., 1990; Dette et al., 1998). We will discuss this situation in more detail in Section 6. A variety of a-posteriori parameter choice rules have been proposed in the literature, including the discrepancy principle (Morozov, 1966; Davies and Anderssen, 1986; Lukas, 1995; Blanchard et al., 2016), generalized cross-validation (Wahba, 1977; Golub et al., 1979; Lukas, 1993), the Lepskiı̆type balancing principle (Lepskiı̆, 1991; Mathé, 2006; Mathé and Pereverzev, 2006; Werner and Hohage, 2012) and many more. We refer to (Bauer and Lukas, 2011) for a recent overview and numerical comparison. General adaptivity in statistical inverse problems has also been treated in (Goldenshluger, 1999; Tsybakov, 2000; Cavalier et al., 2003). In this paper we deal with a specific method based on empirical risk minimization originally introduced by Mallows (1973) for model selection in linear regression and therefore known as   2 Mallow’s CL . Consider the prediction risk r (α, f ) := E T fˆα − f . Following Stein (1981), Y we find that an (up to a constant independent of α) unbiased estimator for this quantity is given by 2 r̂(α, Y ) := T fˆα − 2hT fˆα , Y i + 2σ 2 Trace (T ∗ T qα (T ∗ T )) . (3) Y Now the idea is to choose α as a minimizer of r̂ (α, Y ), i.e. αpred ∈ argmin r̂ (α, Y ) . α>0 Note that the functional (3) penalizes the the misfit between the model fˆα and the data Y , and furthermore 2σ 2 Trace (T ∗ T qα (T ∗ T )) penalizes the number of degrees of freedom of the model. 2 We refer to Birgé and Massart (2001, 2007) for details and a discussion of other possible penalty terms in (3). It is known that choosing α = αpred in combination with certain regularization schemes leads to an order optimal method w.r.t. the prediction risk r (α, f ), see e.g. (Li, 1987; Vogel, 1986; Lukas, 1993). A very precise result about its performance which is also a central ingredient of this paper can be found in the seminal paper by Kneip (1994), who proves exponential deviation bounds for r (αpred , f ). Due to ill-posedness, optimality w.r.t. the prediction risk is however a very weak statement, and consequently we are interested in order optimality w.r.t. the direct risk. This question has hardly been touched in literature, and to the authors best knowledge the only result is due to Chernousova and Golubev (2014) who restrict to finite dimensional spaces and spectral cutoff regularization. Nevertheless, the choice α = αpred has successfully been applied in image denoising applications, see e.g. (Luisier et al., 2007; Candès et al., 2013; Wang and Morel, 2013; Deledalle et al., 2014). Furthermore, the distributional behavior of αpred has recently been studied by Lucka et al. (2017). There it has been argued that the choice αpred and choices based on unbiased risk minimization in general do not seem suitable for inverse problems. Besides, it remains one of the most popular parameter selection rules, due to its favorable practical performance (see e.g. Bauer and Lukas (2011); Chernousova and Golubev (2014)). Supporting this fact, we will prove an oracle inequality of the form   R (αpred , f ) ≤ Θ min r (α, f ) (4) α>0 for all f ∈ W as σ ց 0 where Θ is some (explicit) functional and W ⊂ X some smoothness class. More specifically, the functional Θ will be such that we can derive order optimality of fˆαpred under weak assumptions over many classes W ⊂ X . Moreover, we provide a general strategy to prove estimates of the form (4) which is of independent interest and might be used for the analysis of other a-posteriori parameter choice rules as well. This makes our analytical methodology substantially different from that in (Chernousova and Golubev, 2014), since the crucial techniques (such as optional stopping of martingales) there do not apply to general regularization schemes. For more details on oracle inequalities in statistical inverse problems we refer to (Cavalier et al., 2002; Blanchard et al., 2016). The rest of this paper is organized as follows. In the next section we introduce ordered filter based regularization methods and the empirical parameter choice rule via unbiased prediction risk minimization. The convergence analysis of such a rule is established by means of an oracle inequality in Section 3 with corresponding conclusions on order optimality. In Section 4 we present a general methodology for proving oracle inequalities of the form (4) and apply this methodology for proving the results from Section 3. The performance, as well as the convergence behavior, of the analyzed parameter choice rule is examined by comparison with other empirical parameter choice rules in a simulation study in Section 5. We end this paper with some conclusions in Section 6 . 2 Filter based regularization and empirical risk minimization 2.1 Ordered filter based regularization methods Suppose that X and Y are Hilbert spaces, T : X → Y is an injective and compact Hilbert-Schmidt operator, and ξ in (1) is a standard Gaussian white noise process as described in the introduction. To simplify the notation we will always assume that dim (X ) = ∞, but stress that the case of finite dimensional X (and Y) can be treated similarly. By assumption, there exists a singular   √ λk , ek , gk k∈N of T where λ1 ≥ λ2 ≥ · · · > 0 are the eigenvalues value decomposition (SVD) of T ∗ T and e1 , e2 , . . . are the corresponding normalized eigenvectors. By introducing the notation Yk := hgk , Y i, ξk := hgk , ξi and fk = hf, ek i, we equivalently transform the model (1) to the 3 Gaussian sequence model Yk = iid p λk fk + σξk , k = 1, 2, . . . , (5) with ξk ∼ N (0, 1). As mentioned in the introduction, we focus on regularization methods of the form (2), which by meanings of (5) can be equivalently formulated as   p fˆα = λk qα (λk )Yk , k ∈ N. k P∞ Remark 1. Note that T being Hilbert-Schmidt implies that k=1 λk < ∞, and hence T ∗ Y can be interpreted as a random variable with values in X as "∞ # ∞ h i X X   2 ∗ 2 E kT ξkX = E hξ, T ek iY = λk E hξ, gk i2Y < ∞. k=1 k=1 Consequently, fˆα as in (2) is well-defined. Estimators of this form can be understood as stable √ approximations of the well-known least squares estimate fˆ := (T ∗ T )−1 T ∗ Y (or fˆk = Yk / λk ) in the sense of replacing (·)−1 with a function qα (·). To obtain a well-defined and reasonable regularization method, the functions qα (·) should satisfy proper conditions. We are particularly interested in case that qα (·) is an ordered filter. Definition 1. Let qα : [0, λ1 ] → R, indexed by α ∈ A ⊂ R+ , be a sequence of functions. We always assume that 0 is an accumulation point of A and that A is bounded. (i) The family qα , α ∈ A, is called a filter, if there exist constants Cq′ , Cq′′ > 0 such that for every α ∈ A and every λ ∈ [0, λ1 ] α |qα (λ)| ≤ Cq′ and λ |qα (λ)| ≤ Cq′′ . (ii) The filter qα , α ∈ A, is called ordered, if the sequence {qα (λk )}∞ k=1 is strictly monotone, i.e. α<β ⇒ ∀ k ∈ N : qα (λk ) ≤ qβ (λk ) and ∃ k0 ∈ N such that qα (λk0 ) < qβ (λk0 ), 2 and continuous as A ∋ α 7→ {qα (λk )}∞ k=1 ∈ ℓ . The requirement of an ordered filter is rather weak, as it is satisfied by various regularization methods. In Table 1 we give several examples of such. Note that for spectral cut-off regularization, the set A has to be chosen as {λk : k = 1, 2, . . .} in order to guarantee the strict monotonicity and the continuity required by condition (ii) in Definition 1. In Table 1 we also indicate whether the method can be implemented without SVD. This property is extremely crucial in practice, especially for large-scale applications, where the computation of an SVD is often impossible given limited time and resources. The implementation of Showalter’s method, for instance, can avoid SVD by employing Runge-Kutta schemes, see e.g. (Rieder, 2005). For a further discussion of these and other methods we refer to the monograph (Engl et al., 1996). In this paper, we focus on the asymptotic properties of ordered filter based regularization methods as the noise level σ tends to zero. As noticed by Bakushinskiı̆ (1984), the convergence rates of regularization methods can be arbitrarily slow if the underlying problem ill-posed. In order to derive rates of convergence we need assume some smoothness about the unknown truth f . Typically, the smoothness of f is measured relative to the smoothing properties of the forward operator T in terms of a source condition, i.e. we assume that f ∈ Wφ := {f ∈ X : f = φ(T ∗ T )w, kwkX ≤ C} for some constant C, (6) where φ is a so-called index function, i.e. φ is continuous, strictly increasing, and φ(0) = 0. Note that for any f ∈ X there exists a function φe such that f ∈ Wφe, cf. (Mathé and Hofmann, 2008). 4 To take advantage of (6) we furthermore assume that φ is a qualification of the filter qα , this is sup φ(λ) |1 − λqα (λ)| ≤ Cφ φ(α) for all α ∈ A, λ∈[0,λ1 ] (7) with Cφ being a constant depending only on φ. For further details on general source conditions and corresponding qualifications we refer to Mathé and Pereverzev (2003). As an example consider φ(t) = tv , which is known as Hölder type source condition of order v > 0: Wv := {f ∈ X : f = (T ∗ T )v w, kwkX ≤ C} . (8) The function φ(t) = tv is a qualification of the filter qα if sup λv |1 − λqα (λ)| ≤ Cv αv for all α ∈ A. λ∈[0,λ1 ] (9) In this case, the largest possible v such that (9) is satisfied, is called the classical or polynomial qualification index v0 of the ordered filter qα . For the methods discussed in Table 1, v0 as well as Cv is also depicted. Table 1: Examples of ordered filters. Method qα (λ) Cq′ Cq′′ v0 Cv SVD required Spectral cut-off 1 λ 1[α,∞) (λ) 1 1 ∞ 1 Yes Tikhonov 1 λ+α 1 1 1 No m-iterated Tikhonov (λ+α)m −αm λ(λ+α)m v v (1 − v)1−v m 1 m (v/m)v (1 − v/m)m−v No 1 1 ∞ (v/e)v No 1 1 ∞ (v/e)v No Landweber (kT k ≤ 1) Showalter P⌊1/α⌋−1 (1 − λ)j λ 1−exp(− α ) j=0 λ For further reference, we collect the assumed properties of f and qα as follows: Assumption 1. (i) The true solution f satisfies f ∈ Wφ as in (6). (ii) The function φ is a qualification of the filter qα as in (7). √ (iii) The function ψ(x) := xφ−1 ( x), with φ−1 being the inverse function of φ, is convex. Remark 2. We stress that, being a standard assumption for convergence analysis, Assumption 1 (iii) actually imposes no restriction, since one can always work on a slightly larger source set Wφe with another index function φe for which Assumption 1 (iii) is satisfied. 2.2 Empirical prediction risk minimization As discussed in the Introduction, the optimal regularization parameter α will in general depend on Y , σ and f , but the latter is unknown and hence this α cannot be realized in practice. Recall that we always assume σ > 0 to be known. By meanings of the prediction risk r (α, f ), the optimal α ∈ A is given by αo = argmin r(α, f ). (10) α∈A 5 As a common remedy, we will try to estimate αo from the observations Y in (1) by minimizing an unbiased estimator of r (α, f ), which can be derived as follows. Let us introduce the shorthand notation sα (λ) := λqα (λ). Then we have h i 2 r(α, f ) = E kT (qα (T ∗ T )T ∗ (T f + σξ) − f )kY h i 2 2 = k(I − T qα (T ∗ T )T ∗ )T f kY + σ 2 E kT qα (T ∗ T )T ∗ξkY = ∞ X k=1 λk (1 − sα (λk ))2 fk2 + σ 2 ∞ X sα (λk )2 . (11) k=1 and furthermore   2 E T fˆα − 2hT fˆα, Y iY Y i h = E kT qα (T ∗ T )T ∗ (T f + σξ)k2Y − 2hT qα (T ∗ T )T ∗(T f + σξ), T f + σξiY = ∞ X k=1 λk (1 − sα (λk ))2 fk2 − ∞ X λk fk2 + σ 2 k=1 ∞ X k=1 sα (λk )2 − 2σ 2 ∞ X sα (λk ). k=1 Consequently for r̂ (α, Y ) as in (3) we have E [r̂ (α, Y )] = r(α, f ) − ∞ X λk fk2 , k=1 i.e. up to a constant independent of α, r̂ (α, Y ) is an unbiased estimator of r (α, f ). Hence we define αpred = argmin r̂(α, Y ). (12) α∈A Remark 3. For the clarity of our notation, we stress that α 7→ r(α, f ) is a deterministic function, whereas α 7→ r̂ (α, Y ) is a random function and consequently, αpred as in (11) is a random variable. To obtain bounds for the estimator fˆαpred we will also need bounds for r(αpred , f ), i.e. a deterministic function  evaluated at a random variable. In particular we stress  that E [r(αpred , f )] 6= E T fˆαpred − T f 2 Y . Note that αpred is computable in practice as it only relies on the data and the forward operator. As discussed in the Introduction, there are many results available for the performance of fˆαpred measured by the prediction risk, among which the most precise one is due to Kneip (1994) given below. Theorem 2.1 (Deviation bound of prediction risk (Kneip, 1994)). Assume the model (1). Let fˆα = qα (T ∗ T )T ∗Y with an ordered filter qα , αo as in (10), and αpred as in (12). Then there exist positive constants C1 , C2 such that for all x ≥ 0 and for all f ∈ X , ( )!   2 2 √ x C 2 x, p min , P T fˆαpred − T f − T fˆαo − T f ≥ x ≤ C1 exp − σ Y Y r(αo , f ) which remains true when replacing T fˆαpred − T f 6 2 Y − T fˆαo − T f 2 Y by r(αpred , f ) − r(αo , f ). Proof. Recall that dim X = ∞, which, together with the injectivity of T , implies dim Y = ∞. In fact, the assertion for finite dimensional Y follows directly from (Kneip, 1994, Proposition 1(i)) and (Kneip, 1994, Theorem 1) by chasing the dependency of the constants on the noise level σ. Concerning the key technical tools in Kneip’s proof, we note, that the Lemma 2 there actually holds for infinite sequences a ∈ ℓ2 and bounded linear trace operators A : ℓ2 → ℓ2 , and that the Lemma 3 there can be extended to infinite dimensional ordered linear smoothers, as long as they are Hilbert-Schmidt. Thus, the proof by Kneip (1994) carries over to the case that dim Y = ∞. The above theorem, in particular, implies (cf. (Chernousova and Golubev, 2014, Theorem 1))   2 p E T fˆαpred − T f ≤ r(αo , f ) + Cσ r(αo , f ) for every f ∈ X , Y which guarantees the order optimality of fˆαpred in terms of the prediction risk. 3 MISE estimates The section is devoted to the convergence analysis of fˆα = qα (T ∗ T )T ∗Y with α = αpred as in (12). In what follows, we will prove that fˆαpred also possesses an optimality property in terms of the direct risk, i.e. in terms of the mean integrated square error (MISE). 3.1 Assumptions and merit discussions We start with some technical assumptions. As we have already seen in the previous section, many calculations involve summations over {λk }∞ k=1 , which can be formulated as Lebesgue-Stieltjes integrals with respect to Σ(x) := #{k : λk ≥ x}. Following Bissantz et al. (2007), we assume that Σ can be approximated by a smooth function S to avoid the difficulty caused by the non-smoothness of Σ: Assumption 2. (i) There exists a surrogate function S ∈ C 2 ((0, ∞)) of Σ satisfying lim S(α)/Σ(α) = 1, αց0 S ′ (α) < 0 for all α > 0, lim S(α) = lim S ′ (α) = 0, αր∞ αր∞ lim αS(α) = 0. αց0 (ii) There exist constants α1 ∈ (0, λ1 ] and CS ∈ (0, 2) such that − αS ′ (α) is integrable on (0, α1 ], S ′′ (α) CS ≤ −S ′ (α) α for all α ∈ (0, α1 ]. (iii) There exists a constant Cq > 0 such that r   Z ∞ x dx < ∞ Ψ′ (Cq x) exp −C2 2 1 Here C2 is as in Theorem 2.1. 7 with Ψ(x) := x (S −1 2. (x)) Remark 4. Note that Assumption 2 (i) and (ii) are essentially (Bissantz et al., 2007, Assumption 2) with a proper extension of S to a larger domain (0, ∞). They are rather weak requirements, and cover a wide range of situations, see e.g. (Bissantz et al., 2007, Section 5). The additional assumption (iii) is needed to control certain general moments of r(αpred , f ) with the help of Theorem 2.1. The second assumption concerns the choice of regularization parameter α for (ordered) filters qα . Assumption 3. (i) For α ∈ A, the function λ 7→ sα (λ) is non-decreasing. −1/2 (ii) There exists cq > Cq with Cq as in Assumption 2 (iii) such that sα (α) = αqα (α) ≥ cq as α ց 0. (13) Remark 5. It is easy to see that the above condition with some cq > 0 is satisfied by all the regularization methods in Table 1, which indicates that Assumption 3 is fairly general. More precisely, it can be understood√as a parametrization√condition. For instance, the Tikhonov method with re-parametrization α 7→ α, i.e. qα (λ) = 1/( α + λ), still defines an ordered filter, but does −1/2 not satisfy (13) anymore. The condition cq > Cq requires some compatibility of the ill-posedness with the parametrization of the filter. Under these assumptions, upper bounds for fˆα with an a-priori choice of α have been proven by Bissantz et al. (2007): Theorem 3.1 (A-priori parameter choice (Bissantz et al., 2007)). Consider the model (1), and let fˆα := qα (T ∗ T )T ∗ Y with a filter qα , and Assumptions 1 (i) and 2 (i)-(ii) hold. Let also α∗ satisfy α∗ φ(α∗ )2 = σ 2 S(α∗ ). (14) (i) If Assumption 1 (ii) holds, then for some constant C1 we have   2 S(α∗ ) sup E fˆα∗ − f ≤ C1 φ(α∗ )2 = C1 σ 2 α∗ X f ∈Wφ (ii) If φ̃(t) := as σ ց 0. √ tφ(t) is a qualification of the filter qα , then for some constant C2 we have   2 sup E T fˆα∗ − T f ≤ C2 α∗ φ(α∗ )2 = C2 σ 2 S(α∗ ) as σ ց 0. f ∈Wφ Y 3.2 Oracle inequality We are now in position to derive a crucial oracle inequality in the general form of (4) for the empirical parameter choice α = αpred . Theorem 3.2 (Oracle inequality). Assume the model (1). Let fˆα := qα (T ∗ T )T ∗Y with an ordered filter qα , and Assumptions 1, 2 and 3 hold. Let also αo be given by (10), and αpred by (12). Then there are positive constants Ci , i = 1, . . . , 6, such that for all f ∈ Wφ it holds p     2 r(αo , f ) + σ r(αo , f ) 2 −1 ˆ   + C6 σ 2 . (15) E fαpred − f C2 r(αo , f ) + C3 σ + C4 ≤ C1 ψ r(αo ,f ) X −1 C5 σ2 S The proof is based on a general strategy based on technical lemmas, and is given in Section 4. To ease the understanding of this paper, we will now start with conclusions from Theorem 3.2. 8 3.3 Convergence rates and examples The derived oracle inequality in Theorem 3.2 readily provides error estimates for the estimator fˆαpred given proper upper bounds of the oracle prediction risk r(αo , f ) as in Theorem 3.1. Theorem 3.3 √ (Convergence rates). Assume the same setting as in Theorem 3.2, and additionally that φ̃(t) = tφ(t) is a qualification of the filter qα . Let α∗ be given by (14). Then as σ ց 0 we have   2 α φ(α∗ )2 σ 2 S(α∗ ) 2 S(α∗ ) ˆ  ∗ = C σ sup E fαpred − f ≤ C1 φ(α∗ )2 + C2 + C 1 2 2 ∗) α∗ S −1 (C3 S(α∗ )) X f ∈Wφ S −1 C3 α∗ φ(α σ2 for some positive constants Ci , i = 1, 2, 3. Remark 6. If, in addition, there is a constant C4 > 0 such that S(C4 x) ≥ C3 S(x) then it follows from Theorem 3.3 that  sup E fˆαpred − f f ∈Wφ 2 X  for all x > 0, ≤ Cφ(α∗ )2 = Cσ 2 S(α∗ ) . α∗ This coincides with the convergence rate we obtain under an a-priori parameter choice in Theorem 3.1, which turns out to be order optimal in most cases, see e.g. Section 3.3.1 and Bissantz et al. (2007). We note that there are two additional important assumptions for a-posteriori parameter choice αpred compared to the a-priori choice (cf. Theorem 3.1 (i) and Theorem 3.3). The one is Assumption 2 (iii), which concerns the control of general moments of r(αpred , f ), due to the randomness √ of αpred . The other is that not only φ but also φ̃(t) = tφ(t) is a qualification of the filter qα . The latter seems to be typical for parameter choice rule relying on residuals in image space, as e.g. for the discrepancy principle in case of deterministic inverse problems, see (Engl et al., 1996, Section 4.3) and (Mathé and Pereverzev, 2006), or for generalized cross-validation (GCV), see (Lukas, 1993; Vogel, 2002). Still we stress that the qualification assumption plays no role in the proof of the oracle inequality (Theorem 3.2), and it only kicks in for the derivation of convergence rates for fˆαpred through r(αo , f ) in the convergence analysis under the a-priori parameter choice. 3.3.1 Mildly ill-posed problems We now consider a particular mildly ill-posed problem. More precisely, we assume Assumption 4. (i) polynomial decay of eigenvalues of T ∗ T λk = Ca k −a (ii) smoothness of the truth ( f ∈ Wb/(2a) := k = 1, 2, . . . f ∈X : ∞ X wk fk2 k=1 with some a > 1 and Ca > 0; ≤1 ) with wk = Cb k b k = 1, 2, . . . , for some positive constants b and Cb . In the above assumption, the requirement of a > 1 is to ensure that the forward operator T is Hilbert-Schmidt, and the notation Wb/(2a) is consistent with (8) as the above smoothness condition is equivalent to the Hölder type source condition of order b/(2a). In this simple setting the convergence rates of ordered filter based methods with empirical parameter choice αpred can be explicitly computed. 9 Corollary 3.4 (Order optimality). Assume the model (1). Let fˆα := qα (T ∗ T )T ∗ Y filter qα , and Assumptions 3 and 4 with any cq > 0 hold. If the qualification index ordered filter satisfies v0 ≥ b/(2a) + 1/2, then there are positive constants C1 and     2 2 2b ˆ ˆ sup E fαpred − f ≤ C1 inf sup E f − f ≤ C2 σ a+b+1 fˆ f ∈Wb/(2a) X f ∈Wb/(2a) X with an ordered v0 in (9) of the C2 such that as σ ց 0. The infimum above is taken over all possible estimators fˆ (including both linear and nonlinear ones). −1/a Proof. Define S(α) := α/Ca , which satisfies Assumption 2 (i) and (ii). Note that φ(x) = b/(2a) −1 x and then ψ(x) := xφ (x) = x(a+b)/b , so Assumption 1 is satisfied. Since Ψ(x) = 2 −1 x/ S (x) = Ca−2 x1+2a , Assumption 2 (iii) clearly holds. By definition (14), it follows that 1/(1+a+b) 2a/(1+a+b) α∗ = Ca σ . Thus, by Theorem 3.3 and Remark 6, we have   b 2 b ˆ as σ ց 0, sup E fαpred − f ≤ C1 φ(α∗ )2 = C1 Caa(1+a+b) (σ 2 ) 1+a+b X f ∈Wb/(2a) for some positive constant C1 . Moreover, it is well-known that (see e.g. Pinsker, 1980; Golubev and Khas’minskiı̆, 1999)   2 b ˆ inf sup E f − f ≥ C2 (σ 2 ) a+b+1 for some C2 > 0. fˆ f ∈Wb/(2a) X Remark 7. The above proposition in particular implies that all the methods in Table 1 are order optimal with α = αpred when b/(2a) + 1/2 ≤ v0 in the minimax sense. This reproduces the result in Chernousova and Golubev (2014) for the spectral cut-off method as a special case. Note that the parameter choice αpred depends only on the data, and is completely independent of the unknown truth. Thus, the ordered filter based regularization methods with αpred automatically adapt to the unknown smoothness of the truth, and achieve the best possible rates up to a constant. In other words, the ordered filter based regularization methods with parameter choice αpred are adaptively minimax optimal (cf. Pinsker, 1980) over a range of smoothness classes, and the adaptation range is determined by the qualification index of the filter and the smoothing property of the forward operator. Importantly, we point out that the order optimality here is in sharp contrast to the Lepskiı̆-type balancing principle (Lepskiı̆, 1991), where one typically losses a log-factor in the asymptotic convergence rates. In addition, we stress again the price we pay for a-posteriori parameter choice αpred is a stronger qualification assumption b/(2a) + 1/2 ≤ v0 , as the convergence rates of direct risk for a-priori parameter choice only asks for b/(2a) ≤ v0 by Theorem 3.1 (i), see also Remark 6. 3.3.2 Exponentially ill-posed problems Next we consider an exponentially ill-posed setting: The eigenvalues of T ∗ T satisfy λk ≍ exp (−µk a ) k = 1, 2, . . . for some a, µ > 0, and the smoothness of the truth is characterized by (6) with φ(x) := xb (− log x)c for some b > 0, c ∈ R, or b = 0, c > 0.  P 2 −2ac exp(2µbk a ). That is, we assume that the truth lies in f ∈ X : ∞ k=1 wk fk ≤ 1 with wk ≍ k It is easy to see that the assumptions of Theorem 3.2 are satisfied for all the regularization methods listed in Table 1 provided that 0 < a < 1/2, or a = 1/2 and µ is sufficiently small. Hence, if in addition b + 1/2 < v0 , or b = v0 , c ≤ 0 (recall that v0 is the qualification index), 10 we can obtain certain error bounds by means of Theorem 3.3. However, it turns out that our bounds are too rough to guarantee order optimality. In fact, in case of b = 0, the error bound on the right-hand side of (15) even diverges as the noise level σ tends to 0. In summary, our oracle inequality is applicable for exponentially ill-posed problems as discussed here, but is not strong enough to derive rates of convergence or even show optimality of the investigated parameter choice αpred . 4 A general methodology for proving oracle inequalities of the form (15) To prove the oracle inequality (15), we will proceed as follows. First, we obtain bounds for general moments of the prediction risk (cf. Corollary 4.1). Secondly, we proceed with a standard estimate for the (deterministic) bias of the estimator fˆα under the smoothness Assumption 1 (cf. Lemma 4.2). Finally, we prove a comparison Lemma on the variance terms (cf. Lemma 4.3). Putting these three ingredients together, the proof of Theorem 3.2 is then straightforward. Rephrased differently, if these three ingredients are given for some parameter choice rule ᾱ, an oracle inequality similar to (15) can be derived. 4.1 Main ingredients We start with bounds for general moments of the prediction risk. Corollary 4.1 (General moments of prediction risk). Assume the same setting as Theorem 2.1, and let Ψ : R+ → R+ be an increasing and continuously differentiable function with Ψ(0) = 0 such that r   Z ∞ x dx < ∞ (16) Ψ′ (x) exp −C2 2 1 with C2 being the same as in Theorem 2.1. Then      2r(αo , f ) r(αpred , f ) ≤Ψ + CΨ E Ψ σ2 σ2 for all f ∈ X , where CΨ is a constant depending only on Ψ. Proof. Let ro := r(αo , f ). Then    Z ∞   r(αpred , f ) r(αpred , f ) ′ E Ψ = Ψ (x)P ≥ x dx σ2 σ2 0 r   Z 2ro /σ2 Z ∞ ro ≤ Ψ′ (x) dx + C1 Ψ′ (x) exp −C2 x − 2 dx σ 0 2ro /σ2 r     Z ∞ x 2ro dx + C1 Ψ′ (x) exp −C2 ≤Ψ 2 σ 2 2ro /σ2   2r(αo , f ) ≤Ψ + CΨ . σ2 [by Fubini’s theorem] [by Theorem 2.1] This concludes the proof. Remark 8. A simple example is Ψ(x) := xθ for some θ > 0. By Corollary 4.1, it leads to   E r(αpred , f )θ ≤ 2θ r(αo , f )θ + Cθ σ 2θ , where the second term on the right hand side is typically negligible compared to the first as σ tends to 0. 11 Based on the smoothness Assumption 1, we can prove the following estimate for the bias of fˆα : Lemma 4.2 (Source condition). Under Assumption 1 (i) and (iii), it holds that ! ∞ ∞ X 1 X 2 2 2 −1 2 2 (1 − sα (λk )) fk ≤ C ψ λk (1 − sα (λk )) fk , C2 k=1 k=1 with C being the same constant in (6). Proof. Based on spectral analysis, condition (6) can be equivalently written as fk = φ(λk )wk , k = 1, 2, . . . , with ∞ X k=1 wk2 ≤ C 2 . p Thus, fk2 ≤ C 2 φ(λk )2 and then φ−1 ( C −2 fk2 ) ≤ λk . By Jensen’s inequality, we have ψ ∞ ∞  X  X  1 1 2 2 2 2 (1 − sα (λk )) ≤ ψ f (1 − s (λ )) f α k C2 k C2 k k=1 k=1 ∞ 1 X 2 ≤ 2 λk fk2 (1 − sα (λk )) . C k=1 The assertion follows by applying ψ −1 to the above inequality. Finally, we need certain comparison relations, which are required for bounding the variance part of the risk: Lemma 4.3 (Comparison). Let qα be a filter, and Assumptions 2 and 3 hold. Then there are positive constants C1 and C2 such that for every α ∈ A ! ! ∞ ∞ ∞ ∞ X X X X 2 2 4 2 2 sα (λk ) , λk qα (λk ) ≤ C2 Ψ2 Cq and sα (λk ) λk qα (λk ) ≤ C1 Ψ1 Cq k=1 k=1 k=1 k=1 with Cq being the same as in Assumption 2 (iii), and the functions Ψ1 and Ψ2 are defined as Ψ1 (x) = x , (x) S −1 Ψ2 (x) = x 2, (S −1 (x)) x > 0. (17) Proof. To ease notation, let C be a generic positive constant, whose value may vary from place to place. We consider two separate cases: α is sufficiently small, and α 6ց 0. Case I: α is sufficiently small. Let cq be the same as in Assumption 3. Then as α ց 0 ∞ X k=1 2 sα (λk ) = − ≥− Z ∞ 2 t qα (t) dΣ(t) ≥ − 0 Z 2 ∞ Z ∞ t2 qα (t)2 dΣ(t) α α2 qα (α)2 dΣ(t) [by Assumption 3 (i)] α ≥ −c2q Z ∞ α dΣ(t) = c2q Σ(α) [by Assumption 3 (ii)] = c2q S(α). [by Assumption 2 (i)] It follows from Assumption 2 (ii) and (Bissantz et al., 2007, Lemma 12) that as α ց 0 Z α Z α Z α1 1 dS(t) ≤ CαS(α). t dS(t) ≤ CαS(α) − Cα2 S(t) dt = αS(α) − t α 0 0 12 (18) (19) Then as α ց 0 we have ∞ X k=1 2 λk qα (λk ) = − Z ∞ tqα (t)2 dΣ(t) 0   Z α Z ∞ 1 t dΣ(t) − dΣ(t) ≤C − 2 t α 0 α   Z α Z α α 1 1 1 t Σ(t) dt + Σ(α) = C 2 Σ(t) dt ≤ C − 2 Σ(t) + 2 α α 0 α α 0 0 Z α 1 =C 2 S(t) dt α 0 S(α) , ≤C α [by Definition 1 (i)] [by Assumption 2 (i)] [by (19)] and similarly ∞ X λ2k qα (λk )4 k=1 =− Z ∞ t2 qα (t)4 dΣ(t) 0   Z α 2 Z ∞ 1 t dΣ(t) − dΣ(t) ≤C − 4 t2 α 0 α  2  Z Z α α α t 1 1 1 ≤ C − 4 Σ(t) + 4 2tΣ(t) dt + 2 Σ(α) ≤ C 3 Σ(t) dt α α 0 α α 0 0 Z α 1 =C 3 S(t) dt α 0 S(α) ≤C 2 . α [by Definition 1 (i)] [by Assumption 2 (i)] [by (19)] These together with (18) prove the assertion if α is sufficiently small, by noticing that Cq > 1/c2q . Case II: α 6ց 0. Note that α 6ց 0 and the boundedness of A imply that 1/α is bounded below from 0, and above from ∞. Then by Assumption 3 it holds that ∞ X k=1 ∞ sα (λk )2 ≥ C 1X λk ≥ C. α k=1 By Definition 1 (i) we have ∞ X k=1 λk qα (λk )2 ≤ C ∞ 1 X λk ≤ C, α2 and k=1 ∞ X k=1 λ2k qα (λk )4 ≤ C ∞ 1 X λk ≤ C. α3 k=1 Thus the assertion clearly holds for α 6ց 0. Combining the above two cases concludes the proof. 4.2 Proof of Theorem 3.2 Now we are in position to prove Theorem 3.2. To obtain bounds, we will split the variance part by exploiting a technique from Golubev (2010) dealing with ordered processes: Lemma 4.4 (Ordered processes (Golubev, 2010)). Assume that a sequence of functions ck : A → R, k = 1, 2, . . ., with A ⊆ R+ , satisfy that κ(α) := ∞ X k=1 2 ck (α) !1/2 13 <∞ for α ∈ A, and that κ is continuous and strictly monotone on A. Define (x)+ := max{x, 0}, and ζ(α) := ∞ X k=1 ck (α)(ξk2 − 1) iid with ξk ∼ N (0, 1). Then there exists a constant C such that    C 2 E sup ζ(α) − xκ(α) + ≤ x α∈A for all x > 0. Proof. Note that ζ(α) almost surely finite since κ(α) < ∞. In the terminology of Golubev (2010), ζ(α) is an ordered process, but with a possibly nonzero mean. The assertion can be proven in exactly the same way as (Golubev, 2010, Lemmas 1 and 2). Proof of Theorem 3.2. Consider the bias-variance decomposition   h i h i 2 2 2 ˆ E fαpred − f ≤ 2E (qαpred (T ∗ T )T ∗ T − I)f X + 2σ 2 E qαpred (T ∗ T )T ∗ ξ X X "∞ # "∞ # X X 2 2 2 2 2 = 2E 1 − sαpred (λk ) fk + 2σ E λk qαpred (λk ) ξk . k=1 (20) k=1 For the first term (i.e. bias part) in (20), we have for all f ∈ W # "∞ # " ∞   1 X X 2 2 2 −1 2 λk (1 − sαpred (λk )) fk E ≤ C1 E ψ fk 1 − sαpred (λk ) C1 k=1 k=1    1 −1 r(αpred , f ) ≤ C1 E ψ C1  1  ≤ C1 ψ −1 E [r(αpred , f )] C1  2  ≤ C1 ψ −1 r(αo , f ) + C2 σ 2 . C1 [by Lemma 4.2] [by (11)] [by Jensen’s inequality] [by Remark 8] For the second term (i.e. variance part) in (20), we further split it into two terms "∞ # "∞ # "∞ # X X X 2 2 2 2 2 2 2 2 σ E λk qαpred (λk ) ξk = σ E λk qαpred (λk ) (ξk − 1) . (21) λk qαpred (λk ) + σ E k=1 k=1 k=1 Note that Ψ′1 (x) ≤ S −1 (x)Ψ′2 (x) for the functions Ψ1 and Ψ2 in (17), so by monotonicity of S and Assumption 2 (iii), condition (16) is satisfied with Ψ(x) = Ψ1 (Cq x) as well. Then, for the first term in (21), it holds that !# "∞ # " ∞ X X 2 2 2 2 [by Lemma 4.3] sαpred (λk ) σ E λk qαpred (λk ) ≤ C3 σ E Ψ1 Cq k=1 k=1   r(αpred , f ) 2 ≤ C3 σ E Ψ1 Cq σ2     r(αo , f ) 2 ≤ C3 σ Ψ1 2Cq + C4 σ2 r(α , f )  + C3 C4 σ 2 .  o = 2C3 Cq S −1 2Cq r(ασo2,f )  14 [by (11)] [by Corollary 4.1] For the second term in (21), we apply Lemma 4.4 with ck (α) = λk qα (λk )2 , which leads to (with ζ and κ defined in Lemma 4.4) "∞ # h X    i 2 2 2 σ E λk qαpred (λk ) (ξk − 1) ≤ σ 2 E ζ(αpred ) − xκ(αpred )2 + + σ 2 E xκ(αpred )2 k=1     ≤ σ E sup ζ(α) − xκ(α) + + σ 2 E xκ(αpred )2 α∈A "∞ # X C 5 + xσ 2 E λ2k qαpred (λk )4 for all x > 0. ≤ σ2 x 2 2  k=1 We minimize the right hand side of the above equation over x > 0, and then obtain σ2 E " ∞ X k=1 # λk qαpred (λk )2 (ξk2 − 1) ≤ 2σ 2 ≤ C6 σ C5 E 2 " " ∞ X λ2k qαpred (λk )4 k=1 E Ψ2 Cq ∞ X k=1 #!1/2 2 sαpred (λk ) !#!1/2 [by Lemma 4.3]    1/2 r(αpred , f ) ≤ C6 σ 2 E Ψ2 Cq [by (11)] σ2   1/2  r(αo , f ) ≤ C6 σ 2 Ψ2 2Cq [by Corollary 4.1] + C 7 σ2 p σ r(αo , f ) 1/2  + C6 (C7 )1/2 σ 2 .  ≤ C6 (2Cq ) S −1 2Cq r(ασo2,f ) Combining all these estimates concludes the proof. 5 Numerical simulations In this section, we will investigate the behavior of the following parameter choice methods by means of a simulation study: h i (i) The oracle parameter choice αor = argmin E fˆα − f † , which is not available in practice α∈A and evaluated here for comparison only, (ii) the a-posteriori parameter choice rule which is investigated in this paper, given by αpred = argmin r̂ (α, Y ) with r̂ (α, Y ) as in (3), α∈A (iii) and the Lepskiı̆-type balancing principle originally introduced by Lepskiı̆ (1991), and was further developed for usage in statistical inverse problems by Bauer and Hohage (2005); Mathé (2006); Mathé and Pereverzev (2006); Werner and Hohage (2012). Given estimators fˆα1 , ..., fˆαn for a suitably fine grid α1 < ... < αn , it consists in choosing n o p fˆαj − fˆαk j ∗ = max 1 ≤ j ≤ n ≤ 4σ Trace (qαk (T ∗ T ) T ∗ ) for all 1 ≤ k ≤ j . X (22) p and αLEP := αj ∗ . Note that the term σ Trace (qα (T ∗ T ) T ∗ ) is in fact an estimator for the standard deviation of fˆα . For an explanatory derivation of this choice we refer to Mathé (2006). Unfortunately, the computation of αLEP is computationally expensive (see e.g. our simulations below). 15 In all above methods, the set of considered parameters is n j ko −1 A = σ 2 · rk k = 0, 1, ..., (log (r)) log σ −2 kT ∗ T k   for some r > 1, i.e. it discretizes the range of possible α’s σ 2 , kT ∗ T k in a logarithmically equispaced way. In our simulations we use r = 1.2. We also tried different values of r which did not influence the results significantly. Note that it can readily be seen from the error decomposition (11) that the discrete parameter set A is – under appropriate conditions on the filter which are satisfied by all filters in Table 1 – able to resemble the optimal behavior of a continuous parameter set σ 2 ≤ α < ∞ up to a constant depending on r. Let us briefly comment on the implementation of the parameter choice rule αpred . Even though the minimization is not performed over the continuum α ∈ A but over a discrete set here, the computation of αpred can be numerically challenging. In Figure 1 we depict the function α 7→ r̂ (α, Y ) in an example using Tikhonov regularization, which shows that the function is quite flat around its absolute minimum. We observed this behavior in many situations, especially if σ is not too small. Finally we mention that the evaluation of the trace operator in r̂ (α, Y ) can be expensive, but this can be overcome by different techniques (cf. (Engl et al., 1996, Sec. 9.4) or (Vogel, 2002, Sec. 7.1)). 10−1 r̂ (α, Y ) 10−3 10−5 10−7 σ = 10−2 σ = 10−4 σ = 10−6 10−9 10−12 10−11 10−10 10−9 10−8 10−7 α 10−6 10−5 10−4 10−3 10−2 Figure 1: The function α 7→ r̂ (α, Y ) for different noise levels. The red crosses mark the actual minima. The operator T is as in Section 5.1, and f is as in Example 1. The chosen regularization method is Tikhonov regularization. 5.1 Convergence rates At first we investigate the empirical rate of convergence in a mildly ill-posed situation. Therefore we consider the linear integral operator T : L2 ([0, 1]) → L2 ([0, 1]) defined by (T f ) (x) = Z1 x ∈ [0, 1] k (x, y) f (y) dy, 0 with kernel k (x, y) = min {x · (1 − y) , y · (1 − x)} , x, y ∈ [0, 1], i.e. (T f )′′ = −f for all f ∈ L2 ([0, 1]). Obviously, the eigenvalues λk of T ∗ T satisfy λk ∼ k −4 . 1 3 We discretize T by choosing equidistant points x1 = 2n , x2 = 2n , . . . , xn = 2n−1 2n and using the composite midpoint rule (T f ) (x) = Z1 0 n k (x, y) f (y) dy ≈ 16 1X k (x, xi ) f (xi ) n i=1 on the grid points x = xj , 1 ≤ j ≤ n. To avoid an inverse crime, the exact data T f is always calculated analytically. We consider two different scenarios varying in the smoothness of the unknown solution f : Example 1. As the first example, we consider the continuous function ( x if 0 ≤ x ≤ 12 , f (x) = 1 − x if 12 ≤ x ≤ 1. It can readily be seen by straightforward computations that the Fourier coefficients fk of f are given by k (−1) − 1 . fk = 4π 3 k 2  3  Consequently f ∈ W3/8−ε and the optimal rate of convergence is O σ 4 −ε for any ε > 0, see Proposition 3.4. Example 2. In the second example we choose ( 1 if 14 ≤ x ≤ 34 , f (x) = 0 else. As this function can be written as the derivative of functions as in the first example, it is clear 1 that f ∈ H 2 −ε ([0, 1]) for any ε > 0. This is also evident by the fact that the Fourier coefficients fk of f are given by  k (−1) sin πk 2 . fk = 2π 2 k  1  Consequently, f ∈ W1/8−ε and the optimal rate of convergence is O σ 3 −ε for any ε > 0, see Proposition 3.4.  In Figures 2-4 we plot several empirical risks against the noise level σ ∈ 2−15 , ..., 2−25 . The optimal rate of convergence is also indicated. We consider spectral cut-off (cf. Figure 2), Tikhonov regularization (cf. Figure 3), and Showalter regularization (cf. Figure 4). Using Monte Carlo 4 simulations with per noise level we compute empirical versions of the oracle risk  10 experiments   2 2 Ror (σ) := E fˆαor − f † , the prediction risk Rpred (σ) := E fˆαpred − f † , and the Lepskiı̆ 2 2   2 risk RLEP (σ) := E fˆαLEP − f † . 2 In all plots we find a good agreement of our theoretical predictions and the empirical results. Compared with the Lepskiı̆-type balancing principle, it seems that αpred performs order-optimal with a slightly smaller constant. The loss of a log-factor by using αLEP cannot be visible in such a small simulation study. 5.2 Efficiency simulations Besides the convergence rates simulations above we also want to numerically infer on the constant in the oracle inequality which will be done by efficiency simulations. Therefore (inspired by Bauer and Lukas (2011); Chernousova and Golubev (2014)) we consider the following setup. The forward operator is a 300 × 300 diagonal matrix with singular values λ (k) = k −a with a fixed parameter a > 0. Then we repeat the following experiment 104 times : Given  a parameter ν we generate a random ground truth f ∈ R300 by f (k) = ±k −ν · 1 + N 0, 0.12 where the sign is independent and uniformly distributed for each component. From this ground truth, data is  generated according to Y (k) = λ (k) · f (k) + N 0, σ 2 where the noise is again independent in each component. Based on the data compute empirical versions of the oracle risk Ror (σ), the 17 Example 2 Example 1 101 10−1 10−2 10−3 100 Ror (σ) Rpred (σ) RLEP (σ) 10−4 Ror (σ) Rpred (σ) RLEP (σ) 1 3 σ3 σ4 10−5 −8 10 10−7 10−6 σ 10−5 10−1 −8 10 10−4 10−7 10−6 σ 10−5 10−4 Figure 2: Simulation results for spectral cut-off. Example 1 Example 2 101 10−1 10−2 10−3 100 Ror (σ) Rpred (σ) RLEP (σ) 10−4 Ror (σ) Rpred (σ) RLEP (σ) 3 1 σ4 10−5 −8 10 10−7 10−6 σ 10−5 σ3 10−1 −8 10 10−4 10−7 10−6 σ 10−5 10−4 Figure 3: Simulation results for Tikhonov regularization. Example 1 Example 2 101 10−1 10−2 10−3 100 Ror (σ) Rpred (σ) RLEP (σ) 10−4 Ror (σ) Rpred (σ) RLEP (σ) 1 3 σ4 10−5 10−8 10−7 10−6 σ 10−5 σ3 10−1 10−4 10−8 10−7 10−6 σ 10−5 10−4 Figure 4: Simulation results for Showalter regularization. prediction risk Rpred (σ), and the Lepskiı̆ risk RLEP (σ) for Tikhonov regularization. In Figure 5 we depict the fractions of the oracle risk with the different a-posteriori risks for various parameters ν and a to compare the average behavior of these parameter choice methods. In conclusion we empirically find that both choices αpred and αLEP perform nearly as good as the oracle choice if σ is not too small. Comparing the performance of αpred and αLEP it seems 18 1 1 0.9 0.9 a = 3, ν = 0.3 0.8 0.7 a = 4, ν = 0.4 0.8 ror (σ) rpred (σ) ror (σ) rLEP (σ) 0 1 2 3 4 σ 0.7 5 0 1 2 3 5 ·10−2 1 0.9 0.9 a = 5, ν = 0.5 0.8 0.7 4 σ ·10−2 1 ror (σ) rpred (σ) ror (σ) rLEP (σ) a = 6, ν = 0.6 0.8 ror (σ) rpred (σ) ror (σ) rLEP (σ) 0 1 2 3 4 σ 0.7 5 ror (σ) rpred (σ) ror (σ) rLEP (σ) 0 1 2 3 σ ·10−2 4 5 ·10−2 Figure 5: Efficiency simulations for Tikhonov regularization with different smoothness parameters a and ν. that αLEP behaves better for small values of σ, even though this has not been observed in Figures 2–4. Nevertheless, the computational effort for αpred is significantly smaller: in our efficiency simulations around 90% of the computation time were spent for computing αLEP in (22). 6 Conclusion and outlook In this study we have analyzed a parameter choice method for filter-based regularization methods applied to linear statistical inverse problems. Therefore we have proven an oracle inequality, which generalizes the one from Chernousova and Golubev (2014) to general ordered filters satisfying weak assumptions (cf. Definition 1 and Assumption 3). From this oracle inequality we derived convergence rates of the investigated parameter choice, which are actually order optimal in a wide range of cases. We point out that our techniques do not seem to be limited to the specific choice of α investigated here. Quite the contrary, we provide a general strategy to prove an oracle inequality, which might be used for other choices as well. If one would consider a different parameter choice rule, then an oracle inequality can be carried out the same way as in this study provided the following ingredients are available: • general moment bounds for the prediction risk as in Corollary 4.1 (in our case based on the exponential bounds proven by Kneip (1994)), • a deterministic optimality result as in Lemma 4.2, • estimates for the behavior of the regularization algorithm as in Lemma 4.3. Note that the latter two assumptions do not rely on the parameter choice rule at all but only on the interplay of the operator, the regularization method, and the source condition. Consequently, whenever the general moments can be bounded, the analysis can basically be carried over from standard results, see e.g. Bellec and Tsybakov (2016) for a useful deviation inequality for regularization methods with convex penalties. 19 Even though we have always assume that the noise level σ is known, the generalization to unknown σ is straightforward. For the choice of parameter αpred , we simply replace σ by a proper estimator σ̂ in (12). The only affected part in our argumentation is the Kneip’s deviation bound in Theorem 2.1, which still holds if we further assume the smoothness of T f (this is usually the case due to the blessing of ill-posedness), see (Kneip, 1994, Section 6) for further details. Another possible generalization concerns the errors in (1). If ξ is such that the ξk ’s in (5) are independent sub-Gaussian errors, then there are two crucial parts of the proofs which have to be generalized: Theorem 2.1 and Lemma 4.4. In fact it turns out that both also hold for independent sub-Gaussian errors (see Kneip, 1994; Golubev, 2010), so the whole analytical methodology remains valid in such a case as well. The general analytical strategy advocated in this paper, of course, has its own limitations, as the resulting oracle inequality might turn out to be inadequate or even trivial in certain cases (see Section 3.3.2 for instance). Future questions include generalizations to exponentially ill-posed problems, nonlinear problems and noise models with heavier tails. Acknowledgements FW wants to thank Yu. Golubev for pointing his attention to the inspiring paper (Chernousova and Golubev, 2014) during a visit in Göttingen. FW gratefully acknowledges financial support by the German Research Foundation DFG through subproject A07 of CRC 755, and HL acknowledges support through RTG 2088, subproject B2, and the National Nature Science Foundation of China (61571008, 61402495). References Abramovich, F. and Silverman, B. W. (1998). Wavelet decomposition approaches to statistical inverse problems. Biometrika, 85:115–129. Bakushinskiı̆, A. B. (1984). Remarks on the choice of regularization parameter from quasioptimality and relation tests. Zh. Vychisl. Mat. i Mat. Fiz., 24(8):1258–1259. Bauer, F. and Hohage, T. (2005). A Lepskij-type stopping rule for regularized Newton methods. Inverse Probl., 21(6):1975. Bauer, F. and Lukas, M. A. (2011). Comparing parameter choice methods for regularization of ill-posed problems. Math. Comput. Simulation, 81(9):1795–1841. Bellec, P. C. and Tsybakov, A. B. (2016). Bounds on the prediction error of penalized least squares estimators with convex penalty. arXiv:1609.06675. Birgé, L. and Massart, P. (2001). Gaussian model selection. J. Eur. Math. Soc. (JEMS), 3(3):203– 268. Birgé, L. and Massart, P. (2007). Minimal penalties for Gaussian model selection. Probab. Theory Related Fields, 138(1-2):33–73. Bissantz, N., Hohage, T., Munk, A., and Ruymgaart, F. (2007). Convergence rates of general regularization methods for statistical inverse problems and applications. SIAM J. Numer. Anal., 45(6):2610–2636. Blanchard, G., Hoffmann, M., and Reiß, M. (2016). Optimal adaptation for early stopping in statistical inverse problems. arXiv:1606.07702. Candès, E. J., Sing-Long, C. A., and Trzasko, J. D. (2013). Unbiased risk estimates for singular value thresholding and spectral estimators. IEEE Trans. Signal Process., 61(19):4643–4657. 20 Cavalier, L. (2011). Inverse problems in statistics. In Inverse problems and high-dimensional estimation, volume 203 of Lect. Notes Stat. Proc., pages 3–96. Springer, Heidelberg. Cavalier, L., Golubev, G. K., Picard, D., and Tsybakov, A. B. (2002). Oracle inequalities for inverse problems. Ann. Statist., 30(3):843–874. Dedicated to the memory of Lucien Le Cam. Cavalier, L. and Golubev, Y. (2006). Risk hull method and regularization by projections of illposed inverse problems. Ann. Statist., 34(4):1653–1677. Cavalier, L., Golubev, Y., Lepski, O., and Tsybakov, A. (2003). Block thresholding and sharp adaptive estimation in severely ill-posed inverse problems. Teor. Veroyatnost. i Primenen., 48(3):534–556. Chernousova, E. and Golubev, Y. (2014). Spectral cut-off regularizations for ill-posed linear models. Math. Methods Statist., 23(2):116–131. Cohen, A., Hoffmann, M., and Reiß, M. (2004). Adaptive wavelet Galerkin methods for linear inverse problems. SIAM J. Numer. Anal., 42(4):1479–1501. Davies, A. R. and Anderssen, R. S. (1986). Improved estimates of statistical regularization parameters in Fourier differentiation and smoothing. Numer. Math., 48(6):671–697. Deledalle, C.-A., Vaiter, S., Fadili, J., and Peyré, G. (2014). Stein Unbiased GrAdient estimator of the Risk (SUGAR) for multiple parameter selection. SIAM J. Imaging Sci., 7(4):2448–2487. Dette, H., Munk, A., and Wagner, T. (1998). Estimating the variance in nonparametric regressionwhat is a reasonable choice? J. R. Stat. Soc. Ser. B. Stat. Methodol., 60(4):751–764. Donoho, D. L. (1995). Nonlinear solution of linear inverse problems by wavelet-vaguelette decomposition. Appl. Comput. Harmon. Anal., 2(2):101–126. Engl, H., Hanke, M., and Neubauer, A. (1996). Regularization of Inverse Problems. Springer. Goldenshluger, A. (1999). 5(5):907–925. On pointwise adaptive nonparametric deconvolution. Bernoulli, Golub, G. H., Heath, M., and Wahba, G. (1979). Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics, 21(2):215–223. Golubev, G. K. and Khas’minskiı̆, R. Z. (1999). A statistical approach to some inverse problems for partial differential equations. Problemy Peredachi Informatsii, 35(2):51–66. Golubev, Y. (2010). On universal oracle inequalities related to high-dimensional linear models. Ann. Statist., 38(5):2751–2780. Hall, P., Kay, J. W., and Titterinton, D. M. (1990). Asymptotically optimal difference-based estimation of variance in nonparametric regression. Biometrika, 77:521–528. Ingster, Y., Laurent, B., and Marteau, C. (2014). Signal detection for inverse problems in a multidimensional framework. Math. Methods Statist., 23(4):279–305. Ingster, Y. I., Sapatinas, T., and Suslina, I. A. (2012). Minimax signal detection in ill-posed inverse problems. Ann. Statist., 40(3):1524–1549. Johnstone, I. M., Kerkyacharian, G., Picard, D., and Raimondo, M. (2004). Wavelet deconvolution in a periodic setting. J. R. Stat. Soc. Ser. B Stat. Methodol., 66(3):547–573. Johnstone, I. M. and Silverman, B. W. (1991). Discretization effects in statistical inverse problems. J. Complexity, 7:1–34. Kneip, A. (1994). Ordered linear smoothers. Ann. Statist., 22(2):835–866. 21 Lepskiı̆, O. V. (1991). On a problem of adaptive estimation in Gaussian white noise. Theory Probab. Appl., 35(3):454–466. Li, K.-C. (1987). Asymptotic optimality for Cp , CL , cross-validation and generalized crossvalidation: discrete index set. Ann. Statist., 15(3):958–975. Lucka, F., Proksch, K., Brune, C., Bissantz, N., Burger, M., Dette, H., and Wübbeling, F. (2017). Risk estimators for choosing regularization parameters in ill-posed problems – properties and limitations. arXiv:1701.04970. Luisier, F., Blu, T., and Unser, M. (2007). A new sure approach to image denoising: Interscale orthonormal wavelet thresholding. IEEE Trans. Image Process., 16(3):593–606. Lukas, M. A. (1993). Asymptotic optimality of generalized cross-validation for choosing the regularization parameter. Numer. Math., 66(1):41–66. Lukas, M. A. (1995). On the discrepancy principle and generalised maximum likelihood for regularisation. Bull. Austral. Math. Soc., 52(3):399–424. Mair, B. A. and Ruymgaart, F. H. (1996). Statistical inverse estimation in Hilbert scales. SIAM J. Appl. Math., 56(5):1424–1444. Mallows, C. L. (1973). Some comments on Cp . Technometrics, 15(4):661–675. Mathé, P. (2006). The Lepskiı̆ principle revisited. Inverse Probl., 22(3):L11–L15. Mathé, P. and Hofmann, B. (2008). How general are general source conditions? Inverse Problems, 24(1):015009. Mathé, P. and Pereverzev, S. V. (2001). Optimal discretization of inverse problems in Hilbert scales. Regularization and self-regularization of projection methods. SIAM J. Numer. Anal., 38(6):1999–2021. Mathé, P. and Pereverzev, S. V. (2003). Geometry of linear ill-posed problems in variable Hilbert scales. Inverse Probl., 19(3):789–803. Mathé, P. and Pereverzev, S. V. (2006). Regularization of some linear ill-posed problems with discretized random noisy data. Math. Comp., 75(256):1913–1929 (electronic). Morozov, V. A. (1966). On the solution of functional equations by the method of regularization. Soviet Math. Dokl., 7:414–417. O’Sullivan, F. (1986). A statistical perspective on ill-posed inverse problems. 1(4):502–527. With comments and a rejoinder by the author. Statist. Sci., Pinsker, M. S. (1980). Optimal filtration of square-integrable signals in Gaussian noise. Probl. Inf. Transm., 16(2):52–68. (Russian). Rice, J. (1984). Bandwidth choice for nonparametric regression. Ann. Statist., 12(4):1215–1230. Rieder, A. (2005). Runge-Kutta integrators yield optimal regularization schemes. Inverse Probl., 21(2):453–471. Stein, C. M. (1981). Estimation of the mean of a multivariate normal distribution. Ann. Statist., 9(6):1135–1151. Tsybakov, A. (2000). On the best rate of adaptive estimation in some inverse problems. C. R. Acad. Sci. Paris Sér. I Math., 330(9):835–840. Vogel, C. R. (1986). Optimal choice of a truncation level for the truncated SVD solution of linear first kind integral equations when data are noisy. SIAM J. Numer. Anal., 23(1):109–117. 22 Vogel, C. R. (2002). Computational Methods for Inverse Problems, volume 23 of Frontiers in Applied Mathematics. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA. Wahba, G. (1977). Practical approximate solutions to linear operator equations when the data are noisy. SIAM J. Numer. Anal., 14(4):651–667. Wang, Y.-Q. and Morel, J.-M. (2013). SURE guided Gaussian mixture image denoising. SIAM J. Imaging Sci., 6(2):999–1034. Werner, F. (2015). On convergence rates for iteratively regularized Newton-type methods under a Lipschitz-type nonlinearity condition. J. Inverse Ill-Posed P., 23(1):75–84. Werner, F. and Hohage, T. (2012). Convergence rates in expectation for Tikhonov-type regularization of Inverse Problems with Poisson data. Inverse Probl., 28(10):104004. 23
10math.ST
REDUCING THE RANK OF A MATROID arXiv:1211.4853v2 [cs.DS] 5 Sep 2015 GWENAËL JORET AND ADRIAN VETTA Abstract. We consider the rank reduction problem for matroids: Given a matroid M and an integer k, find a minimum size subset of elements of M whose removal reduces the rank of M by at least k. When M is a graphical matroid this problem is the minimum k-cut problem, which admits a 2-approximation algorithm. In this paper we show that the rank reduction problem for transversal matroids is essentially at least as hard to approximate as the densest k-subgraph problem. We also prove that, while the problem is easily solvable in polynomial time for partition matroids, it is NP-hard when considering the intersection of two partition matroids. Our proof shows, in particular, that the maximum vertex cover problem is NP-hard on bipartite graphs, which answers an open problem of B. Simeone. 1. Introduction Consider the well-known minimum k-cut problem: Given a graph G and an integer k, find a minimum size subset of edges whose removal increases the number of connected components by at least k. This problem is NP-hard, assuming k is part of the input, and several 2-approximation algorithms have been developed for it over the years [14, 17, 18, 20]. Notice that the minimum k-cut problem has a simple formulation in terms of matroids: Given a graph G and an integer k, find a minimum size subset of elements of the graphical matroid of G whose removal reduces its rank by at least k. This observation motivates the study of the rank reduction problem in other classes of matroids. For example, is the rank reduction problem computationally hard and, if so, does it admit approximation algorithms with good approximation guarantees (as is the case for graphical matroids)? Moreover, as we will see, many fundamental problems can be formulated in this rank reduction framework. In this paper, our focus is on the case of transversal matroids. First, we show that the rank reduction problem in transversal matroids is roughly at least as hard to approximate as the densest k-subgraph problem: Given a graph G and an integer k, find a subset of k vertices inducing a subgraph with a maximum number of edges. (Note that in our reduction the parameter k is not necessarily the same one as in the rank reduction problem.) The densest k-subgraph 1 problem can be approximated to within a factor of O(n 4 + ) due to a recent breakthrough result of [4]. Moreover, it is widely believed [1, 5, 10, 11] that its hardness is also close to this upper bound – indeed, Bhaskara et al. [5] present nΩ(1) lower bounds for lift and project methods based upon the Sherali-Adams and the Lassere hierarchies. We will show in particular that an O(mε )-approximation algorithm for the rank reduction problem on transversal matroids (where m denotes the number of elements) implies an O(n4ε )-approximation algorithm for the densest k-subgraph (where n is the number of vertices). Secondly, we prove that while the rank reduction problem is easily solvable in polynomial time for partition matroids (a special class of transversal matroids), it is NP-hard when considering the intersection of two partition matroids. Our proof shows in particular that the maximum vertex cover problem—also known as the partial vertex cover problem—is NP-hard on bipartite graphs. Here, one is given a graph and a positive integer k, and the goal is to find a set of k vertices hitting as many edges as possible. The problem is obviously NP-hard on arbitrary graphs since it contains the vertex cover problem as a special case. Whether it remained NPhard on bipartite graphs was an open problem of B. Simeone (see [15]). We note that we learned 1 after finishing this paper that Apollonio and Simeone [2] independently obtained a proof of this result. 2. Preliminaries In this section we give the necessary definitions and notations. All graphs and matroids in this paper are finite, and “graph” will always mean an undirected simple graph. We use the shorthands |G| and ||G|| for the number of vertices and edges of a graph G, respectively. We denote by µ(G) the maximum size of a matching in G, which we call the matching number of G. A matroid M is a pair (E, I) where I is a family of subsets, called the independent sets, of the ground set E satisfying the following three axioms: • the empty set ∅ is independent; • every subset of an independent is again independent, and • if X and Y are two independent sets with |X| > |Y | then there exists x ∈ X \ Y such that Y ∪ {x} is independent. The inclusion-wise maximal independent sets are the bases of the matroid M ; as follows from the third axiom the bases all have the same cardinality. The rank function of M is the function r : 2E → N that assigns to each subset X of elements of E the maximum size r(X) of an independent set contained in X, called the rank of X. In particular, r(E) is the cardinality of a basis of M , which is called the rank of M . The rank reduction problem for matroids is defined as follows: Given a positive integer k and a matroid on a set A of elements with rank function r, the goal is to find a minimum size subset X ⊆ A such that r(A \ X) 6 r(A) − k. For example consider the case of graphical matroids: Given a graph G = (V, E), the graphical matroid of G is obtained by taking E as ground set, and letting a subset F of edges be independent if and only if the corresponding subgraph is acyclic. Here the rank reduction problem is the minimum k-cut problem. As stated, here we study transversal matroids. A bipartite graph G with bipartition (A, B) induces a matroid M as follows: The matroid M has A as ground set, and X ⊆ A is independent in M if and only if there exists a matching of G covering X. The fact that this is indeed a matroid is well-known; see for instance [19]. Any matroid M that can be obtained this way is called a transversal matroid, and the bipartite graph G is said to be a model for M . Observe that, letting r denote the rank function of M , the rank r(X) of X ⊆ A is equal to µ(G[X ∪ B]). Also note that being a transversal matroid is a hereditary property, in the sense that for each set X ⊆ A, taking the restriction I ∩ X of all independent sets I yields a transversal matroid on ground set X. A special case of transversal matroids are partition matroids. Here we are given a collection E1 , . . . , Ep of disjoint sets and integers d1 , . . . , dp such that 0 6 di 6 |Ei | for each i ∈ {1, . . . , k}. One can define a corresponding matroid with ground set E := E1 ∪ · · · ∪ Ek by letting X ⊆ E be independent if and only if |Ei ∩ X| 6 di for each i ∈ {1, . . . , k}. Such a matroid is called a partition matroid, with model ((E1 , d1 ), . . . , (Ep , dp )). This corresponds to a transversal matroid on a bipartite graph G with bipartition (E, B), where B has di vertices that are adjacent to all vertices in Ei , and none other, for each set Ei . Notice that partition matroids are also hereditary. Throughout, since we restrict ourselves to specific families of matroids, we assume that the matroid is given concisely and not given explicitly as a set system in input. Specifically, a corresponding model of the matroid is provided: a bipartite graph for a transversal matroid, a graph for a graphical matroid, etc. More generally, the rank reduction problem can be considered on the intersection of matroids. Given two matroids M1 = (E, I1 ) and M2 = (E, I2 ) with common ground set E, the intersection M1 ∩ M2 of M1 and M2 is the pair (E, I) where I is the family of sets X ⊆ E that are independent in both M1 and M2 , which are said to be the independent sets of M1 ∩ M2 . While 2 the independence system (E, I) is not necessarily a matroid anymore, it enjoys several of the nice properties of matroids (see [19]). In particular, letting as before the rank r(X) of X ⊆ E be the maximum size of an independent set of M1 ∩ M2 contained in X, the rank r(E) of M1 ∩ M2 can be computed in polynomial time given access to the rank functions r1 and r2 of M1 and M2 , respectively, by a classical result of Edmonds (see [19]). We examine the rank reduction problem for the intersection of two partition matroids in Section 4. 3. Transversal Matroids We start our investigation of the rank reduction problem with an easy observation, namely that the problem can be solved in polynomial time if the input matroid is a partition matroid. Theorem 3.1. The rank reduction problem can be solved in polynomial time on partition matroids. Proof. Let M be a given partition matroid with model ((E1 , d1 ), . . . , (Ep , dp )) P and rank function r. Let E := E1 ∪ · · · ∪ Ep denote the ground set of M . Observe that r(E) = pi=1 di . Let k be the given parameter for the rank reduction problem on M . We may assume that 1 6 k 6 r(E). Let ci :=P |Ei | − di for each i ∈ {1, . . . , p}. Given X ⊆ E, the rank r(E \ X) of the set E \ X is equal to pi=1 min(|Ei \ X|, di ). Let X ⊆ E be such that r(E \ X) 6 r(E) − k. Moreover, assume X is inclusion-wise minimal with this property. Then, for each i ∈ {1, . . . , p}, either |Ei ∩ X| > ci + 1 or Ei ∩ X = ∅. Moreover, letting J be the subset of indices i ∈ {1, . . . , p} such that Ei ∩ X 6= ∅, we have that P P i∈J ci . i∈J di > k and |X| = k + P Conversely, suppose J 0 ⊆ {1, . . . , p} is such that i∈J 0 di > k. S Then choosing arbitrarily ci elements ofP Ei , for each i ∈ J 0 , plus k additional elements from i∈J 0 Ei gives a set X 0 with |X 0 | = k + i∈J 0 ci such that r(E \ X 0 ) 6 r(E) − k. Therefore, computing an optimal solution to the rank reduces to the P reduction problem P problem of finding a subset J ⊆ {1, . . . , p} such that i∈J di > k and i∈J ci is minimum. Thus we obtain a knapsack problem. Moreover, as ci and di are at most |Ei |, they are of polynomial size when encoded in unary. Thus the knapsack problem can be solved easily in polynomial time using dynamic programming.  While the rank reduction problem admits a simple polynomial-time algorithm on partition matroids, the problem turns out to be more difficult on the broader class of transversal matroids. In fact, up to some degree, the problem can be viewed as a generalization of the densest ksubgraph problem. In the latter problem, one is given a graph G and a positive integer k, and the aim is to find a subgraph H of G with |H| = k and ||H|| maximum. Towards this goal, we consider a closely related problem, the minimum t-edge subgraph problem: Given a graph G and a positive integer t, the goal is to find a subgraph H of G with ||H|| = t and |H| minimum. We start by drawing a connection between the rank reduction problem on transversal matroids and the minimum t-edge subgraph problem. Then we will extend the connection to the densest k-subgraph problem. Lemma 3.2. For each constant ε with 0 < ε < 1/2, every O(mε )-approximation algorithm for the rank reduction problem on transversal matroids with m elements can be turned into an O(n2ε )-approximation algorithm for the minimum t-edge subgraph problem on graphs with n vertices. Proof. Let G = (V, E) be an instance of the minimum t-edge subgraph problem. Let n := |V |. Let V1 , V2 , . . . , Vn be n disjoint copies of V . Let E 0 be a disjoint copy of E. Let H be the bipartite graph with bipartition (A, B) where A = V1 ∪ V2 ∪ · · · ∪ Vn ∪ E 0 and B = E, and where u ∈ A is adjacent to v ∈ B if either u corresponds to a vertex of G that is incident to the edge corresponding to v in G, or if u and v correspond to the same edge of G. Let r denote the rank function of the transversal matroid induced by H on A; thus for X ⊆ A, r(X) is the maximum size of a matching in H[X ∪ B]. Obviously, r(A) = |E|, since every v ∈ B 3 can be matched to its copy in A. Let m := |A| denote the number of elements of the transversal matroid. Now consider the rank reduction problem on this matroid with k = t. Recall that a feasible solution is a subset X ⊆ A such that r(A \ X) 6 r(A) − t = |E| − t. As is well known, we have that r(A \ X) 6 r(A) − t for X ⊆ A if and only if there exists Y ⊆ B such that |NH (Y ) \ X| 6 |Y | − t, where NH (Y ) denotes the set of vertices of H that have a neighbor in Y .1 Such a set Y is said to be a witness for X. The set Y defines in turn a corresponding subgraph GY of G consisting of all the edges of G included in Y , and the vertices of G incident to those edges. By definition of H, the set NH (Y ) consists of the n copies of each vertex of GY , along with the copies in E 0 of each edge of GY . Observe that any set X 0 obtained by taking the n copies in A of each vertex of GY and t arbitrarily chosen edges of GY in A is such that |NH (Y ) \ X 0 | = |Y | − t. Moreover, since |NH (Y ) \ X| 6 |Y | − t and X 0 ⊆ NH (Y ), it follows that |X 0 | 6 |X|, that is, X 0 is a solution of size no greater than X and having the same witness Y . Such a pair (X 0 , Y ) is called a canonical pair. Now, if a canonical pair (X, Y ) is such that |Y | > t, then NH (Y ) \ X consists of exactly |Y | − t > 0 edges of GY (or more precisely, their copies in E 0 ). For each u ∈ NH (Y ) \ X with corresponding copy v in B, we have that X \ {u} is again a solution to the rank reduction problem, with witness Y \ {v}, and of size smaller than X. To summarize the above discussion, given an arbitrary set X 0 ⊆ A such that r(A \ X 0 ) 6 r(A) − t, one can in polynomial time compute a canonical pair (X, Y ) with |Y | = ||GY || = t and |X| = n|GY | + t 6 |X 0 |. Conversely, for every subgraph G0 ⊆ G with ||G0 || = t, there is a natural corresponding canonical pair (X, Y ), where Y contains the copies in B of the t edges of G0 , and where X = NH (Y ). Letting x∗ and j ∗ denote the size of an optimal solution for the rank reduction and minimum t-edge subgraph problems, respectively, it follows that x∗ = nj ∗ + t. Now suppose that the rank reduction problem admits a cmε -approximation algorithm, where 0 < ε < 1/2 and c > 0 are absolute constants. Letting (X, Y ) be a canonical pair with |Y | = t obtained using this algorithm, we have n|GY | + t = |X| 6 cmε x∗ = c(n2 + |E|)ε (nj ∗ + t) 6 c(2n2 )ε (nj ∗ + t) and hence   t c(2n2 )ε (nj ∗ + t) − t 2ε ∗ 6 2cn j + 6 2cn2ε (j ∗ + j ∗ ) = 4cn2ε j ∗ . |GY | 6 n n ∗ 2 ∗ (In the last inequality we used the fact that (j ∗ )2 > t, and thus nt 6 (jn) 6 j nn = j ∗ .) Therefore, GY is a t-edge subgraph whose order is within a 4cn2ε -factor of optimal.  As pointed out to us by an anonymous referee, the following lemma is implicit in the recent work of Chlamtac, Dinitz, and Krauthgamer [8] (in [8], the minimum t-edge subgraph problem is called the smallest m-edge subgraph problem). We include a proof nevertheless, for completeness. Lemma 3.3. For each constant ε with 0 < ε < 1/2, every O(nε )-approximation algorithm for the minimum t-edge subgraph problem can be turned into an O(n2ε )-approximation algorithm for the densest k-subgraph problem. 1This is a consequence of Hall’s Marriage Theorem, as we now explain for completeness. Add t−1 new vertices to the set A, yielding a set A0 , and make each of them adjacent to every vertex in B. Let H 0 be the bipartite graph obtained from H in this manner. Let X ⊆ A. Then every matching M in H \ X with |M | 6 |B| − (t − 1) can be extended to a matching M 0 of H 0 \ X with |M 0 | = |M | + t − 1. Conversely, every matching M 0 in H 0 \ X with |M 0 | > t − 1 yields a matching M of H \ X with |M | > |M 0 | − (t − 1) by discarding the at most t − 1 edges of M 0 incident to the vertices in A0 \ A. Hence, H \ X has a matching of size |B| − (t − 1)—or equivalently, r(A \ X) > r(A) − (t − 1)—if and only if B can be completely matched in H 0 \ X. By Hall’s theorem, the latter happens if and only if |NH 0 −X (Y )| > |Y | for every Y ⊆ B, which is equivalent to |NH (Y ) \ X| > |Y | − (t − 1) for every Y ⊆ B. Therefore, r(A \ X) 6 r(A) − t if and only if there exists Y ⊆ B such that |NH (Y ) \ X| 6 |Y | − t. 4 Proof. Suppose that the minimum t-edge subgraph problem admits a c0 nε -approximation algorithm, which we denote A, where 0 < ε < 1 and c0 > 1 are absolute constants. Let G be an instance of the densest k-subgraph problem. As before, we let n and m denote the number of vertices and edges of G, respectively. We may assume n > k > 2. Since c0 > 1 and nε > 1, there exists c with c0 6 c 6 2c0 such that cnε is an integer. We will consider the approximation factor of A to be cnε in what follows, to avoid cumbersome floors and ceilings in the calculations. Run algorithm A on G with t = 1, 2, . . . , m. Let Hi be the ith subgraph returned by the algorithm. Clearly, we may suppose that |Hi | 6 |Hi+1 | for each i ∈ {1, . . . , m − 1}. Let z ∗ denote the number of edges in an optimal solution to the densest k-subgraph problem on G. If |Hm | 6 kcnε then let t0 := m, otherwise let t0 be the index in {1, . . . , m − 1} such that |Ht0 | 6 kcnε and |Ht0 +1 | > kcnε . Since algorithm A is a cnε -approximation algorithm, and since either t0 = m or |Ht0 +1 | > kcnε , it follows that every subgraph of G with exactly k vertices has at most t0 edges, that is, z ∗ 6 t0 . Let q := d|Ht0 |/bk/2ce. Observe that 2 6 q 6 3cnε . Let V1 , V2 , . . . , Vq be a partition of the vertex set of Ht into q subsets with |V1 | = |V2 | = · · · = |Vq−1 | = bk/2c and |Vq | = |Ht0 | − (q − 1)bk/2c 6 bk/2c. Let (Vi , Vj ) be a pair with i 6= j such that ||Ht0 [Vi ∪ Vj ]|| is maximized. By the pigeonhole principle, ||Ht0 [Vi ∪ Vj ]|| > t0 ||Ht0 ||   = q q > 2 2 t0 z∗ > . (3cnε )2 9c2 n2ε If |Vi ∪ Vj | = k, then let H := Ht0 [Vi ∪ Vj ]. If, on the other hand, |Vi ∪ Vj | < k, then let H := Ht0 [Vi ∪ Vj ∪ X] where X is an arbitrary subset of V (Ht0 ) \ (Vi ∪ Vj ) of size k − |Vi ∪ Vj |. Thus in both cases |H| = k and ||H|| > z ∗ /9c2 n2ε . Hence, H is a solution to the densest k-subgraph problem on G whose number of edges is within a 9c2 n2ε -factor of the optimum.  Combining Lemma 3.2 and 3.3 gives: Theorem 3.4. For each constant ε with 0 < ε < 1/4, every O(mε )-approximation algorithm for the rank reduction problem on transversal matroids with m elements can be turned into an O(n4ε )-approximation algorithm for the densest k-subgraph problem on graphs with n vertices. As discussed in the introduction, the best approximation algorithm for the densest k-subgraph problem currently known has an approximation ratio of O(n1/4+δ ) for any fixed δ > 0 [4] and it is conjectured that the inapproximability of the problem is of a similar magnitude. It would be nice to obtain strong inapproximability bounds for the rank reduction problem that do not rely on this conjecture. One approach may be to analyze hypergraphs as the rank reduction problem in transversal matroids incorporates the hypergraph version of the minimum t-edge subgraph problem. That is, we wish to select as few vertices as possible that induce at least t hyperedges. Perhaps surprisingly, little is known about this problem. As far as we are aware, the only specific hardness result is NP-hardess due Vinterbo [21] who studied the problem in the context of making medical databases anonymous. We conclude this section with a remark about the approximability of the minimum t-edge subgraph problem itself. Given the existence of a O(n1/4+δ )-approximation algorithm for the densest k-subgraph problem, in view of Lemma 3.3 it is perhaps natural to wonder whether one could achieve a O(n1/8+δ )-approximation for the former problem. While this is still open as far as we know, Chlamtac et al. [8] recently made progress in that direction by describing an algorithm √ for the minimum t-edge subgraph problem with an approximation ratio of O(n3−2 2+δ ) = O(n0.1716+δ ) for fixed δ > 0. 4. The Maximum Vertex Cover Problem in Bipartite Graphs As we have seen, the rank reduction problem admits a fairly simple polynomial-time algorithm on partition matroids but becomes much harder on transversal matroids, in the sense that approximation algorithms offering good guarantees seem unlikely to exist. Another interesting 5 generalization of the case of partition matroids is to consider the intersection of two partition matroids. As is well-known, the set of matchings of a bipartite graph G = (V, E) with bipartition (A, B) can be modeled as the family of common independent sets of two partition matroids M1 and M2 defined on E: Take M1 to be the partition matroid with model ((E(u1 ), 1), . . . , (E(ua ), 1)) and M2 the partition matroid with model ((E(v1 ), 1), . . . , (E(vb ), 1)), where A = {u1 , . . . , ua }, B = {v1 , . . . , vb }, and for w ∈ V the set E(w) denotes the set of edges incident to w. Hence, in this specific case the rank reduction problem on M1 ∩ M2 amounts to finding a subset F of edges of G of minimum size such that µ(G − F ) 6 µ(G) − k. In this section we show that this problem is NP-hard. More accurately, we show that a problem polynomially equivalent to it, the maximum vertex cover problem on bipartite graphs, is NP-hard; see Theorem 4.1. This solves an open problem of B. Simeone (see [15]). The maximum vertex cover problem (also known as the partial vertex cover problem) is defined as follows: Given a graph G = (V, E) and a positive integer k 6 |G|, find a subset X of vertices of G with |X| = k such that the number of edges covered by X is maximized. (An edge e of G is covered by X if e has at least one endpoint in X.) Now, if G is bipartite, t is a positive integer with t 6 µ(G), and F is a subset of edges of G such that µ(G − F ) 6 µ(G) − t =: k, then by Kőnig’s theorem G − F has a vertex cover X of size k, and hence X covers at least |E| − |F | edges of G. (We remark that X could cover some edges of F too, and that X can be computed in polynomial time given F .). Conversely, for every set X ⊆ V with |X| = k, the set F of edges of G not covered by X is such that µ(G − F ) 6 k. Therefore, for bipartite graphs, the maximum vertex cover problem is polynomially equivalent to that of finding a minimum-size set of edges decreasing the matching number by a prescribed amount. It should be noted that two recent works [6, 9] with an overlapping set of authors claim that the NP-hardness of the maximum vertex cover problem on bipartite graphs can be derived directly from the reduction of Corneil and Perl [7] showing that the densest k-subgraph problem is NP-hard on bipartite graphs. However, the argument relating the latter reduction to the maximum vertex cover problem, described explicitly in [9, Lemma 4], is flawed.2 We also mention that the proof of Theorem 1 in [6], showing that a related problem called the maximum quasi-independent set problem is NP-hard on bipartite graphs, relies on the assumption that the maximum vertex cover problem is NP-hard on bipartite graphs. Thus our result also fills a gap in that proof. Theorem 4.1. The maximum vertex cover problem is NP-hard on bipartite graphs. Before proving Theorem 4.1, we need to introduce a technical lemma. Lemma 4.2. Let ` be an integer with ` > 6. Then the integer program minimize s. t. x + 2y + 3z   ` x+y+z−s= −` 2   s x6 2 x, y, z, s ∈ N 2As mentioned in [9, Lemma 3], the maximum vertex cover problem in bipartite graphs is polynomially equivalent to the densest k-subgraph problem in complements of bipartite graphs. Thus one may equivalently consider the complexity of the latter problem. In the proof of Lemma 4 in [9], the authors point out that the reduction of [7] implies that the problem  of finding a densest k-subgraph in the complement of a bipartite graph with bipartition (A, B) with k = q + 2q and with the extra requirement that it contains exactly q vertices from  A and 2q vertices from B is NP-hard. From this they wrongly conclude that the densest k-subgraph problem, without this extra constraint, is also NP-hard on complements of a bipartite graphs. (In fact, the instances obtained via the reduction in [7] satisfy |B| > k, and thus a densest k-subgraph is trivially obtained by taking k vertices in the clique B.) 6 has a unique optimal solution given by x = ` 2  , y = 0, z = 0, s = `. Proof. The proof is a straightforward case analysis. Consider an optimal solution x, y, z, s to the integer program and, arguing by contradiction, assume it differs from the solution described above. Let f (x, y, z) := x + 2y + 3z. Case 1: s 6 2. We have x 6 s and thus     ` ` y+z = −`+s−x> − `. 2 2    It follows that f (x, y, z) > 2(y + z) > 2 2` − 2`. But 2 2` − 2` > 2` since ` > 6, contradicting the optimality of the solution. Case 2: 3 6 s < `.           ` ` s ` s y+z = −`+s−x> −`+s− = − − (` − s) > 2. 2 2 2 2 2   s Here, the last inequality follows from the fact that s+1 − 2 2 > 3. Now, increment s by 1, x by 3, and decrement y and z in such a way that they remain non-negative integers and that the sum y + z decreases by exactly 2. The modified solution is still feasible and f (x, y, z) decreases by at least 1, a contradiction. Case 3: s = `. Then y + z > 1, since otherwise we would have the solution described in the  lemma statement. It follows that x 6 2` − 1. Thus we can increment x by 1 and decrement by 1 a positive variable among y, z. This f (x, y,  z), sa contradiction.   strictly decreases ` ` ` Case 4: s > `. Then x + y + z = 2 + s − l > 2 . But x 6 2 < 2 , otherwise the solution cannot be minimum. Therefore y + z > 1. Thus we improve the solution by incrementing x by 1 and decrementing by 1 a positive variable among y, z.  Now we may turn to the proof of Theorem 4.1. Proof of Theorem 4.1. The reduction is from the NP-complete problem Clique: Given a graph H and an integer `, decide whether H contains a clique on ` vertices or not. We may assume ` > 6 (otherwise, we simply check the existence of an `-clique by brute force). We may also suppose that H has minimum degree at least 2. Indeed, a vertex with degree at most 1 cannot be part of an `-clique, and thus those vertices can iteratively be removed from the graph. Finally, we assume that ||H|| > |H| + 2` . This last assumption can also be made without loss of generality. Indeed, if ||H|| is too small then one can simply consider the disjoint union of H with a large enough 3-regular graph; since ` > 6 no vertex from this new 3-regular component can be part of an `-clique. We build an instance (G, k) of the maximum vertex cover problem as follows. First, create two adjacent vertices av and bv for every vertex v ∈ V (H), and similarly two adjacent vertices ae and be for every edge e ∈ E(H). Next, for every edge uv ∈ E(H), add the edges auv bu , buv au and auv bv , buv av . Finally, let   ` k := |H| + ||H|| − + `. 2 Observe that G is bipartite with bipartition  {ax : x ∈ V (H) ∪ E(H)}, {bx : x ∈ V (H) ∪ E(H)} . See Figure 1 for an illustration of the construction. A feasible solution for this instance of the maximum vertex cover problem is a subset X of vertices of G with |X| = k, which we call a partial vertex cover for short. We let c(X) denote the number of edges covered by such a set X. Let OP T denote the maximum of c(X) over every partial vertex cover X of G. A partial vertex cover X of G is nice if  X ∩ {au , bu } ∈ {au }, {au , bu } 7 ay by ax bx aw bw av bv au bu auv buv auy buy avy bvy avw bvw awx bwx axy bxy u y v x w H G Figure 1. Illustration of the construction of the bipartite graph G. (We note that this graph H cannot be a valid instance of the problem because ` > 6 and  thus H cannot satisfy ||H|| > |H| + 2` ; our aim here is only to illustrate how G is obtained from H on a small example.) for every u ∈ V (H) and  X ∩ {ae , be } ∈ ∅, {ae } for every e ∈ E(H). Claim 4.3. Given a partial vertex cover X of G, one can find a nice partial vertex cover X 0 of G with c(X 0 ) > c(X). Proof. First we define a partial vertex cover X̃ based on X which is close to being nice: Let   X̃ := au , bu : u ∈ V (H), au , bu ∈ X ∪ au : u ∈ V (H), |{au , bu } ∩ X| = 1   ∪ ae , be : e ∈ E(H), ae , be ∈ X ∪ ae : e ∈ E(H), |{ae , be } ∩ X| = 1 . By construction |X̃| = |X|. Clearly, an edge ax bx with x ∈ V (H) ∪ E(H) is covered by X̃ if and only if it is covered by X. Also, given a pair (u, e) of vertex u ∈ V (H) and edge e ∈ E(H) such that u is incident to e in H, the set X̃ covers at least as many edges in {ae bu , be au } as X (though not necessarily the same ones). It follows that c(X̃) > c(X). A useful property of the set X̃ is that if bx ∈ X̃ for some x ∈ V (H) ∪ E(H) then necessarily ax ∈ X̃. For simplicity we call this property the a-property of X̃. We need to introduce an additional definition. An element x ∈ V (H) ∪ E(H) is said to be bad in a partial vertex cover Y of G if either x ∈ V (H) and ax , bx ∈ / Y (x is a bad vertex), or x ∈ E(H) and ax , bx ∈ Y (x is a bad edge). Observe that Y is nice if and only if Y has the a-property and there is no bad element. Suppose e = uv is an edge of H which is bad in X̃. If u or v is also bad in X̃, say u, then let   X̃ 0 := X̃ − {be } ∪ {au }. We have ae ∈ X̃, thus the edge ae be is still covered by X̃ 0 . Since X̃ 0 covers also be au , there is at most one edge incident to be in G (namely, be av ) which is not covered by X̃ 0 . On the other 8 hand, X̃ 0 covers the previously uncovered edge au bu . Hence, X̃ 0 is a partial vertex cover with c(X̃ 0 ) > c(X̃). Observe that X̃ 0 still has the a-property, and the edge e is no longer bad in X̃ 0 . If, on the other hand, none of u, v is bad in X̃, then au , av ∈ X̃ by the a-property. Since ae ∈ X̃, it follows that c(X̃ − {be }) = c(X̃). There  exists an element x ∈ V (H) ∪ E(H) such ` that ax ∈ / X̃, because |X̃| = k = |H| + ||H|| − 2 + ` < |H| + ||H|| (since ` > 6). Let then   X̃ 0 := X̃ − {be } ∪ {ax }. The set X̃ 0 is a partial vertex cover with the a-property and with c(X̃ 0 ) > c(X̃). Moreover, the edge e is no longer bad in X̃ 0 . Now apply iteratively the above modifications on X̃ as long as there exists a bad edge. b with the a-property, without bad edges, and with This results in a partial vertex cover X b c(X) > c(X̃). b Suppose u ∈ V (H) is such a vertex, that is, au , bu ∈ b Next we deal with bad vertices in X. / X. Consider two edges e, f incident to u in H. (Recall that H has minimum degree at least 2.)   b = k = |H| + ||H|| − ` + ` and ||H|| > |H| + ` by our assumption on H, we have Since |X| 2 2 b > 2|H|. Together with the a-property of X, b it follows that ae0 ∈ X b for some edge e0 ∈ E(H) |X| b because otherwise e0 would be a bad edge for X. b (possibly e0 = e or e0 = f ). Note that be0 ∈ / X, Let   0 b b 0 X := X − {ae } ∪ {au }. b − {ae0 }) > c(X) b − 3. Furthermore, be , bf ∈ b as there Since ae0 has degree 3 in G we have c(X /X b Thus, the three edges au bu , be au , bf au of G were not covered by X b but are no bad edges in X. 0 0 b , so we have c(X b ) > c(X). b Similarly as before, the partial vertex cover X b 0 has are covered by X b Therefore, iterating this procedure as long as the a-property and one less bad vertex than X. b > c(X) there is a bad vertex, we eventually obtain a partial vertex cover X 0 with c(X 0 ) > c(X) having the a-property and no bad element, as desired.  Consider a nice partial vertex cover X of G. Let S(X) be the set of vertices u ∈ V (H) such that au , bu ∈ X, and let s(X) := |S(X)|. An edge e = uv of H satisfies exactly one of the following three conditions: (1) u, v ∈ S(X); (2) exactly one of u, v belongs to S(X), (3) u, v ∈ / S(X). We say that edge e is of type i (i ∈ {1, 2, 3}) if e satisfies the ith condition above and moreover ae , be ∈ / X. (We will focus on edges e of H such that ae , be ∈ / X in what follows, which is why the other ones do not get assigned a type.) Let Ei (X) be the set of edges of H with type i, and let ei (X) := |Ei (X)|. Claim 4.4. Let X be a nice partial vertex cover. Then c(X) = ||G|| − e1 (X) − 2e2 (X) − 3e3 (X). Proof. As X is nice, av ∈ X for all v ∈ V . Therefore every edge of the form av bv or av be is covered. Also, for each edge e = uv ∈ E(H) \ ∪16i63 Ei (X) we have that ae be , ae bu , ae bv are all covered. Thus the only uncovered edges are incident to vertices ae where e ∈ ∪16i63 Ei (X). Suppose e ∈ ∪16i63 Ei (X) and let us consider which edges among the three edges ae be , ae bu , ae bv are covered by X. If e ∈ E1 (X), then X covers ae bu and ae bv but not ae be . If e ∈ E2 (X), then X covers exactly one of ae bu , ae bv , and avoids ae be . If e ∈ E3 (X), then X covers none of the three edges. Hence, the total number of edges not covered by X is exactly e1 (X)+2e2 (X)+3e3 (X).  Claim 4.5. Let X be a nice partial vertex cover. Then   ` c(X) 6 ||G|| − , 2 9 with equality if and only if s(X) = `, e1 (X) = ` 2  , e2 (X) = e3 (X) = 0. Proof. Let x := e1 (X), y := e2 (X), z := e3 (X) and s := s(X). Then c(X) = ||G|| − f (x, y, z), where f (x, y, z) = x + 2y + 3z by the previous claim. Every edge in E1 (X) has its two endpoints in S(X); hence,   s (1) > x. 2 Also,    ` |H| + ||H|| − (x + y + z − s) = |X| = k = |H| + ||H|| − −` , 2 and thus (2)   ` x+y+z−s= − `. 2 Since ` > 6 and x,  y, z, s, ` are non-negative integers satisfying (1) and (2), by Lemma 4.2 we ` have f (x, y, z) > 2 , or equivalently,   ` c(X) 6 ||G|| − . 2  Moreover, equality holds if and only if x = 2` , y = 0, z = 0, s = ` by the same lemma.  It follows from Claims 4.3 and 4.5 that   ` OP T 6 ||G|| − . 2 If H has an `-clique K ⊆ H, then the subset X ⊆ V (G) defined by X := {au , bu : u ∈ V (K)} ∪ {au : u ∈ V (H) − V (K)} ∪ {ae : e ∈ E(H) − E(K)}   is a partial vertex cover of G with c(X) = ||G|| − 2` , implying OP T = ||G|| − 2` .  Conversely, if OP T = ||G|| − 2` , then there exists a partial vertex cover X of G with  c(X) = ||G|| − 2` , and by Claim 4.3 we may assume that X is nice. From Claim 4.5 we then  have s(X) = `, e1 (X) = 2` , e2 (X) = e3 (X) = 0, implying that S(X) induces an `-clique in H. Therefore, we can decide in polynomial time if H has an `-clique by checking if OP T =  ` ||G|| − 2 . This concludes the proof.  The NP-hardness of the maximum vertex cover problem on bipartite graphs motivates the search for non-trivial approximation algorithms for this class of graphs. A recent result in this direction is due to Apollonio and Simeone [3], who gave an LP-based (4/5)-approximation algorithm for bipartite graphs. Acknowledgments We are grateful to Attila Bernath and Tamás Kiraly for their comments on the proof of Theorem 4.1, and to the two anonymous referees for their helpful remarks and suggestions. We also thank Mohit Singh, Bill Cunningham and Anupam Gupta for interesting discussions, and Nicola Apollonio for providing us with a preliminary version of [2]. 10 References [1] R. Andersen and K. Chellapilla, “Finding dense subgraphs with size bounds”, Proceedings of the 6th International Workshop on Algorithms and Models for the Web-Graph, pp. 25–37, 2009. [2] N. Apollonio and B. Simeone, “The maximum vertex coverage problem on bipartite graphs”. Discrete Applied Mathematics, 165, pp. 37–48, 2014. [3] N. Apollonio and B. Simeone, “Improved Approximation of Maximum Vertex Coverage Problem on Bipartite Graphs”. SIAM J. Discrete Math., 28(3), pp. 1137–1151, 2014. [4] A. Bhaskara, M. Charikar, E. Chlamtac, U. Feige, and A. Vijayaraghavan, “Detecting 1 high log-densities: an O(n 4 ) approximation for densest k-subgraph”, Proceedings of 42nd Symposium on Theory of Computing (STOC), pp. 201–210, 2010. [5] A. Bhaskara, M. Charikar, V. Guruswami, A. Vijayaraghavan, and Y. Zhou “Polynomial Integrality gaps for Strong relaxations of Densest k-subgraph”, Proceedings of 23rd Symposium on Discrete Algorithms (SODA), pp. 388–405, 2012. [6] N. Bourgeois, A. Giannakos, G. Lucarelli, I. Milis, V. Paschos, and O. Pottie, “The max quasi-independent set problem”, Journal of Combinatorial Optimization, 23(1), pp. 94– 117, Jan. 2012. [7] D. Corneil and Y. Perl. “Clustering and domination in perfect graphs”. Discrete Applied Mathematics, 9(1), pp. 27–39, 1984. [8] E. Chlamtac, M. Dinitz, and R. Krauthgamer. “Everywhere-Sparse Spanners via Dense Subgraphsh”, Proceedings of the 2012 IEEE 53rd Annual Symposium on Foundations of Computer Science, pp. 758–767, 2012. [9] F. Della Croce and V. Paschos, “On the max k-vertex cover problem”, Cahiers du LAMSADE, 307, Université Paris-Dauphine, 2011. [10] U. Feige, D. Peleg, and G. Kortsarz, “The dense k-subgraph problem”, Algorithmica, 29(3), pp. 410–421, 2001. [11] U. Feige and M. Seltser, “On the densest k-subgraph problem”, Technical Report CS97-16, Department of Mathematics and Computer Science, Weizmann Institute Of Science, 1997. [12] O. Goldschmidt and D. Hochbaum, “A polynomial time algorithms for the k-cut problem for fixed k”, Mathematics of Operations Research, 19(1), pp. 24–37, 1994. [13] S. Khot, “Ruling out PTAS for graph min-bisection, densest subgraph and bipartite clique”, Proceedings of the 44th Symposium on the Foundations of Computer Science (FOCS), pp. 136–145, 2004. [14] J. Naor and Y. Rabani, “Tree packing and approximating k-cuts”, Proceedings of the 12th Symposium on Discrete Algorithms (SODA), pp. 26–27, 2001. [15] Open Problem Forum of the Egerváry Research Group, http://lemon.cs.elte.hu/ egres/open/Partial_vertex_cover_in_bipartite_graphs. [16] J. Oxley, “What is a matroid?”, Cubo, 5, pp. 179–218, 2003. [17] R. Ravi and A. Sinha, “Approximating k-cuts via network strength”, Proceedings of the 13th Symposium on Discrete Algorithms (SODA), pp. 621–622, 2002. [18] H. Saran and V. Vazirani, “Finding k-cuts within twice the optimal”, SIAM Journal on Computing, 24, pp. 101–108, 1995. [19] A. Schrijver, Combinatorial Optimization: Polyhedra and Efficiency, Springer, 2003. [20] L. Zhao, H. Nagamochi and T. Ibaraki, “Approximating the minimum k-way cut in a graph via minimum 3-way cuts”, Journal of Combinatorial Optimization, 5, pp. 397–410, 2001. [21] S. Vinterbo, “A note on the hardness of the k-ambiguity problem”, Technical Report, 2002. 11 Département d’Informatique Université Libre de Bruxelles Brussels, Belgium E-mail address: [email protected] Department of Mathematics and Statistics, and School of Computer Science McGill University Montreal, Canada E-mail address: [email protected] 12
8cs.DS
Secrecy Capacity of Colored Gaussian Noise Channels with Feedback arXiv:1801.06702v1 [cs.IT] 20 Jan 2018 Chong Li, Yingbin Liang, H. Vincent Poor and Shlomo Shamai (Shitz) Abstract In this paper, the k-th order autoregressive moving average (ARMA(k)) Gaussian wiretap channel with noiseless causal feedback is considered, in which an eavesdropper receives noisy observations of the signals in both forward and feedback channels. It is shown that a variant of the generalized Schalkwijk-Kailath scheme, a capacity-achieving coding scheme for the feedback Gaussian channel, achieves the same maximum rate for the same channel with the presence of an eavesdropper. Therefore, the secrecy capacity is equal to the feedback capacity without the presence of an eavesdropper for the feedback channel. Furthermore, the results are extended to the additive white Gaussian noise (AWGN) channel with quantized feedback. It is shown that the proposed coding scheme achieves a positive secrecy rate. As the amplitude of the quantization noise decreases to zero, the secrecy rate converges to the capacity of the AWGN channel. Index Terms Secrecy Capacity, Feedback, Colored Gaussian, Schalkwijk-Kailath Scheme I. I NTRODUCTION It has been more than a half century since the information theorists started to investigate the capacity of feedback Gaussian channels. As the pioneering studies on this topic, Shannon’s 1956 paper [2] showed that feedback does not increase the capacity of the memoryless AWGN channel, and Elias [3] [4] proposed some simple corresponding feedback coding schemes. Schalkwijk and Kailath [5] [6] then developed a notable linear feedback coding scheme to achieve the capacity of the feedback AWGN channel. Thereafter, the problem of finding the feedback capacity and the capacity-achieving codes for the memory Gaussian channels (e.g. ARMA(k)) has been extensively studied. Butman [7] [8], Wolfowitz [9] and Ozarow [10] [11] extended Schalkwijk’s scheme to ARMA(k) Gaussian channels, leading Chong Li is with Qualcomm Research, Bridgewater, NJ, 08807, USA ([email protected]). Yingbin Liang is with the Department of Electrical and Computer Engineering, The Ohio State University, Columbus, OH, 43220, USA (email: [email protected]). H. Vincent Poor is with the Department of Electrical Engineering, Princeton University, Princeton, NJ, 08544, USA (email: [email protected]). Shlomo Shamai (Shitz) is with the Department of Electrical Engineering, Technion-Israel Institute of Technology, Technion City, Haifa 32000, Israel (email: [email protected]) The work of Y. Liang has been supported by the U.S. National Science Foundation under the grant CCF-1618127. The work of H. V. Poor has been supported by the U.S. National Science Foundation under the grants CNS-1702808 and ECCS-1647198. The work of S. Shamai has been supported by the European Union’s Horizon 2020 Research And Innovation Programme, grant agreement no. 694630. This paper was presented (in part) in [1]. to several valuable upper and lower bounds on the capacity. Motivated by these elegant results/insights, in 1989 Cover and Pombra [12] made a breakthrough on characterizing the n-block capacity of the feedback Gaussian channel. In 2010, Kim [13] provided a characterization (in the form of an infinite dimensional optimization problem) of the capacity of the ARMA(k) feedback Gaussian channel based on Cover-Pombra’s n-block capacity characterization. Unfortunately, except for the first-order ARMA noise, it is non-trivial to compute the capacity by solving this infinite dimensional optimization. Recently, Gattami [14] showed that the capacity of the stationary Gaussian noise channel with finite memory can be found by solving a semi-definite programming problem. In addition, Li and Elia [15] [16] utilized the control-theoretic tools to compute the capacity of the ARMA(k) feedback Gaussian channel and construct the capacity-achieving feedback codes. As a natural extension of the above results, the ARMA(k) feedback Gaussian channel with an eavesdropper that has noisy access of channel transmissions is of much interest. Concretely, two fundamental questions can be asked: 1). would the feedback capacity of such a channel decrease subject to the secrecy constraint? 2). what would be the secrecy capacity-achieving codes? In fact, secure communications over feedback channels have attracted a lot of attention over the last decade. Substantial progresses have been made towards understanding this type of channels. In particular, although the feedback may not increase the capacity of open-loop AWGN channels, [17]– [26] showed that feedback can increase the secrecy capacity by sharing a secret key between legitimate users or roiling the codewords from eavesdroppers’ observations. For instance, [17] and [18] showed the achievement of a positive secrecy rate by using noiseless feedback even when the secrecy capacity of the feed-forward channel is zero. Furthermore, [27] presented an achievable scheme for the wiretap channel with generalized feedback, which is a generalization and unification of several relevant previous results in the literature. Very recently, [28] proposed an improved feedback coding scheme for the wiretap channel with noiseless feedback, which was shown to outperform the existing ones in the literature. On the other hand, the multiple-access (MA) wiretap channel with feedback has also been studied in recent a few years. [29] derived achievable secrecy rate regions for discrete memoryless Gaussian channels where two trusted users send independent confidential messages to an intended receiver in the presence of a passive eavesdropper. [30] developed inner and outer bounds on the secrecy rate region for the MA wiretap channel with noiseless feedback. In a more general setting where users have multiple-input multiple-output (MIMO) equipments, [31] characterized the pre-log factor of the secrecy rate in the case with the number of antennas at the source being no larger than that at the eavesdropper. [32] and [33] investigated the benefits of state-feedback to increase the secrecy degrees of freedom for the two-user Gaussian MIMO wiretap channel. However, it is noteworthy that most of the aforementioned results on both the point-to-point and the MA communications only considered memoryless wiretap channels. Thus motivated, in this paper we consider a memory wiretap channel (i.e. ARMA(k) Gaussian noise channel) with feedback and make two major contributions. 1) We propose a variant of the generalized S-K scheme, which achieves the feedback capacity of the ARMA(k) Gaussian noise channel without an eavesdropper and show that the proposed coding scheme also achieves the same maximum rate of such a channel with an eavesdropper. 2) We further study the AWGN channel with quantized feedback, which is a more realistic channel model for Fig. 1. ARMA(k) Gaussian wiretap channel with feedback. the feedback link. We show that the proposed coding scheme provides non-trivial positive secrecy rates and achieves the feedback capacity of the AWGN channel as the amplitude of the quantization noise vanishes to zero. The rest of the paper is organized as follows. In Section II and III, we introduce the system model and the preliminary results, respectively. Section IV presents the main results of our paper. Section V provides the technical proofs. Finally, in Section VI, we conclude the paper and outline possible research venues down the road. Notation: Uppercase and the corresponding lowercase letters (e.g.,Y, Z, y, z) denote random variables and their realizations, respectively. We use log to denote the logarithm with base 2, and 0 log 0 = 0. We use x0 to denote ∞ the transpose of a vector or matrix x. The symbol C[a,b] denotes the set of bounded continuous functions on [a, b]. RH 2 denotes the set of stable and proper rational filters in Hardy space H2 , and L2 denotes the 2-norm Lebesgue space. II. S YSTEM M ODEL In this section, we present the mathematical system model. First of all, we consider a discrete-time Gaussian channel with noiseless feedback (Fig. 1). The additive Gaussian channel is modeled as y(k) = u(k) + w(k), k = 1, 2, · · · , (1) jθ where the Gaussian noise {w(k)}∞ k=1 is assumed to be stationary with power spectrum density Sw (e ) for ∀θ ∈ [−π, π). Unless the contrary is explicitly stated, “stationary” without specification refers to stationary in wide sense. Moreover, we assume the power spectral density satisfies the Paley-Wiener condition 1 2π Z π −π | log Sw (e jθ )|dθ < ∞. Assumption 1. (ARMA(k) Gaussian Channel) In this paper, noise w is assumed as the output of a finite-dimensional linear time invariance (LTI) minimum-phase stable system H ∈ RH 2 , driven by the white Gaussian noise with zero mean and unit variance. The power spectral density (PSD) of w is colored (nonwhite)1 , bounded away from zero and has a canonical spectral factorization given by Sw (e jθ ) = |H(e jθ )|2 . 1 Both the (Shannon) capacity [2] and the secrecy capacity [23] for the AWGN channel with noiseless causal feedback have been known. As shown in Fig.1, the feedback wiretap channel of interest includes a forward channel from Alice to Bob as described by (1), a causal noiseless feedback ŷ from Bob to Alice, and three noisy observation channels to the eavesdropper Eve. Note that a classical wiretap channel model can be recovered if the eavesdropper’s channel input u and ŷ are removed. In this paper, we assume that the eavesdropper is powerful and can access three inputs 2 . The noisy wiretap channels are modeled as z(k) =u(k) + v(k), z̃(k) =y(k) + ṽ(k), k = 1, 2, · · · . ẑ(k) =ŷ(k) + v̂(k), The additive noises v, ṽ and v̂ are assumed to be arbitrarily finite-memory channels, i.e., k−1 p(v(k)|vk−1 1 ) = p(v(k)|vk−d ), k ≥ d, k−1 p(ṽ(k)|ṽk−1 1 ) = p(ṽ(k)|ṽk−d˜), ˜ k ≥ d, k−1 p(v̂(k)|v̂k−1 1 ) = p(v̂(k)|v̂k−dˆ), ˆ k ≥ d, (2) where d, d˜ and dˆ respectively represent the size of finite memories and the notation vba represents a sequence {va , va+1 , · · · , vb } in a compact form. In this paper, we assume these noises have strictly positive and bounded variance for all k. But they are not necessarily uncorrelated. We specify a sequence of (n, 2nRs ) channel codes with an achievable secrecy rate Rs as follows. We denote the message index by xu 0 , which is uniformly distributed over the set {1, 2, 3, · · · , 2nRs }. The encoding process ui (xu 0 , ŷi−1 ) at Alice satisfies the average transmit power constraint P, where ŷi−1 = {ŷ0 , ŷ1 , · · · , ŷi−1 } (ŷ0 = 0) / for i = 1, 2, · · · , n, and u1 (xu 0 , ŷ0 ) = u1 (xu 0 ). Bob decodes the message to be x̂u 0 by following a decoding function g : yn → (n) {1, 2, · · · , 2nRs } with an error probability satisfying Pe = 1 2nRs nRs ∑2xu 0 =1 p(xu 0 6= g(yn )|xu 0 ) ≤ εn , where limn→∞ εn = 0. Meanwhile, the information received by Eve should asymptotically vanish, i.e., limn→∞ n1 I(xu 0 ; zn1 , z̃n1 , ẑn1 ) = 0. The objective of secure communications is to send xu 0 to Bob at an as high rate Rs as possible. The secrecy capacity Csc is defined as the supremium of all achievable rates Rs . Mathematically, Csc = sup Rs feasible coding schemes (3) 1 n n n s.t. lim I(xu 0 ; z1 , z̃1 , ẑ1 ) = 0, n→∞ n where the “feasible coding schemes” refer to all feedback codes satisfying the secrecy requirements and the power constraint. Note that the feedback capacity (without the secrecy constraint) from Alice to Bob, denoted as C f b , can be recovered by removing the secrecy constraint. This implies Csc ≤ C f b . III. P RELIMINARIES OF FEEDBACK CAPACITY AND CAPACITY- ACHIEVING CODING SCHEME In this section, we review the characterization of the feedback capacity C f b and then propose a variant of the generalized S-K scheme, which is a C f b -achieving feedback codes without the presence of an eavesdropper. The materials here are useful for us to further investigate the channel model with an eavesdropper. 2 Note that in [1] only the access to channel input u and channel output y is considered. Based on the generalized results in this paper, however, the results in [1] with three noisy observation channels to the eavesdropper as assumed in this paper still hold. A. Feedback Capacity C f b Revisited Firstly, we present the feedback capacity characterization for the Gaussian channel under Assumption 1. As proved in [13], the feedback capacity from Alice to Bob for such a channel with the average power budget P can be characterized by 1 π C f b = max log |1 + Q(eiθ )|dθ , Q 2π −π Z 1 π |Q(e jθ )|2 Sw (e jθ )dθ ≤ P, s.t. 2π −π Z (4) Q ∈ RH 2 is strictly causal. Remark 1. Under Assumption 1, the optimal Q has no zeros on the unit circle (Proposition 5.1 (ii) in [13]). When specified to ARMA(1) channel, the above characterization can be simplified and has a closed-form solution. Lemma 1. (Theorem 5.3 in [13]) For the ARMA(1) feedback Gaussian channel with the average channel input power budget P > 0, the feedback capacity C f b is given by C f b = − log x0 , where x0 is the unique positive root of the fourth-order polynomial in x Px2 = (1 − x2 )(1 + σ αx)2 , (1 + σ β x) and σ = sign(β − α). Furthermore, an optimal Q to achieve C f b is given by Q(eiθ ) = −Pσ x0 1 + β αx0 eiθ (1 + β eiθ ) . 1 + ασ x0 (1 + αeiθ )(1 − σ x0 eiθ ) (5) Since the optimization in (4) has infinite dimensional search space, except for the ARMA(1) Gaussian channels, neither the analytical nor the numerical solutions to Q(e jθ ) was known in the literature. One recent result in [14] casted the above optimization into a semi-definite programming and then used the convex tools to compute C f b . In addition, [15] [16] provided a numerical approach to compute C f b and explicitly construct the optimal Q(e jθ ), which can be efficiently solved by the standard convex optimization tools. We refer the interested reader to [15] [16] for details. To make our paper self-contained, we re-state the main results in [15] [16] as follows. Proposition 1. (Lemma 4, [16]) Consider a non-white additive noise w under Assumption 1 in the forward channel and let Q(e jθ ) = a(θ ) + jb(θ ). The h-upper-bound on the feedback capacity C f b , denoted by C f b (h), can be characterized by 1 4π C f b (h) = max Γ s.t. 1 2π Z π log((1 + a(θ ))2 + b(θ )2 )dθ −π Z π  a2 (θ ) + b2 (θ ) Sw (θ )dθ ≤ P, −π Z π (6) Z π a(θ ) cos(nθ )dθ + −π b(θ ) sin(nθ )dθ = 0 (strict causality constraint) −π n = 0, 1, 2, · · · , h, where the maximum is taken over a functional set Γ defined as Γ ={a(θ ), b(θ ) : [−π, π] → R | a(θ ), b(θ ) ∈ L2 }. (7) Furthermore, we have C f b (h) ≥ C f b (h + 1),C f b (h) ≥ C f b for any h ≥ 0, and C f b = lim C f b (h). h→∞ Remark 2. With a bit abuse of notation, we use Sw (θ ) instead of Sw (eiθ ) for simplicity. The basic idea to obtain the characterization (6) is that the strict causality constraint (4) can be equivalently imposed on (the infinite number of) the non-positive index coefficients of the inverse Fourier transform of Q(eiθ ) by setting them to zeros. The upper bound follows as we herein only impose a finite number of the Fourier coefficients with non-positive index −h, −h + 1, · · · , −1, 0 to be zero. Notice that C f b (h) still turns out to be a semi-infinite dimensional problem, in which there are finite number of constraints but infinite number of feasible solutions in L2 . However, one important result, as shown below, establishes the strong Lagrangian dual of C f b (h). In other words, there is no duality gap between the semi-infinite dimensional primal problem and its finite dimensional dual problem, a fact that provides a convex optimization approach to compute C f b (h). Theorem 1. (Theorem 2 in [15]) Under Assumption 1, let A(θ ) = [cos(θ ), cos(2θ ), · · · , cos(hθ )]0 , B(θ ) = [sin(θ ), sin(2θ ), · · · , sin(hθ )]0 . For λ > 0, η ∈ Rh , and η0 ∈ R, define r2 (θ ) = (2λ Sw (θ ) + η 0 A(θ ) + η0 )2 + (η 0 B(θ ))2 . Then, the following statements hold. a) The Lagrangian dual of (6) is given by (D) : µh = − max λ >0,η∈Rh ,η0 ∈R g(λ , η, η0 ), (8) where g(λ , η, η0 ) = 1 2π Z π  1 −π 2 log(2λ Sw (θ ) − ν(θ )) −  r2 (θ ) 1 + λ Sw (θ ) dθ − λ P + η0 + , 2ν(θ ) 2 (9) with ν(θ ) = −r2 (θ ) + p r4 (θ ) + 8λ Sw (θ )r2 (θ ) . 2 (10) b) The dual problem (D) in (8) is equivalent to the following convex optimization problem µh = − max g̃(λ , η, η0 , ν(θ )), h λ > 0, η ∈ R , η0 ∈ R (11) ∞ ν(θ ) ≥ 0 ∈ C[−π,π] where 1 g̃(λ , η, η0 , ν(θ )) = 2π  r2 (θ ) 1 log(2λ Sw (θ ) − ν(θ )) − + λ Sw (θ ) dθ − λ P + η0 + , 2 2ν(θ ) 2 Z π  1 −π (12) and the optimal ν(θ ) is characterized by (10). c) Furthermore, C f b (h) = µh , and an optimal strictly casual filter Qh (e jθ ) = a(θ ) + jb(θ ) for C f b (h) exists and is characterized by 2λ Sw (θ ) + η 0 A(θ ) + η0 −1 ν(θ ) η 0 B(θ ) b(θ ) = a.e., ν(θ ) a(θ ) = a.e., (13) where (λ , η 0 , η0 , ν(θ )) are obtained by solving (8) (or (11)). Note that the above optimization is not easily computable due to the integral in the objective function. A natural approach is to approximate the integral with a finite sum by discretizing θ . We apply such discretization to (11) (with spacing π m) and introduce the following finite dimensional convex problem. Given m, consider µh (m) = − max λ >0,η,η0 ,νi ≥0 g̃m (λ , η, η0 , νi ) (14) where g̃m (λ , η, η0 , νi ) =   1 2m 1 r2 (θi ) 1 log(2λ S (θ ) − ν ) + λ S (θ ) − − λ P + η + , w i i w i 0 ∑ 2 2m i=1 2νi 2 π and θi = −π + m (i − 1). It is argued in [16] that µh (m) can be an arbitrarily well approximation of µh , i.e., limm→∞ µh (m) = µh . Notice that the optimization (14) is in a simple convex form. In particular, the log of an affine function is concave. The term r2 (θi ) νi is quadratic (composed with an affine function of the variables) over linear function, therefore convex. Thus, (14) can be efficiently solved with the standard convex optimization tools, e.g. CVX, a package for specifying and solving convex programs [34], [35]. In what follows, we describe, given an optimal Q in (4), how to construct an implementable coding scheme that achieves the feedback capacity from Alice to Bob. Fig. 2. Representation I: Decomposition of filter K into the feedback encoder (Alice) and decoder (Bob). The eavesdropper channels are not included. z-transform is used to represent the dynamics of LTI systems. B. C f b -achieving Feedback Coding Scheme First of all, once an optimal Q is found for the above optimization, we construct a feedback filter K = −Q(1 + Q)−1 stabilizing the channel within the prescribed input average power budget (see [15] for proofs). Next, based on the transfer function K, we construct an explicit feedback coding scheme as follows, which is deterministic (time-invariant) and has doubly exponential decaying decoding error probability. We first present controller K as a LTI single-input-single-output (SISO) finite-dimensional discrete-time unstable system with the following state-space model:    xs (k + 1) A  = s K: xu (k + 1) 0 h u(k) = Cs 0  xs (k)   Bs    +   y(k) xu (k) Bu   i xs (k) . Cu  xu (k) Au (15) Based on Remark 1, we assume that the eigenvalues of Au are strictly outside the unit disc while the eigenvalues of As are strictly inside the unit disc. Without loss of generality, we assume that As and Au are in Jordan form. Assume Au has m eigenvalues, denoted by λi (Au ), i = 1, 2, · · · , m. Next, we review the coding scheme in [16] [36] (Fig. 2), which decompose K into an encoder (Alice) and a decoder (Bob) with an estimated signal fed back to the encoder via the noiseless feedback channel. Representation I: Decoder-estimation-based Feedback Coding Scheme [16] [36] (Fig. 2). Decoder: The decoder runs K driven by the channel output y. xs (k + 1) = As xs (k) + Bs y(k), xs (0) = 0, x̂u (k + 1) = Au x̂u (k) + Bu y(k), x̂u (0) = 0. It produces two signals: an estimate of the initial condition of the encoder x̂u 0 (k) = A−k−1 x̂u (k + 1), u and a feedback signal   h i xs (k) . û(k) = Cs Cu  x̂u (k) Encoder: The encoder runs the following dynamics x̃u (k + 1) = Au x̃u (k), x̃u (0) = xu 0 , ũu (k) = Cu x̃u (k). It receives û and produces the channel input u(k) = ũu (k) − û(k). As will be seen later, the above coding scheme cannot be directly applied to the feedback ARMA(k) Gaussian channel with an eavesdropper. Therefore, we next propose an equivalent representation of the above decoderestimation-based feedback coding scheme. It will be proved that a variant of this new representation achieves the same maximum rate of the same channel without the eavesdropper. Representation II: Channel-output-based Feedback Coding Scheme (Fig. 3). Decoder: The decoder runs K driven by the channel output y. x̂u (k + 1) = Au x̂u (k) + Bu y(k), x̂u (0) = 0. It only produces an estimate of the initial condition of the encoder x̂u 0 (k) = A−k−1 x̂u (k + 1). u Encoder: The encoder runs the following dynamics driven by the initial state, i.e., the message, x̃u (k + 1) = Au x̃u (k), x̃u (0) = xu 0 , ũu (k) = Cu x̃u (k). It receives y and runs dynamics driven by the received feedback y, xs (k + 1) = As xs (k) + Bs y(k), xs (0) = 0 x̂u (k + 1) = Au x̂u (k) + Bu y(k), x̂u (0) = 0, and produces a signal   h i xs (k) . û(k) = Cs Cu  x̂u (k) Fig. 3. Representation II: Decomposition of filter K into the feedback encoder (Alice) and decoder (Bob). The eavesdropper channels are not included. Then, the encoder produces the channel input u(k) = ũu (k) − û(k). By comparing the two representations, we see that the only difference comes from the feedback signal. In Representation I, the feedback signal û is generated by the decoder, while in Representation II, the feedback signal is simply the raw channel output. The equivalence can be directly verified by comparing the channel inputs u (encoder) and the estimate of the message x̂u 0 (decoder) of the two representations. Proposition 2. For a given message xu 0 and a sequence of additive noise wk1 (k ≥ 1), the Representation I and Representation II of the proposed coding scheme produce identical channel input u(k) and message estimate x̂u 0 (k) for ∀k. Remark 3. It is important to notice that the “equivalence” only holds for such a channel without an eavesdropper. This is because in our model the eavesdropper can access the feedback link. In Representation II, since the channel output is directly fed back to Alice, the eavesdropper’s access to both the channel output and the feedback link has no difference from the access to the channel output only. However, this is clearly not true for Representation I, in which the eavesdropper can extract more useful information from the decoding process (Bob) by accessing the feedback link. We next provide some insight on the proposed coding scheme. All the discussions in the rest of this section hold for both representations. First of all, in the above proposed coding schemes, since the closed loop is stable, u(k) goes to zero with time if the noise is not present. Given that u(k) =ũu (k) − û(k) (16) =Cu (x̃u (k) − x̂u (k)) −Cs xs (k), and the system is observable, we have x̂u (k) → −x̃u (k). Thus, −x̂u 0 (k) is an estimate at time k of x̃u (0) = xu,0 . In the presence of noise, Theorem 4.3 in [36] shows that the above coding scheme leads to x̂u 0 (k − 1) v 0 −k 0 0 N (−xu,0 , A−k u E[x̂u (k)x̂u (k) ](Au ) ) for large k, where E[x̂u (k)x̂u (k) ] represents the state covariance matrix. Note that, since the stable closed-loop system is observable and controllable, the matrix E[x̂u (k)x̂u (k)0 ] is positive definite (which converges to a steady state value and is independent from the initial state of the system) and so is 0 −k 0 A−k u E[x̂u (k)x̂u (k) ](Au ) . Since the eigenvalues of Au are strictly outside the unit disc, it is straightforward to see that the state covariance matrix converges to zero (e.g. element-wise) as k goes to infinity. In addition, in the above coding scheme the message index xu0 ∈ Rm is allocated at the centroid of an unit hypercube in the coordinate system depending on Au ∈ Rm×m . We refer interested readers to Theorem 4.3 in [36] for details. For scalar Au ∈ C, the unit hypercube becomes an interval, e.g. [−0.5, 0.5]. That is, 2nRs messages are represented by the middle points of equally divided 2nRs subintervals within [−0.5, 0.5]. In the end, we note that the causality of the feedback channel is captured by the one-step delay of the state transition on xs and x̂u . The next lemma indicates that the proposed coding scheme K is C f b -achieving. The proof is omitted as it follows directly from Theorem 4.3 and Theorem 4.6 in [36]. Proposition 3. Consider stationary Gaussian channels in (4). Given a filter Q(eiθ ) ∈ RH 2 , the proposed coding scheme based on the decomposition of K = −Q(1 + Q)−1 achieves a reliable transmission rate (in the sense of Shannon) at 1 2π Z π −π m log |1 + Q(eiθ )|dθ = ∑ log |λi (Au )| bits/channel use, i=1 and has double exponential decaying error probability. This proposition indicates that the achievable rate of the proposed coding schemes (Representation I and Representation II) is explicitly characterized by the objective function in (4), leading to the fact that the proposed coding schemes are capacity-achieving if Q(eiθ ) is an optimal solution to (4). Moreover, this achievable rate is only determined by the unstable eigenvalues of the system, implying that the capacity-achieving coding scheme K must be unstable although the closed-loop system is stable. Thus far, we have presented explicit feedback codes (in the state-space representation) that can achieve the feedback capacity. In the next section, we show that a variant of this coding scheme K can lead to the asymptotic zero leakage of the message to Eve. This implies Csc = C f b . IV. M AIN R ESULTS In this section, we first present our results for the ARMA(k) feedback channel with an eavesdropper, and then extend our results to the case with quantization noise in feedback. A. ARMA(k) Feedback Channel with an Eavesdropper We first present our new development on the properties of the feedback coding scheme for ARMA(k) Gaussian channels without the presence of an eavesdropper. We then use these properties to establish our main theorem that characterizes the feedback secrecy capacity and its achieving coding scheme. The following result shows that, by choosing the particular m-step initializations (in the state-space representation) for the proposed coding scheme, the channel inputs (k ≥ m + 1) are only determined by the past additive Gaussian noise w, a fact that is vital to guarantee the asymptotic secrecy from Eve. Proposition 4. For the proposed coding scheme in Fig. 2 or Fig. 3, assume the first m-step channel inputs m+1 x m+1 refers to matrix A with power m + 1), the estimate message x̂ (m) = A−m−1 ym um u u 0 (where Au u0 u 1 = Au 1 (or equivalently, x̂u (m + 1) = ym 1 ) and xs (m + 1) = 0, where m is the number of the eigenvalues of matrix Au . Then the induced channel inputs u(k) for k ≥ m + 1 are only determined by the past Gaussian noise wk−1 1 . Proof. See Section V-A. Proposition 5. With the initializations defined in Proposition 4, the coding scheme K in Fig. 2 or Fig. 3 remains to be C f b -achieving. Proof. The proof follows directly from two facts. On the one hand, all these initials have no effect on the average transmission power on channel inputs, which only depend on the steady state of the underlying LTI systems. On the other hand, these initials do not change the reliable transmission rate of the coding scheme K, which is defined in an asymptotic manner and only determined by the unstable eigenvalues in Au (Proposition 3). This result provides a variant of the coding scheme K, in which the first m steps (k = 1, 2, · · · , m) of the channel input u are different from others (k ≥ m + 1) and the states x̂u and xs (m + 1) of the coding dynamics are particularly initialized at m + 1. By doing so, after the initialization phase (k ≤ m), Alice only transmits the statistical learning information of “noise” rather than the message for k ≥ m + 1 in the forward channel, such that if only having access to the forward channel (which is essentially the case for Representation II) Eve cannot learn innovative information of the message through its noisy wiretap channels except in the first m-steps. Theorem 2. Consider the ARMA(k) Gaussian wiretap channel with feedback (Fig. 1) under the average channel input power constraint P > 0. Then, 1) the feedback secrecy capacity equals the feedback (Shannon) capacity, i.e., Csc = C f b , where C f b is obtained from Section III-A; 2) the feedback secrecy capacity is achieved by the C f b -achieving feedback coding scheme K ( Representation m+1 x , x̂ (m) = A−m−1 ym (or equivalently, x̂ (m + 1) = ym ), and x (m + 1) = 0. II) with um u s u0 u0 u 1 = Au 1 1 Proof. See Section V-B. This theorem shows that there exists a feedback coding scheme such that the secrecy requirement can be achieved without loss of the communication rate of the legitimate users. In addition, Section III-B provides such a feedback coding scheme that achieves the feedback secrecy capacity. In particular, a Csc -achieving feedback code can be constructed from the optimal Q in (4) by following the procedures in Section III-B (Representation II) with the initializations defined in Proposition 4. The next corollary shows that the well-known S-K scheme [6] is a special case of our proposed coding scheme. Corollary 1. Consider the AWGN wiretap channel with feedback (Fig. 1) under the average channel input power constraint P > 0. Assume that the additive mean and variance σw2 > 0. Then the proposed coding r noise w has zero √ 2 p A −1 P+σw2 scheme K (Representation II) with Au = , Bu = − Auu , Cu = − A2u − 1, and As = Bs = Cs = 0 becomes σ2 w the original S-K scheme, and achieves the secrecy capacity Cs f = C f b = 12 log(1 + σP2 ). w Proof. See Section V-C. This corollary recovers Theorem 5.1 in [23], showing that the well-known S-K scheme not only achieves the feedback capacity but also automatically provides the secrecy from the eavesdropper. Remark 4. As discussed in Remark 3, if the eavesdropper has no access to the feedback link, then the above results hold for the coding scheme in Representation I as well. That is, the feedback secrecy capacity Csc is achieved by the C f b -achieving feedback coding scheme K (Representation I) with the selected initializations. The proof of this argument follows directly from the proof of Theorem 2 by deleting the eavesdropper’s access to the feedback link. Therefore, we conclude that the channel-output-based feedback coding scheme Representation II is highly necessary to remove the advantage of the eavesdropper’s access to the feedback link. If no such access, the “equivalence” between Representation I and Representation II holds for channels with the eavesdropper. B. Feedback with Quantization Noise In this section, we extend our result to Gaussian channels with quantized feedback. It is noteworthy that the capacity of colored Gaussian channels with noisy feedback remains an open problem [37] [38] [39], even when simplified to the quantization feedback. Therefore, in this paper, as an initial step towards the secrecy capacity of noisy feedback Gaussian channels, we focus on AWGN channels with quantized feedback. In [40], the authors presented a linear coding scheme featuring a positive information rate and a positive error exponent for AWGN channels with feedback corrupted by quantization or bounded noise. In what follows, we show that our proposed linear coding scheme Representation II, when specified to the AWGN channel with quantized feedback, converges to the scheme in [40] and, more importantly, leads to a positive secrecy rate. Furthermore, this achievable secrecy rate converges to the capacity of the AWGN channel as the amplitude of the quantization noise decreases to zero. Firstly, we define a memoryless uniform quantizer with sensitivity σq as follows [40]. Definition 1. Given a real parameter σq > 0, a uniform quantizer with sensitivity σq is a function Φσq : R → R defined as Φσq (y) = 2σq b y + σq c, 2σq Fig. 4. Coding Structure for the AWGN channel with quantized feedback. The quantization noise q can be recovered by the decoder to help decoding. where b·c represents the floor function. Then, the quantization error at instant k, i.e., the feedback noise, is given by q(k) = Φσq (y(k)) − y(k). Notice that, for a given channel output y(k), the quantization noise q(k) can be recovered by the decoder as we assume the decoder knows the quantization rule. In other words, the decoder can get access to both the channel outputs and the feedback noise while the encoder can only get access to the corrupted channel output. On the other hand, note that with the quantized feedback the coding schemes Representation I and Representation II are not equivalent any more due to the different feedback signals. The Representation I may not be applicable here. Therefore, we tailor the coding scheme Representation II to the AWGN channel with quantized feedback as follows (Fig. 4). We first let As = Bs = Cs = 0. Decoder: The decoder runs K driven by the sum of the channel output y and the quantization noise q. x̂u (k + 1) = Au x̂u (k) + Bu (y(k) + q(k)), x̂u (0) = 0. It produces an estimate of the initial condition of the encoder x̂u (k + 1). x̂u 0 (k) = A−k−1 u Encoder: The encoder runs the following dynamics x̃u (k + 1) = Au x̃u (k), x̃u (0) = xu 0 , ũu (k) = Cu x̃u (k). It receives y + v and duplicates the decoding dynamics, x̂u (k + 1) = Au x̂u (k) + Bu (y(k) + q(k)), x̂u (0) = 0, and produces a signal, û(k) = Cu x̂u (k). Then, it produces the channel input u(k) = ũu (k) − û(k). We next show that the above coding scheme can achieve a positive secrecy rate, which converges to the AWGN capacity as the feedback noise σq decreases. The following definition will be used to characterize this secrecy rate. Definition 2. [40] For the given positive real parameters σw2 , σq and the power constraint P, define a parameter rq as follows. 1) If 4σq ≤ P, rq is the nonnegative real solution of the following equation, p √ σw 22rq − 1 = P − σq (1 + 2rq ). 2) If 4σq > P, then rq = 0. It is easy to check that rq satisfies the following three properties [40] 1) rq converges to the AWGN capacity as σq decreases, i.e., lim rq = σq →0+ 2) If σq = √ P 2 , we have rq = 0. P 1 log(1 + 2 ). 2 σw √ √ P P 3) If P  max{σw2 , σq2 }, rq ' log( σw +σ ). In other words, the ratio of rq and log( σw +σ ) converges to 1 as q q P → ∞. Theorem 3. Consider an AWGN channel with uniformly memoryless quantized feedback defined in Definition 1, where the channel input power constraint is P > 0 and the noise variance of the AWGN channel and the quantization sensitivity in the feedback link are assumed to be σw2 and σq , respectively. Assume u(1) = A2u xu 0 , and x̂u 0 (1) = A−2 u (y(1) + q(1)) (or equivalently, x̂u (2) = y(1) + q(1)). Then, the above proposed coding scheme with 1 Au = 2r , Bu = −1,Cu = Au − Au and As = Bs = Cs = 0 achieves a secrecy rate r for all r < rq (rq is defined in Definition 2). Proof. See Section V-D. Combined with the aforementioned property (1) on rq , this theorem implies that the achievable feedback secrecy rate of the proposed coding scheme converges to the AWGN capacity as σq decreases to zero. V. T ECHNICAL P ROOFS In this section, we present the omitted proofs in Sections IV. A. Proof of Proposition 4 Based on the Representation I of the proposed feedback coding scheme, we have u(k) =ũu (k) − û(k) =Cu (x̃u (k) − x̂u (k)) −Cs xs (k) =Cu (Au x̃u (k − 1) − Aku x̂u 0 (k − 1)) −Cs xs (k) (17) =··· =Cu (Aku xu 0 − Aku x̂u 0 (k − 1)) −Cs xs (k) =Cu Aku (xu 0 − x̂u 0 (k − 1)) −Cs xs (k). Next, for k ≥ m + 1 where the initial steps have passed and the signals evolve as described in the coding scheme, it yields x̂u 0 (k) =A−k−1 x̂u (k + 1) u =A−k−1 (Au x̂u (k) + Bu y(k)) u −k−1 =A−k Bu y(k) u x̂u (k) + Au =x̂u 0 (k − 1) + A−k−1 Bu y(k) u =x̂u 0 (k − 1) + A−k−1 Bu (u(k) + w(k)) u (18) (a) = x̂u 0 (k − 1) + A−k−1 Bu (Cu Aku xu 0 −Cu Aku x̂u 0 (k − 1) −Cs xs (k) + w(k)) u =x̂u 0 (k − 1) − A−k−1 BuCu Aku x̂u 0 (k − 1) + A−k−1 BuCu Aku xu 0 + A−k−1 Bu (w(k) −Cs xs (k)) + xu 0 − xu 0 u u u =(I − A−k−1 BuCu Aku )x̂u 0 (k − 1) − (I − A−k−1 BuCu Aku )xu 0 + A−k−1 Bu (w(k) −Cs xs (k)) + xu 0 u u u =(I − A−k−1 BuCu Aku )(x̂u 0 (k − 1) − xu 0 ) + A−k−1 Bu (w(k) −Cs xs (k)) + xu 0 , u u where step (a) follows from (17). Let αk = I − A−k−1 BuCu Aku and βk = A−k−1 Bu . Moving xu 0 to the left side, we u u have x̂u 0 (k) − xu 0 = αk (x̂u 0 (k − 1) − xu 0 ) + βk (w(k) −Cs xs (k)). By iterating the above equation, for k ≥ m + 1, we obtain k k x̂u 0 (k) − xu 0 = αi (x̂u 0 (m) − xu 0 ) + ∏ k ∑ ∏ α j βi (w(i) −Cs xs (i)). i=m+1 j=i+1 i=m+1 m+1 x −m−1 ym , we have where we assume αk+1 = 1. Given um u 0 and x̂u 0 (m) = Au 1 = Au 1 m −m−1 m x̂u 0 (m) = A−m−1 (um w1 . u 1 + w1 ) = xu 0 + Au Then, it yields k x̂u 0 (k) − xu 0 = ∏ i=m+1 αi A−m−1 wm u 1 + k k ∑ ∏ i=m+1 j=i+1 α j βi (w(i) −Cs xs (i)). Furthermore, given xs (m + 1) = 0, from (17) we have u(m + 1) = −Cu Am+1 (x̂u 0 (m) − xu 0 ) −Cs xs (m + 1) u = −Cu Am+1 (x̂u 0 (m) − xu 0 ) u (19) = −Cu wm 1. Now, for k ≥ m + 2, we present the channel inputs u(k) and recall the evolution of xs (k) as follows, u(k) = −Cu Aku (x̂u 0 (k − 1) − xu 0 ) −Cs xs (k)  k−1 k−1 = −Cu Aku ∏ αi A−m−1 wm u 1 + ∑ i=m+1 k−1 ∏  α j βi (w(i) −Cs xs (i)) −Cs xs (k), i=m+1 j=i+1 (20) and xs (k) =As xs (k − 1) + Bs (u(k − 1) + w(k − 1)). Starting with u(m + 1) = −Cu wm 1 and xs (m + 1) = 0, the above coupled iterations induce values of u(k) and xs (k) that depend only on noise wk−1 1 . Therefore, for k ≥ m + 2 u(k) , φk (wk−1 1 ), (21) where the mapping φk : Rk−1 → R is defined by the iterations in (20). Combining with (19), we conclude that, for k ≥ m + 1, u(k) only depends on wk−1 1 . Due to the equivalence between Representation I and Representation II of the coding scheme, this result directly holds for Representation II. B. Proof of Theorem 2 Following from Proposition 3, the proposed coding scheme derived from the optimal filter Q can achieve the feedback capacity C f b . Then, in what follows, we only need to show that under the selected initializations of the proposed coding scheme, the following secrecy requirement is satisfied, 1 I(xu 0 ; zn1 , z̃n1 , ẑn1 ) = 0. n→∞ n lim In this proof, we use the Representation II of the proposed coding scheme. Following from the model in Fig. 1 and (19), (21) in the proof of Proposition 4, the three inputs z(k), z̃(k) and ẑ(k) to Eve for k ≥ 1 are given by m m m+1 zm xu 0 + vm 1 = u1 + v1 = Au 1, z(m + 1) = u(m + 1) + v(m + 1) = −Cu wm 1 + v(m + 1), z(k) = φk (wk−1 1 ) + v(k), (22) k ≥ m + 2, and m m n m+1 n z̃m xu 0 + ṽm 1 = u1 + ṽ1 + w1 = Au 1 + w1 , z̃(m + 1) = u(m + 1) + ṽ(m + 1) + w(m + 1) = −Cu wm + ṽ(m + 1) + w(m + 1), z̃(k) = φk (wk−1 1 ) + ṽ(k) + w(k), k ≥ m + 2, (23) and m m n m+1 n ẑm xu 0 + v̂m 1 = u1 + v̂1 + w1 = Au 1 + w1 , ẑ(m + 1) = u(m + 1) + v̂(m + 1) + w(m + 1) = −Cu wm + v̂(m + 1) + w(m + 1), ẑ(k) = φk (wk−1 1 ) + v̂(k) + w(k), (24) k ≥ m + 2, m+1 x where um u 0 is the selected initializations. Recall that noises v(k), ṽ(k) and v̂(k) are additive noises defined 1 = Au in (2). ˜ d} ˆ + 1 and k ≥ m + 1 we have Then, for n ≥ k + max{d, d, (a) h(xu 0 |zn1 , z̃n1 , ẑn1 ) ≥h(xu 0 |zn1 , z̃n1 , ẑn1 , wn1 , vnm+1 , ṽnm+1 , v̂nm+1 ) (b) m m n n n n =h(xu 0 |zm 1 , z̃1 , ẑ1 , w1 , vm+1 , ṽm+1 , v̂m+1 ) (c) m+1 m m+1 m n n n n xu 0 + ṽm xu 0 + v̂m =h(xu 0 |Am+1 xu 0 + vm u 1 , Au 1 + w1 , Au 1 + w1 , w1 , vm+1 , ṽm+1 , v̂m+1 ) (25) m+1 m+1 n n n n xu 0 + ṽm xu 0 + v̂m =h(xu 0 |Am+1 xu 0 + vm u 1 , Au 1 , Au 1 , w1 , vm+1 , ṽm+1 , v̂m+1 ) (d) ˜ ˜ m+1 m+1 n m+d m+d m+d = h(xu 0 |Am+1 xu 0 + vm xu 0 + ṽm xu 0 + v̂m u 1 , Au 1 , Au 1 , w1 , vm+1 , ṽm+1 , v̂m+1 ) ˜ ˜ m+1 m+1 m+d m+d m+d =h(xu 0 |Am+1 xu 0 + vm xu 0 + ṽm xu 0 + v̂m u 1 , vm+1 , ṽm+1 , v̂m+1 ), 1 , Au 1 , Au where (a) follows from the fact that conditioning does not increase entropy, step (b) follows from Proposition 4, step (c) follows from (22), (23) and (24), step (d) follows from the finite memory of wiretap channel noise (v, ṽ ,v̂) and the last step follows from the fact that the noise w is assumed to be independent from others. Then, we obtain I(xu 0 ; zn1 , z̃n1 , ẑn1 ) =h(xu 0 ) − h(xu 0 |zn1 , z̃n1 , ẑn1 ) ˜ ˜ m+1 m+1 m+d m+d m+d xu 0 + ṽm xu 0 + v̂m ≤h(xu 0 ) − h(xu 0 |Am+1 xu 0 + vm u 1 , Au 1 , Au 1 , vm+1 , ṽm+1 , v̂m+1 ) ˜ (26) ˜ m+1 m+1 m+d m+d m+d xu 0 + ṽm xu 0 + v̂m =I(xu 0 ; Am+1 xu 0 + vm u 1 , Au 1 , Au 1 , vm+1 , ṽm+1 , v̂m+1 ) =I(xu 0 ; Axu 0 + B), ˜ ˆ ˆ × m zero matrix) and B = [vm , ṽm , v̂m , vm+d , ṽm+d , v̂m+d ]. where A = [Am+1 , Am+1 , Am+1 ,00]T (00 is an (d + d˜ + d) u u u 1 1 1 m+1 m+1 m+1 Recall that message xu 0 is uniformly selected from {1, 2, · · · , 2nRs } that are equally spaced in an m-dimensional unit hypercube. The covariance matrix of xu 0 is 1 12 Im as n → ∞. Following from the fact that for a fixed covariance a vector Gaussian input distribution maximizes the mutual information, we obtain the following upper bound, 1 1 lim I(xu 0 ; zn1 , z̃n1 , ẑn1 )) ≤ lim I(xu 0 ; Axu 0 + B) n→∞ n n→∞ n   1 = lim h(Axu 0 + B) − h(Axu 0 + B|xu 0 ) n→∞ n   1 (27) = lim h(Axu 0 + B) − h(B) n→∞ n   1 1 T T ≤ lim log det E[BB ] + AA − h(B) n→∞ 2n 12 = 0. The last step follows from the fact that the right-hand side upper bound is independent from index n. The proof is complete. C. Proof of Corollary 1 Based on the Schalkwijk’s scheme in [6], the channel input (encoder) and the message estimate (decoder) for k = 1 are given below by using the notations in this paper. u(1) =Au xu 0 , (28) −1 x̂u 0 (1) =A−1 u y(k) = xu 0 ) + Au w(1). The dynamics of the Schalkwijk’s coding scheme for k ≥ 2 can be summarized as follows, q u(k) = A2u − 1Ak−1 u (x̂u 0 (k − 1) − xu 0 ), q x̂u 0 (k) =x̂u 0 (k − 1) − A−k−1 A2u − 1y(k), u r P+σw2 where Au = and σw is the variance of the additive white Gaussian noise in the forward channel. σ2 (29) w In our coding scheme, for k = 1, u(1) =A2u xu 0 , (30) −2 x̂u 0 (1) =A−2 u y(1) = xu 0 + Au w(1), Plugging these selected parameters into (17) and (18), we have channel inputs and the message estimate of our proposed coding scheme as follows, q u(k) = A2u − 1Aku (x̂u 0 (k − 1) − xu 0 ), q x̂u 0 (k) =x̂u 0 (k − 1) − A−k−2 A2u − 1y(k). u (31) By scaling the message xu 0 and the corresponding estimate x̂u 0 by factor Au , we recover the dynamics of the Schalkwijk’s scheme. Note that this constant scaling on the message index xu 0 have no effect on the reliable transmission rate and the power cost at channel input. The proof is complete. D. Proof of Theorem 3 Starting from the decoder with Au = 2r and Bu = −1, we have the decoding dynamics (k ≥ 2) x̂u (k) = Au x̂u (k − 1) + Bu (y(k − 1) + q(k − 1)) = Au (Au x̂u (k − 2) + Bu (y(k − 2) + q(k − 2))) + Bu (y(k − 1) + q(k − 1)) = A2u x̂u (k − 2) + Au Bu (y(k − 2) + q(k − 2)) + Bu (y(k − 1) + q(k − 1)) = ··· k−1 = Aku x̂u (0) + Bu ∑ Ak−1−i (y(i) + q(i)) u i=0 k−1 = Bu ∑ Ak−1−i (y(i) + q(i)) u i=0 k−1 = − ∑ 2r(k−1−i) (y(i) + q(i)). i=0 (32) Then, the estimate of the initial state of the encoder (i.e., the message index) is k−1 −r(i+1) x̂u 0 (k − 1) = A−k (y(i) + q(i)). u x̂u (k) = − ∑ 2 (33) i=0 Next, based on (17) with Cs = 0 and Cu = Au − A1u , we have the dynamics of channel inputs as u(k) =Cu Aku (xu 0 − x̂u 0 (k − 1)) =Cu Aku (xu 0 − A−k u x̂u (k)) =Cu Aku (xu 0 − A−k u (Au x̂u (k − 1) + Bu (y(k − 1) + q(k − 1)))) (34) =Cu Aku (xu 0 − A−k+1 x̂u (k − 1)) +Cu Bu (y(k − 1) + q(k − 1)) u (a) =Au u(k − 1) +Cu Bu (y(k − 1) + q(k − 1)) =2r u(k − 1) + (2−r − 2r )(y(k − 1) + q(k − 1)), where step (a) follows from the above first two steps. Notice that our coding schemes of the decoder (33) and the encoder (34) are identical to the coding schemes (2) and (4) in [40]. In addition, Theorem 3.2 in [40] shows that, for a given rv (Definition 2), the proposed scheme can achieve any transmission rate r with r < rv . Now, we need to prove that the proposed coding scheme achieves secrecy with regard to the eavesdropper. In fact, we can directly follow the proof of Proposition 4 and characterize the channel inputs as u(1) =A2u xu 0 , u(2) = −Cu (w(1) + q(1)),   k−1 −i−1 −1 k−1−i k−2 w(1) u(k) = −Cu Aku (1 − A−1 B C ) + A (1 − A B C ) B (w(i) + q(i)) , u u u u u ∑ u u u A2u i=2 (35) k ≥ 3. As a consequence, we note that the channel inputs of the proposed coding scheme only depend on the past forward channel noise w and feedback quantization noise q. This fact enables us to show that, by following the proof of Theorem 2, this coding scheme satisfies the secrecy requirement lim n→∞ 1 I(xu 0 ; zn1 , z̃n1 , ẑn1 ) = 0. n To avoid redundancy, we herein only provide sketchy arguments. Details can be directly obtained by following (25) to (27). h(xu 0 |zn1 , z̃n1 , ẑn1 ) ≥h(xu 0 |zn1 , z̃n1 , ẑn1 , wn1 , qn1 , vn2 , ṽn2 , v̂n2 ) =h(xu 0 |z1 , z̃1 , ẑ1 , wn1 , qn1 , vn2 , ṽn2 , v̂n2 ) =h(xu 0 |A2u xu 0 + v1 , A2u xu 0 + ṽ1 + w1 , A2u xu 0 + v̂1 + w1 , wn1 , qn1 , vn2 , ṽn2 , v̂n2 ) =h(xu 0 |A2u xu 0 + v1 , A2u xu 0 + ṽ1 , A2u xu 0 + v̂1 , wn1 , qn1 , vn2 , ṽn2 , v̂n2 ) ˜ ˆ 1+d 1+d =h(xu 0 |A2u xu 0 + v1 , A2u xu 0 + ṽ1 , A2u xu 0 + v̂1 , wn1 , qn1 , v1+d 2 , ṽ2 , v̂2 ) ˜ ˆ d =h(xu 0 |A2u xu 0 + v1 , A2u xu 0 + ṽ1 , A2u xu 0 + v̂1 , v21+d , ṽ21+d , v̂1+ 2 ). (36) Then, we obtain I(xu 0 ; zn1 , z̃n1 , ẑn1 ) ˜ ˆ 1+d 1+d ≤I(xu 0 ; A2u xu 0 + v1 , A2u xu 0 + ṽ1 , A2u xu 0 + v̂1 , v1+d 2 , ṽ2 , v̂2 ) (37) =I(xu 0 ; Axu 0 + B), ˆ × 1 zero matrix) and B = [v1 , ṽ1 , v̂1 , v1+d , ṽ1+d˜, v̂1+dˆ]. The rest of the where A = [A2u , A2u , A2u ,00]T (00 is an (d + d˜ + d) 2 2 2 proof is omitted as it directly follows from (27). VI. C ONCLUSION In this paper, we considered the ARMA(k) Gaussian wiretap channel with feedback and showed that a variant of the generalized S-K scheme, which is a feedback capacity-achieving code, secures transmissions by itself from the eavesdropper. Namely, the feedback secrecy capacity equals the feedback capacity without the presence of an eavesdropper. We further extended our scheme to the AWGN channel with quantized feedback and proved that our scheme can achieve a positive secrecy rate, which converges to the AWGN channel capacity as the quantization noise decreases to zero. We conclude this paper by listing a few related research topics, which can facilitate to illustrate the complete picture of the secrecy communications with feedback. First of all, it is known that the S-K coding scheme nicely unifies communications, control and estimation for feedback systems. In this paper, by leveraging the tools from both control and communications, we showd that (a variant of) the S-K scheme automatically provides secrecy for the legitimate users. Therefore, understanding the secrecy nature of the S-K scheme from an estimation perspective could be a missing piece of the work. One possible investigation along this line is to extend the fundamental relation between the derivative of the mutual information and the MMSE [41], known as I-MMSE, from the open-loop channels to the feedback channels by invoking the direct information [42], [43] rather than the mutual information [44]. Furthermore, extend the current results to channels with noisy feedback can be very valuable. Toward this end, it is necessary to construct a feedback coding scheme with a good achievable rate for noisy feedback channels with no eavesdropper, which itself is a quite nontrivial problem in general. Finally, extensions to the multi-access colored Gaussian channels with feedback can be of much interest to the community in the field of secrecy communications. R EFERENCES [1] C. Li and Y. Liang, “Secrecy capacity of the first-order autoregressive moving average gaussian channel with feedback,” in Proc. IEEE International Symposium on Information Theory, pp. 1963–1967, 2017. [2] C. Shannon, “The zero error capacity of a noisy channel,” Inst.Radio Eng. Trans.Information Theory, vol. IT-2, pp. S8–S19, 1956. [3] P. Elias, “Channel capacity without coding,” MIT Research Lab. of Electronics, Cambridge, MA, Quarterly Progr. Rep., 1956. [4] ——, “Networks of Gaussian channels with applications to feedback systems,” IEEE Trans. Inf. Theory, vol. 13, pp. 493 – 501, 1967. [5] J. P. M. Schalkwijk and T. Kailath, “A coding scheme for additive noise channels with feedback i: No bandwidth constraint,” IEEE Trans. Inf. Theory, vol. IT-12, no. 2, pp. 172–182, 1966. [6] J. P. M. Schalkwijk, “A coding scheme for additive noise channels with feedback ii: Band-limited signals,” IEEE Trans. Inf. Theory, vol. IT-12, no. 2, pp. 183–189, 1966. [7] S. Butman, “A general formulation of linear feedback communication systems with solutions,” IEEE Trans. Inf. Theory, vol. 15, no. 3, pp. 392 – 400, 1969. [8] ——, “Linear feedback rate bounds for regressive channels,” IEEE Trans. Inf. Theory, vol. 22, no. 3, pp. 363 – 366, 1976. [9] J. Wolfowitz, “Signalling over a Gaussian channel with feedback and autoregressive noise,” J. Appl. Probability, vol. 12, no. 4, pp. 713 – 723, 1975. [10] L. H. Ozarow, “Random coding for additive gaussian channels with feedback,” IEEE Trans. Inf. Theory, vol. 36, no. 1, pp. 17 – 22, 1990. [11] ——, “Upper bounds on the capacity of gaussian channels with feedback,” IEEE Trans. Inf. Theory, vol. 36, no. 1, pp. 151 – 161, 1990. [12] T. M. Cover and S. Pombra, “Gaussian feedback capacity,” IEEE Trans. Inf. Theory, vol. 35, no. 1, pp. 37–43, 1989. [13] Y. H. Kim, “Feedback capacity of stationary gaussian channels,” IEEE Trans. Inf. Theory, vol. 56, no. 1, pp. 57–85, 2010. [14] A. Gattami, “Feedback capacity of gaussian channels revisited,” https://arxiv.org/abs/1511.06866, 2015. [15] C. Li and N. Elia, “Control approach to computing the feedback capacity for stationary finite dimensional gaussian channels,” in Proc. 53th Annual Allerton Conference on Communication, Control, and Computing, pp. 1038–1045, 2015. [16] ——, “Youla coding and computation of gaussian feedback capacity,” IEEE Trans. Inf. Theory, to appear, 2018. [17] U. M. Maurer, “Secret key agreement by public discussion from common information,” IEEE Trans. Inf. Theory,, vol. 39, no. 3, pp. 733–742, 1993. [18] R. Ahlswede and I. Csiszár, “Common randomness in information theory and cryptography, part i: Secret sharing,” IEEE Trans. Inf. Theory,, vol. 39, no. 4, pp. 1121–1132, 1993. [19] R. Ahlswede and N. Cai, “Transmission, identification and common randomness capacities for wire-tape channels with secure feedback from the decoder,” in General Theory of Information Transfer and Combinatorics. Springer Berlin, vol. 4123, pp. 258 – 275, 2006. [20] L. Lai, H. E. Gamal, and H. V. Poor, “Secrecy capacity of the wiretap channel with noisy feedback,” Proceedings of the 45th Annual Allerton Conference on Communication, Control and Computing, Monticello, IL,, 2007. [21] ——, “The wiretap channel with feedback: encryption over the channel,” IEEE Trans. Inf. Theory, vol. 54, no. 11, pp. 5059–5067, 2008. [22] E. Ekrem and S. Ulukus, “Wiretap channel with secure rate-limited feedback,” in Proc. 42nd Annual Conference on Information Sciences and Systems, pp. 791 – 796, 2008. [23] D. Gündüz, D. R. Brown, and H. V. Poor, “Secret communication with feedback,” in Proc. International Symposium on Information Theory and Its Applications, pp. 1 – 6, 2008. [24] E. Ardestanizadeh, M. Franceschetti, T. Javidi, and Y.-H. Kim, “Wiretap channel with secure rate-limited feedback,” IEEE Trans. Inf. Theory, vol. 55, no. 12, pp. 5353 – 5361, 2009. [25] B. Dai, Z. Ma, and L. Yu, “Feeding back the output or sharing state, which is better for the state-dependent degraded wiretap channel with noncausal csi at the transmitter?” Entropy, vol. 17, no. 12, pp. 7900–7925, 2015. [26] B. Dai, A. J. H. Vinck, Y. Luo, and Z. Ma, “Capacity-equivocation region of a special case of wiretap channel with noiseless feedback,” Journal of Communications and Networks, vol. 17, no. 1, 2015. [27] G. Bassi, P. Piantanida, and S. Shamai, “On the capacity of the wiretap channel with generalized feedback,” in Proc. IEEE International Symposium on Information Theory, pp. 1154 – 1158, 2015. [28] B. Dai, “An improved feedback coding scheme for the wire-tap channel,” ArXiv, https://arxiv.org/pdf/1712.04981.pdf, 2017. [29] X. Tang, R. Liu, P. Spasojevic, and H. V. Poor, “Multiple access channels with generalized feedback and confidential messages,” Proceedings of the 2007 IEEE Information Theory Workshop on Frontiers in Coding Theory, Lake Tahoe, CA,, 2007. [30] B. Dai and Z. Ma, “Multiple access wiretap channel with noiseless feedback,” ArXiv, https://arxiv.org/pdf/1701.04052.pdf, 2017. [31] T. Kim and H. V. Poor, “The gaussian wiretap channel with noisy public feedback: Breaking the high-snr ceiling,” Proceedings of the 43rd Asilomar Conference on Signals, Systems and Computers, Pacific Grove, CA, 2009. [32] S. Yang, M. Kobayashi, P. Piantanida, and S. Shamai, “Secrecy degrees of freedom of mimo broadcast channels with delayed csit,” IEEE Trans. Inf. Theory, vol. 59, no. 9, pp. 5244 – 5256, 2013. [33] R. Tandon, P. Piantanida, and S. Shamai, “On multi-user miso wiretap channels with delayed csit,” in Proc. IEEE International Symposium on Information Theory, pp. 211 – 215, 2014. [34] M. Grant and S. Boyd, “Cvx: Matlab software for disciplined convex programming, version 2.0 beta,” 2013. [35] ——, “Graph implementations for nonsmooth convex programs, recent advances in learning and control,” Lecture Notes in Control and Information Sciences, Springer, pp. 95–110, 2008. [36] N. Elia, “When bode meets shannon: control-oriented feedback communication schemes,” IEEE Transactions on Automatic Control, vol. 49, no. 9, pp. 1477–1488, 2004. [37] C. Li and N. Elia, “The information theoretic characterization of the capacity of channels with noisy feedback,” IEEE International Symposium on Information Theory, pp. 174–178, 2011. [38] ——, “Upper bound on the capacity of gaussian channels with noisy feedback,” 49th Annual Allerton Conference, pp. 84–89, 2011. [39] C. Li, “Fundamental limitations on communication channels with noisy feedback: information flow, capacity and bounds,” Iowa State University Ph.D. dissertation, 2013. [40] N. C. Martins and T. Weissman, “Coding for additive white noise channels with feedback corrupted by quantization or bounded noise,” IEEE Trans. Inf. Theory, vol. 54, no. 9, pp. 4274–4282, 2008. [41] D. Guo, S. Shamai, and S. Verdu, “The interplay between information and estimation measures,” Foundations and Trends in Signal Processing, vol. 6, no. 4, pp. 243–429, 2012. [42] J. L. Massey, “Causality, feedback and directed information,” In Proc. Int. Symp. Inf. Theory Applic., pp. 303–305, 1990. [43] G. Kramer, “Directed information for channels with feedback,” Ph.D. dissertation, Swiss Federal Institute of Technology (ETH), Zurich, Switzeland, 1998. [44] H. Asnani, K. Venkat, and T. Weissman, “Relations between information and estimation in the presence of feedback,” In: Como G., Bernhardsson B., Rantzer A. (eds) Information and Control in Networks. Lecture Notes in Control and Information Sciences, vol 450. Springer, 2014.
7cs.IT
F -JUMPING AND F -JACOBIAN IDEALS FOR HYPERSURFACES arXiv:1302.3327v2 [math.AC] 30 Apr 2013 LUIS NÚÑEZ-BETANCOURT AND FELIPE PÉREZ Abstract. We introduce two families of ideals, F -jumping ideals and F -Jacobian ideals, in order to study the singularities of hypersurfaces in positive characteristic. Both families are defined using the D-modules Mα that were introduced by Blickle, Mustaţă and Smith. Using strong connections between F -jumping ideals and generalized test ideals, we give a characterization of F -jumping numbers for hypersurfaces. Furthermore, we give an algorithm that determines whether certain numbers are F -jumping numbers. In addition, we use F -Jacobian ideals to study intrinsic properties of the singularities of hypersurfaces. In particular, we give conditions for F -regularity. Moreover, F -Jacobian ideals behave similarly to Jacobian ideals of polynomials. Using techniques developed to study these two new families of ideals, we provide relations among test ideals, generalized test ideals, and generalized Lyubeznik numbers for hypersurfaces. Contents 1. Introduction 1.1. F-jumping ideals. 1.2. F-Jacobian ideals. 1.3. Further consequences and relations 2. Preliminaries 2.1. Tight closure 2.2. Generalized test ideals 2.3. D-modules 2.4. F e -modules 3. F -jumping ideals and F -jumping numbers 4. F -Jacobian ideals 4.1. Definition for unique factorization domains 4.2. Definition for rings essentially of finite type over an F –finite local ring. 4.3. Examples 5. Further consequences and relations Acknowledgments References 1 2 2 3 4 4 5 6 6 7 15 16 25 27 29 31 31 1. Introduction The aim of this note is to introduce two families of ideals, F -jumping ideals and F Jacobian ideals. Both families of ideals measure singularities in positive characteristic. The F -jumping ideal is closely related to the test ideal introduced by Hara and Yoshida [HY03], while the F -Jacobian ideal is strongly connected with the original test ideal defined by 1 Hochster and Huneke [HH90]. These two families are related through Mα , the modules introduced by Blickle, Mustaţă and Smith [BMS09], and the theory of D-modules and F modules [Lyu97, Yek92]. Roughly speaking, the F -jumping ideal associated to an element f in a regular F -finite ring, R, and to a rational number α “ per´1 , gives the unique simple D-submodule of Mα . If α “ 1, then Mα – Rf with the usual D-module structure. Moreover, the unique simple D-submodule of Mα is R. Under additional hypotheses, the F -Jacobian ideal determines the sum of the simple F -submodules of Rf {R. Several of our results are obtained by investigating properties of F e -submodules of Mα e through ideals I Ă R such that f r I Ă I rp s . We pay particular attention to ideals such that e I “ pI rp s : f r q. This is given by Lyubeznik’s study of F -modules via root maps [Lyu97]. 1.1. F-jumping ideals. Let R be an F -finite regular ring, f an element of R and α a positive real number. The test ideal, τ pf α q, was introduced by Hara and Yoshida as an analogue of the multiplier ideal in positive characteristic [HY03]. The F -jumping numbers for f are defined as the positive real numbers c, such that τ pf c´ǫ q ­“ τ pf c q for every ǫ ą 0. Blickle, Mustaţă and Smith showed that the F -jumping numbers are rational and form a discrete set [BMS09]. These numbers encode important information about the singularity of f (cf. [BFS12]). Let α be the rational number per´1 , with r a positive integer. Mα is Rf ¨eα as an R-module, where eα is a formal symbol. The D-module structure depends on the number α [BMS09, Remark 2.4]. However, it does not depend on the on the representation of α “ per´1 . One of the main aims of this work is to study the simplicity of Mα as a D-module and as a F e -module. In Proposition 3.15 and Remark 3.16 we show that Nα “ D ¨ f rαs eα is the unique simple D-submodule of Mα . This raises the definition of the F -jumping ideal Jpf α q as the ideal such that Jpf α qeα “ R ¨ eα X Nα . We characterize the simplicity of Mα in the following theorem: Theorem 1.1. Let R be an F –finite regular domain and f P R be a nonzero element. The following are equivalent: (i) α is not an F -jumping number; (ii) Nα “ Mα ; (iii) Mα is a simple D-module; (iv) Mα is a simple F e -module; (v) JF pf α q “ R. Moreover, the test ideal τ pf α q is the minimal root for Nα and τ pf α´ǫ q is the minimal root for Mα (see Propositions 3.17 and 3.18). Additionally, in Algorithm 3.19 we present a process to decide whether α is an F -jumping number. 1.2. F-Jacobian ideals. Suppose that S “ Krx1 , . . . , xn s is a polynomial ring over a perfect , . . . , BBf field, K, and f P S. The Jacobian ideal is defined by Jacpf q “ pf, BBf q. This ideal x1 xn plays a fundamental role in the study of singularity in zero and positive characteristics. In this case, Jacpf q “ R if and only if R{f R is a regular ring. Another important property is that Jacpf gq Ă f Jacpgq ` g Jacpf q for f, g P S, which is given by the Leibniz rule. The equality in the previous containment holds only in specific cases [Fab13, Proposition 8] and it is used to study transversality of singular varieties [Fab13, FA12]. 2 Let R be an F -finite regular local ring. We define the F -Jacobian ideal, JF pf q, to be the intersection of R ¨ e1 Ď M1 with the sum of the minimal F -submodules in M1 properly containing the unique simple F -module. The F -Jacobian ideal behaves similarly to the Jacobian ideal of a polynomial. As the Jacobian ideal, they determine singularity: ‚ if R{f R is F -regular, then JF pf q “ R (Corollary 4.40); ‚ if R{f R is F -pure, then R{f R is F -regular if and only if JF pf q “ R (Corollary 4.42). ‚ If f has an isolated singularity and R{f R is F -pure, then JF pf q “ R if R{f R is F -regular, and JF pf q “ m otherwise (Proposition 4.43). In addition, the F -Jacobian ideal also satisfies a Leibniz rule: JF pf gq “ f JF pgq ` gJF pf q for relatively primes elements f, g P R (Proposition 4.14). The Leibniz rule in characteristic zero is important in the study of transversality of singular varieties and free divisors over the complex numbers [Fab13, FA12]. e e The F -Jacobian ideals behave well with pe -th powers; JF pf p q “ JF pf qrp s (Proposition 4.19). This is a technical property that was essential in several proofs. This contrasts with how the Jacobian ideal changes with pe -th powers: pe ´1 e pe ´1 e Bf p Bf p e ,..., q “ Jacpf qrp s ,...,p q “ f R ‰ pf , Jacpf q “ pf , p Bx1 Bxn Bx1 Bxn The F -Jacobian ideal can be computed from the test ideal in certan cases and they are strongly related (see Proposition 4.33). However, they are not the same (see Example 4.45). Moreover, the F -Jacobian can be defined for elements such that R{f R is not reduced and satifies properties that the test ideal does not (eg. Propositions 4.14 and 4.19). Furthermore, we define the F -Jacobian ideal for a regular F -finite UFD, R, such that Rf {R has finite length as a D-module (Section 4.1). We also define the F -Jacobian ideal for a ring which is essentially of finite type over an F -finite local ring (Section 4.2). Both definitions agree for rings that belog to the previous families (Corollary 4.36). pe pe e Bf e Bf pe pe 1.3. Further consequences and relations. Using ideas and techniques developed to define and study F -jumping ideals and F -Jacobian ideals, we give bounds for the length of Rf {R as an F -module. One of these bounds is in terms of a flag of test ideals previously defined by Vassilev [Vas98]. If R is an F -finite regular local ring and R{f R is F -pure, there exists a strictly ascending chain of ideals rps rps f R “ τ0 Ă τ1 Ă . . . Ă τℓ “ R such that pτi : τi q Ă pτi`1 : τi`1 q and τi`1 is the pullback of the test ideal of R{τi . Another bound is given by the generalized Lyubeznik numbers. These are invariants associated to a local ring of equal characteristic defined by the first author and Witt [NBW12]. These numbers are defined using the D-module structure of local cohomology modules. For a hypersurface of particular interest is the Lyubeznik number dimpR{f Rq λ0 p pR{f R; Lq :“ lengthDpR,Lq´module Hf1Rp pRq, p p is the completion of R with respect to its maximal ideal and L is a coefficient field. where R Namely, the relations are: Theorem 1.2. Let pR, m, Kq be an F -finite regular local ring and f P R be an element, such that R{f R is reduced. Let f “ f1 . . . fs be a factorization of f into irreducible elements. 3 Then, lengthF ´mod Rf {R ď lengthR pτ pf 1´ǫ q{τf q ` s, where τf is the pullback of the test ideal, τ pR{f Rq. Moreover, if R{f R is F -pure, and 0 Ă f R “ τ0 Ă τ1 Ă . . . Ă τℓ “ R is the flag of ideals previously defined, then dimpR{f Rq ℓ ď lengthF ´mod Rf {R ď λ0 pR{f R; Lq for every coefficient field, L. Suppose that R is local, R{f R F -pure and K perfect. In this case, λdimpR{f Rq pR{f R; Lq “ 1 if and only if R{f R is F -regular [NBW12, Bli04]. This fact and Theorem 1.2 say that λdimpR{f Rq pR{f R; Lq is measuring “how far” an F -pure hypersurface is from being F -regular. 2. Preliminaries In this section, we review the basic facts that we will need about tight closure, generalized test ideals, D-modules, and F -modules. 2.1. Tight closure. We recall some definitions in tight closure introduced by Hochster and Huneke [HH90, HH94a], and mention some properties of this theory [Fed87, LS01]. Throughout this section, we assume that R is an F -finite ring. We say that R is F -pure if for every R-module, M, the morphism induced by the inclusion of R in R1{p , M bR R Ñ M bR R1{p , is injective. If R Ñ R1{p splits, we say that R is F split. These two properties, F -purity and F -splitting, are equivalent when R is F -finite. In addition, if pR, m, Kq is a regular local ring and I Ă R is an ideal, then R{I is F -pure if and only if pI rps : Iq Ć mrps (Fedder’s Criterion, [Fed87, Theorem 1.12]). If I Ă R is an ideal, the tight closure I ˚ of I is the ideal of R consisting of all elements z P R for which there exists some c P R that is not in any minimal prime of R, such that cz q P I rqs for all q “ pe " 0. We say that R is weakly F -regular if I “ I ˚ for every ideal. If every localization of R is weakly F -regular, we say the R is F -regular. In general, tight closure does not commute with localization [BM10], and it is unknown if the localization of a weakly F -regular ring is again a weakly F -regular ring. That is why the adjective weakly is used. R is strongly F -regular if for all c P R not in any minimal prime, there exists some q “ pe such that the morphism of R-modules, R Ñ R1{q , that sends 1 to c1{q splits. Strong F regularity is preserved after localization. In a Gorenstein ring, strong and weak F-regularity are equivalent. We define the F -singular locus of R by SingF pRq “ tP P SpecpRq | RP is not F -regularu. We define the test ideal of R by τ pRq “ č pI : I ˚ q. IĂR 4 If R is a Gorenstein ring, we have that τ pRq “ č I parameter ideal pI : I ˚ q. [HH90, Theorem 8.23] [Mat89, Theorem 18.1]. Remark 2.1. Let R be a reduced ring essentially of finite type over an excellent local ring of prime characteristic. Let τ pRq denote the test ideal of R. We know that for every multiplicative system W Ă R, W ´1 τ pRq “ τ pW ´1 Rq [Smi94, Proposition 3.3] [LS01, Theorem 2.3]. It is worth pointing out that, in this case, τ pRq contains a nonzero-divisor [HH94a, Theorem 6.1]. If P P SingF pRq, then RP is not F -regular, and so τ pRP q “ τ pRqRP ‰ RP . Therefore, τ pRq Ă P and P P Vpτ pRqq. On the other hand, if P P Vpτ pRqq, then τ pRP q “ τ pRqRP ‰ RP , and then R is not F -regular. Hence, P P SingF pRq. Therefore, SingF pRq “ Vpτ pRqq. 2.2. Generalized test ideals. Test ideals were generalized by Hara and Yoshida [HY03] in the context of pairs pR, I c q, where I is an ideal in R and c is a real parameter. Blickle, Mustaţă, and Smith [BMS08] gave an elementary description of these ideals in the case of a regular F -finite ring, R. We give the definition introduced by them: e e Given an ideal I in R we denote by I r1{p s the smallest ideal J such that I Ď J rp s [BMS08, Definition 2.2]. The existence of the smallest such ideal is a consequence of the flatness of the Frobenius map in the regular case. We recall some properties that we will use often e and e pIJq1{p Ă I r1{p s ¨ J r1{p es ` rpe s ˘1{ps ` s ˘1{pe e s I “ I rp {p s Ă I rp s ¯rpe s ´ r1{pe s “ D peq f [ÀMBL05, Proposition 3.1], [BMS08, Proposition 2.4]. In addition, pf q where D peq “ HomRpe pR, Rq. Given a non-negative number, c, and a nonzero ideal, I, we define the generalized test ideal with exponent c by ď e e τ pI c q “ pI rcp s qr1{p s , eą0 where rcs stands for the smallest integer greater than or equal to c. The ideals in the union above form an increasing chain of ideals; therefore, they stabilize e e because R is Noetherian. Hence for large enough e, τ pI c q “ pI rcp s qr1{p s . In particular, s e τ pf pe q “ pf s qr1{p s [BMS09, Lemma 2.1]. An important property of test ideals is given by Skoda’s Theorem [BMS08, Theorem 2.25]: if I is generated by s elements and c ď s, then τ pI c q “ I ¨ τ pI c´1 q. For every nonzero ideal I and every non-negative number c, there exists ǫ ą 0 such that 1 τ pI c q “ τ pI c q for every c ă c1 ă c ` ǫ [BMS08, Corollary 2.16]. A positive real number c is an F-jumping number for I, if τ pI c q ‰ τ pI c´ǫ q for all ǫ ą 0. All F -jumping numbers of an ideal I are rational, and they form a discrete set; that is, there are no accumulation points of this set. In fact, they form a sequence with limit infinity [BMS08, Theorem 3.1]. Then for every positive number α, there is a positive rational number, β ă α, such that τ pf β q “ τ pf γ q for every γ P pβ, αq. We denote τ pf β q by τ pf α´ǫ q. 5 2.3. D-modules. Given two commutative rings, A and R, such that A Ă R, we define the ring of A-linear differential operators on R, DpR, Aq, as the subring of HomA pR, Rq, defined inductively as follows. The differential operators of order zero are induced by multiplication by elements in R (HomR pR, Rq “ R). An element θ P HomA pR, Rq is a differential operator of order less than or equal to k ` 1 if θ ¨ r ´ r ¨ θ is a differential operator of order less than or equal to k for every r P R. If A, B, and R are commutative rings rings such that A Ă B Ă R, then DpR, Bq Ă DpR, Aq. Notation 2.2. If A “ Z, we write DR for DpR, Zq, and we write only D if it is clear which ring we are working on. If M is a DpR, Aq-module, then Mf has a structure of a DpR, Aq-module, such that the natural morphism M Ñ Mf is a morphism of DpR, Aq-modules. Thus, Rf {R is an DpR, Aqmodule. Ť If R is a reduced F -finite ring, we have that DR “ ePN HomRpe pR, Rq [Yek92]. We denote peq HomRpe pR, Rq by DR . Moreover, if R is an F -finite domain, then R is a strongly F -regular ring if and only if R is F -split and a simple DR -module [Smi95a, Theorem 2.2]. If R is an F -finite reduced ring, W Ă R a multiplicative system and M a simple DR module, then W ´1 M is either zero or a simple DW ´1 R -module. As a consequence, for every DR -module of finite length, N, lengthDW ´1 R W ´1 N ď lengthDR N. 2.4. F e -modules. In this section, we recall some definitions and properties of the Frobenius functor introduced by Peskine and Szpiro [PS73]. We assume that R is regular. This allows us to use the theory of F -modules introduced by Lyubeznik [Lyu97]. Every morphism of rings ϕ : R Ñ S defines a functor from R-modules to S-modules, where ϕ˚ M “ S bR M. If S “ R and ϕ is the Frobenius morphism, F M denotes ϕ˚ M. If R is a regular ring, F is an exact functor. We denote the e-th iterated Frobenius functor by F e. e p q. In Example 2.3. If M is the cokernel of a matrix pri,j q, then F e M is the cokernel of pri,j e rpe s particular, if I Ă R is an ideal, then F R{I “ R{I . We say that an R-module, M, is an F e -module if there exists an isomorphism of R-modules ν : M Ñ F e M. If M is an R-module and β : M Ñ F e M is a morphism of R-modules, we consider β Fβ F 2β M “ limpM Ñ F e M Ñ F 2e M Ñ . . .q. Ñ β Then, M is an F e -module and M Ñ M is the structure isomorphism. In this case, we say that M is generated by β : M Ñ FRe M. If M is a finitely generated R-module, we say that M is an F e -finite F e -module. If β is an injective map, then M injects into M. In this case, we say that β is a root morphism and that M is a root for M. Example 2.4. (i) Since F e R “ R, we have that R is an F e -module, where the structure morphism ν : R Ñ R is the identity. 6 (ii) For every element f P R and r, e P N, we take α “ F e -module that is generated by fp fr er fp r pe ´1 and define Mα as the F e -finite 2e r R Ñ R Ñ R Ñ .... Remark 2.5. This structure of Mα as F e -module depends of the representation per´1 . How1 ever, if we take another representation per1 ´1 , both structures will induce the same structure 1 as F e¨e -module. We say that φ : M Ñ N is a morphism of F -modules if the following diagram commutes: φ M // N νN νM  FR φ  // F N FM The F e -modules form an Abelian category, and the F e -finite F e -modules form a full Abelian subcategory. Moreover, if M is F e -finite then Mf is also an F e -finite F e -module for every f P R. In addition, if R is a local ring, then every F e finite F e -module has finite length as F e -module and has a minimal root [Bli04, Lyu97]. Example 2.6. The localization map R Ñ Rf is a morphism of F -modules for every f P R. Example 2.7. The quotient of localization map R Ñ Rf is an FR -finite FR -module for f p´1 every f P R. Rf {R is generated by R{f R Ñ FR pR{f Rq “ R{f p R. We recall that every F e -submodule M Ă Rf {R is a D-module [Lyu97, Examples 5.2]. We have that Rf {R has finite length as an F -module, because Rf {R has finite length as a D-module. Let R be an F -finite regular ring. If Rf {R has finite length as D-module, then Rf {R has finite length as an F -module for every f P R. Therefore, if Rf {R has finite length as a D-module, then Rf {R has finitely many F -submodules [Hoc07]. 3. F -jumping ideals and F -jumping numbers In this section we define F -jumpings ideals and give some basic properties. In particular, we relate them with the generalized test ideals and F -jumping numbers. Notation 3.1. Throughout this section R denotes an F -finite regular domain of characteristic p ą 0 and α denotes a rational number whose denominator is not divisible by p. This means that α has the form per´1 for some e. We note that ppaℓ´1 ` . . . ` pe ` 1qr ` α “ peℓ α for every ℓ P N. Let R be a regular local e e e F -finite ring. Then, φpx1{p q P I for all φ P HompR1{p , R) if and only if x P I rp s . Lemma 3.2. τ pf pλ q Ă τ pf λ qrps Proof. We have that rppj λs pj ď prpj λs pj prpj λs j jÑ8 p and lim “ pλ. Then, ¯r1{pj s ď ´ j ¯r1{pj´1 s ď ˆ´ j ¯r1{pj s ˙rps ď´ prpj λs f rp λs “ τ pf λ qrps f rp λs Ă f “ τ pf q “ pλ jPN by the properties of the ideals I jPN jPN r1{pj s [BMS08, Lemma 2.4]. 7  We will study the F e -module Mα “ Rf eα introduced in by Blickle, Mustaţă and Smith [BMS09]. As an Rf -modules, Mα is free of rank one generated by eα . Here eα is thought formally as 1{f α . As an F e -module Mα is generated by the morphism fr R ÝÑ F e R “ R, as in Example 2.4. Moreover, the Frobenius morphism acts on Mα by e bp b F p m ¨ eα q “ mpe `r ¨ eα . f f e The structural isomorphism v e : Re b Mα Ñ Mα is given by e v e pa b b abp q “ ¨ eα fm f mpe `r whose inverse morphism is pv e q´1 p 1 c sppe ´1q`r ¨ e q “ cf b ¨ eα . α fs fs Mα carries a natural structure as a DR -module, which does not depend of the presentation se of α [BMS09, Remark 2.4]. Given P P DR , we take c c P ¨ m “ pv se q´1 pP ¨ v se p m qq, f f where P acts in Rse b Mα by P pa b uq “ P paq b u. We note that es abp b v pa b m q “ mpes `rp1`pe `...`peps´1q q ¨ eα f f se and c 1 pmppe ´1q`rqp1`pe `...`peps´1q q q “ cf b ¨ eα fm fm 1 es e eps´1q q “ cf mpp ´1q`rp1`p `...`p b m ¨ eα f pv se q´1 p thus es e eps´1q q P pcf mpp ´1q`rp1`p `...`p c P¨ m “ f f mpes `rp1`pe `...peps´1q q When m “ 0, the previous expression is equal to e q ¨ eα . eps´1q q P pcf rp1`p `...p q P ¨c“ ¨ eα . e `...`peps´1q q rp1`p f Definition 3.3. We denote DR f rαs ¨ eα by Nα . We define the F -jumping ideal associated to f and α as the ideal JFR pf α q of R such that JFR pf α qeα “ Nα X Reα . If it clear in which ring we are working, we only write JF pf α q. Lemma 3.4. The morphism Mα Ñ Mα`1 defined by sending eα ÞÑ f eα`1 is an isomorphism of F e -modules (as well as D-modules). In particular, Nα – Nα`1 “ DR f rα`1s ¨ eα`1 . 8 Proof. We have the following commutative diagram of R-modules, 0 0  fr R f // f  R  R{f f r`p e ´1 f r`p e ´1   f rp R e  R  R{f pe f pr`p e ´1qpe f pr`p e ´1qpe f f rp R  R  // 2e ... // p2e //  0  // pe // // 0 R{f p 2e f pr`p e ´1qp2e f pr`p e ´1qp2e // // ... ...  0 0 We note that R{f f r`p e ´1 Ñ R{f p e f is zero map because r ě 1 as α ą 0. By taking the limits, we obtain that Mα Ñ Mα`1 is an isomorphism of F -modules, and hence of DR -modules.  Proposition 3.5. Let ℓ P N. Then, f ℓ JF pf α q Ă JF pf α`ℓ q. Proof. Let φ : Mα Ñ Mα`ℓ be the morphism of DR -modules given by eα ÞÑ f ℓ eα`ℓ . We have that φ is an isomorphism by Lemma 3.4. Then, f ℓ JF pf α qeα`ℓ “ JF pf α qf ℓ eα`ℓ “ φpJF pf α qeα q “ φpNα X Reα q “ φpNα q X φpReα q “ Nα`ℓ X Rf ℓ eα`ℓ “ Nα`ℓ X Rf ℓ eα`ℓ Ă Nα`ℓ X Reα`ℓ “ JF pf α`ℓ qeα`ℓ . Therefore, we obtain that f ℓ JF pf α q Ă JF pf α`ℓ q.  Remark 3.6. Given any ideal I Ď R, we consider the D-module generated by I, DR ¨ Ieα “ Ť es sě1 D ¨ Ieα . This is equal to ¯ ď´ es rp1`...`peps´1q q rp1`...`peps´1q q ¨ eα . D pf Iq{f sě0 This DR -module intersects with Reα at the ideal ¯ ď´ es rp1`...`peps´1q q rp1`...`peps´1q q D pf Iq : f sě0 and contains I. We define inductively a sequence of ideals I j associated to f α . We take I 1 “ τ pf α q. Given e e I j , we take I j`1 “ ppI j qrp s : f r q. We note that f r I 1 “ f r τ pf α q “ τ pf r`α q “ τ pf p α q Ă e e τ pf α qrp s “ I 1 pf α qrp s , where the second equality follows from Skoda’s Theorem and Lemma e 3.2. We have that I 1 Ă I 2 and f r I 2 Ă pI 1 qrp s . Inductively, we obtain that I j Ă I j`1 and e f r I j`1 Ă pI j qrp s for every j P N. Since R is Noetherian, there is an N P N such that I N “ I N `1 . By our definition of I j , N I “ I N `j for every j ě N. 9 Definition 3.7. We call the previous sequence of ideals the F -flag of ideals associated to f and α, and we denote the ideals by IRj pf α q. If it is clear in which ring we are taking this flag, we write only I j pf α q. Remark 3.8. By the properties of colon ideals and the flatness of Frobenius, we have that I j pf α q “ pτ pf α qrp je s : f rp1`p e `...`pepj´1q q q. As a consequence, the F -flag of ideals associated to f and α depends on the presentation of α “ per´1 . However, the union of this flag does not depend on this presentation as the next proposition shows. Ť Proposition 3.9. JF pf α q “ j I j pf α q “ I N pf α q for N " 0. Proof. By the definition of τ pf α q and properties of test ideals in Section 2.2, τ pf α qrp ´` ˘r1{pse s ¯rpse s e se f rp αs “ D se pf rp αs q for s ě N for a positive integer N P N. Then, by Remark 3.6, č JF pf α qeα “ Nα Reα č “ DR f rαs ¨ eα Reα ¯ ď´ eps´1q q rαs eps´1q q eα “ D es pf rp1`...`p f q : f rp1`...`p se s “ sě0 ¯ ď´ es rp1`...`peps´1q q rαs rp1`...`peps´1q q eα D pf f q:f “ sěN “ ¯ ď´ eps´1q q`αs eps´1q q eα D es pf rp1`...`p q : f rp1`...`p sěN ¯ ď´ es pes rαs rp1`...`peps´1q q eα D pf q:f “ sěN “ “ ¯ ď´ se eps´1q q eα τ pf α qrp s : f rp1`...`p sěN ď sěN I s pf α qeα .  Proposition 3.10. Let W Ă R be a multiplicative system. Then, JFW ´1 R pf α q “ W ´1 JF pf α q Proof. There exists N such that e e JFR pf α q “ IRN pf p α q “ IRN `1 pf p α q. We have that IR1 pf p α q “ τ pf α q and that IRj`1 pf p α q “ pIRj pf p α qrp s : f r q. We have that e 1 pe α W ´1 IR1 pf p α q “ W ´1 τ pf α q “ τ pf α W ´1 Rq “ IW q [BMS08, Proposition 2.13], Thus, ´1 R pf j ´1 j pe α pe α ´1 N pe α W IR pf q “ IW ´1 R pf q because ´ bR W R is a flat functor. Since IW q“ ´1 R pf N `1 pe α IW pf q, we have that ´1 R e e e e N p α JFW ´1 R pf α q “ IW q “ W ´1 JFR pf α q. ´1 R pf 10 e  Proposition 3.11. Suppose that R is a local ring. Then p JFRp pf α q “ JFR pf α qR, p denotes the completion of R with respect to the maximal ideal. where R e e e Proof. We have that IR1 pf p α q “ τ pf α q and that IRj`1 pf p α q “ pIRj pf p α qrp Proposition 2.13]. In addition, es : f r q [BMS08, e p “ τ pf α qR p “ τ pf α Rq pR p “ I 1p pf pe α q IR1 pf p α qR R e p is a flat functor. p “ I j pf pe α q because ´ bR R [BMS08, Proposition 2.13]. Thus, IRj pf p α qR p R  The rest is analogous to the proof of Proposition 3.10. fr e Every F e -submodule of Mα is given by an ideal I Ă R such that I Ñ I rp s makes sense e [Lyu97, Corollary 2.6]. This is f r I Ă I rp s . We set ˙ ˆ e 2e f r rpe s f p r rp2e s f p r Ñ I Ñ ... . NI “ lim I Ñ I Ñ e e Lemma 3.12. Let I, J Ă R be ideals such that f r I Ă I rp s , f r J Ă J rp s and I Ă J. Then the F e -submodule Mα generated by I is equal to the one generated by J if and only if there exits epℓ´1q q eℓ ℓ P N such that f rp1`...`p J Ă I rp s . Proof. Let NI and NJ be the F e -submodules of Mα generated by I and J respectively. We e e fr have that J{I Ñ J rp s {I rp s generates the F e -module NJ {NI . Since J{I is a finitely generated R-module, NJ “ NI if and only if there exist there exists ℓ such that J{I f rp1`...`p epℓ´1q q Ñ eℓ J rp s {I rp eℓ s is the zero morphism. Therefore, NI “ NJ if and only if there exits ℓ P N such that epℓ´1q q e f rp1`...`p J Ă I rp s .  fr Proposition 3.13. DR f rαs ¨ eα is an F e -submodule of Mα . Moreover, JF pf α q Ñ JF pf α qrp e fr and τ pf α q Ñ τ pf α qrp s generate DR f rαs ¨ eα . Proof. By the definition of τ pf α q and properties of test ideals in Section 2.2, τ pf α qrp ´` ˘r1{pse s ¯rpse s e se f rp αs “ D se pf rp αs q for s ě N for an integer N P N. Then, ď DR ¨ f rαs eα “ D es ¨ f rαs eα sě0 ď “ sěN “ sěN D es ¨ f rαs eα ¯ ď´ eps´1q q rαs eps´1q q ¨ eα D es pf rrp1`...`p f q{f rp1`...`p ¯ ď´ es rpes αs rp1`...`peps´1q q ¨ eα D pf q{f “ sěN 11 se s es “ “ ¯ ď´ se eps´1q q ¨ eα . τ pf α qrp s {f rp1`...`p sěN e As f r τ pf α q “ τ pf r`α q “ τ pf p α q Ă τ pf α qrp submodule of Mα generated by the morphism es by Lemma 3.2, it is a root for the F e - fr e τ pf α q Ñ τ pf α qrp s , which is ¯ ď´ se eps´1q q ¨ eα . τ pf α qrp s {f rp1`...`p s fr e Hence, DR ¨f rαs eα is the F e -submodule of Mα generated by the morphism τ pf α q Ñ τ pf rα qrp s . e As f r I s pf α q Ă I s pf α qrp s for every s, we have that I s pf α q also generates an F e -submodule e fr of Mα . Since I s`1 pf α q{I s pf α q is the kernel of the morphism R{I s pf α q Ñ R{I s pf α qrp s , fr fr e e I s pf α q Ñ I s pf α qrp s and I s`1 pf α q Ñ I s`1 pf α qrp s generate the same F e -submodule by Lemma 3.12. Therefore, DR ¨f rαs eα is the F e -submodule e fr generated by JF pf α q Ñ JF pf α qrp s because JF pf α q “ I s pf α q for s " 0.  ? e Lemma 3.14. Let I Ă R be a nonzero ideal such that I Ď pI rp s : f r q. Then f P I. se e eps´1q q Proof. We have that for every s P N, I Ă pI rp s : f rp1`p `...`p q by flatness of Frobenius se rpse s rp1`pe `...`peps´1q q and properties of colon ideals. Thus, IRf Ă ppIRf q :f q “ pIRf qrp s . Let es P Ă R be a prime ideal of R that does not contain f. We have that IRP “ I rp s RP for every s ą 0. We claim that IRP “ RP for every P ; otherwise, č č se se IRP Ă pIRP qrp s Ď pP RP qp “ 0 s and we know that IRP ‰ 0. Therefore, IRf “ Rf and f P ? I.  Proposition 3.15. For any nonzero F e -submodule N of Mα , Nα Ă N. In particular, Nα is a simple F -module. Proof. As any two R-modules intersect in Rf , we have that there is a minimal simple F e Ş e submodule N. We know that Reα N “ Ieα , where I “ pI rp s : f r q [Lyu97, Corollary 2.6]. Then f P I by Lemma 3.14. ´` ˘r1{pse s ¯rpse s se e se There exists an N such that τ pf α qrp s “ f rp αs “ D se pf rp αs q and that n τ pf pse `α q “ τ pf α q for every s ě N (cf. Section 2.2). DR ¨ f n eα “ “ “ ď sě0 ď D es ¨ f n eα sěN D es ¨ f n eα ď´ sěN es D pf rp1`...`peps´1q q n f q{f 12 rp1`...`peps´1q q ¯ ¨ eα “ “ ď´ sěN ď sěN D es pf n`rp1`...`p ˜ˆ ´ f eps´1q q n`rp1`...`peps´1q q q{f rp1`...`p eps´1q q ¯r1{pse s ˙rpes s {f ¯ ¨ eα rp1`...`peps´1q q ˙ ďˆ rp1`...`peps´1q q n es s eps´1q q ` rp rp1`...`p es es p τ pf p “ ¨ eα q {f sěN Ą Ą ď´ sě0 n es τ pf pes `α qrp s {f rp1`...`p ď´ sěN es τ pf α qrp s {f rp1`...`p “ DR ¨ f rαs eα “ Nα eps´1q q eps´1q q ¯ ¯ ¸ ¨ eα ¨ eα ¨ eα Therefore, Nα Ă N.  Corollary 3.16. Nα is a simple D-module. Proof. Since JF pf α q commutes with localization, we have that the construction of Nα commutes with localization. Suppose that N Ă Nα is a nonzero D-submodule. After localizing at a maximal ideal, m, we have that pRzmq´1 N Ă pRzmq´1 Nα . It suffices to prove the statement in the local case. If R is a local ring, Nα is a simple F e -module and it is a direct sum of simple DR -modules [Lyu97, Theorem 3.2 and 5.6]. Since every two R-modules in Rf intersect, Nα must be a simple DR -module.  Proposition 3.17. Let I Ă τ pf α q be a nonzero ideal such that I Ă pI rp I “ τ pf α q. In particular, τ pf α qeα is a minimal root for Nα . es pes ´1 es : f r q. Then, Proof. We have that I Ă pI rp s : f pe ´1 rq for every s P N by flatness of Frobenius and properties of colon ideals. There exists n P N such that f n P I by Lemma 3.14. We have that ´ es ´1 es ´1 ¯r1{pes s n` ppe ´1 r n` ppe ´1 r rpes s f PI , and so f Ă I. In addition, n` and ppe ´ 1qn ` ppes ´ 1qr r pes ´ 1 r “ ą e , e e p ´1 p ´1 p ´1 r ppe ´ 1qn ` ppes ´ 1qr “ e “ α. e sÑ8 p ´1 p ´1 There exists an N such that ˙r1{peN s ˆ eN ´1 r n` ppe ´1 α R Ă I Ă τ pf α q. τ pf q “ f lim 13 fr e Therefore, I “ τ pf α q. The claim about being a minimal root follows because I Ñ I rp s generates an nonzero F e -submodule of Nα , which is simple by Proposition 3.15.  Using ideas analogous to the previous proof, we recover a result previously obtained by Blickle [Bli08, Proposition 3.5] e Proposition 3.18. Let β “ ab P Qą0 . If α ą β, then f r τ pf β q Ă τ pf β qrp s and it generates Mα as F -module. Moreover, τ pf α´ǫ qeα is the minimal root of Mα as a F e -module. Proof. Since r pe ´1 ą ab , we have that br ` a ą pe a. Then pe a a`br e e f r τ pf β q “ τ pf β`r q “ τ pf pe ´1 q Ă τ pf pe ´1 q “ τ pf p β q Ă τ pf β qrp s . Thus τ pf β q generates an F -submodule of Mα . epℓ´1q q “ α, we can pick an ℓ P N such that rp1 ` . . . pepℓ´1q q ą peℓ β. Since lim rp1`...p peℓ ℓÑ8 We have that f rp1`...pepℓ´1q q Then τ pf ˆ´ ¯r1{pe s ˙rpe s ¯rpe s ˙r1{pe s ˆ´ rp1`...pepℓ´1q q e rp1`...pepℓ´1q q rp1`...pepℓ´1q q peℓ qrp s . “ τ pf f f R Ă R“ rp1`pepℓ´1q q peℓ pepℓ´1q `...1qr peℓ q generates Mα as a F e -module by Lemma 3.12 because ppepℓ´1q `...1qr peℓ ă α. q Ă τ pf β q, τ pf β q also generates Mα as a F e -module. Since τ pf ℓ´1 ℓ Let I Ă R be an ideal such that f r I Ă I, and that f rpq `...1q R Ă I rq s for some ℓ P N. Then, ¯r1{peℓ s ´ rp1`...pepℓ´1q q f Ă I, and so, τ pf α´ǫ q Ă τ pf rp1`...pepµ´1q q peµ ¯ eµ ´ epµ´1q q r1{p s q “ f rp1`...p Ă I. Thus, τ pf α´ǫ q is contained in every ideal that generates Mα . Since τ pf α´ǫ q generates Mα , τ pf α´ǫ qeα is the minimal root of Mα as an F e -module.  Proof of Theorem 1.1. We have that α “ per´1 is not an F -jumping number if and only if τ pf α q ‰ τ pf α´ǫ q. This happens if and only if Nα “ Mα by Propositions 3.17 and 3.18, which is equivalent to JF pαf q “ R. The rest follows from Proposition 3.15 and Corollary 3.16.  Theorem 1.1 gives the following algorithm to decide whether a number of the form is an F -jumping number for f P R : Algorithm 3.19. Input: α “ per´1 and f P R. Output: R if α is not F -jumping number for f and a proper ideal otherwise. Process: Compute τ pf α q; Take J1 “ τ pf α q; rpe s Compute Jn`1 “ pJn : f r q until there is an N such that JN “ JN `1 ; Return: JN . Example 3.20. Let R “ F13 rx, ys and f “ x2 ` y 3. Therefore: 14 r pe ´1 11 (i) If α “ 12 , τ pf α q “ px, yqR, J1 “ px, yqR, and J2 “ ppx13 , y 13 q : f 11 q “ R because f 11 is equal to x22 ´ 2x20 y 3 ` 3x18 y 6 ´ 4x16 y 9 ` 5x14 y 12 ´ 6x12 y 15 ´ 6x10 y 18 ` 5x8 y 21 ´ is not an F -jumping number. 4x6 y 24 ` 3x4 y 27 ´ 2x2 y 30 ` y 33 . Then, 11 12 10 α (ii) If α “ 12 , τ pf q “ px, yqR, J1 “ px, yqR, and J2 “ ppx13 , y 13q : f 10 q “ px, yq because f 10 is equal to x20 ´ 3x18 y 3 ` 6x16 y 6 ` 3x14 y 9 ` 2x12 y 12 ` 5x10 y 15 ` 2x8 y 18 ` 3x6 y 21 ` is an F -jumping number. 6x4 y 24 ´ 3x2 y 27 ` y 30 . Then, 10 12 Remark a 3.21. Since a F -jumping ideals and test ideals commute with localization, we have α that JF pf q “ pτ pf α q : τ pf α´ǫ qq. In general, JF pf α q is not equal to pτ pf α q : τ pf β qq. Let R “ F7 rx, ys, f “ x3 y 2 and α “ 64 . Then, β “ 36 is the biggest F -jumping number smaller than α. We have that τ pf β q “ xyR and τ pf α q “ x2 yR, and so px2 yR : xyRq “ xR. However, JF pf α q “ x2 . e e Proposition 3.22. I j pf p α q “ I j´1 pf α qrp s for j ě 2. e e Proof. We will prove that I j pf p α q “ I j´1 pf α qrp s for j ě 2 by induction on j. If j “ 2, e e e I 2 pf p α q “ I 2 pf α`r q “ pτ pf α`r qrp s : f p r q e e e “ pτ pf α`r q : f r qrp s “ pf r τ pf α q : f r qrp s “ τ pf α qrp s “ I 1 pf α q. Suppose that the claim is true for j. Then, e e e e e I j`1 pf p α q “ pI j pf p α qrp s : f p r q “ pI j pf p α q : f r qrp e e es e “ pI j´1 pf α qrp s : f r qrp s “ I j pf α qrp s . Proposition 3.23. JF pf pα q “ JF pf α qrps . e  e Proof. We first note that JF pf p α q “ JF pf α qrp s because ď ď e e e e JF pf p α q “ I j pf p α q “ I j pf α qrp s “ JF pf α qrp s j j by Lemma 3.22. e`1 In addition, we have that JF pf α qrps “ pJF pf α qrp s : f pr q. Then, JF pf α qrps defines the F e -submodule of Mpα generated by the morphism f pr JF pf α qrps Ñ JF pf α qrp e`1 s . Since JF pf pα q defines the unique simple F -submodule of Mpα by Propositions 3.13 and 3.15, JF pf pαq Ă JF pf α qrps . Combining these two observations we have that e JF pf p α q Ă JF pf p e´1 α qrps Ă . . . Ă JF pf pα qrp e´1 s e e Ă JF pf α qrp s “ JF pf p α q. Hence, JF pf pαq “ JF pf α qrps because the Frobenius map is faithfully flat.  4. F -Jacobian ideals The F -Jacobian ideal of an element f is connected with the minimal F -module of the first local cohomology of R supported at f . In this section we define the F -Jacobian ideal and deduce some of its properties. 15 4.1. Definition for unique factorization domains. Notation 4.1. Throughout this section R denotes an F -finite regular UFD of characteristic p ą 0 such that Rf {R has finite length as a DpR, Zq-module for every f P R. This hypothesis is satisfied for every F -finite regular local ring and for every F -finite polynomial ring [Lyu97, Theorem 5.6]. Lemma 4.2. Let S be a UFD and f P S be an irreducible element. Then, N X M ‰ 0 for any nonzero S-submodules M, N Ă Sf {S. Proof. Let a{f β P Mzt0u and b{f γ P Nzt0u, where β, γ ě 1. Since S is a UFD and f is irreducible, we may assume that gcdpa, f q “ gcdpb, f q “ 1. Then, gcdpab, f q “ 1, and so ab{f ‰ 0 in Sf {S. We have that ab{f “ bf β´1 pa{f β q “ af γ´1 pb{f γ q ‰ 0. Then, ab{f P N X M..  Lemma 4.3. Let S be a regular ring of characteristic p ą 0, f P S an element and π : S Ñ S{f S be the quotient morphism. Let and I : tI Ă S | I is an ideal, f P I, pI rps : f p´1q “ Iu N “ tN Ă Sf {S|N is an F -submoduleu. Then, the correspondence given by sending N to IN “ π ´1 pN X R{f Rq is bijective, with f p´1 inverse defined by sending the ideal I P I to the F -module NI generated by I{f S Ñ F pI{f Sq “ I rps {f p S. f p´1 Proof. Since φ : R{f R Ñ R{f p R is a root for Rf {R, its F -submodules are in correspondence with ideals J Ă R{f R such that φ´1 pF pJqq “ J [Lyu97, Corollary 2.6]. We have the following generating morphisms: 0 Ó f p´1 0 Ó fp 2 ´p fp 2 ´p fp 2 ´p 0 Ó fp 3 ´p2 fp 3 ´p2 fp 3 ´p2 I{f R Ñ F pIR{f Rq Ñ F 2 pIR{f Rq Ñ . . . Ó Ó Ó f p´1 R{f R Ñ Ó f p´1 R{I Ñ Ó 0 R{f p R Ó R{I rps Ó 0 Ñ Ñ 2 R{f p R Ó R{I rp Ó 0 2s Ñ ... Ñ ... Since J is a quotient I{f R of an ideal, F pJq “ I rps {f p R. Then, I{f R “ φ´1 pI rps {f p q “ th P R{f R | f p´1h P I rps {f p u “ th P R | f p´1h P I rps u{f R 16 “ pI rps : f p´1 q{f and the result follows.  Lemma 4.4. Let f P R be an irreducible element. Then, there is a unique simple F -module in Rf {R. Proof. Since Rf {R is an F -module of finite length, there exists a simple F -submodule M Rf {R. Let N be an F -submodule of Rf {R. Since M X N ‰ 0 by Lemma 4.2 and M a simple F -module, M “ M X N. Hence, M is the only nonzero simple F -submodule Rf {R. Ă is of  Proposition 4.5. Let g P R be an irreducible element and f “ g n for some integer n ě 1. Then there exists a unique ideal I Ă R such that: (i) f P I, (ii) I ‰ f R, (iii) pI rps : f p´1 q “ I, and (iv) I is contained in any other ideal satisfying (i),(ii) and (iii). Proof. We note that Rf {R “ Rg {R. Let I be the ideal corresponding to the minimal simple F -submodule in given in Lemma 4.4 under the bijection in Lemma 4.3. Then, it is clear from Lemma 4.3 that I satisfies (i)-(iv).  Definition 4.6. Let g P R be an irreducible element and f “ g n for some integer n ě 1. We denote the minimal simple submodule of Rf {R by minFR pf q, and we called it the minimal F -module of f . Let σ : R{f R Ñ Rf {R be the morphism defined by σprasq “ a{f which is well defined because R is a domain. Since image of σ is R f1 , we abuse notation and consider R{f R Ă Rf {R. We denote pφσq´1 pminF pf q X R f1 q by JF pf q, and we call it the F -Jacobian ideal of f . If f is a unit, we take minF pf q “ 0 and JF pf q “ R. Notation 4.7. If it is clear in which ring we are working, we write JF pf q instead of JFR pf q and minF pf q instead of minFR pf q. Proposition 4.8. Let f P R be an irreducible element. Then minF pf q is the only simple D-submodule of Rf {R. Proof. We claim that Rf {R has only one simple DR -module. Since Rf {R has finite length as a D-module, there is a simple D-submodule, M. It suffices to show that for any other DR -submodule, N Ă M. We have that M X N ‰ 0 by Lemma 4.2, and so M “ M X N Ă N because M is a simple DR -module. Since minFR pf q is an DR -module [Lyu97, Examples 5.1 and 5.2], we have that M Ă minF pf q. It suffices to prove that M is an F -submodule of Rf {R. Since R{f R is a domain, we have that the localization morphism, R{f R Ñ Rm {f Rm , is injective. Then, SuppR pR{f Rq “ SuppR pJq for every nonzero ideal J Ă R{f R. Then, SuppR pR{f Rq “ SuppR pR{f R X Nq Ă SuppR pNq Ă SuppR pRf {Rq “ SuppR pR{f q for every R-submodule of Rf {R by Lemma 4.2. Let m denote a maximal ideal such that f P m. Thus, Mm ‰ 0, and then, Mm is the only simple DRm -module of pRf qm {Rm . Since 17 Rm is a regular local F -finite ring, we have that minFRm pf q is a finite direct sum of simple DRm -modules [Lyu97, Theorem 5.6]. Therefore, Mm “ minFRm pf q by Lemma 4.2. Let π : R Ñ R{f R denote the quotient morphism, and I “ π ´1 pR{f R X Mq. We note rps that I ‰ f R because R{f X M ‰ 0 by Lemma 4.2. We claim that pIm : f q “ Im for every maximal ideal. If f P m, Im {f “ pRm {f Rm q X Mm “ pRm {f Rm q X minFRm pf q “ JFRm pf q{f ; otherwise, Im “ Rm “ JFRm pf q because f is a unit in Rm Then, pI rps : f p´1q “ I and so I corresponds to an FR -submodule of Rf {R, NI by Lemma 4.3. Moreover, fp f p´1 2 ´p NI “ limpI{f R Ñ I rps {f p R Ñ . . .q. Ñ Since localization commutes with direct limit, we have that for every maximal ideal such that f P m, fp f p´1 2 ´p rps {f p Rm Ñ . . .q “ NIm “ NI bR Rm . Mm “ minFRm pf q “ limpIm {f Rm Ñ Im Ñ Therefore, M “ NI because SuppR pMq “ SuppR pR{f q, and it is an F -submodule of Rf {R. Hence, M “ minFR pf q.  Remark 4.9. If f P R is an irreducible element, then: (i) minpf q “ minpf n q for every n P N because Rf n {R “ Rf {R, (ii) JF pf q is the minimal of the family of ideals I containing properly f R such that pI : f p´1q “ I by Proposition 4.5. (iii) JF pf q is not the usual Jacobian ideal of f . If S “ F3 rx, y, z, ws and f “ xy ` zw, we have that the Jacobian of f is m “ px, y, z, wqS. However, m ‰ pmrps : f 2 q. (iv) JF pf q “ R if and only if Rf {R is a simple F -module by the proof of Proposition 4.5 and Lemma 4.3. (v) JF pf q “ R if and only if Rf {R is a simple DR -module by Proposition 4.8. Proposition 4.10. Let fi , . . . fℓ P R be irreducible relatively prime elements and f “ f1 ¨ ¨ ¨ fℓ . Then minF pfi q is an F -submodule of Rf {R. Moreover, all the simple F -submodules of Rf {R are minF pf1 q, . . . , minF pfℓ q. Proof. The morphism Rfi {R Ñ Rf {R, induced by the localization map Rf1 Ñ Rf , is a morphism of F -finite F -modules given by the diagram: 0 0  R{fi R  fip´1 // fip R{fip R 2 f1p ...fˆip ¨¨¨fℓp  R{f R f p´1 0 // 2  fip 2 R{fip R f1p ...fˆip ¨¨¨fℓp  // 2 ´p R{f p R fp 2 ´p // 3 2  3 ´p2 // 3 ... f1p ...fˆip ¨¨¨fℓp 2 R{f p R fp 3 3 ´p2 // ... Then minF pfi q is a simple F -submodule of Rf {R. Let N be an F -submodule of Rf {R, and a{f1β1 ¨ ¨ ¨ fℓβℓ P Nzt0u. Since fi is irreducible, we may assume that gcdpa, fi q “ 1 and βi ‰ 0 for some i “ 1 . . . , ℓ. Thus, a{fi P N XRfi {R and a{fi ‰ 0. Then, minF pfi q Ă N XRfi {R Ă N. In particular, if N is a simple F -submodule, then N “ minF pfi q.  18 Remark 4.11. As a consequence of Lemma 4.10, we have that minF pf1 q ‘ . . . ‘ minF pfℓ q P Rf {R because Rg X Rh “ R for all elements g, h P R such that gcdpg, hq “ 1. Definition 4.12. Let fi , . . . fℓ P R be irreducible relatively prime elements, f “ f1β1 ¨ ¨ ¨ fℓβℓ , and π : R Ñ R{f R be the quotient morphism. We define minF pf q by minF pf1 q ‘ . . . ‘ minF pfℓ q, and we called it the minimal F -module of f . Let σ : R{f R Ñ Rf {R be the morphism defined by σprasq “ a{f which is well defined because R is a domain. Since image of σ is R f1 , we will abuse notation and consider R{f R Ă Rf {R. We denote pφσq´1 pminF pf q X R f1 q by JF pf q, and we call it the F -Jacobian ideal of f . Remark 4.13. In the local case, minF pf q is the intersection homology D-modules LpR{f, Rq previously defined by Blickle [Bli04, Theorem 4.5]. Proposition 4.14. Let f, g P R be relatively prime elements. Then, JF pf gq “ f JF pgq ` gJF pf q. Moreover, f JF pgq X gJF pf q “ f gR. Proof. We consider Rf {R and Rg {R as F -submodules of Rf g {R, where the inclusion is given by the localization maps, ιf : Rf Ñ Rf g and ιg : Rg Ñ Rf g . Let π : R Ñ R{f gR and ρ : R Ñ R{f R be the quotient morphisms. The limit of the morphism induced by the diagram 0 0 0   f p´1 R{f R // R{f p R g gp  R{f gR //  2 ´p 2 R{f p R // 2  pf gqp´1 fp R{f p g p R gp  p2 ´p pf gq // fp 3 ´p2 ... // 3 2 R{pf gqp R pf gqp 3 ´p2 // ... is ιf . Moreover, under this correspondence 0 0  JF pf q{f R  f p´1 // JF pf q rp2 s g  gJF pf q{f gR 0 {f R gp pf gqp´1 //  fp p  2 ´p // JF pf q rp2 s 2 gp g p JF pf qrps {f p g p R pf gqp 2 ´p // 2  2 2 {f p R ... // 3 2 g p JF pf qrp s {pf gqp R // ... induces the isomorphism of F -modules, ιf : minF pf q Ñ ιf pminF pf qq. We have that gpJF pf qq “ π ´1 pminF pf q X R{f gRq Ă π ´1 pminF pf q X R{f gRq “ JF pf gq. In addition, pg p JF pf qrps : pf gqp´1q “ gJF pf q, 19 and it defines minF pf q as a F -submodule of Rf g {R. Likewise, f JF pgq Ă JF pf gq, pf p JF pgqrps : pf gqp´1q “ f JF pgq, and it defines minF pgq as a F -submodule of Rf g {R. Then, f JF pgq ` gJF pf q Ă JF pf gq. Since minF pf q X minF pgq “ 0, we have that f JF pgq X gJF pgq “ f gR. We claim that pf p JF pgqrps ` g p JF pf qrps : f p´1g p´1q “ f JF pgq ` gJF pf q. To prove the first containment, take h P pf p JF pgqrps ` g p JF pf qrps : f p´1 g p´1q. Then f p´1g p´1h “ f p v ` g p w for some v P pJF pgqqrps and w P JF pgqrps . Since f and g are relatively prime, f p´1 divides w and g p´1 divides v. Thus, there exist a, b P R such that v “ g p´1a and w “ g p´1b. Then, a P pJF pgqrps : g p´1q “ JF pgq and b P pJF pf qrps : f p´1 q “ JF pf q. Since, f p´1 g p´1h “ f p v ` g p w “ f p g p´1a ` g p g p´1b, h “ f a ` gb P f JF pgq ` gJF pf q. For the other containment, it is straightforward to check that f JF pgq ` gJF pf q Ă pf p JF pgqrps ` g p JF pf qrps : f p´1g p´1q. Since Nf JF pgq`gJF pf q , the F -module generated by f JF pgq ` gJF pf q, contains minF pf q and minF pgq, minF pf q ‘ minF pgq Ă Nf JF pgq`gJF pf q . Therefore, JF phq Ă f JF pgq ` gJF pf q and the result follows.  Proposition 4.15. Let β, γ P N be such that β ă γ. Then, f γ´β JF pf β q Ă JF pf γ q Ă JF pf β q. Proof. Let σℓ : R{f ℓ Ñ Rf {R be the injection defined by sending ras Ñ a{f ℓ . We note that the image of σℓ is R f1ℓ We have that the following commutative diagram, R{f β R ■■ ■■ σβ ■■ ■■ ■$$ Rf {R f γ´β  :: ✉✉ ✉✉ ✉ ✉✉ σ ✉✉ γ R{f γ R Then, R f1β X minF pf q Ă R f1γ X minF pf q, and this corresponds to f γ´β JF pf β q{f γ R Ă JF pf γ q{f γ R. Hence, f γ´β JF pf β q Ă JF pf γ q because f γ belongs to both ideals. 20 f γ´β The morphism R f1γ X minF pf β q Ñ R f1β X minF pf q is well defined and it is equivalent to the morphism JF pf γ q{f γ R Ñ JF pf β q{f β given by the quotient morphism R{f γ R Ñ R{f β R. Then, JF pf γ q ` f β R Ă JF pf β q and the result follows.  Remark 4.16. There are examples in which the containment in Proposition 4.15 is strict. Let R “ Fp rxs and f “ x. In this case, Rf {R is a simple F -module. Then, JF pxβ q “ R for every β P N and f γ´β JF pf β q Ă JF pf γ q for every γ ą β. Corollary 4.17. Let f, g P R be such that f divides g. Then, JF pgq Ă JF pf q. Proof. This follows from Propositions 4.15 and 4.14.  Proposition 4.18. Let f P R and W Ă R be a multiplicative system. Then, JFW ´1 R pf q “ W ´1 JFR pf q. Proof. By Proposition 4.14, it suffices to prove the claim for f “ g n , where g is an irreducible element. We note that g is either a unit or a irreducible element in W ´1 R. We have that minFW ´1 R pf q “ minFW ´1 R pgq is either zero or a simple F -module by Lemma 4.8. Then, minFW ´1 R pf q “ W ´1 minFR pf q, and so JFW ´1 R pf q{f W ´1R “ W ´1 R{f W ´1 R X minFW ´1 R pf q “ W ´1 pR{f R X minFR pf qq “ W ´1 JFR pf q{f W ´1R, and the result follows because f belongs to both ideals. Proposition 4.19. Let f P R. Then, JFR1{pe pf q “ JFR pf qR e JFR pf qrp s .  1{pe pe . Moreover, JFR pf q “ Proof. By Proposition 4.14, we may assume that f “ g n where g is irreducible. Let q denote pe and h denote the length of Rf {R in the category of F -modules. Let G : R1{q Ñ R be the 1{q isomorphism defined by r Ñ r q . Under the isomorphism G, Rf {R1{q corresponds to Rf q {R. 1{q Then, the length of Rf {R1{q in the category of FR1{q -modules is h. Let 0 “ M0 Ă . . . Ă Mh “ Rf {R be a chain of FR -submodules of Rf {R such that Mi`1 {Mi is a simple FR -module. Let f R “ J0 Ă . . . Ă Jh “ R be the corresponding chain of ideals under the bijection given in Lemma 4.3. Since f “ g n and g is irreducible, M1 “ minFR pf q and J1 “ JFR pf q. We note that pJip R1{q : f p´1 q “ Ji R1{q and Ji R1{q ‰ Ji`1 R1{q because R1{q is a faithfully flat R-algebra. Then, we have a strictly ascending chain of ideals f R1{q “ J0 R1{q Ă . . . Ă Jh R1{p “ R1{q 1{q that corresponds to a strictly ascending chain of FR1{q -submodules of Rf {R1{q . 1{q Since f “ pg 1{q qqn , g 1{q is irreducible and the length of Rf {R1{q is h, we have that JFR pf qR1{q “ J1 R1{p “ JFR1{q pf q. After applying the isomorphism G to the previous equality, we have that JFR pf qrqs “ GpJFR pf qR1{q q “ GpJFR1{q pf qq “ JFR pf q q. 21  Proposition 4.20. Let R Ñ S be a flat morphism of UFDs and let f P R. If S is as in Notation 4.1, then JFS pf q Ă JFR pf qS. Proof. We may assume that f “ g β where g is an irreducible element in R by Proposition 4.14. Since S is flat, pJFR pf qrps S : f p´1 q “ JFR pf qS. Let M denote the FS -submodule of Sf {S given by JFR pf qS under the correspondence in Lemma 4.3. If f is a unit in S, then JF pf qS “ S and the result is immediate. We may assume that f is not a unit in S. Since JF pf q ‰ f R, we can pick a P JF pf qzf R. Then, a “ bg γ for some 0 ď γ ă β and b P R such b b that gcdpb, gq “ 1. Then, R{g Ñ R{g is injective, and so S{gS Ñ S{gS is also injective. Thus, gcdpb, gq “ 1 in S. Hence, b{g is not zero in Sg {S. Moreover, b{g “ g β´γ´1a{f P M and it is not zero. Let g1 , . . . , gℓ P S irreducible relatively prime elements such that g “ g1β1 ¨ ¨ ¨ g1βℓ . We have that b{gi “ hb{g P Sgi {S X Mzt0u, where h “ g1β1 ¨ ¨ ¨ giβi´1 ¨ ¨ ¨ g1βℓ . Then, minFS pgi q Ă M and so minFS pf q Ă M. Therefore, JFS pf q Ă JFR pf qS.  Proposition 4.21. Suppose that R is a local ring. Let f P R. Then p JFRp pf q “ JFR pf qR, p denotes the completion of R with respect to the maximal ideal. where R p [Bli04, Theorem 4.6]. Then, Proof. We have that minFRp pf q “ minFR pf q bR R ´ ¯ p R p X minF pf q “ ppR{f Rq X minF pf qq bR R p “ JF pf qR p JF “ R{f p R p R R R  Lemma 4.22. Let R “ Krx1 , . . . , xn s, where K is a perfect field. Let K Ñ L be an algebraic field extension of K, S “ Lrx1 . . . , xn s, and R Ñ S the map induced by the extension. Then, JFS pf q “ JFR pf qS. Proof. We can assume that f “ g β where g is an irreducible element in R by 4.14. It suffices to show that JFR pRqS Ă JFS pSq by Proposition 4.20. There is an inclusion φ : Rf {R Ñ Sf {S, which is induced by R Ñ S. We take M “ pminFS pf qq X Rf {R. We claim that M is a DR -module of Rf {R. Since K is perfect, ď 1 Bt HomS pe pS, Sq “ DpR, Kq “ Rr DR “ s. t t! Bx i ePN t B We note that DR Ă DS , and that for every m P Rf {R, φp Bx t mq “ i Bt m Bxti Bt φpmq. Bxti As a consequence, P M for every m P M. Therefore, M is a DR -module. Let I “ M X R{f R. We note that I “ minFS pf q X R{f R “ pJFS pf q{f Sq X R{f R and that S{f S is an integral extension of R{f R because L is an algebraic extension of K. Let r P JFS pf q{f S not zero, and aj P R{f R such that a0 ‰ 0 in S{f S. Then, r n ` an´1 r n´1 ` . . . ` a1 r ` a0 “ 0 rpan´1 r n´1 ` . . . ` a1 q “ ´a0 , 22 and so a0 P I “ pJFS pf q{f Sq X R{f R, and then M ‰ 0. Therefore, minFR pf q Ă M and so JF pf q{f Ă I. Let π : R Ñ R{f R be the quotient morphism. Then, JFR pf q Ă π ´1 pIq “ JFS pf q X R, and JFR pf qS Ă pJFS pf q X RqS Ă JFS pf q.  Lemma 4.23. Let R “ Krx1 , . . . , xn s, where K is an F -finite field. Let L “ K 1{p , S “ Lrx1 . . . , xn s, and R Ñ S the map induced by the extension K Ñ L. Then JFS pf q “ JFR pf qS. Proof. We have that R Ă S Ă R1{p . Then, by Proposition 4.20, JFR1{p pf q Ă JFS pf qR1{p Ă pJFR pf qSqR1{p “ JFR pf qR1{p . Since JFR1{p pf q “ JFR pf qR1{p by Proposition 4.19, 0 “ JFS pf qR1{p {pJFR pf qSqR1{p “ pJFS pf q{JFR pf qSq bS R1{p . Therefore, JFS pf q “ JFR pf qS because R1{p is a faithfully flat S-algebra.  Lemma 4.24. Let R “ Krx1 , . . . , xn s, where K is an F -finite field. Let L be the perfect closure of K, S “ Lrx1 . . . , xn s, and R Ñ S the map induced by the extension K Ñ L. Then JFS pf q “ JFR pf qS. Proof. We may assume that f “ g n for an irreducible g P R by Proposition 4.14. Let e S e “ K 1{p rx1 , . . . , xn s. Let h1 , . . . , hℓ denote a set of generators for JFS pf q. In this case, pJFS pf qrps : f p´1 q “ JFS pf q. Then there exist ci,j P S such that ÿ f p´1hj “ ci,j hpj . Ť Since S “ e S e , there exists N such that ci,j , hj P S N . Let I Ă RN be the ideal generated by h1 , . . . , hℓ . We note that IS “ JFS pf q; moreover, JFS pf q X S N “ I because S e Ñ S splits for every e P N. We claim that pI rps : f p´1 q “ I. We have that f p´1hℓ P I rps by our choice of N and so I Ă pI rps : f p´1q. If g P pI rps : f p´1q, then f p´1 g P I rps Ă JFS pf qrps and g P JFS pf q X S N “ I. As in the proof of Lemma 4.22, pJFS pf q{f Sq X pS N {f S N q ‰ 0 and then JFS pf q X S N “ I ‰ f S. Therefore, JFS N pf q Ă I by Proposition 4.5. Hence, JFS N pf qS Ă IS “ JFS pf q Ă JFS N pf qS, and the result follows because JFR pf qS “ pJFR pf qS N qS “ JFS N pf qS.  Theorem 4.25. Let R “ Krx1 , . . . , xn s, where K is an F -finite field. Let L be an algebraic extension of K, S “ Lrx1 . . . , xn s, and R Ñ S the map induced by the extension K Ñ L. Then JFS pf q “ JFR pf qS. 23 Proof. It suffices to show JFR pf qS Ă JFS pf q by Proposition 4.20. Let K ˚ and L˚ denote the perfect closure of K and L respectively. Let R˚ “ K ˚ rx1 , . . . , xn s and S ˚ “ L˚ rx1 , . . . , xn s. Then, pJFR pf qSqS ˚JFR pf qS ˚ “ pJFR pf qR˚ qS ˚ “ JFR˚ pf qS ˚ “ JFS ˚ pf q “ JFS pf qS ˚ by Lemma 4.22 and 4.24. Therefore, pJFR pf qS{JFS pf qq bS S ˚ “ pJFR pf qSqS ˚ {pJFS pf qqS ˚ “ 0. Hence JFR pf qS{JFS pf q “ 0 because S ˚ is a faithfully flat S-algebra.  Example 4.26. Let R “ F3 rx, ys, and f “ x2 ` y 2 and m “ px,?yq. We have that pmrps : f p´1 q “ m. Then, JFR pf q Ă m. Let F3 ris the extension of F3 by ´1, S “ Lrx, ys and φ : R Ñ S be the inclusion given by the field extension. Then, JFS pf q “ px, yqS by Proposition 4.14 because x2 ` y 2 “ px ` iyqpx ´ iyq. Since φ is a flat extension, JFS pf q Ă JFR pf qS. Then, m “ R X JFS pf q Ă R X JFR pf qS. Hence, JF pf q “ m. Proposition 4.27. Let f P R be an irreducible element. Then, ˜ ˆ ˙¸ č ď ´` e ˘r1{pe s ¯rpe s e f p ´1 a ,f JF pf q “ : f p ´1 gcdpa,f q“1 ePN Proof. We have that minF pf q is the intersection of all nonzero D-submodules of Rf {R by Proposition 4.8. In particular, minF pf q is the intersection of all nonzero cyclic D-modules generated by elements a{f P Rf {R. Hence, č JF pf q{f “ ppD ¨ a{f q X R{f q gcdpa,f q“1 “ č gcdpa,f q“1 ˜ ď` ˘ D peq ¨ a{f X R{f ePN ¸ ˘ Ş Ť ` We have that b P JF pf q if b{f P gcdpa,f q“1 ePN D peq ¨ a{f , so, for every a P R such that gcdpa, f q “ 1, there exists an e P N such that b{f P D peq ¨ a{f. Thus, there exists φ P HomRpe pR, Rq such that e φpa{f q “ 1{f p φpf p pe e ´1 aq “ b{f ` r Therefore, after multiplying by f , we have that ˜ ˆ ˙¸ č ď ´` e ˘r1{pe s ¯rpe s e f p ´1 a ,f bP : f p ´1 gcdpa,f q“1 ePN ` e ˘ ` e e ˘rpe s because pf p ´1 aqr1{p s “ D peq f p ´1 a . On the other hand, if ˙ č ď ˆ´` e ˘r1{pe s ¯rpe s p ´1 pe ´1 f a ,f , bP :f gcdpa,f q“1 ePN 24 then for every a P R such that gcdpa, f q “ 1, there exists an e P N and φ P HomRpe pR, Rq such that e e e f p ´1 b “ φpf p ´1 aq ` f p r ´` ˘r1{pe s ¯rpe s e e e because f p ´1 aq, f “ D peq pf p ´1 aq. Therefore, after dividing by f p , we have that ˘ Ş Ť ` b{f P gcdpa,f q“1 ePN D peq ¨ a{f , and then b P JF pf q.  Theorem 4.28. Let f P R be such that R{f R is a F -pure ring. If JF pf q “ R, then R{f R is strongly F -regular. Proof. We may assume that pR, m, Kq is local because being reduced, F -pure, and F regular are local properties for R{f R. Then, f is irreducible by Proposition 4.14. Since J a such˙that gcdpa, f q “ 1 there exits an e P N such that R “ ˆF´pf q “ R, for every ´` ˘r1{pe s ¯rpe s ` pe ´1 ˘r1{pe s ¯rpe s pe ´1 e e f p ´1 a ,f f a ,f . by Lemma 4.27. Then, f p ´1 P :f ` e ˘r1{pe s e e Since f p ´1 R mrp s for every e P N by Fedder’s Criterion , R “ f p ´1 a ; otherwise, ` pe´1 ˘r1{pe s pe pe p f a , f q Ă m. Then, there exist a morphism φ : R Ñ R of R -modules such that e pe ´1 aq “ 1. Let ϕ : R{f R Ñ R{f R be the morphism defined by ϕprxsq “ rφpf p ´1 xqs. φpf We note that ϕ is a well defined morphism of pR{f Rqp -modules such that ϕprasq “ 1. Then, R{f R is a simple DpR{f Rq-module. Hence, R{f R is strongly F -regular [Smi95a, Theorem 2.2].  Remark 4.29. ‚ The result of the previous theorem is a consequence of a result of Blickle [Bli04, Corollary 4.10], as R{f R is a Gorenstein ring. However, our proof is different from the one given there. ‚ JFR pf q “ R does not imply that R{f R is F -pure. Let K “ FracpF2 rusq be the fraction field of the polynomial ring F2 rus, R “ Krrx, yss, and f “ x2 ` uy 2. Then, f is an irreducible element such that R{f R is not pure because f P px, yqr2s R. Let L “ K 1{2 , S “ Lrrx, yss and R Ñ S be the inclusion given by the extension K Ă L. Thus, f “ px ´ u1{2 yq2 in S, and then JFS pSq “ S Ă JFR pf qS. Then, R “ JFS pSq X R “ JFR pf qS X R “ JFR pf q because R Ñ S splits. Hence, JFR pf q “ R and R{f R is not F -pure. 4.2. Definition for rings essentially of finite type over an F –finite local ring. Notation 4.30. Throughout this section R denotes a ring essentially of finite type over an F –finite local ring. Let f P R, π : R Ñ R{f R be the quotient morphism. If R{f R is reduced, τf denotes the pullback of the test ideal of R{f R, π ´1 pτ pR{f Rqq. Under the hypotheses on R in Notation 4.30, there is an F -module and a D-module of Rf {R called the intersection homology LpR, R{f Rq [Bli01, Bli04]. We have that for every maximal ideal m Ă R, pRzmq´1 LpR, R{f Rq “ minFRm pf q. Definition 4.31. Let R{f R Ă Rf {R be the inclusion morphism 1 ÞÑ F -Jacobian, Jf pf q as the pullback to R of pR{f Rq X LpR, R{f Rq. rpj´1 s Lemma 4.32. Suppose that R{f R is reduced. Let I j pf q “ pτf I j`1 pf q and I j`1 pf q “ pI j pf qrps : f p´1 q. 25 : fp 1 . f j´1 ´1 We define the q. Then I j pf q Ă Proof. Since, in this case, the test ideal of R{f R commutes with localization, we may assume that R is a local ring. We have that τf {f R is the minimal root for minF pf q [Bli04, Theorem e rpe s rps 4.6]. Then, f p´1I 1 pf q “ f p´1 τf Ă τf “ I 1 pf qrp s . Thus, I 1 Ă I 2 and f p´1 I 2 Ă I1 . Moreover, I 2 {f R is also a root for minF pf q because I 2 pf q{I 1 pf q is the kernel of the map f p´1 R{I 1 pf q Ñ R{I 1 pf qrps . Inductively, we obtain that I j Ă I j`1, f r I j`1 Ă I j and that I j {f R is a root for minF pf q for every j P N and the result follows.  Ť j Proposition 4.33. Suppose that R{f R is reduced. Then, JF pf q “ j IR pf q. f p´1 Proof. We have that τf f1 is the minimal root for LpR, R{f Rq. Moreover, any ideal I j pf q Ñ I j pf qrps also generates LpR, R{f Rq as an F -module. Moreover, ď j č IR pf q “ LpR, R{f Rq R{f R “ JF pf q. j  Remark 4.34. In general, we do not have τf “ JF pf q. Let R “ Krxs, where K is any perfect field of characteristic p ą 0. Let f “ x2 . Then, τf “ xR ‰ R “ JF pf q. In addition, Example 4.45, shows another situation where τf ‰ JF pf q. Remark 4.35. If R is an F -finite local ring, then f p´1 JF pf q Ñ JF pf qrps is a generating morphism for minF pf q because in this case minF pf q “ LpR, R{f Rq. Corollary 4.36. Let S be a ring that is as in Notation 4.1 and as in Notation 4.30. Let f P S. Let J denote the F -Jacobian ideal of f as in Definition 4.12 and let J 1 the F -Jacobian ideal of f as in Definition 4.31. Then, J “ J 1 . Proof. We have that in both contexts the F -Jacobian ideal commutes with localization. We rps f p´1 may assume that R is a regular local F -finite ring. As J2 “ pJ2 : f p´1 q and J2 {f R Ñ rps J2 {f p R is a root for minF pf q by Lemma 4.35, we have that J1 “ J2 .  Remark 4.37. As for every maximal ideal m Ă R, Rm is as in Notation 4.1, we have that ‚ f n JF pf q Ă JF pf n q, e e ‚ JF pf p q “ JF pf qrp s , and ‚ if gcdpf, gq “ 1, JF pf q “ f JF pgq ` gJF pf q. because those properties localize. Proposition 4.38. Suppose that pR, m, Kq is local. Let pS, η, Lq denote a regular F -finite ring. Let R Ñ S be a flat local morphism such that the closed fiber S{mS is regular and L{K is separable. Then, JFS pf q “ JFR pf qS. Proof. It suffices to proof that minFR pf qS “ minFS pf q. We can assume without loss of p and JF pf q “ JF pf qSp generalization tat R{f R is reduced. We have that JFRp pf q “ JFR pf qR S p S p Ñ Sp is still a by Proposition 4.21. In addition, the induced morphism in the completion R 26 flat local morphism. Since JFS pf q Ă JFR pf qS and JFSp pf q Ă JFRp pf qSp by Proposition 4.20, p F pf q “ pJF pf qS{JF pf qq bS S. p Therefore, we can assume that R and S are JFRp pf qS{J R S p S complete. We note that R{f R Ñ S{f S is again a flat local morphism such that the closed fiber S{mS is regular L{K is separable by flat base change. Then S{f S is reduced and τ pR{f RqS “ τ pS{f Sq [HH94a, Theorem 7.2], and so IFj S pf q “ IFj R pf qS. Hence, JFS pf q “ JFR pf qS by Proposition 4.33.  Corollary 4.39. Suppose that R is a Zh -graded ring. Let f P R be a homogeneous element. Then, JF pf q is a homogeneous ideal. Proof. It suffices to proof that minpf q is a Zh -graded submodule of Rf {R. We can assume that R{f R is reduced. We have that τ pR{f Rq is a homogeneous ideal [HH94b, Theorem 4.2]. This means that IRj pf q is a homogeneous ideal for every j. Therefore, JF pf q is homogeneous and that minF pf q Zn -graded submodule of Rf {R.  Corollary 4.40. Let S be a ring that is as in Notation 4.1 or as in Notation 4.30. Let f P S be such that R{f R is reduced. Then, VpJF pf qq Ă SingF pS{f Sq. Moreover, if S{f S is an F -pure ring, then VpJF pf qq “ SingF pS{f Sq. Proof. For every prime ideal P P VpJF pf qq, JFSP pf q ‰ SP . Since SP is as in Notation 4.30, we have that τ pSP {f SP q Ă JFSP pf q Ă P SP . Then, SP is not F -regular and then P P SingF pS{f Sq. Now, we suppose that S{f S is F -pure. For every prime ideal P P SingF pS{f Sq, SP {f SP is not F -regular. Then, JFRP pf q ‰ RP by Theorem 4.28. Then, P P VpJF pf qq.  Lemma 4.41. Let S be a ring that is as in Notation 4.1 and as in Notation 4.30. Let f P S be an element and Q Ă S be a prime ideal. If SQ {f SQ is F -pure, then SQ {JFSQ pf q is F -pure. Proof. We may replace S by SQ . Since S{f S is F -pure, we have that f p´1 R Qrps by Fedder’s Criterion. We have that f p´1 P pJF pf qrps : JF pf qq, and so pJF pf qrps : JF pf qq Ć Qrps . Therefore, S{JF pf q is F -pure.  Corollary 4.42. Let f P R. If R{f R is an F -pure ring, then JF pf q “ τf . a a Proof. We have that JF pf q “ π ´1 pR{f Rq by Corollary 4.40 because SingF pR{f Rq “ Vpτ pR{f Rqq in this case. Since R{JF pf q is F -pure by Lemma 4.41, JF pf q is a radical ideal. In addition, τ pR{f Rq is a radical ideal [FW89, Proposition 2.5]. Hence, JF pf q “ τf .  4.3. Examples. Proposition 4.43. Let f P R be an element with an isolated singularity at the maximal ideal m. If Rm {f Rm is F -pure, then # R if R{f R is F ´ regular JF pf q “ m otherwise Proof. Since R{f R has an isolated singularity a at m, we have that JF pf qRP “ RP for every prime ideal different from m. Then, m Ă JF pf q. If Rm {f Rm is F -regular, then R{f R is F -regular, and so JF pRq “ R by Theorem 4.28. 27 a If Rm {f Rm is not F -regular, then JF pRq ‰ R by Theorem 4.28. Then, m “ JF pf q. Since Rm {f Rm is F -pure, we have that Rm {JF pf qRm is F -pure by Lemma 4.41. Then, Rm {JF pf qRm is a reduced ring. Hence, JF pf q “ m.  Example 4.44. Let K is an F -finite field. Let E be an elliptic curve over K. We choose a closed immersion of E in P2K and set R “ Krx, y, zs, the completed homogeneous co-ordinate ring of P2K . We take f P R as the cubic form defining E. We know that f has an isolated singularity at m “ px, y, zqR. If the elliptic curve is ordinary, then R{f R is F -pure [Har77, Proposition 4.21] [Bha12, Theorem 2.1] [BS]. We know that R{f R is never an F -regular ring [HH94b, Discussion 7.3bpbq, Theorem 7.12]. Then, JF pf q “ m by Proposition 4.43. Example 4.45. Let R “ Krx, y, zs, where is an F -finite field of characteristic p ą 3. Let f “ x3 ` y 3 ` z 3 P R, and π : R Ñ R{f R be the quotient morphism and m “ px, y, zqR. We have that τf “ m [Smi95b, Example 6.3]. Then, m Ă JF pf q by Proposition 4.33. We have that R{f R is F -pure if and only if p ” 1 mod 3. We have that pmrps : f p´1 q “ m if p ” 1 mod 3, and pmrps : f p´1 q “ R if p ” 1 mod 2. Hence, # R p ” 2 mod 3 JF pf q “ m p ” 1 mod 3. Example 4.46. Let R “ Krx1 , . . . , xn s, where K is an F –finite field of characteristic p ą 0. Let f “ a1 xd11 ` . . .` an xdnn , be such that a‰ 0. We have that R{f R has an isolated singularity at the maximal ideal m “ px1 , . . . , xn q. If d11 ` . . . ` d1n “ 1 and pp ´ 1q{d1 is an integer for every i, then R{f R is F -pure for p " 0 [Her12, Theorem 3.1] and not F -regular [Gla96, Theorem 3.1] because f p´1 is congruent to e e cpx1 ¨ ¨ ¨ xn qp ´1 module mrp s for a nonzero element c P K. Hence, JF pf q “ R for p " 0 by Proposition 4.43. Remark 4.47. Let R “ Krx1 , . . . , xn s be a polynomial ring and f P R be such that R{f R is reduced. We can obtain JF pf q from τ pR{f Rq by Proposition 4.33. In the case where n ą 3, f “ xd1 ` . . . xdn and d is not divided by the characteristic of K, there is an algorithm to compute the test ideal of R{f R [McD03]. Therefore, there is an algorithm to compute JF pf q. Example 4.48. Let R “ Krx1 , . . . , xn s, where K is a field of characteristic p ą 0. Let f “ xd1 ` . . . ` xdn . This examples are based in computations done by McDermott [McD03, Example 11, 12 and 13]. If p “ 2, n “ 5 and d “ 5, τf “ px2i xj q1ďi,jď5. r2s r4s Then, px21 , x22 , x23 , x24 , x25 , x1 x2 x3 x4 x5 qR “ pτf : f q and R “ pτf : f 3 q. Hence, JF pf q “ R. If p “ 3, n “ 4 and d “ 7, τf “ px2i x2j q1ďi,jď4. r3s Then R “ pτf : f 2 q and JF pf q “ R. If p “ 7, n “ 5 and d “ 4, τf “ px1 , . . . , x5 qR. r7s Then R “ pτf : f 6 q and JF pf q “ R. 28 5. Further consequences and relations Using ideas and techniques developed in the previous sections, we obtain relations among test ideals, generalized test ideals and generalized Lyubeznik numbers for hypersurfaces. Notation 5.1. Throughout this section R denotes a ring essentially of finite type over an F – finite local ring. Let f P R denote an element such that R{f R is reduced. Let π : R Ñ R{f R be the quotient morphism. τf denotes π ´1 pτ pR{f Rqq, the pullback of the test ideal of R{f R. Remark 5.2. We have that τ pf 1´ǫ q f1 is the minimal root for Rf as an F -module. Then f q´1 τ pf 1´ǫ q{f R Ñ τ pf 1´ǫ qrqs {f q R generates Rf {R (see Proposition 3.17 or [Bli08, Proposition 3.5]. We have that τ pR{f Rq “ τf {f is the minimal root of minF pf q [Bli04, Proposition 4.5 and Theorem 4.6]. Therefore, τf f1 Ă τ pf 1´ǫ q f1 Ă R1 {R. Then, τf Ă τ pf 1´ǫ q. This containment can also be obtained using F -adjunction [Tak08, Sch09]. Suppose that R is a finitely generated polynomial ring over an F -finite field and f is a polynomial. Since the Jacobian ideal of f is contained in τf when R{f R is reduced [HH99], the previous containment of test ideals gives implies Jpf q Ă τ pf 1´ǫ q. The containment of the Jacobian ideal in the test ideal τ pf 1´ǫ q was proved using different techniques [KLZ11] and still holds when R{f R is not reduced. We assume that pR, m, Kq is a local ring and F -finite. Vassilev proved that if I Ă R is an rps ideal and τI is the pullback of the test ideal of R{I, then pI rps : Iq Ă pτI : τI q [Vas98]. In particular, if R{I is F -pure, then R{τI is also F -pure. Using this criteria, she showed that if R{I is F -pure, there is a sequence of ideals (5.2.1) I “ τ0 Ă τ1 Ă . . . such that τi`1 is the pull back of the test ideal of R{τi . The sequence in 5.2.1 stabilizes when τi “ R, because if τi ‰ 0, R{τi , then is an F -finite reduced local ring and its test ideal is not zero [HH94a, Theorem 6.1]. We apply this ideas to bound the length of M1 {N1 “ Rf {R as an F -module. Lemma 5.3. Suppose that pR, m, Kq is a local ring and F -finite and R{f R is F -pure. Let 0 Ă f “ τ0 Ă τ1 Ă . . . Ă τℓ “ R be the sequence of pullback of test ideals for f R defined in 5.2.1. If τi`1 ‰ τi , then Nτi`1 ‰ Nτi . rps Proof. We have that f p´1 P pf p : f q Ă pτj : τj q for every j. We will proceed by contradiction. e rpe s Suppose that τi`1 ‰ τi , and Nτi`1 “ Nτi . Then there exists e such that f p ´1 τi`1 Ă τi by Lemma 3.12. Since R{τj is F -pure for every j, we have that both τi and τi`1 are radical ideals. Therefore, we can choose a minimal prime Q of τi such that pτi`1 qQ “ RQ . Hence e e e rpe s f p ´1 pτi`1 qQ “ f p ´1 RQ Ă pτi qQ Ă pQRQ qrp s , and we obtain a contradiction because RQ {f RQ is F -pure  29 Proposition 5.4. Suppose that pR, m, Kq is local and R{f R is F -pure. If 0 Ă f R “ τ0 Ă τ1 Ă . . . Ă τℓ “ R is the sequence of ideals for f R defined in 5.2.1, then ℓ ď lengthF ´mod Rf {R Proof. We have that every pullback of test ideal τi defines a different F -module by Lemma 5.3, which proves the proposition.  The Lyubeznik numbers are invariants of a local ring of equal characteristic [Lyu93, Theorem/Definition 4.1]. The first author and Witt defined a generalization these invariants using the theory of D-modules and local cohomology [NBW12, Definition 4.3]. We only recall the definition of hypersurfaces; however, the generalized Lyubeznik numbers are defined for any local ring of equal characteristic and a sequence of integers and ideals. Suppose that R “ Krrx1 , . . . , xn ss Let d “ dimpR{f Rq “ n ´ 1 and L be a coefficient field of R{f R. We define the generalized Lyubeznik λd0 pR{f R; Lq by lengthDpR,Lq Rf {R. This number is well defined and depends only on R{f R and L. Corollary 5.5. Suppose that R “ Krrx1 , . . . , xn ss, where K is an F -finite field, and that R{f R is F -pure. Let L be a coefficient field of R{f R. If 0 Ă f R “ τ0 Ă τ1 Ă . . . Ă τℓ “ R is the sequence of ideals in 5.4, then dimpR{f Rq Proof. We have that ℓ ď λ0 pR{f R; Lq. dimpR{f Rq ℓ ď lengthF ´mod Rf {R ď lengthDpR,Zq Rf {R ď lengthDpR,Lq Rf {R “ λ0 pR{f R; Lq.  dimpR{f Rq λ0 pR{f R; Lq Remark 5.6. If R{f R is F -pure and “ 1, then R{f R is F -regular dimpR{f Rq [Bli04, NBW12]. In addition, if R{f R is F -pure and K perfect, then λ0 pR{f R; Lq “ 1 if and only if R{f R is F -regular [Bli04, NBW12]. Then, Corollary 5.5 is telling us that for dimpR{f Rq F -pure hypersurfaces λ0 pR{f R; Lq measures how far is R{f R from being F -regular. Proposition 5.7. Suppose that pR, m, Kq is local and F -finite, and that R{f R is reduced and lengthR τ pf 1´ǫ q{τf is finite. Let f “ f1 . . . fℓ be a factorization of f into irreducible elements. Then, lengthF ´mod Rf {R ď lengthR pτ pf 1´ǫ q{τf q ` ℓ Proof. We have that minF pf q “ minF pf q ‘ . . .‘ minF pfℓ q. In addition, the length of minF pf q as a F -module is ℓ. We recall that τ pf 1´ǫ q f1 is a root for Rf {R by Proposition 3.18 and τf f1 is the minimal root for minF pf q. Therefore, for every F -submodule N Ă Rf {R that contains minF pf q, NXτ pf 1´ǫ q f1 is a root for N and it must contain τf f1 . Then for every strict ascending chain of F -modules minF pf q “ N0 Ă N1 Ă . . . Ă Nt “ Rf {R, t ď lengthR τ pf 1´ǫ q{τf . Hence lengthF ´mod Rf {R ď lengthR pτ pf 1´ǫ q{τf q ` ℓ.  Proof of Theorem 1.2. This is consequence of Propositions 5.4 and 5.7 and Corollary 5.5.  30 Acknowledgments We thank Josep Àlvarez Montaner, Angélica Benito, Daniel J. Hernández, Mel Hochster, Mircea Mustaţă, Emily E. Witt and Wenliang Zhang for insightful mathematical conversations related to this work. We thank Manuel Blickle, Karl schwede and Kevin Tucker for poitnting out missed references. We also thank Alexis Cook for her careful reading of this manuscript. The first author thanks the National Council of Science and Technology of Mexico (CONACyT) for its support through grant 210916. References [ÀMBL05] Josep Àlvarez Montaner, Manuel Blickle, and Gennady Lyubeznik. Generators of D-modules in positive characteristic. Math. Res. Lett., 12(4):459–473, 2005. [BFS12] Angélica Benito, Eleonore Faber, and Karen Smith. Measuring singularities with Frobenius: the basics. Springer, 2012. [Bha12] Bargav Bhatt. F –pure threshold of an elliptic curve. Preprint, 2012. [Bli01] Manuel Blicle. The intersection of homology D-module in finite characteristic. PhD thesis, University of Michigan, 2001. [Bli04] Manuel Blickle. The intersection homology D-module in finite characteristic. Math. Ann., 328(3):425–450, 2004. [Bli08] Manuel Blickle. Minimal γ-sheaves. Algebra Number Theory, 2(3):347–368, 2008. [BM10] Holger Brenner and Paul Monsky. Tight closure does not commute with localization. Ann. of Math. (2), 171(1):571–588, 2010. [BMS08] Manuel Blickle, Mircea Mustaţǎ, and Karen E. Smith. Discreteness and rationality of F thresholds. Michigan Math. J., 57:43–61, 2008. Special volume in honor of Melvin Hochster. [BMS09] Manuel Blickle, Mircea Mustaţă, and Karen E. Smith. F -thresholds of hypersurfaces. Trans. Amer. Math. Soc., 361(12):6549–6565, 2009. [BS] Bhargav Bhatt and Anurag K. Singh. F -thresholds of Calabi-Yau hypersurfaces. preprint. [FA12] Eleonore Faber and Paolo Aluffi. Splayed divisors and their chern classes. Preprint, 2012. [Fab13] Eleonore Faber. Towards transversality of singular varieties: splayed divisors. Publ. RIMS, To appear, 2013. [Fed87] Richard Fedder. F -purity and rational singularity in graded complete intersection rings. Trans. Amer. Math. Soc., 301(1):47–62, 1987. [FW89] Richard Fedder and Kei-ichi Watanabe. A characterization of F -regularity in terms of F -purity. In Commutative algebra (Berkeley, CA, 1987), volume 15 of Math. Sci. Res. Inst. Publ., pages 227–245. Springer, New York, 1989. [Gla96] Donna Glassbrenner. Strong F -regularity in images of regular rings. Proc. Amer. Math. Soc., 124(2):345–353, 1996. [Har77] Robin Hartshorne. Algebraic geometry. Springer-Verlag, New York, 1977. Graduate Texts in Mathematics, No. 52. [Her12] Daniel J. Hernández. F -invariants of diagonal hypersurfaces. Preprint, 2012. [HH90] Melvin Hochster and Craig Huneke. Tight closure, invariant theory, and the Briançon-Skoda theorem. J. Amer. Math. Soc., 3(1):31–116, 1990. [HH94a] Melvin Hochster and Craig Huneke. F -regularity, test elements, and smooth base change. Trans. Amer. Math. Soc., 346(1):1–62, 1994. [HH94b] Melvin Hochster and Craig Huneke. Tight closure of parameter ideals and splitting in modulefinite extensions. J. Algebraic Geom., 3(4):599–670, 1994. [HH99] Melvin Hochster and Craig Huneke. Tight closure in equal characteristic zero. 1999. [Hoc07] Melvin Hochster. Some finiteness properties of Lyubeznik’s F -modules. In Algebra, geometry and their interactions, volume 448 of Contemp. Math., pages 119–127. Amer. Math. Soc., Providence, RI, 2007. [HY03] Nobuo Hara and Ken-Ichi Yoshida. A generalization of tight closure and multiplier ideals. Trans. Amer. Math. Soc., 355(8):3143–3174 (electronic), 2003. 31 [KLZ11] [LS01] [Lyu93] [Lyu97] [Mat89] [McD03] [NBW12] [PS73] [Sch09] [Smi94] [Smi95a] [Smi95b] [Tak08] [Vas98] [Yek92] Mordechai Katzman, Gennady Lyubeznik, and Wenliang Zhang. An upper bound on the number of F -jumping coefficients of a principal ideal. Proc. Amer. Math. Soc., 139(12):4193–4197, 2011. Gennady Lyubeznik and Karen E. Smith. On the commutation of the test ideal with localization and completion. Trans. Amer. Math. Soc., 353(8):3149–3180 (electronic), 2001. Gennady Lyubeznik. Finiteness properties of local cohomology modules (an application of Dmodules to commutative algebra). Invent. Math., 113(1):41–55, 1993. Gennady Lyubeznik. F -modules: applications to local cohomology and D-modules in characteristic p ą 0. J. Reine Angew. Math., 491:65–130, 1997. Hideyuki Matsumura. Commutative ring theory, volume 8 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, second edition, 1989. Translated from the Japanese by M. Reid. Moira A. McDermott. Test ideals in diagonal hypersurface rings. II. J. Algebra, 264(1):296–304, 2003. Luis Núñez-Betancourt and Emily E. Witt. Generalized Lyubeznik numbers. Preprint, 2012. C. Peskine and L. Szpiro. Dimension projective finie et cohomologie locale. Applications à la démonstration de conjectures de M. Auslander, H. Bass et A. Grothendieck. Inst. Hautes Études Sci. Publ. Math., (42):47–119, 1973. Karl Schwede. F -adjunction. Algebra Number Theory, 3(8):907–950, 2009. Karen E. Smith. Tight closure of parameter ideals. Invent. Math., 115(1):41–60, 1994. Karen E. Smith. The D-module structure of F -split rings. Math. Res. Lett., 2(4):377–386, 1995. Karen E. Smith. Test ideals in local rings. Trans. Amer. Math. Soc., 347(9):3453–3472, 1995. Shunsuke Takagi. A characteristic p analogue of plt singularities and adjoint ideals. Math. Z., 259(2):321–341, 2008. Janet Cowden Vassilev. Test ideals in quotients of F -finite regular local rings. Trans. Amer. Math. Soc., 350(10):4041–4051, 1998. Amnon Yekutieli. An explicit construction of the Grothendieck residue complex. Astérisque, (208):127, 1992. With an appendix by Pramathanath Sastry. Department of Mathematics, University of Michigan, Ann Arbor, MI 48109-1043, USA. Email address: [email protected] Department of Mathematics, University of Michigan, Ann Arbor, MI 48109-1043, USA. Email address: [email protected] 32
0math.AC
1 Distributed Information-Theoretic Clustering Georg Pichler, Student Member, IEEE, Pablo Piantanida, Senior Member, IEEE, and Gerald Matz, Senior Member, IEEE arXiv:1602.04605v4 [cs.IT] 17 Nov 2017 Abstract We study a novel multi-terminal source coding setup motivated by the biclustering problem. Two separate n encoders observe two i.i.d. sources Xn and Zn , respectively. The  goal is to find rate-limited encodings f (x ) n n n and g(z ) that maximize the mutual information I f (X ); g(Z ) /n. We provide inner and outer bounds on the achievable region and discuss connections of this problem with hypothesis testing against independence, pattern recognition, the information bottleneck method, and lossy source coding with logarithmic-loss distortion. Improving previous cardinality bounds allows us to thoroughly study the special case of a binary symmetric source and to quantify the gap between the inner and the outer bound in this special case. Furthermore, we generalize our results to the case of more than two i.i.d. sources. As a special case of this generalization we investigate a multiple description (MD) extension of the CEO problem with log-loss distortion. Surprisingly, this MD-CEO problem permits a tight single-letter characterization of the achievable region. Index Terms Source coding; Mutual information; Information bottleneck; CEO problem; Logarithmic loss. I. I NTRODUCTION The recent decades witnessed a rapid proliferation of digital data in a myriad of repositories such as internet fora, blogs, web applications, news, emails and the social media bandwagon. A significant part of this data is unstructured and it is thus hard to extract relevant information. This results in a growing need for a fundamental understanding and efficient methods for analyzing data and discovering valuable and relevant knowledge from it in the form of structured information. When specifying certain hidden (unobserved) features of interest, the problem then consists of extracting those relevant features from a measurement, while neglecting other, irrelevant features. Formulating this idea in terms of lossy source compression [4], we can quantify the complexity of the encoded data via its rate and the quality via the information provided about specific (unobserved) features. In this paper, we introduce and study the distributed clustering problem from a formal information-theoretic perspective. Given correlated samples Xn1 , Xn2 , . . . , XnK observed at different encoders, the aim is to extract a description from each sample such that the descriptions are maximally informative about each other. In other words, the k th encoder tries to find a (lossy) description Wk = fk (Xnk ) of its observation Xnk subject to a complexity requirement (coding rate) such that the mutual information between two disjoint subsets of descriptions (Wk )k∈A and (Wk )k∈B is maximized. Our goal is to characterize the optimal tradeoff between relevance (mutual information between the descriptions) and complexity (encoding rate). A. Distributed Clustering Biclustering (or co-clustering) was first explicitly considered by Hartigan [5] in 1972. A historical overview of biclustering including additional background can be found in [6, Section 3.2.4]. In general, given an N × M data matrix (anm ), the goal of a biclustering algorithm [7] is to find partitions Bk ⊆ {1, . . . , N } and Cl ⊆ {1, . . . , M }, k = 1 . . . K , l = 1 . . . L such that all the elements of the “biclusters” (anm )n∈Bk ,m∈Cl are homogeneous in a certain sense. The measure of homogeneity of the biclusters depends on the specific application. The method received Parts of the material in this paper were previously presented in [1]–[3]. G. Pichler and G. Matz are with the Institute of Telecommunications, TU Wien, Vienna, Austria. P. Piantanida is with Laboratoire des Signaux et Systèmes (L2S, UMR8506), CentraleSupélec-CNRS-Université Paris-Sud, Gif-sur-Yvette, France. Part of this work was supported by the FP7 Network of Excellence in Wireless COMmunications NEWCOM# and by the WWTF under grants ICT12-054 (TINCOIN) and ICT15-119 (Co3-iGraB). 2 renewed attention when Cheng and Church [8] applied it to gene expression data. Many biclustering algorithms have been developed since (e. g., see [9] and references therein). An introductory overview of clustering algorithms for gene expression data can be found in the lecture notes [10]. The information bottleneck (IB) method, which can be viewed as a uni-directional information-theoretic variant of biclustering, was successfully applied to gene expression data as well [11]. In 2003, Dhillon et. al. [12] adopted an information-theoretic approach to biclustering. They used mutual information to characterize the quality of a biclustering. Specifically, for the special case when the underlying matrix represents the joint probability distribution of two discrete random variables X and Y, i. e., anm = P{X = n, Y = m}, their goal was to find  clustering functions f : {1, . . . , N } → {1, . . . , K} and g : {1, . . . , M } → {1, . . . , L} that maximize I f (X); g(Y) for specific K and L. In the present work, we investigate an extension of the approach of Dhillon et. al. [12], where we consider stationary, memoryless processes and N , K , M , and L scale exponentially in the blocklength. The resulting problem is addressed using information-theoretic tools. The aim of the present paper is to characterize the achievable region of this information-theoretic biclustering problem and connect it to known problems in network information theory. Furthermore, we provide an extension to more than two stationary, memoryless sources. This distributed information-theoretic clustering problem offers a formidable mathematical complexity. It is fundamentally different from “classical” distributed source coding problems like distributed lossy compression [13, Chapter 12]. Usually, one aims at reducing redundant information, i. e., information that is transmitted by multiple encoders, as much as possible, while still guaranteeing correct decoding. By contrast, in the clustering problem we are interested in maximizing this very redundancy. In this sense, the clustering problem is complementary to conventional distributed source coding. We also point out that the extension of biclustering to multiple variables contains the Körner-Marton problem [14] as a special case, which implies that in general Berger-Tung coding is suboptimal. B. Contributions We first study the case of two sources in Section II. This problem turns out to be closely related to a number of information-theoretic problems, including hypothesis testing against independence [15], pattern recognition [16], the information bottleneck method [17] and lossy source coding with logarithmic-loss distortion [18]. We study these connections in detail in Section II-B (Theorem 5, Corollary 6, and Proposition 8) and exploit them to provide an inner bound on the achievable region (Theorem 11). The outer bound (Theorem 9) follows from standard information-theoretic manipulations. In Section II-E we extensively study the doubly symmetric binary source as a special case. In order to perform this analysis, we require stronger cardinality bounds (Propositions 10 and 13) than the ones usually obtained using the convex cover method [13, Appendix C]. We are able to improve upon the state-of-the-art cardinality bounding techniques by combining the convex cover method with the perturbation method [13, Appendix C] and leveraging ideas similar to [19], which allow us to restrict our attention to the extreme points of the achievable region. The resulting bounds, proved in Appendix A2, allow for the us binary auxiliary random variables in the case of binary sources. We subsequently show that [16, Conjecture 1] does not hold (Propositions 20 and 21). Based on a weaker conjecture (Conjecture 19), we then argue that there is indeed a gap between the outer and the inner bound for a doubly symmetric binary source (Conjecture 18). In Section III we extend the inner and the outer bound to the case of multiple sources (Theorems 24 and 25) by incorporating a binning strategy into the achievability part of the proof. In Section III-B we investigate the chief executive officer (CEO) problem under a mutual information constraint, a special case of the information-theoretic clustering problem with multiple sources. We show that it is equivalent to classical multiterminal lossy source coding under logarithmic loss distortion (Lemma 32). By leveraging this equivalence, we obtain tight bounds for a special case (Lemma 33) using results from [18]. In this problem, the CEO relies on the full set of descriptions obtained from all agents. If an agent fails to deliver a description, the CEO’s estimate may be severely degraded. We thus propose an extension of the CEO problem that takes into account the possibility that descriptions are not delivered by using multiple description (MD) coding [20] (see [21] for applications). In Section III-D we study this MD-CEO problem. Using tools from submodularity theory and convex analysis, we are able to provide a complete single-letter characterization of the resulting achievable region (Theorem 37), which has the remarkable feature that it allows to exploit rate which is in general insufficient for successful typicality decoding. 3 C. Notation and Conventions 1) Non-Standard Conventions: We will use the shorthand [l : k] := {l, l + 1, . . . , k − 1, k}. For convenience, we define the sets K := [1 : K], J := [1 : J], and L := [1 : L] for K, J, L ∈ N. Furthermore, let Ω denote the set of all pairs (A, B), where A, B ⊂ K are nonempty and disjoint. Note that Ω contains 3K − 2K+1 + 1 different pairs (A, B). We also define Π as the set of all pairs (A, B), where A ⊆ J and B ⊆ L are nonempty. Hence, the set Π contains 2J+L − 2J − 2L + 1 elements. For a total order < on a set E (cf. [22, Definition 1.5]) and e ∈ E we will use the notation =e := {e0 ∈ E : e0 = e} and accordingly for w, < and v. e. g., given the total order < on {1, 2, 3} with 3 < 1 < 2, we have =3 = {1, 2}, =1 = {2} and =2 = ∅. 2) Standard Conventions: We use the notation A, conv(A), and |A| for the topological closure, the convex hull, and the cardinality of a set A, respectively. The superscript Ac is used to denote the complement of a set (or event) A. Let 1A denote the indicator function of a set (or event) A. When there is no possibility of confusion we identify singleton set with its element, e. g., we write {1, 2, 3} \ 1 = {2, 3}. Let R+ be the set of non-negative reals and R− the set of non-positive reals. We denote random quantities and their realizations by capital, sans-serif and lowercase letters, respectively. Furthermore, vectors are indicated by bold-face type and have length n, if not otherwise specified. Random variables are assumed to be supported on finite sets. We use the same letter for the random variable and for its support set, e. g., Y takes values in Y and X3 takes values in X3 . Given a random variable X, we write pX ∈ P(X ) for its probability mass function (pmf), where P(X ) is the set of all pmfs on X . We use the notation X ∼ p to indicate that X is distributed according to p . The notation X ∼ B(p) and X ∼ U(X ) is used to denote a Bernoulli distribution with parameter p and a uniform distribution, respectively. We use E [X] and P{A} for the expectation of the random variable X and the probability of an event A, respectively. Subscripts indicate parts of vectors, e. g., xA := (xi )i∈A for a vector x = (x1 , x2 , . . . , xn ) and A ⊆ [1 : n]. We further use the common notation xji := x{i,...,j} , xj := xj1 . If a vector is already carrying a subscript, it will be separated by a comma, e. g., x53,1 = (x3 )51 = (x3 )5 . Let 0 denote the all-zeros vector and ei = (ei,1 , ei,2 , . . . , ei,n ) ∈ Rn the ith canonical base vector, i. e., ei,j = 1i (j). Additionally we use subscript sets to denote tuples of real values and their components, K K+1 e. g., xK ∈ RK or xΩ ∈ R3 −2 +1 . Naturally, slices of tuples are indexed by subsets, e. g., xA for a set A ⊆ K is a slice of xK . This notation extends naturally to tuples of vectors, where the subscript indices are separated by a comma, e. g., for xK ∈ RnK , we have xkA,l = (xA )kl ∈ R(k−l+1)|A| if A ⊆ K. We use the notation of [23, Chapter 2] for information-theoretic quantities. In particular, given random variables (X, Y, Z) and pmfs p and q , H(X), H(X|Y), I(X; Y), I(X; Y|Z), and D(pkq) denote entropy, conditional entropy, mutual information, conditional mutual information, and Kullback-Leibler divergence, respectively. All logarithms in this paper are to base e and therefore all information theoretic quantities are measured in nats. The notation h2 (p) := −p log p − (1 − p) log(1 − p) is used for the binary entropy function, a ∗ b := a(1 − b) + (1 − a)b is the binary convolution operation and the symbol ⊕ denotes binary addition. The notation X −◦− Y −◦− Z indicates that X, Y, and Z form a Markov chain in this order and X ⊥ Y denotes that X and Y are independent random variables. When generating codebooks we will assume that the codebook size is an integer to keep the notation simple. We will use superscript to indicate that a (42) relation follows from a specific equation, e. g., the inequality a ≤ b follows from equation (42). Our achievability proofs are based on the notion of robust typicality [24], also used in [15]. We will adopt the usual notation for types and typical sequences and make use of the δ -convention [25, Convention 2.11]. For convenience, the necessary notation and relevant results are summarized in Appendix C. II. I NFORMATION -T HEORETIC B ICLUSTERING A. Problem Statement In this section we will introduce the information-theoretic biclustering problem (or biclustering problem for short) with two sources and provide bounds on its achievable region. A schematic overview of the problem is presented in Figure 1. Let (X, Z) be two random variables. The random vectors (X, Z) consist of n i.i.d. copies of (X, Z). Given a block length n ∈ N and coding rates R1 , R2 ∈ R+ , an (n, R1 , R2 )-code for (X, Z) consists of two functions f : X n → M1 and g : Z n → M2 such that the finite sets Mk satisfy log |Mk | ≤ nRk , k ∈ {1, 2}. Thus, the coding rates R1 and R2 limit the complexity of the encoders. Definition 1. For an (n, R1 , R2 )-code (f, g), we define the co-information of f and g as  1 Θ(f ; g) := I f (X); g(Z) . n (1) 4 X Enc. 1 (rate R1 ) f (X) nµ ≤ I f (X); g(Z) Z Enc. 2 (rate R2 )  g(Z) Figure 1: Biclustering of two memoryless sources. This co-information serves as a measure of the mutual relevance of the two encodings f (X) and g(Z). In contrast to rate-distortion theory, we do not require a specific distortion measure; rather, we quantify the quality of a code in pure information-theoretic terms, namely via mutual information. The idea is to find functions f and g that extract a compressed version of the common randomness in the observed data X and Z. Definition 2. A triple (µ, R1 , R2 ) is achievable if for some n ∈ N there exists an (n, R1 , R2 )-code (f, g) such that Θ(f ; g) ≥ µ. (2) The achievable region R is defined as the closure of the set R of achievable triples. Remark 1. Note that a standard time-sharing argument shows that R is a convex set (cf. [13, Section 4.4]). We also point out that stochastic encodings cannot enlarge the achievable region as any stochastic encoding can be represented as the convex combination of deterministic encodings and R is convex. B. Related Works The biclustering problem with two sources turns out to be connected to a hypothesis testing problem and a pattern recognition problem. In this section we will clarify these connections explicitly, using the “multi-letter” region R∗ . Definition 3. Let R∗ be the set of triples (µ, R1 , R2 ) such that there exist n ∈ N and random variables U, V satisfying U −◦− X −◦− Z −◦− V and nR1 ≥ I(U; X), (3) nµ ≤ I(U; V). (5) nR2 ≥ I(V; Z), (4) We will now showcase the connection between the biclustering problem and several other information-theoretic problems. These equivalences will provide us with the achievability of R∗ . 1) Hypothesis Testing (HT): Consider the hypothesis testing problem with data compression when testing against independence, which was studied in [15, Section 6]. For completeness sake we briefly describe the problem setup. Given the potentially dependent sources (X, Z), define the independent random variables X ∼ pX and Z ∼ pZ . Definition 4. An (n, R1 , R2 ) hypothesis test consists of an (n, R1 , R2 )-code (fn , gn ) for (X, Z) and a set An ⊆ M1 × M2 , where M1 and M2 are the ranges of fn and gn , respectively. The type I and type II error probabilities of (fn , gn , An ) are defined as   αn := P fn (X), gn (Z) ∈ An , (6)   βn := P fn (X), gn (Z) ∈ / An , (7) respectively. A triple (µ, R1 , R2 ) is HT-achievable if, for every ε > 0, there is a sequence of (n, R1 , R2 ) hypothesis tests (fn , gn , An ), n ∈ N such that lim αn ≤ ε, n→∞ (8) 5 Let RHT 1 lim − log βn ≥ µ. n→∞ n denote the set of all HT-achievable triples. (9) Theorem 5. RHT = R∗ . Proof. Assume (µ, R1 , R2 ) ∈ RHT . For ε > 0, pick an (n, R1 , R2 ) hypothesis test (fn , gn , An ) such that αn ≤ ε and log βn ≤ −n(µ − ε). The random variables U := fn (X) and V := gn (Z) satisfy the required Markov chain as well as (3) and (4). We apply the log-sum inequality [23, Theorem 2.7.1] and obtain for any ε0 > 0, provided that ε is small enough and n is large enough, 1 − αn αn + αn log βn 1 − βn 1 1 + αn log = −h2 (αn ) + (1 − αn ) log βn 1 − βn ≥ −(1 − ε) log βn − ε0 I(U; V) ≥ (1 − αn ) log ≥ (1 − ε)n(µ − ε) − ε 0 0 ≥ n(µ − ε ). (10) (11) (12) (13) (14) This shows that (µ − ε0 , R1 , R2 ) ∈ R∗ and consequently (µ, R1 , R2 ) ∈ R∗ . Consider the bound [15, Corollary 6]. It shows that (nµ, nR1 , nR2 ) is asymptotically achievable in the hypothesis testing problem for the vector source (X, Z) if (µ, R1 , R2 ) ∈ R∗ . I. e., for any ε, ε0 > 0, there is a sequence of (k, nR1 + ε0 , nR2 + ε0 ) hypothesis tests (fk , gk , Ak ) for (X, Z), k ∈ N such that lim αk ≤ ε, (15) 1 lim − log βk ≥ nµ − ε0 . k (16) k→∞ This shows that µ − proof. ε0 n , R1 + ε0 n , R2 + ε0 n  k→∞ ∈ RHT for the source (X, Z) and as ε0 was arbitrary, this completes the We can leverage the equivalence with hypothesis testing to show that R∗ is indeed a multi-letter characterization of R. Corollary 6. R = R∗ . Proof. To prove R ⊆ R∗ , assume (µ, R1 , R2 ) ∈ R and choose n, f , and g according to Definition 2. Defining U := f (X) and V := g(Z) yields inequalities (3)–(5) and satisfies the required Markov chain. We will show RHT ⊆ R, which is equivalent to R∗ ⊆ R by Theorem 5. Assuming (µ, R1 , R2 ) ∈ RHT , choose an arbitrary ε > 0 and pick an (n, R1 , R2 ) hypothesis test (fn , gn , An ) such that αn ≤ ε and − log βn ≥ n(µ − ε). By the same reasoning as in (14), the (n, R1 , R2 )-code (fn , gn ) achieves Θ(fn ; gn ) ≥ µ − ε0 for any ε0 > 0, implying (µ, R1 , R2 ) ∈ R. 2) Pattern Recognition (PR): Consider the pattern recognition problem introduced in [16]. For completeness sake we restate the problem here.  Let X(i), Z(i) be i.i.d. copies of (X, Z), independently generated for each i ∈ N. Definition 7. A triple (µ, R1 , R2 ) is said to be PR-achievable if, for any ε > 0, there exists an (n, R1 , R2 )-code nµ (f, g) for (X, Z) and a function φ : (M1 )e × M2 → [1 : enµ ] such that,   P W = φ C, g(Z(W)) ≥ 1 − ε, (17)  where C := f (X(i))i∈[1 : enµ ] is the compressed codebook and X(i), Z(i) i∈N ⊥ W ∼ U([1 : enµ ]). Let RPR denote the set of all PR-achievable triples. Remark 2. The variant of the inner bound for the pattern recognition problem stated in [16, Theorem 1] is flawed. To see this, note that (using the notation of [16]) the point (Rx = 0, Ry = b, Rc = b) is contained in Rin (choose U = V = ∅) for any b > 0 even if the random variables X and Y are independent. But this point is clearly not 6 achievable in general. However, the region Rin defined in the right column of [16, p. 303] coincides with our findings and the proof given in [16, Appendix A] holds for this region. Proposition 8. RPR = R∗ . Proof. Assume (µ, R1 , R2 ) ∈ RPR and for an arbitrary ε > 0 and sufficiently large n ∈ N choose appropriate functions f , g , φ satisfying (17). The random variables U := f (X) and V := g(Z) satisfy the required Markov chain as well as (3) and (4). Furthermore,  I(U; V) = I f (X); g(Z) (18)  = I C; g(Z(W)) W (19)  = I C; g(Z(W)), W (20)  ≥ I C; W g(Z(W)) (21)   = H W g(Z(W)) − H W C, g(Z(W)) (22)  ≥ nµ − H W φ C, g(Z(W)) (23) (17) ≥ nµ − h2 (ε) − εnµ. (24) The equality in (19) holds as X(i) ⊥ Z(j) for i 6= j , (20) follows from W ⊥ C, (23) follows from W ⊥ Z(W), the fact that H(W) = nµ and the data processing inequality [23, Theorem 2.8.1]. Fano’s inequality [23, Theorem 2.10.1] was used in (24). This shows (µ, R1 , R2 ) ∈ R∗ as ε was arbitrary. To show the other direction, we apply the achievability result [16, Theorem 1] to the multi-letter source (X, Z). Assuming (µ, R1 , R2 ) ∈ R∗ , we know that for some n ∈ N there are random variables (U, V) satisfying the Markov chain U −◦− X −◦− Z −◦− V and (3)–(5) hold. By [16, Theorem 1], the triple (nµ, nR1 , nR2 ) is asymptotically achievable for the pattern recognition problem for the source (X, Z) with an arbitrary error probability ε > 0. For any ε0 > 0 we can find k ∈ N, a (k, nR1 + ε0 , nR2 + ε0 )-code (f, g) for is  (X, Z), and a function φ, such that (17) 0  ε0 ε0 ε0 k(nµ−ε ) 0 satisfied with W ∼ U 1 : e . Thus, µ − n , R1 + n , R2 + n ∈ RPR for the source (X, Z) and as ε was arbitrary, this completes the proof. C. Bounds on the Achievable Region We first provide outer bounds on the set of achievable triples for biclustering with two sources. Theorem 9. We have R ⊆ Ro ⊆ R0o , where the two regions Ro and R0o are given by [ (µ, R1 , R2 ) : R1 ≥ I(U; X), R2 ≥ I(V; Z), Ro := U,V R0o := [ U,V µ ≤ I(U; X) + I(V; Z) − I(UV; XZ) , (µ, R1 , R2 ) : R1 ≥ I(U; X), R2 ≥ I(V; Z), µ ≤ min{I(U; Z), I(V; X)} , (25) (26) with U and V any pair of random variables satisfying U −◦− X −◦− Z and X −◦− Z −◦− V. Theorem 9 follows from the outer bound for the pattern recognition problem [16, Appendix B] via the equivalence shown in Section II-B2. Nonetheless, we provide a short, self-contained proof in Appendix A1 for the sake of completeness. The regions Ro and R0o are both convex since a time-sharing variable can be incorporated into U and V. Furthermore, 0 Ro remains unchanged when U and V are required to satisfy the complete Markov chain U −◦− X −◦− Z −◦− V. The numerical computation of the outer bounds requires the cardinalities of the auxiliary random variables to be bounded. We therefore complement Theorem 9 with the following result, whose proof is provided in Appendix A2. Proposition 10. We have Ro = conv(So ) and R0o = conv(So0 ), where the regions So and So0 are defined as Ro and R0o , respectively, but with the additional cardinality bounds |U| ≤ |X | and |V| ≤ |Z|. The cardinality bounds in this result are tighter than the usual bounds obtained with the convex cover method [13, Appendix C], where the cardinality has to be increased by one. Thus, when dealing with binary sources in Section II-E, binary auxiliary random variables suffice. The smaller cardinalities come at the cost of convexification in Proposition 10 since the regions So and So0 themselves are not necessarily convex. 7 We next state an inner bound for the biclustering problem. A more general inner bound will be proved in Theorem 25 in Section III-A for the extension of the biclustering problem to more than two sources. Theorem 11. We have Ri ⊆ R where [ Ri := (µ, R1 , R2 ) : R1 ≥ I(U; X), R2 ≥ I(V; Z), µ ≤ I(U; V) , (27) U,V with auxiliary random variables U, V satisfying U −◦− X −◦− Z −◦− V. Theorem 11 follows from the achievability result of Han on the hypothesis testing problem [15, Corollary 6], leveraging the equivalence detailed in Theorem 5 and Corollary 6. Alternatively, it also follows from the inner bound for the pattern recognition problem [16, Appendix A] using Corollary 6 and Proposition 8. The main differences between the outer and the inner bound lies in the Markov conditions, a phenomenon that also occurs with Berger-Tung type bounds (cf. [26, Chapter 7] or [13, Section 12.2]). Note that Ro and Ri would coincide if the Markov condition U −◦− X −◦− Z −◦− V were imposed in the definition of Ro . Employing a binning scheme would not enlarge the inner bound. The intuition is that binning reduces redundant information transmitted by both encoders, whereas in information-theoretic biclustering this quantity should actually be maximized. A tight bound on the achievable region can be obtained if µ is not greater than the common information (cf. [27]–[29]) of X and Z, as stated in the following corollary. Corollary 12. If Y = ζ1 (X) = ζ2 (Z) is common to X and Z in the sense of [28] and 0 ≤ µ ≤ H(Y) then (µ, R1 , R2 ) ∈ R if and only if µ ≤ min{R1 , R2 }. Proof. Theorem 9 entails µ ≤ min{R1 , R2 } for any (µ, R1 , R2 ) ∈ R. With U = V = Y, Theorem 11 implies (H(Y), H(Y), H(Y)) ∈ R. Using time-sharing with 0 ∈ R we obtain (µ, µ, µ) ∈ R for 0 ≤ µ ≤ H(Y) and hence (µ, R1 , R2 ) ∈ R if µ ≤ min{R1 , R2 }. The inner bound Ri can be improved by convexification. Furthermore, we incorporate the same strong cardinality bounds as for the outer bound (cf. Proposition 10), thereby enabling us to use binary auxiliary random variables when dealing with binary sources in Section II-E. Proposition 13. We have Si0 := conv(Si ) = conv(Ri ) ⊆ R where Si is defined as Ri , but with the additional cardinality bounds |U| ≤ |X |, and |V| ≤ |Z|. Furthermore, Si0 can be explicitly expressed as [  Si0 = (µ, R1 , R2 ) : R1 ≥ I(U; X|Q), R2 ≥ I(V; Z|Q), µ ≤ I(U; V|Q) , (28) U,V,Q where U, V, and Q are random variables such that pX,Z,U,V,Q = pQ pX,Z pU|X,Q pV|Z,Q , |U| ≤ |X |, |V| ≤ |Z|, and |Q| ≤ 3. The proof of this result is given in Appendix A3. D. The Information Bottleneck Method The information-theoretic problem posed by the information bottleneck (IB) method [17] can be obtained as a special case from the biclustering problem. We will introduce the problem setup and subsequently show how it can be derived as a special case of Definition 2. Note that the definition slightly differs from [12, Definition 1]. However, the achievable region is identical. Definition 14. A pair (µ, R1 ) is IB-achievable if, for some n ∈ N, there exists f : X n → M1 with log|M1 | ≤ nR1 and 1 µ ≤ I(f (X); Z). (29) n Let RIB be the set of all IB-achievable pairs. Furthermore, Definition 14 is equivalent to noisy lossy source coding [30] with logarithmic loss (LL) distortion [18]. 8 Definition 15. A pair (µ, R1 ) is LL-achievable if, for some n ∈ N, there exist f : X n → M1 and φ : M1 → P(Z n ) with log|M1 | ≤ nR1 such that 1 E [dLL (φ ◦ f (X), Z)], n where dLL (p, z) := − log p(z) is LL distortion. Let RLL be the set of all LL-achievable pairs. µ≥ (30) Using results from [18] we can show the following equivalences. Proposition 16. For a pair (µ, R1 ), the following are equivalent: 1) (µ, R1 ) ∈ RIB . 2) (H(Z) − µ, R1 ) ∈ RLL . 3) (µ, R1 , log|Z|) ∈ R . 4) There exists a random variable U such that U −◦− X −◦− Z, I(X; U) ≤ R and I(Z; U) ≥ µ. Proof. The equivalence “1 ⇔ 3” holds as Definition 2 collapses to Definition 14 for R2 = log|Z|. “2 ⇔ 4” is shown in [18, Section III.F]. To show “3 ⇔ 4” apply the outer bound R0o of Theorem 9 and Theorem 11 (identifying V = Z). The tradeoff between “relevance” and “complexity” can equivalently be characterized by the IB function (cf. [18], [31]) µIB (R) := sup{µ : (µ, R) ∈ RIB }. Proposition 16 provides µIB (R) = max U : I(U;X)≤R U− ◦−X−◦−Z I(U; Z). (31) Interestingly, the function (31) is the solution to a variety of different problems in information theory. As mentioned in [31], (31) is the solution to the problem of loss-less source coding with one helper [32], [33]. Witsenhausen and Wyner [34] investigated a lower bound for a conditional entropy when simultaneously requiring another conditional entropy to fall below a threshold. Their work was a generalization of [35] and furthermore related to [32], [36]–[38]. The conditional entropy bound in [34] turns out to be an equivalent characterization of (31). Furthermore, µIB characterizes the optimal error exponent, when testing against independence with one-sided data compression [39, Theorem 2]. Also in the context of gambling in the horse race market, (31) occurs as the maximum incremental growth in wealth when rate-limited side-information is available to the gambler [40, Theorem 3]. E. Doubly Symmetric Binary Source We will consider the special case where (X, Z) ∼ DSBS(p) is a doubly symmetric binary source [13, Example 10.1] with parameter p, i. e., X ∼ B( 21 ), X ⊥ N ∼ B(p), and Z := X ⊕ N. The cardinality bounds in Propositions 10 and 13 will enable us to use binary auxiliary random variables. We first show that the inner bound Si0 and the outer bound R0o do not coincide. Proposition 17. For the source (X, Z) ∼ DSBS(p) with p ∈ (0, 1) and p 6= 21 , we have Si0 6= R0o . The proof of this proposition is given in Appendix A4. We conjecture that there is also a gap between Si0 = conv(Si ) and the outer bound Ro . Conjecture 18. There exists p ∈ [0, 1], such that Si0 6= Ro for the source (X, Z) ∼ DSBS(p). To support Conjecture 18, we will introduce a region Sb ⊆ Si and show that conv(Sb ) 6= Ro . Let Sb be defined as [  Sb := (µ, R1 , R2 ) : R1 ≥ log 2 − h2 (α), 0≤α,β≤ 12 R2 ≥ log 2 − h2 (β), µ ≤ log 2 − h2 (α ∗ p ∗ β) . (32) By choosing U = X ⊕ N1 and V = Z ⊕ N2 , where N1 ∼ B(α) and N2 ∼ B(β) are independent of (X, Z) and of each other, it follows that Sb ⊆ Si . To illustrate the tradeoff between complexity (R1 , R2 ) and relevance (µ), the boundary of Sb is depicted in Figure 2 for p = 0.1. Based on numerical experiments, we conjecture the following. 9 I(X; Z) 0.2 0.1 µ 0 log 2 0.4 0.2 0.4 0.2 log 2 R2 R1 Figure 2: Boundary of Sb for p = 0.1. Conjecture 19. For the source (X, Z) ∼ DSBS(p) with p ∈ [0, 1] we have Si0 = conv(Sb ), or equivalently Si ⊆ conv(Sb ). The natural, stronger conjecture that Sb = Si already appeared in [16, Conjecture 1, Eq. (14)]. However, there is a counterexample [41]1 . Proposition 20. For the source (X, Z) ∼ DSBS(0) we have Sb 6= Si . U a 0 X=Z 1 0 a 0 1−a V 0 1 1 1−a 1 Figure 3: Random variables for the proof of Proposition 20. Proof. For a ∈ [0, 1] we define (U, V) by the binary channels  depicted in Figure 3, satisfying U −◦− X −◦− Z −◦− V. We obtain (µ, R, R) ∈ Si with R = I(U; X) = I(V; Z) = h2 a2 − 21 h2 (a) and µ = I(U; V) = 2R−a log(2). For a = 0.8 we have µ ≈ 0.291103 and R ≈ 0.42281. On the other hand, we obtain µb := max{µ̂ : (µ̂, R, R) ∈ Sb } < 0.285594 using (32) with α = β ≈ 0.07658. As µb < µ we have (µ, R, R) ∈ / Sb . This argument can be verified numerically using interval arithmetic [42]. Code written in the Octave Programming Language [43] using its interval package [44] can be found at [45]. Note that Proposition 20 does not  impact Conjecture 19 as it concerns the case p = 0. For p = 0 we have X = Z and Corollary 12 implies R = (µ, R1 , R2 ) : R1 , R2 ≥ 0 and µ ≤ min{R1 , R2 , log 2} . It is easily verified that R = conv(Sb ) and thus Conjecture 19 holds for p = 0 by Proposition 13. In fact, the entire statement [16, Conjecture 1] does not hold. The second part [16, Conjecture 1, Eq. (15)] claims that conv(Sb ) = Ro . In what follows, we show how to construct a counterexample. Proposition 21. For the source (X, Z) ∼ DSBS(0.1), we have conv(Sb ) 6= Ro . Proposition 21 shows that Conjecture 18 follows directly from Conjecture 19. 1 https://mathoverflow.net/questions/213084/do-binary-symmetric-channels-maximize-mutual-information 10 I(X; Z) µ µ̂o µ̂b 0.365 0.36 0.675 0.68 0.685 R 0.69 log 2 Figure 4: Numeric evaluation of µ̂o and µ̂b for p = 0.1. To prove Proposition 21 we construct a point (µ, R, R) ∈ Ro that satisfies (µ, R, R) ∈ / conv(Sb ). To this end, define the concave functions µ̂b (R) := max{µ : (µ, R, R) ∈ conv(Sb )} and µ̂o (R) := max{µ : (µ, R, R) ∈ Ro } for R ∈ [0, log 2]. In order to show conv(Sb ) 6= Ro , it suffices to find R̂ ∈ [0, log 2] with µ̂b (R̂) < µ̂o (R̂). We can numerically compute an upper bound for the function µ̂b . For α, β ∈ [0, 21 ], we calculate e1 := log 2 − h2 (α), R e2 := log 2 − h2 (β), and R µ e := log 2 − h2 (α ∗ p ∗ β) (33) (34) (35) e1 , R e 2 ). on a suitably fine grid and upper bound the upper concave envelope of the implicitly defined function µ e(R e e Evaluating it at R = R1 = R2 yields an upper bound for µ̂b (R). On the other hand, we can obtain a lower bound for µ̂o by computing (25) for specific probability mass functions that satisfy the Markov constraints in Theorem 9. Note that based on the cardinality bound in Proposition 10, we can restrict the auxiliary random variables U and V to be binary. We randomly sample the binary probability mass functions that satisfy the Markov constraints in Theorem 9 (but not necessarily the long Markov chain U −◦− X −◦− Z −◦− V) and in doing so encounter points strictly above the graph of µ̂b . Figure 4 shows the resulting bounds for p = 0.1 in the vicinity of R = log 2. Albeit small, there is clearly a gap between µ̂b and µ̂o outside the margin of numerical error. Proof of Proposition 21. We observed the largest gap between the two bounds at a rate of R̂ ≈ 0.675676. The particular distribution of (U, V) at this rate, resulting from optimizing over the distributions that satisfy the Markov constraints in Theorem 9 is given in Table I for reference. Note that this is an exact conditional pmf (i. e., not a numerical approximation) that satisfies the Markov chains U −◦− X −◦− Z and X −◦− Z −◦− V. It achieves I(V; Z) + I(U; X) − I(UV; XZ) ≈ 0.35972 which is ∆ ≈ 1.985673 · 10−4 above the inner bound, thus proving Proposition 21. Using interval arithmetic [42] this claim can be verified numerically. Code written in the Octave Programming Language [43] using its interval package [44] can be found at [45]. It uses the distribution given in Table I. We firmly believe that a tight characterization of the achievable region requires an improved outer bound. However, using current information theoretic tools, it appears very challenging to find a manageable outer bound based on the full Markov chain U −◦− X −◦− Z −◦− V. Remark 3. Recently, Kumar and Courtade introduced a conjecture [46], [47] concerning Boolean functions that maximize mutual information. Their work was inspired by a similar problem in computational biology [48]. A weaker form of their conjecture [47, Section IV, 2)], which was solved in [49], corresponds to a zero-rate/one-bit variant of the binary example studied here. 11 u v x z P{U = u, V = v|X = x, Z = z} 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0.995358146217353406525 0.00249767559844423319075 0.002498344003957310643325 0.00034313919194834475 0.002142603857654094275 0.99500307447656326760925 0.000000905921035188556675 0.00215611073304415445 0.002142603857654094275 0.00000157432654826600925 0.995002406071050190156675 0.00215611073304415445 0.000356646067338404925 0.00249767559844423319075 0.002498344003957310643325 0.99534463934196334635 Table I: Distribution resulting from random search. III. C LUSTERING WITH M ULTIPLE S OURCES A. Problem Statement and Results In this section we extend the information-theoretic biclustering problem introduced in Section II-A to the case of multiple sources and we provide bounds on the associated achievable region. A schematic illustration of the problem is shown in Figure 5. X1 W1 = f1 (X1 ) (rate R1 ) X2 W2 = f2 (X2 ) (rate R2 ) X3 W3 = f3 (X3 ) (rate R3 ) X4 W4 = f4 (X4 ) (rate R4 ) X5 W5 = f5 (X5 ) (rate R5 ) .. . .. . XK WK = fK (XK ) (rate RK ) nµA,B ≤ I WA ; WB  Figure 5: Clustering of multiple sources. Let XK (K = [1 : K]) be K random variables, taking values in the finite sets XK . The random vectors XK consist of n i.i.d. copies of XK . For n ∈ N and RK ∈ RK + , an (n, RK )-code fK for XK consists of K functions n fk : Xk → Mk , where Mk is an arbitrary finite set with log |Mk | ≤ nRk for each k ∈ K. Recall that the symbol 12 K K+1 µΩ refers to a tuple µΩ ∈ R3 −2 and hence, |Ω| = 3K − 2K+1 + 1. +1 , where Ω is the set of all pairs (A, B) with A, B ⊂ K nonempty and disjoint Definition 22. Consider an (n, RK )-code fK with Wk := fk (Xk ); for any (A, B) ∈ Ω we define the co-information of fA and fB as 1 I(WA ; WB ). (36) n Definition 23. A point (µΩ , RK ) is achievable if, for some n ∈ N, there exists an (n, RK )-code fK such that for all (A, B) ∈ Ω, Θ(fA ; fB ) := Θ(fA ; fB ) ≥ µA,B . (37) The set of all achievable points is denoted R and we refer to its closure R as achievable region. Remark 4. A standard time sharing argument can be used to show that R is a convex set (cf. [13, Section 4.4]). We first state an outer bound for the achievable region, whose proof is provided in Appendix B1. Theorem 24. We have the outer bounds R ⊆ Ro ⊆ R0o . Here, the region R0o is defined as X [ Rk ≥ I(UA ; XK |UC ) for A, C ⊆ K, (µΩ , RK ) : R0o := k∈A UK and µA,B ≤ I(UA ; XB ) for (A, B) ∈ Ω , (38) where the auxiliary random variables UK satisfy UA −◦− XA −◦− XK\A for every A ⊆ K. The region Ro is defined just as R0o only that the inequality for the relevance µA,B is replaced with µA,B ≤ I(UA ; XA ) + I(UB ; XB ) − I(UA UB ; XA XB ). (39) µA,B ≤ I(UA ; UB ) − I(UA ; UB |XA XB ). (40) Remark 5. In particular we have the Markov chains UA −◦− XA −◦− XB and UB −◦− XB −◦− XA . Using Lemma 43 we can write (39) equivalently as The next result, whose proof is detailed in Section III-C, provides an inner bound. Theorem 25. We have Ri ⊆ R where the region Ri consists of all points (µΩ , RK ) for which there exist random variables UK satisfying Uk −◦− Xk −◦− (XK\k , UK\k ) for all k ∈ K and for all (A, B) ∈ Ω there exist subsets Ae ⊆ A and Be ⊆ B such that X  Rk ≥ I XA0 ; UA0 UA\A0 for all A0 ⊆ A with A0 ∩ Ae = 6 ∅, (41) k∈A0 X k∈B 0 Rk ≥ I XB0 ; UB0 UB\B0  µA,B ≤ I UAe; UBe .  for all B 0 ⊆ B with B 0 ∩ Be 6= ∅, (42) (43) Remark 6. In contrast to the case of two sources, binning does help for K > 2 sources. For illustration, consider the case K = 3 and assume we are only interested in maximizing Θ(f1 , f2 ; f3 ). Then any information encoded by both f1 and f2 is redundant as it does not increase Θ(f1 , f2 ; f3 ). The corresponding rate loss can be reduced by a quantize-and-bin scheme (cf. [26], [32], [50]). The proof that Ri is indeed achievable uses typicality coding and binning. The conditions (41) and (42) ensure that the messages of encoders Ae and Be can be correctly decoded from the output of the encoders A and B , respectively. By (43), these suffice to ensure that µA,B is achievable. Intuitively, the encoders A \ Ae and B \ Be act as helpers. The special case Ae = A, Be = B for every (A, B) ∈ Ω corresponds to no binning at all, as (41) and (42) then imply Rk ≥ I(Xk ; Uk ) for all k ∈ K. The inner bound in Theorem 25 cannot be tight, as evidenced by the Körner-Marton problem [14]. For K = 3 consider independent random variables X1 ∼ B( 12 ) and X3 ∼ B(p) with p ∈ (0, 1) and p 6= 12 and define X2 := X1 ⊕ X3 . The point (µΩ , RK ) where R3 = log 2, R1 = R2 = H(X3 ) = h2 (p), and µA,B = 0 except for 13 µ{1,2},{3} = H(X3 ) = h2 (p) is achievable [14, Theorem 1]. However, the quantize-and-bin scheme used in the proof of Theorem 25 cannot achieve this point [14, Proposition 1]. Finally, note that in general Ri is not convex and thus Theorem 25 can be strengthened to conv(Ri ) ⊆ R. However, characterizing conv(Ri ) using a time-sharing random variable is tedious due to the freedom of choosing the index sets Ae, and Be for each (A, B) ∈ Ω in Theorem 25. The following cardinality bounds show that Ri is computable (see Appendix B2 for the proof). Proposition 26. The region Ri remains unchanged if the cardinality bound |Uk | ≤ |Xk | + 4K is imposed for every k ∈ K. B. A Special Case: The CEO Problem In this section we study a special case of the clustering problem that corresponds to a variant of the CEO problem [51] in which the usual distortion criterion is replaced with mutual information (MI). This problem turns out to be equivalent to the classical CEO problem with logarithmic loss distortion as analyzed in [18]. The equivalence follows in the same fashion as the equivalence between the IB problem and lossy source coding with log-loss distortion, shown in Section II-D. Using results from [18], we will show that our inner bound becomes tight in this special case. We consider a CEO problem under a mutual information constraint where random variables XJ are encoded to be maximally informative about another set of random variables YL (remember, J = [1 : J] and L = [1 : L]). Recall that we use the symbol νΠ to denote a tuple νΠ ∈ RΠ , where Π consists of all pairs (A, B) of nonempty sets A ⊆ J and B ⊆ L. Definition 27. A point (νΠ , RJ ) is MI-achievable if for some n ∈ N there exists an (n, RJ )-code fJ for XJ such that for all (A, B) ∈ Π, 1 I(WA ; YB ) ≥ νA,B , n where Wj := fj (Xj ) for j ∈ J . Denote the set of all MI-achievable points by RMI . (44) The region RMI is a special case of R. Proposition 28. Letting K := J + L and XK := (XJ , YL ), we have (νΠ , RJ ) ∈ RMI if and only if (µΩ , RK ) ∈ R, where (45) µA,J+B = 1Π (A, B)νA,B , (46) Rk = log|Xk | for k > J. Proof. Let (νΠ , RJ ) ∈ RMI be achieved by the (n, RJ )-code fJ in the sense of Definition 27. We extend fJ to an (n, RK )-code fK by setting fk (xk ) = xk for k > J . This code achieves (µΩ , RK ) ∈ RMI in the sense of Definition 23. Let (µΩ , RK ) ∈ R be achieved by the (n, RK )-code fK in the sense of Definition 23. The restriction fJ then achieves (νΠ , RJ ) ∈ RMI in the sense of Definition 27. Remark 7. The convexity of R (Remark 4) and Proposition 28 imply that RMI is a convex set. To shorten notation we will introduce the set of random variables P∗ := {UJ , Q : Q ⊥ (XJ , YL ), Uj −◦− (Xj , Q) −◦− (XJ \j , YL , UJ \j ) for all j ∈ J }. (47) We can obtain an inner bound on RMI directly from Theorem 25 as stated in the following corollary. (MI) (MI) Corollary 29. An inner bound for the achievable region is given by Ri ⊆ RMI where the region Ri consists of all points (νΠ , RJ ) such that there exist random variables (UJ , ∅) ∈ P∗ and for all (A, B) ∈ Π there exists a subset Ae ⊆ A such that X  Rk ≥ I XA0 ; UA0 UA\A0 for all A0 ⊆ A with A0 ∩ Ae = 6 ∅, (48) k∈A0 14  νA,B ≤ I UAe; YB . (49) Proof. The result follows from Theorem 25 and Proposition 28 with auxiliary random variables Uk = Xk for k > J. We next argue that the CEO problem introduced in Definition 27 is equivalent to the log-loss distortion approach in [18]. For A ⊆ J and B ⊆ L we consider a decoding function gA,B : MA → P(YBn ) that produces a probabilistic estimate of YB given the output of the encoders A. The quality of this probabilistic estimate is measured by log-loss distortion. Definition 30. A point (νΠ , RJ ) is LL-achievable if, for some n ∈ N, there exists an (n, RJ )-code fJ such that for all (A, B) ∈ Π there is a decoding function gA,B : MA → P(YBn ) with  1  E dLL (gA,B (WA ), YB ) ≤ νA,B , (50) n where Wj := fj (Xj ), j ∈ J . Let RLL be the set of all LL-achievable points. We note that [18] considers the case where νA,B 6= ∞ only if A = J and B = L = {1}. To show that RMI and RLL are equivalent, we first state an auxiliary lemma which is essentially [18, Lemma 1] and provided just for the sake of completeness (see Appendix B3 for the proof). Lemma 31. For two random variables (X, Y) and two functions f : X → M and g : M → P(Y), where M is an arbitrary set, we have   E dLL g(f (X)), Y ≥ H(Y|f (X)) (51) with equality if and only if g(m) = P{Y = · |f (X) = m} for all m ∈ M with P{f (X) = m} = 6 0. Loosely speaking, Lemma 31 implies that the “MI performance” of an encoder is at least as good as its “LL performance” – independent of the decoder. On the other hand, the optimum can always be achieved when equality holds in (51). This is the basis for the next result. 0 , R ) ∈ R , where ν 0 Lemma 32. (νΠ , RJ ) ∈ RLL if and only if (νΠ J MI A,B := H(YB ) − νA,B . 0 ,R ) ∈ R Proof. Assume that (νΠ J MI is achieved by the (n, RJ )-code fJ , i. e., (44) holds for all (A, B) ∈ Π with Wj := fj (Xj ). By Lemma 31, choosing the decoding functions gA,B (mA ) = pYB |WA ( · |mA ) implies (44) 1 1 n E [dLL (gA,B (WA ), Y B )] = n H(Y B |WA ) ≤ νA,B To show RLL ⊆ RMI , assume that (νΠ , RJ ) and thus (νΠ , RJ ) ∈ RLL . ∈ RLL is achieved by the (n, RJ )-code fJ and the decoding 0 function gA,B , i. e., (50) holds for all (A, B) ∈ Π with Wj := fj (Xj ). Lemma 31 then implies I(WA ; YB ) ≥ nνA,B 0 and hence (νΠ , RJ ) ∈ R. For the rest of this section, assume L = 1 and Xj −◦− Y1 −◦− XJ \j for all j ∈ J . For brevity we will write Y := Y1 and νA := νA,1 in the following. As a consequence of Lemma 32, the results in [18] directly apply to the CEO problem with a mutual information constraint. Lemma 33. Assume νA = 0 whenever A 6= J . Then (νΠ , RJ ) ∈ RMI if and only if there exist random variables (UJ , Q) ∈ P∗ and the following inequalities hold: X  Rk ≥ I XA0 ; UA0 UJ \A0 , Q for all A0 ⊆ J , (52) k∈A0 νJ ≤ I(UJ ; Y|Q). (53) Proof. (νΠ , RJ ) ∈ RMI follows by applying Corollary 29 with Ae = ∅ for A = 6 J and Ae = J for A = J , taking into account the convexity of RMI (Remark 7). The converse follows from [18, Lemma 5] and Lemma 32. Remark 8. The achievable region of the multiterminal source coding problem with logarithmic-loss distortion, introduced in [18, Section II], can be obtained as a special case of RMI as well. Choose J = L = 2 and set Yj = Xj , (MI) j ∈ {1, 2}. The inner bound Ri is also tight (up to convexification) due to the results in [18]. 15 C. Proof of Theorem 25 The proof of Theorem 25 extends the methods developed in [15] for the hypothesis testing problem (cf. Section II-B1) to a setup with multiple sources. We begin by extending [15, Lemma 8] and incorporating a binning strategy. Lemma 34 (Existence of a code). Let ε > 0, Uk −◦− Xk −◦− (XK\k , UK\k ) for all k ∈ K, and RK ∈ RK + . Then, for sufficiently large n ∈ N we can obtain an (n, RK + ε)-code fK with Wk := fk (Xk ) and decoding functions gA,Ae : MA → U ne for each A, Ae ⊆ K with ∅ 6= Ae ⊆ A such that the following two properties hold. A For every (A, B) ∈ Ω and ∅ 6= Ae ⊆ A as well as ∅ 6= Be ⊆ B we have    gA,Ae(MA ) × gB,Be(MB ) ∩ T[Un eU e] ≤ exp n(I UAeUBe; XAeXBe + ε) . (54) A B Furthermore, if (41) and (42) hold, then n o  P gA,Ae(WA ), XA , XB , gB,Be(WB ) ∈ / T[Un eXA XB U e] ≤ ε. A B (55) The proof of Lemma 34 is provided in Appendix B4. Furthermore we will need the following set of random variables. Definition 35. For random variables (A, B, C, D) and δ ≥ 0, define the set of random variables e B, e C, e D e : (A, e B) e ∈T e e e e Sδ (A, B, C, D) := {A, [AB]δ , (C, D) ∈ T[CD]δ , (A, D) ∈ T[AD]δ }. (56) Consider (µΩ , RK ) ∈ Ri and choose UK as in Theorem 25. Fix ε > 0 and apply Lemma 34 to obtain encoding functions fK and decoding functions gA,Ae. For any pair (A, B) ∈ Ω, find the nonempty subsets Ae ⊆ A ⊆ A and Be ⊆ B ⊆ B such that (41)–(43) hold. (The case Ae = ∅ or Be = ∅ can be ignored since due to (43) it leads to µA,B ≤ 0, which is achieved by any code.) Define the functions h1 := gA,Ae ◦ fA and h2 := gB,Be ◦ fB . To analyze S Θ(fA ; fB ), we define D1 := h1 (XAn ) and partition XAn as XAn = u e∈D1 h−1 e). We may assume without loss 1 (uA A −1 n n of generality that h1 (uAe) ⊆ T[XA |U e] (uAe) whenever uAe ∈ T[U e] as this does not interfere with the properties A A (54) and (55) of the code. Defining D2 accordingly, we set F := (D1 × D2 ) ∩ T[Un eU e] . Let us use the shorthand A B   notation Û1 := h1 (XA ) and Û2 := h2 (XB ), and define pF := P (Û1 , Û2 ) ∈ F and p̄F := P (U1 , U2 ) ∈ F with U1 := h1 (XA ), U2 := h2 (XB ), where (XA , XB ) are n i.i.d. copies of (XA , XB ) ∼ pXA pXB . We then have nΘ(fA ; fB ) ≥ nΘ(h1 ; h2 ) = I(h1 (XA ); h2 (XB )) n o n o P Û1 = uAe, Û2 = uBe X o n o P Û1 = uAe, Û2 = uBe log n = P Û = u P Û = u 1 2 e uAe ∈D1 ,uBe∈D2 A Be n o n o P Û1 = uAe, Û2 = uBe X o n o = P Û1 = uAe, Û2 = uBe log n P Û = u P Û = u 1 2 e e (uAe ,uBe)∈F A B n o n o P Û1 = uAe, Û2 = uBe X o n o + P Û1 = uAe, Û2 = uBe log n Û = u P Û = u P c 1 2 e (uAe ,uBe)∈F A Be ≥ pF log pF 1−pF + (1−pF ) log , p̄F 1− p̄F (57) (58) (59) (60) where (57) follows from the data processing inequality [23, Theorem 2.8.1] and (60) is a consequence of the log-sum inequality [23, Theorem 2.7.1]. Expression (60) can be further bounded by pF log pF 1−pF + (1−pF ) log = −h2 (pF ) − pF log p̄F − (1−pF ) log(1− p̄F ) p̄F 1− p̄F ≥ −h2 (pF ) − pF log p̄F (55) ≥ − log 2 − (1−ε) log p̄F . (61) (62) (63) 16 For each uAe ∈ D1 and uBe ∈ D2 , let us define and −1 S(uAe, uBe) := {uAe} × h−1 e) × h2 (uBe) × {uBe} 1 (uA S := [ (uAe ,uBe)∈F (64) (65) S(uAe, uBe). Now, pick any (ûAe, x̂A , x̂B , ûBe) ∈ S . Let ÛAe, X̂A , X̂B , and ÛBe be the type variables corresponding to ûAe, x̂A , x̂B , and ûBe, respectively. From part 1 of Lemma 54 we know   P XA = x̂A , XB = x̂B = exp − n H(X̂A X̂B ) + D(X̂A X̂B kXA XB ) . (66) Let κ(uAe, uBe; ÛAe, X̂A , X̂B , ÛBe) denote the number of elements in S(uAe, uBe) that have type (ÛAe, X̂A , X̂B , ÛBe). Then, by part 2 of Lemma 54  κ(uAe, uBe; ÛAe, X̂A , X̂B , ÛBe) ≤ exp nH(X̂A X̂B |ÛAeÛBe) . (67) Letting κ(ÛAe, X̂A , X̂B , ÛBe) be the number of elements of S with type (ÛAe, X̂A , X̂B , ÛBe), we have X κ(ÛAe, X̂A , X̂B , ÛBe) = κ(uAe, uBe; ÛAe, X̂A , X̂B , ÛBe) (68) (uAe ,uBe)∈F X (67) ≤ (uAe ,uBe)∈F exp nH(X̂A X̂B |ÛAeÛBe)  (69)   ≤ exp n I UAeUBe; XA XB + H(X̂A X̂B |ÛAeÛBe) + ε . (54) Thus,  P (UAe, UBe) ∈ F (66) = X ÛAe ,X̂A ,X̂B ,ÛBe (70) ≤ (70) κ(ÛAe, X̂A , X̂B , ÛBe)   · exp −n H(X̂A X̂B ) + D(X̂A X̂B kXA XB )  X  exp −n k(ÛAe, X̂A , X̂B , ÛBe) − ε , (71) (72) ÛAe ,X̂A ,X̂B ,ÛBe where the sum is over all types that occur in S and k(ÛAe, X̂A , X̂B , ÛBe) := I(ÛAeÛBe; X̂A X̂B ) − I UAeUBe; XA XB + D(X̂A X̂B kXA XB ).  Using a type counting argument (Lemma 53), we can further bound  P (UAe, UBe) ∈ F ≤ (n + 1)|UAe||XA ||XB ||UBe|   · max exp −n k(ÛAe, X̂A , X̂B , ÛBe) − ε , (73) (74) ÛAe ,X̂A ,X̂B ,ÛBe where the maximum is over all types occurring in S . For any type (ÛAe, X̂A , X̂B , ÛBe) in S , we have by construction (ÛAe, X̂A , X̂B , ÛBe) ∈ Sδ (UAe, XA , XB , UBe) (following the δ -convention, Remark 12) and we thus conclude  P (UAe, UBe) ∈ F ≤ (n + 1)|UK ||XK |   e e, X eA, X eB, U e e) − ε . · max exp −n k(U (75) A B e e ,X e A ,X e B ,U e e)∈Sδ (U e ,XA ,XB ,U e) (U A B A B 17 Combining (63) and (75) we have shown that for n large enough  log 2 1 − ε Θ(fA ; fB ) ≥ − − log P (UAe, UBe) ∈ F n n e e, X eA, X eB, U e e) ≥ −2ε + (1 − ε) · min k(U A B  e e e e ≥ min k(U e, XA , XB , U e) − 2 + I(XA ; XB ) ε, A B (76) (77) (78) e e, X eA, X eB, U e e) ∈ Sδ (U e, XA , XB , U e). As k(U e e, X eA, X eB, U e e) is continuous as a where the minimum is over all (U A B A B A B function of pUe e,Xe A ,Xe B ,Ue e , by letting n → ∞, A B Θ(fA ; fB ) ≥ min e e ,X e A ,X e B ,U e e)∈S0 (U e ,XA ,XB ,U e) (U A B A B e e, X eA, X eB, U e e) − Cε k(U A B e e, X eA, X eB, U e e) ∈ S0 (U e, XA , XB , U e) we have for some fixed constant C . Observe that for (U A B A B e e, X eA, X eB, U e e) = I(U e eX e e e k(U B A A ; XB UBe) A e e; U e e) = I(U e; U e). ≥ I(U Combining (79) and (81), we have A B A (80) (81) B (43)  Θ(fA ; fB ) ≥ I UAe; UBe − Cε ≥ µA,B − Cε. (79) (82) We hence obtain (µΩ − Cε, RK + ε) ∈ R; since ε was arbitrary, this completes the proof. D. Multiple Description CEO Problem We continue the discussion of the CEO problem of Section III-B and assume L = 1 as well as Xj −◦− Y := Y1 −◦− XJ \j for all j ∈ J . To simplify notation we will again use νA := νA,1 . Extending the setup discussed in Section III-B, we will allow νj > 0 for any j ∈ J . Loosely speaking, this requires a multiple description (MD) code for the CEO problem, enabling the CEO to obtain valuable information from the message of the j th agent alone. Surprisingly, this extension also permits a single-letter characterization. In particular for the case J = 2 this allows us to give a full single-letter characterization of the achievable region, which will be explicitly stated in Corollary 38. (<,I) Definition 36. For a total order2 < on J and a set I ⊆ J , let the region RMI such that there exist random variables (UJ , ∅) ∈ P∗ with be the set of tuples (νΠ , RJ ) Rj ≥ I(Uj ; Xj |U=j ), j ∈ J, (83) νj ≤ I(Uj ; Y|U=j ), j∈ / I, (85) j ∈ I, (84) νj ≤ I(Uj ; Y), j ∈ I, (86) νA ≤ 0, 1 < |A| < |J |. (88) Rj ≥ I(Uj ; Xj ), νK ≤ I(UJ ; Y), (87) Remark 9. The purpose of the order < is to determine the order of the messages for successive decoding. Equivalently, Definition 36 could be rephrased in terms of a permutation of J in place of a total order. We are now able to state the single-letter characterization of RMI with the additional condition that (88) holds. S  (<,I) Theorem 37. We have {(νΠ , RJ ) ∈ RMI : (88) holds} = conv <,I RMI , where the union is over all total orders < on J and all sets I ⊆ J . The proof of Theorem 37 is provided at the end of this section. In particular, Theorem 37 provides a single-letter characterization of RMI for the case of J = 2 agents. We state this special case separately in the following corollary to showcase some interesting features of this single-letter region. 2 For the notation regarding total orders refer to Section I-C1. 18   (1) (2) (3) (i) Corollary 38. For J = 2, we have RMI = conv RMI ∪ RMI ∪ RMI , where (νΠ , RJ ) ∈ RMI if, for some (UJ , ∅) ∈ P∗ , the following inequalities are satisfied (1) (2) RMI : (3) RMI : ν1 ≤ I(Y; U1 ) RMI : ν1 ≤ I(Y; U1 |U2 ) ν2 ≤ I(Y; U2 |U1 ) ν2 ≤ I(Y; U2 ) ν{1,2} ≤ I(Y; U1 U2 ) ν{1,2} ≤ I(Y; U1 U2 ) R1 ≥ I(U1 ; X1 ) R1 ≥ I(U1 ; X1 |U2 ) R2 ≥ I(U2 ; X2 |U1 ) ν1 ≤ I(Y; U1 ) (89) ν{1,2} ≤ I(Y; U1 U2 ) (91) R2 ≥ I(U2 ; X2 ) (<,I) (2) ν2 ≤ I(Y; U2 ) (90) R1 ≥ I(U1 ; X1 ) (92) R2 ≥ I(U2 ; X2 ). (<,I) Proof. Assuming 1 < 2, we obtain RMI = RMI if 1 ∈ / I and otherwise RMI (<,I) (1) (<,I) (3) 2 < 1, we obtain RMI = RMI if 2 ∈ / I and otherwise also RMI = RMI . (93) (3) = RMI . On the other hand, if (1) Remark 10. Note that the total available rate of encoder 2 is R2 = I(X2 ; U2 |U1 ) to achieve a point in RMI . Interestingly, this rate is in general less than the rate required to ensure successful typicality decoding of U2 . However, ν2 = I(Y; U2 |U1 ) can still be achieved. (i) Remark 11. On the other hand, fixing the random variables U1 , U2 in the definition of RMI shows another interesting feature of this region. The achievable values for ν1 and ν2 vary across i ∈ {1, 2, 3} and hence do not only depend on the chosen random variables U1 and U2 , but also on the specific rates R1 and R2 . It is worth mentioning that by setting ν1 = ν2 = 0 the region RMI reduces to the rate region in Lemma 33. (<,I) The following proposition shows that RMI is computable, at least in principle. The given cardinality bound is (<,I) not optimal, but it implies RMI (<,I) = RMI . The proof of Proposition 39 is provided in Appendix B5. (<,I) Proposition 39. The region RMI every j ∈ J . remains unchanged if the cardinality bound |Uj | ≤ |Xj | + 4J is imposed for The following two theorems provide an inner and an outer bound for RMI . In order to show that Theorem 37 holds, we subsequently prove that these bounds are indeed tight, assuming that (88) holds. (<,I) Theorem 40. We have RMI ⊆ RMI for any I ⊆ J and any total order < on J . Theorem 41. If (νΠ , RJ ) ∈ RMI then X  Rj − νA ≥ I(XB ; UB |YQ) − I Y; UA\B Q (94) j∈B for all A, B ⊆ J and some random variables (UJ , Q) ∈ P∗ . The proof of Theorems 40 and 41 are given in Appendices B6 and B7, respectively. We will, however, only require the following simple corollary of Theorem 41. Corollary 42. For any (νΠ , RJ ) ∈ RMI there are random variables (UJ , Q) ∈ P∗ with X j∈A Rj ≥ 0, Rj − νJ ≥ I(XA ; UA |YQ) − I Y; UJ \A Rj − νj ≥ I(Xj ; Uj |YQ), νj ≤ I(Y; Uj |Q),  Q , for all j ∈ J , (95) for all A ⊆ J , (96) for all j ∈ J , (97) for all j ∈ J . (98) Proof of Theorem 37. We will make use of some rather technical results on convex polyhedra, derived in Appendix B9. Assume (νΠ , RJ ) ∈ RMI . We can then find (UJ , Q) ∈ P∗ such that (95)–(98) hold. We define νeΠ := −νΠ to simplify notation. It is straightforward to check that the inequalities (95)–(98) define a sequence of closed convex polyhedra H(j) in the variables (RJ , νeΠ ) that satisfy Assumptions 1 and 2 of Lemma 51. H(0) is defined by (95) 19 and (96) alone, and for k ∈ [0 : J] the polyhedron H(k) is given in the K + k variables (RJ , νeJ , νe1 , νe2 , . . . , νek ) by adding constraints (97) and (98) for each j ∈ [1 : k]. The set H(0) is a supermodular polyhedron [52, Section 2.3] in the K variables (RJ , νeJ ) on (K, 2K ) with rank function ( 0, K∈ / A,   ϑ(A) = (99) I XA\K ; UA\K YQ − I Y; UJ \A Q , K ∈ A, where supermodularity follows via standard information-theoretic arguments. By the extreme point theorem [52, Theorem 3.22], every extreme point of H(0) is associated with a total order < on K. Such an extreme point is given by (<) = 0 for j < K, (100) = I(Y; U=K |Q) − I(Y; U<K |YQ). (102) ≤ I(Xj ; Uj |YQ) + I(Y; Uj |Q) = I(Xj ; Uj |Q). (103) Rj (<) Rj (<) νJ = I(Uj ; Xj |U=j Q) for j = K, (101) Assumption 3 of Lemma 51 is now verified by (<) Rj By applying Lemma 51 we find that every extreme point of H(J) is given by a subset I ⊆ J and an order < of K as (<,I) Rj (<,I) Rj (<,I) Rj (<,I) νj (<,I) νj (<,I) νj (<,I) νJ = I(Xj ; Uj |Q), (104) j ∈ I, = 0, = I(Uj ; Xj |U=j Q), = I(Uj ; Y|Q), = −I(Uj ; Xj |YQ), = I(Uj ; Y|U=j Q), j∈ / I and j < K, (105) j ∈ I, (107) j∈ / I and j = K, (109) j∈ / I and j = K, (106) j∈ / I and j < K, (108) (110) = I(Y; U=K |Q) − I(Y; U<K |YQ). (<,I,q) (<,I,q) For each q ∈ Q with P{Q = q} > 0 let the point (νΠ , RJ ) be defined by (104)–(110), but given (<,I,q) (<,I,q) (<,I) {Q = q}. By substituting / I and j < K , we see that (νΩ , RJ ) ∈ RMI and consequently  Uj →∅ if j ∈ (<,I) (<,I) (<,I) (νΠ , RJ ) ∈ conv RMI . Defining the orthant O := {(νΠ , RJ ) : νΠ ≤ 0, RJ ≥ 0}, this implies       [ [ (<,I)  (<,I) (νK , RJ ) ∈ conv conv RMI + O = conv RMI  + conv(O) (111) <,I <,I  = conv [ <,I  = conv [ <,I (<,I) RMI + O (112)  (<,I) RMI , (<,I) where (112) follows from [53, Theorem 1.1.2] and in (113) we used that RMI Together with Theorem 40 and the convexity of RMI (Remark 7) we obtain   [ (<,I) RMI ⊆ conv RMI  ⊆ RMI . <,I  (113) (<,I) + O = RMI by definition. (114) 20 S  (<,I) (<,I) It remains to show that conv <,I RMI is closed. Using Proposition 39, we can write RMI = F (<,I) (P∗0 ) + O, where P∗0 := {pY,XJ ,UJ : (UJ , ∅) ∈ P∗ , |Uj | = |Xj | + 4J , j ∈ J } is a compact subset of the probability simplex (<,I) and F (<,I) is a continuous function, given by the definition of RMI , (83)–(88). We can thus write     [ (<,I) [ conv RMI  = conv F (<,I) (P∗0 ) + O, (115) which is closed by Lemma 44. <,I <,I IV. S UMMARY AND D ISCUSSION We introduced a novel multi-terminal source coding problem termed information-theoretic biclustering. Interestingly, this problem is related to several other problems at the frontier of statistics and information theory and offers a formidable mathematical complexity. Indeed, it is fundamentally different from “classical” distributed source coding problems where the encoders usually aim at reducing, as much as possible, redundant information among the sources while still satisfying a fidelity criterion. In the considered problem, however, the encoders are interested in maximizing precisely such redundant information. While an exact characterization of the achievable region is mathematically very challenging and still remains elusive, we provided outer and inner bounds to the set of achievable rates. We thoroughly studied the special case of two symmetric binary sources for which novel cardinality bounding techniques were developed. Based on numerical evidence we formulated a conjecture that entails an explicit expression for the inner bound. This conjecture provides strong evidence that our inner and outer bound do not meet in general. We firmly believe that an improved outer bound, satisfying the adequate Markov chains, is required for a tight characterization of the achievable region. We further established analogous bounds to the achievable rate region of information-theoretic biclustering with more than two sources. However, these bounds cannot be tight since the famous Körner-Marton problem constitutes a counterexample. For an analogue of the well-known CEO problem we showed that our bounds are tight in a special case, leveraging existing results from multiterminal lossy source coding. Furthermore we considered a multiple description CEO problem which surprisingly also permits a single-letter characterization of the achievable region. The resulting region has the remarkable feature that it allows to exploit rate that is in general insufficient to guarantee successful typicality encoding. The interesting challenge of the biclustering problem lies in the fact that one needs to bound the mutual information between two arbitrary encodings solely based on their rates. Standard information-theoretic manipulations seem incapable of handling this requirement well. ACKNOWLEDGMENT The authors would like to thank Shlomo Shamai (Shitz) and Emre Telatar for insightful discussions regarding the binary example. We would also like to thank Christian Chapman from the School of Electrical, Computer and Energy Engineering at Arizona State University for providing the counterexample to [16, Conjecture 1, Eq. (14)]. A PPENDIX A. Proofs from Section II We start this section with two simple lemmas, which will be used in several proofs. Lemma 43. If U −◦− X −◦− Z and X −◦− Z −◦− V, then I(U; X) + I(V; Z) − I(UV; XZ) = I(U; V) − I(U; V|XZ), (116) I(U; X) + I(V; Z) − I(UV; XZ) ≤ I(V; X). (118) I(U; X) + I(V; Z) − I(UV; XZ) ≤ I(U; Z), (117) Provided that U −◦− X −◦− Z −◦− V then I(U; X) + I(V; Z) − I(UV; XZ) = I(U; V). Proof. By standard information-theoretic manipulations we obtain (116) as I(U; X) + I(V; Z) − I(UV; XZ) = I(U; XZ) + I(V; XZ) − I(UV; XZ) (119) 21 = I(U; V) − I(U; V|XZ). (120) We obtain (117), and by a symmetric argument also (118), as I(U; X) + I(V; Z) − I(UV; XZ) = I(V; Z) − I(V; XZ|U) = I(U; Z) + I(V; Z) − I(U; Z) − I(V; XZ|U) = I(U; Z) + I(V; Z) − I(U; Z) − I(V; Z|U) − I(V; X|ZU) = I(U; Z) + I(V; Z) − I(UV; Z) − I(V; X|ZU) = I(U; Z) − I(U; Z|V) − I(V; X|ZU) ≤ I(U; Z). (121) (122) (123) (124) (125) (126) Lemma 44. For a compact set C ⊆ Rn and a closed, convex set B ⊆ Rn , A := conv(C + B) = conv(C) + B = A. (127) Proof. We have A = conv(C) + conv(B) = conv(C) + B by [53, Theorem 1.1.2] and the convexity of B . Note that conv(C) is compact by [54, Theorem 2.3.4]. A is the sum of a compact set and a closed set and, hence, closed [55, Exercise 1.3(e)]. 1) Proof of Theorem 9: For (µ, R1 , R2 ) ∈ R, let (f, g) be an (n, R1 , R2 )-code such that Θ(f ; g) ≥ µ. Defining the random variables Ui := Xi−1 , f (X) and Vi := Zi−1 , g(Z) for i ∈ [1 : n] we obtain   nR1 ≥ H f (X) = I f (X); X (128) n X  = I f (X); Xi Xi−1 (129) i=1 = n X I(Ui ; Xi ), (130) i=1 where (130) holds because X are i.i.d. Analogously, we have nR2 ≥ n X I(Vi ; Zi ). (131) i=1 From Lemma 43 and the Markov chain f (X) −◦− X −◦− Z −◦− g(Z), we obtain  nµ ≤ I f (X); g(Z)    = I f (X); X + I g(Z); Z − I f (X)g(Z); XZ n h i X = I(Ui ; Xi ) + I(Vi ; Zi ) − I(Ui Vi ; Xi Zi ) . (132) (133) (134) i=1 Now a standard time-sharing argument shows R ⊆ Ro . Lemma 43 provides Ro ⊆ R0o . 2) Proof of Proposition 10: Most steps in the proof apply to both Ro and R0o . We thus state the proof for Ro and point out the required modifications where appropriate. For fixed random variables (X, Z) define the set of pmfs (with finite, but arbitrarily large support) Q := {pU,X,Z,V : U −◦− X −◦− Z, X −◦− Z −◦− V}, (135) and the compact set of pmfs with fixed alphabet size Q(a, b) := {pU,X,Z,V ∈ Q : |U| = a, |V| = b}. (136) Define the continuous vector valued function F := (F1 , F2 , F3 ) as F1 (pU,X,Z,V ) := I(X; U) + I(Z; V) − I(UV; XZ), (137) 22 (138) F2 (pU,X,Z,V ) := I(U; X), F3 (pU,X,Z,V ) := I(V; Z). (139) In the proof of R0o =conv(So0 ) let F1 (pU,X,Z,V ) := min{I(U; Z), I(V; X)}. We can now write Ro = F (Q) + O and So = F Q(|X |, |Z|) + O where O := (R− × R+ × R+ ). Since Ro is convex, we may define the extended real function ψ(λ) := inf x∈Ro λ · x and obtain [54, Theorem 2.2, 3.] o \ n conv(Ro ) = Ro = x ∈ R3 : x · λ ≥ ψ(λ) . (140) λ∈R3 From the definition of Ro , we have ψ(λ) = −∞ if λ ∈ / O, and ψ(λ) = inf p∈Q λ · F (p) otherwise. This shows, that o \ n Ro = x ∈ R3 : x · λ ≥ ψ(λ) (141) λ∈O and using the same argument, one can also show that o \ n e conv(So ) = x ∈ R3 : x · λ ≥ ψ(λ) , e ψ(λ) = λ∈O min p∈Q(|X |,|Z|) λ · F (p). (142) e We next show that ψ(λ) = ψ(λ) for λ ∈ O. For arbitrary λ ∈ O and δ > 0, we can find random variables e X, Z, V) e ∼ e (U, p ∈ Q with λ · F (e p ) ≤ ψ(λ) + δ . By compactness of Q(a, b) and continuity of F , there is e e p ∈ Q(|U|, |V|) with λ · F (p) = min e p̂∈Q(|Ue|,|V|) λ · F (p̂) ≤ λ · F (e p ) ≤ ψ(λ) + δ. (143) We now show that there exists p̂ ∈ Q(|X |, |Z|) with λ · F (p̂) = λ · F (p). (144) As a consequence of the inequalities F1 ≤ F2 and F1 ≤ F3 we have λ · F (p) = 0 if λ1 + max{λ2 , λ3 } ≥ 0. Thus, we only need to show (144) for λ ∈ O with λ1 + λ2 < 0 and λ1 + λ3 < 0. To this end we use the perturbation method [56], [57] and perturb p , obtaining the candidate  (Û, X, Z, V̂) ∼ p̂(u, x, z, v) = p(u, x, z, v) 1 + εφ(u) . (145) We require 1 + εφ(u) ≥ 0, E [φ(U)] = 0, E[φ(U)|X = x, Z = z] = 0, for every u ∈ U, (146) if p(x, z) > 0. (148) (147) The conditions (146) and (147) ensure that p̂ is a valid pmf and (148) implies p̂ ∈ Q. Observe that there is an ε0 > 0 for any φ, such that (146) is satisfied for ε ∈ [−ε0 , ε0 ]. Furthermore, (148) is equivalent to E[φ(U)|X = x] = 0, for every x ∈ X (149) due to the Markov chain U −◦− X −◦− Z. Note also that (149) already implies (147). If |U| ≥ |X | + 1 there is a non-trivial solution to (149), which means there exists φ 6≡ 0 such that (146)–(148) are satisfied. We have h λ · F (p̂) = λ1 I(X; U) − I(UV; XZ) + H(Z) + εHφ (U) − εHφ (UX) i − εHφ (UV) + εHφ (UXZV) + H(V̂) − H(ZV̂) + λ2 [I(X; U) + εHφ (U) − εHφ (UX)] + λ3 [H(Z) + H(V̂) − H(ZV̂)]. (150) P Here, we used the shorthand Hφ (UX) := − u,x p(u, x)φ(u) log p(u, x) and analogous for other combinations of 23 random variables. By (143), we have ∂2 ∂ε2 λ · F (p̂) ε=0 ≥ 0. Observe that  ∂ ∂ X p̂(z, v) H(V̂) − H(ZV̂) = p̂(z, v) log ∂ε ∂ε z,v p̂(v) = X ∂p̂(z, v) ∂ε z,v and consequently, log ∂p̂(v) p̂(z, v) ∂p̂(z, v) p̂(z, v) ∂ε + − p̂(v) ∂ε p̂(v) ∂2 ∂2 λ · F (p̂) = (λ + λ ) (H(V̂) − H(ZV̂)) 1 3 ∂ε2 ∂ε2  X ∂p̂(z, v) 2 1 = (λ1 + λ3 ) ∂ε p̂(z, v) z,v   ∂p̂(v) 2 p̂(z, v) ∂p̂(z, v) ∂p̂(v) 1 . −2 + ∂ε ∂ε p̂(v) ∂ε p̂(v)2 Here we already used that ∂ 2 p̂(v) ∂ε2 ≡ ∂ 2 p̂(z,v) ∂ε2 (151) (152) (153) (154) ≡ 0. It is straightforward to calculate ∂p̂(v) = p(v)E[φ(U)|V = v], ∂ε ∂p̂(z, v) = p(z, v)E[φ(U)|V = v, Z = z], ∂ε p̂(z, v)|ε=0 = p(z, v), (155) (156) (157) (158) p̂(v)|ε=0 = p(v), and thus, taking into account that λ1 + λ3 < 0, X 2 0≥ p(z, v) E[φ(U)|V = v, Z = z] − E[φ(U)|V = v] , (159) z,v which implies for any (z, v) ∈ Z × V with p(z, v) > 0, X X p(u|z, v)φ(u) = p(u|v)φ(u). u (160) u From (160) we can conclude X p̂(z, v) p̂(v) z,v  P X û p(û, z, v) 1 + εφ(û)  = p(u, z, v)(1 + εφ(u)) log P p(û, v) 1 + εφ(û) û z,v,u  P X p(z, v) 1 + ε û p(û|z, v)φ(û)  P = p(u, z, v)(1 + εφ(u)) log p(v) 1 + ε p(û|v)φ(û) û z,v,u p(z, v) (160) X = p(u, z, v)(1 + εφ(u)) log p(v) z,v,u X X p(z, v) p(z, v) = p(z, v) log +ε φ(u)p(u, z, v) log p(v) p(v) z,v z,v,u H(V̂) − H(ZV̂) = p̂(z, v) log = H(V) − H(ZV) + εHφ (V) − εHφ (ZV), where we used Hφ (V) := − X u,v p(u, v)φ(u) log p(v), (161) (162) (163) (164) (165) (166) (167) 24 Hφ (ZV) := − X p(u, z, v)φ(u) log p(z, v). (168) u,z,v Substituting in (150) shows that λ · F (p̂) is linear in ε. And by the optimality of p it must be constant. We may now choose ε maximal, i. e., such that there is at least one u ∈ U with p(u)(1 + εφ(u)) = 0. This effectively reduces the cardinality of Û by at least one and may be repeated until |Û| = |X | (as then φ ≡ 0). The same process can be carried out for V and yields p̂ ∈ Q(|X |, |Z|) such that (144) holds. In the proof of R0o = conv(So0 ), we show (144) by applying the support lemma [13, Appendix C] with |X | − 1 test functions tx (pX̂ ) := pX̂ (x) (x ∈ X \ x0 ) and with the function  f (pX̂ ) := λ1 min{I(V; X), H(Z) − H(Ẑ)} + λ2 H(X) − H(X̂) + λ3 I(Z; V), (169) e and where (Ẑ, X̂) ∼ pX̂ pZ|X . Consequently there exists a random variable Û with (Û, X, Z, V) ∼ p̂ ∈ Q(|X |, |V|) λ · F (p̂) = λ · F (p). By applying the same argument to V, we obtain p̂ ∈ Q(|X |, |Z|) such that (144) holds. By combining (143) and (144) we obtain λ · F (p̂) = λ · F (p) ≤ ψ(λ) + δ. (170) e , which implies Ro = conv(So ) using As δ > 0 was arbitrary and Q(|X |, |Z|) is compact, we proved ψ(λ) = ψ(λ) (141) and (142). We find Ro = conv(So ) by writing Ro = conv(F (Q(|X |, |Z|)) + O) (171) = conv(F (Q(|X |, |Z|))) + O (172) = Ro , (174) ⊆ F (Q) + O (173) where (172) follows from Lemma 44. The relation (173) is a consequence of Q(|X |, |Z|) ⊆ Q and the convexity of F (Q). 3) Proof of Proposition 13: We only need to show conv(Si ) = conv(Ri ) as the cardinality bound |Q| ≤ 3 follows directly from the strengthened Carathéodory theorem [58, Theorem 18(ii)] because conv(Ri ) is the convex hull of a connected set in R3 . We will only show the cardinality bound |U| ≤ |X |. The corresponding bound for |V| follows analogously. We note that the weaker bounds |U| ≤ |X | + 1 and |V| ≤ |Z| + 1 can be shown directly using the convex cover method [13, Appendix C], [32], [59]. Define the continuous vector-valued function  e e e e e e F (pU, (175) e X, e Z, eV e ) := I(U; V), I(X; U), I(Z; V) , and the compact, connected sets of pmfs n    o e e Q := pU, , e X, e Z, eV e : pU, e X, e Z, eV e = pU|X e pX,Z pV|Z e , U = 0 : |X | , V = 0 : |Z| n  o e := p e e e e ∈ Q : Ue = 1 : |X | . Q U,X,Z,V To complete the proof of the proposition, it suffices to show   e , conv F (Q) ⊆ conv F (Q) (176) (177) (178) since we then have with O := (R− × R+ × R+ ),  conv(Ri ) = conv F (Q) + O  = conv F (Q) + O (178)  e +O ⊆ conv F (Q)  e +O = conv F (Q) = conv(Si ), (179) (180) (181) (182) (183) 3 where (180) and (182) follow  from Lemma 44. The region F (Q) ⊆ R is compact [22, Theorem 4.22]. Therefore, its convex hull conv F (Q) is compact [60, Corollary 5.33] and can be represented as an intersection of halfspaces 25 in the following manner [54, Proposition 2.2, 3.]: Defining V (λ) := maxx∈F (Q) λ · x for λ = (λ1 , λ2 , λ3 ) ∈ R3 , we have o \ n  conv F (Q) = x ∈ R3 : λ · x ≤ V (λ) . (184) λ∈R3 With the same reasoning we obtain o \ n  e = conv F (Q) x ∈ R3 : λ · x ≤ Ve (λ) , λ∈ (185) R3 e where Ve (λ) := maxx∈F (Q) e λ · x. We next show V (λ) ≥ V (λ) which already implies (178) due to (184) and (185). Let t = (tx )x∈X \x0 be |X | − 1 test functions tx (pXe ) := pXe (x) for all but one x ∈ X . Choose any λ ∈ R3 and fix (U, X, Z, V) ∼ p ∈ Q that achieve λ · F (p) = V (λ). Define the continuous function e + λ2 (H(X) − H(X)) e + λ3 I(Z; V) f (pXe ) := λ1 (H(V) − H(V)) (186)  e Z, e X) e ∼ pV|Z pZ|X p e . The point (pX (x))x∈X \x , V (λ) lies in the convex hull of the compact [61, where (V, 0 X  Theorem 26.5] and connected [22, Theorem 4.22] set (t, f ) Q . Therefore, by the strengthened Carathéodory theorem [58, Theorem 18(ii)], i. e., there exists a random variable U0 with |U 0 | = |X | and thus  |X | points 0suffice,  e, such that EU0 f (pX|U0 ( · |U )) = λ · F (pU0 ,X,Z,V ) = V (λ). This shows Ve (λ) ≥ V (λ). pU0 ,X,Z,V ∈ Q By applying the same reasoning to V, one can show that |V| = |Z| also suffices. e = X ⊕ N1 and V e = Z ⊕ N2 , where N1 , N2 ∼ B(α) are independent of (X, Z) 4) Proof of Proposition 17: With U  and of each other, it follows that (µ, R, R) := log 2 − h2 (α ∗ p), log 2 − h2 (α), log 2 − h2 (α) ∈ R0o for α ∈ (0, 12 ). Assume (µ, R, R) ∈ Si0 and choose U, V, and Q according to Proposition 13. We then have H(X|UQ) ≥ h2 (α), (187) I(U; V|Q) ≥ log 2 − h2 (α ∗ p). (189) H(Z|VQ) ≥ h2 (α), (188) Using Mrs. Gerber’s Lemma (MGL) [35, Theorem 1], we obtain   (188) H(X|VQ) ≥ h2 h−1 H(Z|VQ) ∗ p ≥ h2 (α ∗ p). 2 (190) Thus, I(X; V|Q) ≤ log 2 − h2 (α ∗ p) and furthermore I(X; V|Q) ≥ I(U; V|Q) due to U −◦− (X, Q) −◦− V. These two inequalities in combination with (189) imply I(X; V|Q) = I(U; V|Q), which amounts to X −◦− (U, Q) −◦− V. We can therefore write the joint pmf of (U, X, V, Q) in two ways, as pU,X,V,Q (u, x, v, q) = pX (x)pQ (q)pU|X,Q (u|x, q)pV|X,Q (v|x, q) (191) = pX (x)pQ (q)pU|X,Q (u|x, q)pV|U,Q (v|u, q). (192) Assume without loss of generality that pQ (q) > 0 for all q ∈ Q. If pU|X,Q (u|x, q) > 0 then (192) necessitates pV|U,Q (v|u, q) = pV|X,Q (v|x, q) for v ∈ {0, 1}. Next, we partition Q into three disjoint subsets  Q1 := q ∈ Q : P{U = X|Q = q} = 1 or P{U = X ⊕ 1|Q = q} = 1 ,  Q2 := q ∈ Q : P{U = 0|Q = q} = 1 or P{U = 1|Q = q} = 1 ,  Q3 := q ∈ Q : pU|X,Q (0|x, q) > 0 and pU|X,Q (1|x, q) > 0 for some x ∈ {0, 1} . (193) (194) (195) (196) Given q ∈ Q3 , we apply (193) twice and obtain pV|U,Q (v|0, q) = pV|X,Q (v|x, q) = pV|U,Q (v|1, q), (197) i. e., I(U; V|Q = q) = 0, which is also true for q ∈ Q2 . We can thus write (189)  log 2 − h2 (α ∗ p) ≤ I(U; V|Q) ≤ P{Q ∈ Q1 } I(X; Z) = P{Q ∈ Q1 } log 2 − h2 (p) . (198) 26 On the other hand we have (187) (194)   h2 (α) ≤ H(X|UQ) ≤ P Q ∈ (Q2 ∪ Q3 ) log 2 = 1 − P{Q ∈ Q1 } log 2. (199) Combination of the previous two inequalities leads to (199) log 2 − h2 (α ∗ p) (198) h2 (α) ≤ P{Q ∈ Q1 } ≤ 1 − , log 2 − h2 (p) log 2 which is a contradiction since log 2−h2 (α∗p) log 2−h2 (p) >1− (200) h2 (α) log 2 . B. Proofs from Section III 1) Proof of Theorem 24: If (µΩ , RK ) ∈ R we obtain an (n, RK )-code fK for  some n ∈ N such that (37) holds. Define Wk := fk (Xk ) and the auxiliary random variables Uk,i := Wk , Xi−1 for k ∈ K and i ∈ [1 : n]. For any K two sets A, C ⊆ K we have X n Rk ≥ H(WA ) (201) k∈A (202) = I(WA ; XK ) ≥ I(WA ; XK |WC ) n   X = I WA ; XK,i WC Xi−1 K,1 (203) (204) i=1 = n X i=1 I(UA,i ; XK,i |UC,i ), (205) where (203) follows from WA −◦− XK −◦− WC . Furthermore, for any pair (A, B) ∈ Ω we have by Lemma 43 and WA −◦− XA −◦− XB −◦− WB ,  nµA,B ≤ I WA ; WB (206)    = I WA ; XA + I WB ; XB − I WA WB ; XA XB (207) n i Xh = I(UA,i ; XA,i ) + I(UB,i ; XB,i ) − I(UA,i UB,i ; XA,i XB,i ) . (208) i=1 Now a standard time-sharing argument shows R ⊆ Ro . Lemma 43 implies Ro ⊆ R0o . 2) Proof of Proposition 26: Pick an   arbitrary k ∈ K. For nonempty A, B ⊆ K with k ∈ B we can write H(XA |UB ) = EUk fA,B (pXk |Uk ( · |Uk )) where  fA,B (pXk |Uk ( · |uk )) := H XA UB\k , Uk = uk . (209)   Furthermore, H(UA |UB ) = EUk gA,B (pXk |Uk ( · |Uk )) where  gA,B (pXk |Uk ( · |uk )) := H UA UB\k , Uk = uk . (210) Observe that both fA,B and gA,B are continuous functions of pXk |Uk ( · |uk ). Apply the support lemma [13, Appendix C] with the functions fA,B and gA,B for all nonempty A, B ⊆ K such that k ∈ B , and |Xk | − 1 test functions, 0 which guarantee  that the marginal distribution p0Xk does not change. We obtain a new random variable Uk with 0 H XA UB\k Uk = H(XA |UB ) and H UA UB\k Uk = H(UA |UB ). By rewriting (41)–(43) in terms of conditional entropies, it is evident that the defining inequalities for Ri remain the same when replacing Uk by U0k . The support of U0k satisfies the required cardinality bound:3 Uk0 ≤ |Xk | − 1 + 2(2K − 1)2K−1 = |Xk | − 1 + 2 3 2K There are (2K − 1) ways to choose A and 2K−1 ways to choose B. −2 K (211) (212) 27 ≤ |Xk | + 4K . (213) The same process is repeated for every k ∈ K. 3) Proof of Lemma 31: Defining U = f (X), we have for every m ∈ M with P{U = m} = 6 0    E dLL g(f (X)), Y U = m = −E[log g(m)(Y)|U = m] X =− pY|U (y|m) log g(m)(y) (214) (215) y∈Y  = H(Y|U = m) + D pY|U ( · |m) g(m)( · ) ≥ H(Y|U = m), (216) (217) where (217) follows as KL-divergence is non-negative [23, Theorem 2.6.3]. The final result follows by calculating the expectation over U. By [23, Theorem 2.6.3], g(m) = pY|U ( · |m) is a necessary and sufficient condition for equality. ek = I(Xk ; Uk ) + ε00 /2 for each k ∈ K. 4) Proof of Lemma 34: Fix 0 < ε0 , ε00 < ε and set R e fk := enRk and M fk := [1 : M fk ]. We apply the generalized Markov lemma • Encoding: For n ∈ N define M (k) (Lemma 59) and consider the random codebooks Ck := (Vm )m∈M fk , which are drawn independently uniform n e k = fek (Xk , Ck ) and the from T[Uk ] for each k ∈ K. Denote the resulting randomized coding functions as W (k) e k := V . If n is chosen large enough we have therefore corresponding decoded value as U ek W n e K , XK ) ∈ P (U / Tn [UK XK ] o ≤ ε0 . (218) fk into Mk := en(Rk +ε00 ) equally Next, we introduce (deterministic) binning. If Rk < I(Xk ; Uk ), partition M sized, consecutive bins, each of size en∆k with ek − Rk − ε00 = I(Xk ; Uk ) − Rk − ∆k := R • ε00 . 2 (219) fk → Mk := [1 : Mk ] maps a codeword index to the index of the bin, it The deterministic function βk : M belongs to. In total the encoding function becomes fk := βk ◦ fek . If Rk ≥ I(Xk ; Uk ), we do not require binning fk and hence fk := fek . and let βk be the identity on M n for each ∅ 6= A e ⊆ A ⊆ K is Decoding: Given the codebooks, the decoding procedure gA,Ae : MA → UA e −1 fA be all indices that belong to the bin indices e := βA carried out as follows: Given w ∈ MA , let m (w) ⊆ M (A) n n w. Consider only the typical sequences Vm e ∩ T[UA ] =: Φ ⊆ UA . If Φ 6= ∅, choose the lexicographically e (A) smallest element of4 ΦAe, otherwise choose the lexicographically smallest element of Vm e . e e Let A, A, B, B ⊆ K be sets of indices such that the conditions (41) and (42) are satisfied. Using Wk := fk (Xk , Ck ) and the randomized decodings Û1 := gA,Ae(WA , CA ), Û2 := gB,Be(WB , CB ), consider the error event E0 := {(Û1 , XA , XB , Û2 ) ∈ / T[Un eXA XB U e] }. Define the other events A B e A , X A , XB , U e B) ∈ E1 := {(U / T[Un eXA XB U e] }, B n  oA (A) n := E2 VW ∩ T[UA ] >1 , e n A o (B) E3 := VM ∩ T[UnB ] >1 , Be (220) (221) (222) −1 where we used the random sets of indices W := βA (WA ) and M := βB−1 (WB ). We clearly have E0 ⊆ E1 ∪ E2 ∪ E3 and thus P{E0 } ≤ P{E1 } + P{E2 |E1c } + P{E3 |E1c } (218) ≤ P{E2 |E1c } + P{E3 |E1c } + ε0 . 4 e Note that ΦAe is the restriction of Φ to the indices in A. (223) (224) 28 S −1 We can partition the random set of indices W = βA (WA ) = A0 ⊆A DA0 into (random) subsets o n e A00 and m e k , ∀k ∈ A0 , e ∈W:m e A00 = W e k 6= W DA0 := m (225) e A }. For each set ∅ 6= A0 ⊆ A we define the error event where we used A00 := A \ A0 . Observe that D∅ = {W n o (A) EA0 := VDA0 ∩ T[UnA ] 6= ∅ (226) and obtain E2 ⊆ which implies P{E2 |E1c } ≤ [ EA0 , (227) X P{EA0 |E1c }. (228) 0 A ⊆A: e=∅ A0 ∩A6 0 A ⊆A: e=∅ A0 ∩A6 0 Q ) e ∈ DA0 , we have that V(A By construction, DA0 has k∈A0 (en∆k − 1) elements. For m are uniformly distributed e m Q n c n e e e A00 = WA00 . Given E1 we have in particular UA ∈ T[UA ] . Thus, for any uA00 ∈ T[Un 00 ] , we on k∈A0 T[Uk ] and m A can conclude,    [  n o (A) n c e 00 e A00 = uA00 = P 00 P EA0 E1c , U {Vm ∈ T } E , U = u (229) A A 1 [UA ] e   e ∈DA0 m o X n (A) n c e 00 00 ≤ P Vm (230) e ∈ T[UA ] E1 , UA = uA e ∈DA0 m ≤ exp n X 0 k∈A ∆k !! !! T[UnA0 |UA00 ] (uA00 ) Q n k∈A0 T[Uk ]  exp n(H(UA0 |UA00 ) + ε0 (n))  P ≤ exp n ∆k exp n( k∈A0 H(Uk ) − εk (n)) k∈A0 !! X  ≤ exp n ε(n) + H(UA0 |UA00 ) + ∆k − H(Uk ) , X (231) (232) (233) k∈A0 P where ε(n) = k∈A0 ∪0 εk (n) goes to zero as n → ∞. Here, (232) follows from parts 2 and 3 of Lemma 58. We ek and (41) imply for any ∅ 6= A0 ⊆ A with A0 ∩ Ae = observe that the definition of R 6 ∅ that X X ε00 ∆k ≤ − − H(UA0 |UA00 ) + H(Uk ). (234) 2 0 0 k∈A k∈A e A00 in (233) and use (234) to obtain Marginalize over U    ε00 P{EA0 |E1c } ≤ exp n ε(n) − ≤ ε0 2 (235) for n large enough. Applying the same arguments to P{E3 |E1c } and combining (224), (228) and (235), we have P{E0 } ≤ ε0 + 2|A| ε0 + 2|B| ε0 ≤ 2K ε0 . (236) For a set ∅ 6= A ⊆ K, we next analyze the random quantity LA := CA ∩ T[UnA ] . For n large enough, we have 29 e A ∈ CA for any V E [LA ] ≤ E = " X VA ∈CA Y k∈A = Y k∈A ≤ ≤ Y k∈A Y k∈A h E 1T[Un ] (VA ) CA ! A h i e f n Mk E 1T[U ] (VA ) fk M Q fk M ! # (237) (238) A ! ! i T[UnA ] k∈A en fk en M en (239) T[Unk ]  H(UA )+ε0 (n) P k∈A  (240) H(Uk )−εk (n) H(UA )− P k∈A  H(Uk )+ε(n) !! ε00 = exp n H(UA ) + ε(n) + I(Uk ; Xk ) + − H(Uk ) 2 k∈A !! ε00 X = exp n H(UA ) + ε(n) + |A| − H(Uk |Xk ) 2 k∈A    ε00 = exp n I(UA ; XA ) + ε(n) + |A| , 2 X (241) (242) (243) (244) P where ε(n) = k∈A∪0 εk (n) goes to zero as n → ∞. Here, (240)follows from parts 1 and 2 of Lemma 58. Assume  that ε00 is such that Kε00 /2 < ε. Defining the error event E4 = LA ≥ exp n(I(UA ; XA ) + ε) , we know from Markov’s inequality that for n large enough    ε00 P{E4 } ≤ exp n ε(n) − ε + |A| ≤ ε0 . (245) 2 Using (236) and (245) we can apply Lemma 45 and obtain deterministic encoding functions fk : Xkn → Mk , and n such that (55) holds whenever the conditions (41) and (42) deterministic decoding functions gA,Ae : MA → UA e are satisfied. Taking into account that gA,Ae(MA ) × gB,Be(MB ) ⊆ CA∪ e Be, we also have (54). (Note that, given a specific code, P{E4 |CK = cK } < 1 already implies P{E4 |CK = cK } = 0 as the event E4 is determined by the code CK alone.) 5) Proof of Proposition  39: Pick arbitrary j, k ∈ J .For nonempty B ⊆  J with j ∈ B we can write H(Xk |UB ) = EUj fk,B pXj |Uj ( · |Uj ) as well as H(Y|UB ) = EUj gB pXj |Uj ( · |Uj ) , where   fk,B pXj |Uj ( · |uj ) := H Xk UB\j , Uj = uj , (246)   gB pXj |Uj ( · |uj ) := H Y UB\j , Uj = uj . (247) Observe that fk,B and gB are continuous functions of pXj |Uj ( · |uj ). Apply the support lemma [13, Appendix C] with the functions fk,B and gB for all k ∈ J , j ∈ B ⊆ J , and |Xj | − 1 test functions, which guarantee that the marginal distribution pXj does not change. We obtain a new random variable Ûj with H(Xk |UB\j Ûj ) = H(Xk |UB ) and H(Y|UB\j Ûj ) = H(Y|UB ). By rewriting (83)–(88) in terms of conditional entropies, it is evident that the (<,I) defining inequalities for RMI remain the same when replacing Uj by Ûj . The support of Ûj satisfies the required cardinality bound5 |Ûj | ≤ |Xj | − 1 + J2J−1 + 2J−1 ≤ |Xj | + 4J . 5 There are J ways to choose k and 2J−1 ways to choose B. (248) (249) 30 The same process is repeated for every j ∈ J . 6) Proof of Theorem 40: Pick a total order < on J , a set I ⊆ J and (UJ , ∅) ∈ P∗ . To obtain a code we apply Lemma 34 with K = J + 1, XK = UK = Y, B = Be = {K}, Ae = A for all ∅ 6= A ⊆ J , and rates Rj = I(Uj ; Xj |U=j ), RK = log|Y|, as suggested by Proposition 28. As in the proof of Lemma 34 let fej denote the encoding function without binning and with rate n−1 log fej ≤ I(Uj ; Xj ) + 2ε . Furthermore, let fj0 be the encoding function including binning, obtaining a rate of n−1 log |fj0 | ≤ I(Uj ; Xj |U=j ) + ε. Finally we obtain the (n, RJ + ε)-code fJ by setting fj := fej for j ∈ I and fj := fj0 for j ∈ / I . Let the decoding functions be gA := gA,A e j := fej (Xj ) for all ∅ 6= A ⊆ J . Furthermore, for each j ∈ J , we define the decoding function gej , which maps W (j) onto its codebook entry, i. e., gej (w) = Vw (using the notation from Appendix B4). Also let Wj := fj (Xj ) and e j. Wj0 := fj0 (Xj ). For later use, we note that Wj0 is a function of Wj , which is in turn a function of W  0 n 0 Let the event SA be the success event that joint typicality Y, XA , gA (WA ) ∈ T[YXA UA ] holds. Also let Sej be  e j) ∈ T n the event that Y, Xj , gej (W . For any A = wk , k ∈ J , and A0 ⊆ A, we have [YXj Uj ] X X Rj = j∈A0 j∈A0 ≥ X 0 j∈A I(Uj ; Xj |U=j ) I Uj ; XA0 U=j , UA\A0  = I UA0 ; XA0 UA\A0 . (250)  (251) (252) 0 } ≥ 1 − ε by Lemma 34. Thus, (252) shows that condition (41) is satisfied and for n large enough we have P{SA Clearly also P{Sej } ≥ 1 − ε for each j ∈ J and n large enough, using Lemmas 56 and 57. Pick an arbitrary6 ε0 > 0. Provided that n is large enough and ε small enough, we have for any A = wk  1 1 0 I(Y; WA ) ≥ I Y; WA (253) n n  1 0 ) (254) ≥ I Y; gA (WA n  1 0 = H(Y) − H Y gA (WA ) (255) n  1 0 ≥ H(Y) − H Y, 1SA0 gA (WA ) (256) n  1  1 0 0 = H(Y) − H 1SA0 gA (WA ) − H Y gA (WA ), 1SA0 (257) n n  1 0 0 ≥ H(Y) − ε0 − (1 − ε)H Y gA (WA ), SA − εH(Y) (258) n  1 0 0 ≥ H(Y) − ε0 − H Y gA (WA ), SA (259) n 1X  0 0 n ≥ H(Y) − ε0 − (uA ) (260) P gA (WA ) = uA SA log T[Y|U A] n u A ≥ H(Y) − H(Y|UA ) − ε0 0 = I(UA ; Y) − ε . (261) (262) Here, (253) and (254) follow from the data processing inequality [23, Theorem 2.8.1], we applied the entropy bound [23, Theorem 2.6.4] in (260), and part 3 of Lemma 58 in (261). For A = J we specifically obtain (87) 1 I(Y; WJ ) ≥ I(UJ ; Y) − ε0 ≥ νJ − ε0 . (263) n For k ∈ J and A = =k we obtain the following chain of inequalities, where (268) and (269) will be justified 6 In what follows, we will routinely merge expressions that can be made arbitrarily small (for n large and ε sufficiently small) and bound them by ε0 . 31 subsequently.  1  1 1 0 I(Y; Wk ) ≥ I Y; Wk0 ≥ I Y; Wk0 WA n n n  1  1 0 0 0 = I Y; Wk WA − I Y; WA n n (262)  1 0 ≥ I(UA Uk ; Y) − ε0 − I Y; WA n  1  1 0 0 0 + I XA ; WA Y = I(UA Uk ; Y) − ε − I XA ; WA n n  1 0 ≥ I(UA Uk ; Y) − ε0 − I(XA ; UA ) + H(XA |Y) − H XA WA ,Y n ≥ I(UA Uk ; Y) − ε0 − I(XA ; UA ) + H(XA |Y) − H(XA |UA , Y) = I(Uk ; Y|UA ) − ε 0 (85) ≥ νk − ε0 . (264) (265) (266) (267) (268) (269) (270) (271) 0 − Equality in (267) follows from the Markov chain WA ◦− XA −◦− Y. In (268), we used that for ε small enough and n large enough, we have  1  1 0 0 I XA ; WA = H WA (272) n n X  1 ≤ H Wj0 (273) n j∈A  X ≤ I(Uj ; Xj |U=j ) + ε (274) j∈A ≤ I(UA ; XA ) + ε0 , (275) where (273) follows from the chain rule for entropy [23, Theorem 2.2.1] and the data processing inequality [23, Theorem 2.8.1] and (274) follows from the entropy bound [23, Theorem 2.6.4] and the fact that n−1 log fj0 ≤ I(Uj ; Xj |U=j ) + ε. The inequality (269) follows similar to (262) as for n large enough and ε small enough,  1  1 0 0 H XA WA , Y ≤ H XA gA (WA ), Y (276) n n  1 0 ≤ H XA , 1SA0 gA (WA ), Y (277) n  1 0 0 ≤ ε0 + H XA gA (WA ), Y, SA (278) n X  1 0 0 ≤ ε0 + P gA (WA ) = uA , Y = y SA log T[XnA |UA ,Y] (uA , y) (279) n u ,y A 0 ≤ ε + H(XA |UA , Y). (280) For k ∈ I , we have similarly to (262) that  1 1 ek I(Y; Wk ) = I Y; W n n  1 e k) ≥ I Y; gek (W n  1 e k) = H(Y) − H Y gek (W n  1 e k) ≥ H(Y) − H Y, 1Sek gek (W n  1  1 e k ), 1 e ≥ H(Y) − H 1Sek − H Y gek (W S k n n (281) (282) (283) (284) (285) 32  1 e k ), Sek H Y gek (W n o 1X n 0 e k ) = uk Sek log T n (uk ) P geA (W ≥ H(Y) − ε − [Y|Uk ] n u ≥ H(Y) − ε0 − (286) (287) k ≥ H(Y) − ε0 − H(Y|Uk ) (288) = I(Uk ; Y) − ε0 ≥ νk − ε0 . (289) (86) 7) Proof of Theorem 41: For (νΠ , RJ ) ∈ RMI we apply Definition 27, choosing an (n, RJ )-code fJ for XJ and define Uj := fj (Xj ) for j ∈ J . For any A ⊆ J we thus have 1 I(UA ; Y) ≥ νA . n i−1 With Uj,i := (Uj , Xi−1 , Yni+1 ) we have j,1 ) and Qi := (Y X n Rj ≥ H(UB ) (290) (291) j∈B (292) = I(UB ; XB ) (293) = I(UB ; XB , Y) = I(UB ; Y) + I(UB ; XB |Y)  (294) = I(UA UB ; Y) − I UA\B ; Y UB + I(UB ; XB |Y)   = I(UA ; Y) + I UB\A ; Y UA − I UA\B ; Y UB + I(UB ; XB |Y)   ≥ nνA + I UB\A ; Y UA − I UA\B ; Y UB + I(UB ; XB |Y)  ≥ nνA − I UA\B ; Y + I(UB ; XB |Y) n X    νA − I UA\B ; Yi Yi−1 + I UB ; XB,i YXi−1 = B (295) ≥ (300) = i=1 n X i=1 n X i=1    i−1 νA − I UA\B,i ; Yi Qi + I UB ; XB,i YXB    νA − I UA\B,i ; Yi Qi + I(UB,i ; XB,i |Yi Qi ) . (296) (297) (298) (299) (301) The result follows by a standard time-sharing argument. Note that the required Markov chain and the independence are satisfied. 8) A Random Coding Lemma: (δ) Lemma 45. For any δ > 0 let Cδ be a random code and (Ei )i∈I finitely many error events associated with the  (δ) code Cδ . If we have P Ei ≤ δ for every i ∈ I , then, for any ε > 0 we can find δ > 0 such that there is a code  (δ) c with P Ei Cδ = c ≤ ε for every i ∈ I .  (δ) Proof. We apply Markov’s inequality to the random variable P Ei Cδ and obtain n  √ o √ δ (δ) P P Ei Cδ ≥ δ ≤ √ = δ. (302) δ Applying the union bound yields ( ) [ n  (δ) X n  (δ) √ o √ o P P Ei Cδ ≥ δ ≤ P P Ei Cδ ≥ δ (303) i∈I i∈I √ ≤ |I| δ. (304) √ √  (δ) In particular, exists at least one code c such that P Ei Cδ = c < δ for all i ∈ I if |I| δ < 1. Choosing  2 there 1 δ = min ε , 2|I|2 yields the desired result. 33 9) Results on Convex Polyhedra: Let H be the convex polyhedron H := {x ∈ Rn : Ax ≥ b} for an m × n matrix A = (a(1) , a(2) , . . . , a(m) )T and b ∈ Rm , where aT (j) is the j th row of A. In this section we will use the notation of [54]. In particular, we shall call a closed convex set line-free if it does not contain a (straight) line. The characteristic cone of a closed convex set C is defined as cc(C) := {y : x + λy ∈ C for all λ ≥ 0} (x ∈ C arbitrary) and ext(C) is the set of all extreme points of C , i. e., points x ∈ C that cannot be written as x = λy + (1 − λ)z with y, z ∈ C , y 6= z and λ ∈ (0, 1). Lemma 46. A point y is in cc(H) if and only if Ay ≥ 0. Proof. If Ay ≥ 0, x ∈ H and λ ≥ 0, A(x + λy) ≥ Ax ≥ b. On the other hand, for aT (j) y < 0, we have aT (j) (x + λy) < bj for λ > bj −aT (j) x aT (j) y > 0. Lemma 47. If, for every i ∈ [1 : n], there exists j ∈ [1 : m] such that ei = a(j) and for every j ∈ [1 : m], a(j) ≥ 0, then H is line-free and cc(H) = Rn+ . Proof. For any y ∈ Rn+ , clearly Ay ≥ 0 and hence y ∈ cc(H) by Lemma 46. If y ∈ / Rn+ we have yi < 0 for some T i ∈ [1 : n] and choose j ∈ [1 : m] such that a(j) = ei , resulting in a(j) y = yi < 0. To show that H is line-free assume that x + λy ∈ H for all λ ∈ R. This implies ±y ∈ cc(H), i. e., y = 0. Definition 48. A point x is on an extreme ray of the cone cc(H) if the decomposition x = y + z with y, z ∈ cc(H) implies that y = λz for some λ ∈ R. It is easy to see that the points on extreme rays of O are given by x = λei for λ ≥ 0 and i ∈ [1 : n]. Define A(x) := {j ∈ [1 : m] : aT (j) x = bj }. We say that exactly n0 linearly independent inequalities are satisfied with equality at x, if Ax ≥ b and (a(j) )j∈A(x) has rank n0 . Lemma 49. x ∈ ext(H) if and only if exactly n linearly independent inequalities are satisfied with equality at x. Proof. Assuming that less than n linearly independent inequalities are satisfied with equality at x, we find 0 6= c ⊥ (a(j) )j∈A(x) and thus x ± εc ∈ H for a small ε > 0, showing that x ∈ / ext(H). 0 00 Conversely assume x ∈ / ext(H), i. e., x = λx + (1 − λ)x for λ ∈ (0, 1) and x0 , x00 ∈ H, x0 6= x00 . For 0 T 00 T 0 T 00 any j ∈ A(x), we then have λaT (j) x + (1 − λ)a(j) x = bj , which implies a(j) x = a(j) x = bj and therefore 0 6= x0 − x00 ⊥ (a(j) )j∈A(x) . Lemma 50. Assuming that H is line-free, and that exactly n − 1 linearly independent inequalities are satisfied with equality at x. Then either x = λc + (1 − λ)d where λ ∈ (0, 1) and c, d ∈ ext(H) or x = c + d where c ∈ ext(H) and d 6= 0 lies on an extreme ray of cc(H). Proof. We obtain 0 6= r ⊥ (a(j) )j∈A(x) . Define λ1 := inf{λ : x + λr ∈ H} and λ2 := sup{λ : x + λr ∈ H}. Clearly λ1 ≤ 0 ≤ λ2 . As H is line-free, we may assume without loss of generality λ1 = −1 (note that x ∈ / ext(H)) and set c = x − r . We now have c ∈ ext(H) as otherwise c − εr ∈ H for some small ε > 0. 2 If λ2 < ∞, define d = x + λ2 r which yields d ∈ ext(H) and x = λc + (1 − λ)d with λ = λ2λ+1 . Note that λ2 6= 0 as x ∈ / ext(H). If λ2 = ∞ we have x − c = r ∈ cc(H). We need to show that r is also on an extreme ray of cc(H). Assuming 0 00 T 0 T 00 r = r 0 + r 00 with r 0 , r 00 ∈ cc(H) yields aT (j) (r + r ) = 0, which implies a(j) r = a(j) r = 0 for every j ∈ A(x) by Lemma 46. For each j ∈ [0 : J], define the closed convex polyhedron H(j) := {x ∈ RK+j : A(j) x ≥ b(j) }, where A(j) is a matrix and b(j) a vector of appropriate dimension. We make the following three assumptions: 1) A(j) and b(j) are defined recursively as    (j−1)  b(j−1) A 0   A(j) :=  0T b(j) =  c(j) (305) 1 , , 1 (j) eT 1 c j 2 (j) (j) where c1 and c2 are arbitrary reals. 34 2) Each entry of A(0) equals 0 or 1 and for all k ∈ K at least one row of A(0) is equal to eT k . Due to Assumption 1, this also implies that each entry of A(j) is in {0, 1} and for all k ∈ [1 : K + j] at least one row of A(j) is equal to eT k. (j) (j) 3) For any extreme point x ∈ ext(H(0) ) and any j ∈ J , assume xj ≤ c2 − c1 . Lemma 51. Under Assumptions 1 to 3, for every k ∈ [0 : J] and every extreme point y ∈ ext(H(k) ) there is an extreme point x ∈ ext(H(0) ) and a subset Ik ⊆ [1 : k] such that yK = xK and for every j ∈ J , ( xj , j∈ / Ik , yj = (306) (j) (j) c2 − c1 , j ∈ Ik , and for every j ∈ [1 : k], yK+j = ( (j) c2 − xj , (j) c1 , j∈ / Ik , j ∈ Ik . (307) Proof. For every j ∈ J , H(j) is line-free and can be written [54, Lemma 6, p. 25]  by Assumption 2 and Lemma 47, (j) (j) (j) (j) as H = cc(H ) + conv ext(H ) . Lemma 47 also implies cc(H) = O. Let us proceed inductively over k ∈ [0 : J]. For k = 0 the statement is trivial. Given any y ∈ ext(H(k) ), we need to obtain x ∈ ext(H(0) ) and Ik such that y is given according to (306) and (307). Let z = y K+k−1 be 1 (k) (k) the truncation of y . Exactly K + k linear independent inequalities of A y ≥ b are satisfied with equality by Lemma 49, which is possible in only two different ways: (k−1) z ≥ b(k−1) are satisfied with • Construction I: Exactly K + k − 1 linear independent inequalities of A (k−1) equality, i. e., z ∈ ext(H ) by Lemma 49, and at least one of (k) (308) (k) c2 , (309) yK+k ≥ c1 , yk + yK+k ≥ • is satisfied with equality. As z ∈ ext(H(k−1) ), there exists x ∈ ext(H(0) ) and Ik−1 such that (306) holds for j ∈ J and (307) holds for j ∈ [1 : k − 1] by the induction hypothesis. In particular yk = xk . Assuming that (309) holds with equality, we (k) have yK+k = c2 − xk . Thus, the point x together with Ik = Ik−1 yields y from (306) and (307). Equality in (308) implies equality in (309) by Assumption 3. Construction II: Exactly K + k − 2 linear independent inequalities of A(k−1) z ≥ b(k−1) are satisfied with equality and (308) and (309) are both satisfied with equality as well. Additionally, these K + k inequalities together need to be linearly independent. This can occur in two different ways by Lemma 50. (k) Assume z = λx + (1 − λ)x0 for x, x0 ∈ ext(H(k−1) ), x 6= x0 and λ ∈ (0, 1). This implies yK+k = c1 and (k) (k) (k) (k) yk = λxk + (1 − λ)x0k = c2 − c1 , which by Assumption 3 already implies xk = x0k = c2 − c1 . Thus, (308) and (309) are satisfied (with equality) for every λ ∈ [0, 1] and y cannot be an extreme point as it can be written as a non-trivial convex combination. We can thus focus on the second option which is that z is on an extreme ray of H(k−1) , i. e., z = x + λek0 for some x ∈ ext(H(k−1) ), λ > 0 and k 0 ∈ [1 : K + k − 1]. If k 0 6= k , (308) and (309) are satisfied for all λ > 0 and thus y cannot be an extreme point because it can be written as a non-trivial convex combination. For k 0 = k the point x with Ik = Ik−1 ∪ k yields the desired extreme point. C. Types, Typical Sequences and Related Results In this section we introduce notions and results needed for the mathematical developments and proofs in this work. The results can be easily derived from the standard formulations provided in [13] and [25]. Definition 52 (Type; [25, Definition 2.1]). The type of a vector x ∈ X n is the random variable X̂ ∼ pX̂ ∈ P(X ) defined by pX̂ (x) = 1 N (x|x), for every x ∈ X , n (310) 35 where N (x|x) denotes the number of occurrences of x in x. For a random variable X̂, the set of n-sequences with type X̂ is denoted TX̂n . n . For a pair of random variables (X, Y), we say that y ∈ Y n has conditional type Y given x ∈ X n if (x, y) ∈ TXY n n The set of all n-sequences y ∈ Y with conditional type Y given x will be denoted TY|X (x). A key property of types is the following result, known as type counting. Lemma 53 (Type counting; [25, Lemma 2.2]). The number of different types of sequences in X n is less than (n + 1)|X | . Some important properties of types are listed in the following lemma. Lemma 54 ([25, Lemmas 2.5 and 2.6]). e on X , and x ∈ T n 1) For any two random variables X, X X h i e = x} = exp − n H(X) + D(XkX) e , P{X e is a sequence of n i.i.d. copies of X e. where X n (x) 6= ∅ 2) For a pair of random variables (X, Y) on X × Y and x ∈ X n such that TY|X   n (n + 1)−|X ||Y| exp nH(Y|X) ≤ TY|X (x) ≤ exp nH(Y|X) . (311) (312) Definition 55 (Typicality; [13, Section 2.4]). Consider X ∼ pX ∈ P(X ) and δ ≥ 0. We call the random variable Y ∼ pY ∈ P(X ) δ -typical if Y ∈ T[X]δ with e ∼ p e ∈ P(X ) : |p e (x) − pX (x)| ≤ δpX (x), ∀x ∈ X }. T[X]δ := {X X X (313) n . A sequence x ∈ X n is δ -typical if its type X̂ is δ -typical. The set of all δ -typical n-sequences is denoted T[X]δ n Given pX,Y ∈ P(X × Y) we call the elements of T[XY]δ the jointly δ -typical n-sequences. We also define the n n conditionally typical n-sequences T[Y|X]δ (x) := {y ∈ Y n : (x, y) ∈ T[XY]δ }. Typical sequences have several useful properties, which are presented in the following. Lemma 56 (Asymptotic equipartition property; [13, Sections 2.4]). Let X be n i.i.d. copies of X. For any δ > 0 we have n o n lim P X ∈ T[X]δ = 1. (314) n→∞ n , and let the random Lemma 57 (Conditional typicality lemma; [13, Section 2.5]). Choose δ 0 > 0, assume x ∈ T[X]δ 0 Qn 0 vector Y be distributed according to pY (y) = i=1 pY|X (yi |xi ). For any δ > δ we have n o n lim P Y ∈ T[Y|X]δ (x) = 1. (315) n→∞ Lemma 58 (Size of typical sets; [13, Sections 2.4 and 2.5]). The following properties hold for (X, Y) ∼ pX,Y : 1) Using ε(δ) = δH(X), n T[X]δ ≤ en(H(X)+ε(δ)) . (316) 2) For δ > 0, ε0 > 0, n sufficiently large (as a function of ε0 and pX ), and ε(δ) = δH(X), n T[X]δ ≥ (1 − ε0 )en(H(X)−ε(δ)) . (317) n (x) ≤ en(H(Y|X)+ε(δ)) . T[Y|X]δ (318) 3) For x ∈ X n and ε(δ) = δH(Y|X), 36 n . For δ > δ 0 , ε0 > 0, n sufficiently large (as a function of ε0 and p 4) Let δ 0 > 0 and x ∈ T[X]δ 0 X,Y ), and ε(δ) = δH(Y|X), n T[Y|X]δ (x) ≥ (1 − ε0 )en(H(Y|X)−ε(δ)) . (319) Remark 12. We shall adopt the δ -convention [25, Convention 2.11] and assume the existence of an adequate sequence (δn )n∈N approaching 0 for every set of random variables. We will omit δ in the notation, e. g., we will write T[X] , n , and T T[X] [X|Y] (y). Lemma 59 (Generalized Markov lemma; [62, Lemma 3.4]). Let XK and UK be such that Uk −◦− Xk −◦− (XK\k , UK\k ) for every k ∈ K and fix ε > 0. For n ∈ N and for each k ∈ K let Mk ∈ N with Mk > enI(Xk ;Uk ) . Furthermore, e k,M (Mk := [1 : Mk ]) bemutually independent random vectors, also independent of X[1 : K] , drawn uniformly let U k from T[Unk ] . Then, for sufficiently large n there exist K functions fk : Xkn × (Ukn )Mk → Mk such that, using e k,M ) and U∗ = U e k,W , we have Wk = fk (Xk , U k k k n o P (XK , U∗K ) ∈ T[XnK UK ] ≥ 1 − ε. (320) R EFERENCES [1] G. Pichler, P. Piantanida, and G. Matz, “Distributed information-theoretic biclustering of two memoryless sources,” in Proc. 53rd Annual Allerton Conference on Communication, Control, and Computing, Monticello, IL, Sep. 2015, pp. 426–433. [2] ——, “Distributed information-theoretic biclustering,” in Proc. IEEE Int. Symp. on Inform. Theory, Barcelona, Spain, Jul. 2016, pp. 1083–1087. [3] ——, “A multiple description CEO problem with log-loss distortion,” in Proc. IEEE Int. Symp. on Inform. Theory, Aachen, Germany, Jun. 2017, pp. 111–115. [4] C. E. Shannon, “Coding theorems for a discrete source with a fidelity criterion,” in Claude Elwood Shannon: collected papers, N. J. A. Sloane and A. D. Wyner, Eds. IEEE Press, 1993, pp. 325–350. [5] J. A. Hartigan, “Direct clustering of a data matrix,” Journal of the American Statistical Association, vol. 67, no. 337, pp. 123–129, Mar. 1972. [6] B. Mirkin, Mathematical Classification and Clustering. Kluwer Academic Publisher, 1996. [7] S. C. Madeira and A. L. Oliveira, “Biclustering algorithms for biological data analysis: A survey,” IEEE/ACM Trans. Comput. Biol. Bioinformatics, vol. 1, no. 1, pp. 24–45, Aug. 2004. [8] Y. Cheng and G. M. Church, “Biclustering of expression data,” in Proc. 8th Int. Conf. Intelligent Syst. for Molecular Biology, vol. 8, San Diego, CA, Aug. 2000, pp. 93–103. [9] A. Tanay, R. Sharan, and R. Shamir, “Biclustering algorithms: A survey,” Handbook of Computational Molecular Biology, vol. 9, no. 1-20, pp. 122–124, 2005. [10] R. Sharan, “Analysis of biological networks: Network modules – clustering and biclustering,” lecture notes, 2006. [Online]. Available: http://www.cs.tau.ac.il/~roded/courses/bnet07.html [11] N. Slonim, G. S. Atwal, G. Tkačik, and W. Bialek, “Information-based clustering,” Proc. of the Nat. Academy of Sciences of the United States of America, vol. 102, no. 51, pp. 18 297–18 302, Dec. 2005. [12] I. S. Dhillon, S. Mallela, and D. S. Modha, “Information-theoretic co-clustering,” in Proc. 9th ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining, Washington, DC, Aug. 2003, pp. 89–98. [13] A. El Gamal and Y.-H. Kim, Network Information Theory. Cambridge University Press, 2011. [14] J. Körner and K. Marton, “How to encode the modulo-two sum of binary sources,” IEEE Trans. Inf. Theory, vol. 25, no. 2, pp. 219–221, Mar. 1979. [15] T. S. Han, “Hypothesis testing with multiterminal data compression,” IEEE Trans. Inf. Theory, vol. 33, no. 6, pp. 759–772, Nov. 1987. [16] M. B. Westover and J. A. O’Sullivan, “Achievable rates for pattern recognition,” IEEE Trans. Inf. Theory, vol. 54, no. 1, pp. 299–320, Jan. 2008. [17] N. Tishby, F. C. Pereira, and W. Bialek, “The information bottleneck method,” in Proc. 37th Annual Allerton Conference on Communication, Control, and Computing, Monticello, IL, Sep. 1999, pp. 368–377. [Online]. Available: https://arxiv.org/abs/physics/0004057 [18] T. A. Courtade and T. Weissman, “Multiterminal source coding under logarithmic loss,” IEEE Trans. Inf. Theory, vol. 60, no. 1, pp. 740–761, Jan. 2014. [19] C. Nair, “Upper concave envelopes and auxiliary random variables,” Int. J. of Advances in Eng. Sciences and Appl. Math., vol. 5, no. 1, pp. 12–20, Mar. 2013. [20] A. A. El Gamal and T. M. Cover, “Achievable rates for multiple descriptions,” IEEE Trans. Inf. Theory, vol. 28, no. 6, pp. 851–857, Nov. 1982. [21] V. K. Goyal, “Multiple description coding: Compression meets the network,” IEEE Signal Process. Mag., vol. 18, no. 5, pp. 74–93, Sep. 2001. [22] W. Rudin, Principles of Mathematical Analysis, 3rd ed. McGraw-Hill, 1976. [23] T. M. Cover and J. A. Thomas, Elements of Information Theory. John Wiley & Sons, 2006. [24] A. Orlitsky and J. R. Roche, “Coding for computing,” IEEE Trans. Inf. Theory, vol. 47, no. 3, pp. 903–917, Mar. 2001. 37 [25] I. Csiszár and J. Körner, Information Theory: Coding Theorems for Discrete Memoryless Systems. Cambridge University Press, Aug. 2011. [26] S.-Y. Tung, “Multiterminal source coding,” Ph.D. dissertation, Cornell University, May 1978. [27] P. Gács and J. Körner, “Common information is far less than mutual information,” Problems of Control and Inform. Theory, vol. 2, pp. 149–162, 1973. [28] A. B. Wagner, B. G. Kelly, and Y. Altug, “Distributed rate-distortion with common components,” IEEE Trans. Inf. Theory, vol. 57, no. 7, pp. 4035–4057, 2011. [29] H. S. Witsenhausen, “On sequences of pairs of dependent random variables,” SIAM Journal on Applied Mathematics, vol. 28, no. 1, pp. 100–113, Jan. 1975. [30] R. Dobrushin and B. Tsybakov, “Information transmission with additional noise,” IRE Trans. on Inform. Theory, vol. 8, no. 5, pp. 293–304, Sep. 1962. [31] R. Gilad-Bachrach, A. Navot, and N. Tishby, “An information theoretic tradeoff between complexity and accuracy,” in Learning Theory and Kernel Machines. Springer, 2003, pp. 595–609. [32] R. Ahlswede and J. Körner, “Source coding with side information and a converse for degraded broadcast channels,” IEEE Trans. Inf. Theory, vol. 21, no. 6, pp. 629–637, Nov. 1975. [33] A. D. Wyner, “On source coding with side information at the decoder,” IEEE Trans. Inf. Theory, vol. 21, no. 3, pp. 294–300, May 1975. [34] H. S. Witsenhausen and A. D. Wyner, “A conditional entropy bound for a pair of discrete random variables,” IEEE Trans. Inf. Theory, vol. 21, no. 5, pp. 493–501, Sep. 1975. [35] A. Wyner and J. Ziv, “A theorem on the entropy of certain binary sequences and applications: Part I,” IEEE Trans. Inf. Theory, vol. 19, no. 6, pp. 769–772, Nov. 1973. [36] H. Witsenhausen, “Entropy inequalities for discrete channels,” IEEE Trans. Inf. Theory, vol. 20, no. 5, pp. 610–616, Sep. 1974. [37] A. Wyner, “A theorem on the entropy of certain binary sequences and applications: Part II,” IEEE Trans. Inf. Theory, vol. 19, no. 6, pp. 772–777, Nov. 1973. [38] R. Ahlswede and J. Körner, “On the connection between the entropies of input and output distributions of discrete memoryless channels,” in Proc. 5th Conf. Probability Theory, Sep. 1974, Brasov, Romania, 1977, pp. 13–23. [39] R. Ahlswede and I. Csiszár, “Hypothesis testing with communication constraints,” IEEE Trans. Inf. Theory, vol. 32, no. 4, pp. 533–542, Jul. 1986. [40] E. Erkip and T. M. Cover, “The efficiency of investment information,” IEEE Trans. Inf. Theory, vol. 44, no. 3, pp. 1026–1040, May 1998. [41] C. Chapman, personal communication, Aug. 2017. [Online]. Available: https://mathoverflow.net/questions/213084/ do-binary-symmetric-channels-maximize-mutual-information [42] R. E. Moore, R. B. Kearfott, and M. J. Cloud, Introduction to Interval Analysis. SIAM, 2009. [43] “GNU Octave,” Free Software Foundation. [Online]. Available: https://www.gnu.org/software/octave/ [44] O. Heimlich, “GNU Octave Interval Package.” [Online]. Available: https://octave.sourceforge.io/interval/ [45] G. Pichler, “DSBS-MutInf-counterexample,” 2017, Program code. [Online]. Available: https://doi.org/10.5281/zenodo.1042588 [46] G. R. Kumar and T. A. Courtade, “Which Boolean functions are most informative?” in Proc. IEEE Int. Symp. on Inform. Theory, Istanbul, Turkey, Jul. 2013, pp. 226–230. [47] T. A. Courtade and G. R. Kumar, “Which Boolean functions maximize mutual information on noisy inputs?” IEEE Trans. Inf. Theory, vol. 60, no. 8, pp. 4515–4525, Aug. 2014. [48] J. G. Klotz, D. Kracht, M. Bossert, and S. Schober, “Canalizing Boolean functions maximize mutual information,” IEEE Trans. Inf. Theory, vol. 60, no. 4, pp. 2139–2147, Apr. 2014. [49] G. Pichler, G. Matz, and P. Piantanida, “A tight upper bound on the mutual information of two Boolean functions,” in Proc. Inform. Theory Workshop, Cambridge, UK, Sep. 2016, pp. 16–20. [50] T. Berger, “Multiterminal source coding,” in The Information Theory Approach to Communications, G. Longo, Ed. Springer, 1977, pp. 171–231. [51] T. Berger, Z. Zhang, and H. Viswanathan, “The CEO problem,” IEEE Trans. Inf. Theory, vol. 42, no. 3, pp. 887–902, May 1996. [52] S. Fujishige, Submodular Functions and Optimization, 2nd ed., ser. Annals of Discrete Mathematics. Elsevier Science, 2005. [53] R. Schneider, Convex Bodies: The Brunn-Minkowski Theory, 2nd ed. Cambridge University Press, 2014. [54] B. Grünbaum, Convex Polytopes. Springer, New York, 2003. [55] W. Rudin, Functional Analysis, 2nd ed. McGraw-Hill, 1991. [56] A. A. Gohari and V. Anantharam, “Evaluation of Marton’s inner bound for the general broadcast channel,” IEEE Trans. Inf. Theory, vol. 58, no. 2, pp. 608–619, Feb. 2012. [57] V. Jog and C. Nair, “An information inequality for the BSSC broadcast channel,” in Inform. Theory and Applicat. Workshop (ITA), San Diego, CA, Feb. 2010, pp. 1–8. [58] H. G. Eggleston, Convexity, P. Hall and F. Smithies, Eds. Cambridge University Press, 1958. [59] A. D. Wyner and J. Ziv, “The rate-distortion function for source coding with side information at the decoder,” IEEE Trans. Inf. Theory, vol. 22, no. 1, pp. 1–10, Jan. 1976. [60] C. D. Aliprantis and K. C. Border, Infinite Dimensional Analysis: A Hitchhiker’s Guide, 3rd ed. Springer, 2006. [61] J. R. Munkres, Topology. Prentice Hall, 2000. [62] T. S. Han and K. Kobayashi, “A unified achievable rate region for a general class of multiterminal source coding systems,” IEEE Trans. Inf. Theory, vol. 26, no. 3, pp. 277–288, May 1980.
7cs.IT
1 Application of Microgrids in Supporting Distribution Grid Flexibility Alireza Majzoobi, Student Member, IEEE, and Amin Khodaei, Senior Member, IEEE  S Abstract—Distributed renewable energy resources have attracted significant attention in recent years due to the falling cost of the renewable energy technology, extensive federal and state incentives, and the application in improving load-point reliability. This growing proliferation, however, is changing the traditional consumption load curves by adding considerable levels of variability and further challenging the electricity supply-demand balance. In this paper, the application of microgrids in effectively capturing the distribution network net load variability, caused primarily by the prosumers, is investigated. Microgrids provide a viable and localized solution to this challenge while removing the need for costly investments by the electric utility on reinforcing the existing electricity infrastructure. A flexibility-oriented microgrid optimal scheduling model is proposed and developed to coordinate the microgrid net load with the aggregated consumers/prosumers net load in the distribution network with a focus on ramping issues. The proposed coordination is performed to capture both inter-hour and intra-hour net load variabilities. Numerical simulations on a test distribution feeder with one microgrid and several consumers and prosumers exhibit the effectiveness of the proposed model. Index Terms--Distributed generation, duck curve, flexibility, microgrid optimal scheduling, renewable energy resource. NOMENCLATURE Indices: c Superscript for distribution network consumers and prosumers. ch Superscript for energy storage charging. dch Superscript for energy storage discharging. d Index for loads. i Index for DERs. j Index for consumers/prosumers at the distribution network. k Index for intra-hour time periods. s Index for scenarios. t Index for inter-hour time periods. u Superscript for the utility grid. Sets: D F G N O Set of adjustable loads. Set of flexibility constraints. Set of dispatchable units. Set of consumers/prosumers. Set of operation constraints. The authors are with the Department of Electrical and Computer Engineering, University of Denver, Denver, CO 80210 USA (email: [email protected]; [email protected]). Set of energy storage systems. Parameters: DR Ramp down rate. DT Minimum down time. E Load total required energy. F(.) Generation cost. MC Minimum charging time. MD Minimum discharging time. MU Minimum operating time. UR Ramp up rate. UT Minimum up time. w Binary islanding indicator (1 if grid-connected, 0 if islanded). α, β Specified start and end times of adjustable loads. ρ Market price. η Energy storage efficiency. λ Value of lost load (VOLL). ψ Probability of islanding scenarios. τ Time period. Δ1 Intra-hour flexibility limit. Δ2 Inter-hour flexibility limit. low up Δ1 /Δ1 Microgrid time-dependent intra-hour lower/upper flexibility limit. Δ2low/Δ2up Microgrid time-dependent inter-hour lower/upper flexibility limit. Variables: C Energy storage available (stored) energy. D Load demand. I Commitment state of dispatchable units. LS Load curtailment. P DER output power. PM Utility grid power exchange with the microgrid. SD Shut down cost. SU Startup cost. Tch Number of successive charging hours. Tdch Number of successive discharging hours. Ton Number of successive ON hours. off T Number of successive OFF hours. u Energy storage discharging state (1 when discharging, 0 otherwise). 2 v z Energy storage charging state (1 when charging, 0 otherwise). Adjustable load state (1 when operating, 0 otherwise). I. INTRODUCTION T HE GROWING trend of renewable generation installations in the United States, driven primarily by current renewable portfolio standards in 27 states, efficiency incentives and net metering in 43 states, and the falling cost of renewable generation technologies [1], [2], challenges traditional practices in balancing electricity supply and demand and calls for innovative methods to reduce impacts on grid stability and reliability. Fig. 1 shows daily net load (i.e., the consumer load minus local generation) variations in California ISO, the socalled duck curve, as an example of this challenge [3]. As renewable generation increases, to reach the 33% renewable target by 2020, the power grid would require increased levels of fast ramping units to address abrupt changes (as much as 13 GW in three hours) in the net load, caused by concurrent fall in renewable generation and increase in demand. Fig. 1. The current and future estimates of over-generation and ramping effect in California [3]. To maintain system supply-demand balance, grid operators traditionally rely on bulk power generation resources, such as fast ramping hydro and thermal units, that can be quickly dispatched and ramped up. These units, however, are limited in number and capacity, capital-intensive, time-consuming to be constructed, and subject to probable transmission network congestions. Addressing the variability of renewable generation, on the other hand, has long been an attractive area of research to complement renewable generation forecasting efforts [4]. Uncertainty considerations in power system operation and planning have significantly increased in the past few years as a large amount of uncertainty sources are integrated in power systems as a result of renewable generation proliferation. The renewable generation integration problem can be investigated under two contexts of large-scale (which attempts to manage the generation of wind and solar farms) [5][8], and small-scale (which deals with renewable generation in the distribution level). Small-scale coordination approaches mainly focus on various methods of demand side management, such as demand response [9]-[12], energy storage [13]-[17], and aggregated electric vehicles [18], [19]. However, these methods each encounter obstacles that may prevent a viable application, such as the need for advanced metering infrastructure in deploying demand response, privacy and customer willingness issues in electric vehicle applications, and financial aspects in energy storage deployment. Leveraging available flexibility in existing microgrids for addressing renewable generation integration, as proposed in [20] and extended in this paper, will offer a potentially more viable solution to be used in distribution networks, and thus calls for additional studies. The microgrid, as defined by the U.S. Department of Energy, is “a group of interconnected loads and distributed energy resources (DER) within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid and can connect and disconnect from the grid to enable it to operate in both grid-connected or islandmode” [21]. The microgrid, as a novel distribution network architecture with local generation, control, and consumption, offers noticeable benefits to both consumers and utility companies such as enhanced reliability and resilience, reduced environmental impact, power quality improvement, improved energy efficiency by loss reduction, and network congestion relief. Microgrids can be operated in grid-connected and islanded modes. In the grid-connected mode, which is the default operation mode, the microgrid can import, export, or have zero power exchange with the utility grid to achieve the least-cost supply schedule (i.e., an economic operation). Capability to switch to the islanded mode is the salient feature of the microgrids which isolates the microgrid from faults and/or disturbances in the upstream network to achieve the least load curtailment (i.e., a reliable operation) [22]-[28]. Microgrids have been significantly deployed over the past few years and are anticipated to grow even more in the near future [29], [30], in both national and international levels [31], where future power grids can be pictured as systems of interconnected microgrids [32]. This paper focuses on the flexibility advantages of microgrids as a complementary value proposition in grid support. The microgrid capability in managing its power exchange with the utility grid in the grid-connected mode is specifically considered in this paper for mitigating the net load ramping in the distribution network and to further ensure that the power seen by the utility has manageable ramps. There have been several studies that investigate how a microgrid can participate in the upstream network market and offer services to the grid. In [33], an optimal bidding strategy via a microgrid aggregator is proposed to involve all small-scale microgrids into an electricity market via real-time balancing market bidding. In [34], an optimal bidding strategy based on two-stage stochastic linear programming for an electric vehicle aggregator who participates in the day-ahead energy and regulation markets is proposed. Furthermore, it goes on to consider market conditions and the associated uncertainty of the electric vehicle fleet. A two-stage market model for microgrid power exchange with the utility grid, via an aggregator, is proposed in [35] to achieve an efficient market equilibrium. A risk-constrained optimal hourly bidding model for microgrid aggregator is proposed in [36] to consider various uncertainties and maximize the microgrid benefit. The study in [37] proposes an 3 optimal dispatch strategy for the residential loads via artificial neural network for calculating the demand forecast error when the demand changes are known one hour ahead with respect to the day-ahead forecasted values. The study in [38] presents a stochastic bidding strategy for microgrids participating in energy and spinning reserve markets, considering the load and renewable generation uncertainty. In [39], a stochastic lookahead economic dispatch model for near-real-time power system operation is proposed and its benefits and implementability for assessing the power system economic risk are further explored. These works primarily rely on a market mechanism to procure microgrids’ flexibility and accordingly capture the unbalanced power in the day-ahead market as well as the ramping and variabilities caused by forecast errors or unforeseen real-time events. In this paper, however, this problem is studied from a microgrid perspective, i.e., how a microgrid controller can manage local resources to offer required/desired services to the utility grid. This work is particularly important in networks that a market mechanism cannot be established but grid operators are interested in lowcost and distributed solutions in managing grid flexibility. The main contributions of this paper are listed as follows:  A flexibility-oriented microgrid optimal scheduling model is developed to optimally manage local microgrid resources while providing flexibility services to the utility grid. This model is achieved by transforming the distribution net load variability limits into constraints on the microgrid net load.  A coordinated grid-connected and islanded operation is considered in the model development to take into account microgrid’s potential islanding while supporting the utility grid in the grid-connected mode.  A high resolution operation is modeled via consideration of both intra-hour and inter-hour time periods, which is capable of integrating quick variations in renewable generation. Unlike existing studies on distribution network flexibility procurement, which focus on microgrid participation in grid support via a market mechanism, this paper investigates the problem from a microgrid’s perspective, i.e., how a microgrid controller can manage local resources to offer required/desired services to the utility grid. The rest of the paper is organized as follows. Section II describes the outline of proposed flexibility-oriented microgrid optimal scheduling model. Section III develops the model formulation, including operation and flexibility constraints. Section IV presents numerical simulations to show the merits and the effectiveness of the proposed model applied to a test distribution network. Section V discusses the specific features of the proposed model, and finally, Section V concludes the paper. II. MODEL OUTLINE Consider a distribution feeder consisting of a set N = {1, 2, …, N} customers (both consumers and prosumers) and one microgrid. The net load of each customer j ϵ N and the 𝑐 𝑀 microgrid are respectively denoted by 𝑃𝑗𝑡𝑘 and 𝑃𝑡𝑘 , where t is the inter-hour time index and k is the intra-hour time index as demonstrated in Fig. 2. Fig. 2. The schematic diagram of inter-hour and intra-hour time intervals. To fully supply the total net load in this feeder, a power of 𝑢 𝑃𝑡𝑘 needs to be provided by the utility grid where: u M Ptks  Ptks  c  Pjtks ∀ t ,∀ k ,∀ s. (1) jN To address the net load variability seen by the grid operator, the intra-hour variability (2) and inter-hour variability (3) in the utility grid power will need to be constrained: u Ptks  Ptu( k 1) s  1 ∀ t , ∀ s, k  1, (2) Pt1us  P(ut 1) Ks   2 ∀ t ,∀ s. (3) These limits are selected by the grid operator based on the dayahead net load forecasts and desired grid flexibility during each time interval. There are various methods to determine the grid flexibility [6], [40]-[42]. If this calculated flexibility is less than the required grid flexibility, which is obtained based on net load forecasts, the grid operator can utilize distributed resources, such as microgrids, to compensate the shortage in grid flexibility. Therefore, intra- and inter-hour limits will be obtained by comparing the available and required grid flexibility. Considering the importance of grid flexibility limits on the microgrid operation, a system-level study needs to be performed by the utility company. This topic will be investigated in a follow up research. The grid operator furthermore can calculate these limits using a cost-benefit analysis, i.e., to upgrade the current infrastructure to address increasing flexibility requirements or to procure the flexibility of existing microgrids and in turn pay for their service. This topic, however, requires further analysis and modeling which will be carried out in follow up research. Fig. 3 shows the schematic diagram of a feeder consisting of a microgrid along with other connected loads. The microgrid can be scheduled based on price considerations, i.e., local resources are scheduled in a way that the microgrid operation cost is minimized during the grid-connected mode (Fig. 3-top). The only factor impacting the microgrid scheduling results from the utility grid side is the real-time electricity price (hence the term price-based scheduling). The price-based scheduling can potentially exacerbate the consumption variability. On the other hand, microgrid resources can be scheduled in coordination with other loads in the same distribution feeder, and thus support the utility grid in mitigating potential variabilities and ensuring supply-load balance (Fig. 3-bottom). Although the objective is still to minimize the operation cost during the grid-connected mode, this scheduling is primarily based on the grid flexibility requirements (hence the term flexibility-oriented scheduling). 4 operation. Microgrid DERs, loads, and the main grid power transfer are further subject to operation and flexibility constraints, respectively represented by sets Os and Fs in (7)(8). Fig. 3. Impact of the microgrid in increasing the distribution net load variabilities (top) or capturing the variabilities (bottom). III. FLEXIBILITY-ORIENTED MICROGRID SCHEDULING – PROBLEM FORMULATION The microgrid optimal scheduling problem aims at determining the least-cost schedule of available resources (DERs and loads) while considering prevailing operational constraints, i.e., min  [  Fi ( Pitk 0 )  tM PtkM0 ]    s  LStks t k iG t k (4) s Subject to  Pitks  PtksM  LStks   Ddtks A. Operation Constraints (Os) The microgrid components to be modeled in the optimal scheduling problem include DERs (i.e., generation units and energy storage) and loads. Microgrid loads are categorized into two types of fixed (which cannot be altered and must be satisfied under normal operation conditions) and adjustable (which are responsive to price variations and/or controlling signals). Generation units in a microgrid are either dispatchable (i.e., units which can be controlled by the microgrid controller) or nondispatchable (i.e., wind and solar units which cannot be controlled by the microgrid controller since the input source is uncontrollable). The primary applications of the energy storage are to coordinate with generation units for guaranteeing the microgrid generation adequacy, energy shifting, and islanding support. From these microgrid components, only dispatchable DGs, energy storage, and adjustable loads can provide flexibility benefits for the microgrid due to their controllability. Microgrid component constraints are formulated as follows: (9) Pi min I it  Pitks  Pi max I it i  G, t , k , s, (10) Pitks  Pit ( k 1) s  URi i  G, t , s, k  1, t , k , s, (5) M  P M , max wtks  Ptks  P M , max wtks t , k , s, (6) Pit1s  Pi (t 1) Ks  URi i  G, t , k , s, (11) {Pitks , Ddtks}  O s i, t , k , s, (7) Pit ( k 1) s  Pitks  DRi i  G, t , s, k  1, (12) M Ptks  Fs t , k , s. Pi (t 1) Ks  Pit1s  DRi i  G, t , k , s, (13) i  G, t , (14) Tioff  DTi ( I i (t 1)  I it ) i  G, t , (15) dch,max ch,min Pitks  Pitk uit  Pitk vit i  S, t , k , s, (16) ch,max  Pitk vit i  S, t , k , s, (17) i  S, t , (18) i d (8) The objective (4) minimizes the microgrid daily operation cost, which includes the local generation cost, cost of energy transfer with the utility grid, and the outage cost. The outage cost (also known as the cost of unserved energy) is defined as the load curtailment times the value of lost load (VOLL). The VOLL represents the customers’ willingness to pay for reliable electricity service and to avoid power outages, which can also be perceived as the energy price for compensating curtailed loads. The VOLL depends on the type of customers, time and duration of outage, time of advanced notification of outage, and other specific traits of an outage. The VOLL is generally considered between $0/MWh and $17,976/MWh for residential customers, while for commercial and industrial customers is estimated between $3,000/MWh and $53,907/MWh [43, page 7]. The load balance equation (5) ensures that the sum of the injected/withdrawn power from the utility grid and local DERs (i.e., dispatchable units, nondispatchable units, and the distributed energy storage) would match the microgrid load. The load curtailment variable is used to ensure a feasible solution in the islanded operation if adequate generation is not available. The power of energy storage can be negative (charging), positive (discharging) or zero (idle). Since the power can be exchanged between the utility grid and the 𝑀 microgrid, 𝑃𝑡𝑘𝑠 can be positive (power import), negative (power export) or zero. The power transfer with the utility grid is limited by (6). The binary islanding parameter (which is 1 when grid-connected and 0 when islanded) ensures that the microgrid interacts with the utility grid only during the grid-connected Ti on  UTi ( I it  I i (t 1) ) Pitks  dch,min Pitk uit uit  vit  1 Citks  Cit ( k 1) s  ( Pitksuit / i )  Pitksvit i  S, t , s, k  1, (19) Cit1s  Ci (t 1) Ks  ( Pit1s uit / i )  Pit1s vit i  S, t , s, (20) i  S, t , k , s, (21) Titch  MCi (uit  ui (t 1) ) i  S, t , (22) Titdch  MDi (vit  vi (t 1) ) i  S, t , (23) Ddmin zdtk  Ddtks  Ddmax zdtk Tdon  MU d ( z dt  z d (t 1) ) d  D, t , k , s, (24) d  D, t , (25) d  D, s. (26) Cimin  [ ,  ]  Citks  Cimax Ddtks  Ed Constraint (9) represents the maximum and minimum generation capacity of dispatchable units. The binary variable I represents the unit commitment state which would be one when the unit is committed and zero otherwise. Dispatchable generation units are also subject to ramp up and ramp down 5 constraints which are defined by (10)-(13). Equations (10) and (12) represent the ramping constraints for intra-hour intervals, while (11) and (13) represent the ramping constraint for interhour intervals. The minimum up and down time limits are imposed by (14) and (15) respectively. The minimum and maximum limits of the energy storage charging and discharging, based on the operation mode, are defined by (16) and (17), respectively. While charging, the binary charging state v is one and the binary discharging state u is zero; while in the discharging mode, the binary charging state v is zero and the binary discharging state u is one. The energy storage charging power is a negative value which is compatible with the negative amount for limitations of constraints (16) and (17) for the charging mode. Only one of the charging or discharging modes at every time period is possible, which is ensured by (18). The energy storage stored energy is calculated based on the available stored energy and the amount of charged/discharged power, which is represented in (19) and (20) for intra-hour and inter-hour intervals, respectively. The time period of charging and discharging is considered to be τ=(1/K)h, where K is the number of intra-hour periods and h represents a time period of one hour. The amount of stored energy in energy storage is restricted with its capacity (21). The minimum charging and discharging times are represented in (22) and (23), respectively. Adjustable loads are subject to minimum and maximum rated powers (24), where binary operating state z is 1 when load is consuming power and 0 otherwise. The minimum operating time (25), and the required energy to complete an operating cycle (26) are further considered for adjustable loads. It is worth mentioning that t=0, which would appear in (3), (14), (15), (22), and (23), represents the last hour of the previous scheduling horizon, here t=24. B. Flexibility Constraints (Fs) Flexibility constraints represent additional limits on the microgrid power exchange with the utility grid. These constraints are defined in a way that the microgrid net load is matched with the aggregated net load of connected prosumers/consumers, so as to capture likely variations. To u obtain the flexibility constraints, the value of Ptks , i.e., u c , is substituted in (2) and (3). By proper Ptks  PtksM   Pjtks jN rearrangements, the inter-hour and intra-hour flexibility constraints will be accordingly obtained as in (27) and (28): c M  1  ( Pjtk   Pjtc ( k 1) ) ≤ Ptks  Pt M ( k 1) s j (27) j c ≤ 1  ( Pjtk   Pjtc ( k 1) ) j t , s, k  1, j   2  ( Pjtc1   Pjc(t 1) K ) ≤ Pt1Ms  P(M t 1) Ks j (28) j ≤  2  ( Pjtc1   Pjc(t 1) K ) j t , s. j Accordingly, new time-dependent flexibility limits can be defined as follows c c (29) low t , k  1, 1,tk   1  ( Pjtk   Pjt ( k 1) ) j j c c up 1,tk  1  ( Pjtk   Pjt ( k 1) ) j c c low 2,t    2  ( Pjt1   Pj (t 1) K ) j (30) t , (31) t. (32) j c c up 2, t   2  ( Pjt1   Pj (t 1) K ) j t , k  1, j j These new constraints convert the required flexibility by the grid operator to a limit on the microgrid net load. Although utility grid flexibility limits, i.e., Δ1 and Δ2, are constant and determined by the grid operator, the limits on the microgrid net load are highly variable as they comprise the aggregated net load of all N customers in the distribution feeder. Depending on the considered time resolution for forecasts, these limits can change from every 1 minute to every 1 hour in the scheduling horizon. The flexibility limits can be adjusted by the grid operator to achieve the desired net load in the distribution network. For example, a value of zero for Δ1 would eliminate intra-hour variations. It is worth mentioning that connected prosumers/consumers are considered as given parameters (forecasted) in the optimization problem. There will be no direct communications between the microgrid and the connected prosumers/consumers, where all communications will be through the grid operator. Therefore, the microgrid only communicates with the grid operator and sends/receives the required data for capturing and mitigating the distribution network net load variabilities. C. Islanding Considerations The islanding is performed to rapidly disconnect the microgrid from a faulty distribution network, safeguard the microgrid components from upstream disturbances, and protect voltage sensitive loads when a quick solution to utility grid voltage problems is not imminent. The time and the duration of such disturbances, however, are not known to microgrids in advance. Islanding is considered in this paper via a Θ-k islanding criterion, where Θ(=T×K) represents the total number of intra-hour time periods in the scheduling horizon and k represents the number of consecutive intra-hour periods that the microgrid should operate in the islanded mode. To apply this criterion to the proposed model, the binary islanding indicator w is defined and added to the microgrid power exchange constraint (6). Several scenarios are defined based on the number of intra-hour time periods (for instance 144 scenarios for 10-minute intra-hour periods), and the value of w in each scenario is obtained based on the Θ-k islanding criterion, i.e., in each scenario w will be 0 for k consecutive intra-hour time periods (imposing an islanded operation) and 1 in other periods (representing the grid-connected operation). Fig. 4 shows the first five islanding scenarios, from a total of 144 scenarios, associated with a Θ-4 islanding criterion, which requires that the microgrid be able to operate in the islanded mode for any 4 consecutive intra-hour periods once it is switched to the islanded mode. Further discussions on the Θ-k islanding criterion can be found in [23]. It should be noted that the proposed model is generic and can be applied to any microgrid size without loss of generality. 6 t k Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 1 1 0 1 1 1 1 2 0 0 1 1 1 3 0 0 0 1 1 2 4 0 0 0 0 1 5 1 0 0 0 0 6 1 1 0 0 0 1 1 1 1 0 0 2 1 1 1 1 0 3 1 1 1 1 1 3 4 1 1 1 1 1 5 1 1 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 3 1 1 1 1 1 4 1 1 1 1 1 5 1 1 1 1 1 6 1 1 1 1 1 ... ... ... ... ... ... Fig. 4. First five islanding scenarios associated with a Θ-4 islanding criterion. IV. NUMERICAL SIMULATIONS A microgrid with four dispatchable units, two nondispatchable units including wind and solar, one energy storage, and five adjustable loads is used to study the performance of the proposed model. The characteristics of the microgrid DERs and loads, and the hourly market price are borrowed from [23]. The maximum ramping capability of the microgrid, based on the maximum ramping capacity of DERs, is 18 MW/h and the capacity of the line connecting the microgrid to the distribution feeder is assumed to be 10 MW. A VOLL of $10,000/MWh is considered for the microgrid. The aggregated consumption profile of consumers/prosumers connected to the system in the same feeder as the microgrid is shown in Fig. 5. This figure consists of aggregated values for the distributed solar generation, consumption, and the net load (i.e., difference between the local consumption and generation). The net load should be supplied by the utility grid, and as the figure demonstrates, it includes considerable variabilities due to the local solar generation. The maximum ramping of this net load is 3.3 MW/10-min and the peak net load is 12.9 MW. This net load variability should be satisfied by either fast response units deployed by the utility or locally by the microgrid, where the latter is discussed here. The proposed flexibility-oriented microgrid optimal scheduling model is developed using mixedinteger programming and solved using CPLEX 12.6. It should be noted that the computation time for the studied cases was between 3 and 4 minutes, with an average of 3 min and 22 s. that the unit is not committed. The energy storage charging, discharging, and idle states are represented by -1, 1, and 0, respectively. The bold values represent changes in the schedule due to the islanding requirements. Dispatchable unit 1 has the lowest operation cost, so it is committed in all scheduling hours, while other units are committed and dispatched when required based on economic and reliability considerations. It should be noted that the amount of load curtailment during the islanded operation is considered as a measure of microgrid reliability. The energy storage is charged in low price hours and discharged in high price hours, i.e., an energy arbitrage, to maximize the benefits and minimize the operation cost. As the table shows, the islanding criterion leads to the commitment of more units in the grid-connected mode to guarantee a seamless islanding. TABLE I DER SCHEDULE IN CASE 1 Hours (1-24) G1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G3 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G4 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 1 1 0 0 DES -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 Fig. 6 depicts the microgrid net load and the distribution feeder net load (i.e., the microgrid net load plus the aggregated consumer/prosumer net load in Fig. 5). As this figure shows, the microgrid imports the power from the utility grid in low price hours and switches over to local generation when the utility grid price is high. This scheduling causes a 21.58 MW peak load for the utility grid between hours 9 and 10 (that is a new morning peak), and also exacerbates the distribution feeder ramping requirement (which is increased to 8.9 MW/10-min between hours 11 and 12 in this case). In addition, the net load variability is significantly increased in this case. Fig. 5. Aggregated prosumers solar generation, consumption, and the net load in the distribution feeder. Fig. 6. Distribution feeder net load, and microgrid net load for the 24-hour horizon in Case 1. Case 1: The grid-connected, price-based optimal scheduling is analyzed for a 24-hour horizon. The price-based scheduling denotes that the microgrid seeks to minimize its operation cost and does not have any commitment to support the utility grid in capturing distribution network net load variabilities. Table I shows the schedule of dispatchable units and the energy storage for 24 hours of operation in this case. A commitment state of 1 represents that the dispatchable unit is ON while 0 represents Therefore, the utility grid encounters severe net load ramping and variations, caused by the microgrid to a great extent. This result advocates that the microgrid can potentially have a negative impact on the distribution network net load when scheduled only based on the price data and economic considerations. The microgrid operation cost in this case is $11748.3. 7 Case 2: In this case, the flexibility-oriented microgrid optimal scheduling is carried out, rather than the price-based scheduling, to support the utility grid in addressing net load variations. A Θ-1 islanding criterion with 10-min intra-hour periods is considered. This islanding criterion ensures that the microgrid is capable of switching to the islanded mode to reliably supply local loads (for any 10-min islanding during the scheduling horizon), while supporting the utility grid by providing required flexibility during the grid-connected operation. The flexibility limits of 0.5 MW/10-min are considered for inter-hour and intra-hour ramping. The intrahour and inter-hour ramping constraints are accordingly developed, as proposed in (27)-(32) and added to the developed model. Table II shows the schedule of dispatchable units and the energy storage for the scheduling horizon. The bold values represent changes in the schedule, while the highlighted cells represent changes in the dispatched power compared to Case 1. This table shows that the commitment of unit 4 and the energy storage, as well as the dispatched power of all DERs, are changed compared to Case 1 to satisfy the flexibility constraints. These changes in the schedules increase the microgrid operation cost to $12077. The difference between this cost and the microgrid operation cost in Case 1 should be paid to the microgrid, as a minimum, to incentivize the microgrid for providing flexibility and supporting the utility grid. Fig. 7 shows the distribution feeder net load and the microgrid net load in this case. TABLE II DER SCHEDULE IN CASE 2 Hours (1-24) G1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G3 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 G4 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 DES 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 Fig. 7. Distribution feeder net load, and microgrid net load for 0.5 MW/10-min inter-hour and intra-hour utility ramping in Case 2. Comparison of Figs. 6 and 7 shows the positive impact of the microgrid in changing the distribution network net load in a way that is desirable for the utility grid. As Fig. 6 illustrates, the distribution feeder net load, which should be supplied by the utility grid, consists of several rampings in the order of a few MW/10-min as well as a severe ramping of 8.9 MW/10-min between hours 11 and 12. In Fig. 7, however, all these variabilities are reduced to 0.5 MW/10-min as targeted by the grid operator. Moreover, Fig. 8 depicts the ramping of the utility grid in both studied cases. This figure clearly demonstrates the effectiveness of the proposed model in reducing the distribution network net load ramping, as the obtained data from Case 2 is efficiently confined between the desired ramping values. Fig. 8. Utility grid net load ramping in the two studied cases. The results in Case 2 advocate that to obtain the desired ramping the microgrid needs to deviate from its price-based schedule. This deviation results in a $328.7 increase in the microgrid operation cost (i.e., $12077–$11748.3). This increase represents the microgrid lost revenue. To incentivize the microgrid to opt in for offering flexibility services to the utility grid, the amount of incentive that should be paid to the microgrid must be equal to or greater than this amount. If less, the microgrid would prefer to find its price-based schedule while disregarding the grid requirements. However, it would be extremely beneficial for the utility grid to incentivize the microgrid, otherwise the microgrid may exacerbate the distribution network net load variability as discussed in Case 1. It is worth mentioning that the microgrid lost revenue is a function of the consumers/prosumers net load variations as well as values of Δ1 and Δ2 which are further investigated in the following. Case 3: After proving the effectiveness of the proposed model by comparing Cases 1 and 2, the impact of ramping limits is studied in this case. To show that the microgrid is also capable of meeting tight ramping limits, a value of zero is considered for the intra-hour ramping and 2 MW/10-min for the inter-hour ramping. Fig. 9 depicts the solution of this case. Considering a value of zero for intra-hour ramping completely eliminates the intra-hour variabilities in the distribution network net load, hence the obtained consumption is constant within each operation hour while it can change by up to 2 MW between any two consecutive operation hours. To closely follow the limits, the microgrid imported power from the utility grid is decreased when the net load is increasing. Furthermore, microgrid’s export to the utility grid in high price hours is changed to support the ramping limits. For instance the microgrid power export to the utility grid in hours 12-14, which was based on economic considerations, is now changed to power import from the utility grid. Fig. 10 shows the obtained results of Fig. 9 between hours 12 and 20, which better 8 demonstrates the viable application of the microgrid in reducing the net load variability and sharp ramping. Fig. 9. Distribution feeder net load, and microgrid net load for 2 MW/10-min inter-hour and 0 MW/10-min intra-hour utility ramping. is due to two main reasons: (i) the need to commit more units and dispatch them at uneconomical operation points, in a way that they can provide the required flexibility, and (ii) the possibility of load curtailment in the microgrid. The ramping limits are added as constraints to the problem, while the load curtailment is added as a penalty to the objective function. It results in prioritizing the flexibility limit (i.e., problem feasibility) on the load curtailment (i.e., problem optimality). There of course should be additional measures to consider in order to prevent load curtailment in the microgrid which are currently under investigation by the authors. The utility grid incentive in each case must at least cover the microgrid’s lost revenue. According to Table III, if the utility grid decides to eliminate the intra-hour ramping, it should pay at least $24,557.3 and $697.3 to the microgrid for Δ2 values equal to 0.5 MW/10-min and 5 MW/10-min, respectively. Whereas, in the case of 2 MW/10-min as desired intra-hour ramping, at least $77 and $21.8 should be paid to the microgrid for Δ2 equal to 0.5 MW/10-min and 5 MW/10-min, respectively. These results advocate for the importance of a cost-benefit analysis from the grid operator to determine the most suitable inter-hour and intra-hour ramping limits. V. DISCUSSIONS Fig. 10. Distribution feeder net load, and microgrid net load for 2 MW/10-min inter-hour and 0 MW/10-min intra-hour utility ramping, during net load peak hours. The results of flexibility-oriented microgrid optimal scheduling for different amounts of inter-hour (changing between 0.5 and 5) and intra-hour (changing between 0 and 2) ramping limits are provided in Table III. It should be noted that all obtained results are near-optimal, mainly due to nonlinearity of the original problem and presence of uncertainties. TABLE III MICROGRID OPERATION COST ($) FOR VARIOUS RAMPING LIMITS Intra-hour ramping limit Δ1 Inter-hour (MW/10 min) ramping limit Δ2 (MW/10min) 0 0.5 1 2 0.5 36305.6 12077 11886.9 11825.3 1 19799.1 12011.5 11860.1 11804 1.5 14930.4 11977.5 11845.2 11796.5 2 13329.1 11951.4 11834.1 11790.1 2.5 12790.2 11936.4 11826.4 11786 3 12607.5 11925.8 11819.7 11782.1 3.5 12532.5 11916.8 11813.7 11778.6 4 12485.9 11906.8 11808.6 11775.6 4.5 12460.1 11898.3 11804.3 11772.7 5 12445.6 11891 11800.1 11770.1 The obtained results show that the microgrid operation cost is increased by decreasing the inter-hour and intra-hour ramping limits, however these changes are not linear. For example, the microgrid operation cost when the intra-hour ramping limit is 0 is considerably higher than other cases. This Microgrids can potentially be utilized in distribution networks as a solution for mitigating net load ramping and variability. According to the studied cases in this paper, the following features of the proposed microgrid optimal scheduling model with multi-period islanding and flexibility constraints, could be concluded:  Flexibility consideration: The inter-hour and intra-hour ramping constraints have been considered in the proposed model to ensure that the utility grid desired power is obtained for different time resolutions.  Economic and reliable operation: The proposed model determines the least-cost schedule of microgrid loads and DERs while supporting the utility grid in addressing net load ramping. In addition, the consideration of Θ-k islanding criterion ensures the microgrid reliability in supplying local loads during the islanded mode.  High resolution scheduling: 10-minute time interval scheduling was considered in studied cases, which offers a high resolution scheduling and is efficient for capturing net load variabilities. The proposed model offers the capability to consider various intra-hour time resolutions.  Localized and low-cost solution: Using microgrids as local solutions for addressing distribution net load ramping can significantly reduce the utility grid investments in upgrading the generation, transmission, and distribution facilities. This significant cost saving would be made possible at the small expense of incentivizing microgrids to offer flexibility services. VI. CONCLUSION In this paper, the microgrid was utilized to reduce the distribution network net load variabilities, resulted primarily due to simultaneous decrease in solar generation and increase 9 in consumers’ loads. A flexibility-oriented microgrid optimal scheduling model was proposed to efficiently schedule microgrid resources for supporting the distribution grid flexibility requirements. These flexibility requirements were considered in terms of net load ramping limits. The model was studied for intra-hour and inter-hour time intervals during the 24-hour day-ahead operation. The Θ-k islanding criterion was further taken into account to ensure that the microgrid has the capability to switch to the islanded mode, if needed, while supporting the utility grid during the grid-connected operation. Numerical simulations were carried out for various amounts of utility grid’s desired inter-hour and intra-hour ramping to show the merits and the effectiveness of the proposed model. The results showed that the grid operator can efficiently leverage the flexibility of existing microgrids in distribution networks to address some of the most pressing flexibility-associated challenges, while removing the need for costly investments in the generation and distribution facilities. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] U.S. Energy Information Administration, "Annual Energy Review," [Online]. Available: https://www.eia.gov/totalenergy/data/annual/previous.cfm. G. Barbose, N. Darghouth, and S. Weaver, Lawrence Barkley National Laboratory (LBNL), “Tracking the Sun VII: An Historical Summary of the Installed Price of Photovoltaics in the United States from 1998 to 2013,” September 2014. California ISO, “What the duck curve tells us about managing a green grid,”. [Online]. Available: https://www.caiso.com/Documents/FlexibleResourcesHelpRenewables_ FastFacts.pdf. A. Costa, A. Crespo, J. Navarro, G. Lizcano, H. Madsen, and E. Feitosa, “A review on the young history of the wind power short-term prediction,” Renew. Sustain. Energy Rev., vol. 12, no. 6, pp. 1725–1744, 2008. A. Ulbig, G. Andersson, "On operational flexibility in power systems," in Proc. 2012 IEEE Power and Energy Society General Meeting, pp. 1-8. E. Lannoye, D. Flynn, and M. O’Malley, “Evaluation of power system flexibility,” IEEE Trans. Power Syst., vol. 27, no. 2, pp. 922–931, May 2012. D.S. Kirschen, A. Rosso, J. Ma, L.F. Ochoa, "Flexibility from the demand side," in Proc. IEEE Power and Energy Society General Meeting, San Diego, CA, 22-26 Jul. 2012, pp. 1-6. M. Ghamkhari and H. Mohsenian-Rad, “Optimal integration of renewable energy resources in data centers with behind-the-meter renewable generator,” in Proc. IEEE International Conference on Communications (ICC), Ottawa, ON, 10-15 Jun. 2012, pp. 3340-3344. A. Asadinejad and K. Tomsovic “Impat of incetive based demand response on large scale renewable integration,” 2016 IEEE PES Innovative Smart Grid Technologies (ISGT), Minneapolis, MN, 6-9 Sep. 2016. S. C. Chan, K. M. Tsui, H. C. Wu, Y. Hou, Y. Wu, and F. F. Wu, “Load/price forecasting and managing demand response for smart grids: methodologies and challenges,” IEEE Signal Process. Mag., vol. 29, no. 5, pp. 68–85, Sep. 2012. O. Ma, N. Alkadi, P. Cappers, P. Denholm, J. Dudley, S. Goli, M. Hummon, S. Kiliccote, J. MacDonald, N. Matson, D. Olsen, C. Rose, M. D. Sohn, M. Starke, B. Kirby, and M. O’Malley, “Demand Response for Ancillary Services,” IEEE Trans. Smart Grid, vol. 4, no. 4, pp. 1988– 1995, Dec. 2013. J. Aghaei and M. I. Alizadeh, “Demand response in smart electricity grids equipped with renewable energy sources: A review,” Renew. Sustain. Energy Rev., vol. 18, pp. 64–72, 2013. P. Denholm, E. Ela, B. Kirby, and M. Milligan, “The role of energy storage with renewable electricity generation,” National Renewable Energy Laboratory, Tech. Rep. NREL/TP-6A2-47187, Jan. 2010, Available: http://www.nrel.gov/docs/fy10osti/47187.pdf J. Eyer and G. Corey, “Energy Storage for the Electricity Grid : Benefits and Market Potential Assessment Guide; A Study for the DOE Energy Storage Systems Program,” Sandia National Laboratories, 2010. [15] M. Beaudin, H. Zareipour, A. Schellenberglabe, and W. Rosehart, “Energy storage for mitigating the variability of renewable electricity sources: An updated review,” Energy Sustain. Dev., vol. 14, no. 4, pp. 302–314, 2010. [16] P. Denholm and M. Hand, “Grid flexibility and storage required to achieve very high penetration of variable renewable electricity,” Energy Policy, vol. 39, no. 3, pp. 1817–1830, 2011. [17] K. Bradbury, L. Pratson, and D. Patino-Echeverri, “Economic viability of energy storage systems based on price arbitrage potential in real-time U.S. electricity markets,” Appl. Energy, vol. 114, pp. 512–519, 2014. [18] S. Gottwalt, A. Schuller, C. Flath, H. Schmeck, and C. Weinhardt, “Assessing load flexibility in smart grids: Electric vehicles for renewable energy integration,” in Proc. 2013 IEEE Power and Energy Society General Meeting, Vancouver, BC, 21-25 Jul. 2013, pp. 1-5. [19] S.-I. Inage. (2010). “Modelling load shifting using electric vehicles in a smart grid environment,” IEA/OECD Working Paper. [Online]. Available: http://www.iea.org/publications/freepublications/ publication/load_shifting.pdf [20] A. Majzoobi and A. Khodaei, “Application of Microgrids in Addressing Distribution Network Net-Load Ramping,” IEEE PES Innovative Smart Grid Technologies Conference (ISGT), Minneapolis, MN, 6-9 Sep. 2016. [21] Department of Energy Office of Electricity Delivery and Energy Reliability, “Summary Report: 2012 DOE Microgrid Workshop,” 2012. [Online]. Available: http://energy.gov/sites/prod/files/2012 Microgrid Workshop Report 09102012.pdf. [22] A. Majzoobi and A. Khodaei “Leveraging microgrids for capturing uncertain distribution network net load ramping,” in North American Power Symposium (NAPS), Denver, CO, 18-20 Sep. 2016. [23] A. Khodaei, “Microgrid optimal scheduling with multi-period islanding constraints,” IEEE Trans. Power Syst., vol. 29, no. 3, pp. 1383–1392, May 2014. [24] A. Khodaei, “Resiliency-oriented microgrid optimal scheduling,” IEEE Trans. Smart Grid, vol. 5, no. 4, pp. 1584–1591, July 2014. [25] A. Majzoobi, A. Khodaei, S. Bahramirad and M. H. J. Bollen, "Capturing the Variabilities of Distribution Network Net-Load via Available Flexibility of Microgrids,” CIGRE Grid of the Future Symposium, Philadelphia, PA, 30 Oct.-1 Nov. 2016. [26] A. Khodaei, “Provisional Microgrid Planning,” IEEE Trans. Smart Grid, In press, 2015. [27] F. Wu, X. Li, F. Feng and H. B. Gooi, “Modified Cascaded Multilevel Gird-Connected Inverter to Enhance European Efficiency,” IEEE Trans. Ind. Informatics, vol. 11, no. 6, pp.1358-1365, Dec. 2015. [28] M. J. Sanjari, A. H. Yatim and G. B. Gharehpetian, “Online Dynamic Security Assessment of Microgrids before Intentional Islanding Occurrence,” Neural Comput. & Applic., vol. 26, no. 3, pp.659-668, Oct. 2014. [29] M. Shahidehpour and J. F. Clair, “A Functional Microgrid for Enhancing Reliability, Sustainability, and Energy Efficiency,” The Electr. J., vol. 25, no. 8, pp. 21–28, 2012. [30] Microgrid Exchange Group, “DOE Microgrid Workshop Report,” 2011. [Online]. Available: http://energy.gov/oe/downloads/microgridworkshop-report-august-2011. [31] Navigant Research, “Microgrid Deployment Tracker 4Q13; Commercial/Industrial, Community/Utility, Institutional/Campus, Military, and Remote Microgrids: Operating, Planned, and Proposed Projects by World Region,” 2013. [32] S. Parhizi, H. Lotfi, A. Khodaei, and S. Bahramirad, “State of the art in research on microgrids: A review,” IEEE Access, vol. 3, pp. 890–925, Jul. 2015. [33] W. Pei, Y. Du, W. Deng, K. Sheng, H. Xiao, and H. Qu, “Optimal Bidding Strategy and Intramarket Mechanism of Microgrid Aggregator in RealTime Balancing Market,” IEEE Trans. Ind. Informatics, vol. 12, no. 2, pp. 587–596, Apr. 2016. [34] S. I. Vagropoulos, S. Member, A. G. Bakirtzis, and S. Member, “Optimal Bidding Strategy for Electric Vehicle Aggregators in Electricity,” vol. 28, no. 4, pp. 4031–4041, Nov. 2013. [35] H. Kim and M. Thottan, “A two-stage market model for microgrid power transactions via aggregators,” Bell Labs Tech. J., vol. 16, pp. 101–107, 2011. [36] D. T. Nguyen and L. B. Le, “Risk-constrained profit maximization for microgrid aggregators with demand response,” IEEE Trans. Smart Grid, vol. 6, no. 1, pp. 135–146, Jan. 2015. [37] M. J. Sanjari, H. Karami, and H. B. Gooi, “Micro-generation dispatch in a smart residential multi-carrier energy system considering demand forecast error,” Energy Convers. Manag., vol. 120, pp. 90–99, 2016. 10 [38] L. Shi, Y. Luo, and G. Y. Tu, “Bidding strategy of microgrid with consideration of uncertainty for participating in power market,” Electr. Power Energy Syst., vol. 59, pp. 1–13, 2014. [39] Y. Gu and L. Xie, “Stochastic Look-Ahead Economic Dispatch With Variable Generation Resources,” IEEE Trans. Power Syst., In press, Apr. 2016. [40] B. A. Frew, S. Becker, M. J. Dvorak, G. B. Andersen, and M. Z. Jacobson, “Flexibility mechanisms and pathways to a highly renewable US electricity future,” Energy, vol. 101, pp. 65–78, 2016. [41] Y. Dvorkin, M. A. Ortega-Vazquez, and D. S. Kirschen, “Assessing flexibility requirements in power systems,” IET Gener., Transm., Distrib, vol. 8, no. 11, pp. 1820-1830, Nov. 2014. [42] J. Ma, “Evaluating and planning flexibility in a sustainable power system with large wind penetration,” Ph.D. dissertation, Dept. Electrical and Electronic Eng., Univ. Manchester, Manchester, 2012 [43] Estimating the Value of Lost Load [Online]. Available http://www.ercot.com/content/gridinfo/resource/2015/mktanalysis/ERC OT_ValueofLostLoad_LiteratureReviewandMacroeconomic.pdf Alireza Majzoobi (S’15), received the B.Sc. degree from Sharif University of Technology, Tehran, Iran, in 2007, the M.Sc. degree from the University of Tehran, Tehran, Iran, in 2011, and the second M.Sc. degree from Old Dominion University, Norfolk, VA, USA, in 2015, all in electrical engineering. He is currently pursuing the Ph.D. degree in the Department of Electrical and Computer Engineering at University of Denver, Denver, CO, USA. His current research interests include power system operation and economics, microgrids, and integrating renewable and distributed resources. Amin Khodaei (SM’14) received the Ph.D. degree in electrical engineering from the Illinois Institute of Technology, Chicago, in 2010. He was a visiting faculty (2010–2012) in the Robert W. Galvin Center for Electricity Innovation at Illinois Institute of Technology. He is currently an Associate Professor in the Department of Electrical and Computer Engineering at University of Denver, Denver, CO, USA. His research interests include power system operation, planning, computational economics, microgrids, smart electricity grids, and artificial intelligence.
3cs.SY
arXiv:1711.03842v1 [cs.PL] 9 Nov 2017 Refinement Reflection: Complete Verification with SMT NIKI VAZOU, University of Maryland, USA ANISH TONDWALKAR, University of California, San Diego, USA VIKRAMAN CHOUDHURY, Indiana University, USA RYAN G. SCOTT, Indiana University, USA RYAN R. NEWTON, Indiana University, USA PHILIP WADLER, University of Edinburgh and Input Output HK, UK RANJIT JHALA, University of California, San Diego, USA We introduce Refinement Reflection, a new framework for building SMT-based deductive verifiers. The key idea is to reflect the code implementing a user-defined function into the function’s (output) refinement type. As a consequence, at uses of the function, the function definition is instantiated in the SMT logic in a precise fashion that permits decidable verification. Reflection allows the user to write equational proofs of programs just by writing other programs e.g. using pattern-matching and recursion to perform case-splitting and induction. Thus, via the propositions-as-types principle, we show that reflection permits the specification of arbitrary functional correctness properties. Finally, we introduce a proof-search algorithm called Proof by Logical Evaluation that uses techniques from model checking and abstract interpretation, to completely automate equational reasoning. We have implemented reflection in Liqid Haskell and used it to verify that the widely used instances of the Monoid, Applicative, Functor, and Monad typeclasses actually satisfy key algebraic laws required to make the clients safe, and have used reflection to build the first library that actually verifies assumptions about associativity and ordering that are crucial for safe deterministic parallelism. CCS Concepts: • Software and its engineering → General programming languages; General programming languages; Additional Key Words and Phrases: refinement types, theorem proving, Haskell, automatic verification ACM Reference Format: Niki Vazou, Anish Tondwalkar, Vikraman Choudhury, Ryan G. Scott, Ryan R. Newton, Philip Wadler, and Ranjit Jhala. 2018. Refinement Reflection: Complete Verification with SMT. Proc. ACM Program. Lang. 2, POPL, Article 53 (January 2018), 59 pages. https://doi.org/10.1145/3158141 1 INTRODUCTION Deductive verifiers fall roughly into two camps. Satisfiability Modulo Theory (SMT) based verifiers (e.g. Dafny and F*) use fast decision procedures to automate the verification of programs that only require reasoning over a fixed set of theories like linear arithmetic, string, set and bitvector operations. These verifiers, however, encode the semantics of user-defined functions with universally-quantified axioms and use incomplete (albeit effective) heuristics to instantiate those Authors’ addresses: Niki Vazou, University of Maryland, USA, [email protected]; Anish Tondwalkar, University of California, San Diego, USA, [email protected]; Vikraman Choudhury, Indiana University, USA; Ryan G. Scott, Indiana University, USA; Ryan R. Newton, Indiana University, USA; Philip Wadler, University of Edinburgh and Input Output HK, UK, [email protected]; Ranjit Jhala, University of California, San Diego, USA, [email protected]. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. © 2018 Association for Computing Machinery. 2475-1421/2018/1-ART53 https://doi.org/10.1145/3158141 Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53 53:2 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala axioms. These heuristics make it difficult to characterize the kinds of proofs that can be automated, and hence, explain why a given proof attempt fails [30]. At the other end, we have Type-Theory (TT) based theorem provers (e.g. Coq and Agda) that use type-level computation (normalization) to facilitate principled reasoning about terminating user-defined functions, but which require the user to supply lemmas or rewrite hints to discharge proofs over decidable theories. We introduce Refinement Reflection, a new framework for building SMT-based deductive verifiers, which permits the specification of arbitrary properties and yet enables complete, automated SMTbased reasoning about user-defined functions. In previous work, refinement types [17, 44] — which decorate basic types (e.g. Integer) with SMT-decidable predicates (e.g. {v:Integer | 0 ≤ v && v < 100}) — were used to retrofit so-called shallow verification, such as array bounds checking, into several languages: ML [6, 42, 63], C [16, 43], Haskell [56], TypeScript [59], and Racket [26]. In this work, we extend refinement types with refinement reflection, leading to the following three contributions. 1. Refinement Reflection Our first contribution is the notion of refinement reflection. To reason about user-defined functions, the function’s implementation is reflected into its (output) refinementtype specification, thus converting the function’s type signature into a precise description of the function’s behavior. This simple idea has a profound consequence: at uses of the function, the standard rule for (dependent) function application yields a precise means of reasoning about the function (§ 4). 2. Complete Specification Our second contribution is a library of combinators that lets programmers compose sophisticated proofs from basic refinements and function definitions. Our proof combinators let programmers use existing language mechanisms, like branches (to encode case splits), recursion (to encode induction), and functions (to encode auxiliary lemmas), to write proofs that look very much like their pencil-and-paper analogues (§ 2). Furthermore, since proofs are literally just programs, we use the principle of propositions-as-types [62] (known as the Curry-Howard isomorphism [24]) to show that SMT-based verifiers can express any natural deduction proof, thus providing a pleasant implementation of natural deduction that can be used for pedagogical purposes (§ 3). 3. Complete Verification While equational proofs can be very easy and expressive, writing them out can quickly get exhausting. Our third contribution is Proof by Logical Evaluation (PLE) a new proof-search algorithm that automates equational reasoning. The key idea in PLE is to mimic type-level computation within SMT-logics by representing functions in a guarded form [19] and repeatedly unfolding function application terms by instantiating them with their definition corresponding to an enabled guard. We formalize a notion of equational proof and show that the above strategy is complete: i.e. it is guaranteed to find an equational proof if one exists. Furthermore, using techniques from the literature on Abstract Interpretation [18] and Model Checking [14], we show that the above proof search corresponds to a universal (or must) abstraction of the concrete semantics of the user-defined functions. Thus, since those functions are total, we obtain the pleasing guarantee that proof search terminates (§ 6). We evaluate our approach by implementing refinement reflection and PLE in Liqid Haskell [56], thereby turning Haskell into a theorem prover. Repurposing an existing programming language allows us to take advantage of a mature compiler and an ecosystem of libraries, while keeping proofs and programs in the same language. We demonstrate the benefits of this conversion by proving typeclass laws. Haskell’s typeclass machinery has led to a suite of expressive abstractions and optimizations which, for correctness, crucially require typeclass instances to obey key algebraic laws. We show how reflection and PLE can be used to verify that widely used instances of the Monoid, Applicative, Functor, and Monad typeclasses satisfy the respective laws. Finally, we use Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:3 reflection to create the first deterministic parallelism library that actually verifies assumptions about associativity and ordering that ensure determinism (§ 7). Thus, our results demonstrate that Refinement Reflection and Proof by Logical Evaluation identify a new design for deductive verifiers which, by combining the complementary strengths of SMTand TT- based approaches, enables complete verification of expressive specifications spanning decidable theories and user defined functions. 2 OVERVIEW We start with an overview of how SMT-based refinement reflection lets us write proofs as plain functions and how PLE automates equational reasoning. 2.1 Refinement Types First, we recall some preliminaries about specification and verification with refinement types. Refinement types are the source program’s (here Haskell’s) types refined with logical predicates drawn from an SMT-decidable logic [17, 44]. For example, we define Nat as the set of Integer values v that satisfy the predicate 0 ≤ v from the quantifier-free logic of linear arithmetic and uninterpreted functions (QF-UFLIA [5]): type Nat = { v:Integer | 0 ≤ v } Specification & Verification Throughout this section, to demonstrate the proof features we add to Liqid Haskell, we will use the textbook Fibonacci function which we type as follows. fib fib fib fib :: Nat → Nat 0 = 0 1 = 1 n = fib (n-1) + fib (n-2) To ensure termination, the input type’s refinement specifies a pre-condition that the parameter must be Nat. The output type’s refinement specifies a post-condition that the result is also a Nat. Refinement type checking automatically verifies that if fib is invoked with a non-negative Integer, then it terminates and yields a non-negative Integer. Propositions We define a data type representing propositions as an alias for unit: type Prop = () which can be refined with propositions about the code, e.g. that 2 + 2 equals 4 type Plus_2_2 = { v: Prop | 2 + 2 = 4 } For simplicity, in Liqid Haskell, we abbreviate the above to type Plus_2_2 = { 2 + 2 = 4 }. Universal & Existential Propositions Using the standard encoding of Howard [24], known as the Curry-Howard isomorphism, refinements encode universally-quantified propositions as dependent function types of the form: type Plus_comm = x:Integer → y:Integer → { x + y = y + x } As x and y refer to arbitrary inputs, any inhabitant of the above type is a proof that Integer addition commutes. Refinements encode existential quantification via dependent pairs of the form: type Int_up = n:Integer → (m::Integer, {n < m}) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:4 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala The notation (m :: t, t') describes dependent pairs where the name m of the first element can appear inside refinements of the second element. Thus, Int_up states the proposition that for every integer n, there exists one that is larger than n. While quantifiers cannot appear directly inside the refinements, dependent functions and pairs allow us to specify quantified propositions. One limitation of this encoding is that quantifiers cannot exist inside refinement’s logical connectives (like ∧ and ∨). In § 3, we describe how to encode logical connectives using data types, e.g. conjunction as a product and disjunction as a union, how to specify arbitrary, quantified propositions using refinement types, i.e. have complete specifications, and how to verify those propositions using refinement type checking. Proofs We prove the above propositions by writing Haskell programs, for example plus_2_2 :: Plus_2_2 plus_2_2 = () plus_comm :: Plus_comm plus_comm = \x y → () int_up :: Int_up int_up = \n → (n+1,()) Standard refinement typing reduces the above to the respective verification conditions (VCs) true ⇒ 2 + 2 = 4 ∀ x, y . true ⇒ x + y = y + x ∀ n .n < n + 1 which are easily deemed valid by the SMT solver, allowing us to prove the respective propositions. Soundness and Lazy Evaluation Readers familiar with Haskell’s lazy semantics may be concerned that “bottom”, which inhabits all types, makes our proofs suspect. Fortunately, as described in Vazou et al. [56], Liqid Haskell, by default, checks that user defined functions provably terminate and are total (i.e. return non-bottom values, and do not throw any exceptions), which makes our proofs sound. Liqid Haskell checks that each function is terminating using a termination metric i.e. a natural number that decreases at each recursive call. For instance, if we generalize the signature of fib to Integers, as shown below, then Liqid Haskell reports a termination error: fib :: n:Integer → Integer Liqid Haskell generates a type error in the definition of fib since in the recursive calls fib (n-1) and fib (n-2) the arguments n-1 and n-2 cannot be proved to be non-negative and less than n. Both these proof obligations are satisfied when the domain of fib is restricted to natural numbers. fib :: n:Nat → Nat / [n] The above type signature is explicitly annotated with the user specified termination metric / [n] declaring that n is the decreasing natural number. Liqid Haskell heuristically assumes that the termination metric is always the first argument of the function (that can be mapped to natural numbers), thus, the above explicit termination metric can be omitted. Not all Haskell functions terminate. The lazy annotation deactivates termination checking, e.g. for the the diverge function shown below. Haskell terms marked as lazy could unsoundly be used as proof terms, much like Coq’s unsoundness with respect to Admitted. For example, the following is accepted by Liqid Haskell lazy diverge diverge :: x:Integer → { x = 0 } diverge x = diverge x Totality Checking Liqid Haskell further checks that all user-specified functions are totally defined. For instance the below definition fibPartial 0 = 0 fibPartial 1 = 1 generates a totality error. The above definition is completed, by GHC, with an error invocation Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:5 fibPartial 0 = 0 fibPartial 1 = 1 fibPartial _ = error "undefined" Thus, to check totality, Liqid Haskell simply ascribes the precondition false to error error :: { v:String | false } → a Thus, to typecheck fibPartial, Liqid Haskell needs to prove that the call to error is dead-code, i.e. happens under an inconsistent environment. As this check fails, Liqid Haskell generates a totality error. As with termination checking, Liqid Haskell provides an unsound error function unsoundError with no false precondition. In the sequel (and in our evaluation) we assume that proof terms are generated without any unsound uses of lazy or unsafeError. However, note that lazy, diverging functions can be soundly verified, and diverging code can soundly co-exist with terminating proof terms: we refer the reader to Vazou et al. [56] for details. 2.2 Refinement Reflection Suppose we wish to prove properties about the fib function, e.g. that {fib 2 = 1}. Standard refinement type checking runs into two problems. First, for decidability and soundness, arbitrary user-defined functions cannot belong in the refinement logic, i.e. we cannot refer to fib in a refinement. Second, the only specification that a refinement type checker has about fib is its type Nat → Nat which is too weak to verify {fib 2 = 1}. To address both problems, we reflect fib into the logic which sets the three steps of refinement reflection in motion. Step 1: Definition The annotation creates an uninterpreted function fib :: Integer → Integer in the refinement logic. By uninterpreted, we mean that the logical fib is not connected to the program function fib; in the logic, fib only satisfies the congruence axiom ∀n, m. n = m ⇒ fib n = fib m. On its own, the uninterpreted function is not terribly useful: we cannot check {fib 2 = 1} as the SMT solver cannot prove the VC true ⇒ fib 2 = 1 which requires reasoning about fib’s definition. Step 2: Reflection In the next key step, we reflect the definition of fib into its refinement type by automatically strengthening the user defined type for fib to: fib :: n:Nat → { v:Nat | v = fib n && fibP n } where fibP is an alias for a refinement automatically derived from the function’s definition: fibP n  n == 0 ⇒ fib n = 0 ∧ n == 1 ⇒ fib n = 1 ∧ n > 1 ⇒ fib n = fib (n-1) + fib (n-2) Step 3: Application With the reflected refinement type, each application of fib in the code automatically unfolds the definition of fib once in the logic. We prove {fib 2 = 1} by: pf_fib2 :: { fib 2 = 1 } pf_fib2 = let { t0 = fib 0; t1 = fib 1; t2 = fib 2 } in () We write in bold red, f, to highlight places where the unfolding of f’s definition is important. Via refinement typing, the above yields the following VC that is discharged by SMT, even though fib is uninterpreted: (fibP 0 ∧ fibP 1 ∧ fibP 2) ⇒ (fib 2 = 1) The verification of pf_fib2 relies merely on the fact that fib is applied to (i.e. unfolded at) 0, 1, and 2. The SMT solver automatically combines the facts, once they are in the antecedent. Thus, the following is also verified: Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:6 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala pf_fib2' :: {v:[Nat] | fib 2 = 1 } pf_fib2' = [ fib 0, fib 1, fib 2 ] In the next subsection, we will continue to use explicit, step-by-step proofs as above, but we will introduce tools for proof composition. Then, in § 2.4 we will show how to eliminate unnecessary details from such proofs, using Proof by Logical Evaluation (PLE). 2.3 Equational Proofs We can structure proofs to follow the style of calculational or equational reasoning popularized in classic texts [8, 20] and implemented in Agda [34] and Dafny [31]. To this end, we have developed a library of proof combinators that permits reasoning about equalities and linear arithmetic. “Equation” Combinators We equip Liqid Haskell with a family of equation combinators, ⊙, for logical operators in the theory QF-UFLIA, ⊙ ∈ {=, ,, ≤, <, ≥, >}. In Haskell code, to avoid collisions with existing operators, we further append a colon “:” to these operators, so that “=” becomes the Haskell operator (=:). The refinement type of ⊙ requires that x ⊙ y holds and then ensures that the returned value is equal to x. For example, we define (=:) as: (=:) :: x:a → y:{ a | x = y } → { v:a | v = x } x =: _ = x and use it to write the following equational proof: fib2_1 :: { fib 2 = 1 } fib2_1 = fib 2 =: fib 1 + fib 0 =: 1 ** QED where ** QED constructs proof terms by casting expressions to Prop in a post-fix fashion. data QED = QED (**) :: a → QED → Prop _ ** QED = () Proof Arguments Often, we need to compose lemmas into larger theorems. For example, to prove fib 3 = 2 we may wish to reuse fib2_1 as a lemma. We do so by defining a variant of (=:), written as (=?), that takes an explicit proof argument: (=?) :: x:a → y:a → { Prop | x = y } → { v:a | v = x } x =? _ _ = x We use the (=?) combinator to prove that fib 3 = 2. fib3_2 :: { fib 3 = 2 } fib3_2 = (fib 3 =: fib 2 + fib 1 =? 2 $ fib2_1) ** QED Here fib 2 is not important to unfold, because fib2_1 already provides the same information. “Because” Combinators Observe that the proof term fib3_2 needs parentheses, since Haskell’s ($) operator has the lowest (i.e. 0) precedence. To omit parentheses in proof terms, we define a “because” combinator that operates exactly like Haskell’s ($) operator, but has the same precedence as the proof combinators (=:) and (=?). (∵) :: (Prop → a) → Prop → a f ∵ y = f y We use the “because” combinator to remove the parentheses from the proof term fib3_2. fib3_2 :: { fib 3 = 2 } fib3_2 = fib 3 =: fib 2 + fib 1 =? 2 ∵ fib2_1 ** QED Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:7 Optional Proof Arguments Finally, we unify both combinators (=:) and (=?) using type classes to define the class method (=.) that takes an optional proof argument, and generalize such definitions for each operator in ⊙. We define the class OptEq to have one method (=.) that takes two arguments of type a, to be compared for equality, and returns a value of type r. class OptEq a r where (=.) :: a → a → r When instantiating the result type to be the same as the argument type a, (=.) behaves as (=:). instance (a~b) ⇒ OptEq a b where (=.) :: x:a → { y:a | x = y } → { v:b | v = x } When the result type is instantiated to be a function that given a proof term Prop returns the argument type a, (=.) behaves exactly as (=?). instance (a~b) ⇒ OptEq a (Prop → b) where (=.) :: x:a → y:a → { Prop | x = y } → { v:a | v = x } Thus, (=.) takes two arguments to be compared for equality and, optionally, a proof term argument. With this, the proof term fib3_2 is simplified to fib3_2 :: { fib 3 = 2 } fib3_2 = fib 3 =. fib 2 + fib 1 =. 2 ∵ fib2_1 ** QED Arithmetic and Ordering Next, lets see how we can use arithmetic and ordering to prove that fib is (locally) increasing, i.e. for all n, fib n ≤ fib (n + 1). type Up f = n:Nat → { f n ≤ f (n + 1) } fibUp :: Up fib fibUp 0 = fib 0 <. fib 1 ** QED fibUp 1 = fib 1 ≤. fib 1 + fib 0 =. fib 2 ** QED fibUp n = fib n ≤. fib n + fib (n-1) =. fib (n+1) ** QED Case Splitting The proof fibUp works by splitting cases on the value of n. In the cases 0 and 1, we simply assert the relevant inequalities. These are verified as the reflected refinement unfolds the definition of fib at those inputs. The derived VCs are (automatically) proved as the SMT solver concludes 0 < 1 and 1 + 0 ≤ 1 respectively. When n is greater than one, fib n is unfolded to fib (n-1) + fib (n-2), which, as fib (n-2) is non-negative, completes the proof. Induction & Higher Order Reasoning Refinement reflection smoothly accommodates induction and higher-order reasoning. For example, let’s prove that every function f that increases locally (i.e. f z ≤ f (z+1) for all z) also increases globally (i.e. f x ≤ f y for all x < y) type Mono = f:(Nat → Integer) → Up f → x:Nat → y:{ x < y } → { f x ≤ f y } fMono :: Mono / [y] fMono f up x y | x+1 == y = f x ≤. f (x+1) ∵ up x ≤. f y ** QED | x+1 < y = f x ≤. f (y-1) ∵ fMono f up x (y-1) ≤. f y ∵ up (y-1) ** QED We prove the theorem by induction on y as specified by the annotation / [y] which states that y is a well-founded termination metric that decreases at each recursive call [56]. If x+1 == y, then we call the up x proof argument. Otherwise, x+1 < y, and we use the induction hypothesis i.e. apply Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:8 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala fMono at y-1, after which transitivity of the less-than ordering finishes the proof. We can apply the general fMono theorem to prove that fib increases monotonically: fibMono :: n:Nat → m:{ n < m } → { fib n ≤ fib m } fibMono = fMono fib fibUp 2.4 Complete Verification: Automating Equational Reasoning While equational proofs can be very easy, writing them out can quickly get exhausting. Lets face it: fib3_2 is doing rather a lot of work just to prove that fib 3 equals 2! Happily, the calculational nature of such proofs allows us to develop the following proof search algorithm PLE that is inspired by model checking [14] • Guard Normal Form: First, as shown in the definition of fibP in § 2.2, each reflected function is transformed into a guard normal form ∧i (pi ⇒ f (x) = bi ) i.e. a collection of guards pi and their corresponding definition bi . • Unfolding: Second, given a VC of the form Φ ⇒ p, we iteratively unfold function application terms in Φ and p by instantiating them with the definition corresponding to an enabled guard, where we check enabled-ness by querying the SMT solver. For example, given the VC true ⇒ fib 3 = 2, the guard 3 > 1 of the application fib 3 is trivially enabled, i.e. is true, hence we strengthen the hypothesis Φ with the equality fib 3 = fib (3 − 1) + fib (3 − 2) corresponding to unfolding the definition of fib at 3. • Fixpoint: We repeat the unfolding process until either the VC is proved or we have reached a fixpoint, i.e. no further unfolding is enabled. For example, the fixpoint computation of fib 3 unfolds the definition of fib at 3, 2, 1, and 0 and then stops as no further guards are enabled. Automatic Equational Reasoning In § 6 we formalize a notion of equational proof and show that the proof search procedure PLE enjoys two key properties. First, that it is guaranteed to find an equational proof if one can be constructed from unfoldings of function definitions. (The user must still provide instantiations of lemmas and induction hypotheses.) Second, that under certain conditions readily met in practice, it is guaranteed to terminate. These two properties allow us to use PLE to predictably automate proofs: the programmer needs only to supply the relevant induction hypotheses or helper lemma applications. The remaining long chains of calculations are performed automatically via SMT-based PLE. That is, the user must provide case statements and the recursive structure, but can elide the long chains of =. applications. To wit, with complete proof search, the proofs of § 2.3 shrink to: fib3_2 :: {fib 3 = 2} fib3_2 = () fMono :: Mono / [y] fMono f up x y | x+1 == y = up x | x+1 < y = up (y-1) &&& fMono up x (y-1) where the combinator p &&& q = () inserts the propositions p and q to the VC hypothesis. PLE vs. Axiomatization Existing SMT based verifiers like Dafny [29] and F* [52] use the classical axiomatic approach to verify assertions over user-defined functions like fib. In these systems, the function is encoded in the logic as a universally quantified formula (or axiom): ∀n. fibP n after which the SMT solver may instantiate the above axiom at 3, 2, 1 and 0 in order to automatically prove {fib 3 = 2}. The automation offered by axioms is a bit of a devil’s bargain, as axioms render VC checking undecidable, and in practice automatic axiom instantiation can easily lead to infinite “matching loops”. For example, the existence of a term fib n in a VC can trigger the above axiom, which may then produce the terms fib (n − 1) and fib (n − 2), which may then recursively give rise to further Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:9 app_assoc :: AppendAssoc app_assoc [] ys zs = ([] ++ ys) ++ zs =. ys ++ zs =. [] ++ (ys ++ zs) ** QED app_assoc (x:xs) ys zs = ((x : xs) ++ ys) ++ zs =. (x : (xs ++ ys)) ++ zs =. x :((xs ++ ys) ++ zs) ∵ app_assoc xs ys zs =. x : (xs ++ (ys ++ zs)) =. (x : xs) ++ (ys ++ zs) ** QED app_assoc :: AppendAssoc app_assoc [] ys zs = () app_assoc (x:xs) ys zs = app_assoc xs ys zs app_right_id app_right_id [] app_right_id (x:xs) :: AppendNilId = () = app_right_id xs map_fusion :: MapFusion map_fusion f g [] = () map_fusion f g (x:xs) = map_fusion f g xs Fig. 1. (L) Equational proof of append associativity. (R) PLE proof, also of append-id and map-fusion. instantiations ad infinitum. To prevent matching loops an expert must carefully craft “triggers” or alternatively, provide a “fuel” parameter that bounds the depth of instantiation [1]. Both these approaches ensure termination, but can cause the axiom to not be instantiated at the right places, thereby rendering the VC checking incomplete. The incompleteness is illustrated by the following example from the Dafny benchmark suite [32] pos n | n < 0 = 0 | otherwise = 1 + pos (n-1) test :: y:{y > 5} → {pos n = 3 + pos (n-3)} test _ = () Dafny (and F*’s) fuel-based approach fails to check the above, when the fuel value is less than 3. One could simply raise-the-fuel-and-try-again but at what point does the user know when to stop? In contrast, PLE (1) does not require any fuel parameter, (2) is able to automatically perform the required unfolding to verify this example, and (3) is guaranteed to terminate. 2.5 Case Study: Laws for Lists Reflection and PLE are not limited to integers. We end the overview by showing how they verify textbook properties of lists equipped with append (++) and map functions: reflect (++) :: [a] → [a] → [a] [] ++ ys = ys (x:xs) ++ ys = x : (xs ++ ys) reflect map :: (a → b) → [a] → [b] map f [] = [] map f (x:xs) = f x : map f xs In § 5.1 we will describe how the reflection mechanism illustrated via fibP is extended to account for ADTs using SMT-decidable selection and projection operations, which reflect the definition of xs ++ ys into the refinement as: if isNil xs then ys else sel1 xs : (sel2 xs ++ ys). We require an explicit reflect annotation as not all Haskell functions can be reflected into logic, either because it is unsound to do so (e.g. due to divergence) or because of limitations of our current implementation. Recall that Liqid Haskell verifies that all reflected functions, like (++) and map here, are total [56] and rejects the code otherwise. Laws We can specify various laws about lists with refinement types. For example, the below laws state that (1) appending to the right is an identity operation, (2) appending is an associative operation, and (3) map distributes over function composition: type AppendNilId = xs:_ → { xs ++ [] = xs } type AppendAssoc = xs:_ → ys:_ → zs:_ → { xs ++ (ys ++ zs) = (xs ++ ys) ++ zs } type MapFusion = f:_ → g:_ → xs:_ → { map (f . g) xs = map f (map g xs) } Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:10 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Fig. 2. Proofs that swap is idempotent with Coq, Agda, Dafny and PLE. Proofs On the right in Figure 1 we show the proofs of these laws using PLE, which should be compared to the classical equational proof e.g. by Wadler [61], shown on the left. With PLE, the user need only provide the high-level structure — the case splits and invocations of the induction hypotheses — after which PLE automatically completes the rest of the equational proof. Thus using SMT-based PLE, app_assoc shrinks down to its essence: an induction over the list xs. The difference is even more stark with map_fusion whose full equational proof is omitted, as it is twice as long. PLE vs. Normalization The proofs in Figure 1 may remind readers familiar with Type-Theory based proof assistants (e.g. Coq or Agda) of the notions of type-level normalization and rewriting that permit similar proofs in those systems. While our approach of PLE is inspired by the idea of type level computation, it differs from it in two significant ways. First, from a theoretical point of view, SMT logics are not equipped with any notion of computation, normalization, canonicity or rewriting. Instead, our PLE algorithm shows how to emulate those ideas by asserting equalities corresponding to function definitions (Theorem 6.10). Second, from a practical perspective, the combination of (decidable) SMT-based theory reasoning and PLE’s proof search can greatly simplify verification. For example, consider the swap function from Appel [2]’s Coq textbook: swap :: [Integer] → [Integer] swap (x1:x2:xs) = if x1 > x2 then x2:x1:x2 else x1:x2:xs swap xs = xs In Figure 2 we show four proofs that swap is idempotent: Appel’s proof using Coq (simplified by the use of a hint database and the arithmetic tactic omega), its variant in Agda (for any Decidable Partial Order), the PLE proof, and a proof using the Dafny verifier. It is readily apparent that PLE’s proof search, working hand-in-glove with SMT-based theory reasoning, makes proving the result trivial in comparison to Coq or Agda. Of course, proof assistants like Agda, Coq, and Isabelle emit easily checkable certificates and have decades-worth of tactics, libraries, and proof scripts that enable large scale proof engineering. On the other hand, Dafny’s fuel-based axiom instantiation automatically unfolds the definition of swap twice, thereby completing the proof without any user input. These heuristics are orthogonal to PLE and can be combined with it, if the user wishes to trade off predictability for even more automation. Summary We saw an overview of an SMT-automated refinement type checker that achieves SMTdecidable checking by restricting verification conditions to be quantifier-free and hence, decidable. In existing SMT-based verifiers (e.g. Dafny) there are two main reasons to introduce quantifiers, namely (1) to express quantified specifications and (2) to encode the semantics of user-defined Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:11 Native Terms Implication Negation Conjunction Disjunction Forall Exists Logical Formula e ϕ1 ⇒ ϕ2 ¬ϕ ϕ1 ∧ ϕ2 ϕ1 ∨ ϕ2 ∀x .ϕ ∃x .ϕ Refinement Type {e } ϕ1 → ϕ2 ϕ → { False } (ϕ 1 , ϕ 2 ) Either ϕ 1 ϕ 2 x :τ →ϕ (x :: τ , ϕ) Fig. 3. Mapping from logical predicates to quantifier-free refinement types. { e } abbreviates { v : Prop | e }. Function binders are not relevant for negation and implication, and hence, elided. functions. Next, we use propositions-as-types to encode quantified specifications and in § 4 we show how to encode the semantics of user-defined functions via refinement reflection. 3 EMBEDDING NATURAL DEDUCTION WITH REFINEMENT TYPES In this section we show how user-provided quantified specifications can be naturally encoded using λ-abstractions and dependent pairs to encode universal and existential quantification, respectively. Proof terms can be generated using the standard natural deduction derivation rules, following Propositions as Types [62] (also known as the Curry-Howard isomorphism [24]). What is new is that we exploit this encoding to show for the first time that a refinement type system can represent any proof in Gentzen’s natural deduction [23] while still taking advantage of SMT decision procedures to automate the quantifier-free portion of natural deduction proofs. For simplicity, in this section we assume all terms are total. 3.1 Propositions: Refinement Types Figure 3 maps logical predicates to types constructed over quantifier-free refinements. Native terms Native terms consist of all of the (quantifier-free) expressions of the refinement languages. In § 4 we formalize refinement typing in a core calculus λ R where refinements include (quantifier-free) terminating expressions. Boolean connectives Implication ϕ 1 ⇒ ϕ 2 is encoded as a function from the proof of ϕ 1 to the proof of ϕ 2 . Negation is encoded as an implication where the consequent is False. Conjunction ϕ 1 ∧ ϕ 2 is encoded as the pair (ϕ 1 , ϕ 2 ) that contains the proofs of both conjuncts and disjunction ϕ 1 ∨ ϕ 2 is encoded as the sum type Either that contains the proofs of one of the disjuncts, i.e. where data Either a b = Left a | Right b. Quantifiers Universal quantification ∀x .ϕ is encoded as lambda abstraction x : τ → ϕ and eliminated by function application. Existential quantification ∃x .ϕ is encoded as a dependent pair (x::τ , ϕ) that contains the term x and a proof of a formula that depends on x. Even though refinement type systems do not traditionally come with explicit syntax for dependent pairs, one can encode dependent pairs in refinements using abstract refinement types [55] which do not add extra complexity to the system. Consequently, we add the syntax for dependent pairs in Figure 3 as syntactic sugar for abstract refinements. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:12 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala 3.2 Proofs: Natural Deduction We overload ϕ to be both a proposition and a refinement type. We connect these two meanings of ϕ by using the Propositions as Types [62], to prove that if there exists an expression (or proof term) with refinement type ϕ, then the proposition ϕ is valid. We construct proofs terms using Gentzen’s natural deduction system [23], whose rules map directly to refinement type derivations. The rules for natural deduction arise from the propositionsas-types reading of the standard refinement type checking rule (to be defined in § 4) Γ ⊢ e : ϕ as “ϕ is provable under the assumptions of Γ”. We write Γ ⊢N D ϕ for Gentzen’s natural deduction judgment “under assumption Γ, proposition ϕ holds”. Then, each of Gentzen’s logical rules can be recovered from the rules in Figure 5 by rewriting each judgment Γ ⊢ e : ϕ of λ R as Γ ⊢N D ϕ. For example, conjunction and universal elimination can be derived as: Γ ⊢N D ϕ 1 ∨ ϕ 2 Γ, ϕ 1 ⊢N D ϕ Γ, ϕ 2 ⊢N D ϕ Γ ⊢N D e x term Γ ⊢N D ∀x .ϕ ∨ -E ∀-E Γ ⊢N D ϕ[x/e x ] Γ ⊢N D ϕ Programs as Proofs As Figure 5 directly maps natural deduction rules to derivations that are accepted by refinement typing, we conclude that if there exists a natural deduction derivation for a proposition ϕ, then there exists an expression that has the refinement type ϕ. Theorem 3.1. If Γ ⊢N D ϕ, then we can construct an e such that Γ ⊢ e : ϕ. Note that our embedding is not an isomorphism, since the converse of Theorem 3.1 does not hold. As a counterexample, the law of the excluded middle can be proved in our system (i.e. we can construct an Either term e, so that p : { Bool | True } ⊢ e : p ∨ ¬p), but cannot be proved using natural deduction (i.e. { True } ⊬N D p ∨ ¬p). The reason for that is that our system is using the classical logic of the SMTs, which includes the law of the excluded middle. On the contrary, in intuitionistic systems that also encode natural deduction (e.g. Coq, Idris, NuPRL) the law of the excluded middle should be axiomatized. 3.3 Examples Next, we illustrate our encoding with examples of proofs for quantified propositions ranging from textbook logical tautologies, properties of datatypes like lists, and induction on natural numbers. Natural Deduction as Type Derivation We illustrate the mapping from natural deduction rules to typing rules in Figure 4 which uses typing judgments to express Gentzen’s proof of the proposition ϕ ≡ (∃x .∀y.(p x y)) ⇒ (∀y.∃x .(p x y)) Read bottom-up, the derivation provides a proof of ϕ. Read top-down, it constructs a proof of the formula as the term λe y.case e of {(x, e x ) → (x, e x y)}. This proof term corresponds directly to the following Haskell expression that typechecks with type ϕ. exAll :: p:(a → a → Bool) → (x::a, y:a → {p x y}) → y:a → (x::a, {p x y}) exAll _ = \e y → case e of {(x, ex) → (x, ex y)} SMT-aided proofs The great benefit of using refinement types to encode natural deduction is that the quantifier-free portions of the proof can be automated via SMTs. For every quantifier-free proposition ϕ, you can convert between {ϕ}, where ϕ is treated as an SMT-proposition and ϕ, where ϕ is treated as a type; and this conversion goes both ways. For example, let ϕ ≡ p ∧ (q ∨ r ). Then flatten converts from ϕ to {ϕ} and expand the other way, while this conversion is SMT-aided. flatten :: p:_ → q:_ → r:_→ ({p}, Either {q} {r}) → {p && (q || r)} flatten (pf, Left qf) = pf &&& qf flatten (pf, Right rf) = pf &&& rf Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:13 e :ϕ e , y :τy ⊢ e : ϕ e e :ϕ e , y :τy , x :t x , e x :ϕ x ⊢ e x : ϕ x e :ϕ e , y :τy , x :t x , e x :ϕ x ⊢ y : τy e :ϕ e , y :τy , x :t x , e x :ϕ x ⊢ e x y : p x y ∀-E e :ϕ e , y :τy ⊢ case e of {(x, e x ) → (x, e x y)} : ∃x .(p x y) ∃-E e :ϕ e ⊢ λy.case e of {(x, e x ) → (x, e x y)} : ∀y.∃x .(p x y) ∀-I ∅ ⊢ λe y.case e of {(x, e x ) → (x, e x y)} : (∃x .∀y.(p x y)) ⇒ (∀y.∃x .(p x y)) ⇒ -I Fig. 4. Proof of (∃x .∀y.(p x y)) ⇒ (∀y.∃x .(p x y)) where ϕ e ≡ ∃x .∀y.(p x y), ϕ x ≡ ∀y.(p x y). expand :: p:_ → q:_ → r:_ → {p && (q || r)} → ({p}, Either {q} {r}) expand proof | q = (proof, Left proof) expand proof | r = (proof, Right proof) Distributing Quantifiers Next, we construct the proof terms needed to prove two logical properties: that existentials distribute over disjunctions and foralls over conjunctions, i.e. ϕ ∃ ≡ (∃x .p x ∨ q x) ⇒ ((∃x .p x) ∨ (∃x .q x)) (1) ϕ ∀ ≡ (∀x .p x ∧ q x) ⇒ ((∀x .p x) ∧ (∀x .q x)) (2) The specification of these properties requires nesting quantifiers inside connectives and vice versa. The proof of ϕ ∃ (1) proceeds by existential case splitting and introduction: exDistOr :: p:_ → q:_ → (x ::a , Either {p x} {q x }) → Either (x ::a , {p x }) (x ::a , {q x }) exDistOr _ _ (x , Left px ) = Left (x , px ) exDistOr _ _ (x , Right qx ) = Right (x , qx ) Dually, we prove ϕ ∀ (2) via a λ-abstraction and case spitting inside the conjunction pair: allDistAnd :: p:_ → q:_ → → allDistAnd _ _ andx = ( (\ x , (\ x (x:a → ({ p x}, {q x }) ) (( x:a → {p x }) , (x:a → {q x }) ) → case andx x of (px , _) → px ) → case andx x of (_ , qx ) → qx ) ) The above proof term exactly corresponds to its natural deduction proof derivation but using SMT-aided verification can get simplified to the following allDistAnd _ _ andx = (pf , pf ) where pf x = case andx x of (px , py ) → px &&& py Properties of User Defined Datatypes As ϕ can describe properties of data types like lists, we can prove properties of such types, e.g. that for every list xs, if there exists a list ys such that xs == ys ++ ys ,then xs has even length. ϕ ≡ ∀xs.((∃ys. xs = ys ++ ys) ⇒ (∃n.len xs = n + n)) The proof (evenLen) proceeds by existential elimination and introduction and uses the lenAppend lemma, which in turn uses induction on the input list and PLE to automate equational reasoning. evenLen :: xs :[ a] → ( ys ::[ a ] ,{ xs = ys ++ ys }) → (n :: Int ,{ len xs = n+n }) evenLen xs (ys , pf ) = ( len ys , lenAppend ys ys &&& pf ) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:14 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Γ ⊢ fst e : ϕ 1 Γ ⊢ snd e : ϕ 2 Γ ⊢ e : (ϕ 1 , ϕ 2 ) Γ ⊢ e : (ϕ 1 , ϕ 2 ) Γ ⊢ fst e : ϕ 1 Γ ⊢ e : (ϕ 1 , ϕ 2 ) ∧ -I Γ ⊢ e1 : ϕ1 Γ ⊢ Left e 1 : Either ϕ 1 ϕ 2 Γ ⊢ snd e : ϕ 2 Γ ⊢ case e of { Left x 1 → e 1 ; Right x 2 → e 2 } : ϕ Γ ⊢ e1 : ϕ2 Γ ⊢ e : (x :: τ , ϕ[x/fst e]) ∧ -R-E Γ ⊢ e : Either ϕ 1 ϕ 2 Γ, x 1 :ϕ 1 ⊢ e 1 : ϕ Γ, x 2 :ϕ 2 ⊢ e 2 : ϕ ∨ -L-I ∨ -R-I Γ ⊢ Right e 2 : Either ϕ 1 ϕ 2 Γ, x :ϕ x ⊢ e : ϕ ⇒ -I Γ ⊢ λx .e : ϕ x → ϕ Γ, x :τ ⊢ e : ϕ ∀-I Γ ⊢ λx .e : (x : τ → ϕ) Γ ⊢ fst e : τ Γ, x :τ ⊢ snd e : ϕ ∧ -L-E Γ ⊢ e : ϕx → ϕ Γ ⊢ ex : ϕ x Γ ⊢ e ex : ϕ Γ ⊢ ex : τ Γ ⊢ e : (x : τ → ϕ) ∃-I ∨ -E ⇒ -E ∀-E Γ ⊢ e e x : ϕ[x/e x ] Γ ⊢ e : (x :: τ , ϕ x ) Γ, x :τ , y :ϕ x ⊢ e ′ : ϕ Γ ⊢ case e of {(x, y) → e ′ } : ϕ ∃-E Fig. 5. Natural deduction rules for refinement types. With [fst|snd] e ≡ case e of {(x 1 , x 2 ) → [x 1 |x 2 ]} . lenAppend :: xs :_ → ys :_ → { len ( xs ++ ys ) = len xs + len ys } lenAppend [] _ = () lenAppend ( x: xs ) ys = lenAppend xs ys Induction on Natural Numbers Finally, we specify and verify induction on natural numbers: ϕ ind ≡ (p 0 ∧ (∀n.p (n − 1) ⇒ p n) ⇒ ∀n.p n) The proof proceeds by induction (e.g. case splitting). In the base case, n == 0, the proof calls the left conjunct, which contains a proof of the base case. Otherwise, 0 < n, and the proof applies the induction hypothesis to the right conjunct instantiated at n-1. ind :: p : _ → ({ p 0} ,( n: Nat → {p (n -1) } → {p n }) ) → n: Nat → {p n} ind p ( p0 , pn ) 0 = p0 ind p ( p0 , pn ) n = pn n ( ind p (p0 , pn ) (n -1) ) 3.4 Consequences To summarize, we use the propositions-as-types principle to make two important contributions. First, we show that natural deduction reasoning can smoothly co-exist with SMT-based verification to automate the decidable, quantifier-free portions of the proof. Second, we show for the first time how natural deduction proofs can be encoded in refinement type systems like Liqid Haskell and we expect this encoding to extend, in a straightforward manner to other SMT-based deductive verifiers (e.g. Dafny and F*). This encoding shows that refinement type systems are expressive enough to encode any intuitionistic natural deduction proof, gives a guideline for encoding proofs with nested quantifiers, and provides a pleasant implementation of natural deduction that is pedagogically useful. 4 REFINEMENT REFLECTION: λ R Refinement reflection encodes recursive functions in the quantifier-free, SMT logic and it is formalized in three steps. First, we develop a core calculus λ R with an undecidable type system based Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:15 Ops ⊙ ::= Consts c ::= | Vals w ::= Exprs e ::= | Binds Progs Bas. Types Ref. Types b p B τ ::= ::= ::= ::= =|< ∧ | ! | ⊙ | +, −, . . . True | False | 0, −1, 1, . . . c | λx .e | D w w | x | ee case x = e of {D x → e} e | let rec x : τ = b in b b | reflect x : τ = e in p Int | Bool | T {v : B [⇓] | e} | x :τx → τ Fig. 6. (Left) Syntax of λ R : Denotational Typing. Terms p ::= p ▷◁ p | ⊕1p | D | n | b | x | xp | if p then p else p Ints Bools Bin-Ops Un-Ops Args n b ▷◁ ⊕1 sa ::= ::= ::= ::= ::= | 0, −1, 1, . . . True | False = | < | ∧ | +, −, . . . ! | ... Int | Bool | U Fun sa sa Sorts s ::= sa | sa → s (Right) Syntax of λS : Algorithmic Typing. on denotational semantics and prove it sound. Next, in § 5 we define a language λS that soundly approximates λ R while enabling decidable, SMT-based type checking. Finally, in § 6 we develop a complete proof search algorithm to automate equational reasoning. 4.1 Syntax Figure 6 summarizes the syntax of λ R , which is essentially the calculus λU [56] with explicit recursion and a special reflect binding to denote terms that are reflected into the refinement logic. The elements of λ R are constants, values, expressions, binders, and programs. Constants The constants of λ R include primitive relations ⊙, here, the set {=, <}. Moreover, they include the booleans True, False, integers −1, 0, 1, etc., and logical operators ∧, !, etc.. Data Constructors Data constructors are special constants. For example, the data type [Int], which represents finite lists of integers, has two data constructors: [] (nil) and : (cons). Values & Expressions The values of λ R include constants, λ-abstractions λx .e, and fully applied data constructors D that wrap values. The expressions of λ R include values, variables x, applications e e, and case expressions. Binders & Programs A binder b is a series of possibly recursive let definitions, followed by an expression. A program p is a series of reflect definitions, each of which names a function that is reflected into the refinement logic, followed by a binder. The stratification of programs via binders is required so that arbitrary recursive definitions are allowed in the program but cannot be inserted into the logic via refinements or reflection. (We can allow non-recursive let binders in expressions e, but omit them for simplicity.) 4.2 Operational Semantics We define ,→ to be the small step, call-by-name β-reduction semantics for λ R . We evaluate reflected terms as recursive let bindings, with termination constraints imposed by the type system: reflect x : τ = e in p ,→ let rec x : τ = e in p ,→⋆ We define to be the reflexive, transitive closure of ,→ . Moreover, we define ≈β to be the reflexive, symmetric, and transitive closure of ,→ . Constants Application of a constant requires the argument be reduced to a value; in a single step, the expression is reduced to the output of the primitive constant operation, i.e. c v ,→ δ (c, v). For Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:16 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala example, consider =, the primitive equality operator on integers. We have δ (=, n)  =n where δ (=n , m) equals True iff m is the same as n. Equality We assume that the equality operator is defined for all values, and, for functions, is defined as extensional equality. That is, for all f and f ′, (f = f ′) ,→ True iff ∀v. f v ≈β f ′ v. We assume source terms only contain implementable equalities over non-function types; while function extensional equality only appears in refinements. 4.3 Types λ R types include basic types, which are refined with predicates, and dependent function types. Basic types B comprise integers, booleans, and a family of data-types T (representing lists, trees etc.). For example, the data type [Int] represents lists of integers. We refine basic types with predicates (boolean-valued expressions e) to obtain basic refinement types {v : B | e}. We use ⇓ to mark provably terminating computations and use refinements to ensure that if e:{v : B ⇓ | e ′ }, then e terminates. As discussed by Vazou et al. [56] termination labels are checked using refinement types and are used to ensure that refinements cannot diverge as required for soundness of type checking under lazy evaluation. Termination checking is crucial for this work, as combined with checks for exhaustive definitions (§ 2.1), it ensures totality (well-formedness) of expressions as required by propositions-as-types (§ 3) and termination of PLE (§ 6). Finally, we have dependent function types x :τx → τ where the input x has the type τx and the output τ may refer to the input binder x. We write B to abbreviate {v : B | True} and τx → τ to abbreviate x :τx → τ , if x does not appear in τ . Denotations Each type τ denotes a set of expressions [[τ ]], that is defined via the operational semantics [27]. Let shape(τ ) be the type we get if we erase all refinements from τ and e : shape(τ ) be the standard typing relation for the typed lambda calculus. Then, we define the denotation of types as: [[{x : B | r }]]  {e | e : B, if e ,→⋆ w then r [x/w] ,→⋆ True} [[{x : B ⇓ | r }]]  [[{x : B | r }]] ∩ {e | ∃ w.e ,→⋆ w } [[x :τx → τ ]]  {e | e : shape(τx → τ ), ∀e x ∈ [[τx ]]. (e e x ) ∈ [[τ [x/e x ]]]} Constants For each constant c we define its type prim(c) such that c ∈ [[prim(c)]]. For example, prim(3) prim(+) prim(≤) 4.4    {v : Int⇓ | v = 3} x : Int⇓ → y : Int⇓ → {v : Int⇓ | v = x + y} x : Int⇓ → y : Int⇓ → {v : Bool⇓ | v ⇔ x ≤ y} Refinement Reflection Reflection strengthens function output types with a refinement that reflects the definition of the function in the logic. We do this by treating each reflect-binder (reflect f : τ = e in p) as a let rec-binder (let rec f : Reflect(τ , e) = e in p) during type checking (rule T-Refl in Figure 7). Reflection We write Reflect(τ , e) for the reflection of the term e into the type τ , defined as Reflect({v : B ⇓ | r }, e) Reflect(x :τx → τ , λx .e)   {v : B ⇓ | r ∧ v = e} x :τx → Reflect(τ , e) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:17 As an example, recall from § 2 that the reflect fib strengthens the type of fib with the refinement fibP. That is, let the user specified type of fib be t fib and the its definition be definition λn.e fib . t fib  {v : Int⇓ | 0 ≤ v} → {v : Int⇓ | 0 ≤ v} e fib  case x = n ≤ 1 of {True → n; False → fib(n − 1) + fib(n − 2)} Then, the reflected type of fib will be: Reflect(t fib , e fib ) = n : {v : Int⇓ | 0 ≤ v} → {v : Int⇓ | 0 ≤ v ∧ v = e fib } Termination Checking We defined Reflect(·, ·) to be a partial function that only reflects provably terminating expressions, i.e. expressions whose result type is marked with ⇓. If a non-provably terminating function is reflected in an λ R expression then type checking will fail (with a reflection type error in the implementation). This restriction is crucial for soundness, as diverging expressions can lead to inconsistencies. For example, reflecting the diverging f x = 1 + f x into the logic leads to an inconsistent system that is able to prove 0 = 1. Automatic Reflection Reflection of λ R expressions into the refinements happens automatically by the type system, not manually by the user. The user simply annotates a function f as reflect f . Then, the rule T-Refl in Figure 7 is used to type check the reflected function by strengthening f ’s result via Reflect(·, ·). Finally, the rule T-Let is used to check that the automatically strengthened type of f satisfies f ’s implementation. 4.5 Typing Rules Next, we present the type-checking rules of λ R , as found in Figure 7. Environments and Closing Substitutions A type environment Γ is a sequence of type bindings x 1 : τ1 , . . . , x n : τn . An environment denotes a set of closing substitutions θ which are sequences of expression bindings: x 1 7→ e 1 , . . . , x n 7→ en such that: [[Γ]]  {θ | ∀x : τ ∈ Γ.θ (x) ∈ [[θ · τ ]]} where θ · τ applies a substitution to a type (and likewise θ · p, to a program). A reflection environment R is a sequence that binds the names of the reflected functions with their definitions f 1 7→ e 1 , . . . , fn 7→ en . A reflection environment respects a type environment when all reflected functions satisfy their types: Γ |= R  ∀(f 7→ e) ∈ R. ∃τ . (f : τ ) ∈ Γ ∧ (Γ; R ⊢ e : τ ) Typing A judgment Γ; R ⊢ p : τ states that the program p has the type τ in the type environment Γ and the reflection environment R. That is, when the free variables in p are bound to expressions described by Γ, the program p will evaluate to a value described by τ . Rules All but two of the rules are standard [27, 56] except for the addition of the reflection environment R at each rule. First, rule T-Refl is used to extend the reflection environment with the binding of the function name with its definition (f 7→ e) and moreover to strengthen the type of each reflected binder with its definition, as described previously in § 4.4. Second, rule T-Exact strengthens the expression with a singleton type equating the value and the expression (i.e. reflecting the expression in the type). This is a generalization of the “selfification” rules from [27, 39] and is required to equate the reflected functions with their definitions. For example, the application fib 1 is typed as {v : Int⇓ | fibP 1 ∧ v = fib 1} where the first conjunct comes from the (reflection-strengthened) output refinement of fib (§ 2) and the second comes from rule T-Exact. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:18 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Γ; R ⊢ p : τ Typing x :τ ∈ Γ Γ; R ⊢ x : τ Γ; R ⊢ p : τ ′ T-Var Γ; R ⊢ c : prim(c) Γ; R ⊢ e : {v : B | er } T-Exact Γ; R ⊢ e : {v : B | er ∧ v = e} Γ; R ⊢ e : (x :τx → τ ) T-Con Γ; R ⊢ e x : τx T-App Γ; R ⊢ e e x : τ [x/e x ] Γ; R ⊢ e : {v : T | er } ∀i.prim(D i ) = y j : τ j → {v : T | er i } Γ; R ⊢ τ ′ ⪯ τ T-Sub Γ; R ⊢ p : τ Γ, x : τx ; R ⊢ e : τ Γ; R ⊢ λx .e : (x :τx → τ ) T-Fun Γ, x : τx ; R ⊢ bx : τx Γ, x : τx ⊢ τx Γ, x : τx ; R ⊢ b : τ Γ ⊢τ Γ; R ⊢ let rec x : τx = bx in b : τ Γ ⊢τ Γ, y j : τ j , x : {v : T | er ∧ er i }; R ⊢ ei : τ Γ; R ⊢ case x = e of {D i yi → ei } : τ Γ; R, f 7→ e ⊢ let rec f : Reflect(τf , e) = e in p : τ Γ; R ⊢ reflect f : τf = e in p : τ T-Let T-Case T-Refl Γ ⊢τ Well Formedness Γ, v : B; ∅ ⊢ e : Bool⇓ Γ ⊢ {v : B | e} WF-Base Γ ⊢ τx Γ, x : τx ⊢ τ Γ ⊢ x :τx → τ WF-Fun Γ; R ⊢ τ1 ⪯ τ2 Subtyping ∀θ ∈ [[Γ]].[[θ · {v : B | e 1 }]] ⊆ [[θ · {v : B | e 2 }]] Γ; R ⊢ {v : B | e 1 } ⪯ {v : B | e 2 } Γ; R ⊢ τx′ ⪯ τx Γ, x : τx′ ; R ⊢ τ ⪯ τ ′ Γ; R ⊢ x :τx → τ ⪯ x :τx′ → τ ′ ⪯-Base-λ R ⪯-Fun Fig. 7. Typing of λ R . Well-formedness A judgment Γ ⊢ τ states that the refinement type τ is well-formed in the environment Γ. Following Vazou et al. [56], τ is well-formed if all the refinements in τ are Booltyped, provably terminating expressions in Γ. Subtyping A judgment Γ; R ⊢ τ1 ⪯ τ2 states that the type τ1 is a subtype of τ2 in the environments Γ and R. Informally, τ1 is a subtype of τ2 if, when the free variables of τ1 and τ2 are bound to expressions described by Γ, the denotation of τ1 is contained in the denotation of τ2 . Subtyping of basic types reduces to denotational containment checking, shown in rule ⪯-Base-λ R . That is, τ1 is a subtype of τ2 under Γ if for any closing substitution θ in [[Γ]], [[θ · τ1 ]] is contained in [[θ · τ2 ]]. Soundness We prove that typing implies denotational inclusion and evaluation preserves typing. Theorem 4.1. [Soundness of λ R ] • Denotations If Γ; R ⊢ p : τ , then ∀θ ∈ [[Γ]].θ · p ∈ [[θ · τ ]]. • Preservation If ∅; ∅ ⊢ p : τ and p ,→⋆ w, then ∅; ∅ ⊢ w : τ . Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:19 The proofs can be found in [58]. Theorem 4.1 lets us prove that if ϕ is a λ R type interpreted as a proposition (using the mapping of Figure 3) and if there exists a p so that ∅; ∅ ⊢ p : ϕ, the ϕ is valid. For example, in § 2 we verified that the term fibUp proves n : Nat → {fib n ≤ fib (n + 1)}. Via soundness of λ R , we get that for each valid input n, the result refinement is valid. ∀n.0 ≤ n ,→⋆ True ⇒ fib n ≤ fib (n + 1) ,→⋆ True 5 ALGORITHMIC CHECKING: λS λS is a first order approximation of λ R where higher-order features are approximated with uninterpreted functions and the undecidable type subsumption rule ⪯-Base-λ R is replaced with a decidable one (i.e., ⪯-Base-PLE), yielding an sound and decidable SMT-based algorithmic type system. Figure 6 summarizes the syntax of λS , the sorted (SMT-) decidable logic of quantifier-free equality, uninterpreted functions and linear arithmetic (QF-EUFLIA) [5, 36]. The terms of λS include integers n, booleans b, variables x, data constructors D (encoded as constants), fully applied unary ⊕1 and binary ▷◁ operators, and application x p of an uninterpreted function x. The sorts of λS include the built-in Int and Bool to represent integers and booleans and the uninterpreted U to represent data types. The interpreted functions of λS , e.g. the logical constants = and <, have the function sort s → s. Other functional values in λ R , e.g. reflected λ R functions and λ-expressions, are represented as first-order values with the uninterpreted sort Fun s s. 5.1 Transforming λ R into λS The judgment Γ ⊢ e ⇝ p states that a λ R term e is transformed, under an environment Γ, into a λS term p. If Γ ⊢ e ⇝ p and Γ is clear from the context we write ⌊e⌋ and ⌈p⌉ to denote the translation from λ R to λS and back. Most of the transformation rules are identity and can be found in [58]. Here we discuss the non-identity ones. Embedding Types We embed λ R types into λS sorts as: ⌊Int⌋  Int ⌊Bool⌋  Bool ⌊{v : B [⇓] | e}⌋  ⌊B⌋ ⌊x :τx → τ ⌋  Fun ⌊τx ⌋ ⌊τ ⌋ ⌊T ⌋  U Embedding Constants Elements shared on both λ R and λS translate to themselves. These elements include booleans, integers, variables, binary and unary operators. SMT solvers do not support currying, and so in λS , all function symbols must be fully applied. Thus, we assume that all applications to primitive constants and data constructors are fully applied, e.g. by converting source terms like (+ 1) to (\z → z + 1). Embedding Functions As λS is first-order, we embed λs using the uninterpreted function lam. Γ, x : τx ⊢ e ⇝ p Γ; ∅ ⊢ (λx .e) : (x :τx → τ ) x⌋ Γ ⊢ λx .e ⇝ lam ⌊τ xp ⌊τ ⌋ The term λx .e of type τx → τ is transformed to lamssx x p of sort Fun s x s, where s x and s are respectively ⌊τx ⌋ and ⌊τ ⌋, lamssx is a special uninterpreted function of sort s x → s → Fun s x s, and x of sort s x and p of sort s are the embeddings of the binder and body, respectively. As lam is an SMT-function, it does not create a binding for x. Instead, x is renamed to a fresh SMT name. Embedding Applications We use defunctionalization [40] to embed applications. Γ ⊢ e x ⇝ px Γ ⊢e ⇝p Γ ⊢ e ex ⇝ Γ; ∅ ⊢ e : τx → τ x⌋ app ⌊τ ⌊τ ⌋ p px Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:20 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala The term e e x , where e and e x have types τx → τ and τx , is transformed to appssx p px : s where s and s x are ⌊τ ⌋ and ⌊τx ⌋, the appssx is a special uninterpreted function of sort Fun s x s → s x → s, and p and px are the respective translations of e and e x . Embedding Data Types We embed data constructors to a predefined λS constant sD of sort ⌊prim(D)⌋: Γ ⊢ D ⇝ sD . For each datatype, we create reflected functions that check the top-level constructor and select their individual fields. For example, for lists, we create the functions isNil [] = True isNil (x:xs) = False isCons (x:xs) = True isCons [] = False sel1 (x:xs) = x sel2 (x:xs) = xs The above selectors can be modeled precisely in the refinement logic via SMT support for ADTs [36]. To generalize, let D i be a data constructor such that prim(D i )  τi,1 → · · · → τi,n → τ . Then check isD i has the sort Fun ⌊τ ⌋ Bool and select selD i, j has the sort Fun ⌊τ ⌋ ⌊τi, j ⌋. Embedding Case Expressions We translate case-expressions of λ R into nested if terms in λS , by using the check functions in the guards and the select functions for the binders of each case. Γ ⊢e ⇝p Γ ⊢ ei [yi /selD i x][x/e] ⇝ pi Γ ⊢ case x = e of {D i yi → ei } ⇝ if app isD 1 p then p1 else . . . else pn The above translation yields the reflected definition for append (++) from (§ 2.5). Semantic Preservation The translation preserves the semantics of the expressions. Informally, if Γ ⊢ e ⇝ p, then for every substitution θ and every logical model σ that respects the environment Γ if θ · e ,→⋆ v then σ |= p = ⌊v⌋. 5.2 Algorithmic Type Checking We make the type checking from Figure 7 algorithmic by checking subtyping via our novel, SMTbased Proof by Logical Evaluation(PLE). Next, we formalize how PLE makes checking algorithmic and in § 6 we describe the PLE procedure in detail. Verification Conditions Recall that in § 5.1 we defined ⌊·⌋ as the translation from λ R to λS . Informally, the implication or verification condition (VC) ⌊Γ⌋ ⇒ p1 ⇒ p2 is valid only if the set of values described by p1 is subsumed by the set of values described by p2 under the assumptions of Γ. Γ is embedded into logic by conjoining the refinements of terminating binders [56]: ( Ø ⌊e⌋ if Γ(x) = {x : B ⇓ | e} ⌊Γ⌋  ⌊Γ, x⌋ where we embed each binder as ⌊Γ, x⌋  True otherwise. x ∈Γ Validity Checking Instead of directly using the VCs to check validity of programs, we use the procedure PLE that strengthens the assumption environment ⌊Γ⌋ with equational properties. Concretely, given a reflection environment R, type environment Γ, and expression e, the procedure PLE(⌊R⌋, ⌊Γ⌋, ⌊e⌋) — we will define ⌊R⌋ in § 6.1 — returns true only when the expression e evaluates to True under the reflection and type environments R and Γ. Subtyping via VC Validity Checking We make subtyping, and hence, typing decidable, by replacing the denotational base subtyping rule ⪯-Base-λ R with the conservative, algorithmic version ⪯-Base-PLE that uses PLE to check the validity of the subtyping. PLE(⌊R⌋, ⌊Γ, v : {v : B ⇓ | e 1 }⌋, ⌊e 2 ⌋) Γ; R ⊢P LE {v : B | e 1 } ⪯ {v : B | e 2 } ⪯-Base-PLE This typing rule is sound as functions reflected in R always respect the typing environment Γ (by construction) and because PLE is sound (Theorem 6.2). Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:21 Terms p, t, b ::= λS if-free terms from Figure 6 Functions F ::= λx .⟨p ⇒ b⟩ Definitional Environment Ψ ::= ∅ | f 7→ F , Ψ Logical Environment Φ ::= ∅ | p, Φ Fig. 8. Syntax of Predicates, Terms and Reflected Functions. Lemma 5.1. If Γ; R ⊢P LE {v : B | e 1 } ⪯ {v : B | e 2 } then Γ; R ⊢ {v : B | e 1 } ⪯ {v : B | e 2 }. Soundness of λS We write Γ; R ⊢PLE e : τ for the judgments that can be derived by the algorithmic subtyping rule ⪯-Base-PLE (instead of ⪯-Base-λ R .) Lemma 5.1 implies the soundness of λS . Theorem 5.2 (Soundness of λS ). If Γ; R ⊢PLE e : τ , then Γ; R ⊢ e : τ . 6 COMPLETE VERIFICATION: PROOF BY LOGICAL EVALUATION Next, we formalize our Proof By Logical Evaluation algorithm PLE and show that it is sound (§ 6.1), that it is complete with respect to equational proofs (§ 6.2), and that it terminates (§ 6.3). 6.1 Algorithm Figure 8 describes the input environments for PLE. The logical environment Φ contains a set of hypotheses p, described in Figure 6. The definitional environment Ψ maps function symbols f to their definitions λx .⟨p ⇒ b⟩, written as λ-abstractions over guarded bodies. Moreover, the body b and the guard p contain neither λ nor if. These restrictions do not impact expressiveness: λs can be named and reflected, and if-expressions can be pulled out into top-level guards using DeIf(·), defined in [58]. A definitional environment Ψ can be constructed from R as ⌊R⌋  { f 7→ λx .DeIf(⌊e⌋)|(f 7→ λx .e) ∈ R} Notation We write f (t 1 , . . . , tn ) ≺ Φ if the λS term (app . . . (app f t 1 ) . . . tn ) is a syntactic subterm of some t ∈ Φ. We abuse notation to write f (t) ≺ t ′ for f (t) ≺ {t ′ }. We write SmtValid(Φ, p) for SMT validity of the implication Φ ⇒ p. Instantiation & Unfolding A term q is a (Ψ, Φ)-instance if there exists f (t) ≺ Φ such that: • Ψ(f ) ≡ λx .⟨pi ⇒  bi⟩, • SmtValid(Φ, pi t/x ), and   • q ≡ (f (x) = bi ) t/x . A set of terms Q is a (Ψ, Φ)-instance if every q ∈ Q is an (Ψ, Φ)-instance. The unfolding of Ψ, Φ is the (finite) set of all (Ψ, Φ)-instances. Procedure Unfold(Ψ, Φ) shown in Figure 9 computes and returns the conjunction of Φ and the unfolding of Ψ, Φ. The following properties relate (Ψ, Φ)-instances to the semantics of λ R and SMT validity. Let R[e] denote the evaluation of e under the reflection environment R, i.e. ∅[e]  e and (R, f :e f )[e]  R[let rec f = e f in e]. Lemma 6.1. For every Γ |= R and θ ∈ (|Γ|), • Sat-Inst If ⌊e⌋ is a (⌊R⌋, ⌊Γ⌋)-instance, then θ · R[e] ,→⋆ True. • SMT-Approx If SmtValid(⌊Γ⌋, ⌊e⌋), then θ · R[e] ,→⋆ True. • SMT-Inst If q is a (⌊R⌋, ⌊Γ⌋)-instance and SmtValid(⌊Γ⌋ ∪ {q}, ⌊e⌋), then θ · R[e] ,→⋆ True. The Algorithm Figure 9 shows our proof search algorithm PLE(Ψ, Φ, p) which takes as input a set of reflected definitions Ψ, an hypothesis Φ, and a goal p. The PLE procedure recursively unfolds Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:22 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Unfold : = (Ψ, Φ) → Φ  Ð Φ ∪ f (t )≺Φ Instantiate Ψ, Φ, f , t n     o (pi ⇒ bi ) ∈ d, SmtValid(Φ, pi t/x ) (⌊ f (x)⌋ = bi ) t/x Unfold(Ψ, Φ) = = Ψ(f ) PLE : PLE(Ψ, Φ, p) where loop (i, Φi ) | SmtValid(Φi , p) | Φi+1 ⊆ Φi | otherwise where Φi+1 = (Ψ, Φ, p) → Bool   Ð loop 0, Φ ∪ f (t )≺p Instantiate Ψ, Φ, f , t = = = true false loop (i + 1, Φi+1 ) = Φ ∪ Unfold(Ψ, Φi ) Instantiate Ψ, Φ, f , t where λx .⟨d⟩  Fig. 9. Algorithm PLE: Proof by Logical Evaluation. function application terms by invoking Unfold until either the goal can be proved using the unfolded instances (in which case the search returns true) or no new instances are generated by the unfolding (in which case the search returns false). Soundness First, we prove the soundness of PLE. Theorem 6.2 (Soundness). If PLE(⌊R⌋, ⌊Γ⌋, ⌊e⌋) then ∀θ ∈ (|Γ|), θ · R[e] ,→⋆ True. We prove Theorem 6.2 using the Lemma 6.1 that relates instantiation, SMT validity, and the exact semantics. Intuitively, PLE is sound as it reasons about a finite set of instances by conservatively treating all function applications as uninterpreted [36]. 6.2 Completeness Next, we show that our proof search is complete with respect to equational reasoning. We define a notion of equational proof Ψ, Φ ⊢ t ↠ t ′ and prove that if there exists such a proof, then PLE(Ψ, Φ, t = t ′) is guaranteed to return true. To prove this theorem, we introduce the notion of bounded unfolding which corresponds to unfolding definitions n times. We show that unfolding preserves congruences, and hence, that an equational proof exists iff the goal can be proved with some bounded unfolding. Thus, completeness follows by showing that the proof search procedure computes the limit (i.e. fixpoint) of the bounded unfolding. In § 6.3 we show that the fixpoint is computable: there exists an unfolding depth at which PLE reaches a fixpoint and hence terminates. Bounded Unfolding For every Ψ, Φ, and 0 ≤ n, the bounded unfolding of depth n is defined by: Unfold∗ (Ψ, Φ, 0) Unfold∗ (Ψ, Φ, n + 1)   Φ Φn ∪ Unfold(Ψ, Φn ) where Φn = Unfold∗ (Ψ, Φ, n) That is, the unfolding at depth n essentially performs Unfold upto n times. The bounded-unfoldings yield a monotonically non-decreasing sequence of formulas such that if two consecutive bounded unfoldings coincide, then all subsequent unfoldings are the same. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:23 Ψ, Φ ⊢ t ↠ t Ψ, Φ ⊢ t ↠ t ′′ Eq-Refl Φ′ = Unfold(Ψ, Φ ∪ {ν = t ′′ }) SmtValid(Φ′, ν = t ′) Ψ, Φ ⊢ t ↠ t ′ Ψ, Φ ⊢ t 1 ↠ t 1′ Ψ, Φ ⊢ t 2 ↠ t 2′ SmtValid(Φ, t 1′ ▷◁ t 2′ ) Ψ, Φ ⊢ t 1 ▷◁ t 2 Eq-Trans Eq-Proof Fig. 10. Equational Proofs: rules for equational reasoning. Lemma 6.3 (Monotonicity). ∀0 ≤ n. Unfold∗ (Ψ, Φ, n) ⊆ Unfold∗ (Ψ, Φ, n + 1). Lemma 6.4 (Fixpoint). Let Φi  Unfold∗ (Ψ, Φ, i). If Φn = Φn+1 , then ∀n < m. Φm = Φn . Uncovering Next, we prove that every function application term that is uncovered by unfolding to depth n is congruent to a term in the n-depth unfolding. Lemma 6.5 (Uncovering). Let Φn ≡ Unfold∗ (Ψ, Φ ∪ {ν = t }, n). If SmtValid(Φn , ν = t ′), then for every f (t ′) ≺ t ′ there exists f (t) ≺ Φn such that SmtValid(Φn , ti = ti′). We prove the above lemma by induction on n where the inductive step uses the following property of congruence closure, which itself is proved by induction on the structure of t ′: Lemma 6.6 (Congruence). If SmtValid(Φ ∪ {ν = t }, ν = t ′) and ν < Φ, t, t ′, then for every f (t ′) ≺ t ′ there exists f (t) ≺ Φ, t such that SmtValid(Φ, ti = ti′). Unfolding Preserves Equational Links We use the uncovering Lemma 6.5 and congruence to show that every instantiation that is valid after n steps is subsumed by the n + 1 depth unfolding. That is, we show that every possible link in any equational chain can be proved equal to the source expression via bounded unfolding. Lemma 6.7 (Link). If SmtValid(Unfold∗ (Ψ, Φ∪{ν = t }, n), ν = t ′), then SmtValid(Unfold∗ (Ψ, Φ∪ {ν = t }, n + 1), Unfold(Ψ, Φ ∪ {ν = t ′ })). Equational Proof Figure 10 formalizes our rules for equational reasoning. Intuitively, there is an equational proof that t 1 ▷◁ t 2 under Ψ, Φ, written by the judgment Ψ, Φ ⊢ t 1 ▷◁ t 2 , if by some sequence of repeated function unfoldings, we can prove that t 1 and t 2 are respectively equal to t 1′ and t 2′ such that, SmtValid(Φ, t 1′ ▷◁ t 2′ ) holds. Our notion of equational proofs adapts the idea of type level computation used in TT-based proof assistants to the setting of SMT-based reasoning, via the directional unfolding judgment Ψ, Φ ⊢ t ↠ t ′. In the SMT-realm, the explicit notion of a normal or canonical form is converted to the implicit notion of the equivalence classes of the SMT solver’s congruence closure procedure (post-unfolding). Completeness of Bounded Unfolding We use the fact that unfolding preserves equational links to show that bounded unfolding is complete for equational proofs. That is, we prove by induction on the structure of the equational proof that whenever there is an equational proof of t = t ′, there exists some bounded unfolding that suffices to prove the equality. Lemma 6.8. If Ψ, Φ ⊢ t ↠ t ′, then ∃0 ≤ n. SmtValid(Unfold∗ (Ψ, Φ ∪ {ν = t }, n), ν = t ′). Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:24 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala PLE is a Fixpoint of Bounded Unfolding We show that the proof search procedure PLE computes the least-fixpoint of the bounded unfolding and hence, returns true iff there exists some unfolding depth n at which the goal can be proved. Lemma 6.9 (Fixpoint). PLE(Ψ, Φ, t = t ′) iff ∃n. SmtValid(Unfold∗ (Ψ, Φ ∪ {ν = t }, n), ν = t ′). The proof follows by observing that PLE(Ψ, Φ, t = t ′) computes the least-fixpoint of the sequence Φi  Unfold∗ (Ψ, Φ, i). Specifically, we prove by induction on i that at each invocation of loop (i, Φi ) in Figure 9, Φi is equal to Unfold∗ (Ψ, Φ ∪ {ν = t }, i), which then yields the result. Completeness of PLE Finally, we combine Lemmas 6.9 and 6.7 to show that PLE is complete, i.e. if there is an equational proof that t ▷◁ t ′ under Ψ, Φ, then PLE(Ψ, Φ, t ▷◁ t ′) returns true. Theorem 6.10 (Completeness). If Ψ, Φ ⊢ t ▷◁ t ′ then PLE(Ψ, Φ, t ▷◁ t ′) = true. 6.3 PLE Terminates So far, we have shown that our proof search procedure PLE is both sound and complete. Both of these are easy to achieve simply by enumerating all possible instances and repeatedly querying the SMT solver. Such a monkeys-with-typewriters approach is rather impractical: it may never terminate. Fortunately, we show that in addition to being sound and complete with respect to equational proofs, if the hypotheses are transparent, then our proof search procedure always terminates. Next, we describe transparency and explain intuitively why PLE terminates. We then develop the formalism needed to prove the termination Theorem 6.16. Transparency An environment Γ is inconsistent if SmtValid(⌊Γ⌋, false). An environment Γ is inhabited if there exists some θ ∈ (|Γ|). We say Γ is transparent if it is either inhabited or inconsistent. As an example of a non-transparent Φ0 consider the predicate lenA xs = 1 + lenB xs, where lenA and lenB are both identical definitions of the list length function. Clearly there is no θ that causes the above predicate to evaluate to true. At the same time, the SMT solver cannot (using the decidable, quantifier-free theories) prove a contradiction as that requires induction over xs. Thus, non-transparent environments are somewhat pathological and, in practice, we only invoke PLE on transparent environments. Either the environment is inconsistent, e.g. when doing a proof-bycontradiction, or e.g. when doing a proof-by-case-analysis we can easily find suitable concrete values via random [13] or SMT-guided generation [45]. Challenge: Connect Concrete and Logical Semantics As suggested by its name, the PLE algorithm aims to lift the notion of evaluation or computations into the level of the refinement logic. Thus, to prove termination, we must connect the two different notions of evaluation, the concrete (operational) semantics and the logical semantics being used by PLE. This connection is trickier than appears at first glance. In the concrete realm totality ensures that every reflected function f will terminate when run on any individual value v. However, in the logical realm, we are working with infinite sets of values, compactly represented via logical constraints. In other words, the logical realm can be viewed (informally) as an abstract interpretation of the concrete semantics. We must carefully argue that despite the approximation introduced by the logical abstraction, the abstract interpretation will also terminate. Solution: Universal Abstract Interpretation We make this termination argument in three steps. First, we formalize how PLE performs computation at the logical level via logical steps and logical traces. We show (Lemma 6.13) that the logical steps form a so-called universal (or must) abstraction of the concrete semantics [14, 18]. Second, we show that if PLE diverges, it is because it creates a strictly increasing infinite chain, Unfold∗ (Ψ, Φ, 0) ⊂ Unfold∗ (Ψ, Φ, 1) . . . which corresponds to an infinite logical trace. Third, as the logical computation is a universal abstraction we use inhabitation to connect the two realms, i.e. to show that an infinite logical trace corresponds to an infinite Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:25 concrete trace. The impossibility of the latter must imply the impossibility of the former, i.e. PLE terminates. Next, we formalize the above to obtain Theorem 6.16. Totality A function is total when its evaluation reduces to exactly one value. The totality of R can and is checked by refinement types (§ 4). Hence, for brevity, in the sequel we implicitly assume that R is total under Γ. Definition 6.11 (Total). Let b ≡ λx .⟨⌊p⌋ ⇒ ⌊e⌋⟩. b is total under Γ and R, if forall θ ∈ (|Γ|): (1) if θ · R[pi ] ,→⋆ True, then ∃v. θ · R[ei ] ,→⋆ v, (2) if θ · R[pi ] ,→⋆ True and θ · Ψ[p j ] ,→⋆ True, then i = j, and (3) there exists an i so that θ · R[pi ] ,→⋆ True. R is total under Γ, if every b ∈ ⌊R⌋ is total under Γ and R. Subterm Evaluation As the reflected functions are total, the Church-Rosser theorem implies that evaluation order is not important. To prove termination, we require an evaluation strategy, e.g. CBV, in which if a reflected function’s guard is satisfied, then the evaluation of the corresponding function body requires evaluating every subterm inside the body. As DeIf(·) hoists if-expressions out of the body and into the top-level guards, the below fact follows from the properties of CBV: Lemma 6.12. Let b ≡ λx .⟨⌊p⌋ ⇒ ⌊e⌋⟩ and f ∈ R. For every Γ, R, and θ ∈ (|Γ|), if θ · R[pi ] ,→⋆ True and f (⌊e ′⌋) ≺ ⌊ei ⌋, then θ · R[ei ] ,→⋆ C[f (θ · R[e ′])]. Logical Step A pair f (t) ⇝ f ′(t ′) is a Ψ, Φ-logical step (abbrev. step), if • Ψ(f ) ≡ λx .⟨p ⇒ b⟩, • SmtValid(Φ ∧ Q, pi ) for some (Ψ, Φ)-instance Q, and • f ′(t ′) ≺ bi t/x . Steps and Reductions Next, using Lemmas 6.12, 6.1, and the definition of logical steps, we show that every logical step corresponds to a sequence of steps in the concrete semantics: Lemma 6.13 (Step-Reductions). If f (⌊e⌋) ⇝ f ′(⌊e ′⌋) is a logical step under ⌊R⌋, ⌊Γ⌋ and θ ∈ (|Γ|), then f (θ · R[e]) ,→⋆ C[f (θ · R[e ′])] for some context C. Logical Trace A sequence f 0 (t 0 ), f 1 (t 1 ), f 2 (t 2 ), . . . is a Ψ, Φ-logical trace (abbrev. trace), if fi (ti ) ⇝ fi+1 (ti+1 ) is a Ψ, Φ-step, for each i. Our termination proof hinges upon the following key result: inhabited environments only have finite logical traces. We prove this result by contradiction. Specifically, we show by Lemma 6.13 that an infinite (⌊R⌋, ⌊Γ⌋)-trace combined with the fact that Γ is inhabited yields at least one infinite concrete trace, which contradicts the totality assumption. Hence, all the (⌊R⌋, ⌊Γ⌋) logical traces must be finite. Theorem 6.14 (Finite-Trace). If Γ is inhabited, then every (⌊R⌋, ⌊Γ⌋)-trace is finite. Ascending Chains and Traces If unfolding Ψ, Φ yields an infinite chain Φ0 ⊂ . . . ⊂ Φn . . ., then Ψ, Φ has an infinite logical trace. We construct the trace by selecting at level i (i.e. in Φi ) an application term fi (ti ) that was created by unfolding an application term at level i − 1 (i.e. in Φi−1 ). Lemma 6.15 (Ascending Chains). Let Φi  Unfold∗ (Ψ, Φ, i). If there exists an (infinite) ascending chain Φ0 ⊂ . . . ⊂ Φn . . ., then there exists an (infinite) logical trace f 0 (t 0 ), . . . , fn (tn ), . . .. Logical Evaluation Terminates Finally, we prove that the proof search procedure PLE terminates. If PLE loops forever, there must be an infinite strictly ascending chain of unfoldings Φi , and hence, by Lemma 6.15, an infinite logical trace, which, by Theorem 6.14, is impossible. Theorem 6.16 (Termination). If Γ is transparent, then PLE(⌊R⌋, ⌊Γ⌋, p) terminates. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:26 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Benchmark Common Without PLE Search With PLE Search Impl (l) Spec (l) Proof (l) Time (s) SMT (q) Proof (l) Time (s) SMT (q) Arithmetic Fibonacci 7 Ackermann 20 Class Laws Fig 11 Monoid 33 Functor 48 Applicative 62 Monad 63 Higher-Order Properties Logical Properties 0 Fold Universal 10 Functional Correctness SAT-solver 92 Unification 51 Deterministic Parallelism Conc. Sets 597 n-body 163 Par. Reducers 30 Total 1176 10 73 38 196 2.74 5.40 129 566 16 119 1.92 13.80 79 846 50 44 110 42 109 93 241 122 4.47 4.97 12.00 5.39 34 26 69 49 33 14 74 39 4.22 3.68 10.00 4.89 209 68 1090 250 20 44 33 43 2.71 2.17 32 24 33 14 2.74 1.46 32 48 34 60 0 85 50.00 4.77 50 195 0 21 50.00 5.64 50 422 329 251 212 1279 339 101 124 1524 40.10 7.41 6.63 148.76 339 61 52 1626 229 21 25 638 40.70 6.27 5.56 150.88 861 61 52 4068 Table 1. We report verification Time (in seconds, on a 2.3GHz Intel® Xeon® CPU E5-2699 v3 with 18 physical cores and 64GiB RAM.), the number of SMT queries and size of Proofs (in lines). The Common columns show sizes of common Implementations and Specifications . We separately consider proofs Without and With PLE Search. 7 EVALUATION We have implemented reflection and PLE in Liqid Haskell [56]. Table 1 summarizes our evaluation which aims to determine (1) the kinds of programs and properties that can be verified, (2) how PLE simplifies writing proofs, and (3) how PLE affects the verification time. Benchmarks We summarize our benchmarks below, see [58] for details. • Arithmetic We proved arithmetic properties for the textbook Fibonacci function (c.f. § 2) and the 12 properties of the Ackermann function from [53]. • Class Laws We proved the monoid laws for the Peano, Maybe and List data types and the Functor, Applicative, and Monad laws, summarized in Figure 11, for the Maybe, List and Identity monads. • Higher Order Properties We used natural deduction to prove textbook logical properties as in § 3. We combined natural deduction principles with PLE-search to prove universality of right-folds, as described in [25] and formalized in Agda [34]. • Functional Correctness We proved correctness of a SAT solver and a unification algorithm as implemented in Zombie [11]. We proved that the SAT solver takes as input a formula f and either returns Nothing or an assignment that satisfies f, by reflecting the notion of satisfaction. Then, we proved that if the unification unify s t of two terms s and t returns a substitution su, then applying su to s and t yields identical terms. Note that, while the unification function can itself diverge, and hence cannot be reflected, our method allows terminating and diverging functions to soundly coexist. • Deterministic Parallelism Retrofitting verification onto an existing language with a mature parallel run-time allows us to create three deterministic parallelism libraries that, for the first time, Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:27 verify implicit assumptions about associativity and ordering that are critical for determinism (c.f. [58] for extended description). First, we proved that the ordering laws hold for keys inserted into LVar-style concurrent sets [28]. Second, we used monad-par [33] to implement an n-body simulation, whose correctness relied upon proving that a triple of Real (implementing) 3-d acceleration was a Monoid. Third, we built a DPJ-style [10] parallel-reducers library whose correctness relied upon verifying that the reduced arguments form a CommutativeMonoid, and which was the basis of a parallel array sum. Proof Effort We split the total lines of code of our benchmarks into three categories: Spec represents the refinement types that encode theorems, lemmas, and function specifications; Impl represents the rest of the Haskell code that defines executable functions; Proofs represent the sizes of the Haskell proof terms (i.e. functions returning Prop). Reflection and PLE are optionally enabled using pragmas; the latter is enabled either for a whole file/module or per top-level function. Runtime Overhead Proof terms have no runtime overhead as they will never be evaluated. When verification of an executable term depends on theorems, we use the below withTheorem function withTheorem :: x:a → Prop → { v:a | v = x } withTheorem x _ = x that inserts the proof argument into the static verification environment, relying upon laziness to not actually evaluate the proof. For example, when verification depends on the associativity of append on the lists xs, ys, and zs, the invocation withTheorem xs (app_assoc xs ys zs) extends the (static) SMT verification environment with the instantiation of the associativity theorem of Figure 1. This invocation adds no runtime overhead, since even though app_assoc xs ys zs is an expensive recursive function, it will never actually get evaluated. To ensure that proof terms are not evaluated in runtime, without using laziness, one can add one rewrite rule for each proof term that replaces the term with unit. For example, the rewrite rule for app_assoc is RULES " assoc / runtime " forall xs ys zs . app_assoc xs ys zs = () Such rules are sound, since each proof term is total, thus provably reduces to unit. Results The highlights of our evaluation are the following. (1) Reflection allows for the specification and verification of a wide variety of important properties of programs. (2) PLE drastically reduces the proof effort: by a factor of 2−5× — shrinking the total lines of proof from 1524 to 638— making it quite modest, about the size of the specifications of the theorems. Since PLE searches for equational properties, there are some proofs, that rarely occur in practice, that PLE cannot simplify, e.g. the logical properties from § 3. (3) PLE does not impose a performance penalty: even though proof search can make an order of magnitude many more SMT queries — increasing the total SMT queries from 1626 without PLE to 4068 with PLE— most of these queries are simple and it is typically faster to type-check the compact proofs enabled by PLE than it is to type-check the 2 − 5× longer explicit proofs written by a human. 8 RELATED WORK SMT-Based Verification SMT-solvers have been extensively used to automate program verification via Floyd-Hoare logics [36]. Leon introduces an SMT-based algorithm that is complete for catamorphisms (folds) over ADTs [50] and a semi-decision procedure that is guaranteed to find satisfying assignments (models) for queries over arbitrary recursive functions, if they exist [51]. Our work is inspired by Dafny’s Verified Calculations [31] but differs in (1) our use of reflection instead of axiomatization, (2) our use of refinements to compose proofs, and (3) our use of PLE to automate reasoning about user-defined functions. Dafny (and F* [52]) encode user-functions as Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:28 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Monoid (for Peano, Maybe, List) Left Id. mempty x ♦ ≡ x Right Id. x ♦ mempty ≡ x Assoc. (x ♦ y) ♦ z ≡ x ♦ (y ♦ z) Functor (for Maybe, List, Id) Id. fmap id xs ≡ id xs Distr. fmap (д ◦ h) xs ≡ (fmap д ◦ fmap h) xs Applicative (for Maybe, List, Id) Monad (for Maybe, List, Id) Id. pure id ⊛ v ≡ v Left Id. return a ≫= f ≡ f a Comp. pure (◦) ⊛ u ⊛ v ⊛ w ≡ u ⊛ (v ⊛ w) Right Id. m ≫= return ≡ m Hom. pure f ⊛ pure x ≡ pure (f x) Assoc. (m ≫= f ) ≫= д ≡ m ≫= (λx → f x ≫= д) Inter. u ⊛ pure y ≡ pure ($ y) ⊛ u Ord (for Int, Double, Either, (, )) Refl. x ≤ x Antisym. x ≤ y ∧ y ≤ x =⇒ x ≡ y Trans. x ≤ y ∧ y ≤ z =⇒ x ≤ z Total. x ≤ y ∨ y ≤ x Commutative Monoid (for Int, Double, (, )) Comm. x ♦ y ≡ y ♦ x (including Monoid laws) Fig. 11. Summary of Verified Typeclass Laws. axioms and use a fixed fuel to instantiate functions upto some fixed unfolding depth [1]. While the fuel-based approach is incomplete, even for equational or calculational reasoning, it may, although rare in practice, quickly time out after a fixed, small number of instantiations rather than perform an exhaustive proof search like PLE. Nevertheless, PLE demonstrates that it is possible to develop complete and practical algorithms for reasoning about user-defined functions. Proving Equational Properties Several authors have proposed tools for proving (equational) properties of (functional) programs. Systems of Sousa and Dillig [48] and Asada et al. [3] extend classical safety verification algorithms, respectively based on Floyd-Hoare logic and refinement types, to the setting of relational or k-safety properties that are assertions over k-traces of a program. Thus, these methods can automatically prove that certain functions are associative, commutative etc. but are restricted to first-order properties and are not programmer-extensible. Zeno [47] generates proofs by term rewriting and Halo [60] uses an axiomatic encoding to verify contracts. Both the above are automatic, but unpredictable and not programmer-extensible, hence, have been limited to far simpler properties than the ones checked here. HERMIT [22] proves equalities by rewriting the GHC core language, guided by user specified scripts. Our proofs are Haskell programs, SMT solvers automate reasoning, and importantly, we connect the validity of proofs with the semantics of the programs. Dependent Types in Programming Integration of dependent types into Haskell has been a long standing goal [21] that dates back to Cayenne [4], a Haskell-like, fully dependent type language with undecidable type checking. Our approach differs significantly in that reflection and PLE use SMT-solvers to drastically simplify proofs over decidable theories. Zombie [46] investigates the design of a dependently typed language where SMT-style congruence closure is used to reason about the equality of terms. However, Zombie explicitly eschews type-level computation, as the authors write “equalities that follow from β-reduction” are “incompatible with congruence closure”. Due to this incompleteness, the programmer must use explicit @join@ terms to indicate where normalization should be triggered, even so, equality checking is based on fuel, hence, is incomplete. Theorem Provers Reflection shows how to retrofit deep specification and verification in the style of Agda [38], Coq [7] and Isabelle [37] into existing languages via refinement typing and PLE shows how type-level computation can be made compatible with SMT solvers’ native theory reasoning Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:29 yielding a powerful new way to automate proofs (§ 2.5). An extensive comparison [54] between our approach and mature theorem provers like Coq, Agda, and Isabelle reveals that these provers have two clear advantages over our approach: they emit certificates, so they rely on a small trusted computing base, and they have decades-worth of tactics, libraries, and proof scripts that enable large scale proof engineering. Some tactics even enable embedding of SMT-based proof search heuristics, e.g. Sledgehammer [9], that is widely used in Isabelle. However, this search does not have the completeness guarantees of PLE. The issue of extracting checkable certificates from SMT solvers is well understood [12, 35] and easy to extend to our setting. However, the question of extending SMT-based verifiers with tactics and scriptable proof search, and more generally, incorporating interactivity in the style of proof-assistants, perhaps enhanced by proof-completion hints, remains an interesting direction for future work. 9 CONCLUSIONS AND FUTURE WORK Our results identify a new design for deductive verifiers wherein: (1) via Refinement Reflection, we can encode natural deduction proofs as SMT-checkable refinement typed programs and (2) via Proof by Logical Evaluation we can combine the complementary strengths of SMT- (i.e., decision procedures) and TT- based approaches (i.e., type-level computation) to obtain completeness guarantees when verifying properties of user-defined functions. However, the increased automation of SMT and proof-search can sometimes make it harder for a user to debug failed proofs. In future work, it would be interesting to investigate how to add interactivity to SMT based verifiers, in the form of tactics and scripts or algorithms for synthesizing proof hints, and to design new ways to explain and fix refinement type errors. ACKNOWLEDGMENTS We thank the anonymous referees, our shepherd Koen Claessen, and Rustan Leino for their feedback on earlier versions of this paper. Special thanks to George Karachalias and Valentin Robert for their input on proof combinators, and to Joachim Breitner and Eric Seidel for their suggestion on run-time proof elimination. This work was supported by the EPSRC programme grant EP/K034413/1, the National Science Foundation under Grant Numbers CCF-1618756, CNS-1518765, CCF-1518844, CCF-1422471, CCF-1223850, and CCF-1218344, and a generous gift from Microsoft Research. REFERENCES [1] N. Amin, K. R. M. L., and T. Rompf. 2014. Computing with an SMT Solver. In TAP. [2] A. Appel. 2016. Verified Functional Algorithms. https://www.cs.princeton.edu/~appel/vfa/Perm.html. [3] K. Asada, R. Sato, and N. Kobayashi. 2015. Verifying Relational Properties of Functional Programs by First-Order Refinement. In PEPM. [4] L. Augustsson. 1998. Cayenne - a Language with Dependent Types.. In ICFP. [5] C. Barrett, A. Stump, and C. Tinelli. 2010. The SMT-LIB Standard: Version 2.0. [6] J. Bengtson, K. Bhargavan, C. Fournet, A.D. Gordon, and S. Maffeis. 2008. Refinement Types for Secure Implementations. In CSF. [7] Y. Bertot and P. Castéran. 2004. Coq’Art: The Calculus of Inductive Constructions. Springer Verlag. [8] R. S. Bird. 1989. Algebraic Identities for Program Calculation. In The Computer Journal. [9] J. C. Blanchette, S. Böhme, and L. C. Paulson. 2011. Extending Sledgehammer with SMT Solvers. In CADE. [10] Jr. Bocchino, L. Robert, V. S. Adve, S. V. Adve, and M. Snir. 2009. Parallel Programming Must Be Deterministic by Default. In HotPar. [11] C. Casinghino, V. Sjöberg, and S. Weirich. 2014. Combining proofs and programs in a dependently typed language. In POPL. [12] J. Chen, R. Chugh, and N. Swamy. 2010. Type-preserving Compilation of End-to-end Verification of Security Enforcement. In PLDI. [13] K. Claessen and J. Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP. [14] E. M. Clarke, O. Grumberg, and D.E. Long. 1992. Model checking and abstraction. In POPL. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:30 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala [15] S. Collange, D. Defour, S. Graillat, and R. Iakymchuk. 2014. Full-Speed Deterministic Bit-Accurate Parallel Floating-Point Summation on Multi- and Many-Core Architectures. (2014). https://hal.archives-ouvertes.fr/hal-00949355 working paper or preprint. [16] J. Condit, M. Harren, Z. R. Anderson, D. Gay, and G. C. Necula. 2007. Dependent Types for Low-Level Programming. In ESOP. [17] R. L. Constable and S. F. Smith. 1987. Partial Objects In Constructive Type Theory. In LICS. [18] P. Cousot and R. Cousot. 1977. Abstract Interpretation: A Unified Lattice Model for the Static Analysis of Programs. In POPL. [19] E. W. Dijkstra. 1975. Guarded Commands, Nondeterminacy and Formal Derivation of Programs. In Communications of the ACM. [20] E. W. Dijkstra. 1976. A Discipline of Programming. Prentice-Hall. [21] R. A. Eisenberg and J. Stolarek. 2014. Promoting functions to type families in Haskell. In Haskell. [22] A. Farmer, N. Sculthorpe, and A. Gill. 2015. Reasoning with the HERMIT: Tool Support for Equational Reasoning on GHC Core Programs. In Haskell. [23] G. Gentzen. 1935. Inverstigations into Logical Deduction. In American Philosophical Quarterly. [24] W. A. Howard. 1980. The formulae-as-types notion of construction. In Essays on Combinatory Logic, Lambda Calculus and Formalism. [25] G. Hutton. 1999. A tutorial on the universality and expressiveness of fold. J. Functional Programming (1999). [26] A. M. Kent, D. Kempe, and S. Tobin-Hochstadt. 2016. Occurrence typing modulo theories. In PLDI. [27] K. W. Knowles and C. Flanagan. 2010. Hybrid type checking. In TOPLAS. [28] L. Kuper, A. Turon, N. R Krishnaswami, and R. R Newton. 2014. Freeze after writing: quasi-deterministic parallel programming with LVars. In POPL. [29] K. R. M. Leino. 2010. Dafny: An Automatic Program Verifier for Functional Correctness. In LPAR. [30] K. R. M. Leino and C. Pit-Claudel. 2016. Trigger selection strategies to stabilize program verifiers. In CAV. [31] K. R. M. Leino and N. Polikarpova. 2016. Verified Calculations. In VSTTE. [32] R. Leino. 2016. Dafny. (2016). https://github.com/Microsoft/dafny/blob/master/Test/dafny0/Fuel.dfy. [33] S. Marlow, R. Newton, and S. Peyton-Jones. 2011. A Monad for Deterministic Parallelism. In Haskell. [34] S. C. Mu, H. S. Ko, and P. Jansson. 2009. Algebra of Programming in Agda: Dependent Types for Relational Program Derivation. In J. Funct. Program. [35] G. C. Necula. 1997. Proof carrying code. In POPL. [36] C. G. Nelson. 1980. Techniques for Program Verification. Ph.D. Dissertation. Stanford University. [37] T. Nipkow, L.C. Paulson, and M. Wenzel. 2002. Isabelle/HOL — A Proof Assistant for Higher-Order Logic. [38] U. Norell. 2007. Towards a practical programming language based on dependent type theory. Ph.D. Dissertation. Chalmers. [39] X. Ou, G. Tan, Y. Mandelbaum, and D. Walker. 2004. Dynamic Typing with Dependent Types. In IFIP TCS. [40] J. C. Reynolds. 1972. Definitional interpreters for higher-order programming languages. In ACM National Conference. [41] S. R. Della Rocca and L. Paolini. 2004. The Parametric Lambda Calculus, A Metamodel for Computation. [42] P. Rondon, M. Kawaguchi, and R. Jhala. 2008. Liquid Types. In PLDI. [43] P. Rondon, M. Kawaguchi, and R. Jhala. 2010. Low-Level Liquid Types. In POPL. [44] J. Rushby, S. Owre, and N. Shankar. 1998. Subtypes for Specifications: Predicate Subtyping in PVS. TSE. [45] E. L. Seidel, N. Vazou, and R. Jhala. 2015. Type Targeted Testing. In ESOP. [46] V. Sjöberg and S. Weirich. 2015. Programming Up to Congruence. In POPL. [47] W. Sonnex, S. Drossopoulou, and S. Eisenbach. 2012. Zeno: An Automated Prover for Properties of Recursive Data Structures. In TACAS. [48] M. Sousa and I. Dillig. 2016. Cartesian hoare logic for verifying k-safety properties. In PLDI. [49] Martin Sulzmann, Gregory J. Duck, Simon P. Jones, and Peter J. Stuckey. 2006. Understanding Functional Dependencies via Constraint Handling Rules. Journal of Functional Programming (2006). [50] P. Suter, M. Dotta, and V. Kuncak. 2010. Decision Procedures for Algebraic Data Types with Abstractions. In POPL. [51] P. Suter, A. Sinan Köksal, and V. Kuncak. 2011. Satisfiability Modulo Recursive Programs. In SAS. [52] N. Swamy, C. Hriţcu, C. Keller, A. Rastogi, A. Delignat-Lavaud, S. Forest, K. Bhargavan, C. Fournet, P. Y. Strub, M. Kohlweiss, J. K. Zinzindohoue, and S. Zanella-Béguelin. 2016. Dependent Types and Multi-Monadic Effects in F*. In POPL. [53] G. Tourlakis. 2008. Ackermann’s Function. (2008). http://www.cs.yorku.ca/~gt/papers/Ackermann-function.pdf. [54] N. Vazou, L. Lampropoulos, and J. Polakow. 2017. A Tale of Two Provers: Verifying Monoidal String Matching in Liquid Haskell and Coq. In Haskell. [55] N. Vazou, P. Rondon, and R. Jhala. 2013. Abstract Refinement Types. In ESOP. [56] N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. L. Peyton-Jones. 2014. Refinement Types for Haskell. In ICFP. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:31 [57] N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. L. Peyton-Jones. 2014. Technical Report: Refinement Types for Haskell. (2014). http://goto.ucsd.edu/~nvazou/icfp14/haskell-refinements-techrep.pdf. [58] N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala. 2017. Extended Version: Refinement Reflection: Complete Verification with SMT. (2017). https://nikivazou.github.io/static/popl18/ extended-refinement-reflection.pdf [59] P. Vekris, B. Cosman, and R. Jhala. 2016. Refinement types for TypeScript. In PLDI. [60] D. Vytiniotis, S. L. Peyton-Jones, K. Claessen, and D. Rosén. 2013. HALO: Haskell to Logic through Denotational Semantics. In POPL. [61] P. Wadler. 1987. A Critique of Abelson and Sussman or Why Calculating is Better Than Scheming. In SIGPLAN Not. [62] P. Wadler. 2015. Propositions As Types. In Communications of the ACM. [63] H. Xi and F. Pfenning. 1998. Eliminating Array Bound Checking Through Dependent Types. In PLDI. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:32 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala A PROOF OF MAPFUSION WITHOUT PLE map_fusion f g [] = (map f . map g) [] =. map f (map g []) =. map f [] =. map (f . g) [] ** QED map_fusion f g (C x xs) = map (f . g) (x : xs) =. ((f . g) x) : (map (f . g) xs) =. ((f . g) x) : (((map f) . (map g)) xs) ? map_fusion f g xs =. ((f . g) x) : (map f (map g xs)) =. (f (g x)) : (map f (map g xs)) =. map f ((g x) : (map g xs)) =. map f ((g x) : (map g xs)) =. map f (map g (x : xs)) =. map f ((map g) (x : xs)) =. ((map f) . (map g)) (x : xs) ** QED B PROOFS FOR PLE Proofs for § 6 Proof. (Of lemma 6.5) We prove the result by induction on n. Case n = 0: Immediate as t ≡ t ′. Case n = k + 1: Consider any t ′ such that SmtValid(Φk +1 , ν = t ′). By definition Φk +1 = Unfold(Ψ, Φk ), hence SmtValid(Unfold(Ψ, Φk ), v = t, ν = t ′). Consider any f (t ′) ≺ t ′; Lemma 6.6 completes the proof. □ Proof. (Of lemma 6.6) Proof by induction on the structure of t ′: Case t ′ ≡ x: There are no subterms, hence immediate. Case t ′ ≡ c: There are no subterms, hence immediate. Case t ′ ≡ f (t ′): Consider the last link in Φ connecting the equivalence class of ν (and t) to t ′. Suppose the last link is a congruence link of the form t = t ′ where t ≡ f (t) and SmtValid(Φ, t = t ′). Then f (t) ≺ Φ, t and we are done. Suppose instead, the last link is an equality link in Φ of the form z = f (t ′). In this case, f (t ′) ≺ Φ and again, we are done. □ Proof. (Of lemma 6.7) Let G k  Unfold∗ (Ψ, Φ, k). Let us assume that SmtValid(Unfold∗ (Ψ, Φ, ν = t, n), ν = t ′) (3)   q ≡ f (t ′) = bi t ′/x in Unfold(Ψ, Φ ∧ ν = t ′) (4) Consider any instance By the definition of Unfold, we have   f (t ′) ≺ Φ ∧ ν = t ′ such that SmtValid(Φ, pi t ′/x ) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. (5) 53:33 By (3) and Lemma 6.5 there exists f (t) ≺ Φn such that SmtValid(Φn , t = t ′) As Φ ⊆ Φn and (5), by congruence   SmtValid(Φn , pi t/x ) Hence, the instance   f (t) = bi t/x is inΦn+1 That is SmtValid(Φn+1 , t = t ′ ∧ f (t) = bi [t/x]) And so by congruence closure SmtValid(Φn+1 , q) As the above holds for every instance, we have SmtValid(Φn+1 , Unfold(Ψ, Φ ∧ ν = t ′)) □ Proof. (Of lemma 6.8) The proof follows by induction on the structure of Ψ, Φ ⊢ t ↠ t ′. Base Case Eq-Refl: Follows immediately as t ≡ t ′. Inductive Case Eq-Trans In this case, there exists t ′′ such that Ψ, Φ ⊢ t ↠ t ′′ (6) SmtValid(Unfold(Ψ, Φ ∧ ν = t ), ν = t ) ′′ ′ (7) By the induction hypothesis (6) implies there exists 0 ≤ n such that SmtValid(Unfold∗ (Ψ, Φ ∧ ν = t, n), ν = t ′′) By Lemma 6.7 we have SmtValid(Unfold∗ (Ψ, Φ, ν = t, n + 1), Unfold(Ψ, Φ ∧ ν = t ′′)) Thus, by (7) and modus ponens we get SmtValid(Unfold∗ (Ψ, Φ, ν = t, n + 1), ν = t ′) □ Proof. (Of Lemma 6.9) Let Φ′ = Φ ∧ ν = t. Case ⇒: Assume that PLE(Ψ, Φ, t = t ′). That is, at some iteration i we have SmtValid(Φi , ν = t ′), i.e. by (6.2) we have SmtValid(Unfold∗ (Ψ, Φ′, i), ν = t ′). Case ⇐: Pick the smallest n such that SmtValid(Unfold∗ (Ψ, Φ′, n), ν = t ′). Using Lemmas 6.3 and 6.4 we can then show that forall 0 ≤ k < n, we have Unfold∗ (Ψ, Φ′, k) ⊂ Unfold∗ (Ψ, Φ′, k + 1) and Unfold∗ (Ψ, Φ′, k) ⊬ ν = t ′ Hence, after n iterations of the recursive loop, PLE(Ψ, Φ, t = t ′), returns true. □ Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:34 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Steps and Values Next, we show that if f (y) ⇝ t ′ is a logical step under an Γ that is inhabited by θ then f (y) reduces to a value under θ . The proof follows by observing that if Γ is inhabited by θ , and a particular step is possible, then the guard corresponding to that step must also be true under θ and hence, by totality, the function must reduce to a value under the given store. Lemma B.1 (Step-Value). If θ ∈ (|Γ|) and f (y) ⇝ t ′ is a ⌊R⌋, ⌊Γ⌋ step then R[θ · f (y)] ,→⋆ v. Proof. (Of Lemma B.1) Assume that θ ∈ (|Γ|) (8) Let θ  θ [x 7→ θ · y] ∗ (9) Ψ(f )  λx .⟨p ⇒ b⟩ As f (y) ⇝ t′ (10) is a ⌊R⌋Γ step, for some i, ⌊R⌋-instance Q we have SmtValid(⌊Γ⌋ ∧ Q, pi [y/x]) Hence, by (8) and Lemma 6.1 θ · R[pi [y/x]] ,→⋆ True As θ · pi ≡ θ · pi [y/x] ∗ (11) (12) ⋆ The fact (11) yields θ · R[pi ] ,→ True ∗ By the Totality Assumption 6.11 R[θ ∗ · f (x)] ,→⋆ v That is R[θ · f (y)] ,→⋆ v (13) (14) □ Divergence A closed term t diverges under R if there is no v such that R[t] ,→⋆ v . Lemma B.2 (Divergence). If ∀0 ≤ i we have R[ti ] ,→⋆ C[ti+1 ] then t 0 diverges under Ψ. Proof. (Of Theorem 6.14) Assume that θ ∈ (|Γ|) and assume an infinite ⌊R⌋, ⌊Γ⌋ trace: (15) f 0 (t 0 ), f 1 (t 1 ), . . . (16) Where additionally t 0 ≡ x 0 Define By Lemma 6.13, for every i ∈ N Hence, by Lemma B.2 ti∗ (17) ≡ θ · fi (ti ) (18) ∗ R[ti∗ ] ,→⋆ Ci [ti+1 ] ∗ t 0 diverges under Ψ i.e., by (17, 18) θ · f 0 (x 0 ) diverges under Ψ ⋆ But by (15) and Lemma B.1 R[θ · f 0 (x 0 )] ,→ v contradicting (19) Hence, assumption (16) cannot hold, i.e. all all the Ψ, Φ symbolic traces must be finite. Proof. (Of Theorem 6.16) As Φ is transparent, there are two cases. Case: Γ is inconsistent. By definition of inconsistency (19) SmtValid(⌊Γ⌋, false) Hence SmtValid(⌊Γ⌋, p) That is PLE(⌊R⌋, ⌊Γ⌋, p) terminates immediately. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. □ 53:35 Case: Γ is inhabited. That is, exists θ s.t. θ ∈ (|Γ|) (20) Suppose that PLE(⌊R⌋, ⌊Γ⌋, p) does not terminate. That is, there is an infinitely increasing chain: By Lemma 6.15 Φ0 ⊂ . . . ⊂ Φn . . . (21) ⌊R⌋, ⌊Γ⌋ has an infinite trace Which, by (20) contradicts Theorem 6.14. Thus, (21) is impossible, i.e. PLE(⌊R⌋, ⌊Γ⌋, p) terminates. □ C PROOF OF SECTION: EMBEDDING NATURAL DEDUCTION WITH REFINEMENT TYPES Lemma C.1 (Validity). If there exists e ∈ (|ϕ |) then ϕ is valid. Proof. We prove the lemma by case analysis in the shape of ϕ. • ϕ ≡ { p }. Since the set (|{ p }|) = {e |p ,→⋆ True} is not empty, then p ,→⋆ True. • ϕ ≡ ϕ 1 → ϕ 2 . By assumption, there exists an expressions f so that ∀e x ∈ (|ϕ 1 |), f e x ∈ (|ϕ 2 |). So, if there exists an expression e 1 ∈ (|ϕ 1 |) that makes ϕ 1 valid then f e 1 makes ϕ 2 valid. • ϕ ≡ ϕ → False. By assumption, there exists an expressions f so that ∀e x ∈ (|ϕ |), f e x ∈ (|{ False }|). So, if there exists an expression e 1 ∈ (|ϕ |) that makes ϕ valid then f e 1 makes { False } valid, which is impossible, thus ϕ cannot be valid. • ϕ ≡ (ϕ 1 , ϕ 2 ). If there exists a total expression e ∈ (|ϕ |) then e evaluates to (e 1 , e 2 ). • ϕ ≡ Either ϕ 1 ϕ 2 . If there exists a total expression e ∈ (|ϕ |) then e evaluates to either Left e ′ or Right e ′. • ϕ ≡ x : τ → ϕ. By assumption, there exists an expressions f so that ∀e x ∈ (|τ |), f e x ∈ (|ϕ[x/e x ]|). So, if there exists an expression e 1 ∈ (|τ |) then f e 1 makes ϕ[x/e 1 ] valid. • ϕ ≡ (x :: τ , ϕ). By assumption, there exists an expressions p that evaluates to a pair (e x , ey ) so that e x ∈ (|τ |) and ey ∈ (|ϕ[x/e x ]|). □ Theorem C.2 (Validity). If ∅; ∅ ⊢ e : ϕ then ϕ is valid. Proof. By direct implication of Lemma C.1 and soundness of λ R (Theorem 4.1). D □ REFINEMENT REFLECTION: λ R : EXTENDED VERSION WITH PROOFS Our first step towards formalizing refinement reflection is a core calculus λ R with an undecidable type system based on denotational semantics. We show how the soundness of the type system allows us to prove theorems using λ R . D.1 Syntax Figure 12 summarizes the syntax of λ R , which is essentially the calculus λU [56] with explicit recursion and a special reflect binding form to denote terms that are reflected into the refinement logic. In λ R refinements r are arbitrary expressions e (hence r ::= e in Figure 12). This choice allows us to prove preservation and progress, but renders typechecking undecidable. In § F we will see how to recover decidability by soundly approximating refinements. The syntactic elements of λ R are layered into primitive constants, values, expressions, binders and programs. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:36 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Operators Constants ⊙ c Values w Expressions e Binders Program Basic Types Refined Types b p B τ ::= ::= | ::= ::= | ::= ::= ::= ::= =|< ∧ | ! | ⊙ | +, −, . . . True | False | 0, 1, −1, . . . c | λx .e | D w w | x | ee case x = e of {D x → e} e | let rec x : τ = b in b b | reflect x : τ = e in p Int | Bool | T {v : B | {} | | }x : τ → τ Fig. 12. Syntax of λ R Contexts C C ::= • | Ce | cC | DeCe | case y = C of {D i x → ei } p ,→ p ′ Reductions C[p] cv (λx .e) e ′ case y = D j e of {D i x i → ei } reflect x : τ = e in p let rec x : τ = bx in b fix p ,→ ,→ ,→ ,→ ,→ ,→ ,→ C[p ′], if p ,→ p ′ δ (c, v) e [e ′/x]  e j D j e/y [e/x i ] p [fix (λx .e)/x] b [fix (λx .bx )/x] p (fix p) Fig. 13. Operational Semantics of λ R Constants The primitive constants of λ R include all the primitive logical operators ⊕, here, the set {=, <}. Moreover, they include the primitive booleans True, False, integers −1, 0, 1, etc., and logical operators ∧, ∨, !, etc.. Data Constructors We encode data constructors as special constants. For example the data type [Int], which represents finite lists of integers, has two data constructors: [] (“nil”) and : (“cons”). Values & Expressions The values of λ R include constants, λ-abstractions λx .e, and fully applied data constructors D that wrap values. The expressions of λ R include values and variables x, applications e e, and case expressions. Binders & Programs A binder b is a series of possibly recursive let definitions, followed by an expression. A program p is a series of reflect definitions, each of which names a function that can be reflected into the refinement logic, followed by a binder. The stratification of programs via binders is required so that arbitrary recursive definitions are allowed but cannot be inserted into the logic via refinements or reflection. (We can allow non-recursive let binders in e, but omit them for simplicity.) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:37 D.2 Operational Semantics Figure 12 summarizes the small step contextual β-reduction semantics for λ R . We write e ,→j e ′ if there exist e 1 , . . . , e j such that e is e 1 , e ′ is e j and ∀i, j, 1 ≤ i < j, we have ei ,→ ei+1 . We write e ,→⋆ e ′ if there exists some finite j such that e ,→j e ′. We define ≈β to be the reflexive, symmetric, transitive closure of ,→ . Constants Application of a constant requires the argument be reduced to a value; in a single step the expression is reduced to the output of the primitive constant operation. For example, consider =, the primitive equality operator on integers. We have δ (=, n)  =n where δ (=n , m) equals True iff m is the same as n. We assume that the equality operator is defined for all values, and, for functions, is defined as extensional equality. That is, for all f and f ′ we have (f = f ′) ,→ True iff ∀v. f v ≈β f ′ v. We assume source terms only contain implementable equalities over non-function types; the above only appears in refinements and allows us to state and prove facts about extensional equality § H.2. D.3 Types λR types include basic types, which are refined with predicates, and dependent function types. Basic types B comprise integers, booleans, and a family of data-types T (representing lists, trees etc..) For example the data type [Int] represents lists of integers. We refine basic types with predicates (boolean valued expressions e) to obtain basic refinement types {v : B | e}. Finally, we have dependent function types x : τx → τ where the input x has the type τx and the output τ may refer to the input binder x. We write B to abbreviate {v : B | True}, and τx → τ to abbreviate x : τx → τ if x does not appear in τ . We use r to refer to refinements. Denotations Each type τ denotes a set of expressions [[τ ]], that are defined via the dynamic semantics [27]. Let shape(τ ) be the type we get if we erase all refinements from τ and e : shape(τ ) be the standard typing relation for the typed lambda calculus. Then, we define the denotation of types as: [[{x : B | r }]]  {e | e : B, if e ,→⋆ w then r [x/w] ,→⋆ True} [[x : τx → τ ]]  {e | e : shape(τx → τ ), ∀e x ∈ [[τx ]]. e e x ∈ [[τ [x/e x ]]]} Constants For each constant c we define its type prim(c) such that c ∈ [[prim(c)]]. For example, prim(3) prim(+) prim(≤)    {v : Int | v = 3} x : Int → y : Int → {v : Int | v = x + y} x : Int → y : Int → {v : Bool | v ⇔ x ≤ y} So, by definition we get the constant typing lemma Lemma D.1. [Constant Typing] Every constant c ∈ [[prim(c)]]. Thus, if prim(c)  x : τx → τ , then for every value w ∈ [[τx ]], we require δ (c, w) ∈ [[τ [x/w]]]. D.4 Refinement Reflection The simple, but key idea in our work is to strengthen the output type of functions with a refinement that reflects the definition of the function in the logic. We do this by treating each reflect-binder: reflect f : τ = e in p as a let rec-binder: let rec f : Reflect(τ , e) = e in p during type checking (rule T-Refl in Figure 7). Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:38 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Reflection We write Reflect(τ , e) for the reflection of term e into the type τ , defined by strengthening τ as: Reflect({v : B | r }, e)  {v : B | r ∧ v = e} Reflect(x : τx → τ , λy.e)  x : τx → Reflect(τ , e[y/x]) As an example, recall from § 2 that the reflect fib strengthens the type of fib with the reflected refinement fibP. Consequences for Verification Reflection has two consequences for verification. First, the reflected refinement is not trusted; it is itself verified (as a valid output type) during type checking. Second, instead of being tethered to quantifier instantiation heuristics or having to program “triggers” as in Dafny [29] or F* [52] the programmer can predictably “unfold” the definition of the function during a proof simply by “calling” the function, which we have found to be a very natural way of structuring proofs § 7. D.5 Refining & Reflecting Data Constructors with Measures We assume that each data type is equipped with a set of measures which are unary functions whose (1) domain is the data type, and (2) body is a single case-expression over the datatype [56]: measure f : τ = λx .case y = x of {D i z → ei } For example, len measures the size of an [Int]: measure len :: [ Int ] → Nat len = \ x → case x of [] → 0 (x: xs ) → 1 + len xs Checking and Projection We assume the existence of measures that check the top-level constructor, and project their individual fields. In § F.2 we show how to use these measures to reflect functions over datatypes. For example, for lists, we assume the existence of measures: isNil [] isNil ( x : xs ) = True = False isCons ( x : xs ) = True isCons [] = False sel1 ( x : xs ) sel2 ( x : xs ) = x = xs Refining Data Constructors with Measures We use measures to strengthen the types of data constructors, and we use these strengthened types during construction and destruction (patternmatching). Let: (1) D be a data constructor, with unrefined type x : τ → T (2) the i-th measure definition with domain T is: measure fi : τ = λx .case y = x of {D z → ei } Then, the refined type of D is defined: prim(D)  x : τ → {v : T | ∧i fi v = ei [x/z]} Thus, each data constructor’s output type is refined to reflect the definition of each of its measures. For example, we use the measures len, isNil, isCons, sel1, and sel2 to strengthen the types of [] Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:39 and : to: prim([])  {v : [Int] | r [] } prim(:)  x : Int → xs : [Int] → {v : [Int] | r : } where the output refinements are r []  len v = 0 ∧ isNil v ∧ !isCons v r :  len v = 1 + len xs ∧ !isNil v ∧ isCons v ∧ sel1 v = x ∧ sel2 v = xs It is easy to prove that Lemma D.1 holds for data constructors, by construction. For example, len [] = 0 evaluates to true. D.6 Typing Rules Next, we present the type-checking judgments and rules of λ R . Environments and Closing Substitutions A type environment Γ is a sequence of type bindings x 1 : τ1 , . . . , x n : τn . An environment denotes a set of closing substitutions θ which are sequences of expression bindings: x 1 7→ e 1 , . . . , x n 7→ en such that: [[Γ]]  {θ | ∀x : τ ∈ Γ.θ (x) ∈ [[θ · τ ]]} Judgments We use environments to define three kinds of rules: Well-formedness, Subtyping, and Typing [27, 56]. A judgment Γ ⊢ τ states that the refinement type τ is well-formed in the environment Γ. Intuitively, the type τ is well-formed if all the refinements in τ are Bool-typed in Γ. A judgment Γ ⊢ τ1 ⪯ τ2 states that the type τ1 is a subtype of τ2 in the environment Γ. Informally, τ1 is a subtype of τ2 if, when the free variables of τ1 and τ2 are bound tomeasures expressions described by Γ, the denotation of τ1 is contained in the denotation of τ2 . Subtyping of basic types reduces to denotational containment checking. That is, for any closing substitution θ in the denotation of Γ, for every expression e, if e ∈ [[θ · τ1 ]] then e ∈ [[θ · τ2 ]]. A judgment Γ ⊢ p : τ states that the program p has the type τ in the environment Γ. That is, when the free variables in p are bound to expressions described by Γ, the program p will evaluate to a value described by τ . Rules All but three of the rules are standard [27, 56]. First, rule T-Refl is used to strengthen the type of each reflected binder with its definition, as described previously in § D.4. Second, rule T-Exact strengthens the expression with a singleton type equating the value and the expression (i.e. reflecting the expression in the type). This is a generalization of the “selfification” rules from [27, 39], and is required to equate the reflected functions with their definitions. For example, the application (fib 1) is typed as {v : Int | fibP v 1 ∧ v = fib 1} where the first conjunct comes from the (reflection-strengthened) output refinement of fib § 2, and the second conjunct comes from rule T-Exact. Finally, rule T-Fix is used to type the intermediate fix expressions that appear, not in the surface language but as intermediate terms in the operational semantics. Soundness Following λU [56], we can show that evaluation preserves typing and that typing implies denotational inclusion. Theorem D.2. [Soundness of λ R ] • Denotations If Γ ⊢ p : τ then ∀θ ∈ [[Γ]].θ · p ∈ [[θ · τ ]]. • Preservation If ∅ ⊢ p : τ and p ,→⋆ w then ∅ ⊢ w : τ . Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:40 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Γ ⊢p :τ Typing x :τ ∈ Γ Γ ⊢x :τ T-Var Γ ⊢ p : τ′ T-Con Γ ⊢ c : prim(c) Γ ⊢ τ′ ⪯ τ Γ ⊢p :τ Γ ⊢ e : {v : B | { | r }} T-Sub T-Exact Γ ⊢ e : {v : B | { | r } ∧ v = e} Γ, x : τx ⊢ e : τ T-Fun Γ ⊢ λx .e : x : τx → τ Γ ⊢ e 1 : (x : τx → τ ) Γ ⊢ e 2 : τx Γ ⊢ e1 e2 : τ T-App Γ, x : τx ⊢ bx : τx Γ, x : τx ⊢ τx Γ, x : τx ⊢ b : τ Γ ⊢τ Γ ⊢ let rec x : τx = bx in b : τ T-Let Γ ⊢ let rec f : Reflect(τf , e) = e in p : τ Γ ⊢ reflect f : τf = e in p : τ Γ ⊢ e : {v : T | er } Γ ⊢τ ∀i.prim(D i ) = y j : τ j → {v : T | er i } Γ, y j : τ j , x : {v : T | er ∧ er i } ⊢ ei : τ Γ ⊢ case x = e of {D i yi → ei } : τ T-Refl T-Case Γ ⊢τ Well Formedness Γ, v : B ⊢ e : Bool⇓ WF-Base Γ ⊢ {v : B | e} Γ ⊢ τx Γ, x : τx ⊢ τ WF-Fun Γ ⊢ x : τx → τ Γ ⊢ τ1 ⪯ τ2 Subtyping Γ ′  Γ, v : {B ⇓ |e} Γ′ ⊢ e ′ ⇝ p′ SmtValid(⌊Γ ′⌋ ⇒ p ′) Γ ⊢ {v : B | e} ⪯ {v : B | e ′ } Γ ⊢ τx′ ⪯ τx Γ, x : τx′ ⊢ τ ⪯ τ ′ Γ ⊢ x : τx → τ ⪯ x : τx′ → τ ′ ⪯-Base-λ S ⪯-Fun Fig. 14. Typing of λ R Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:41 D.7 From Programs & Types to Propositions & Proofs The denotational soundness Theorem D.2 lets us interpret well typed programs as proofs of propositions. “Definitions” A definition d is a sequence of reflected binders: d ::= • | reflect x : τ = e in d A definition’s environment Γ(d) comprises its binders and their reflected types: Γ(•)  ∅ Γ(reflect f : τ = e in d)  (f , Reflect(τ , e)), Γ(d) A definition’s substitution θ (d) maps each binder to its definition: θ (•)  [] θ (reflect f : τ = e in d)  [[f /fix f e], θ (d)] “Propositions” A proposition is a type x 1 : τ1 → . . . → x n : τn → {v : Unit | prop} For brevity, we abbreviate propositions like the above to x : τ → {prop} and we call prop the proposition’s refinement. For simplicity we assume that fv(τi ) = ∅. “Validity” A proposition x : τ → {prop} is valid under d if ∀w ∈ [[τ ]]. θ (d) · prop [w/x] ,→⋆ True That is, the proposition is valid if its refinement evaluates to True for every (well typed) interpretation for its parameters x under d. “Proofs” A binder b proves a proposition τ under d if ∅ ⊢ d[let rec x : τ = b in unit] : Unit That is, if the binder b has the proposition’s type τ under the definition d’s environment. Theorem D.3. [Proofs] If b proves τ under d then τ is valid under d. Proof. As b proves τ under d, we have ∅ ⊢ d[let rec x : τ = b in unit] : Unit (22) By Theorem D.2 on 22 we get θ (d) ∈ [[Γ(d)]] (23) Furthermore, by the typing rules 22 implies Γ(d) ⊢ b : τ and hence, via Theorem D.2 ∀θ ∈ [[Γ(d)]]. θ · b ∈ [[θ · τ ]] (24) θ (d) · b ∈ [[θ (d) · τ ]] (25) [[θ (d) · τ ]]  { f | τ is valid under d } (26) Together, 23 and 24 imply By the definition of type denotations, we have By 25, the above set is not empty, and hence τ is valid under d. □ Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:42 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Example: Fibonacci is increasing In § 2 we verified that under a definition d that includes fib, the term fibUp proves n : Nat → {fib n ≤ fib (n + 1)} Thus, by Theorem D.3 we get ∀n.0 ≤ n ,→⋆ True ⇒ fib n ≤ fib (n + 1) ,→⋆ True E PROOF OF SOUNDNESS We prove Theorem 4.1 of § D by reduction to Soundness of λU [56]. Theorem E.1. [Denotations] If Γ ⊢ p : τ then ∀θ ∈ [[Γ]].θ · p ∈ [[θ · τ ]]. Proof. We use the proof from [57] and specifically Lemma 4 that is identical to the statement we need to prove. Since the proof proceeds by induction in the type derivation, we need to ensure that all the modified rules satisfy the statement. • T-Exact Assume Γ ⊢ e : {v : B | { | r } ∧ v = e}. By inversion Γ ⊢ e : {v : B | { | r }}(1). By (1) and IH we get ∀θ ∈ [[Γ]].θ · e ∈ [[θ · {v : B | { | r }}]]. We fix a θ ∈ [[Γ]] We get that if θ · e ,→⋆ w, then θ · { | r }[v/w] ,→⋆ True. By the Definition of = we get that w = w ,→⋆ True. Since θ · (v = e)[v/w] ,→⋆ w = w, then θ · ({ | r } ∧ v = e)[v/w] ,→⋆ True. Thus θ · e ∈ [[θ · {v : B | { | r } ∧ v = e}]] and since this holds for any fixed θ , ∀θ ∈ [[Γ]].θ · e ∈ [[θ · {v : B | { | r } ∧ v = e}]]. • T-Let Assume Γ ⊢ let rec x : τx = e x in p : τ . By inversion Γ, x : τx ⊢ e x : τx (1), Γ, x : τx ⊢ p : τ (2), and Γ ⊢ τ (3). By IH ∀θ ∈ [[Γ, x : τx ]].θ ·e x ∈ [[θ ·τx ]] (1’) ∀θ ∈ [[Γ, x : τx ]].θ ·p ∈ [[θ ·τ ]] (2’). By (1’) and by the type of fix ∀θ ∈ [[Γ, x : τx ]].θ · fix x e x ∈ [[θ · τx ]]. By which, (2’) and (3) ∀θ ∈ [[Γ]].θ · p [fix x e x /x] ∈ [[θ · τ ]]. • T-Refl Assume Γ ⊢ reflect f : τf = e in p : τ . By inversion, Γ ⊢ let rec f : Reflect(τf , e) = e in p : τ . By IH, ∀θ ∈ [[Γ]].θ · let rec f : Reflect(τf , e) = e in p ∈ [[θ · τ ]]. Since denotations are closed under evaluation, ∀θ ∈ [[Γ]].θ · reflect f : Reflect(τf , e) = e in p ∈ [[θ · τ ]]. • T-Fix In Theorem 8.3 from [57] (and using the textbook proofs from [41]) we proved that for each type τ , fix τ ∈ [[(τ → τ ) → τ ]]. □ Theorem E.2. [Preservation] If ∅ ⊢ p : τ and p ,→⋆ w then ∅ ⊢ w : τ . Proof. In [57] proof proceeds by iterative application of Type Preservation Lemma 7. Thus, it suffices to ensure Type Preservation in λ R , which it true by the following Lemma. □ Lemma E.3. If ∅ ⊢ p : τ and p ,→ p ′ then ∅ ⊢ p ′ : τ . Proof. Since Type Preservation in λU is proved by induction on the type derivation tree, we need to ensure that all the modified rules satisfy the statement. • T-Exact Assume ∅ ⊢ p : {v : B | { | r }∧v = p}. By inversion ∅ ⊢ p : {v : B | { | r }}. By IH we get ∅ ⊢ p ′ : {v : B | { | r }}. By rule T-Exact we get ∅ ⊢ p ′ : {v : B | { | r } ∧v = p ′ }. Since subtyping is closed under evaluation, we get ∅ ⊢ {v : B | { | r } ∧ v = p ′ } ⪯ {v : B | { | r } ∧ v = p}. By rule T-Sub we get ∅ ⊢ p ′ : {v : B | { | r } ∧ v = p}. • T-Let Assume ∅ ⊢ let rec x : τx = e x in p : τ . By inversion, x : τx ⊢ e x : τx (1), x : τx ⊢ p : τ (2), and Γ ⊢ τ (3). By rule T-Fix x : τx ⊢ fix x e x : τx (1’). By (1’), (2) and Lemma 6 of [57], we get ⊢ p [fix x e x /x] : τ [fix x e x /x]. By (3) τ [fix x e x /x] ≡ τ . Since p ′ ≡ p [fix x e x /x], we have ∅ ⊢ p ′ : τ . Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:43 Predicates p Integers Booleans Bin Operators Un Operators Model Sort Arguments Sorts n b ▷◁ ⊕1 σ sa s ::= | | ::= ::= ::= ::= ::= ::= ::= p ▷◁ p | ⊕1p n | b | x | D | xp if p then p else p 0, −1, 1, . . . True | False = | < | ∧ | + | − | ... ! | ... σ , (x : p) | ∅ Int | Bool | U | Fun sa sa sa → s Fig. 15. Syntax of λS • T-Refl Assume ∅ ⊢ reflect x : τx = e x in p : τ . By double inversion, with τx′ ≡ Reflect(τx , e x ); x : τx′ ⊢ e x : τx′ (1), x : τx′ ⊢ p : τ (2), and Γ ⊢ τ (3). By rule T-Fix x : τx′ ⊢ fix x e x : τx′ (1’). By (1’), (2) and Lemma 6 of [57], we get ⊢ p [fix x e x /x] : τ [fix x e x /x]. By (3) τ [fix x e x /x] ≡ τ . Since p ′ ≡ p [fix x e x /x], we have ∅ ⊢ p ′ : τ . • T-Fix This case cannot occur, as fix does not evaluate to any program. □ F ALGORITHMIC CHECKING λS : EXTENDED VERSION Next, we describe λS , a conservative approximation of λ R where the undecidable type subsumption rule is replaced with a decidable one, yielding an SMT-based algorithmic type system that enjoys the same soundness guarantees. F.1 The SMT logic λS Syntax: Terms & Sorts Figure 15 summarizes the syntax of λS , the sorted (SMT-) decidable logic of quantifier-free equality, uninterpreted functions and linear arithmetic (QF-EUFLIA) [5, 36]. The terms of λS include integers n, booleans b, variables x, data constructors D (encoded as constants), fully applied unary ⊕1 and binary ▷◁ operators, and application x p of an uninterpreted function x. The sorts of λS include built-in integer Int and Bool for representing integers and booleans. The interpreted functions of λS , e.g. the logical constants = and <, have the function sort s → s. Other functional values in λ R , e.g. reflected λ R functions and λ-expressions, are represented as first-order values with uninterpreted sort Fun s s. The universal sort U represents all other values. Semantics: Satisfaction & Validity An assignment σ is a mapping from variables to terms σ  {x 1 7→ p1 , . . . , x n 7→ pn }. We write σ |= p if the assignment σ is a model of p, intuitively if σ p “is true” [36]. A predicate p is satisfiable if there exists σ |= p. A predicate p is valid if for all assignments σ |= p. F.2 Transforming λ R into λS The judgment Γ ⊢ e ⇝ p states that a λ R term e is transformed, under an environment Γ, into a λS term p. The transformation rules are summarized in Figure 16. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:44 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Γ ⊢e ⇝p Transformation − |= B ,→∗ ool Γ ⊢b ⇝b Γ ⊢ e 1 ⇝ p1 Γ ⊢ e 2 ⇝ p2 Γ ⊢ e 1 ▷◁ e 2 ⇝ p1 ▷◁ p2 Γ ⊢e ⇝p − |= U ,→∗ n Γ ⊢ ⊕1e ⇝ ⊕1p − |= O ,→∗ p Γ ⊢ c ⇝ sc Γ, x : τx ⊢ e ⇝ p − |= I ,→∗ nt Γ ⊢n⇝n − |= B ,→∗ in Γ ⊢ (λx .e) : (x : τx → τ ) Γ ⊢e ⇝p Γ ⊢ e e′ ⇝ Γ ⊢e ⇝p x |) app(|τ (|τ |) − |= D ,→∗ C Γ ⊢ D ⇝ sD − |= F ,→∗ un x |) Γ ⊢ λx .e ⇝ lam(|τ xp (|τ |) Γ ⊢ e′ ⇝ p′ − |= V ,→∗ ar Γ⊢x ⇝x Γ ⊢ e : τx → τ − |= A ,→∗ pp p p′ Γ ⊢ ei [x/e] ⇝ pi Γ ⊢ case x = e of {True → e 1 ; False → e 2 } ⇝ if p then p1 else p2 Γ ⊢e ⇝p Γ ⊢ ei [yi /selD i x][x/e] ⇝ pi Γ ⊢ case x = e of {D i yi → ei } ⇝ if app isD 1 p then p1 else . . . else pn − |= I ,→∗ f − |= C ,→∗ ase Fig. 16. Transforming λ R terms into λS . Embedding Types We embed λ R types into λS sorts as: (|Int|) (|Bool|)   Int Bool (|T |) (|x : τx → τ |)   U Fun (|τx |) (|τ |) Embedding Constants Elements shared on both λ R and λS translate to themselves. These elements include booleans (− |= B ,→∗ ool), integers (− |= I ,→∗ nt), variables (− |= V ,→∗ ar), binary (− |= B ,→∗ in) and unary (− |= U ,→∗ n) operators. SMT solvers do not support currying, and so in λS , all function symbols must be fully applied. Thus, we assume that all applications to primitive constants and data constructors are saturated, i.e. fully applied, e.g. by converting source level terms like (+ 1) to (\z → z + 1). Embedding Functions As λS is a first-order logic, we embed λ-abstraction and application using the uninterpreted functions lam and app. We embed λ-abstractions using lam as shown in rule − |= F ,→∗ un. The term λx .e of type τx → τ is transformed to lamssx x p of sort Fun s x s, where s x and s are respectively (|τx |) and (|τ |), lamssx is a special uninterpreted function of sort s x → s → Fun s x s, and x of sort s x and r of sort s are the embedding of the binder and body, Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:45 respectively. As lam is just an SMT-function, it does not create a binding for x. Instead, the binder x is renamed to a fresh name pre-declared in the SMT environment. Embedding Applications Dually, we embed applications via defunctionalization [40] using an uninterpreted apply function app as shown in rule − |= A ,→∗ pp. The term e e ′, where e and e ′ have types τx → τ and τx , is transformed to appssx p p ′ : s where s and s x are respectively (|τ |) and (|τx |), the appssx is a special uninterpreted function of sort Fun s x s → s x → s, and p and p ′ are the respective translations of e and e ′. Embedding Data Types Rule − |= D ,→∗ C translates each data constructor to a predefined λS constant sD of sort (|prim(D)|). Let D i be a non-boolean data constructor such that prim(D i )  τi,1 → · · · → τi,n → τ Then the check function isD i has the sort Fun (|τ |) Bool, and the select function selD i, j has the sort Fun (|τ |) (|τi, j |). Rule − |= C ,→∗ ase translates case-expressions of λ R into nested if terms in λS , by using the check functions in the guards, and the select functions for the binders of each case. For example, following the above, the body of the list append function [] ++ ys = ys (x : xs ) ++ ys = x : ( xs ++ ys ) is reflected into the λS refinement: if isNil xs then ys else sel1 xs : (sel2 xs ++ ys) We favor selectors to the axiomatic translation of HALO [60] and F* [52] to avoid universally quantified formulas and the resulting instantiation unpredictability. F.3 Correctness of Translation Informally, the translation relation Γ ⊢ e ⇝ p is correct in the sense that if e is a terminating boolean expression then e reduces to True iff p is SMT-satisfiable by a model that respects β-equivalence. Definition F.1 (β-Model). A β−model σ β is an extension of a model σ where lam and app satisfy the axioms of β-equivalence: ∀x y e.lam x e ∀x e x e.(app (lam x e) e x = lam y (e[x/y]) = e[x/e x ] Semantics Preservation We define the translation of a λ R term into λS under the empty environment as (|e |)  p if ∅ ⊢ e ⇝ p. A lifted substitution θ ⊥ is a set of models σ where each “bottom” in the substitution θ is mapped to an arbitrary logical value of the respective sort [56]. We connect the semantics of λ R and translated λS via the following theorems: Theorem F.2. If Γ ⊢ e ⇝ p, then for every θ ∈ [[Γ]] and every σ ∈ θ ⊥ , if θ ⊥ · e ,→⋆ v then σ β |= p = (|v |). Corollary F.3. If Γ ⊢ e : Bool, e reduces to a value and Γ ⊢ e ⇝ p, then for every θ ∈ [[Γ]] and every σ ∈ θ ⊥ , θ ⊥ · e ,→⋆ True iff σ β |= p. F.4 Decidable Type Checking Figure 17 summarizes the modifications required to obtain decidable type checking. Namely, basic types are extended with labels that track termination and subtyping is checked via an SMT solver. Termination Under arbitrary beta-reduction semantics (which includes lazy evaluation), soundness of refinement type checking requires checking termination, for two reasons: (1) to ensure that Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:46 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Refined Types τ ::= {v : B [⇓] | {} | | }x : τ → τ Γ ⊢S τ Well Formedness Γ, v : B ⊢S e : Bool⇓ Γ ⊢S {v : B | e} WF-Base Γ ⊢S τ ⪯ τ ′ Subtyping Γ ′  Γ, v : {B ⇓ |e} Γ′ ⊢ e ′ ⇝ p′ SmtValid(⌊Γ ′⌋ ⇒ p ′) Γ ⊢S {v : B | e} ⪯ {v : B | e ′ } ⪯-Base-λ S Fig. 17. Algorithmic Typing (other rules in Figs 12 and 14.) refinements cannot diverge, and (2) to account for the environment during subtyping [56]. We use ⇓ to mark provably terminating computations, and extend the rules to use refinements to ensure that if Γ ⊢S e : {v : B ⇓ | r }, then e terminates [56]. Verification Conditions The verification condition (VC) ⌊Γ⌋ ⇒ p is valid only if the set of values described by Γ, is subsumed by the set of values described by p. Γ is embedded into logic by conjoining (the embeddings of) the refinements of provably terminating binders [56]: (|Γ|)  Û (|Γ, x |) x ∈Γ where we embed each binder as ( p (|Γ, x |)  True if Γ(x) = {v : B ⇓ | e}, Γ ⊢ e[v/x] ⇝ p otherwise. Subtyping via SMT Validity We make subtyping, and hence, typing decidable, by replacing the denotational base subtyping rule ⪯ -Base-λS with a conservative, algorithmic version that uses an SMT solver to check the validity of the subtyping VC. We use Corollary F.3 to prove soundness of subtyping. Lemma F.4. If Γ ⊢S {v : B | e 1 } ⪯ {v : B | e 2 } then Γ ⊢ {v : B | e 1 } ⪯ {v : B | e 2 }. Soundness of λS Lemma F.4 directly implies the soundness of λS . Theorem F.5 (Soundness of λS ). If Γ ⊢S e : τ then Γ ⊢ e : τ . G SOUNDNESS OF ALGORITHMIC VERIFICATION In this section we prove soundness of Algorithmic verification, by proving the theorems of § 5 by referring to the proofs in [57]. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:47 G.1 Transformation Definition G.1 (Initial Environment). We define the initial SMT environment ∆0 to include sc lamssx appssx sD isD selD i x is Where x is : (|prim(c)|) : s x → s → Fun s x s : Fun s x s → s x → s : (|prim(D)|) : (|T → Bool|) : (|T → τi |) : s ∀c ∈ λ R ∀s x , s ∈ λS ∀s x , s ∈ λS ∀D ∈ λ R ∀D ∈ λ R of data type T ∀D ∈ λ R of data type T and i-th argument τi ∀s ∈ λS and1 ≤ i ≤ M λ are M λ global names that only appear as lambda arguments. We modify the − |= F ,→∗ un rule to ensure that logical abstraction is performed using the minimum globally defined lambda argument that is not already abstracted. We do so, using the helper function MaxLam(s, p): MaxLam(s, lamss ′ x is p) =max(i, MaxLam(s, p)) MaxLam(s, r r ) =max(MaxLam(s, p, p)) MaxLam(s, p1 ▷◁ p2 ) =max(MaxLam(s, p1 , p2 )) MaxLam(s, ⊕1p) =MaxLam(s, p) MaxLam(s, if p then p1 else p2 ) =max(MaxLam(s, p, p1 , p2 )) MaxLam(s, p) =0 i = MaxLam((|τx |), p) Γ, y : τx ⊢ e[x/y] ⇝ p Γ ⊢ λx .e ⇝ (|τx |) i < Mλ y = x i+1 Γ ⊢ (λx .e) : (x : τx → τ ) x |) lam(|τ (|τ |) yp − |= F ,→∗ un Lemma G.2 (Type Transformation). If Γ ⊢ e ⇝ p, and Γ ⊢ e : τ , then ∆0 , (|Γ|) ⊢S p:(|τ |). Proof. We proceed by induction on the translation • − |= B ,→∗ ool: Since (|Bool|) = Bool, If Γ ⊢ b : Bool, then ∆0 , (|Γ|) ⊢S b:(|Bool|). • − |= I ,→∗ nt: Since (|Int|) = Int, If Γ ⊢ n : Int, then ∆0 , (|Γ|) ⊢S n:(|Int|). • − |= U ,→∗ n: Since Γ ⊢ ! e : τ , then it should be Γ ⊢ e : Bool and τ ≡ Bool. By IH, ∆0 , (|Γ|) ⊢S p:(|Bool|), thus ∆0 , (|Γ|) ⊢S !p:(|Bool|). • − |= B ,→∗ in Assume Γ ⊢ e 1 ▷◁ e 2 ⇝ p1 ▷◁ p2 . By inversion Γ ⊢ e 1 ⇝ p1 , and Γ ⊢ e 2 ⇝ p2 . Since Γ ⊢ e 1 ▷◁ e 2 : τ , then Γ ⊢ e 1 : τ1 and Γ ⊢ e 1 : τ2 . By IH, ∆0 , (|Γ|) ⊢S p1 :(|τ1 |) and ∆0 , (|Γ|) ⊢S p2 :(|τ2 |). We split cases on ▷◁ – If ▷◁≡=, then τ1 = τ2 , thus (|τ1 |) = (|τ2 |) and (|τ |) = τ = Bool. – If ▷◁≡<, then τ1 = τ2 = Int, thus (|τ1 |) = (|τ2 |) = Int and (|τ |) = τ = Bool. – If ▷◁≡ ∧, then τ1 = τ2 = Bool, thus (|τ1 |) = (|τ2 |) = Bool and (|τ |) = τ = Bool. – If ▷◁≡ + or ▷◁≡ −, then τ1 = τ2 = Int, thus (|τ1 |) = (|τ2 |) = Int and (|τ |) = τ = Int. • − |= V ,→∗ ar: Assume Γ ⊢ x ⇝ x Then Γ ⊢ x : Γ(x) and ∆0 , (|Γ|) ⊢S x:(|Γ|)(x). But by definition ((|Γ|))(x) = (|Γ(x)|). • − |= O ,→∗ p: Assume Γ ⊢ c ⇝ sc Also, Γ ⊢ c : prim(c) and ∆0 , (|Γ|) ⊢S sc :∆0 (sc ). But by Definition G.1 ∆0 (sc ) = (|prim(c)|). Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:48 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala • − |= D ,→∗ C: Assume Γ ⊢ D ⇝ sD Also, Γ ⊢ D : prim(D) and ∆0 , (|Γ|) ⊢S sD :∆0 (sD ). But by Definition G.1 ∆0 (sD ) = (|prim(c)|). x |) • − |= F ,→∗ un: Assume Γ ⊢ λx .e ⇝ lam(|τ x i(|τx |) p. By inversion i ≤ M λ Γ, x i(|τx |) : τx ⊢ (|τ |) e[x/x i(|τx |) ] ⇝ p, and Γ ⊢ (λx .e) : (x : τx → τ ). By the Definition G.1 on lam, x is and induction, x |) we get ∆0 , (|Γ|) ⊢S lam(|τ x i(|τx |) p:Fun (|τx |) (|τ |). By the definition of the type embeddings we (|τ |) have (|x → τx τ |)  Fun (|τx |) (|τ |). x |) • − |= A ,→∗ pp: Assume Γ ⊢ e e ′ ⇝ app(|τ p p ′. By inversion, Γ ⊢ e ′ ⇝ p ′, Γ ⊢ e ⇝ p, (|τ |) x |) Γ ⊢ e : x : τx → τ . By IH and the type of app we get that ∆0 , (|Γ|) ⊢S app(|τ p p ′:(|τ |). (|τ |) • − |= I ,→∗ f : Assume Γ ⊢ case x = e of {True → e 1 ; False → e 2 } ⇝ if p then p1 else p2 Since Γ ⊢ case x = e of {True → e 1 ; False → e 2 } : τ , then Γ ⊢ e : Bool, Γ ⊢ e 1 : τ , and Γ ⊢ e 2 : τ . By inversion and IH, ∆0 , (|Γ|) ⊢S p:Bool, ∆0 , (|Γ|) ⊢S p1 :(|τ |), and ∆0 , (|Γ|) ⊢S p2 :(|τ |). Thus, ∆0 , (|Γ|) ⊢S if p then p1 else p2 :(|τ |). • − |= C ,→∗ ase: Assume Γ ⊢ case x = e of {D i yi → ei } ⇝ if isD 1 p then p1 else . . . else pn and Γ ⊢ case x = e of {D i yi → ei } : τ . By inversion we get Γ ⊢ e ⇝ p and Γ ⊢ ei [yi /selD i x][x/e] ⇝ pi . By IH and the Definition G.1 on the checkers and selectors, we get ∆0 , (|Γ|) ⊢S if isD 1 p then p1 else . . . else pn :(|τ |). □ Theorem G.3. If Γ ⊢ e ⇝ p, then for every substitution θ ∈ [[Γ]] and every model σ ∈ [[θ ⊥ ]], if · e ,→⋆ v then σ β |= p = [[v]]. θ⊥ Proof. We proceed using the notion of tracking substitutions from Figure 8 of [57]. Since θ ⊥ · e ,→⋆ v, there exists a sequence of evaluations via tracked substitutions, ⟨θ 1⊥ ; e 1 ⟩ ,→ . . . ⟨θ i⊥ ; ei ⟩ · · · ,→ ⟨θ n⊥ ; en ⟩ with θ 1⊥ ≡ θ ⊥ , e 1 ≡ e, and en ≡ v. Moreover, each ei+1 is well formed under Γ, thus it has a translation Γ ⊢ ei+1 ⇝ pi+1 . Thus we can iteratively apply Lemma G.5 n − 1 times and since v is a value the extra variables in θ n⊥ are irrelevant, thus we get the required σ β |= p = [[v]]. □ For Boolean expressions we specialize the above to Corollary G.4. If Γ ⊢ e : Bool↓ and Γ ⊢ e ⇝ p, then for every substitution θ ∈ [[Γ]] and every model σ ∈ [[θ ⊥ ]], θ ⊥ · e ,→⋆ True ⇐⇒ σ β |= p Proof. We prove the left and right implication separately: • ⇒ By direct application of Theorem G.3 for v ≡ True. • ⇐ Since e is terminating, θ ⊥ · e ,→⋆ v. with either v ≡ True or v ≡ False. Assume v ≡ False, then by Theorem G.3, σ β |= !p, which is a contradiction. Thus, v ≡ True. □ Lemma G.5 (Eqivalence Preservation). If Γ ⊢ e ⇝ p, then for every substitution θ ∈ [[Γ]] β and every model σ ∈ [[θ ⊥ ]], if ⟨θ ⊥ ; e⟩ ,→ ⟨θ 2⊥ ; e 2 ⟩ and for Γ ⊆ Γ2 so that θ 2⊥ ∈ [[Γ2 ]] and σ2 ∈ [[θ 2⊥ ]], β Γ2 ⊢ e 2 ⇝ p2 then σ β ∪ (σ2 \ σ β ) |= p = p2 . Proof. We proceed by case analysis on the derivation ⟨θ ⊥ ; e⟩ ,→ ⟨θ 2⊥ ; e 2 ⟩. • Assume ⟨θ ⊥ ; e 1 e 2 ⟩ ,→ ⟨θ 2⊥ ; e 1′ e 2 ⟩. By inversion ⟨θ ⊥ ; e 1 ⟩ ,→ ⟨θ 2⊥ ; e 1′ ⟩. Assume Γ ⊢ e 1 ⇝ p1 , β β Γ ⊢ e 2 ⇝ p2 , Γ2 ⊢ e 1′ ⇝ p1′ . By IH σ β ∪ (σ2 \ σ β ) |= p1 = p1′ , thus σ β ∪ (σ2 \ σ β ) |= app p1 p2 = app p1′ p2 . Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:49 • Assume ⟨θ ⊥ ; c e⟩ ,→ ⟨θ 2⊥ ; c e ′⟩. By inversion ⟨θ ⊥ ; e⟩ ,→ ⟨θ 2⊥ ; e ′⟩. Assume Γ ⊢ e ⇝ p, β β Γ ⊢ e ′ ⇝ p ′. By IH σ β ∪ (σ2 \ σ β ) |= p = p ′, thus σ β ∪ (σ2 \ σ β ) |= app c p = app c p ′. • Assume ⟨θ ⊥ ; case x = e of {D i yi → ei }⟩ ,→ ⟨θ 2⊥ ; case x = e ′ of {D i yi → ei }⟩. By inversion ⟨θ ⊥ ; e⟩ ,→ ⟨θ 2⊥ ; e ′⟩. Assume Γ ⊢ e ⇝ p, Γ ⊢ e ′ ⇝ p ′. Γ ⊢ ei [yi /selD i x][x/e] ⇝ pi . β β By IH σ β ∪(σ2 \σ β ) |= p = p ′, thus σ β ∪(σ2 \σ β ) |= if isD 1 p then p1 else . . . else pn (|τ |) = if isD 1 p ′ then p1 else . . . else pn (|τ |). • Assume ⟨θ ⊥ ; D ei e e j ⟩ ,→ ⟨θ 2⊥ ; D ei e ′ e j ⟩. By inversion ⟨θ ⊥ ; e⟩ ,→ ⟨θ 2⊥ ; e ′⟩. Assume Γ ⊢ β β e ⇝ p, Γ ⊢ ei ⇝ pi , Γ ⊢ e ′ ⇝ p ′. By IH σ β ∪ (σ2 \ σ β ) |= p = p ′, thus σ β ∪ (σ2 \ σ β ) |= ′ app D pi p p j = app D pi p p j . • Assume ⟨θ ⊥ ; c w⟩ ,→ ⟨θ ⊥ ; δ (c, w)⟩. By the definition of the syntax, c w is a fully applied β logical operator, thus σ β ∪ (σ2 \ σ β ) |= c w = [[δ (c, w)]] • Assume ⟨θ ⊥ ; (λx .e)e x ⟩ ,→ ⟨θ ⊥ ; e[x/e x ]⟩. Assume Γ ⊢ e ⇝ p, Γ ⊢ e x ⇝ px . Since σ β is defined β to satisfy the β-reduction axiom, σ β ∪ (σ2 \ σ β ) |= app (lam x e) px = p[x/px ]. • Assume ⟨θ ⊥ ; case x = D j e of {D i yi → ei }⟩ ,→ ⟨θ ⊥ ; e j [x/D j e][yi /e]⟩. Also, let Γ ⊢ e ⇝ p, Γ ⊢ ei [x/D j e][yi /ei ] ⇝ pi . By the axiomatic behavior of the measure selector isD j p , we get σ β |= isD j p . Thus, σ β if isD 1 p then p1 else . . . else pn = p j . • Assume ⟨(x, e x )θ ⊥ ; x⟩ ,→ ⟨(x, e x′ )θ 2⊥ ; x⟩. By inversion ⟨θ ⊥ ; e x ⟩ ,→ ⟨θ 2⊥ ; e x′ ⟩. By identity of β equality, (x, px )σ β ∪ (σ2 \ σ β ) |= x = x. ⊥ • Assume ⟨(y, ey )θ ; x⟩ ,→ ⟨(y, ey )θ 2⊥ ; e x ⟩. By inversion ⟨θ ⊥ ; x⟩ ,→ ⟨θ 2⊥ ; e x ⟩. Assume Γ ⊢ e x ⇝ β β px . By IH σ β ∪ (σ2 \ σ β ) |= x = px . Thus (y, py )σ β ∪ (σ2 \ σ β ) |= x = px . • Assume ⟨(x, w)θ ⊥ ; x⟩ ,→ ⟨(x, w)θ ⊥ ; w⟩. Thus (x, [[w]])σ β |= x = [[w]]. • Assume ⟨(x, D y)θ ⊥ ; x⟩ ,→ ⟨(x, D y)θ ⊥ ; D y⟩. Thus (x, app D y)σ β |= x = app D y. • Assume ⟨(x, D e)θ ⊥ ; x⟩ ,→ ⟨(x, D y), (yi , ei )θ ⊥ ; D y⟩. Assume Γ ⊢ ei ⇝ pi . Thus (x, app D y), (yi , pi )σ β |= x = app D y. □ G.2 Soundness of Approximation Theorem G.6 (Soundness of Algorithmic). If Γ ⊢S e : τ then Γ ⊢ e : τ . Proof. To prove soundness it suffices to prove that subtyping is appropriately approximated, as stated by the following lemma. □ Lemma G.7. If Γ ⊢S {v : B | e 1 } ⪯ {v : B | e 2 } then Γ ⊢ {v : B | e 1 } ⪯ {v : B | e 2 }. Proof. By rule ⪯-Base-λS , we need to show that ∀θ ∈ [[Γ]].[[θ · {v : B | e 1 }]] ⊆ [[θ · {v : B | e 2 }]]. We fix a θ ∈ [[Γ]]. and get that forall bindings (x i : {v : B ↓ | ei }) ∈ Γ, θ · ei [v/x i ] ,→⋆ True. Then need to show that for each e, if e ∈ [[θ · {v : B | e 1 }]], then e ∈ [[θ · {v : B | e 2 }]]. If e diverges then the statement trivially holds. Assume e ,→⋆ w. We need to show that if θ · e 1 [v/w] ,→⋆ True then θ · e 2 [v/w] ,→⋆ True. Let θ ⊥ the lifted substitution that satisfies the above. Then by Lemma G.4 for each model β σ ∈ [[θ ⊥ ]], σ β |= pi , and σ β |= q 1 for Γ ⊢ ei [v/x i ] ⇝ pi Γ ⊢ ei [v/w] ⇝ qi . Since Γ ⊢S {v : B | e 1 } ⪯ {v : B | e 2 } we get Û pi ⇒ q 1 ⇒ q 2 i thus σβ |= q 2 . By Theorem F.3 we get θ · e 2 [v/w] ,→⋆ True. □ Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:50 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala H REASONING ABOUT LAMBDAS Encoding of λ-abstractions and applications via uninterpreted functions, while sound, is imprecise as it makes it hard to prove theorems that require α- and β-equivalence or extensional equality. Using the universally quantified α- and β- equivalence axioms would let the type checker accept more programs, but would render validity, and hence, type checking undecidable. Next, we identify a middle ground by describing an not provably complete, but sound and decidable approach to increase the precision of type checking by strengthening the VCs with instances of the α- and β- equivalence axioms § H.1 and by introducing a combinator for safely asserting extensional equality § H.2. In the sequel, we omit app when it is clear from the context. H.1 Equivalence As soundness relies on satisfiability under a σ β (see Definition F.1), we can safely instantiate the axioms of α- and β-equivalence on any set of terms of our choosing and still preserve soundness (Theorem 5.2). That is, instead of checking the validity of a VC p ⇒ q, we check the validity of a strengthened VC, a ⇒ p ⇒ q, where a is a (finite) conjunction of equivalence instances derived from p and q, as discussed below. Representation Invariant The lambda binders, for each SMT sort, are drawn from a pool of names x i where the index i = 1, 2, . . .. When representing λ terms we enforce a normalization invariant that for each lambda term lam x i e, the index i is greater than any lambda argument appearing in e. α-instances For each syntactic term lam x i e and λ-binder x j such that i < j appearing in the VC, we generate an α-equivalence instance predicate (or α-instance): lam x i e = lam x j e[x i /x j ] The conjunction of α-instances can be more precise than De Bruijn representation, as they let the SMT solver deduce more equalities via congruence. For example, this VC is needed to prove the applicative laws for Reader: d = lam x 1 (x x 1 ) ⇒ lam x 2 ((lam x 1 (x x 1 )) x 2 ) = lam x 1 (d x 1 ) The α instance lam x 1 (d x 1 ) = lam x 2 (d x 2 ) derived from the VC’s hypothesis, combined with congruence immediately yields the VC’s consequence. β-instances For each syntactic term app (lam x e) e x , with e x not containing any λ-abstractions, appearing in the VC, we generate a β-equivalence instance predicate (or β-instance): app (lam x i e) e x = e [e x /x i ] , s.t. e x is λ-free The λ-free restriction is a simple way to enforce that the reduced term e [e ′/x i ] enjoys the representation invariant. For example, consider the following VC needed to prove that the bind operator for lists satisfies the monadic associativity law. (f x ≫= д) = app (lam y (f y ≫= д)) x The right-hand side of the above VC generates a β-instance that corresponds directly to the equality, allowing the SMT solver to prove the (strengthened) VC. Normalization The combination of α- and β-instances is often required to discharge proof obligations. For example, when proving that the bind operator for the Reader monad is associative, we need to prove the VC: lam x 2 (lam x 1 w) = lam x 3 (app (lam x 2 (lam x 1 w)) w) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:51 The SMT solver proves the VC via the equalities corresponding to an α and then β-instance: lam x 2 (lam x 1 w) =α lam x 3 (lam x 1 w) =β lam x 3 (app (lam x 2 (lam x 1 w)) w) H.2 Extensionality Often, we need to prove that two functions are equal, given the definitions of reflected binders. Consider reflect id id x = x Liqid Haskell accepts the proof that id x = x for all x: id_x_eq_x :: x:a → { id x = x} id_x_eq_x = \x → id x =. x ** QED as “calling” id unfolds its definition, completing the proof. However, consider this η-expanded variant of the above proposition: type Id_eq_id = {(\ x → id x) = (\ y → y)} Liqid Haskell rejects the proof: fails :: Id_eq_id fails = (\ x → id x) =. (\ y → y) ** QED The invocation of id unfolds the definition, but the resulting equality refinement {id x = x} is trapped under the λ-abstraction. That is, the equality is absent from the typing environment at the top level, where the left-hand side term is compared to \y → y. Note that the above equality requires the definition of id and hence is outside the scope of purely the α- and β-instances. An Exensionality Operator To allow function equality via extensionality, we provide the user with a (family of) function comparison operator(s) that transform an explanation p which is a proof that f x = g x for every argument x, into a proof that f = g. =* :: f:(a → b) → g:(a → b) → exp:(x:a → {f x = g x}) → {f = g} Of course, =* cannot be implemented; its type is assumed. We can use =* to prove Id_eq_id by providing a suitable explanation: pf_id_id :: Id_eq_id pf_id_id = (\y → y) =* (\x → id x) ∵ expl ** QED where expl = (\x → id x =. x ** QED) The explanation is the second argument to ∵ which has the following type that syntactically fires β-instances: x : a → {(\ x → id x) x = ((\ x → x) x} I IMPLEMENTATION Refinement reflection and PLE are implemented in Liquid Haskell. The implementation can be found in the Liquid Haskell GitHub repository, all the benchmarks of § 2 and § 7 are included in the nople and ple test directories. The benchmarks for deterministic parallelism can be found at class-laws and detpar-laws. Next, we describe the file ProofCombinators.hs, the library of proof combinators used by our benchmarks and discuss known limitations of our implementation. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:52 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala I.1 ProofCombinators: The Proof Combinators Library In this section we present ProofCombinators, a Haskell library used to structure proof terms. ProofCombinators is inspired by Equational Reasoning Data Types in Adga [34], providing operators to construct proofs for equality and linear arithmetic in Haskell. The constructed proofs are checked by an SMT-solver via Liquid Types. Proof terms are defined in ProofCombinators as a type alias for unit, a data type that curries no run-time information type Proof = () Proof types are refined to express theorems about program functions. For example, the following Proof type expresses that fib 2 == 1 fib2 :: () → {v: Proof | fib 2 == 1} We simplify the above type by omitting the irrelevant basic type Proof and variable v fib2 :: () → { fib 2 == 1 } ProofCombinators provides primitives to construct proof terms by casting expressions to proofs. To resemble mathematical proofs, we make this casting post-fix. We write p *** QED to cast p to a proof term, by defining two operators QED and *** as data QED = QED (***) :: a → QED → Proof _ *** _ = () Proof construction. To construct proof terms, ProofCombinators provides a proof constructor ⊙. for logical operators of the theory of linear arithmetic and equality: {=, ,, ≤, <, ≥, >} ∈ ⊙. ⊙. x y ensures that x ⊙ y holds, and returns x ⊙.:: x : a → y :{ a| x ⊙ y} → {v:a| v == x} ⊙. x _ = x -- for example ==.:: x : a → y :{ a| x == y} → {v:a| v == x} For instance, using ==. we construct a proof, in terms of Haskell code, that fib 2 == 1: fib2 _ = fib 2 ==. fib 1 + fib 0 ==. 1 *** QED Reusing proofs: Proofs as optional arguments. Often, proofs require reusing existing proof terms. For example, to prove fib 3 == 2 we can reuse the above fib2 proof. We extend the proof combinators, to receive an optional third argument of Proof type. ⊙.:: x : a → y :a → {x ⊙ y} → {v:a|v == x} ⊙. x _ _ = x ⊙. x y p returns x while the third argument p explicitly proves x ⊙ y. Optional Arguments. The proof term argument is optional. To implement optional arguments in Haskell we use the standard technique where for each operator ⊙ we define a type class Opt⊙ that Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:53 takes as input two expressions a and returns a result r, which will be instantiated with either the result value r:=a or a function form a proof to the result r:=Proof → a. class Opt⊙ a r where (⊙.) :: a → a → r When no explicit proof argument is required, the result type is just an y:a that curries the proof x ⊙ y instance Opt⊙ a a where (⊙.) :: x : a → y :{ a| x ⊙ y} → {v:a | v == x } (⊙.) x _ = x Note that Haskell’s type inference [49] requires both type class parameters a and r to be constrainted at class instance matching time. In most our examples, the result type parameter r is not constrained at instance matching time, thus due to the Open World Assumption the matching instance could not be determined. To address the above, we used another common Haskell trick, of generalizing the instance to type arguments a and b and then constraint a and b to be equal a~b. This generalization allows the instance to always match and imposed the equality constraint after matching. instance ( a ~ b ) ⇒ Opt⊙ a b where (⊙.) :: x : a → y :{ x ⊙ y} → {v:b | v == x } (⊙.) x _ = x To explicitly provide a proof argument, the result type r is instantiated to r:= Proof → a. For the same instance matching restrictions as above, the type is further generalized to return some b that is constraint to be equal to a. instance ( a ~ b ) ⇒ Opt⊙ a ( Proof → b) where (⊙.) :: x : a → y:a → {x ⊙ y} → {v:b | v == x } (⊙.) x _ _ = x As a concrete example, we define the equality operator ==. via the type class OptEq as class OptEq a r where (==.) :: a → a → r instance ( a ~ b ) ⇒ OptEq a b where (==.) :: x : a → y :{ a|x == y} → {v:b|v == x} (==.) x _ = x instance ( a ~ b ) ⇒ OptEq a ( Proof → b) where (==.) :: x : a → y:a → {x == y} → {v:b|v == x} (==.) x _ _ = x Explanation Operator. The “explanation operator” (?), or (∵), is used to better structure the proofs. (?) is an infix operator with same fixity as (⊙.) that allows for the equivalence x ⊙. y ? p == (⊙.) x y p (? ) :: ( Proof → a) → Proof → a f ? y = f y Putting it all together Using the above operators, we prove that fib 3 == 2, reusing the previous proof of fib 2 == 1, in a Haskell term that resembles mathematical proofs Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:54 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala fib3 :: () → { fib 3 == 2} fib3 _ = fib 3 ==. fib 2 + fib 1 ==. 2 ? fib2 () *** QED Unverified Operators All operators in ProofCombinators, but two are implemented in Haskell with implementations verified by Liquid Haskell. The ”unsound“ operators are the assume (1). (==?) that eases proof construction by assuming equalities, to be proven later and (2). (=*) extentional proof equality. Assume Operator (==?) eases proof construction by assuming equalities while the proof is in process. It is not implemented in that its body is undefined. Thus, if we run proof terms including assume operator, the proof will merely crash (instead of returning ()). Proofs including the assume operator are not considered complete, as via assume operator any statement can be proven, Function Extensional Equality Unlike the assume operator that is undefined and included in unfinished thus unsound proofs, the functions extensionality is included in valid proofs that assume function extensionality, an axioms that is assumed, as it cannot be proven by our logic. To allow function equality via extensionality, we provide the user with a function comparison operator that for each function f and g it transforms a proof that for every argument x, f x = g x to a proof on function equality f = g. (=*) :: Arg a ⇒ f :( a → b) → g :( a → b) → p :( x : a → {f x = g x }) → {f = g} The function (=*) is not implemented in the library: it returns () and its type is assumed. But soundness of its usage requires the argument type variable a to be constrained by a type class constraint Arg a, for both operational and type theoretic reasons. From operational point of view, an implementation of (=*) would require checking equality of f x = g x forall arguments x of type a. This equality would hold due to the proof argument p. The only missing point is a way to enumerate all the argument a, but this could be provided by a method of the type clas Arg a. Yet, we have not implement (=*) because we do not know how to provide such an implementation that can provably satisfy (=*)’s type. From type theoretic point of view, the type variable argument a appears only on negative positions. Liquid type inference is smart enough to infer that since a appears only negative (=*) cannot use any a and thus will not call any of its argument arguments f, g, nor the p. Thus, at each call site of (=*) the type variable ‘a‘ is instantiated with the refinement type {v:a | false} indicating deadcode (since as will not be used by the callee.) Refining the argument x:a with false at each call-site though leads to unsoundness, as each proof argument p is a valid proof under the false assumption. What Liquid inference cannot predict is our intention to call f, g and p at every possible argument. This information is capture by the type class constraint Arg a that (as discussed before [55]) states that methods of the type class Arg a may create values of type a, thus, due to lack of information on the values that are created by the methods of Arg a, a can only be refined with True. With extensional equality, we can prove that \x → x is equal to \x → id x, by providing an explicit explanation that if we call both these functions with the same argument x, they return the same result, for each x. safe :: Arg a ⇒ a → {(\x → id x) = (\x → x)} Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:55 safe _ = (\x → x) =*(\x → id x) ∵ (exp ()) exp :: Arg a ⇒ a → x:a → {(\x → id x) x = (\x → x) x} exp _ x = id x ==. x *** QED Note that the result of exp is an equality of the redexes (\x → id x) x and ((\x → x) x. Extentional function equality requires as argument an equality on such redexes. Via β equality instantiations, both such redexes will automatically reduce, requiring exp to prove id x = x, with is direct. Admittedly, proving function equality via extensionality is requires a cumbersome indirect proof. For each function equality in the main proof one needs to define an explanation function that proves the equality for every argument. I.2 Engineering Limitations The theory of refinement reflection is fully implemented in Liquid Haskell. Yet, to make this extension usable in real world applications there are four known engineering limitations that need to be addressed. All these limitations seem straightforward to address and we plan to fix them soon. The language of refinements is typed lambda calculus. That is the types of the lambda arguments are explicitly specified instead of being inferred. As another minor limitation, the refinement language parser requires the argument to be enclosed in parenthesis in applications where the function is not a variable. Thus the Haskell expression (\x → x) e should be written as (\x:a → x) (e) in the refinement logic, Class instances methods can not be reflected. Instead, the methods we want to use in the theorems/propositions should be defined as Haskell functions. This restriction has two major implications. Firstly, we can not verify correctness of library provided instances but we need to redifine them ourselves. Secondly, we cannot really verify class instances with class preconditions. For example, during verification of monoid associativity of the Maybe instance instance ( Monoid a) ⇒ Monoid ( Maybe a) there is this Monoid a class constraint assumption we needed to raise to proceed verification. Only user defined data types can currently used in verification. The reason for this limitation is that reflection of case expressions requires checker and projector measures for each data type used in reflected functions. Thus, not only should these data types be defined in the verified module, but also should be be injected in the logic by providing a refined version of the definition that can (or may not) be trivially refined. For example, to reflect a function that uses Peano numbers, the Haskell and the refined Peano definitions should be provided data Peano = Z | S Peano {-@ data Peano [ toInt ] = Z | S { prev :: Peano } @ -} Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:56 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala Note that the termination function toInt that maps Peano numbers to natural numbers is also crucial for soundness of reflection. There is no module support. All reflected definitions, including, measures (automatically generated checkers and selector, but also the classic lifted Haskell functions to measures) and the reflected types of the reflected functions, are not exposed outside of the module they are defined. Thus all definitions and propositions should exist in the same module. J VERIFIED DETERMINISTIC PARALLELISM Finally, we evaluate our deterministic parallelism prototypes. Aside from the lines of proof code added, we evaluate the impact on runtime performance. Were we using a proof tool external to Haskell, this would not be necessary. But our proofs are Haskell programs—they are necessarily visible to the compiler. In particular, this means a proliferation of unit values and functions returning unit values. Also, typeclass instances are witnessed at runtime by “dictionary” data structures passed between functions. Layering proof methods on top of existing classes like Ord could potentially add indirection or change the code generated, depending on the details of the optimizer. In our experiments we find little or no effect on runtime performance. Benchmarks were run on a singlesocket Intel® Xeon® CPU E5-2699 v3 with 18 physical cores and 64GiB RAM. J.1 LVish: Concurrent Sets First, we use the verifiedInsert operation to observe the runtime slowdown imposed by the extra proof methods of VerifiedOrd. We benchmark concurrent sets storing 64-bit integers. Figure 18 compares the parallel speedups for a fixed number of parallel insert operations against parallel verifiedInsert operations, varying the number of concurrent threads. There is a slight observable difference between the two lines because the extra proof methods do exist at runtime. We repeat the experiment for two set implementations: a concurrent skiplist (SLSet) and a purely functional set inside an atomic reference (PureSet) as described in Kuper et al. [28]. J.2 monad-par: n-body simulation Next, we verify deterministic behavior of an n-body simulation program that leverages monad-par, a Haskell library which provides deterministic parallelism for pure code [33]. Each simulated particle is represented by a type Body that stores its position, velocity, and mass. The function accel computes the relative acceleration between two bodies: accel :: Body → Body → Accel where Accel represents the three-dimensional acceleration data Accel = Accel Real Real Real To compute the total acceleration of a body b we (1) compute the relative acceleration between b and each body of the system (Vec Body) and (2) we add each acceleration component. For efficiency, we use a parallel mapReduce for the above computation that first maps each vector body to get the acceleration relative to b (accel b) and then adds each Accel value by pointwise addition. mapReduce is only deterministic if the element is a VerifiedMonoid. mapReduce :: VerifiedMonoid b ⇒ (a → b) → Vec a → b To enforce the determinism of an n-body simulation, we need to provide a VerifiedMonoid instance for Accel. We can prove that (Real, +, 0.0) is a monoid. By product proof composition, we get a verified monoid instance for type Accel' = (Real, (Real, Real)) Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 2 8 7 1.5 6 5 1 4 3 0.5 PureSet Verified PureSet SLSet Verified SLSet 0 2 1 Parallel speedup (relative to SLSet) Parallel speedup (relative to PureSet) 53:57 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Threads Fig. 18. Parallel speedup for doing 1 million parallel inserts over 10 iterations, verified and unverified, relative to the unverified version, for PureSet and SLSet. which is isomorphic to Accel (i.e. Iso Accel' Accel). Figure 19 shows the results of running two versions of the n-body simulation with 2,048 bodies over 5 iterations, with and without verification, using floating point doubles for Real1 . Notably, the two programs have almost identical runtime performance. This demonstrates that even when verifying code that is run in a tight loop (like accel), we can expect that our programs will not be slowed down by an unacceptable amount. J.3 DPJ: Parallel Reducers The Deterministic Parallel Java (DPJ) project provides a deterministic-by-default semantics for the Java programming language [10]. In DPJ, one can declare a method as commutative and thus assert that racing instances of that method result in a deterministic outcome. For example: commutative void updateSum ( int n) writes R { sum += n; } 1 Floating point numbers notoriously violate associativity, but we use this approximation because Haskell does net yet have an implementation of superaccumulators [15]. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. Parallel speedup (relative to unverified) 53:58 N. Vazou, A. Tondwalkar, V. Choudhury, R. G. Scott, R. R. Newton, P. Wadler, and R. Jhala 7 6 5 4 3 2 1 0 Verified n-body Unverified n-body Verified reducer Unverified reducer 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Threads Fig. 19. Parallel speedup for doing a parallel n-body simulation and parallel array reduction. The speedup is relative to the unverified version of each respective class of program. But, DPJ provides no means to formally prove commutativity and thus determinism of parallel reduction. In Liquid Haskell, we specified commutativity as an extra proof method that extends the VerifiedMonoid class. class VerifiedMonoid a ⇒ VerifiedCommutativeMonoid a where commutes :: x:a → y:a → { x <> y = y <> x } Provably commutative appends can be used to deterministically update a reducer variable, since the result is the same regardless of the order of appends. We used LVish [28] to encode a reducer variable with a value a and a region s as RVar s a. newtype RVar s a We specify that safe (i.e. deterministic) parallel updates require provably commutative appending. updateRVar :: VerifiedCommutativeMonoid a ⇒ a → RVar s a → Par s () Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018. 53:59 Following the DPJ program, we used updateRVar’s provably deterministic interface to compute, in parallel, the sum of an array with 3x109 elements by updating a single, global reduction variable using a varying number of threads. Each thread sums segments of an array, sequentially, and updates the variable with these partial sums. In Figure 19, we compare the verified and unverified versions of our implementation to observe no appreciable difference in performance. Proceedings of the ACM on Programming Languages, Vol. 2, No. POPL, Article 53. Publication date: January 2018.
6cs.PL
arXiv:1605.06416v3 [math.ST] 12 Feb 2017 Statistical Inference for Cluster Trees Jisu Kim Department of Statistics Carnegie Mellon University Pittsburgh, USA [email protected] Yen-Chi Chen Department of Statistics University of Washington Seattle, USA [email protected] Alessandro Rinaldo Department of Statistics Carnegie Mellon University Pittsburgh, USA [email protected] Sivaraman Balakrishnan Department of Statistics Carnegie Mellon University Pittsburgh, USA [email protected] Larry Wasserman Department of Statistics Carnegie Mellon University Pittsburgh, USA [email protected] Abstract A cluster tree provides a highly-interpretable summary of a density function by representing the hierarchy of its high-density clusters. It is estimated using the empirical tree, which is the cluster tree constructed from a density estimator. This paper addresses the basic question of quantifying our uncertainty by assessing the statistical significance of topological features of an empirical cluster tree. We first study a variety of metrics that can be used to compare different trees, analyze their properties and assess their suitability for inference. We then propose methods to construct and summarize confidence sets for the unknown true cluster tree. We introduce a partial ordering on cluster trees which we use to prune some of the statistically insignificant features of the empirical tree, yielding interpretable and parsimonious cluster trees. Finally, we illustrate the proposed methods on a variety of synthetic examples and furthermore demonstrate their utility in the analysis of a Graft-versus-Host Disease (GvHD) data set. 1 Introduction Clustering is a central problem in the analysis and exploration of data. It is a broad topic, with several existing distinct formulations, objectives, and methods. Despite the extensive literature on the topic, a common aspect of the clustering methodologies that has hindered its widespread scientific adoption is the dearth of methods for statistical inference in the context of clustering. Methods for inference broadly allow us to quantify our uncertainty, to discern “true” clusters from finite-sample artifacts, as well as to rigorously test hypotheses related to the estimated cluster structure. In this paper, we study statistical inference for the cluster tree of an unknown density. We assume that we observe an i.i.d. sample {X1 , . . . , Xn } from a distribution P0 with unknown density p0 . Here, Xi ∈ X ⊂ Rd . The connected components C(λ), of the upper level set {x : p0 (x) ≥ λ}, are called high-density clusters. The set of high-density clusters forms a nested hierarchy which is referred to as the cluster tree1 of p0 , which we denote as Tp0 . Methods for density clustering fall broadly in the space of hierarchical clustering algorithms, and inherit several of their advantages: they allow for extremely general cluster shapes and sizes, and in general do not require the pre-specification of the number of clusters. Furthermore, unlike flat 1 It is also referred to as the density tree or the level-set tree. 29th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. clustering methods, hierarchical methods are able to provide a multi-resolution summary of the underlying density. The cluster tree, irrespective of the dimensionality of the input random variable, is displayed as a two-dimensional object and this makes it an ideal tool to visualize data. In the context of statistical inference, density clustering has another important advantage over other clustering methods: the object of inference, the cluster tree of the unknown density p0 , is clearly specified. In practice, the cluster tree is estimated from a finite sample, {X1 , . . . , Xn } ∼ p0 . In a scientific application, we are often most interested in reliably distinguishing topological features genuinely present in the cluster tree of the unknown p0 , from topological features that arise due to random fluctuations in the finite sample {X1 , . . . , Xn }. In this paper, we focus our inference on the cluster tree of the kernel density estimator, Tpbh , where pbh is the kernel density estimator,   n 1 X kx − Xi k pbh (x) = K , (1) nhd i=1 h where K is a kernel and h is an appropriately chosen bandwidth 2 . To develop methods for statistical inference on cluster trees, we construct a confidence set for Tp0 , i.e. a collection of trees that will include Tp0 with some (pre-specified) probability. A confidence set can be converted to a hypothesis test, and a confidence set shows both statistical and scientific significances while a hypothesis test can only show statistical significances [23, p.155]. To construct and understand the confidence set, we need to solve a few technical and conceptual issues. The first issue is that we need a metric on trees, in order to quantify the collection of trees that are in some sense “close enough” to Tpbh to be statistically indistinguishable from it. We use the bootstrap to construct tight data-driven confidence sets. However, only some metrics are sufficiently “regular” to be amenable to bootstrap inference, which guides our choice of a suitable metric on trees. On the basis of a finite sample, the true density is indistinguishable from a density with additional infinitesimal perturbations. This leads to the second technical issue which is that our confidence set invariably contains infinitely complex trees. Inspired by the idea of one-sided inference [9], we propose a partial ordering on the set of all density trees to define simple trees. To find simple representative trees in the confidence set, we prune the empirical cluster tree by removing statistically insignificant features. These pruned trees are valid with statistical guarantees that are simpler than the empirical cluster tree in the proposed partial ordering. Our contributions: We begin by considering a variety of metrics on trees, studying their properties and discussing their suitability for inference. We then propose a method of constructing confidence sets and for visualizing trees in this set. This distinguishes aspects of the estimated tree correspond to real features (those present in the cluster tree Tp0 ) from noise features. Finally, we apply our methods to several simulations, and a Graft-versus-Host Disease (GvHD) data set to demonstrate the usefulness of our techniques and the role of statistical inference in clustering problems. Related work: There is a vast literature on density trees (see for instance the book by Klemelä [16]), and we focus our review on works most closely aligned with our paper. The formal definition of the cluster tree, and notions of consistency in estimation of the cluster tree date back to the work of Hartigan [15]. Hartigan studied the efficacy of single-linkage in estimating the cluster tree and showed that single-linkage is inconsistent when the input dimension d > 1. Several fixes to single-linkage have since been proposed (see for instance [21]). The paper of Chaudhuri and Dasgupta [4] provided the first rigorous minimax analysis of the density clustering and provided a computationally tractable, consistent estimator of the cluster tree. The papers [1, 5, 12, 17] propose various modifications and analyses of estimators for the cluster tree. While the question of estimation has been extensively addressed, to our knowledge our paper is the first concerning inference for the cluster tree. There is a literature on inference for phylogenetic trees (see the papers [13, 10]), but the object of inference and the hypothesized generative models are typically quite different. Finally, in our paper, we also consider various metrics on trees. There are several recent works, in the computational topology literature, that have considered different metrics on trees. The most relevant to our own work, are the papers [2, 18] that propose the functional distortion metric and the interleaving distance on trees. These metrics, however, are NP-hard to compute in general. In Section 3, we consider a variety of computationally tractable metrics and assess their suitability for inference. 2 We address computing the tree Tpbh , and the choice of bandwidth in more detail in what follows. 2 p(x) p(x) x x Figure 1: Examples of density trees. Black curves are the original density functions and the red trees are the associated density trees. 2 Background and Definitions We work with densities defined on a subset X ⊂ Rd , and denote by k.k the Euclidean norm on X . Throughout this paper we restrict our attention to cluster tree estimators that are specified in terms of a function f : X 7→ [0, ∞), i.e. we have the following definition: Definition 1. For any f : X 7→ [0, ∞) the cluster tree of f is a function Tf : R 7→ 2X , where 2X is the set of all subsets of X , and Tf (λ) is the set of the connected components of the upper-level set S {x ∈ X : f (x) ≥ λ}. We define the collection of connected components {Tf }, as {Tf } = Tf (λ). λ As will be clearer in what follows, working only with cluster trees defined via a function f simplifies our search for metrics on trees, allowing us to use metrics specified in terms of the function f . With a slight abuse of notation, we will use Tf to denote also {Tf }, and write C ∈ Tf to signify C ∈ {Tf }. The cluster tree Tf indeed has a tree structure, since for every pair C1 , C2 ∈ Tf , either C1 ⊂ C2 , C2 ⊂ C1 , or C1 ∩ C2 = ∅ holds. See Figure 1 for a graphical illustration of a cluster tree. The formal definition of the tree requires some topological theory; these details are in Appendix B. In the context of hierarchical clustering, we are often interested in the “height” at which two points or two clusters merge in the clustering. We introduce the merge height from [12, Definition 6]: Definition 2. For any two points x, y ∈ X , any f : X 7→ [0, ∞), and its tree Tf , their merge height mf (x, y) is defined as the largest λ such that x and y are in the same density cluster at level λ, i.e. mf (x, y) = sup {λ ∈ R : there exists C ∈ Tf (λ) such that x, y ∈ C} . We refer to the function mf : X × X 7→ R as the merge height function. For any two clusters C1 , C2 ∈ {Tf }, their merge height mf (C1 , C2 ) is defined analogously, mf (C1 , C2 ) = sup {λ ∈ R : there exists C ∈ Tf (λ) such that C1 , C2 ⊂ C} . One of the contributions of this paper is to construct valid confidence sets for the unknown true tree and to develop methods for visualizing the trees contained in this confidence set. Formally, we assume that we have samples {X1 , . . . , Xn } from a distribution P0 with density p0 . Definition 3. An asymptotic (1 − α) confidence set, Cα , is a collection of trees with the property that P0 (Tp0 ∈ Cα ) = 1 − α + o(1). We also provide non-asymptotic upper bounds on the o(1) term in the above definition. Additionally, we provide methods to summarize the confidence set above. In order to summarize the confidence set, we define a partial ordering on trees. Definition 4. For any f, g : X 7→ [0, ∞) and their trees Tf , Tg , we say Tf  Tg if there exists a map Φ : {Tf } → {Tg } such that for any C1 , C2 ∈ Tf , we have C1 ⊂ C2 if and only if Φ(C1 ) ⊂ Φ(C2 ). With Definition 3 and 4, we describe the confidence set succinctly via some of the simplest trees in the confidence set in Section 4. Intuitively, these are trees without statistically insignificant splits. It is easy to check that the partial order  in Definition 4 is reflexive (i.e. Tf  Tf ) and transitive (i.e. that Tf1  Tf2 and Tf2  Tf3 implies Tf1  Tf3 ). However, to argue that  is a partial order, we need to show the antisymmetry, i.e. Tf  Tg and Tg  Tf implies that Tf and Tg are equivalent in some sense. In Appendices A and B, we show an important result: for an appropriate topology on trees, Tf  Tg and Tg  Tf implies that Tf and Tf are topologically equivalent. 3 Tp Tp x Tp x (a) (b) Tq x (c) Tq x Tq x (d) (e) x (f) Figure 2: Three illustrations of the partial order  in Definition 4. In each case, in agreement with our intuitive notion of simplicity, the tree on the top ((a), (b), and (c)) is lower than the corresponding tree on the bottom((d), (e), and (f)) in the partial order, i.e. for each example Tp  Tq . The partial order  in Definition 4 matches intuitive notions of the complexity of the tree for several reasons (see Figure 2). Firstly, Tf  Tg implies (number of edges of Tf ) ≤ (number of edges of Tg ) (compare Figure 2(a) and (d), and see Lemma 6 in Appendix B). Secondly, if Tg is obtained from Tf by adding edges, then Tf  Tg (compare Figure 2(b) and (e), and see Lemma 7 in Appendix B). Finally, the existence of a topology preserving embedding from {Tf } to {Tg } implies the relationship Tf  Tg (compare Figure 2(c) and (f), and see Lemma 8 in Appendix B). 3 Tree Metrics In this section, we introduce some natural metrics on cluster trees and study some of their properties that determine their suitability for statistical inference. We let p, q : X → [0, ∞) be nonnegative functions and let Tp and Tq be the corresponding trees. 3.1 Metrics We consider three metrics on cluster trees, the first is the standard `∞ metric, while the second and third are metrics that appear in the work of Eldridge et al. [12]. `∞ metric: The simplest metric is d∞ (Tp , Tq ) = kp − qk∞ = supx∈X |p(x) − q(x)|. We will show in what follows that, in the context of statistical inference, this metric has several advantages over other metrics. Merge distortion metric: The merge distortion metric intuitively measures the discrepancy in the merge height functions of two trees in Definition 2. We consider the merge distortion metric [12, Definition 11] defined by dM (Tp , Tq ) = sup |mp (x, y) − mq (x, y)|. x,y∈X The merge distortion metric we consider is a special case of the metric introduced by Eldridge et al. [12]3 . The merge distortion metric was introduced by Eldridge et al. [12] to study the convergence of cluster tree estimators. They establish several interesting properties of the merge distortion metric: in particular, the metric is stable to perturbations in `∞ , and further, that convergence in the merge distortion metric strengthens previous notions of convergence of the cluster trees. Modified merge distortion metric: We also consider the modified merge distortion metric given by dMM (Tp , Tq ) = sup |dTp (x, y) − dTq (x, y)|, x,y∈X where dTp (x, y) = p(x) + p(y) − 2mp (x, y), which corresponds to the (pseudo)-distance between x and y along the tree. The metric dMM is used in various proofs in the work of Eldridge et al. [12]. 3 They further allow flexibility in taking a sup over a subset of X . 4 It is sensitive to both distortions of the merge heights in Definition 2, as well as of the underlying densities. Since the metric captures the distortion of distances between points along the tree, it is in some sense most closely aligned with the cluster tree. Finally, it is worth noting that unlike the interleaving distance and the functional distortion metric [2, 18], the three metrics we consider in this paper are quite simple to approximate to a high-precision. 3.2 Properties of the Metrics The following Lemma gives some basic relationships between the three metrics d∞ , dM and dMM . We define pinf = inf x∈X p(x), and qinf analogously, and a = inf x∈X {p(x) + q(x)} − 2 min{pinf , qinf }. Note that when the Lebesgue measure µ(X ) is infinite, then pinf = qinf = a = 0. Lemma 1. For any densities p and q, the following relationships hold: (i) When p and q are continuous, then d∞ (Tp , Tq ) = dM (Tp , Tq ). (ii) dMM (Tp , Tq ) ≤ 4d∞ (Tp , Tq ). (iii) dMM (Tp , Tq ) ≥ d∞ (Tp , Tq ) − a, where a is defined as above. Additionally when µ(X ) = ∞, then dMM (Tp , Tq ) ≥ d∞ (Tp , Tq ). The proof is in Appendix F. From Lemma 1, we can see that under a mild assumption (continuity of the densities), d∞ and dM are equivalent. We note again that the work of Eldridge et al. [12] actually defines a family of merge distortion metrics, while we restrict our attention to a canonical one. We can also see from Lemma 1 that while the modified merge metric is not equivalent to d∞ , it is usually multiplicatively sandwiched by d∞ . Our next line of investigation is aimed at assessing the suitability of the three metrics for the task of statistical inference. Given the strong equivalence of d∞ and dM we focus our attention on d∞ and dMM . Based on prior work (see [7, 8]), the large sample behavior of d∞ is well understood. In particular, d∞ (Tpbh , Tp0 ) converges to the supremum of an appropriate Gaussian process, on the basis of which we can construct confidence intervals for the d∞ metric. The situation for the metric dMM is substantially more subtle. One of our eventual goals is to use the non-parametric bootstrap to construct valid estimates of the confidence set. In general, a way to assess the amenability of a functional to the bootstrap is via Hadamard differentiability [24]. Roughly speaking, Hadamard-differentiability is a type of statistical stability, that ensures that the functional under consideration is stable to perturbations in the input distribution. In Appendix C, we formally define Hadamard differentiability and prove that dMM is not point-wise Hadamard differentiable. This does not completely rule out the possibility of finding a way to construct confidence sets based on dMM , but doing so would be difficult and so far we know of no way to do it. In summary, based on computational considerations we eliminate the interleaving distance and the functional distortion metric [2, 18], we eliminate the dMM metric based on its unsuitability for statistical inference and focus the rest of our paper on the d∞ (or equivalently dM ) metric which is both computationally tractable and has well understood statistical behavior. 4 Confidence Sets In this section, we consider the construction of valid confidence intervals centered around the kernel density estimator, defined in Equation (1). We first observe that a fixed bandwidth for the KDE gives a dimension-free rate of convergence for estimating a cluster tree. For estimating a density in high dimensions, the KDE has a poor rate of convergence, due to a decreasing bandwidth for simultaneously optimizing the bias and the variance of the KDE. When estimating a cluster tree, the bias of the KDE does not affect its cluster tree. Intuitively, the cluster tree is a shape characteristic of a function, which is not affected by the bias. Defining the biased density, ph (x) = E[b ph (x)], two cluster trees from ph and the true density p0 are equivalent with respect to the topology in Appendix A, if h is small enough and p0 is regular enough: Lemma 2. Suppose that the true unknown density p0 , has no non-degenerate critical points 4 , then there exists a constant h0 > 0 such that for all 0 < h ≤ h0 , the two cluster trees, Tp0 and Tph have the same topology in Appendix A. 4 The Hessian of p0 at every critical point is non-degenerate. Such functions are known as Morse functions. 5 From Lemma 2, proved in Appendix G, a fixed bandwidth for the KDE can be applied to give a dimension-free rate of convergence for estimating the cluster tree. Instead of decreasing bandwidth h and inferring the cluster tree of the true density Tp0 at rate OP (n−2/(4+d) ), Lemma 2 implies that we can fix h > 0 and infer the cluster tree of the biased density Tph at rate OP (n−1/2 ) independently of the dimension. Hence a fixed bandwidth crucially enhances the convergence rate of the proposed methods in high-dimensional settings. 4.1 A data-driven confidence set We recall that we base our inference on the d∞ metric, and we recall the definition of a valid confidence set (see Definition 3). As a conceptual first step, suppose that for a specified value α we could compute the 1 − α quantile of the distribution of d∞ (Tpbh , Tph ), and denote this value tα . Then a valid confidence set for the unknown Tph is Cα = {T : d∞ (T, Tpbh ) ≤ tα }. To estimate tα , we use e 1, · · · , X en1 }, . . . , {X eB, · · · , X enB }, the bootstrap. Specifically, we generate B bootstrap samples, {X 1 1 by sampling with replacement from the original sample. On each bootstrap sample, we compute the KDE, and the associated cluster tree. We denote the cluster trees {Tep1h , . . . , TepBh }. Finally, we estimate tα by n 1 X −1 b b b tα = F (1 − α), where F (s) = I(d∞ (Tepih , Tpbh ) < s). B i=1 bα = {T : d∞ (T, Tbh ) ≤ b tα }. Using techniques from [8, 7], Then the data-driven confidence set is C the following can be shown (proof omitted): Theorem 3. Under mild regularity conditions on the kernel5 , we have that the constructed confidence set is asymptotically valid and satisfies,    7 1/6  bα = 1 − α + O log n P Th ∈ C . nhd Hence our data-driven confidence set is consistent at dimension independent rate. When h is a fixed small constant, Lemma 2 implies that Tp0 and Tph have the same topology, and Theorem 3 guarantees that the non-parametric bootstrap is consistent at a dimension independent O(((log n)7 /n)1/6 ) rate. For reasons explained in [8], this rate is believed to be optimal. 4.2 Probing the Confidence Set bα is an infinite set with a complex structure. Infinitesimal perturbations of the The confidence set C density estimate are in our confidence set and so this set contains very complex trees. One way to understand the structure of the confidence set is to focus attention on simple trees in the confidence set. Intuitively, these trees only contain topological features (splits and branches) that are sufficiently strongly supported by the data. We propose two pruning schemes to find trees, that are simpler than the empirical tree Tpbh that are in the confidence set. Pruning the empirical tree aids visualization as well as de-noises the empirical tree by eliminating some features that arise solely due to the stochastic variability of the finite-sample. The algorithms are (see Figure 3): 1. Pruning only leaves: Remove all leaves of length less than 2b tα (Figure 3(b)). 2. Pruning leaves and internal branches: In this case, we first prune the leaves as above. This yields a new tree. Now we again prune (using cumulative length) any leaf of length less than 2b tα . We continue iteratively until all remaining leaves are of cumulative length larger than 2b tα (Figure 3(c)). In Appendix D.2 we formally define the pruning operation and show the following. The remaining tree Te after either of the above pruning operations satisfies: (i) Te  Tpbh , (ii) there exists a function f bα (see Lemma 10 in Appendix D.2). In other words, we identified a whose tree is Te, and (iii) Te ∈ C valid tree with a statistical guarantee that is simpler than the original estimate Tpbh . Intuitively, some of the statistically insignificant features have been removed from Tpbh . We should point out, however, 5 See Appendix D.1 for details. 6 L1 L2 L6 L5 L3 L4 E5 E4 E1 E3 E2 (a) The empirical tree. (b) Pruning only leaves. (c) Pruning leaves and branches. Figure 3: Illustrations of our two pruning strategies. (a) shows the empirical tree. In (b), leaves that are insignificant are pruned, while in (c), insignificant internal branches are further pruned top-down. (a) (b) (c) − − 0.2 0.4 0.6 (d) 0.8 1.0 lambda 0 lambda 0 0.208 0.272 0 lambda − 0.0 − 0.07 0.291 − Yingyang data, alpha = 0.05 0.035 0.044 0.052 − 0.255 Mickey mouse data, alpha = 0.05 0.529 Ring data, alpha = 0.05 0.0 0.2 0.4 0.6 (e) 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 (f) Figure 4: Simulation examples. (a) and (d) are the ring data; (b) and (e) are the mickey mouse data; (c) and (f) are the yingyang data. The solid lines are the pruned trees; the dashed lines are leaves (and edges) removed by the pruning procedure. A bar of length 2b tα is at the top right corner. The pruned trees recover the actual structure of connected components. bα . Ideally, we would like to that there may exist other trees that are simpler than Tpbh that are in C have an algorithm that identifies all trees in the confidence set that are minimal with respect to the partial order  in Definition 4. This is an open question that we will address in future work. 5 Experiments In this section, we demonstrate the techniques we have developed for inference on synthetic data, as well as on a real dataset. 5.1 Simulated data We consider three simulations: the ring data (Figure 4(a) and (d)), the Mickey Mouse data (Figure 4(b) and (e)), and the yingyang data (Figure 4(c) and (f)). The smoothing bandwidth is chosen by the Silverman reference rule [20] and we pick the significance level α = 0.05. 7 4e−10 − − 0e+00 0e+00 1e−10 2e−10 2e−10 4e−10 3e−10 6e−10 8e−10 − − 0.0 0.2 0.4 0.6 0.8 1.0 0.0 (a) The positive treatment data. 0.2 0.4 0.6 0.8 1.0 (b) The control data. Figure 5: The GvHD data. The solid brown lines are the remaining branches after pruning; the blue dashed lines are the pruned leaves (or edges). A bar of length 2b tα is at the top right corner. Example 1: The ring data. (Figure 4(a) and (d)) The ring data consists of two structures: an outer ring and a center node. The outer circle consists of 1000 points and the central node contains 200 points. To construct the tree, we used h = 0.202. Example 2: The Mickey Mouse data. (Figure 4(b) and (e)) The Mickey Mouse data has three components: the top left and right uniform circle (400 points each) and the center circle (1200 points). In this case, we select h = 0.200. Example 3: The yingyang data. (Figure 4(c) and (f)) This data has 5 connected components: outer ring (2000 points), the two moon-shape regions (400 points each), and the two nodes (200 points each). We choose h = 0.385. Figure 4 shows those data ((a), (b), and (c)) along with the pruned density trees (solid parts in (d), (e), and (f)). Before pruning the tree (both solid and dashed parts), there are more leaves than the actual number of connected components. But after pruning (only the solid parts), every leaf corresponds to an actual connected component. This demonstrates the power of a good pruning procedure. 5.2 GvHD dataset Now we apply our method to the GvHD (Graft-versus-Host Disease) dataset [3]. GvHD is a complication that may occur when transplanting bone marrow or stem cells from one subject to another [3]. We obtained the GvHD dataset from R package ‘mclust’. There are two subsamples: the control sample and the positive (treatment) sample. The control sample consists of 9083 observations and the positive sample contains 6809 observations on 4 biomarker measurements (d = 4). By the normal reference rule [20], we pick h = 39.1 for the positive sample and h = 42.2 for the control sample. We set the significance level α = 0.05. Figure 5 shows the density trees in both samples. The solid brown parts are the remaining components of density trees after pruning and the dashed blue parts are the branches removed by pruning. As can be seen, the pruned density tree of the positive sample (Figure 5(a)) is quite different from the pruned tree of the control sample (Figure 5(b)). The density function of the positive sample has fewer bumps (2 significant leaves) than the control sample (3 significant leaves). By comparing the pruned trees, we can see how the two distributions differ from each other. 6 Discussion There are several open questions that we will address in future work. First, it would be useful to have an algorithm that can find all trees in the confidence set that are minimal with respect to the partial order . These are the simplest trees consistent with the data. Second, we would like to find a way to derive valid confidence sets using the metric dMM which we view as an appealing metric for tree inference. Finally, we have used the Silverman reference rule [20] for choosing the bandwidth but we would like to find a bandwidth selection method that is more targeted to tree inference. 8 References [1] S. Balakrishnan, S. Narayanan, A. Rinaldo, A. Singh, and L. Wasserman. Cluster trees on manifolds. In Advances in Neural Information Processing Systems, 2012. [2] U. Bauer, E. Munch, and Y. Wang. Strong equivalence of the interleaving and functional distortion metrics for reeb graphs. In 31st International Symposium on Computational Geometry (SoCG 2015), volume 34, pages 461–475. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 2015. [3] R. R. Brinkman, M. Gasparetto, S.-J. J. Lee, A. J. Ribickas, J. Perkins, W. Janssen, R. Smiley, and C. Smith. High-content flow cytometry and temporal data analysis for defining a cellular signature of graft-versus-host disease. Biology of Blood and Marrow Transplantation, 13(6):691–700, 2007. [4] K. Chaudhuri and S. Dasgupta. Rates of convergence for the cluster tree. In Advances in Neural Information Processing Systems, pages 343–351, 2010. [5] K. Chaudhuri, S. Dasgupta, S. Kpotufe, and U. von Luxburg. Consistent procedures for cluster tree estimation and pruning. IEEE Transactions on Information Theory, 2014. [6] F. Chazal, B. T. Fasy, F. Lecci, B. Michel, A. Rinaldo, and L. Wasserman. Robust topological inference: Distance to a measure and kernel distance. arXiv preprint arXiv:1412.7197, 2014. [7] Y.-C. Chen, C. R. Genovese, and L. Wasserman. Density level sets: Asymptotics, inference, and visualization. arXiv:1504.05438, 2015. [8] V. Chernozhukov, D. Chetverikov, and K. Kato. Central limit theorems and bootstrap in high dimensions. Annals of Probability, 2016. [9] D. Donoho. One-sided inference about functionals of a density. The Annals of Statistics, 16(4):1390–1420, 1988. [10] B. Efron, E. Halloran, and S. Holmes. Bootstrap confidence levels for phylogenetic trees. Proceedings of the National Academy of Sciences, 93(23), 1996. [11] U. Einmahl and D. M. Mason. Uniform in bandwidth consistency of kernel-type function estimators. The Annals of Statistics, 33(3):1380–1403, 2005. [12] J. Eldridge, M. Belkin, and Y. Wang. Beyond hartigan consistency: Merge distortion metric for hierarchical clustering. In Proceedings of The 28th Conference on Learning Theory, pages 588–606, 2015. [13] J. Felsenstein. Confidence limits on phylogenies, a justification. Evolution, 39, 1985. [14] C. R. Genovese, M. Perone-Pacifico, I. Verdinelli, and L. Wasserman. Nonparametric ridge estimation. The Annals of Statistics, 42(4):1511–1545, 2014. [15] J. A. Hartigan. Consistency of single linkage for high-density clusters. Journal of the American Statistical Association, 1981. [16] J. Klemelä. Smoothing of multivariate data: density estimation and visualization, volume 737. John Wiley & Sons, 2009. [17] S. Kpotufe and U. V. Luxburg. Pruning nearest neighbor cluster trees. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 225–232, 2011. [18] D. Morozov, K. Beketayev, and G. Weber. Interleaving distance between merge trees. Discrete and Computational Geometry, 49:22–45, 2013. [19] D. W. Scott. Multivariate density estimation: theory, practice, and visualization. John Wiley & Sons, 2015. [20] B. W. Silverman. Density estimation for statistics and data analysis, volume 26. CRC press, 1986. [21] W. Stuetzle and R. Nugent. A generalized single linkage method for estimating the cluster tree of a density. Journal of Computational and Graphical Statistics, 19(2), 2010. [22] L. Wasserman. All of nonparametric statistics. Springer Science & Business Media, 2006. [23] L. Wasserman. All of Statistics: A Concise Course in Statistical Inference. Springer Science & Business Media, 2010. ISBN 1441923225, 9781441923226. [24] J. Wellner. Weak Convergence and Empirical Processes: With Applications to Statistics. Springer Science & Business Media, 2013. 9 A Topological Preliminaries The goal of this section is to define an appropriate topology on the cluster tree Tf in Definition 1. Defining an appropriate topology for the cluster tree Tf is important in this paper for several reasons: (1) the topology gives geometric insight for the cluster tree, (2) homeomorphism (topological equivalence) is connected to equivalence in the partial order  in Definition 4, and (3) the topology bα as in Lemma 2 gives a justification for using a fixed bandwidth h for constructing confidence set C to obtain faster rates of convergence. We construct the topology of the cluster tree Tf by imposing a topology on the corresponding collection of connected components {Tf } in Definition 1. For defining a topology on {Tf }, we define the tree distance function dTf in Definition 5, and impose the metric topology induced from the tree distance function. Using a distance function for topology not only eases formulating topology but also enables us to inherit all the good properties of the metric topology. The desired tree distance function dTf : {Tf }×{Tf } → [0, ∞) is based on the merge height function mf in Definition 2. For later use in the proof, we define the tree distance function dTf on both X and {Tf } as follows: Definition 5. Let f : X → [0, ∞) be a function, and Tf be its cluster tree in Definition 1. For any two points x, y ∈ X , the tree distance function dTf : X × X → [0, ∞) of Tf on X is defined as dTf (x, y) = f (x) + f (y) − 2mf (x, y). Similarly, for any two clusters C1 , C2 ∈ {Tf }, we first define λ1 = sup{λ : C1 ∈ Tf (λ)}, and λ2 analogously. We then define the tree distance function dTf : {Tf } × {Tf } → [0, ∞) of Tf on X as: dTf (C1 , C2 ) = λ1 + λ2 − 2mf (C1 , C2 ). The tree distance function dTf in Definition 2 is a pseudometric on X and is a metric on {Tf } as desired, proven in Lemma 4. The proof is given later in Appendix E. Lemma 4. Let f : X → [0, ∞) be a function, Tf be its cluster tree in Definition 1, and dTf be its tree distance function in Definition 5. Then dTf on X is a pseudometric and dTf on {Tf } is a metric. From the metric dTf on {Tf } in Definition 5, we impose the induced metric topology on {Tf }. We say Tf is homeomorphic to Tg , or Tf ∼ = Tg , when their corresponding collection of connected components are homeomorphic, i.e. {Tf } ∼ = {Tg }. (Two spaces are homeomorphic if there exists a bijective continuous function between them, with a continuous inverse.) To get some geometric understanding of the cluster tree in Definition 1, we identify edges that constitute the cluster tree. Intuitively, edges correspond to either leaves or internal branches. An edge is roughly defined as a set of clusters whose inclusion relationship with respect to clusters outside an edge are equivalent, so that when the collection of connected components is divided into edges, we observe the same inclusion relationship between representative clusters whenever any cluster is selected as a representative for each edge. For formally defining edges, we define an interval in the cluster tree and the equivalence relation in the cluster tree. For any two clusters A, B ∈ {Tf }, the interval [A, B] ⊂ {Tf } is defined as a set clusters that contain A and are contained in B, i.e. [A, B] := {C ∈ {Tf } : A ⊂ C ⊂ B} , The equivalence relation ∼ is defined as A ∼ B if and only if their inclusion relationship with respect to clusters outside [A, B] and [B, A], i.e. A ∼ B if and only if for all C ∈ {Tf } such that C ∈ / [A, B] ∪ [B, A], C ⊂ A iff C ⊂ B and A ⊂ C iff B ⊂ C. Then it is easy to see that the relation ∼ is reflexive(A ∼ A), symmetric(A ∼ B implies B ∼ A), and transitive (A ∼ B and B ∼ C implies A ∼ C). Hence the relation ∼ is indeed an equivalence relation, and we can consider the set of equivalence classes {Tf }/∼ . We define the edge set E(Tf ) as E(Tf ) := {Tf }/∼ . For later use, we define the partial order on the edge set E(Tf )) as follows: [C1 ] ≤ [C2 ] if and only if for all A ∈ [C1 ] and B ∈ [C2 ], A ⊂ B. We say that a tree Tf is finite if its edge E(Tf ) is a finite set. 10 B The Partial Order As discussed in Section 2, to see that the partial order  in Definition 4 is indeed a partial order, we need to check the reflexivity, the transitivity, and the antisymmetry. The reflexivity and the transitivity are easier to check, but to show antisymmetric, we need to show that if two trees Tf and Tg satisfies Tf  Tg and Tg  Tf , then Tf and Tg are equivalent in some sense. And we give the equivalence relation as the topology on the cluster tree defined in Appendix A. The argument is formally stated in Lemma 5. The proof is done later in Appendix E. Lemma 5. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. Then if f, g are continuous and Tf , Tg are finite, Tf  Tg and Tg  Tf implies that there exists a homeomorphism Φ : {Tf } → {Tg } that preserves the root, i.e. Φ(X ) = X . Conversely, if there exists a homeomorphism Φ : {Tf } → {Tg } that preserves the root, Tf  Tg and Tg  Tf hold. The partial order  in Definition 4 gives a formal definition of simplicity of trees, and it is used to justify pruning schemes in Section 4.2. Hence it is important to match the partial order  with the intuitive notions of the complexity of the tree. We provided three arguments in Section 2: (1) if Tf  Tg holds then it must be the case that (number of edges of Tf ) ≤ (number of edges of Tg ), (2) if Tg can be obtained from Tf by adding edges, then Tf  Tg holds, and (3) the existence of a topology preserving embedding from {Tf } to {Tg } implies the relationship Tf  Tg . We formally state each item in Lemma 6, 7, and 8. Proofs of these lemmas are done later in Appendix E. Lemma 6. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. Suppose Tf  Tg via Φ : {Tf } → {Tg }. Define Φ̄ : E(Tf ) → E(Tg ) by for [C] ∈ E(Tf ) choosing any C ∈ [C] and defining as Φ̄([C]) = [Φ(C)]. Then Φ̄ is injective, and as a consequence, |E(Tf )| ≤ |E(Tg )|. Lemma 7. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. If Tg can be obtained from Tf by adding edges, then Tf  Tg holds. Lemma 8. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. If there exists a one-to-one map Φ : {Tf } → {Tg } that is a homeomorphism between {Tf } and Φ({Tf }) and preserves the root, i.e. Φ(X ) = X , then Tf  Tg holds. C Hadamard Differentiability Definition 6 (see page 281 of [24]). Let D and E be normed spaces and let φ : Dφ → E be a map defined on a subset Dφ ⊂ D. Then φ is Hadamard differentiable at θ if there exists a continuous, linear map φ0θ : D → E such that φ(θ + tqt ) − φ(θ) − φ0θ (h) t →0 E as t → 0, for every qt → q. Hadamard differentiability is a key property for bootstrap inference since it is a sufficient condition for the delta method; for more details, see section 3.1 of [24]. Recall that dMM is based on the function dTp (x, y) = p(x) + p(y) − 2mp (x, y). The following theorem shows that the function dTp is not Hadamard differentiable for some pairs (x, y). In our case D is the set of continuous functions on the sample space, E is the real line, θ = p, φ(p) is dTp (x, y) and the norm on E is the usual Euclidean norm. Theorem 9. Let B(x) be the smallest set B ∈ Tp such that x ∈ B. dTp (x, y) is not Hadamard differentiable for x 6= y when one of the following two scenarios occurs: (i) min{p(x), p(y)} = p(c) for some critical point c. (ii) B(x) = B(y) and p(x) = p(y). The merge distortion metric dM is also not Hadamard differentiable. 11 D Confidence Sets Constructions D.1 Regularity conditions on the kernel To apply the results in [8] which imply that the bootstrap confidence set is consistent, we consider the following two assumptions. (K1) The kernel function K has the bounded second derivative and is symmetric, non-negative, and Z Z x2 K(x)dx < ∞, K(x)2 dx < ∞. (K2) The kernel function K satisfies     x−y : x ∈ Rd , h > 0 . K = y 7→ K h (2) We require that K satisfies supN K, L2 (P ), kF kL2 (P ) P   v A ≤  (3) for some positive numbers A and v, where N (T, d, ) denotes the -covering number of the metric space (T, d), F is the envelope function of K, and the supremum is taken over the whole RdR. The A and v are usually called the VC characteristics of K. The norm kF k2L2 (P ) = |F (x)|2 dP (x). Assumption (K1) is to ensure that the variance of the KDE is bounded and ph has the bounded second derivative. This assumption is very common in statistical literature, see e.g. [22, 19]. Assumption (K2) is to regularize the complexity of the kernel function so that the supremum norm for kernel functions and their derivatives can be bounded in probability. A similar assumption appears in [11] and [14]. The Gaussian kernel and most compactly supported kernels satisfy both assumptions. D.2 Pruning The goal of this section is to formally define the pruning scheme in Section 4.2. Note that when pruning leaves and internal branches, when the cumulative length is computed for each leaf and internal branch, then the pruning process can be done at once. We provide two pruning schemes in Section 4.2 in a unifying framework by defining an appropriate notion of lifetime for each edge, and deleting all insignificant edges with small lifetimes. To follow the pruning schemes in Section 4.2, we require that the lifetime of a child edge is shorter than the lifetime of a parent edge, so that we can delete edges from the top. We evaluate the lifetime of each edge by an appropriate nonnegative (possibly infinite) function life. We formally define the pruned tree P runedlife,btα (Tbh ) as follows: Definition 7. Suppose the function life : E(Tbh ) → [0, +∞] satisfies that [C1 ] ≤ [C2 ] =⇒ life([C1 ]) ⊂ life([C2 ]). We define the pruned tree P runedlife,btα (Tbh ) : R → 2X as n o P runedlife,btα (Tbh )(λ) = C ∈ Tbh (λ − b tα ) : life([C]) > b tα . We suggest two life functions corresponding to two pruning schemes in Section 4.2. We first need several definitions. For any [C] ∈ E(Tbh ), define its level as n o level([C]) := λ : there exists A ∈ [C] ∩ Tbh (λ) , and define its cumulative level as n o cumlevel([C]) := λ : there exists A ∈ Tbh (λ), B ∈ [C] such that A ⊂ B . Then lifeleaf corresponds to first pruning scheme in Section 4.2, which is to prune out only insignificant leaves.  sup{level([C])} − inf{level([C])} if inf{level([C])} = 6 inf {cumlevel([C])} lifeleaf ([C]) = . +∞ otherwise. 12 And lifetop corresponds to second pruning scheme in Section 4.2, which is to prune out insignificant edges from the top. lifetop ([C]) = sup{cumlevel([C])} − inf {cumlevel([C])} . Note that lifeleaf is lower bounded by lifetop . In fact, for any life function that is lower bounded bα that is simpler than by lifetop , the pruned tree P runedlife,btα is a valid tree in the confidence set C the original estimate Tbh , so that the pruned tree is the desired tree as discussed in Section 4.2. We formally state as follows. The proof is given in Appendix G Lemma 10. Suppose that the life function satisfies: for all [C] ∈ E(Tbh ), lifetop ([C]) ≤ life([C]). Then (i) P runedlife,btα (Tbh )  Tpbh . (ii) there exists a function pe such that Tpe = P runedlife,btα (Tbh ). bα . (iii) pe in (ii) satisfies pe ∈ C Remark: It can be shown that complete pruning — simultaneously removing all leaves and branches with length less than 2b tα — can in general yield a tree that is outside the confidence set. For example, see Figure 3. If we do complete pruning to this tree, we will get the trivial tree. E E.1 Proofs for Appendix A and B Proof of Lemma 4 Lemma 4. Let f : X → [0, ∞) be a function, Tf be its cluster tree in Definition 1, and dTf be its tree distance function in Definition 5. Then dTf on X is a pseudometric and dTf on {Tf } is a metric. Proof. First, we show that dTf on X is a pseudometric. To do this, we need to show nonnegativity(dTf (x, y) ≥ 0), x = y implying dTf (x, y) = 0, symmetry(dTf (x, y) = dTf (y, x)), and subadditivity(dTf (x, y) + dTf (y, z) ≤ dTf (x, z)). For non-negativity, note that for all x, y ∈ X , mf (x, y) ≤ min {f (x), f (y)}, so dTf (x, y) = f (x) + f (y) − 2mf (x, y) ≥ 0. (4) For x = y implying dTf (x, y) = 0, x = y implies mf (x, y) = f (x) = f (y), so x = y =⇒ dTf (x, y) = 0. (5) For symmetry, since mf (x, y) = mf (y, x), dTf (x, y) = dTf (y, x). (6) For subadditivity, note first that mf (x, y) ≤ f (y) and mf (y, z) ≤ f (y) holds, so max {mf (x, y), mf (y, z)} ≤ f (y). (7) And also note that there exists Cxy , Cyz ∈ Tf (min {mf (x, y), mf (y, z)}) that satisfies x, y ∈ Cxy and y, z ⊂ Cyz . Then y ∈ Cxy ∩ Cyz 6= ∅, so x, z ∈ Cxy = Cyz . Then from definition of mf (x, z), this implies that min {mf (x, y), mf (y, z)} ≤ mf (x, z). (8) And by applying (7) and (8), dTf (x, y) + dTf (y, z) is upper bounded by dTf (x, z) as dTf (x, y) + dTf (y, z) = f (x) + f (y) − 2mf (x, y) + f (y) + f (z) − 2mf (y, z) = f (x) + f (z) − 2 (min {mf (x, y), mf (y, z)} + max {mf (x, y), mf (y, z)} − f (y)) ≥ f (x) + f (z) − 2mf (x, z) = dTf (x, z). 13 (9) Hence (4), (5), (6), and (9) implies that dTf on X is a pseudometric. Second, we show that dTf on {Tf } is a metric. To do this, we need to show nonnegativity(dTf (x, y) ≥ 0), identity of indiscernibles(x = y ⇐⇒ dTf (x, y) = 0), symmetry(dTf (x, y) = dTf (y, x)), and subadditivity(dTf (x, y) + dTf (y, z) ≤ dTf (x, z)). For nonnegativity, note that if C1 ∈ Tf (λ1 ) and C2 ∈ Tf (λ2 ), then mf (C1 , C2 ) ≤ min{λ1 , λ2 }, so dTf (C1 , C2 ) = λ1 + λ2 − 2mf (C1 , C2 ) ≥ 0. (10) For identity of indiscernibles, C1 = C2 implies mf (C1 , C2 ) = λ1 = λ2 , so C1 = C2 =⇒ dTf (C1 , C2 ) = 0. (11) And conversely, dTf (C1 , C2 ) = 0 implies λ1 = λ2 = mf (C1 , C2 ), so there exists C ∈ Tf (λ1 ) such that C1 ⊂ C and C2 ⊂ C. Then since C1 , C2 , C ∈ Tf (λ1 ), so C1 ∩ C 6= ∅ implies C1 = C and similarly C2 = C, so dTf (C1 , C2 ) = 0 =⇒ C1 = C2 . (12) Hence (11) and (12) implies identity of indiscernibles as C1 = C2 ⇐⇒ dTf (C1 , C2 ) = 0. (13) For symmetry, since mf (C1 , C2 ) = mf (C2 , C1 ), dTf (C1 , C2 ) = dTf (C2 , C1 ). (14) For subadditivity, note that mf (C1 , C2 ) ≤ λ2 and mf (C2 , C3 ) ≤ λ2 holds, so max {mf (C1 , C2 ), mf (C2 , C3 )} ≤ λ2 . (15) And also note that there exists C12 , C23 ∈ Tf (min {mf (C1 , C2 ), mf (C2 , C3 )}) that satisfies C1 , C2 ⊂ C12 and C2 , C3 ⊂ C23 . Then C2 ⊂ C12 ∩ C23 6= ∅, so C1 , C3 ∈ C12 = C23 . Then from definition of mf (C1 , C3 ), this implies that min {mf (C1 , C2 ), mf (C2 , C3 )} ≤ mf (C1 , C3 ). (16) And by applying (15) and (16), dTf (C1 , C2 ) + dTf (C2 , C3 ) is upper bounded by dTf (C1 , C3 ) as dTf (C1 , C2 ) + dTf (C2 , C3 ) = λ1 + λ2 − 2mf (C1 , C2 ) + λ2 + λ3 − 2mf (C2 , C3 ) = λ1 + λ3 − 2 (min {mf (C1 , C2 ), mf (C2 , C3 )} + max {mf (C1 , C2 ), mf (C2 , C3 )} − λ2 ) ≥ λ1 + λ3 − 2mf (C1 , C3 ) = dTf (C1 , C3 ). (17) Hence (10), (13), (14), and (17) dTf on {Tf } is a metric.  E.2 Proof of Lemma 5 Lemma 5. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. Then if f, g are continuous and Tf , Tg are finite, Tf  Tg and Tg  Tf implies that there exists a homeomorphism Φ : {Tf } → {Tg } that preserves the root, i.e. Φ(X ) = X . Conversely, if there exists a homeomorphism Φ : {Tf } → {Tg } that preserves the root, Tf  Tg and Tg  Tf hold. Proof. First, we show that Tf  Tg and Tg  Tf implies homeomorphism. Let Φ : {Tf } → {Tg } be the map that gives the partial order Tf  Tg in Definition 4. Then from Lemma 6, Φ̄ : E(Tf ) → E(Tg ) is injective and |E(Tf )| ≤ |E(Tg )|. With a similar argument, |E(Tg )| ≤ |E(Tf )| holds, so |E(Tf )| = |E(Tg )|. Since we assumed that Tf and Tg are finite, i.e. |E(Tf )| and |E(Tg )| are finite, Φ̄ becomes a bijection. Now, let [C1 ] and [C2 ] be adjacent edges in E(Tf ), and without loss of generality, assume C1 ⊂ C2 . We argue below that Φ̄([C1 ]) and Φ̄([C2 ]) are also adjacent edges. Then Φ(C1 ) ⊂ Φ(C2 ) holds from 14 Definition 4, and since Φ̄ is bijective, [Φ(C1 )] = Φ̄([C1 ]) and [Φ(C2 )] = Φ̄([C2 ]) holds. Suppose e3 ∈ {Tg } such that [C e3 ] ∈ e3 ⊂ Φ(C2 ). Then there exists C / {Φ̄([C1 ]), Φ̄([C2 ])} and Φ(C1 ) ⊂ C e e3 ⊂ Φ(C2 ) since Φ̄ is bijective, there exists C3 ∈ {Tf } such that [Φ(C3 )] = [C3 ]. Then Φ(C1 ) ⊂ C implies that C1 ⊂ C3 ⊂ C2 , and Φ̄ being a bijection implies that [C3 ] ∈ / {[C1 ], [C3 ]}. This is a e3 , and Φ̄([C1 ]) and contradiction since [C1 ] and [C2 ] are adjacent edges. Hence there is no such C Φ̄([C2 ]) are adjacent edges. Therefore, Φ̄ : E(Tf ) → E(Tg ) is a bijective map that sends adjacent edges to adjacent edges, and also sends root edge to root edge. Then combining Φ̄ : E(Tf ) → E(Tg ) being bijective sending adjacent edges to adjacent edges and root edge to root edge, and f, g being continuous, the map Φ̄ : E(Tf ) → E(Tg ) can be extended to a homeomorphism {Tg } → {Tf } that preserves the root. Second, the part that homeomorphism implies Tf  Tg and Tg  Tf follows by Lemma 8.  E.3 Proof of Lemma 6 Lemma 6. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. Suppose Tf  Tg via Φ : {Tf } → {Tg }. Define Φ̄ : E(Tf ) → E(Tg ) by for [C] ∈ E(Tf ) choosing any C ∈ [C] and defining as Φ̄([C]) = [Φ(C)]. Then Φ̄ is injective, and as a consequence, |E(Tf )| ≤ |E(Tg )|. Proof. We will first show that equivalence relation on {Tg } implies equivalence relation on {Tf }, i.e. Φ(C1 ) ∼ Φ(C2 ) =⇒ C1 ∼ C2 . (18) Suppose Φ(C1 ) ∼ Φ(C2 ) in {Tg }. Then from Definition 4 of Φ, for any C ∈ {Tf } such that C∈ / [C1 , C2 ] ∪ [C2 , C1 ], Φ(C) ∈ / [Φ(C1 ), Φ(C2 )] ∪ [Φ(C2 ), Φ(C1 )] holds. Then from definition of Φ(C1 ) ∼ Φ(C2 ), Φ(C) ⊂ Φ(C1 ) iff Φ(C) ⊂ Φ(C2 ) and Φ(C1 ) ⊂ Φ(C) iff Φ(C2 ) ⊂ Φ(C). Then again from Definition 4 of Φ, equivalence relation holds for C1 and C2 holds as well, i.e. C ⊂ C1 iff C ⊂ C2 and C1 ⊂ C iff C2 ⊂ C. Hence (18) is shown, and this implies that Φ̄([C1 ]) = Φ̄([C2 ]) =⇒ [Φ(C1 )] = [Φ(C2 )] =⇒ Φ(C1 ) ∼ Φ(C2 ) =⇒ C1 ∼ C2 =⇒ [C1 ] = [C2 ], so Φ̄ is injective.  E.4 Proof of Lemma 7 Lemma 7. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. If Tg can be obtained from Tf by adding edges, then Tf  Tg holds. Proof. Since Tg can be obtained from Tf by adding edges, there is a map Φ : Tf → Tg which preserves order, i.e. C1 ⊂ C2 if and only if Φ(C1 ) ⊂ Φ(C2 ). Hence Tf  Tg holds.  E.5 Proof of Lemma 8 Lemma 8. Let f, g : X → [0, ∞) be functions, and Tf , Tg be their cluster trees in Definition 1. If there exists a one-to-one map Φ : {Tf } → {Tg } that is a homeomorphism between {Tf } and Φ({Tf }) and preserves root, i.e. Φ(X ) = X , then Tf  Tg holds. Proof. For any C ∈ {Tf }, note that [C, X ] ⊂ {Tf } is homeomorphic to an interval, hence Φ([C, X ]) ⊂ {Tg } is also homeomorphic to an interval. Since {Tg } is topologically a tree, an interval in a tree with fixed boundary points is uniquely determined, i.e. Φ([C, X ]) = [Φ(C), Φ(X )] = [Φ(C), X ]. 15 (19) For showing Tf  Tg , we need to argue that for all C1 , C2 ∈ {Tf }, C1 ⊂ C2 holds if and only if Φ(C1 ) ⊂ Φ(C2 ). For only if direction, suppose C1 ⊂ C2 . Then C2 ∈ [C1 , X ], so Definition 4 and (19) implies Φ(C2 ) ⊂ Φ([C1 , X ]) = [Φ(C1 ), X ]. And this implies Φ(C1 ) ⊂ Φ(C2 ). (20) For if direction, suppose Φ(C1 ) ⊂ Φ(C2 ). Then since Φ−1 : Φ({Tf }) → {Tf } is also an homeomorphism with Φ−1 (X ) = X , hence by repeating above argument, we have C1 = Φ−1 (Φ(C1 )) ⊂ Φ−1 (Φ(C2 )) = C2 . (21) Hence (20) and (21) implies Tf  Tg .  F F.1 Proofs for Section 3 and Appendix C Proof of Lemma 1 and extreme cases Lemma 1. For any densities p and q, the following relationships hold: (i) When p and q are continuous, then d∞ (Tp , Tq ) = dM (Tp , Tq ). (ii) dMM (Tp , Tq ) ≤ 4d∞ (Tp , Tq ). (iii) dMM (Tp , Tq ) ≥ d∞ (Tp , Tq )−a, where a is defined as above. Additionally when µ(X ) = ∞, then dMM (Tp , Tq ) ≥ d∞ (Tp , Tq ). Proof. (i) First, we show dM (Tp , Tq ) ≤ d∞ (Tp , Tq ). Note that this part is implicitly shown in Eldridge et al. [12, Proof of Theorem 6]. For all  > 0 and for any x, y ∈ X , let C0 ∈ Tp (mp (x, y) − ) with x, y ∈ C0 . Then for all z ∈ C0 , q(z) is lower bounded as q(z) > p(z) − d∞ (Tp , Tq ) ≥ mp (x, y) −  − d∞ (Tp , Tq ), so C0 ⊂ q −1 (mp (x, y) −  − d∞ (Tp , Tq ), ∞) and C0 is connected, so x and y are in the same connected component of q −1 (mp (x, y) −  − d∞ (Tp , Tq ), ∞), which implies mq (x, y) ≤ mp (x, y) −  − d∞ (Tp , Tq ). (22) A similar argument holds for other direction as mp (x, y) ≤ mq (x, y) −  − d∞ (Tp , Tq ), (23) so (22) and (23) being held for all  > 0 implies |mp (x, y) − mq (x, y)| ≤ d∞ (Tp , Tq ). (24) And taking sup over all x, y ∈ X in (24) dM (Tp , Tq ) is upper bounded by d∞ (Tp , Tq ), i.e. dM (Tp , Tq ) ≤ d∞ (Tp , Tq ). (25) Second, we show dM (Tp , Tq ) ≥ d∞ (Tp , Tq ). For all  > 0, Let x be such that |p(x) − q(x)| > d∞ (Tp , Tq ) − 2 . Then since p and q are continuous, there exists δ > 0 such that       B(x, δ) ⊂ p−1 p(x) − , ∞ ∩ q −1 q(x) − , ∞ . 2 2  Then for any y ∈ B(x, δ), since B(x, δ) is connected, p(x) − 2 ≤ mp (x, y) ≤ p(x) holds and q(x) − 2 ≤ mq (x, y) ≤ q(x), so |mp (x, y) − mq (x, y)| ≥ |p(x) − q(x)| − > d∞ (Tp , Tq ) − . 16  2 Since this holds for any  > 0, dM (Tp , Tq ) is lower bounded by d∞ (Tp , Tq ), i.e. dM (Tp , Tq ) ≥ d∞ (Tp , Tq ). (26) (25) and (26) implies d∞ (Tp , Tq ) = dM (Tp , Tq ). (ii) We have already seen that for all x, y ∈ X , |mp (x, y) − mq (x, y)| ≤ d∞ (Tp , Tq ) in (24). Hence for all x, y ∈ X , |[p(x) + p(y) − 2mp (x, y)] − [q(x) + q(y) − 2mq (x, y)]| ≤ |p(x) − q(x)| + |p(y) − q(y)| + 2|mp (x, y) − mq (x, y)| ≤ 4d∞ (Tp , Tq ). Since this holds for all x, y ∈ X , so dMM (Tp , Tq ) ≤ 4d∞ (Tp , Tq ). (iii) For all  > 0, Let x be such that |p(x) − q(x)| > d∞ (Tp , Tq ) − 2 , and without loss of generality assume that p(x) > q(x). Let y be such that p(y) + q(y) < inf (p(x) + q(x)) + 2 . Then mp (x, y) ≤ x p(y) holds, and since X is connected, qinf ≤ mq (x, y) holds. Hence [p(x) + p(y) − 2mp (x, y)] − [q(x) + q(y) − 2mq (x, y)] ≥ [p(x) + p(y) − 2p(y)] − [q(x) + q(y) − 2qinf ] = p(x) − q(x) − (p(y) + q(y) − 2qinf )   > d∞ (Tp , Tq ) − inf (p(x) + q(x)) − 2qinf −  x ≥ d∞ (Tp , Tq ) − a − , where a = inf (p(x) + q(x)) − 2 min {pinf , qinf }. Since this holds for all  > 0, we have x∈X dMM (Tp , Tq ) ≥ d∞ (Tp , Tq ) − a.  Hence 0 ≤ dMM (Tp , Tq ) ≤ 4d∞ (Tp , Tq ) holds. And both extreme cases can happen, i.e. dMM (Tp , Tq ) = 4d∞ (Tp , Tq ) > 0 and dMM (Tp , Tq ) = 0, d∞ (Tp , Tq ) > 0 can happens. Lemma 11. There exists densities p, q for both dMM (Tp , Tq ) = 4d∞ (Tp , Tq ) > 0 and dMM (Tp , Tq ) = 0, d∞ (Tp , Tq ) > 0.     Proof. Let X = R, p(x) = I(x ∈ [0, 1]) and q(x) = 2I x ∈ 0, 14 + 2I x ∈ 34 , 1 . Then d∞ (Tp , Tq ) = 1. And with x = 18 and y = 78 , |[p(x) + p(y) − 2mp (x, y)] − [q(x) + q(y) − 2mq (x, y)]| = |[1 + 1 − 2] − [2 + 2 − 0]| = 4, hence dMM (Tp , Tq ) = 4d∞ (Tp , Tq ).  1   1  Let X = [0,1), p(x) = 2I x ∈ 0, and q(x) = 2I x ∈ 2 2 , 1 . Then d∞ (Tp , Tq ) = 2. And  1  1 for any x ∈ 0, 2 and y ∈ 2 , 1 , |[p(x) + p(y) − 2mp (x, y)] − [q(x) + q(y) − 2mq (x, y)]| = |(2 + 0 − 0) + (0 + 2 − 0)| = 0. 1   1   A similar case holds for x ∈ 2 , 1 and y ∈ 0, 2 . And for any x, y ∈ 0, 12 , |[p(x) + p(y) − 2mp (x, y)] − [q(x) + q(y) − 2mq (x, y)]| = |(2 + 2 − 4) + (0 + 0 − 0)| = 0. 1  and a similar case holds for x, y ∈ 2 , 1 . Hence dMM (Tp , Tq ) = 0.  17 y0 c x0 Figure 6: The example used in the proof of Theorem 9. F.2 Proof of Theorem 9 Theorem 9. Let B(x) be the smallest set B ∈ Tp such that x ∈ B. dTp (x, y) is not Hadamard differentiable for x 6= y when one of the following two scenarios occurs: (i) min{p(x), p(y)} = p(c) for some critical point c. (ii) B(x) = B(y) and p(x) = p(y). Proof. For x, y ∈ K, note that the merge height satisfies mp (x, y) = min{t : (x, y) are in the same connected component of L(t)}. Recall that dTp (x, y) = p(x) + p(y) − 2mp (x, y). Note that the modified merge distortion metric is dMM (p, q) = supx,y |dTp (x, y) − dTq (x, y)|. A feature of the merge height is that mp (x, y) = p(x) ⇒ B(y) ⊂ B(x) mp (x, y) = p(y) ⇒ B(x) ⊂ B(y) mp (x, y) 6= p(y) or p(x) ⇒ ∃c(x, y) ∈ C s.t. mp (x, y) = p(c(x, y)). where C is the collection of all critical points. Thus, we have  p(x) − p(y) dTp (x, y) = p(y) − p(x)  p(x) + p(y) − 2p(c(x, y)) if B(y) ⊂ B(x) if B(x) ⊂ B(y) . otherwise Case 1: We pick a pair of x0 , y0 as in Figure 6. Now we consider a smooth symmetric function g(x) > 0 such that it peaks at 0 and monotonically decay and has support [−δ, δ] for some small δ > 0. We pick δ small enough such that p (x0 ) = p(x0 ), p (y0 ) = p(y0 ). For simplicity, let g(0) = maxx g(x) = 1. Now consider perturbing p(x) along g(x − c) with amount . Namely, we define p (x) = p(x) +  · g(x − c). For notational convenience, define ξp, = dTp (x0 , y0 ). When || is sufficiently small, define ξp, (x0 , y0 ) = dTp (x0 , y0 ) if  > 0, ξp, (x0 , y0 ) = dTp (x0 , y0 ) − 2 if  < 0. This is because when  > 0, the p (c) > p(c), so the merge height for x0 , y0 using p is still the same as p(y0 ), which implies ξp, (x0 , y0 ) = dTp (x0 , y0 ). On the other hand, when  < 0, p (c) < p(c), so the merge height is no longer p(y0 ) but p (c). Then using the fact that || = p(c) − p (c) we obtain the result. 18 Now we show that dTp (x0 , y0 ) is not Hadamard differentiable. In this case, φ(p) = ξp (x0 , y0 ). First, we pick a sequence of n such that n → 0 and n > 0 if n is even and n < 0 if n is odd. Plugging t ≡ n and qt = g into the definition of Hadamard differentiability, we have φ0 (p) ≡ ξp,n (x0 , y0 ) − dTp (x0 , y0 ) n is alternating between 0 and 2, so it does not converge. This shows that the function dTp (x, y) at such a pair of (x0 , y0 ) is non-Hadamard differentiable. Case 2: The proof of this case uses the similar idea as the proof of case 1. We pick the pair (x0 , y0 ) satisfying the desire conditions. We consider the same function g but now we perturb p by p (x) = p(x) +  · g(x − x0 ), and as long as δ is small, we will have p (y0 ) = p(y0 ). Since B(x0 ) = B(y0 ) and p(x0 ) = p(y0 ), dTp (x0 , y0 ) = 0. When  > 0, ξp, (x0 , y0 ) = , and on the other hand, when  < 0, δ (x0 , y0 ) = −. In this case, again, φ(p) = ξp (x0 , y0 ). Now we use the similar trick as case 1: picking a sequence of n such that n → 0 and n > 0 if n is even and n < 0 if n is odd. Under this sequence of n , the ‘derivative’ along g ξp,n (x0 , y0 ) − dTp (x0 , y0 ) φ0 (p) ≡ n is alternating between 1 and −1, so it does not converge. Thus, dTp (x, y) at such a pair of (x0 , y0 ) is non-Hadamard differentiable.  G G.1 Proofs for Section 4 and Appendix D Proof of Lemma 2 Lemma 2. Let ph = E[b ph ] where pbh is the kernel estimator with bandwidth h. We assume that p is a Morse function supported on a compact set with finitely many, distinct, critical values. There exists h0 > 0 such that for all 0 < h < h0 , Tp and Tph have the same topology in Appendix A. Proof. Let S be the compact support of p. By the classical stability properties of the Morse function, there exists a constant C0 > 0 such that for any other smooth function q : S → R with kq − pk∞ , k∇q − ∇pk∞ , k∇2 q − ∇2 pk∞ < C0 , q is a Morse function. Moreover, there exist two diffeomorphisms h : R → R and φ : S → S such that q = h ◦ p ◦ φ See e.g., proof of [6, Lemma 16]. Further, h should be nondecreasing if C0 is small enough. Hence for any C ∈ Tp (λ), since q ◦ φ−1 (C) = h ◦ p(C), so φ−1 (C) is a connected component of Tq (h(λ)). Now define Φ : {Tp } → {Tq } as Φ(C) = φ−1 (C). Then since φ is a diffeomorphism, C1 ⊂ C2 if and only if Φ(C1 ) = φ−1 (C1 ) ⊂ φ−1 (C2 ) = Φ(C2 ), hence Tp  Tq holds. And from p ◦ φ = h−1 ◦ q, we can similarly show Tq  Tp as well. Hence from Lemma 5, two trees Tp and Tq are topologically equivalent according to the topology in Appendix A. Now by the nonparametric theory (see e.g. page 144-145 of [19], and [22]), qthere is a constant 2 0 C1 > 0 such that kph − pk2,max ≤ C1 h when h < 1. Thus, when 0 ≤ h ≤ C C1 , Th = Tph and T = Tp have the same topology.  G.2 Proof of Lemma 10 Lemma 10. Suppose that the life function satisfies: for all [C] ∈ E(Tbh ), lifetop ([C]) ≤ life([C]). Then (i) P runedlife,btα (Tbh )  Tpbh . (ii) there exists a function pe such that Tpe = P runedlife,btα (Tbh ). bα . (iii) pe in (ii) satisfies pe ∈ C 19 Proof. (i) This is implied by Lemma 7. (ii) Note that P runedlife,btα (Tbh ) is generated by function pe defined as n o pe(x) = sup λ : there exists C ∈ Tbh (λ) such that x ∈ C and life([C]) > 2b tα + b tα . (iii) Let C0 := S {C : life([C]) ≤ 2b tα }. Then note that n o pb(x) = sup λ : there exists C ∈ Tbh (λ) such that x ∈ C , so for all x, pe(x) ≤ pb(x) + b tα , and if x ∈ / C0 , pe(x) = pb(x) + b tα . Then note that n o λ : there exists C ∈ Tbh (λ) such that x ∈ C n o \ λ : there exists C ∈ Tbh (λ) such that x ∈ C and life([C]) > 2b tα n o ⊂ λ : there exists C ∈ Tbh (λ) such that x ∈ C and life([C]) ≤ 2b tα  Let ex := max e : x ∈ ∪e, life(e) ≤ 2b tα . Then note that x ∈ C and life([C]) ≤ 2b tα implies that we can find some B ∈ ex such that C ⊂ B, so n o λ : there exists C ∈ Tbh (λ) such that x ∈ C and life([C]) ≤ 2b tα ⊂ cumlevel(ex ). Hence pb(x) + b tα − pe(x) ≤ sup{cumlevel(ex )} − inf {cumlevel(ex )} = lifetop (ex ) ≤ life(ex ) ≤ 2b tα , and hence pb(x) − b tα ≤ pe(x) ≤ pb(x) + b tα .  20
10math.ST
Comments on: “Lyapunov matrices for a class of time delay systems” by V. L. Kharitonov Murad Abu-Khalaf MIT CSAIL, MIT, Cambridge, MA Suat Gumussoy IEEE Member [email protected] [email protected] February 19, 2018 Abstract We prove that an auxiliary two-point boundary value problem presented in V. L. Kharitonov, Lyapunov matrices for a class of time delay systems, Systems & Control Letters 55 (2006) 610-617 has linearly dependent boundary conditions, and consequently a unique solution does not exist. Therefore, the twopoint boundary value problem presented therein fails to be a basis for constructing Lyapunov matrices for the class of time delay systems investigated. 1 Introduction In [1], the author considers a stable linear time-delay system of the form 0 x(= t ) A0 x(t ) + A1 x(t − h) + ∫ G(θ )x(t + θ )dθ , t ≥0 (1) −h and is interested in ∞ U(τ )  ∫ ΦT (t )W Φ(t + τ )dt , 0 ∀τ ∈  (2) where Φ(t ) is the fundamental matrix and U(⋅) is well-defined and is referred to as a Lyapunov matrix. It was shown in both [1] and [2], and references therein, that U(⋅) is characterized by a dynamic, a symmetric, and an algebraic property 0 U (τ=) U(τ )A0 + U(τ − h)A1 + ∫ U(τ + θ )G(θ )dθ , τ ≥0 −h U(−τ ) = U(τ )T (3) 0 0 −h −h W U(0)A0 + U(−h)A1 + ∫ U(θ )G(θ )dθ + A0T U(0) + A1T U(h) + ∫ G(θ )T U(−θ )dθ −= Note that x(t ) is an n ×1 vector function of time; G(⋅) and U(⋅) are n × n function matrices; A0 , A1 , and W = W T are n × n constant matrices; and h a nonnegative scalar. To solve for U(⋅) , [1] proposed solving for (3) indirectly by first solving for an auxiliary two-point boundary value problem and use the solution of this auxiliary system to construct a solution to (3). The following concrete example was provided in Section 4 of [1] 0 x= (t ) A0 x(t ) + A1 x(t − 1) + ∫ G(θ )x(t + θ )dθ −1 where 0.3  −1 0   0 1 0.3 0   0 A0  = , A1 = , B0  = , B1  =      0 −1  −1 0   0 0.3  −0.3 0  = G(θ ) sin(πθ )B0 + cos(πθ )B1 and [1] derived based on its methodology the following auxiliary two-point boundary value problem Z (τ ) = Z (τ )A0 + V (τ )A1 + X 0 (τ )B0 + X1 (τ )B1 V (τ ) = − A1T Z (τ ) − A0T V (τ ) − B0T X 0 (τ ) + B1T X1 (τ ) X 0 (τ ) = −π X1 (τ ) X 1 (τ ) = Z (τ ) + V (τ ) + π X 0 (τ ) (4) with boundary conditions W Z (0)A0 + A0T Z (0) + V (0)A1 + A1T V T (0) + X 0 (0)B0 + B0T X 0T (0) + X1 (0)B1 + B1T X1T (0) −= = 0 Z (0) − V (1) 0 X 0 (0) − X 0T (1) = (5) 0 X1 (0) + X1T (1) = Once Z (τ ) is computed, then U(τ ) can be constructed = U(τ ) Z (τ ), τ ≥0 = U(−τ ) Z (τ ), τ ≥0 T (6) The work [1], and similarly [2], does not examine existence and uniqueness of solutions conditions for the auxiliary two-point boundary value problem (4)-(5). Following our experience in not being able to reproduce the numerical results of this example of Section 4 of [1], we provide in what follows a proof showing that the boundary conditions of system (4)-(5) are in fact linearly dependent. Therefore, (4)-(5) does not yield a well-defined solution, and cannot generate a unique Z (τ ) that can be used to construct a unique U(τ ) . In particular, we show that the following set of boundary conditions is linearly dependent = 0 Z (0) − V (1) = 0 X 0 (0) − X 0T (1) (7) T 1 = 0 X1 (0) + X (1) 2 Linear Dependence of Boundary Conditions Rewriting the auxiliary two-point boundary value problem in Kronecker product form [3], equation (4) becomes H   T T A1 ⊗ In B0T ⊗ In B1T ⊗ In   z   z   A0 ⊗ In     T T T In ⊗ B1T   v   v  =  −In ⊗ A1 −In ⊗ A0 −In ⊗ B0  x 0   0 0 0 −π In ⊗ In   x0       In ⊗ In 0 π In ⊗ In  x1   In ⊗ In   x1  (8) where z = vec(Z ) , v = vec(V ) , x0 = vec( X 0 ) , and x1 = vec( X1 ) are n2 × 1 vectors; vec(A) generates a vector by stacking the columns A into a single column; In is an identity matrix of size n × n ; 0 is a n2 × n2 matrix of zeros. Note the following properties follow from [3] = = (A), T T T vec(AT ) Tvec =) (C T ⊗ A)vec(B) vec(ABC T (A ⊗ C T )Tvec(B) = T (A ⊗ C T )vec(BT ) = Tvec(C T BT AT ) = vec(ABC ) = (C T ⊗ A)vec(B) Moreover, equation (7) becomes 0    =   0  In ⊗ In  0   0 0 0 0 In ⊗ In 0 0  z(0)  0   0 −In ⊗ In v (0)   + 0 0  0  x0 (0)  In ⊗ In   0  0  x1 (0)   z(1)  0  v(1)  −T 0    x (1) 0 T   0   x1 (1)  0 (9) Evaluating the following at τ = 1 and plugging in (9)  z(τ )   v(τ )    = eHτ  x0 (τ )    x1 (τ )   z(0)   v(0)     x0 (0)    x1 (0)  (10) results in 0  =    0   In ⊗ In   0  0  0 0 0 In ⊗ In 0 0 0  0 −In ⊗ In 0  + 0 0 In ⊗ In  0 0 0 0 −T 0  eHτ 0 T   z(0)      v(0)      x0 (0)  x (0)  1  (11) which has 3n2 rows. Clearly if the rank of the row space of (11) is less than 3n2 , then the rows are linearly = 0 Z (1)T − V (0) – dependent. Without loss of generality, we add to (9) an additional boundary condition one we initially guess to be in the row space of (9) – and investigate instead the squared matrix 0      0  In ⊗ In  0   0   0 0 In ⊗ In 0 0 0 0 In ⊗ In 0 0   z(0)   0 0   v(0)  T − 0   x0 (0)  0    In ⊗ In   x1 (0)   0 which after evaluating (10) at τ = 1 and plugging in (12) we get T 0 0 0 0   z(1)  0   v(1)  0 T 0   x0 (1)   0 0 −T   x1 (1)  (12) 0    =   0  I J         In ⊗ In 0 0 0   0 T 0 0    z(0)    0 0  T 0 0 0  H   v(0)  In ⊗ In  0 e −  0 0 0   0 0 T 0    x0 (0) In ⊗ In       0 0 In ⊗ In   0 0 0 −T    x1 (0)   0     (13)  z(0)  0   v(0)    H     = (I − Je )  x (0) 0 0    x  1 (0)  (14) T Note that from T = T T , it follows that J = J T and that=I JJ= J T J . Moreover, system (13) has 4n2 rows. If the rank of (13) is less than 3n2 , then this implies at least n2 + 1 rows of (13), and similarly (12), can be eliminated. This implies that (11), and similarly (9), must be linearly dependent. This is further investigated in the subsequent Theorem 1 and Corollary 1 which are influenced by an analysis appearing in [4]. Lemma 1: J T HJ = −H , where H is given by (8) and J by (13). Proof: 0 T JT HJ =  0  0 T 0 0 0 0 0 0 0 0   A0T ⊗ In  T   −In ⊗ A1  T 0  0 −T   In ⊗ In A1T ⊗ In −In ⊗ A0T 0 B0T ⊗ In −In ⊗ B0T 0 In ⊗ In π In ⊗ In B1T ⊗ In   0  In ⊗ B1T  T −π In ⊗ In   0  0   0  −T (In ⊗ A1T ) −T (In ⊗ A0T ) −T (In ⊗ B0T ) T (In ⊗ B1T )  0   T (A0T ⊗ In ) T (A1T ⊗ In ) T (B0T ⊗ In ) T (B1T ⊗ In ) T =  0 0 0 −π T   0   0 −T −T −π T    0 T 0 0 0 T 0 0 0 0 0 0 0 0     T  0 −T  0 0 0 0  T 0  0 −T   −T (In ⊗ A0T )T −T (In ⊗ A1T )T −T (In ⊗ B0T )T −T (In ⊗ B1T )T    T (A1T ⊗ In )T T (A0T ⊗ In )T T (B0T ⊗ In )T −T (B1T ⊗ In )T   =   0 0 0 π TT   0 −TT −TT −π TT    − A0T ⊗ In − A1T ⊗ In −B0T ⊗ In −B1T ⊗ In    In ⊗ A1T In ⊗ A0T In ⊗ B0T −In ⊗ B1T   =  0 0 0 π TT    −TT −π TT 0  −TT  (15) = −H 2n2 . Theorem 1: Dimension of the nullspace of I − JeH in (14) is 2n2 , i.e. dim Null(I − JeH ) = ∎ Proof: Let λi be an eigenvalue of H with algebraic multiplicity mi – geometric multiplicity is µi with µi ≤ mi and represents the dimension of associated eigenspace – whose Jordan block form is Σ i ∈ m ×m i i 2 and its corresponding generalized eigenvectors Vi ∈ 4 n ×mi . If λi is an eigenvalue, then so is −λi HVi = Vi Σ i T J HJJ T= Vi J T Vi Σ i (16) −HJ T Vi =J T V Σ i H(= J T Vi ) ( J T Vi )(−Σ i ) Thus, all the distinct eigenvalues of H are { ± λ1 , ± λ2 , , ± λs } where Re λi ≤ 0 and s ≤ 2n2 each repeated per its algebraic multiplicity. Let the Jordan form corresponding to { ± λ1 , ± λ2 , , ± λs } be 2 2 Σ  ∈  4 n ×4 n   −Σ   where  Σ1    2 n2 ×2 n2 = Σ   ∈  Σ s  2 corresponds to {λ1 , λ2 , , λs } and their respective generalized eigenvectors Vi ∈ 4 n ×mi forming 2 2 = V [V1 Vs ]∈  4 n ×2n Note that from (16) it follows that H V J T V  = V Σ 0  J T V     0 −Σ  By diagonalizing the exponential matrix – in Jordan Block Form – as follows eHτ = V  e Στ J T V    0 0   V e  −Στ J T V  −1 the state trajectories are written in terms of its eigenmotions  z(τ )   v(τ )    = V  x0 (τ )     x1 (τ )  Letting Στ e J T V    0 0   V e  −Στ  z(0)    −1 v (0)  J T V    x0 (0)    x1 (0)  (17)  c1  c   2  = V  c3      c4   z(0)    −1 v (0) T   J V   x0 (0)    x1 (0)  this simplifies to  z(τ )   v(τ )    = V  x0 (τ )     x1 (τ )  Στ e J T V    0  c1    0   c2   e −Στ   c3     c4  (18) To understand how arbitrary coefficients c1 , , c4 are, evaluate (18) at τ = 0 and plug in (14) to get 0    H    = (I − Je ) V 0   c1  c  T J V   2   c3     c4  (19) Evaluating (17) at τ = 1 and recalling that J = J T , we have 0    =   0    I − J V  e J T V   0 Σ 0   V e −Σ   −1  J T V   V    c1   e Σ 0    c2  T T =  V J V  − J V J V   −Σ      0 e    c3      c4   c  c   c  c  =V   1  − e −Σ  3   + J T V  3  − JVe Σ  1  c2   c4    c4   c2  = V Since V   c1  −Σ  c3     − e   c2   c4   T J V    c  c     3  − eΣ  1   c2    c4  J T V  is linearly independent, it follows that  c3  Σ  c1  c  = e c   4  2 This implies that  c1  c  T J V   2   c3     c4   z(0)   v(0)    = V  x0 (0)     x1 (0)   c1  c  T J V   2   c3     c4  I 2 2   c  J T V   2 n ×Σ2n   1   e  c2  = V (20) and that c1 and c2 are arbitrary thus  dim Range  V   I  J T V   Σ   = 2n2 e   Plugging (20) into (14), it can be verified that (I − JeH ) V  I  c   I  c  V J T V   Σ   1  − J V J T V   Σ   1  = e  c2  e  c2  = V = V e Σ 0   I   c1  J T V    −Σ   Σ    0 e  e  c2  eΣ   c  J T V     1   I  c2   I  c  J T V   Σ   1  − J V e  c2   I  c   I  c  J T V   Σ   1  − V J T V   Σ   1  e  c2  e  c2  (21) 0  =    0  Since (20) spans a subspace of the nullspace of I − JeH , Null(I − JeH ) , this implies dim Null(I − JeH ) ≥ 2n2 . Equation (14) shows that 1 is an eigenvalue of JeH and thus dim Null(I − JeH ) equals the dimension of the generalized eigenspace associated with 1. Similarly, -1 is an eigenvalue of JeH by noting that (−I − Je ) V H 0   I   c1    J V   Σ    =    −e  c2  0    T and dim Null(−I − JeH ) equals the dimension of the generalized eigenspace associated with -1. Thus  dim Range  V   I  J T V   Σ   = 2n2  −e   which spans a subspace of Null(−I − JeH ) . This implies dim Null(−I − JeH ) ≥ 2n2 . Since the dimensions of the generalized eigenspaces of JeH is 4n2 , it follows that dim Null(I − JeH ) + dim Null(−I − JeH ) ≤ 4n2 dim Null(I − JeH ) ≤ 4n2 − dim Null(−I − JeH ) ≤ 2n2 2n2 . Both dim Null(I − JeH ) ≥ 2n2 and dim Null(I − JeH ) ≤ 2n2 imply that dim Null(I − JeH ) = ∎ Corollary 1: The null space of the subsystem (11) has a dimension of at least n2 , thus the subsystem (9) is linear dependent. 2n2 from Theorem 1, and given that (11) is a 3n2 -equations subsystem of Proof: Since dim Null(I − JeH ) = the 4n2 -equations system (13), then dimension of the null space of the subsystem (11) is at most 2n2 , and at least n2 . This implies at least n2 + 1 rows of (11), and similarly of (9), can be eliminated and thus implies that (9) is linearly dependent. 3 Conclusion ∎ In [5], we propose an alternative structure for an auxiliary two-point boundary value problem whose solution is well-defined, and provide a necessary and sufficient condition for the existence and uniqueness of solutions. References [1] [2] [3] [4] [5] V. L. Kharitonov, "Lyapunov matrices for a class of time delay systems," Systems & Control Letters, vol. 55, no. 7, pp. 610–617, Jul. 2006. V. L. Kharitonov, Time-delay systems: Lyapunov Functionals and Matrices. New York: Birkhäuser, 2013. J. Brewer, "Kronecker Products and Matrix Calculus In System Theory". IEEE Transactions on Circuits and Systems 25.9 (1978): 772-781. Young Soo Suh, Seiichi Shin, “Stability of State Delay Systems Based on Finite Characterization of a Lyapunov Functional”, Transactions of the Society of Instrument and Control Engineers, Volume 35, Issue 9, Pages 1170-1175, 1999. S. Gumussoy, M. Abu-Khalaf, “Analytic Solution of a Delay Differential Equation Arising in Cost Functionals for Systems with Distributed Delays”, 1st version reviewed by IEEE TAC, 2nd version to be submitted to IEEE TAC.
3cs.SY
Fast and Flexible Software Polar List Decoders Mathieu Léonardon∗† , Adrien Cassagne∗ , Camille Leroux∗ , Christophe Jégo∗ , Louis-Philippe Hamelin‡ and Yvon Savaria† arXiv:1710.08314v1 [cs.IT] 23 Oct 2017 ∗ IMS Laboratory, UMR CNRS 5218, Bordeaux INP, University of Bordeaux, Talence, France † École Polytechnique de Montréal, QC, Canada ‡ Huawei Technologies Canada Co. LTD, Ottawa, ON, Canada Abstract—Flexibility is one mandatory aspect of channel coding in modern wireless communication systems. Among other things, the channel decoder has to support several code lengths and code rates. This need for flexibility applies to polar codes that are considered for control channels in the future 5G standard. This paper presents a new generic and flexible implementation of a software Successive Cancellation List (SCL) decoder. A large set of parameters can be fine-tuned dynamically without recompiling the software source code: the code length, the code rate, the frozen bits set, the puncturing patterns, the cyclic redundancy check, the list size, the type of decoding algorithm, the tree-pruning strategy and the data quantization. This generic and flexible SCL decoder enables to explore tradeoffs between throughput, latency and decoding performance. Several optimizations are proposed to achieve a competitive decoding speed despite the constraints induced by the genericity and the flexibility. The resulting polar list decoder is about 4 times faster than a generic software decoder and only 2 times slower than a non-flexible unrolled decoder. Thanks to the flexibility of the decoder, the fully adaptive SCL algorithm can be easily implemented and achieves higher throughput than any other similar decoder in the literature (up to 425 Mb/s on a single processor core for N = 2048 and K = 1723 at 4.5 dB). Index Terms—Polar Codes, Adaptive Successive Cancellation List decoder, Software Implementation, 5G Standard, Generic Decoder, Flexible Decoder. I. I NTRODUCTION Polar codes [1] are the first provably capacity achieving channel codes, for an infinite code length. The decoding performance of the original Successive Cancellation (SC) decoding algorithm is however not satisfactory for short polar codes. The Successive Cancellation List (SCL) decoding algorithm has been proposed in [2] to counter this fact along with the concatenation of a Cyclic Redundancy Check (CRC). The decoding performance of SCL decoding is such that polar codes is included in the fifth generation (5G) mobile communications standard [3]. Cloud radio access network (Cloud-RAN) is foreseen by both academic [4], [5] and industrial [6], [7] actors as one of the key technologies of the 5G standard. In the Cloud-RAN the virtualization of the physical layer (PHY) would allow for deep cooperative multipoint processing and computational diversity [4]. PHY-layer cooperation enables interference mitigation, while computational diversity lets the network balance the computational load accross multiple users. But the virtualization of the FEC decoder is a challenge as it is one of the most computationally intensive tasks of the signal processing chain in a Cloud-RAN context [8], [9]. Therefore, efficient, flexible and parallel software implementations of FEC decoders are needed to enable some of the expected features of Cloud-RAN. To date, the fastest software implementations of SCL polar decoders have been proposed in [10]. The high decoding speed is achieved at the price of flexibility, because the software decoder is only dedicated to a specific polar code. In a wireless communication context, the source code of this fast software polar decoder would have to be recompiled every time the Modulation and Coding Scheme (MCS) changes, which may happen every millisecond. In this work, we propose a software SCL polar decoder able to switch between different channel coding contexts (block length, code rate, frozen bits sets, puncturing patterns and CRC code). This property is denoted as genericity. Moreover, the proposed decoder supports different list-based decoding algorithms, several list sizes (L), quantization formats and treepruning techniques during a real time execution. Again, this is done dynamically without having to recompile the software description. We denote this feature as flexibility. The genericity and the flexibility of the decoder are achieved without sacrificing the decoding throughput and latency thanks to several implementation optimizations. Actually, the proposed software SCL decoder is only 2 times slower than a polar code specific decoder [10] and 4 times faster than a generic decoder [11]. Unlike these fast decoders, the proposed decoder supports a fully adaptive version of SCL. It reaches 425 Mb/s on a single processor core for N = 2048 and K = 1723 at 4.5 dB. The genericity of our decoder makes it compliant with a wireless communication context: one can change the polar code parameters dynamically. Thanks to the decoder flexibility, some new tradeoffs between throughput and error rate performance are now possible. Finally, besides the genericity/flexibilitydriven improvements, some specific optimizations were implemented in order to match the state-of-the-art throughputs of software SCL decoders. Among other optimizations, a new sorting technique is applied to different parts of the algorithm which is faster than any other according to our experimentations. New methods to speed up the CRC processing are also applied. The polar functions library described in [12], [13] is used in order to benefit from a portable implementation of SIMD instructions. The rest of the paper is organized as follows: Section II describes the SCL decoding algorithm and the improved versions. The genericity and the flexibility of the proposed decoder are highlighted in Section III. Section IV details the Function f Layer Function g 16 (LLR, ŝ) is R = 1/2 contains 1024 informations bits. Such a code is denoted as (2048,1024). 0 Function h B. Polar Decoding Algorithms 1) SC decoding algorithm: The SC decoding process can be seen as the pre-order traversal of a binary tree as shown in Figure 1. The tree contains log2 N + 1 layers. Each layer contains 2d nodes, where d is the depth of the layer in the tree. Each node contains a set of 2n−d Log-Likelihood Ratios (LLRs) λ and partial sums ŝ. The partial sums correspond to the propagation towards the top of the tree of hard decisions made in the update paths() function. As shown in Figure 1, LLRs, which take real values, and partial sums, which take binary values, are the two types of data contained in the decoding tree, and three functions, f , g and h are necessary for updating the nodes:  = sign(λa .λb ). min(|λa |, |λb |)  f (λa , λb ) g(λa , λb , ŝa ) = (1 − 2ŝa )λa + λb  h(ŝa , ŝb ) = (ŝa ⊕ ŝb , ŝb ) 1 8 (LLR, ŝ) 2 4 (LLR, ŝ) 3 2 (LLR, ŝ) 4 1 (LLR, ŝ) Fig. 1. Full SC decoding tree (N = 16). speed-oriented optimizations. Finally, Section V provides the throughput and latency performance. II. P OLAR C ODES In this section, we first present the polar encoding process. Then the SC and SC-List based decoding algorithms are reviewed. Finally we discuss the tradeoffs between speed and decoding performance of different decoding algorithms. A. Polar Encoding Process In the polar encoding process, an information sequence b of length K is transformed into a codeword x of length N . The first step is to build a vector u in which the information bits b are mapped on a subset uA where A ⊂ {0, ..., N − 1}. The remaining bits uAc = (ai : i 6∈ A) called frozen bits 1 are usually set to zero. The selection of the frozen bits is 2 critical for the effectiveness of the polar codes. Two of the 3 main techniques to date for constructing polar codes are based 4 on the Density Evolution approach [14] and on the Gaussian 5 Approximation [15]. These techniques sort the polar channels 6 according to their reliability in order to choose the frozen bits set for a given code length. Then, an intermediate vector u0 7 is generated thanks to an encoding matrix1 : u0 = uF ⊗n . 8 9 Finally the bits in the subset u0Ac are set to zero and the 10 0 ⊗n output codeword is x = u F . This encoding method is called systematic because the information sequence b is present in the codeword (xA = b). In this paper, systematic 11 encoding schemes are considered. A CRC of length c may be 12 concatenated to the information sequence b in order to improve 13 the decoding performance of SCL decoding algorithms. In this 14 case, |A| = K + c and the CRC is included in uA . In this paper, the code rate is defined as R = K/N and the c bits of 15 16 the CRC are not considered as information bits. For instance, a polar code whose block length is N = 2048 and code rate 17 18   ⊗n−1  1 0 F 0n−1 and ∀n > 1, F ⊗n = , where ⊗n−1 ⊗n−1 1 1 F F n = log2 (N ), N is the codeword length, and 0n is a 2n -by-2n matrix of zeros. 1 F ⊗1 In comparison with the SCL algorithm and its derivatives, the computational complexity of the SC algorithm is low: O(N log2 N ). Therefore, both software [16] and hardware [17] implementations achieve multi-Gb/s throughputs with low latencies. The drawback of the SC decoding algorithm is its decoding performance especially for short polar codes. This is an issue for the future 5G wireless standard in which polar codes are targeted for control channels, with code lengths shorter than 2048 [3]. Algorithm 1: SCL decoding algorithm Data: λ is a 2D buffer ([L][2N ]) to store the LLRs. Data: ŝ is a 2D buffer ([L][N ]) to store the bits. Function SCL decode (N, oλ , oŝ ) N 1 = N/2 2 if N > 1 then // not a leaf node for p = 0 to L − 1 do // loop over the paths for i = 0 to N 1 − 1 do // apply the f function 2 λ[p][oλ +N +i] = f (λ[p][oλ +i], λ[p][oλ +N 1 +i]) 2 SCL decode (N 1 , oλ + N, oŝ ) 2 for p = 0 to L − 1 do for i = 0 to N 1 − 1 do // apply the g function 2 λ[p][oλ + N + i] = g(λ[p][oλ + i], λ[p][oλ + N 1 + i], ŝ[p][oŝ + i]) 2 SCL decode (N 1 , oλ + N, oŝ + N 1 ) 2 2 for p = 0 to L − 1 do for i = 0 to N 1 − 1 do // update the partial sums 2 ŝ[p][oŝ + i] = h(ŝ[p][oŝ + i], ŝ[p][oŝ + N 1 + i]) 2 else // a leaf node update paths () // update, create and delete paths SCL decode (N, 0, 0) // launch the decoder select best path ()  = 2) SCL decoding algorithm: The SCL algorithm is summarized in Algorithm 1. Unlike the SC algorithm, the SCL de- coder builds a list of candidate codewords along the decoding. At each call of the update paths() sub-routine (Alg. 1, l.16), 2L candidates are generated. A path metric is then evaluated to keep only the L best candidates among the 2L paths. The path metrics are calculated as in [18]. At the end of the decoding process, the candidate codeword with the best path metric is selected in the select best path() sub-routine (Alg. 1, l.18). The decoding complexity of the SCL algorithm grows as O(LN log2 N ). This linear increase in complexity with L leads to significant improvements in BER/FER performances, especially for small code lengths. 3) Simplified SC and SCL decoding algorithms: All aforementioned polar decoding algorithms have in common that they can be seen as a pre-order tree traversal algorithm. In [19], a tree pruning technique called the Simplified SC (SSC) was applied to SC decoding. An improved version was proposed in [17]. This technique relies on the fact that, depending on the frozen bits location in the leaves of the tree, the definition of dedicated nodes enables to prune the decoding tree: Rate0 nodes (R0) correspond to a sub-tree whose all leaves are frozen bits, Rate-1 nodes (R1) correspond to a sub-tree in which all leaves are information bits, REPetition (REP) and Single Parity Check (SPC) nodes correspond to repetition and SPC codes sub-trees. These special nodes, originally defined for SC decoding, can be employed in the case of SCL decoding as long as some modifications are made in the path metric calculation [10]. This tree-pruned version of the algorithm is called Simplified SCL (SSCL). The tree pruning technique can drastically reduce the amount of computation in the decoding process. Moreover, it increases the available parallelism by replacing small nodes by larger ones. As will be discussed in Section III, the tree pruning may have a small impact on decoding performance. 4) CRC concatenation scheme: The authors in [2] observed that when a decoding error occurs, the right codeword is often in the final list, but not with the best path metric. They proposed to concatenate a CRC to the codeword in order to discriminate the candidate codewords at the final stage of the SCL decoding. Indeed, this technique drastically improves the FER performance of the decoder. We denote this algorithm CA-SCL and its simplified version CA-SSCL. In terms of computational complexity, the overhead consists in the computation of L CRC at the end of each decoding. 5) Adaptive SCL decoding algorithm: The presence of the CRC can be further used to reduce the decoding time by gradually increasing L. This variation of SCL is called Adaptive SCL (A-SCL) [20]. The first step of the A-SCL algorithm is to decode the received frame with the SC algorithm. Then, the decoded polar codeword is checked with a CRC. If the CRC is not valid, the SCL algorithm is applied with L = 2. If no candidate in the list satisfies the CRC, L is gradually doubled until it reaches the value Lmax . In this paper, we call this version of the A-SCL decoding the Fully Adaptive SCL (FASCL) as opposed to the Partially Adaptive SCL (PA-SCL), in which the L value is not gradually doubled but directly increased from 1 (SC) to Lmax . The simplified versions of TABLE I T HROUGHPUT AND LATENCY COMPARISON OF POLAR DECODING ALGORITHMS . Decoding Algorithm SC SSC SCL SSCL CA-SSCL PA-SSCL FA-SSCL BER & FER Performances poor poor good good very good very good very good Throughput (T ) medium high low low low high high Max. Latency (Lworst ) medium low high medium medium medium high these algorithms are denoted PA-SSCL and FA-SSCL. In order to simplify the algorithmic range, in the remainder of the paper, only the simplified versions are considered. The use of either FA-SSCL or PA-SSCL algorithmic improvement introduces no BER or FER performance degradation as long as the CRC length is adapted to the polar code length. If the CRC length is too short, the decoding performance may be degraded because of false detections. These adaptive versions of SSCL can achieve higher throughputs. Indeed, a large proportion of frames can be decoded with a single SC decoding. This is especially true when the SNR is high. This will be further discussed in Section III. C. Algorithmic Comparison In order to better distinguish all the algorithmic variations, we compare their main features in Table I. Each algorithm is characterized in terms of decoding performance, throughput, and worst case latency for a software implementation. The non-simplified versions of the adaptive SCL algorithms are not included in the Table for readability. The SC and especially the SSC algorithms achieve very high throughput and low latency with poor BER and FER performances. The SCL algorithm improves the decoding performance compared to the SC algorithm, but its computational complexity leads to an increased latency and a lower throughput. The SSCL algorithm improves the decoding throughput and latency without any impact in terms of BER and FER performances, as long as the tree pruning is not too deep, as will be discussed in Section III. Therefore, tree pruning is applied to all the following algorithms, namely CA-SSCL, FASSCL and PA-SSCL. By applying CRC to the SCL algorithm, one can achieve better BER and FER performances at the cost of computational complexity overhead. The Adaptive SCL algorithms reduce the decoding time with no impact on BER and FER performances. Furthermore, a tradeoff between throughput and worst case latency is possible with the use of either PA-SSCL or FA-SSCL decoding algorithms. To the best of our knowledge, SC and CA-SCL decoding performances have never been investigated in the literature for large code lengths (N > 214 ). This is probably due to the long simulation durations. In this work the AFF3CT2 tool enables multi-threaded and multi-nodes simulations. All the presented 2 AFF3CT is an Open-source software (MIT license) for fast forward error correction simulations, see http://aff3ct.github.io 10−4 flexibility of a decoder includes all the customizations that can be applied to the decoding algorithm for a given polar code: variant of the decoding algorithm, data representation format, list size L, tree pruning strategy, ... These customizations are not enforced by a standard. The flexibility gives some degrees of freedom to the decoder in order to find the best tradeoff between decoding performance, throughput or latency for a given polar code. 10−5 A. Genericity 100 N 10−1 212 FER 10 SC 28 216 10−2 10 SCL32 220 N SCL128 −3 220 −6 0.5 1 1.5 2 2.5 Eb /N0 (dB) 3 3.5 4 4.5 Fig. 2. Decoding performance comparison between CA-SCL and SC decoders. Code rate R = 1/2, and 32-bit CRC (GZip). simulations use the Monte Carlo method with a Binary PhaseShift Keying (BPSK) modulation. The communication channel is an Additive White Gaussian Noise (AWGN) channel based on the Mersenne Twister pseudo-random number generator (MT19937) [21] and the Box-Muller transform [22]. Figure 2 compares the BER/FER performances of CA-SCL with SC decoding for a large range of code lengths. As expected, it appears that the coding gain brought by the SCL algorithm decreases for larger N values. In the case of N = 216 , the improvement caused by the use of the CA-SCL algorithm with L = 32 and a 32-bit GZip CRC (0x04C11DB7 polynomial) instead of SC is about 0.75 dB compared to 1.2 dB with a polar code of size N = 212 . For larger polar codes, N = 220 , the gain is reduced to 0.5 dB, even with a list depth of 128 that is very costly in terms of computational complexity. The tradeoffs between speed and decoding performance show some general trends. However, the efficiency of each decoding algorithm is strongly dependent on the polar code length, code rate, list depth and code construction. It is expected that the best tradeoff is not always obtained with a single algorithm and parameter set combination. It is consequently highly relevant to use a generic and flexible decoder, that supports all variants of the decoding algorithms. Thus, it is possible to switch from one to another as shown in the following section. III. G ENERIC AND F LEXIBLE P OLAR D ECODER The main contribution of this work lies in the flexibility and the genericity of the proposed software decoder. These terms need to be clearly defined in order to circumvent possible ambiguity. In the remainder of the paper, the genericity of the decoder concerns all the parameters that define the supported polar code such as the codeword length, the code rate, the frozen bits set, the puncturing patterns and the concatenated CRC. These parameters are imposed by the telecommunication standard or the communication context. In the wireless communications context, these are constantly adapted by AMC methods [23]. In this work, a decoder is considered generic if it is able to support any combination of these parameters that can be changed during a real time execution. On the other hand, the In the context of wireless communications, the standards enforce several different code lengths N that have to be supported to share bandwidth between different users. This is also the case for the code rate R that needs to be adapted to the quality of the transmission channel. Therefore, a practical implementation should be adapted to both N and R in realtime in order to limit latency. A polar code is completely defined by N and the frozen bits set uAc . Several methods exist to generate some ”good” sets of frozen bits [14], [15]. The code rate R depends on the size of uAc . In their original form, polar code lengths are only powers of two. The puncturing and shortening techniques in [24]–[26] enable to construct polar codes of any length at the cost of slightly degraded decoding performance. The coding scheme can be completed with the specification of a CRC. In [10], the unrolling method is used: a specific description of the decoder has to be generated for a specific polar code parameter set of N , K, R, frozen bits set, puncturing pattern, CRC. This approach leads to very fast software decoders at the price of the genericity, since a new source code should be generated and compiled every time the modulation and coding scheme (MCS) changes. This method is not adapted to wireless communication standards, in which these parameters have to be adapted not only over time, but also for the different users. The proposed decoder does not use the unrolling method and is completely generic regarding the code dimension K, the code length N , the frozen bits set uAc and the puncturing patterns. All of them are dynamic parameters of the decoder and can be defined in input files. All CRC listed in [27] are available along with the possibility to define others. It is shown in [28] that custom CRCs for polar codes can have a very good impact on the decoding performance. Relying on an unique software description also implies that the tree pruning technique also has to be dynamically defined. Indeed, this technique depends on the frozen bits set uAc . Not sacrificing throughput or latency while maintaining the genericity imposed by wireless communication standards is at the core of the proposed implementation. Flexibility in terms of decoding algorithms, described in the following, along with improvements presented in Section IV, is necessary to deal with this challenge. B. Flexibility On one hand, the reason for the decoder genericity is the compliance to the telecommunication standards. On the other L 1 2 4 8 16 32 64 128 10−1 FER 10−2 10−3 10−4 7 Ti (Mb/s) ref 215.15 26.67 12.54 6.00 2.96 1.40 0.66 0.29 R0 R1 REP SPC4 SPC4+ 6 Coded throughput (Mb/s) 100 10−5 5 4 3 2 10−6 1 1 1.5 2 3 3.5 0 10 9/ 10 10 8/ 7/ 10 10 10 10 6/ 5/ 4/ 3/ hand, the flexibility of the decoder regroups several algorithmic variations that are discussed in the following. These variations allow several tradeoffs of multiple sorts, whatever the standard. They are all included in a single source code. In the proposed decoders the following parameters can be changed dynamically without re-compilation: the list size L, the tree pruning strategy, the quantization of the LLRs and the different SCL variants. Each of these adjustments can be applied to access to different tradeoffs between throughput, latency, and error rate performance. As a consequence, one can easily fine-tune the configuration of the software decoder for any given polar code. 1) List size: As mentioned earlier, the list size L impacts both speed and decoding performance. In Figure 3, the throughput as well as BER and FER performances of the CA-SSCL algorithm are shown for different L values. A (2048,1024) polar code with a 32-bit CRC is considered. The computational complexity increases linearly with L: the throughput is approximately halved when L is doubled, except for the case of the SC algorithm (L = 1) which is much faster. Indeed, there is no overhead due to the management of different candidate paths during the decoding. For L ≥ 4 and Eb /N0 = 2, the FER is also approximately halved when the list size L is doubled. 2) Tree pruning strategy: A second degree of flexibility is the customization of the SCL tree pruning. The authors in [10], [19] defined dedicated nodes to prune the decoding tree and therefore to reduce the computational complexity. In this proposed decoder, each dedicated node can be activated separately. The ability to activate dedicated nodes at will is useful in order to explore the contribution of each node type on the throughput. Figure 4 shows the impact of the different tree pruning optimizations on the CA-SSCL decoder throughput depending on the code rate. The performance improvements are cumulative. Coded throughput, in which the redundant bits are taken in account, is shown instead of information throughput, for which only information bits are considered in order to illustrate the computational effort without the influence of the fact that higher rate codes involve higher 10 10 Fig. 3. Tradeoffs between CA-SSCL decoding and throughput performances depending on L. N = 2048, R = 0.5, and 32-bit CRC (GZip). For L = 1, the SSC decoder is used with a (2048,1024) polar code. 2/ 1/ 2.5 Eb /N0 (dB) Code rate (R = K/N ) Fig. 4. Dedicated nodes impact on CA-SSCL. N = 2048 and L = 32. information throughput. Without pruning, the coded throughput decreases as the code rate increases. Indeed, frozen bit leaf nodes are faster to process than information bit leaf nodes, in which a threshold detection is necessary. As there are more R0 and REP nodes in low code rates, the tree pruning is more efficient in the case of low code rates. The same explanation can be given for R1 nodes in high code rates. R1 node pruning is more efficient than R0 node pruning on average. Indeed, a higher amount of computations is saved in R1 nodes than in R0 nodes. It has also been observed in [10] that when the SPC node size is not limited to 4, the decoding performance may be degraded. Consequently the size is limited to 4 in SPC4. In SPC4+ nodes, there is no size limit. The two node types are considered in Figure 4. Therefore, the depth at which dedicated nodes are activated in the proposed decoder can be adjusted, in order to offer a tradeoff between throughput and decoding performance. According to our experiments, the aforementioned statement about performance degradation caused by SPC4+ nodes is not always accurate depending on the code and decoder parameters. The impact of switching on or off SPC4+ nodes on decoding performance and throughput at a FER of 10−5 is detailed in Table II. It shows that SPC4+ nodes have only a small effect on the decoding performance. With L = 8, TABLE II E FFECTS OF THE SPC4+ NODES ON THE CA-SSCL @ 10−5 FER L 8 32 R 1/3 1/2 2/3 1/3 1/2 2/3 N = 256 Eb /N0 Thr. loss gain % dB 0.15 09.7 0.09 08.6 0.03 20.5 0.52 11.8 0.30 10.3 0.27 22.6 N = 1024 Eb /N0 Thr. loss gain % dB 0.03 12.6 0.04 16.4 0.04 11.3 0.19 12.9 0.24 16.5 0.22 15.2 N = 4096 Eb /N0 Thr. loss gain % dB 0.02 09.5 0.07 20.2 0.09 14.3 0.22 12.5 0.26 19.9 0.25 17.1 512 10−2 10−3 10−3 10−6 10−5 10−6 REP2+ 16-bit REP2+ 8-bit REP2+ 8-bit REP8float −7 10 10−8 10−9 10−2 FER 10−5 3.5 4 Eb /N0 (dB) 10 (a): Impact of the REP node size on fixed-point SSCL decoding 3.5 4 Eb /N0 (dB) (b): Impact of the CRC size on SSCL and A-SSCL decoding 3) LLR Quantization: Another important parameter in both software and hardware implementations is the quantization of data in the decoder. More specifically, the representations of LLRs and partial sums in the decoder have an impact on decoding performance. Quantized implementations of the SC algorithm have already been proposed in [30] but to the best of our knowledge, the proposed decoder is the first SCL software implementation that can benefit from the 8-bit and 16-bit fixed-point representations of LLRs and internal path metrics. In the 8-bit mode LLRs and path metrics are saturated between −127 and +127 after each operation. Moreover, to avoid overflows, the path metrics are normalized after each update paths() call (cf. Alg. 1) by subtracting the smallest metric to each one of them. Figure 5a shows the BER and FER performances of the CA-SSCL decoder for 32-bit floatingpoint, 16-bit and 8-bit fixed-point representations. One can TABLE III T HROUGHPUT AND LATENCY COMPARISONS BETWEEN FLOATING - POINT (32- BIT ) AND FIXED - POINT (16- BIT AND 8- BIT ) A DAPTIVE SSCL DECODERS . C ODE (2048,1723), L = 32 AND 32- BIT CRC (G ZIP ). PA-SSCL FA-SSCL Prec. Lworst 635 622 651 1201 1198 1259 3.5 dB Lavg Ti 232.3 7.6 219.6 8.0 232.4 7.6 67.2 26.1 68.7 25.6 71.8 24.4 4.0 Lavg 41.7 40.1 41.2 8.5 7.7 7.7 dB Ti 42.1 43.8 42.6 207.8 225.7 227.3 4.5 Lavg 7.4 6.6 6.5 5.1 4.3 4.1 FA PA 8 32 128 64 32 16 8 4 2 1 4.5 an SNR degradation lower than 0.1 dB is observed, except for one particular configuration Throughput improvements of 8 to 20 percents are observed. If L = 32, the SNR losses are more substantial (up to 0.5 dB), whereas throughput improvements are approximately the same. Besides this observation, Table II shows how the proposed decoder flexibility in the AFF3CT environment enables to optimize easily the decoder tree pruning, both for software implementations or for hardware implementations in which tree pruning can also be applied [29]. 32-bit 16-bit 8-bit 32-bit 16-bit 8-bit L 10−7 Fig. 5. Decoding performance of the SSCL and the A-SSCL decoders. Code (2048,1723), L = 32. Decoder 10−4 10−6 CRC SSCL A-SSCL 8-bit 16-bit 32-bit 10−8 10−9 10−3 10−5 −7 4.5 256 10−1 10−4 FER FER 10−4 100 Info. throughput (Mb/s) 10−2 dB Ti 237.6 267.5 268.3 345.5 408.7 425.9 2.5 3 3.5 4 Eb /N0 (dB) 4.5 2.5 3 3.5 4 Eb /N0 (dB) 4.5 Fig. 6. Frame Error Rate (FER) performance and throughput of the Fully and Partially Adaptive SSCL decoders (FA and PA). Code (2048,1723) and 32-bit CRC (GZip). 32-bit floating-point representation. observe that the REP nodes degrade the decoding performance in a 8-bit representation because of accumulation (red triangles curve). Indeed, it is necessary to add all the LLRs of a REP node together in order to process it, which may lead to an overflow in the case of fixed-point representation. It can happen when the size of the repetition nodes is not limited (REP2+ ). However, thhe size limitation of the repetition nodes to 8 (REP8- ) fixes this issue. In Table III, maximum latency (Lworst in µs), average latency (Lavg in µs) and information throughput (Ti in Mb/s) are given. Note that in 8-bit configuration only the REP8- nodes are used. The fixed-point implementation reduces, on average, the latency. In the high SNR region, the frame errors are less frequent. Therefore, the SCL algorithm is less necessary than in low SNR regions for Adaptive SCL algorithms. As the gain of fixed-point implementation benefits more to the SC algorithm than to the SCL algorithm, the throughput is higher in high SNR regions. For instance, up to 425.9 Mb/s is achieved in 8-bit representation with the FA-SSCL decoder. Note that the improvements described in Section IV are applied to the decoders that are given in Table III. 4) Supporting different variants of the decoding algorithms: Besides the L values, the tree pruning and quantization aspects, the proposed software polar decoder supports different variants of the SCL algorithm: CA-SSCL, PA-SSCL, FASSCL. As shown in [10], the adaptive version of the SCL algorithm yields significant speedups, specially for high SNR. The original adaptive SCL described in [20], denoted as Fully Adaptive SCL (FA-SSCL) in this paper, gradually doubles the list depth L of the SCL decoder when the CRC is not valid for any of the generated codewords at a given stage until the value Lmax . By contrast, the adaptive decoding algorithm implemented in [10], called in this paper Partially Adaptive SCL (PA-SSCL), directly increases the list depth from 1 (SC) to Lmax . In Figure 6, the two versions (FASSCL and PA-SSCL) are compared on a (2048,1723) polar code and 32-bit CRC (GZip). The LLRs values are based on a 32-bit floating point representation. Note that as the FER performance of PA-SSCL and FA-SSCL are exactly the same, the related error performance plots completely overlap. The throughput of the FA-SSCL algorithm is higher than that of the PA-SSCL algorithm for some SNR values, depending on the code parameters. Considering typical FER values for wireless communication standards (10−3 to 10−5 ), in the case of a (2048,1723) polar code, the throughput of FA-SSCL is double that of PA-SSCL with L = 8, while it is multiplied by a factor of 7 with L = 32. The drawback of FA-SSCL is that although the average latency decreases, the worst case latency increases. The adaptive versions of the algorithm achieve better throughputs, but CA-SCL may also be chosen depending on the CRC. One may observe in Figure 5b that an adaptive decoder dedicated to an 8-bit CRC with a (2048,1723) polar code and L = 32 leads to a loss of 0.5 dB for a FER of 10−5 compared to its non adaptive counterpart. Both polar code genericity and decoding algorithm flexibility are helpful to support the recommendations of wireless communications in an SDR or cloud RAN context. The code and decoder parameters can be dynamically changed in the proposed decoder, while maintaining competitive throughput and latency. The following section introduces algorithmic and implementation improvements applied in the proposed decoders to keep a low decoding time. 1 class API_polar 2{ 3 template <typename R> 4 mipp::Reg<R> f_simd(const mipp::Reg<R> &la, 5 const mipp::Reg<R> &lb) 6 { 7 auto abs_la = mipp::abs(la); 8 auto abs_lb = mipp::abs(lb); 9 auto abs_min = mipp::min(abs_la, abs_lb); 10 auto sign = mipp::sign(la, lb); 11 auto lc = mipp::neg(abs_min, sign); 12 13 return lc; 14 } 15 16 template <typename B, typename R> 17 mipp::Reg<R> g_simd(const mipp::Reg<R> &la, 18 const mipp::Reg<R> &lb, 19 const mipp::Reg<B> &sa) 20 { 21 auto neg_la = mipp::neg(la, sa); 22 auto lc = neg_la + lb; 23 24 return lc; 25 } 26 27 template <typename B> 28 mipp::Reg<B> h_simd(const mipp::Reg<B>& sa, 29 const mipp::Reg<B>& sb) 30 { 31 return sa ˆ sb; 32 } 33 }; IV. S OFTWARE IMPLEMENTATION OPTIMIZATIONS Fig. 7. C++ SIMD implementation of the f , g and h functions. The genericity and flexibility of the formerly described decoder prevent from using some optimizations. Unrolling the description as in [10] is not possible at runtime, although code generation could be used to produce an unrolled version of any decoder as in [12]. Moreover, in the case of large code lengths, the unrolling strategy can generate very large compiled binary files. This can cause instruction cache misses that would dramatically impact the decoder throughput. As this unrolling method is not applied, some implementation improvements are necessary in order to be competitive with specific decoders of the literature. The software library for polar codes from [12], [13] enables to benefit from the SIMD instructions for various target architectures. Optimizations of CRC checking benefit to both the non-adaptive and adaptive versions of the CA-SCL algorithms. The new sorting technique presented in Section IV-C can be applied to each variation of the SCL algorithm. Finally, an efficient implementation of the partial sums memory management is proposed. It is particularly effective for short polar codes. implementation is based on MIPP, a SIMD wrapper for the intrinsic functions (assembly code), and the template metaprogramming technique. Consequently, the description is clear, portable, multi-format (32-bit floating-point, 16-bit and 8-bit fixed-points) and as fast as an architecture specific code. The mipp::Reg<B> and mipp::Reg<R> types correspond to SIMD registers. B and R define the type of the elements that are contained in this register. B for bit could be int, short or char. R for real could be float, short or char. In Figure 7, each operation is made on multiple elements at the same time. For instance, line 22, the addition between all the elements of the neg_la and lb registers is executed in one CPU cycle. In the context of software decoders, there are two well-known strategies to exploit SIMD instructions: use the elements of a register to compute 1 )many frames in parallel (INTER frame) or 2) multiple elements from a single frame (INTRA frame). In this paper, only the INTRA frame strategy is considered. The advantage of this strategy is the latency reduction by comparison to the INTER frame strategy. However, due to the nature of the polar codes, there are sometimes not enough elements to fill the SIMD registers completely. This is especially true in the nodes near the leaves. For this reason, SIMD instructions in the lower layers of the tree do not bring any speedup. In this context, the building blocks of the Polar API automatically switch from SIMD to sequential implementations. In the case of the CA-SSCL algorithm, using SIMD instructions for decoding a (2048, 1723) polar code A. Polar Application Programming Interface Reducing the decoding time with SIMD instructions is a classical technique in former software polar decoder implementations. The proposed list decoders are based on specific building blocks included from the Polar API [12], [13]. These blocks are fast and optimized implementations of the f , g, h (and their variants) polar intrinsic functions. Figure 7 details the SIMD implementation of these functions. This leads to an improvement of 20% of the decoding throughput on average for different values of the list depth L. By profiling the Adaptive SCL decoder, one may observe that a significant amount of time is spent to process the cyclic redundancy checks. Its computational complexity is O(LN ) versus the computational complexity of the SCL decoding, O(LN log N ). The first is not negligible compared to the second. In the adaptive decoder, the CRC verification is performed a first time after the SC decoding. In the following, we show how to reduce the computational complexity of these CRC verifications. First, an efficient CRC checking code has been implemented. Whenever the decoder needs to check the CRC, the bits are packed and then computed 32 by 32. In order to further speed up the implementation, a lookup table used to store pre-computed CRC sub-sequences, and thus reduce the computational complexity. After a regular SC decoding, a decision vector of size N is produced. Then, the K information bits must be extracted to apply cyclic redundancy check. The profiling of our decoder description shows that this extraction takes a significant amount of time compared to the check operation itself. Consequently, a specific extraction function was implemented. This function takes advantage of the leaf node type knowledge to perform efficient multi-element copies. Concerning SCL decoding, it is possible to sort the candidates according to their respective metrics and then to check the CRC of each candidate from the best to the worst. Once a candidate with a valid CRC is found, it is chosen as the decision. This method is strictly equivalent to do the cyclic redundancy check of each candidate and then to select the one with the best metric. With the adopted order, decoding time is saved by reducing the average number of checked candidates. C. LLR and Metric Sorting Metric sorting is involved in the aforementioned path selection step, but also in the update paths() sub-routine (Alg. 1, L16) and consequently in each leaf. Sorting the LLRs is also necessary in R1 and SPC nodes. Because of a lack of information about the sorting technique presented in [10], its reproduction is not possible. In the following of the paragraph the sorting algorithm used in the SCL decoder is described. In R1 nodes, a Chase-2 [31] algorithm is applied. The two maximum absolute values of the LLRs have to be identified. The way to do the minimum number of comparisons to identify the 2 largest of n ≥ 2 elements was originally described by Schreier in [32] and reported in [33]. The lower stages of this algorithm can be parallelized thanks to SIMD instructions in the way described in [34]. According to our experimentations, Schreier’s algorithm is the most efficient compared to parallelized Batcher’s merge exchange, partial quick-sort or heap-sort implemented in the C++ standard library in the case of R1 nodes. At the end, we chose not Info. throughput (Mb/s) B. Improving Cyclic Redundancy Checking 6 5 4 3 2 SSCLcpy SSCLptr 8-bit 16-bit 32-bit 1 0 27 28 29 210 211 212 213 214 215 216 217 218 219 220 221 222 Codeword size (N ) Fig. 8. Information throughput of the SSCL decoder depending on the codeword size (N ) and the partial sums management. R = 1/2, L = 8. to apply the SIMD implementation of the Schreier’s algorithm because: 1) the speedup was negligible, 2) in 8-bit fixed-point, only N ≤ 256 codewords can be considered. Concerning path metrics, partial quick-sort appeared to yield no gains in terms of throughput by comparison with the algorithm in [32], neither did heap-sort or parallelized Batcher’s merge exchange. For a matter of consistency, only Schreier’s algorithm is used in the proposed decoder, for both LLR sorting in R1 and SPC nodes and for path metrics sorting. The sorting of path metrics is applied to choose the paths to be removed, kept or duplicated. D. Partial Sum Memory Management An SCL decoder can be seen as L replications of an SC decoder. The first possible memory layout is the one given in Figure 1. In this layout, the partial sums ŝ of each node is stored in a dedicated array. Therefore, a memory of size 2N −1 bits is necessary in the SC decoder, or L × (2N − 1) bits in the SCL decoder. This memory layout is described in [2] and applied in previous software implementations [10], [11], [35]. A possible improvement is to change the memory layout to reduce its footprint. Due to the order of operations in both SC and SCL algorithms, the partial sums on a given layer are only used once by the h function and can then be overwritten. Thus, a dedicated memory allocation is not necessary at each layer of the tree. The memory can be shared between the stages. Therefore the memory footprint can be reduced from 2N − 1 to N in the SC decoder as shown in [36]. A reduction from L × (2N − 1) to LN can be obtained in the SCL decoder. In the case of the SCL algorithm, L paths have to be assigned to L partial sum memory arrays. In [2], this assignment is made with pointers. The advantage of pointers is that when a path is duplicated, in the update paths() sub-routine of Alg. 1, the partial sums are not copied. Actually, they can be shared between paths thanks to the use of pointers. This method limits the number of memory transactions. Unfortunately, it is not possible to take advantage of the memory space reduction: the partial sums have to be stored on L × (2N − 1) bits. There is an alternative to this mechanism. If a logical path is statically assigned to a memory array, no pointers are necessary at the cost that partial sums must be copied when a path is duplicated (only LN bits are required). This method is called SSCLcpy whereas the former is called SSCLptr . Our experiments have proved that the overhead of handling pointers plus the extra memory space requirement cause the SSCLcpy to be more efficient than the SSCLptr for short and medium code lengths, as shown in Figure 8. The 32-bit version uses floating-point LLRs, whereas 16-bit and 8-bit versions are in fixed-point. Notice that in this work, each bit of the partial sums is stored on an 8-bit, 16-bit or 32-bit number accordingly to the LLR data type. The code rate R is equal to 1/2. The throughput of the SSCLcpy version is higher for N ≤ 8192 whereas the SSCLptr version is more efficient for higher values of N . Although it does not appear in Figure 8, experiments showed that the lower L is, the more efficient SSCLcpy is compared to SSCLptr . Figure 8 also illustrates the impact of the representation of partial sums. For very high values of N , 8-bit fixed point representation takes advantage of fewer cache misses. According to the results presented in Figure 2, as the decoding performance improvements of the SCL algorithm are not very significant compared to the SC algorithm for long polar codes, SSCLcpy is the appropriate solution in most practical cases. In our decoder description, LLRs are managed with pointers, as it is the case in other software implementations of the literature [10], [11], [35]. We tried to remove the pointer handling as for the partial sums, but it appeared that it was not beneficial in any use case. V. E XPERIMENTS AND M EASUREMENTS Throughput and latency measurements are detailed in this section. The proposed decoder implementation is compared with the previous software decoders. Despite the additional levels of genericity and flexibility, the proposed implementation is very competitive with its counterparts. Note that all the results presented in the following can be reproduced with the AFF3CT tool. During our investigations, all the throughput and latency measurements have been obtained on a single core of an Intel i5-6600K CPU (Skylake architecture with AVX2 SIMD) with a base clock frequency of 3.6 GHz and a maximum turbo frequency of 3.9 GHz. The description has been compiled on Linux with the C++ GNU compiler (version 5.4.0) and with the following options: -Ofast -march=native -funroll-loops. A. Fully Adaptive SCL Being able to easily change the list size of the SCL decoders enables the use of the FA-SSCL algorithm. With an unrolled decoder as proposed in [10], the fully adaptive decoder would imply to generate a fully unrolled decoder for each value of the list depth. In our work, only one source code gives the designer the possibility to run each variation of the SCL decoders. FA-SSCL algorithm is the key to achieve the highest possible throughput. As shown in Table III, with an 8-bit fixed TABLE IV T HROUGHPUT AND LATENCY COMPARISON WITH STATE - OF - THE - ART SCL DECODERS . 32- BIT FLOATING - POINT REPRESENTATION . C ODE (2048,1723), L = 32, 32- BIT CRC. Target Decoder i7-4790K CA-SCL [35] CA-SCL [11] CA-SSCL [11] PA-SSCL [11] CA-SCL [10] CA-SSCL [10] PA-SSCL [10] This CA-SCL This CA-SSCL This PA-SSCL This FA-SSCL This CA-SCL This CA-SSCL This PA-SSCL This FA-SSCL i7-2600 i7-2600 i7-2600 i5-6600K Lworst (µs) 1572 23000 3300 ≈ 3300 2294 433 ≈ 433 4819 770 847 1602 3635 577 635 1201 3.5 dB 1.10 0.07 0.52 0.9 0.76 4.0 8.6 0.37 2.3 5.5 19.4 0.48 3.0 7.6 26.1 T i (Mb/s) 4.0 dB 1.10 0.07 0.52 4.90 0.76 4.0 33.0 0.37 2.3 31.1 149.0 0.48 3.0 42.1 207.8 4.5 dB 1.10 0.07 0.52 54.0 0.76 4.0 196.0 0.37 2.3 168.4 244.3 0.48 3.0 237.6 345.5 point representation of the decoder inner values, the achieved throughput in the case of the (2048,1723) polar code is about 425 Mb/s on the i5-6600K for an Eb /N0 value of 4.5 dB. It corresponds to a FER of 5 × 10−8 . This throughput is almost 2 times higher than the throughput of the PA-SSCL algorithm. The highest throughput increase from PA-SSCL to FA-SSCL, of about 380%, is in the domain where the FER is between 10−3 and 10−5 . It is the targeted domain for wireless communications like LTE or 5G. In these conditions, the throughput of FA-SSCL algorithm is about 227 Mb/s compared to 42 Mb/s for the PA-SSCL algorithm. In Adaptive SCL algorithms, the worst case latency is the sum of the latency of each triggered algorithm. In the case of PASSCL with Lmax = 32, it is just the sum of the latency of the SC algorithm, plus the latency of the SCL algorithm with L = 32. In the case of the FA-SSCL algorithm, it is the sum of the decoding latency of the SC algorithm and all the decoding latencies of the SCL algorithm for L = 2, 4, 8, 16, 32. This is the reason why the worst latency of the PA-SSCL algorithm is lower while the average latency and consequently the average throughput is better with the FA-SSCL algorithm. B. Comparison With State-Of-The-Art SCL Decoders. The throughput and latency of the proposed decoder compared to other reported implementations are detailed in Table IV. For all the decoders, all the available tree pruning optimizations are applied excluding the SPC4+ nodes because of the performance degradation. Each decoder is based on a 32-bit floating-point representation. The polar code parameters are N = 2048, K = 1723 and the 32-bit GZip CRC is used. The list size is L = 32. The latency given in Table IV is the worst case latency and the throughput is the average information throughput. The first version, CA-SCL, is the implementation of the CA-SCL algorithm without any tree pruning. As mentioned before the throughput of the proposed CA-SSCL decoder (2.3 Mb/s) is only halved compared to the specific unrolled CASSCL decoder described in [10] (4.0 Mb/s). The proposed CA-SSCL decoder is approximately 4 times faster than the generic implementation in [11] (0.52 Mb/s) and 2 times faster than the CA-SCL implementation in [35] (1.1 Mb/s) thanks to the implementation improvements detailed in Section IV. Furthermore, the proposed decoder exhibits a much deeper level of genericity and flexibility than the ones proposed in [11], [35]. Indeed, the following features were not enabled: the customization of the tree pruning, the 8-bit and 16-bit fixedpoint representations of the LLRs, the puncturing patterns and the FA-SSCL algorithm. When implemented on the same target (i7-2600), the proposed PA-SSCL is competitive with the unrolled PA-SSCL in [10], being only two times slower. This can be explained by the improvements concerning the CRC that are described in Section IV-B, especially the information bits extraction in the SC decoder. Finally, as mentioned before, the throughput of the proposed FA-SSCL significantly outperforms all the other SCL decoders (up to 345.5 Mb/s at 4.5 dB in 32-bit floatingpoint). VI. C ONCLUSION The trend towards Cloud RAN networks in the context of mobile communications and the upcoming 5G standard motivated an investigation of the possibility of implementing generic and flexible software polar decoders. Means of implementing such flexible decoders are reported in this paper. A single source code is necessary to address any code lengths, code rates, frozen bits sets, puncturing patterns and cyclic redundancy check polynomials. This genericity is obtained without sacrificing the throughput of the decoders, thanks to the possibility to adjust the decoding algorithm and the possibility to apply multiple implementation related and algorithmic optimizations. In fact, to the best of our knowledge, the proposed adaptive SCL decoder is the fastest to be found in the literature, with a throughput of 425 Mb/s on a single core for N = 2048 and K = 1723 at 4.5 dB. Being included in the open-source AFF3CT tool, all the results presented in this paper can be easily reproduced. Moreover, this tool can be used for polar codes exploration, which is of interest for the definition of digital communication standards and for practical implementations in an SDR environment. ACKNOWLEDGMENTS The authors would like to thank the Natural Sciences and Engineering Research Council of Canada, Prompt, and Huawei Technologies Canada Co. Ltd. for financial support to this project. This work was also supported by a grant overseen by the French National Research Agency (ANR), ANR-15-CE250006-01. R EFERENCES [1] E. Arikan, “Channel polarization: a method for constructing capacityachieving codes for symmetric binary-input memoryless channels,” IEEE Transactions on Information Theory (TIT), vol. 55, no. 7, pp. 3051–3073, 2009. [2] I. Tal and A. Vardy, “List decoding of polar codes,” in Proceedings of the IEEE International Symposium on Information Theory (ISIT), 2011, pp. 1–5. [3] “3GPP TSG RAN WG1 meeting #87, Chairmans notes of agenda item 7.1.5 Channel coding and modulation,” 2016. [4] D. Wübben, P. Rost, J. S. Bartelt, M. Lalam, V. Savin, M. Gorgoglione, A. Dekorsy, and G. Fettweis, “Benefits and impact of cloud computing on 5G signal processing: flexible centralization through cloud-ran,” IEEE Signal Processing Magazine, vol. 31, no. 6, pp. 35–44, 2014. [5] P. Rost, C. J. Bernardos, A. De Domenico, M. Di Girolamo, M. Lalam, A. Maeder, D. Sabella, and D. Wübben, “Cloud technologies for flexible 5G radio access networks,” IEEE Communications Magazine, vol. 52, no. 5, pp. 68–76, 2014. [6] Ericsson, “Cloud ran - the benefits of cirtualization, centralisation and coordination,” Tech. Rep., 2015. [Online]. Available: https://www. ericsson.com/assets/local/publications/white-papers/wp-cloud-ran.pdf [7] Huawei, “5G: A technology vision,” Tech. Rep., 2013. [Online]. Available: https://www.huawei.com/ilink/en/download/HW 314849 [8] V. Q. Rodriguez and F. Guillemin, “Towards the deployment of a fully centralized cloud-ran architecture,” in Proceedings of the IEEE International Wireless Communications and Mobile Computing Conference (IWCMC), 2017, pp. 1055–1060. [9] N. Nikaein, “Processing radio access network functions in the cloud: critical issues and modeling,” in Proceedings of the ACM International Workshop on Mobile Cloud Computing and Services (MCS), 2015, pp. 36–43. [10] G. Sarkis, P. Giard, A. Vardy, C. Thibeault, and W. J. Gross, “Fast list decoders for polar codes,” IEEE Journal on Selected Areas in Communications (JSAC), vol. 34, no. 2, pp. 318–328, 2016. [11] ——, “Increasing the speed of polar list decoders,” in Proceedings of the IEEE International Workshop on Signal Processing Systems (SiPS), 2014, pp. 1–6. [12] A. Cassagne, B. Le Gal, C. Leroux, O. Aumage, and D. Barthou, “An efficient, portable and generic library for successive cancellation decoding of polar codes,” in Proceedings of the Springer International Workshop on Languages and Compilers for Parallel Computing (LCPC), 2015, pp. 303–317. [13] A. Cassagne, O. Aumage, C. Leroux, D. Barthou, and B. Le Gal, “Energy consumption analysis of software polar decoders on low power processors,” in Proceedings of the IEEE European Signal Processing Conference (EUSIPCO), 2016, pp. 642–646. [14] I. Tal and A. Vardy, “How to construct polar codes,” IEEE Transactions on Information Theory (TIT), vol. 59, no. 10, pp. 6562–6582, Oct 2013. [15] P. Trifonov, “Efficient design and decoding of polar codes,” IEEE Transactions on Communications, vol. 60, no. 11, pp. 3221–3227, November 2012. [16] B. Le Gal, C. Leroux, and C. Jégo, “Multi-Gb/s software decoding of polar codes,” IEEE Transactions on Signal Processing (TSP), vol. 63, no. 2, pp. 349–359, 2015. [17] G. Sarkis, P. Giard, A. Vardy, C. Thibeault, and W. J. Gross, “Fast polar decoders: algorithm and implementation,” IEEE Journal on Selected Areas in Communications (JSAC), vol. 32, no. 5, pp. 946–957, 2014. [18] A. Balatsoukas-Stimming, M. B. Parizi, and A. Burg, “LLR-based successive cancellation list decoding of polar codes,” IEEE Transactions on Signal Processing (TSP), vol. 63, no. 19, pp. 5165–5179, 2015. [19] A. Alamdar-Yazdi and F. Kschischang, “A simplified successivecancellation decoder for polar codes,” IEEE Communications Letters, vol. 15, no. 12, pp. 1378–1380, 2011. [20] B. Li, H. Shen, and D. Tse, “An adaptive successive cancellation list decoder for polar codes with cyclic redundancy check,” IEEE Communications Letters, vol. 16, no. 12, pp. 2044–2047, December 2012. [21] M. Matsumoto and T. Nishimura, “Mersenne twister: a 623dimensionally equidistributed uniform pseudo-random number generator,” ACM Transactions on Modeling and Computer Simulation (TOMACS), vol. 8, no. 1, pp. 3–30, 1998. [22] G. E. P. Box, M. E. Muller et al., “A note on the generation of random normal deviates,” The annals of mathematical statistics, vol. 29, no. 2, pp. 610–611, 1958. [23] E. Dahlman, S. Parkvall, and J. Skold, 4G: LTE/LTE-advanced for mobile broadband. Academic press, 2013. [24] R. Wang and R. Liu, “A novel puncturing scheme for polar codes,” IEEE Communications Letters, vol. 18, no. 12, pp. 2081–2084, Dec 2014. [25] K. Niu, K. Chen, and J. R. Lin, “Beyond turbo codes: rate-compatible punctured polar codes,” in Proceedings of the IEEE International Conference on Communications (ICC), June 2013, pp. 3423–3427. [26] V. Miloslavskaya, “Shortened polar codes,” IEEE Transactions on Information Theory (TIT), vol. 61, no. 9, pp. 4852–4865, Sept 2015. [27] “Cyclic redundancy check,” https://en.wikipedia.org/wiki/Cyclic redundancy check, accessed: 2017-03-13. [28] Q. Zhang, A. Liu, X. Pan, and K. Pan, “CRC code design for list decoding of polar codes,” IEEE Communications Letters, vol. 21, no. 6, pp. 1229–1232, 2017. [29] J. Lin, C. Xiong, and Z. Yan, “A reduced latency list decoding algorithm for polar codes,” in Proceedings of the IEEE International Workshop on Signal Processing Systems (SiPS), 2014, pp. 1–6. [30] P. Giard, G. Sarkis, C. Leroux, C. Thibeault, and W. J. Gross, “Lowlatency software polar decoders,” Springer Journal of Signal Processing Systems (JSPS), pp. 31–53, Jul 2016. [31] D. Chase, “Class of algorithms for decoding block codes with channel measurement information,” IEEE Transactions on Information Theory (TIT), vol. 18, no. 1, pp. 170–182, 1972. [32] J. Schreier, “On tournament elimination systems,” Mathesis Polska, vol. 7, pp. 154–160, 1932. [33] D. Knuth, The art of computer programming. Addison-Wesley, 1973, no. 3. [34] T. Furtak, J. N. Amaral, and R. Niewiadomski, “Using SIMD registers and instructions to enable instruction-level parallelism in sorting algorithms,” in Proceedings of the ACM Symposium on Parallel Algorithms and Architectures, 2007, pp. 348–357. [35] Y. Shen, C. Zhang, J. Yang, S. Zhang, and X. You, “Low-latency software successive cancellation list polar decoder using stage-located copy,” in Proceedings of the IEEE International Conference on Digital Signal Processing (DSP), 2016. [36] C. Leroux, A. J. Raymond, G. Sarkis, and W. J. Gross, “A semi-parallel successive-cancellation decoder for polar codes,” IEEE Transactions on Signal Processing (TSP), vol. 61, no. 2, pp. 289–299, 2013.
7cs.IT
arXiv:1712.06281v2 [math.OC] 22 Dec 2017 Model Reduction in Chemical Reaction Networks: A Data-Driven Sparse-Learning Approach Omar A. Khalila,∗, Farshad Harirchia,∗ , Doohyun Kimc , Sijia Liua , Paolo Elvatic , Angela Violic,d , Alfred O. Heroa,b a Department of Electrical Engineering and Computer Science, b Department of Statistics, c Department of Mechanical Engineering, d Departments of Chemical Engineering, Biomedical Engineering, Macromolecular Science and Engineering, Biophysics Program, University of Michigan, Ann Arbor, MI 48109 † {oakhalil,harirchi,gogum,lsjxjtu,elvati,avioli,hero}@umich.edu December 27, 2017 Abstract The reduction of large kinetic mechanisms is a crucial step for fluid dynamics simulations of combustion systems. In this paper, we introduce a novel approach for mechanism reduction that presents unique features. We propose an unbiased reaction-based method that exploits an optimization-based sparse-learning approach to identify the set of most influential reactions in a chemical reaction network. The problem is first formulated as a mixed-integer linear program, and then a relaxation method is leveraged to reduce its computational complexity. Not only this method calculates the minimal set of reactions subject to the user-specified error tolerance bounds, but it also incorporates a bound on the propagation of error over a time horizon caused by reducing the mechanism. The method is unbiased toward the optimization of any characteristic of the system, such as ignition delay, since it is assembled based on the identification of a reduced mechanism that fits the species concentrations and reaction rate generated by the full mechanisms. Qualitative and quantitative validations of the sparse encoding approach demonstrate that the reduced model captures important network structural properties. 1 Introduction Combustion is a ubiquitous process with applications that vary widely from heating and transportation to mass production of metallic and ceramic nanoparticles. Despite its importance and several decades of intense scientific work, the chemical reaction networks that drive the processes are still elusive; they involve mechanisms that can span a wide range of length and time scales, highly reactive species, and are controlled by the delicate interplay between several chemical and physical phenomena. For all these reasons modeling has been extensively used to interpret and predict data on combustion. However, despite the massive increase in computational resources, we are still far from being able to simulate but the simplest systems once detailed fluid dynamic description is required. Specifically, using a detailed chemical description for the combustion of large molecules is still unrealistic, and instead reduced versions of the chemical kinetics have been developed. Various reduction methods that exploit different mathematical model reduction algorithms have been proposed, including Principal Component Analysis (PCA) [1], Intrinsic Low Dimensional Manifolds [2, 3], Computational Singular Perturbation (CSP) method [4, 5], isomer lumping [6], and an optimization-based method [7]. Also, the Directed Relation Graph (DRG) method and its derivatives [8, 9] have shown their ∗ Similar † This contributions from these authors. research has been funded by the US Army Research Office grants W911NF-15-1-0241 and W911NF-14-1-0359. 1 capabilities to generate a skeletal version of very large detailed chemical mechanisms in a computationally efficient manner. However, since DRG-type approaches are species-based methods (they identify unimportant species and remove all reactions associated with them), they are not as effective as reaction-based methods for reducing chemical reaction networks. On the other hand, reaction-based mechanism reduction approaches (they identify unimportant reactions and remove them) are able to calculate more compact reduced mechanisms. Many reaction-based mechanism reduction approaches such as the ones based on PCA, CSP and brute-force sensitivity analysis require generating data for many perturbations of each rate parameter, which is computationally demanding [10, 11]. Optimization-based reaction elimination approaches also received some attention from the combustion community. For example, a nonlinear mixed-integer programming approach was proposed in [12, 13]. Because of the non-convex nature of these problems, they are computationally intractable, and their optimality is not guaranteed. In [7], an approach is proposed to obtain a group of reduced mechanisms that are only valid around one reference point (i.e., temperature, pressure, molar concentrations). This enables the approach to be formulated as a mixed-integer linear programming problem, which is achieved by linearizing the nonlinear ODE around a given reference point. This approach delivers a group of different reduced mechanisms that are valid locally around a reference point. Furthermore, it requires Jacobian evaluation that is computationally demanding. In this paper, we propose a novel approach based on sparse-learning method to model reduction in chemical reaction networks. Our data-driven approach is part of the class of reaction-based methods, and hence carries the advantages associated with this class that are illustrated in figure 1. On the other hand, it does not require extensive number of simulations to capture sensitivity to different parameters. We pose the reaction-elimination problem as a mixed integer linear program, which can be solved to optimality in a relatively efficient manner, thanks to state-of-the-art MIP solvers [14]. As opposed to [7], the proposed approach aims to find a global reduced mechanism that is valid in the whole dynamical state space range. Our optimization-based approach identifies and removes unimportant reactions, by taking advantage of simulation data from the chemical process, and finds a global reduced mechanism with the minimal set of reactions, for which, the fitting error induced by removing the rest of the reactions remains in a user-specified bounded set. That is, the method finds the smallest set of reactions that still satisfy the bound condition on the error. Furthermore, it constraints the propagation of error caused by removing reactions in time. As the method is constructed based on finding a reduced mechanism that fits the species concentrations and reaction rates generated from the full mechanism, it is unbiased toward optimizing any specific characteristics such as ignition delay or temperature profile. In addition, the proposed method only requires tuning one parameter that has a physical meaning, which simply indicates the upper-bound on the tolerance of error caused by mechanism reduction. A preliminary version of this paper is presented in [15]. 2 Modeling Framework Chemical systems involve multiple species and reactions that describe how a set of chemical species interact through reactions and how their species concentrations evolve over time. The dynamics of chemical reactions are commonly modeled using mass-action kinetic equations [16, 17, 18, 19, 20]. Under Euler discretization method [21], the continuous dynamics can then be discretized as the following linear system Xt+1 = Xt + Mrt ∆t + ω t , t = 1, 2, . . . , T − 1, (1) where Xt is an Ns × 1 vector of molar concentrations of all species at time t, Ns is the number of species, Nr is the number of reactions, M is an Ns × Nr matrix that contains the stoichiometric coefficients of all reactions, ∆t is the sampling time used for discretization, ω t denotes the discretization error and process noise. rt is an Nr × 1 vector of the reaction rates of all reactions at time t, which is a polynomial function of concentration values as follows: Nr Y rt (i) = di Xt (j)αi,j , (2) j=1 where di is time varying reaction constant for the reaction i, Xt (j) denotes the j th component of Xt , and αi,j is the stoichiometric reaction coefficient relating reaction i to species j. The values of αi,j are contained in M. 2 Full mechanism A A A D B D B C G F H I D G Reduction by species-based method F H J B E C C G Reduction by this work F H I J I J Figure 1: Schematic representation of a chemical reaction network and its reduction. The circular nodes are chemical species and the arrows are chemical reactions with the thickness representing their relative importance within the system. This illustration highlights that the reduction method proposed in this work can generate smaller reaction network compared to the one by typical species-based method by eliminating all less-influential reactions. Given the discrete-time mass-action kinetic equations in Eq. (1), the focus of this paper is to infer a reduced mechanism, in terms of a reduced number of reactions, based only on observations such as species concentrations and reaction rates of the chemical systems. 3 Mechanism reduction via reaction selection In this section, we propose a data-driven sparse-learning approach towards identifying a reduced set of reactions, which approximately replicates the behavior of the detailed mechanism. For each of Nr reactions, we introduce a binary selection variable wi,t ∈ {0, 1} to encode whether or not the ith reaction is selected at time t. If reaction i is chosen for the reduced mechanism at time t, then wi,t = 1; otherwise, wi,t = 0. With the aid of the selection variables wt = [w1,t , w2,t , . . . , wNr ,t ]| , we formally state the problem of mechanism reduction. Problem Statement Given the measurements of species concentrations Xt and reaction rates rt at all times, determine the smallest subset of reactions (in terms of w) such that the estimation error induced by the reduced mechanism remains in a user-specified tolerance range () at all time instances. 3.1 Sparse-Learning Mechanism Reduction (SLMR) Let us first define the error induced by the reduced mechanism characterized by wt at time t on molar concentration of ith species as follows: Ei,t (wt ) = |Xt+1 (i) − Xt (i) − Mi (wt where Mi denotes the ith row of matrix M and rt )∆t|, (3) denotes the element-wise product. Error tolerance on individual concentrations We can enforce constraints on the error in the change of individual species concentrations for all time instances, i.e., Ei,t (wt ) ≤ Nt (i), ∀t, ∀i ∈ {1, . . . , Ns }, (4) where Nt is the normalization factor at time t, which is defined to be the summation of absolute changes of all concentrations at time t as described in Eq. (5), and  is a tuning parameter that indicates the error tolerance that is acceptable in terms of the percentage of Nt , i.e.,  = 0.05 indicates 5% error tolerance. 3 Nt (i) = |Mi |rt ∆t , i ∈ {1, . . . , Ns }. (5) Error propagation Constraint Eq. (6) is added to avoid the propagation of error through time. The size of time horizon can be chosen based on the speed of changes in concentrations. We indicate such time horizon with H. For the concentration change of each species i in time horizon [t, t + H − 1], we have that |Xt+H−1 (i) − Xt (i) − t+H−2 X Mi wk rk ∆k | ≤ β t+H−2 X k=t Nk (i), (6) k=t where β is a tuning parameter that indicates the tightness of the bound on propagated error, and t = 0, H, 2H, . . .. Incremental reaction inclusion At each time instance t, we seek the minimum number of reactions that are required to be added to the previously selected reactions up to time t such that Eq. (4) and Eq. (6) are satisfied, i.e., wt+1 ≥ wt . (7) Sparse-Learning Mechanism Reduction Now that the constraints that we consider for the optimization problem are described, we can formulate our data-driven sparse-learning mechanism reduction approach. For each time batch of size H, we solve the following mixed-integer linear programming problem: {wk∗ }t+H−1 = minimize k=t {wk }t+H−1 k=t Nr t+H−1 X X k=t wi,k (PSLM R ) i=1 subject to wi,k ∈ {0, 1}, i = 1, 2, ..., Nr , ∀k ∈ {t, t + 1, . . . , t + H − 1} Eqs. (4),(6),(7) hold. where {wk }t+H−1 are the optimization variables. Note that solving problem (PSLM R ) delivers the minimum k=t number of reactions that are required to be added to the previously selected reactions, i.e., incremental reaction inclusion Eq. (7) such that the error tolerance constraint on individual concentrations Eq. (4) and error propagation Eq. (6) are satisfied. The objective function minimizes the total number of selected reactions in the time horizon [t, t + H − 1]. Effect of different initial conditions In order to have a global reduced mechanism that mimics the dynamical behavior of full mechanism, we need to use data from simulations over a sparse set of initial conditions that encompass the whole range of temperature T , equivalence ratio φ and pressure p. We refer to each initial condition as a point in the parameter space, namely θ = [T, φ, p]. Reduced mechanism for entire simulation time The next step is to find the reduced mechanism not just for the time horizon [t, t + H − 1], but for the entire simulation time [0, tf ], where tf is the time that simulation ends. In order to do this, we solve problem (PSLM R ) for time intervals [0, H − 1], [H, 2H − 1], ..., [KH, tf ], where KH is the largest integer multiple of H that is smaller or equal to tf , as described in Algorithm 1. Global mechanism Assume that data is available for a sparse set of initial conditions that is denoted by Θ. In order to obtain a global reduced mechanism we calculate the set union of all selected reactions for all the conditions in Θ. In other words: [ w∗ = R(w(θ)), (8) θ∈Θ where R(w(θ)) denotes the set of reactions corresponding to the output of Algorithm 1 for initial condition θ. 4 Algorithm 1 Calculating w(θ) t t t f f f Input: {Xt }t=0 , {rt }t=0 , {∆t }t=1 , , β, θ = [φ, T, p]. Initialize: t = 0, w−1 = 0. 1. While (t ≤ tf ) • W = min{H, tf − t + 1} • set the time horizon to [t, t + W − 1]. ∗ • solve problem (PSLM R ) to obtain wt+W −1 • t + W → t. ∗ • wt−1 = wt−1 . End while 2. Return wt∗f as w(θ). 3.2 Computational Complexity Problem (PSLM R ) is a standard mixed-integer linear programming (MILP) problem, and thus can be efficiently solved using state-of-the-art MILP solvers such as Gurobi [14] and CPLEX [22]. Even though these solvers can solve problems with large number of integer variables in a relatively fast manner by employing advanced branch and bounding algorithms, the worst-case complexity of MILP is exponential. In order to further reduce the complexity of our data-driven sparse-learning approach, we can utilize convex relaxation methods [23] by replacing the Boolean variable constraint with its convex compartment 0 ≤ wi,t ≤ 1 for all i. The latter yields a linear programming problem, which can be solved efficiently in polynomial time, and therefore makes our approach promising for extremely large-scale chemical reaction networks at the cost of losing optimality guarantees. 4 Application We applied the reduction algorithm presented in the previous section to the chemical mechanism of H2 oxidation by Hong et al. [24]. We selected this mechanism for two reasons: first is a very small mechanism that is suitable for testing of different approaches and as such optimal to develop new methodologies; second, due to the small number of reactions and species, is very difficult to reduce without affecting its accuracy. We want to stress, however, that the mechanism reduction of H2 is intended to show the algorithm capabilities and not a real world application. We first performed 48 simulations using the full mechanism in a H2 /air 0-D homogeneous reactor for thermodynamic regimes that relevant to practical combustion devices by using using Chemkin [25]. The species concentrations and reaction rates generated for initial conditions encompassing 5 − 20 atm, 800 − 1100 K, and equivalence ratios between 0.5 − 2 were used to generate the reduced mechanism. We first fix the time horizon for error propagation to be at H = 10. Then, by setting the tuning parameters β to 100 and , i.e., the upper bound on the fitting error tolerance, to 0.02, 0.05, and 0.1 results in three reduced mechanisms with 47, 40 and 37 reactions (forward and reverse counted separately). Compared to the full mechanism, which includes 58 reactions excluding the reactions associated with Ar, that is a reduction of about 19%, 31%, and 36%, respectively. Figure 2 shows, in the form of a directed bipartite graph, the comparison between the full mechanism and the 37-reactions reduced mechanism. In this representation, species are connected to the reactions in which they appear as reactants by red dashed lines, while reactions are connected to their products by blue dotted lines. Finally, gray lines show the reactions that were removed by the mechanism reduction. To test the quality of the reduced mechanisms , we compared calculated ignition characteristics and the time evolutions of species concentrations in a range of conditions slightly wider than the one used to generate them (i.e., 5 − 20 atm, 700 − 1300 K, equivalence ratio of 0.5 − 2) for the same homogeneous 5 O2 HO 2 HO2 HO 2 O H O H2 -> 2 H2 O H 5: H O R3 0 R5 R3 6: HO 7: R3 H :2 -> O HH 8: H O2 - 2O >H 2 -> 2O 2 HH -> O HO2 :O R39 R3 2 H -> H O2 H2 2 -> O OH O R40: R42: HO2 H2 -> H2O2 H R41: H2O R43: H2O2 H -> H2O OH H2 2H -> 2 2H 9: H2 -> R4 2H 8: 4 2H R O 2 -> 2O2 7: H -> H R4 O2 HH O : O2 R46 OH H O -> H2O2 R45: 2O2 H OH -> H R44: H2O 2 2H -> H2 2 HO :2 34 1 R5 R H -> H : 33 :H 2 R5 R H 2: -> 2H 2: 2 H H2 -> 2- H >2 :H R5 3 R3 H H H H2 O >H H2 2- H OH -> 2H 4: 1: R5 R3 :H R30 : 2O H2 -> O 2 R55 : O2 R56 R29 H2 -> O OH 2 -> :OH R57: O R28: H H HO OH -> O H2 -> 2O H -> O R58: OH -> H R27: O H2 -> OH R26: H2O O -> 2OH R25: 2OH -> H OH H R24: O O H2O O HHH H2 :H R2 1: O R2 2 HO Species 9: R1 8: O2 2 H2 O H2 O2 2H O 7: 2 O 2 -> > OH OH -> H 2H2O H H2 O 2O O- >H H2 O2 - -> OH >2 O2 HO 2 H2 O2 2H O 2 O 2 H2 OH 2 O -> 2 O2 2 H2O2 H2O 2O HH >O 2O HO >H O- O2 HO2 H2O -> OH -> H H2O H2O2 -> 2 H2O H2 2- O2 OH HO2 HO O2 OH -> 5: O H2 R1 6: 2H R1 4: H : R13 R1 R12: -> H O2 R10: 2OH -> H2O2 R11: OH 2 O -> O O H O2 R9: H2O2 -> 2OH H R8: HO2 -> 2 HO R7: H O2 -> HO2 R6: HO2 -> H R5 O2 : H O2 -> H O2 : -> O 2 HO 2 H O2 -> R4 :H O H R3 :O R1 R2 :H H2 0: R1 O2 Reaction H2O - R22 OH removed edges 2O -> R23 :2 O2 R1 Reaction->Species O -> 2O H2 Species->Reaction 2O -> 2 HO Figure 2: The directed bipartite graph for the reduced mechanism with 37 reactions ( = 0.1). Red dashed lines indicate the edges from species to reactions, blue dotted lines represent the edges from reactions to species, and light grey solid lines show the removed edges from the detailed mechanism. reactor. Figure 3 shows the ignition delay times, relative deviations in ignition delay time from the full mechanism, and maximum temperature increase at 10 atm, and equivalence ratios of 0.5 and 1. All three reduced mechanisms are in excellent agreement with the full mechanism, with, as expected, larger reduced mechanisms showing better agreements. The relative deviation in the ignition delay times are, however, even in the worst case scenario within 1% under all the tested conditions. Also the maximum temperature increase (bottom panels of Fig. 3) is well-maintained in the reduced mechanisms. This agreements are not limited to 10 atm and φ =0.5 and 1, as very similar observations can be made in all the condition tested (not shown). Figure 4 shows the time evolutions of selected species for the simulations at 1000 K, 10 atm, equivalence ratios of 0.5 and 1. All reduced mechanisms generated very similar H2 O and H profiles throughout the whole ignition event compared to those from the full mechanism. However, OH profiles show that the correct concentrations after ignition is not completely matched by the 40- and 37-reactions mechanism. Considering the small size of the full mechanism this is not entirely unexpected and is exacerbated by the equilibrium reached in the concentrations after ignition. Overall, however, the above comparisons show that the reduced mechanisms generated by our new reduction approach are effective in reproducing key combustion properties such as ignition characteristics and heat release, as well as species profiles during pre-ignition and ignition. 6 Tmax - T init (K) 10atm, phi=1 10 -1 10 -3 10 -5 ID deviation (%) Ignition Delay (s) 10atm, phi=0.5 10 1 1 0 -1 2500 full mechanism 47-reactions 40-reactions 37-reactions 2000 1500 0.8 0.9 1 1.1 1.2 1.3 1.4 0.8 1000/T (1/K) 0.9 1 1.1 1.2 1.3 1.4 1000/T (1/K) Figure 3: Computed ignition delay times (top), percent deviations in ignition delay from the full mechanism (middle), and maximum temperature increase (bottom) for 10 atm, equivalence ratios of 0.5 and 1 cases. OH Mole Frac (-) H Mole Frac (-) H 2O Mole Frac (-) 10atm, phi=0.5, T init=1000K 10atm, phi=1, T init=1000K 0.2 0.3 0.2 0.1 0.1 0 0 0.06 full mechanism 47-reactions 40-reactions 37-reactions 0.02 0.01 0.04 0.02 0 0 0.02 0.03 0.02 0.01 0.01 0 0 0 0.005 0.01 0 Time (sec) 0.004 0.008 Time (sec) Figure 4: Time evolutions of H2 O, H, and OH in mole fractions from homogeneous reactor simulations with initial conditions of 1000 K, 10 atm, and equivalence ratios of 0.5 and 1. 5 Conclusions In this work, we present a new method to reduce chemical reaction network by employing data-driven sparse learning approach to obtain a reduced mechanism that is valid for all process conditions (temperature, pressure and equivalence ration) and all ranges of species molar concentrations. In addition, our method incorporates a user-specified bound on the propagation of error cause by eliminating reactions. That is, the proposed approach ensures that the discrepancy between the original and the reduced mechanisms remains in the user-specified acceptable range in all time instances and in all time horizons of specified length. The reduction is performed without introducing any bias towards specific properties or species therefore providing a mechanism with optimal performance, which is independent of the chemical reaction network that is being considered. Finally, the approach has a low computational cost and scales gracefully with the size of the full mechanism, making it a viable option for the reduction of large mechanisms. The performance of the method is evaluated on a H2 mechanism, which due to its small initial size was expected to be difficult to reduce. Surprisingly, however, our method was able to reduced the number of 7 reactions by more than one third without any notable discrepancy in ignition delay or heat release. References [1] S. Vajda, P. Valko, and T. Turányi. Principal component analysis of kinetic models. International Journal of Chemical Kinetics, 17(1):55–81, 1985. [2] U. Maas and S. B. Pope. Implementation of simplified chemical kinetics based on intrinsic lowdimensional manifolds. Symposium (International) on Combustion, 24(1):103–112, 1992. [3] U. Maas and S. B. Pope. Simplifying chemical kinetics: Intrinsic low-dimensional manifolds in composition space. Combustion and Flame, 88(3):239–264, 1992. [4] S. H. Lam and D. A. Goussis. The CSP method for simplifying kinetics. International Journal of Chemical Kinetics, 26(4):461–486, 1994. [5] S. H. Lam. Using CSP to Understand Complex Chemical Kinetics. Combustion Science and Technology, 89(5-6):375–404, 1993. [6] Syed Sayeed Ahmed, Fabian Mauß, Gladys Moréac, and Thomas Zeuch. A comprehensive and compact n-heptane oxidation model derived using chemical lumping. Physical Chemistry Chemical Physics, 9(9):1107–1126, 2007. [7] Binita Bhattacharjee, Douglas A. Schwer, Paul I. Barton, and William H. Green. Optimally-reduced kinetic models: Reaction elimination in large-scale kinetic mechanisms. Combustion and Flame, 135(3):191–208, 2003. [8] Tianfeng Lu and Chung K. Law. A directed relation graph method for mechanism reduction. Proceedings of the Combustion Institute, 30, 2005. [9] P Pepiotdesjardins and H Pitsch. An efficient error-propagation-based reduction method for large chemical kinetic mechanisms. Combustion and Flame, 154(1-2):67–81, 2008. [10] T Lu and C Law. Strategies for mechanism reduction for large hydrocarbons: N-heptane. Combustion and Flame, 154(1-2):153–163, 2008. [11] Kyle E. Niemeyer, Chih-Jen Sung, and Mandhapati P. Raju. Skeletal mechanism generation for surrogate fuels using directed relation graph with error propagation and sensitivity analysis. Combustion and Flame, 157(9):1760–1770, 2010. [12] Linda Petzold and Wenjie Zhu. Model reduction for chemical kinetics: An optimization approach. AIChE journal, 45(4):869–886, 1999. [13] Keith Edwards, TF Edgar, and VI Manousiouthakis. Reaction mechanism simplification using mixedinteger nonlinear programming. Computers & Chemical Engineering, 24(1):67–79, 2000. [14] Inc. Gurobi Optimization. Gurobi optimizer reference manual, 2016. [15] Farshad Harirchi, Omar A. Khalil, Sijia Liu, Paolo Elvati, Angela Violi, and Alfred O. Hero. A datadriven sparse-learning approach to model reduction in chemical reaction networks. In Proceedings of NIPS 2017 Workshop on Advances in Modeling and Learning Interactions from Complex Data, 2017. [16] Martin Feinberg. Chemical reaction network structure and the stability of complex isothermal reactors– i. the deficiency zero and deficiency one theorems. Chemical Engineering Science, 42(10):2229–2268, 1987. [17] Jeremy Gunawardena. Chemical reaction network theory for in-silico biologists. Notes available for download at http: // vcp. med. harvard. edu/ papers/ crnt. pdf , 2003. [18] Daniel T Gillespie. Stochastic simulation of chemical kinetics. Annu. Rev. Phys. Chem., 58:35–55, 2007. 8 [19] Vijaysekhar Chellaboina, Sanjay P Bhat, Wassim M Haddad, and Dennis S Bernstein. Modeling and analysis of mass-action kinetics. IEEE Control Systems, 29(4):60–78, 2009. [20] David F Anderson and Thomas G Kurtz. Continuous time markov chain models for chemical reaction networks. In Design and analysis of biomolecular circuits, pages 3–42. Springer, 2011. [21] Uri M Ascher and Linda R Petzold. Computer methods for ordinary differential equations and differential-algebraic equations, volume 61. Siam, 1998. [22] IBM ILOG CPLEX. User’s manual for CPLEX. Int. Bus. Mach. Corp., 46(53):157, 2009. [23] Jorge Nocedal and Stephen J. Wright. Numerical Optimization. Springer, New York, NY, USA, second edition, 2006. [24] Zekai Hong, David F. Davidson, and Ronald K. Hanson. An improved H2/O2 mechanism based on recent shock tube/laser absorption measurements. Combustion and Flame, 158(4):633–644, 2011. [25] CHEMKIN version 18.0, 2016. 9
3cs.SY
A Density Matrix-based Algorithm for Solving Eigenvalue Problems Eric Polizzi∗ Department of Electrical and Computer Engineering, University of Massachusetts, Amherst (Dated: January 17, 2009) arXiv:0901.2665v1 [cs.CE] 17 Jan 2009 A new numerical algorithm for solving the symmetric eigenvalue problem is presented. The technique deviates fundamentally from the traditional Krylov subspace iteration based techniques (Arnoldi and Lanczos algorithms) or other Davidson-Jacobi techniques, and takes its inspiration from the contour integration and density matrix representation in quantum mechanics. It will be shown that this new algorithm - named FEAST - exhibits high efficiency, robustness, accuracy and scalability on parallel architectures. Examples from electronic structure calculations of Carbon nanotubes (CNT) are presented, and numerical performances and capabilities are discussed. PACS numbers: 02.60.-x,02.70.Hm,02.70.-c,02.10.Ud,31.15.-p,71.15.Dx Keywords: diagonalization technique, contour integration, electronic structure calculations I. INTRODUCTION The generalized eigenvalue problem, that is the determination of nontrivial solutions (λ, x) of Ax = λBx with A and B square matrices, is a central topic in numerical linear algebra and arises from a wide range of applications in sciences and engineering. In electronic structure calculations, in particular, the eigenvalue problem is one of the most challenging applied numerical process - also called diagonalization procedure or spectral decomposition. In these calculations, the electron density can be formally calculated by summation of the amplitude square of the wave functions Ψm solution of the Schrödinger-like eigenvalue problem HΨm = Em SΨm with different discrete energies Em (where H represents the Hamiltonian Hermitian matrix and S is a symmetric positive matrix obtained using non-orthogonal basis functions). This procedure can be quite computationally challenging for large-scale simulations of systems containing more than a hundred of atoms and/or where a large number of eigenpairs (Em , Ψm ) are needed. Progress in electronic structure calculations as for other large-scale modern applications, are then much likely dependent on advances in diagonalization methods. In the past decades, the eigenvalue problem has led to many challenging numerical questions and a central problem [1]: how can we compute eigenvalues and eigenvectors in an efficient manner and how accurate are they? Powerful tools have then been developed from Jacobi method and power iterations, to iterative Krylov subspace techniques (including Arnoldi, and Lanczos methods), or other Davidson-Jacobi techniques [2]. Traditional numerical algorithms and library packages are yet facing new challenges for addressing the current largescale simulations needs for ever higher level of efficiency, accuracy and scalability in modern parallel architectures. This article presents a new robust and scalable algorithm design for solving the eigenvalue problem- named ∗ URL: http://www.ecs.umass.edu/ece/polizzi FEAST- which deviates fundamentally from the traditional techniques above, and takes its inspiration from the density matrix representation and contour integration in quantum mechanics. Section II summarizes the electronic structure and contour integration problems which have motivated the development of the new algorithm. The FEAST algorithm is then described in detail in Section III, and numerical examples and performance results are presented in Section IV. Finally, Section V presents some discussions regarding the efficiency, robustness and scalability of the algorithm. II. THE CONTOUR INTEGRATION TECHNIQUE IN ELECTRONIC STRUCTURE CALCULATIONS Although new fast sparse solvers have allowed considerable time saving for obtaining the eigenpairs (Em , Ψm ) in electronic structure calculations, such as the Rayleighquotient multigrid [3] developed for the MIKA package, or the parallel Chebyshev subspace iteration technique developed for the PARSEC package [4, 5], these calculations are still considered computationally extremely challenging and linear scalability is not easily achievable. An alternative approach to the Schrödinger picture for obtaining the electron density consists in performing a contour integration of the diagonal elements of the Green’s function matrix G(Z) = (ZS − H)−1 over the complex energy space [6]. At zero temperature, the resulting expression for the electron density in real-space is: Z X 1 n(r) = − dZ G(r, r, Z) = |Ψm (r)|2 , (1) 2πı C m where the complex contour C includes all the eigenvalues Em below the Fermi level EF , and where the spin factor is not considered. It should be noted that at non zero temperatures, this expression would also include the contribution of the residues of all poles of the FermiDirac distribution function on the imaginary axis at the position of the Fermi level [7]. For transport problems 2 and open systems, in turn, the contour integration is often used to compute the equilibrium part of the electron density [8] where self-energy boundary conditions need to be included in the Hamiltonian matrix H. The contour integration technique represents a priori an attractive alternative approach to the traditional eigenvalue problem for computing the electron density since the number of Green’s function to be calculated -typically ∼ O(10) using a Gauss quadrature procedure- is independent of the size of the system. In particular, an efficient linear scaling strategy CMB (CMB stands for Contour integration - Mode approach - Banded system solver), has been proposed in [9, 10] for simulating nanowire-type structures within a real-space mesh framework while overcoming the impossible numerical task of inverting a large size matrix at each point of the contour. For arbitrary systems (i.e. beyond nanowire structures), however, there are no numerical advantages of abandoning the traditional eigenvalue problem in favor of the contour integration technique for computing the electron density. In addition, it is clear from equation (1) that the contour integration technique does not provide a natural route for obtaining the individual eigenvectors but rather the summation of their amplitudes square. In the following section, a new numerical algorithm design FEAST is proposed for obtaining directly the eigenpairs solutions using the density matrix representation and a numerically efficient contour integration technique. III. A. FEAST Introduction In this section, a new algorithm is presented for solving generalized eigenvalue problems of this form Ax = λBx, in quantum mechanics. One can show that this factorization can be expressed in terms of the eigenvectors present inside the contour as follows: ρ=− Z dZ G(Z) == C M X |xm ihxm |. (3) m=1 In matrix notations the second term of the equation reads XXT where XN×M = {x1 , x2 , ..xM } (M being the number of eigenvalue inside the contour and N the size of G). It should be noted that the diagonal elements of ρ represent the electron density in quantum mechanics (1) discussed in Section II. Postmultiplying ρ by a set of M linearly independent random vectors YN×M = {y1 , y2 , ..yM }, the first expression in (3) leads to a new set of M independent vectors QN×M = {q1 , q2 , ..qM } obtained by solving linear systems along the contour Z 1 QN×M = − dZ G(Z)YN×M , (4) 2πı C while the second expression in (3), implies these vectors Q can be formally generated by the eigenfunctions X inside the contour QN×M = XN×M WM×M with Wi,j = xT i yj . (5) In other words, each Q column vector obtained in (4) represents a different linear combination of unknown basis functions X in (5). Using a Rayleigh-Ritz procedure, the problem (2) is now equivalent to computing the eigenpairs (ǫm , Φm ) of the following reduced generalized eigenvalue problem of size M: AQ Φ = ǫBQ Φ (2) within a given interval [λmin , λmax ], where A is real symmetric or Hermitian and B is a symmetric positive definite (s.p.d). One common way to accelerate the convergence rate of traditional iterative techniques consists in performing a factorization of the Green’s function G(σ) = (σB − A)−1 for some reasonable shift σ close to the eigenvalues in the search interval and which leads to solving linear systems (i.e. shifting strategy). More recently, Sakurai et al. [11, 12] have proposed a root finding technique which consists of a contour integration of a projected Laurent series-type decomposition of the Green’s function. In principle, a set of complex moments can be obtained by solving few linear systems along the contour, which can generate an identical subspace to the one spanned by the eigenvectors present inside the contour. In practice, however, robustness and accuracy are not easily achievable. In our approach, we avoid decomposing directly the Green’s function and perform instead an exact mathematical factorization of its contour integration - which represents the reduced density matrix ρ 1 2πı T with AQ = Q AQ T and BQ = Q BQ. (6) (7) The Ritz values and vectors are then given by: λm = ǫm , m = 1, . . . , M XN×M = QN×M ΦM×M (8) (9) where ΦM×M = {Φ1 , Φ2 , ..ΦM }. One can show that the obtained eigenvectors X are naturally B-orthonormal i.e. xT i Bxj = δi,j , if the eigenvectors of the reduced problem (6) are BQ -orthonormal i.e. ΦT i BQ Φj = δi,j . B. Practical Considerations and Pseudocode In practice, the vectors Q are computed by performing a numerical integration of each vectors G(Z)Y (4) along the complex contour C. Let us consider a circle centered in the middle of the search interval [λmin , λmax ], it should be noted that the expression of the contour integration 3 (ii) Postmultiplying the density matrix (3) by M0 random vectors (rather than M) where M0 is greater than M. The reduced dense generalized eigenvalue problem (6) of size M0 can be solved using standard eigenvalue LAPACK routines [13]. Since we do not perform the orthogonalization of the vectors Q, one has to make sure that BQM0 ,M0 is symmetric positive definite i.e. M0 does not exceed an upper limit which can easily be obtained a posteriori. C+ λmin λ λmax FIG. 1: Schematic representation of the complex contour integral defined by the positive half circle C + . In practice, the vectors Q are computed via a numerical integration (e.g. GaussLegendre quadrature) where only few linear systems G(Z)Y needs to be solved at specific points Ze along the contour. 1- Select M0 > M random vectors YN×M0 ∈ RN×M0 2- Set Q = 0 with Q ∈ RN×M0 ; r = (λmax − λmin )/2; For e = 1, . . . Ne can be further simplified since G(Z̄) = G† (Z). Denoting C + the positive half circle of the complex contour, it comes if A is Hermitian: Z 1 dZ {G(Z) − G† (Z)}, (10) ρ=− 2πı C + and if A is real symmetric: Z 1 ρ=− dZ ℑ{G(Z)}, π C+ compute θe = −(π/2)(xe − 1), compute Ze = (λmax + λmin )/2 + r exp(ıθe ), solve (Ze B − A)Qe = Y to obtain Qe ∈ CN×M0 compute Q = Q − (ωe /2)ℜ{r exp(ıθe ) Qe } End 3- Form AQ M0 ×M0 = QT AQ and BQ M0 ×M0 = QT BQ 4- Solve AQ Φ = ǫBQ Φ to obtain the M0 eigenvalue ǫm , (11) where ℑ{} stands for the imaginary part. Using a Ne point Gauss-Legendre quadrature on the positive half circle C + (see Figure 1), with xe the eth Gauss node associated with the weight ωe , one obtains if A is Hermitian and Y, Q ∈ CN×M : and eigenvectors ΦM0 ×M0 ∈ RM0 ×M0 5- Set λm = ǫm and compute XN×M0 = QN×M0 ΦM0 ×M0 If λm ∈ [λmin , λmax ], λm is an eigenvalue solution and its eigenvector is Xm (the mth column of X). 6- Check convergence for the trace of the eigenvalues λm If iterative refinement is needed, compute Y = BX Q=− Ne X 1 e=1 4  ωe r exp(ıθe ) G(Ze ) + exp(−ıθe ) G† (Ze ) Y, (12) and go back to step 2 (15) FIG. 2: FEAST pseudocode (sequential version) for solving the generalized eigenvalue problem Ax = λBx, where A is real symmetric and B is s.p.d., and obtaining all the M eigenpairs within a given interval [λmin , λmax ]. The numerical integration is performed using Ne -point Gauss-Legendre quadrature with xe the eth Gauss node associated with the weight ωe . For the case Ne = 8, one can use: (x1 , ω1 ) = (0.183434642495649, 0.362683783378361), (x3 , ω3 ) = (0.525532409916328, 0.313706645877887), (x5 , ω5 ) = (0.796666477413626, 0.222381034453374), (x7 , ω7 ) = (0.960289856497536, 0.101228536290376), and (x2i , ω2i )i=1,...,4 = (−x2i−1 , ω2i−1 ) where ℜ{} stands for the real part. In order to reduce the numerical quadrature error of the contour integral, one may consider the two following improvements: (i) Performing outer-iterative refinement steps. Once the eigenvectors X are obtained (9), a new set of initial guess vectors Y = BX can be used. Postmultiplying the density matrix (3) by Y, one now obtains from (5) that Q converges to X since XT BX = I (i.e. Wi,j = δi,j and then ρBX = X). A fast test for convergence can be obtained by checking the trace of the eigenvalues (8). The performances of the basic FEAST algorithm will then depend on a trade off between the choices of the number of Gauss quadrature points Ne , the size of the subspace M0 , and the number of outer refinement loops. So far, using M0 ≥ 1.5M, Ne = 8, and with at most 2 refinement loops, we have consistently obtained a relative residual equal or smaller than 10−10 seeking up to 1000 eigenpairs for a variety of problems. The basic pseudocode for the FEAST algorithm is given in Figure 2 in the case of A real symmetric. In the case of A complex Hermitian, we note the following changes: with r= λmax − λmin , θe = −(π/2)(xe − 1), 2 λmax + λmin + r exp(ıθe ). Ze = 2 (13) (14) If A is real symmetric, Y, Q ∈ RN×M and one can use: Q=− Ne X 1 e=1 2 ωe ℜ{r exp(ıθe ) G(Ze )Y}, 4 Y, Q ∈ CN×M0 , Φ ∈ CM0 ×M0 , and the construction of the vectors Q in step-2 of the pseudocode must be modified to satisfy (12). IV. NUMERICAL EXPERIMENTS In this section, we propose to demonstrate the numerical stability, robustness and scalability of the FEAST algorithm using three examples derived from electronic structure calculations of Carbon nanotube (CNT). A. Example I Let us first consider a family of eigenvalue problems, Test-CNT, obtained using a 2D FEM discretization of the DFT/Kohn-Sham equations at a given cross-section of a (13,0) CNT – the 2D atomistic potential is derived from the mode approach used in the CMB strategy for solving the full 3D problem presented in [9]. In Test-CNT, A is real symmetric, and B is s.p.d., the size of both matrices is N = 12, 450 and their sparsity pattern is identical with a number of non-zero elements nnz = 86, 808. In Table I, we report the times and relative residual obtained by the public domain eigenvalue solver package ARPACK [14] (using the shift-invert strategy) and the FEAST algorithm presented in Figure 2 for solving the Test-CNT example seeking up to M = 800 (lowest) eigenpairs. The inner linear systems in ARPACK and FEAST are solved using the shared-memory parallel direct solver PARDISO [15]. It should be noted, however, that FEAST benefits more than ARPACK from the PARDISO solver, as the inner linear systems have multiple right-hand sides. Although both algorithms could benefit from a parallel distributed implementation (e.g. using the P ARPACK package), the simulation runs are here restricted to a given node of a 8-cores Intel Clovertown system (16Gb,2.66GHz) where the linear systems in FEAST are factorized and solved one after another. The performances of ARPACK and FEAST can also depend on fine tunings parameters such as the choices of the size of the subspace M0 (M0 = 1.5M here for both algorithms), the inner systems solvers, the number of contour points Ne for FEAST, or the stopping criteria for obtaining the residual. The simulation results in this section are then not intended to compare quantitatively the two solvers but rather to point out the potentialities of the FEAST algorithm. In our experiments, the convergence criteria on the relative residual for FEAST is obtained P when the relative error on the trace of the eigenvalues m λm in the search interval is smaller or equal to 10−13 . Table II shows the variation of the relative error on the trace with the number of outer-iterative refinement for FEAST. These results demonstrate that only 2 to 3 refinement loops are necessary to obtain the small relative residuals for the different cases reported in Table I. It should be noted TEST-CNT ARPACK N = 12, 450 Time(s) Resid. M = 100 12.2 2.0 ∗ 10−11 M = 200 31 2.0 ∗ 10−11 M = 400 86 1.4 ∗ 10−11 M = 800 213 4.5 ∗ 10−9 FEAST Time(s) Resid. 7.8 4.5 ∗ 10−10 14 5.5 ∗ 10−10 21 1.8 ∗ 10−10 58 3.4 ∗ 10−11 TABLE I: Simulations times and relative residual maxi (||Axi − λi Bxi ||1 /||Axi ||1 ), obtained by the solver ARPACK and FEAST on the TEST-CNT system seeking M (lowest) eigenpairs for different search intervals. The simulations are performed on a Intel Clovertown (8cores, 1 node, 2.66GHz, 16Gb). The shift-strategy has been used in ARPACK to accelerate the convergence (the regular mode would give ∼ 300s for M = 100). The inner linear systems in ARPACK and FEAST are both solved using the direct parallel solver PARDISO [15] on 8 cores. Finally, the size of the subspace has been chosen to be M0 = 1.5M for both algorithms, and the number of contour points for FEAST is fixed at Ne = 8. that only one loop is necessary to obtain the eigenvalues with an accuracy of ∼ 10−5 or below. TEST-CNT N = 12, 450 M = 100 M = 200 M = 400 M = 800 Relative error on the Trace 1st loop 2nd loop 3rd loop 3.0 ∗ 10−6 2.9 ∗ 10−12 1.0 ∗ 10−15 1.8 ∗ 10−5 4.8 ∗ 10−12 2.1 ∗ 10−14 2.4 ∗ 10−8 3.2 ∗ 10−16 1.8 ∗ 10−9 4.3 ∗ 10−16 TABLE II: Variation of the relative error on the trace of P the eigenvalues m λm for different search intervals with the number of iterative refinement loops. The convergence criteria is set to 10−13 where the final relative residual on the eigenpairs is reported in Table I. The simulation results in Table I demonstrate very good scalability for FEAST while the search interval keeps increasing but the number of contour points Ne stays identical (i.e. the number of numerical operations stays the same for a given loop of FEAST with a fixed Ne = 8 linear systems to solve). In addition, from Table III, one can see how the robustness of the FEAST algorithm is affected while the number of contour points Ne changes. In particular, Ne = 4 points along the contour did suffice to capture M = 100 eigenpairs with a relatively small residual (decreasing the simulation time reported in Table I for this case), while the case Ne = 16 points generated a residual smaller than the one obtained by ARPACK (using M0 = 1.5M). B. Example II In another set of numerical experiments, we intend to demonstrate the robustness of FEAST in capturing the 5 TEST-CNT ARPACK N = 12, 450 M = 100 Time(s) Resid. (N, M) 12.2 2.0 ∗ 10−11 2(N, M) 85 3.5 ∗ 10−11 4(N, M) 668 4.6 ∗ 10−11 8(N, M) 5492 6.2 ∗ 10−11 FEAST Time(s) 7.8 27 109 523 Resid. 4.5 ∗ 10−10 7.7 ∗ 10−10 8.8 ∗ 10−10 6.5 ∗ 10−10 TABLE IV: Simulations times and relative residual maxi (||Axi − λi Bxi ||1 /||Axi ||1 ), obtained by the solver ARPACK and FEAST on the k(N, M) TEST-CNT systems which artificially reproduce k times the original TEST-CNT system. The kM (lowest) eigenpairs are found where each eigenvalue has a multiplicity of k. 0 -2 E (eV) multiplicity of the eigenvalues. We propose to create artificially new TEST-CNT systems called k(N, M) where the matrices A and B are repeated k times along the main diagonal (the new system matrix is block diagonal with k blocks). Physically, these systems can describe the cross section of a bundle composed by k CNTs, where we do not consider the interactions between the different tubes such that each eigenvalue is now k times degenerate. If we keep the same search interval used to obtain M = 100 eigenpairs for k = 1 (where the size of the matrices A and B is N), 100k eigenpairs must now be found for k ≥ 1, where each one of them have the multiplicity k. In Table IV, we report the simulation times and relative residuals obtained using ARPACK and FEAST on these k(N, M) TEST-CNT systems. For the case 8(N, M), for example, the size of the new system matrix is 99, 600 and the first 100 eigenvalues have all the multiplicity 8 (so 800 eigenpairs are found in total). The simulation results show linear scalability performances with the size of the system and the number of eigenpairs. In contrast to ARPACK where the number of matrix-vector multiplications and linear system solves would keep increasing with k, the number of operations in FEAST stays the same for all these cases. The scalability of the algorithm depends then mainly on the scalability of the linear system solver. Example III We have shown that FEAST can re-use the computed subspace as suitable initial guess for performing iterative refinements. This capability can also be of benefit to modern applications in science and engineering where it is often necessary to solve a series of eigenvalue problems that are close one another. In bandstructure calculations, in particular, many eigenvalue problems of the form (A + Sk )xk = λk Bxk need to be solved at different locations in the k-space (i.e. for different values of k and where S is Hermitian with S0 = I). Let us consider the eigenvalue sparse system of size N = 492, 982 obtained for a (5,5) metallic CNT using our in-house DFT/real-space mesh technique framework for bandstructure calculations of nanowires-type structure [16]. In Figure 3, we propose to solve this eigenvalue problem using the same search interval for the eigenvalues λ for different locations of k where the subspace computed by FEAST at the point k − 1 is successively used as initial guess for the neighboring point k. In addition, the inner linear systems in -4 -6 -8 -10 #Eigenvalues TABLE III: Performance results obtained by FEAST seeking M = 100 eigenpairs for different values of Ne . The convergence is obtained when the error on the trace is equal or smaller to 10−13 . C. #FEAST loop TEST-CNT FEAST M = 100 Time(s) Resid. # loops Ne = 4 7.0 8.3 ∗ 10−8 6 Ne = 8 7.8 4.5 ∗ 10−10 4 Ne = 16 10.2 3.4 ∗ 10−12 3 -12 20 20 18 18 16 16 14 14 12 4 12 4 3 3 2 2 1 1 0 Γ k 0 X FIG. 3: Bandstructure calculations of a (5,5) metallic CNT. The eigenvalue problems are solved successively for all the k points (from Γ to X), while the computed subspace of size M0 = 25 at the point k is used as initial guess for the point k + 1. The number of eigenvalues found ranges from 13 to 20, and by the third k point, the FEAST convergence is obtained using only one refinement loop. The convergence is obtained with the relative error on trace of the eigenvalues smaller or equal to 10−8 , while the inner linear systems are solved using an iterative method with an accuracy of 10−3 . The final relative residuals on the eigenpairs range from 10−3 to 10−5 . FEAST are solved using an iterative method with preconditioner where a modest relative residual of 10−3 is used (e.g. a suitable banded preconditioner can be obtained using a mode approach [9]). It should be noted that the convergence criteria for the relative error on the trace of the eigenvalues is chosen much smaller at 10−8 , while the eigenvectors are expected to be obtained within the same (or a smaller) order of accuracy that the one used 6 for the solutions of the inner systems. Figure 3 shows that 13 to 20 eigenvalues (i.e. energies) are found within the selected search interval along the different k points (from the Γ to the X point in the graph). Although the size of the subspace stays identical at M0 = 25, after the first initial point at k = 0 (Γ point in the graph) FEAST converges within only one refinement loop for almost all the other k points. V. DISCUSSIONS In comparison to iterative Krylov subspace techniques, FEAST can be cast as a ”direct” technique which is based on an exact mathematical derivation (3). FEAST does naturally then capture all the multiplicity and noorthogonalization procedure is necessary (such as GramSchmidt orthogonalization process). As described above, the main computational tasks in FEAST consist of solving Ne independent linear systems along the contour with M0 right-hand-sides and a reduced dense generalized eigenvalue problem of size M0 . Since FEAST has the ability to re-use the basis from the previously computed subspace, an outer-iterative refinement procedure is proposed to improve the accuracy of the solutions. The capability to take advantage of suitable initial guess can also be of benefit to modern applications in sciences and engineering where it is often necessary to solve a series of eigenvalue problems that are close one another (e.g. Bandstructure calculations in Example III Section IV). In one sense, the difficulty of solving an eigenvalue problem has been replaced by the difficulty of solving a linear system with multiple right-hand sides. For large sparse systems, this latter can be solved using either a direct system solver such as PARDISO [15] (as proposed in Section IV), or an iterative system solver with preconditioner. In turn, for banded systems or banded preconditioner, FEAST can be seen as an outer-layer for the author’s SPIKE parallel system solver [17]. It should be noted that the inner linear systems arising from standard eigenvalue solvers (using the shift-strategy), need often to be solved highly accurately via direct methods. Direct system solvers, however, are not always suited for addressing large-scale modern applications because of memory requirements. In Example III of Section IV we have shown that FEAST can take advantage of iterative solvers for solving the inner linear systems with modest [1] G. Golub and H. A. van der Vorst, J. of Comput. and Appl. Math. 123, 35 (2000). [2] Z. Bai, J. Demmel, J. Dongarra, A. Ruhe, and H. van der Vorst, Templates for the solution of Algebraic Eigenvalue Problems: A Practical Guide (Society for Industrial and Applied Mathematics, Philadelphia, PA, 2000). [3] T. Torsti, M. Heiskanen, M. J. Puska, and R. M. Nieminen, Int. J. Quantum Chem 91, 171 (2003). relative residual and obtaining the eigenvectors solution within the same order of accuracy. The resulting subspace could also be used as a very good initial guess for a one step more accurate refinement procedure (i.e. using more accurate relative residual for the inner systems). FEAST exhibits important potentialities for parallelism at three different levels: (i) many search interval [λmin , λmax ] can be run independently, (ii) each linear systems can be solved simultaneously (e.g. on each node of parallel architecture where the factorization of the linear system can be done only once for all the refinement loops), (iii) the linear system solver can be parallel (e.g. within a given node as in Section IV). Depending on the parallel architecture at hand, the local memory of a given node and the properties of the matrices of the eigenvalue problems, one may preferably select one parallel option among the others, or just take advantage of a combination of those. In particular, there will be a trade off between how many search intervals to consider and how many eigenpairs FEAST can handle by intervals. For example if M0 is more than few thousands, one could either (i) solve the obtained reduced system of size M0 using efficient dense parallel symmetric eigenvalue solvers [18], or (ii) propose to divide the initial search interval into two or more to be processed in parallel. In addition, it should be noted that the orthonormalization step is absent from FEAST which will drastically reduce the communication overhead for performing scalar products on high-end parallel architectures (the scalar product in step-3 in Fig. 2 has to be done only once per iterative refinement). Given the recent advances in parallel architectures and parallel linear system solvers, it is reasonable to envision using FEAST in a near future for obtaining up to millions of eigenpairs of large sparse symmetric eigenvalue problems. Finally the capabilities of FEAST could potentially be enhanced for addressing non-symmetric eigenvalue problems where the contour integration would then be performed in a given region of the complex space. Acknowledgments The author wishes to acknowledge helpful discussions with Dr. Ahmed Sameh and Dr. Massimo Fischetti. This material is supported by NSF under Grant #CCF0635196. [4] Y. Saad, Y. Zhou, C. Bekas, M. L. Tiago, and J. Chelikowsky, physica status solidi (b) 243, 2188 (2006). [5] Y. Zhou, Y. Saad, M. L. Tiago, and J. Chelikowsky, Phys. Rev. E. 74, 066704 (2006). [6] R.Zeller, J. Deutz, and P. Dederichs, Solid state communications 44, 993 (1982). [7] J. Taylor, H. Guo, and J. Wang, Phys. Rev. B. 63, 245407 (2001). 7 [8] M. Brandbyge, J.-L. Mozos, P. Ordejon, J. Taylor, and K. Stokbro, Phys. Rev. B. 65, 165401 (2002). [9] D. Zhang and E. Polizzi, J. Comput. Elec. 7, 427 (2008). [10] D. Zhang and E. Polizzi, 2008 NSTI Nanotechnology Conference and Trade Show. Technical Proceedings. 1, 12 (2008). [11] T. Sakurai and H. Sugiura, J. of Comput. and Appl. Math. 159, 119 (2003). [12] T. Sakurai, Y. Kodaki, H. Tadano, D. Takahashi, M. Sato, and U. Nagashima, Future Generation Computer Systems 24, 613 (2008). [13] E. Anderson, Z. Bai, C. Bischof, S. Blackford, J. Demmel, J. D. C. J. Dongarra, A. Greenbaum, S. Hammarling, A. McKenney, and D. Sorensen, LAPACK Users Guide (Society for Industrial and Applied Mathematics, Philadelphia, PA, 1999), third ed. ed. [14] R. B. Lehoucq, D. C. Sorensen, and C. Yang., ARPACK Users Guide: Solution of Large Scale Eigenvalue Problems with Implicitly Restarted Arnoldi Methods. (Society for Industrial and Applied Mathematics, Philadelphia, PA, 1998). [15] O. Schenk and K. Gärtner, Journal of Future Generation Computer Systems 20, 475 (2004). [16] D. Zhang and E. Polizzi, in preparation (2009). [17] E. Polizzi and A. Sameh, Parallel Computing 32, 177 (2006). [18] L. Blackford, J. Choi, A. Cleary, E. D’Azevedo, J. Demmel, I. Dhillon, J. Dongarra, S. Hammarling, G. Henry, A. Petitet, et al., ScaLAPACK Users Guide (Society for Industrial and Applied Mathematics, Philadelphia, PA, 1997).
5cs.CE
Statistics and Computing manuscript No. (will be inserted by the editor) A critical analysis of resampling strategies for the regularized particle filter arXiv:1705.04219v1 [stat.CO] 11 May 2017 Pierre Carmier · Olexiy Kyrgyzov · Paul-Henry Cournède March 16, 2018 Abstract We analyze the performance of different resampling strategies for the regularized particle filter regarding parameter estimation. We show in particular, building on analytical insight obtained in the linear Gaussian case, that resampling systematically can prevent the filtered density from converging towards the true posterior distribution. We discuss several means to overcome this limitation, including kernel bandwidth modulation, and provide evidence that the resulting particle filter clearly outperforms traditional bootstrap particle filters. Our results are supported by numerical simulations on a linear textbook example, the logistic map and a non-linear plant growth model. Keywords Particle filtering · Bayesian inference · Hidden Markov model · Kernel density estimation 1 Introduction Sequential Monte Carlo (SMC) methods [13, 16] are powerful algorithms which allow performing Bayesian inference in dynamic systems. These methods, also known under the heading of particle filters in the context of dynamic systems, have become extremely popular way beyond the borders of the statistics community and are nowadays widely used by engineers and scientists from other fields faced with nontrivial inference tasks which naturally abound with the emergence of data science. The purpose of this paper is to provide a critical analysis of the performance of regularized particle filter (RPF) algorithms [26, 30] which represent an interesting variation of traditional particle filters. They rely on kernel-based [31] posterior density estimation at each filtering step, with particle resampling performed from the [email protected] Biomathematics Team, MICS Lab, CentraleSupélec, Université Paris-Saclay, France structed density. In many situations, this method was proven to help prevent sample impoverishment [16] and thereby enhance the robustness of particle filtering. Our main achievement will be to demonstrate in this paper that the approach which consists in resampling systematically can lead to seriously over-estimate the posterior mean squared error, motivating us to exhibit alternative resampling strategies which allow fully resolving this issue. Before going any further, let us introduce the general framework we shall be working with in the rest of this paper. To begin with, we shall assume that the processes from which we seek to infer some information belong to the family of hidden Markov models (HMM) [4], which describe stochastic processes characterizing the evolution in discrete time n of two sets of random variables {xn }n≥0 and {yn }n≥1 , respectively defined on some space X ⊆ Rdx and Y ⊆ Rdy . The former are hidden random variables referred to as states, while the latter are noisy observations of the former. Starting from a prior probability measure π0 (dx0 ) on the initial state, hidden variables follow a Markovian evolution characterized by a sequence of Markov kernels fn (dxn |xn−1 ) also named transition functions. Observations are considered conditionally independent and described by a conditional probability density function gn (yn |xn ), the so-called measurement function, with respect to the Lebesgue measure λ . Parameters {Θ }, with a compact support set, can easily be accounted for in that framework by augmenting the size of the state space, as can the presence of environmental variables {un }n≥0 defined on some space U ⊆ Rdu . A problem of broad interest in this context is to determine the posterior probability measure πk (dxk |y1:n ) given a sequence of observations y1:n = {y1 , ..., yn }. If k < n, this is called a smoothing problem, while if k > n this is a prediction problem. In the following we shall be interested in the situation where k = n, which is called the filtering problem. R Thus, given any Borel set A ⊂ X, πn (A) = A πn (dxn |y1:n ) 2 Pierre Carmier et al. shall be the posterior probability of event A. More generally, for any test function φ defined on X, applying Bayes rule recursively allows expressing the integral of φ with respect to the posterior probability measure as a function of past measurement and transition functions [4] Z X = φ (xn )πn (dxn |y1:n ) 1 Zn n Z Xn+1 (1) φ (xn )π0 (dx0 ) ∏ g j (y j |x j ) f j (dx j |x j−1 ) , j=1 introducing the marginal likelihood Z Zn = Xn+1 n π0 (dx0 ) ∏ g j (y j |x j ) f j (dx j |x j−1 ) . (2) modified particle filter clearly outperforms that of the original bootstrap particle filter [18]. The rest of the paper is organized as follows. In section 2, we recall basic principles of SMC methods and introduce the bootstrap particle filter and the RPF, before illustrating what can potentially go wrong when resampling is performed on a systematic basis. We then provide analytical insight regarding the effect of different resampling strategies on the behavior of the RPF in section 3, using a very simple linear textbook example for illustrative purposes. That our results qualitatively hold for more general, non-linear, models is discussed in section 4. Conclusions are drawn in section 5, while a series of technical details are gathered in appendices. j=1 The purpose of SMC methods [28, 14, 16] is to provide an estimation of such probability measures in the general case of nonlinear state-space models, where analytical attempts are essentially hopeless. The idea of such methods is to represent the probability distributions by particles, i.e. independent identically distributed samples of the distributions, and to propagate and update them using the HMM equations, hence the equivalent nomenclature of particle filter methods. The estimation of parameters in this context has received acute attention from the community these last years (see [24] for a review). One of the main challenges is to circumvent the celebrated particle degeneracy problem [18] and to ensure that parameter space is sufficiently explored to enable accurate estimation. Several methods have been proposed to address this challenge, among which iterated filtering [20] and particle Markov chain Monte Carlo [1] in the specific context of joint parameter / hidden state estimation. They constitute batch or offline methods, however, in that they are unable to take into account new observations dynamically, as opposed to online algorithms such as SMC2 [10, 21]. A different idea, introduced some time ago in [36] and discussed in more detail in [27, 30], is to allow freedom in parameter space by regularizing the posterior density using a mixture. In this paper, we focus on the RPF introduced in Ref. [26] and further developed and discussed in Refs [30, 2, 7, 17]. We shall highlight some shortcomings of this approach when resampling is performed systematically (as routinely done), which can be made explicit by computing the posterior mean squared error. In particular, building upon some well-known results obtained for linear Gaussian state-space models, we prove that the mean squared error is lower bounded by a positive constant when the number of particles is finite, independently of the number of observations. We shall provide a detailed understanding of this phenomenon on a very simple linear textbook example, offering evidence that it is related to the particle filter losing memory of past observations. We will then show that longranged memory can be restored by appropriately modulating the kernel bandwidth and that the efficiency of this suitably 2 Sequential Monte Carlo methods Let us begin by recalling the basic principles of particle filter methods. Starting from the initial prior probability measure (i) from which N particles are sampled, x0 ∼ π0 (dx0 ), particles are propagated until the next time step using a Markov (i) (i) kernel generally chosen [18, 25] as x1|0 ∼ f1 (dx1 |x0 ) in (i) nonlinear state space models for which f1 (dx1 |x0 , y1 ) is not readily available [28]. The resulting empirical estimator for the predicted probability measure can be expressed as N π1|0 (dx) = 1 N ∑ δx(i)1|0 (dx) N i=1 (3) with δ the Dirac measure. The estimator for the updated posterior probability measure is obtained by weighting each particle according to the observation y1 : N (i) π1N (dx1 |y1 ) = ∑ w1 δ i=1 (i) x1|0 (dx1 ) (4) with weights (i) (i) w1 = g1 (y1 |x1|0 ) (5) ( j) ∑Nj=1 g1 (y1 |x1|0 ) suitably normalized to ensure that total weight is conserved. Given any bounded function φ defined on X, its integral with respect to the empirical posterior probability measure is then given by Z X N (i) (i) φ (x1 )π1N (dx1 |y1 ) = ∑ w1 φ (x1|0 ) , (6) i=1 and the estimator can be shown to converge asymptotically, for an infinite number of particles, towards the true posterior probability measure given by Bayes rule [9]: Z lim N→∞ X φ (x1 )π1N (dx1 |y1 ) = Z X φ (x1 )π1 (dx1 |y1 ) . (7) A critical analysis of resampling strategies for the regularized particle filter Practically speaking, however, one always works with a finite number of particles and life is not as simple. A wellknown problem which can occur with the above estimation procedure is the so-called weight degeneracy issue [16]. If the likelihood is relatively peaked around the observation value, or in other words if the observation noise is rather small, particle weights will differ by orders of magnitude depending on the distance between the particle and the observation. Actually, this will happen almost regardless of the magnitude of the observation noise for a sufficient number of observations, since iterating the above procedure yields (i) (i) wn ∝ ∏nj=1 g j (y j |x j| j−1 ), using the recursive formulation (i) (i) x j| j−1 ∼ f j (dx j |x j−1 ). This implies that, eventually, most of the weight will be carried by a small number of particles, with a dramatic effect on the precision of the resulting estimation as can be seen by looking at the unbiased estimator of the marginal likelihood at step n: 3 2.1 Regularized particle filter In Ref. [26], LeGland, Musso and Oujdane proposed to address these shortcomings by regularizing the probability measure using a Parzen-Rosenblatt [31] kernel density estimator. The idea is to replace the Dirac measure by a measure able to smoothly interpolate between all weighted particles. In other words, observing that the coarse-grained density on Borel set Aε ⊂ X N 1 1 (i) πnN (Aε ) = wn δ (i) (Aε ) , ∑ xn|n−1 λ (Aε ) λ (Aε ) i=1 R where λ (Aε ) = Aε λ (dxn ), the regularization procedure consists in replacing δx (Aε )/λ (Aε ) as λ (Aε ) → 0 by a kernel density function with respect to the Lebesgue measure [35], thanks to which the regularized estimator for the posterior probability density function reads N ZnN 1 N n (i) = ∑ ∏ g j (y j |x j| j−1 ) . N i=1 j=1 (8) (12) (i) (i) pNn (xn |y1:n ) = ∑ wn Khn (xn − xn|n−1 ) , (13) i=1 with Its variance can be estimated using the standard empirical estimator 1 N ∑ N 2 i=1 !2 n (i) ∏ g j (y j |x j| j−1 ) − ZnN j=1 where we introduced the effective sample size 1 (i) ∑Ni=1 (wn )2 (10) which is a measure of the effective number of particles [25, 6]: if all particles carry the same weight, ESSn = N, while if a single particle carries all the weight, ESSn = 1. This result therefore illustrates that the accuracy of the estimation by the empirical measure relies on a relatively homogeneneous distribution of particle weights. A natural strategy to counter the effect of particle degeneracy is to ’unweight’ particles by resampling from the em(i) pirical posterior probability measure, xn ∼ πnN (dxn |y1:n ), such that the new approximation to the posterior is π̃nN (dxn |y1:n ) = 1 N ∑ δx(i)n (dxn ) . N i=1 (i) ( j) (i) (i) • xn|n−1 ∼ fn (dxn |xn−1 )   (ZnN )2 ESSn = , 1− ESSn N (9) ESSn = (i) • wn = gn (yn |xn|n−1 )/ ∑Nj=1 gn (yn |xn|n−1 ) (11) This is the idea behind the bootstrap particle filter [18], also known as the sequential importance resampling (SIR) algorithm. Its main drawback is that resampling according to a probability measure such as Eq. (4) essentially duplicates particles (particles are selected following a multinomial law), leading to so-called sample impoverishment [16]. (i) • xn−1 ∼ pNn−1 (xn−1 |y1:n−1 ) . In the following, we shall consider a Gaussian kernel Khn = N(0, h2n ): Eq. (13) then effectively describes a Gaussian mixture and resampling according to this distribution now consists in a two-step procedure, with the particle selection (performed using the systematic resampling algorithm [19]) complemented by a perturbation controlled by the kernel bandwidth hn . Each particle generated in the process is thus unique. Note that, if the likelihood function gn is unknown, it can itself be emulated by a kernel density estimator [2, 7]. There is a whole literature on how the kernel bandwidth hn can be chosen. For now, we will follow Ref. [30] and pick h2n = αh Σn , with  αh = 4 N(dx + 2)  2 dx +4 . (14) This minimizes the mean integrated squared error  choice  N 2 E ||pn − pn ||L2 , provided the true probability density function pn is Gaussian (see Appendix A for the proof in one dimension with uniform weights). In practice, the true covariance matrix Σn is unknown and is therefore replaced by an (i) (i) estimator ΣnN based on the weighted samples (xn|n−1 , wn ): ΣnN = N N (i) (i) ∑ wn (xn|n−1 − µnN )2 N − 1 i=1 (i) (i) (15) with µnN = ∑Ni=1 wn xn|n−1 . As an important corollary, because limN→∞ hn = 0, we retrieve asymptotically that, just 4 Pierre Carmier et al. as for the empirical probability measure, the regularized estimator converges towards the true posterior density:     2 E ||pNn − pn ||L2 = O N − dx +4 . (16) N→∞ 2.2 Problem statement While the general strategy underlying the RPF seems very principled, we proceed to highlight a problem which can be encountered when resampling is performed on a systematic basis, i.e. at every step, as generally done. Recall that, given a prior probability measure π0 (dx0 ) and a series of observations {y1:n }, we seek to determine the true posterior distribution x̂n ∼ πn (dxn |y1:n ). In particular, we wish to estimate how the RPF estimator x̂Nn ∼ pNn (xn |y1:n ) fares with respect to x̂n . In what follows, we shall provide evidence that, for a finite number of particles, the RPF estimator features a systematic deviation from the true posterior density which increases with the number of observations. This deviation can be made explicit by comparing the root mean squared error of the RPF with that of the true posterior density:  1/2 RMSE(x̂n , xn ) = E ||x̂n − xn ||2 q = ||µn − xn ||2 + Tr[Σn ] , (17) where ||.|| indicates the usual Euclidean norm, and introducing the mean value µn := E[x̂n |y1:n ] and the covariance matrix Σn := E[(x̂n − µn )(x̂n − µn )T ]. For illustrative purposes, consider the very simple case of a one-dimensional stationary state xn+1 = xn with time-independent additive observation noise η ∼ N(0, R): yn = xn + η. This is of course an elementary textbook setting, which is in fact a special case of the Kalman filter framework which shall be reviewed in the following section. The advantage of this setup is to provide us with the exact result with respect to which particle filter expectations can be benchmarked. In the left frame of Fig. 1, we plot the analytical solution and compare it with the outcome of the RPF when resampling is performed at each step. As can be clearly seen, while the analytical expectation steadily decreases with each new observation, the RMSE computed using the RPF rather quickly saturates and remains lower bounded by a positive constant no matter how many observations are considered. The explanation for this behavior essentially stems from the fact that resampling from the regularized estimator, while allowing to explore particle space, also acts as a perturbation which increases the variance of the estimator. This perturbation becomes detrimental for the estimation process in the long run, as is manifest in the left frame of Fig. 1. While this problem was already acknowledged in a slightly different context in the early days of particle filters [36], some of its implications may not have been fully grasped at the time. In partic- ular, we claim that the over-estimation of the variance prevents the estimator from remaining asymptotically efficient as the number of observations increases, in a sense which shall be defined shortly. Mathematical arguments supporting this claim for linear state-space models will be provided in the following section, while numerical simulations indicating that our results extend to non-linear models will be presented in section 4. 3 Theoretical results in the linear Gaussian case We now address the origin of the saturation effect in the estimated RMSE in more detail and claim that it can be understood using results which we obtain in the setting of linear Gaussian state-space models. Before providing mathematical evidence supporting our claim, we begin by recalling standard results for the derivation of the filtered probability density function in the linear Gaussian case, which is the framework of the famous Kalman filter. 3.1 Kalman filter framework The framework of the Kalman filter [22, 23] is obtained by considering the special case where transition and measurement functions are linear, and assuming that noise and prior probability density functions are Gaussian distributed with respect to the Lebesgue measure. The HMM equations then read xn = An xn−1 + εn (18) yn = Bn xn + ηn where {An }n≥1 and {Bn }n≥1 are referred to as transition and measurement matrices, and with εn ∼ N(0, Qn ) and ηn ∼ N(0, Rn ). In this situation, given a prior x̂0 ∼ N(µ0 , Σ0 ), the filtering problem can be solved exactly: analytical expressions can be obtained for the posterior x̂n ∼ N(µn , Σn ) which is fully characterized by its mean value µn and (symmetric positive definite) covariance matrix Σn . Their expressions are provided by the recursive formulae −1 Σn−1 = Σn|n−1 + BTn R−1 n Bn −1 µn|n−1 + BTn R−1 Σn−1 µn = Σn|n−1 n yn , (19) with µn|n−1 = An µn−1 and Σn|n−1 = An Σn−1 ATn + Qn (see Appendix B for a derivation). A simple way of obtaining these results is to make use of the Bayesian conjugacy property of Gaussian distributions: in other words, given a Gaussian prior and a Gaussian likelihood, the posterior is also Gaussian. Applying Bayes rule to the predicted and posterior probability measures, respectively as πn|n−1 (dxn |y1:n−1 ) = Z X fn (dxn |xn−1 ) × πn−1 (dxn−1 |y1:n−1 ) , (20) A critical analysis of resampling strategies for the regularized particle filter 5 1 RMSE RMSE 1 0,1 0,01 1 10 n 0,1 0,01 1 100 10 100 n Fig. 1 Left frame: Normalized root mean squared error (RMSE) of the estimated state as a function of the number of observations in logarithmic scale for N = 1000 particles and normalized observation noise variance R/Σ0 = 0.25. The black solid line is the expectation based on the Kalman filter, while the red solid line is the outcome of the RPF with resampling at each step. The latter clearly shows a saturation effect at a value given by the red dotted line, which we compute analytically in section 3. Blue lines are for N = 10000 particles and green lines for R/Σ0 = 1. The black dashed line is obtained by taking into account the bandwidth perturbation inside the√Kalman filter, with a quench in normalized observation noise variance from 0.25 to 1 at n = 300. Other parameters: prior mean value µ0 = x0 + Σ0 . Right frame: Likewise, for different bandwidth selection criteria: Silverman’s rule of thumb h2n = (4/N)2/3 Σn (dark green), direct plugin method by Sheather and Jones [33] (orange), West shrinkage [36] (cyan) and our proposal of kernel bandwidth modulation αn = αh /(1 + nαh ) (violet). and gn (yn |xn )πn|n−1 (dxn |y1:n−1 ) , X gn (yn |xn )πn|n−1 (dxn |y1:n−1 ) πn (dxn |y1:n ) = R (21) thus allows for a straightforward derivation of Eq. (19). We next focus on the special case where all states are assumed stationary. This corresponds to taking Ak = I and Qk = 0 for k ≥ 1 in Eq. (18). If we further fix the measurement covariance matrices to unity Bk = I and assume that observation noise covariance matrices are time-independent, one can show using the matrix inversion lemma that Σn = R(R + nΣ0 )−1 Σ0 µn = Σn Σ0−1 µ0 + (I − Σn Σ0−1 )hyin (22) with hyin := ∑nj=1 y j /n the maximum likelihood estimator. This situation corresponds to a multi-dimensional generalization of the stationary model we considered earlier. Note that Σn reaches the Cramer-Rao bound R/n as n → ∞, while limn→∞ µn = x0 : we thus retrieve that, in accordance with the Bernstein-von Mises theorem, the Bayes estimator x̂n is asymptotically efficient and coincides in that limit with the maximum likelihood estimator, as the dependence on the choice of prior vanishes. The corresponding RMSE = O(n−1/2 ) also vanishes asymptotically. This behavior might seem like a natural byproduct in the limit of a large number of observations, since the latter might be expected to eventually provide sufficient information for an arbitrarily accurate estimation of the true state. There are, however, elementary counterexamples to this fact which can be very easily proven using the Kalman filter equations we have derived. For example, if we restore a simple time-independent transition matrix A = aI to the above estimation paradigm, one can easily show that the asymptotic behavior of Σn depends on the magnitude of a: while if a < 1, the covariance matrix decays exponentially fast, if a > 1 however, then the covariance matrix remains lower bounded as Σn ≥ (1 − a−2 )R. Note that if a = 1, we recover the algebraic dependence as stated in Eq. (22). Another enlightening case is when state noise Q 6= 0 is included. Given time-independent state and observation noises, one can show that Σn necessarily remains lower bounded by a positive matrix [4]. 3.2 Regularized RMSE asymptotics Let us now investigate how the above results can be transposed in the framework of the RPF. For a Gaussian regularizing kernel, Bayesian conjugacy ensures that the posterior distribution Eq. (13) is asymptotically Gaussian: pNn (xn |y1:n ) = 1 N (i) (i) ∑Ni=1 gn (yn |xn|n−1 )Khn (xn − xn|n−1 ) 1 N ( j) ∑Nj=1 gn (yn |xn|n−1 ) 0 N 0 0 0 X λ (dxn )pn|n−1 (xn |y1:n−1 )gn (yn |xn )Khn (xn − xn ) R N 0 0 0 X λ (dxn )pn|n−1 (xn |y1:n−1 )gn (yn |xn ) R ≈ N→∞ , (23) with mean   N N N −1 N T −1 (Σn|n−1 )−1 + BTn R−1 n Bn µn = (Σ n|n−1 ) µn|n−1 +Bn Rn yn (24) 6 Pierre Carmier et al. and covariance matrix  −1 N ΣnN = h2n + (Σn|n−1 )−1 + BTn R−1 n Bn  −1 N = (1 + αh ) (Σn|n−1 )−1 + BTn R−1 , n Bn (25) Lemma 1 Consider the recursively defined set of equations for n ≥ 1 on the couple of variables (µn , Σn ), (26) Σn = (1 + αn )R (R + Σn−1 )−1 Σn−1 where {αn }n≥1 is a sequence of positive real numbers, and R and {y}n≥1 are defined as in Eq. (22). Starting from the initial condition (µ0 , Σ0 ), the solution to the above set of equations can be expressed as  −1 j−1 Σn = ∏nj=1 (1 + α j )R R + ∑nj=1 ∏k=0 (1 + αk )Σ0 Σ0 µn = 1 Σn Σ0−1 µ0 n (1 ∏ j=1 + α j ) 1 Σn Σ0−1 + I− n (1 ∏ j=1 + α j ) ! 1 Σ N Σ −1 µ0 (1 + αh )n n 0  n  (1 + αh ) j−1 y j 1 N −1 ∑ j=1 Σ Σ + I− n n 0 (1 + αh )n ∑ j=1 (1 + αh ) j−1 µnN = N N N N AT + Q , and with µn|n−1 = An µn−1 and Σn|n−1 = An Σn−1 n n where αh is defined in Eq. (14). Note that, as N → ∞, we recover the standard Kalman result from Eq. (19) as we should, since the kernel acts as a Dirac delta-function in Eq. (23) as αh → 0. Additionnally, while we work in the limit of N → ∞ and choose to conserve the N-dependence of the kernel bandwidth, we explicitly assume the Monte Carlo error ∝ N −1/2 is negligible when replacing the sum by the integral in Eq. (23). We now proceed to illustrate the consequences of Eqs. (24,25) by returning for simplicity to the case of stationary states, where exact expressions for the posterior moments can be obtained by solving Eqs. (24,25) recursively. For reasons which will be clear later, we shall allow the possibility for αh to be time-dependent. Note that our analysis should carry over to any dynamical system described by Eqs. (18) for which the Bayes estimator is asymptotically efficient: this includes systems with noiseless and compact supported state dynamics, and for which the observation model is regular in some sense [5].  −1 −1 Σn−1 + R−1 µn = Σn−1 µn−1 + R−1 yn indicated in Eq. (14): αn = αh ∀n ≥ 1. Expressions for the posterior moments simplify as  −1 ΣnN = (1 + αh )n R R + ∑nj=1 (1 + αh ) j−1 Σ0 Σ0 j−1 ∑nj=1 ∏k=0 (1 + αk )y j j−1 ∑nj=1 ∏k=0 (1 + αk ) (27) with α0 = 0. Proof This can be straightforwardly proven by recurrence. t u As a first application of lemma 1, consider the case where the sequence {αn }n≥1 is time-independent. This is our original motivation, corresponding to the choice of bandwidth (28) We obtain as a direct consequence that, if αh > 0 (for finite N), the covariance matrix does not converge to zero as the number of observations increases. Theorem 1 (RPF fixed point) The RPF estimator for the posterior covariance matrix converges exponentially fast towards a non-vanishing fixed point: lim Σ N n→∞ n = αh R(1 + O(e−nαh )) . (29) Likewise, the estimated mean value converges exponentially fast towards a random variable µnN ≈ n→∞  ∑nj=1 (1 + αh ) j−1 y j 1 + O(e−nαh ) n j−1 ∑ j=1 (1 + αh ) (30) centered around the observation mean value xn = x0 , with residual covariance αh lim E[(µnN − xn )(µnN − xn )T ] = R. (31) n→∞ 2 + αh √ As a result, the asymptotic RMSE = O( αh ) remains lower bounded by a positive constant as soon as the number of particles is finite, no matter how many observations. As we have already mentioned, this situation can also occur in the original Kalman filter (retrieved in the limit of an infinite number of particles) as soon as process noise Q 6= 0 is included. In the present case, the reason for this phenomenon is that the kernel bandwidth used for resampling acts as a perturbation which increases the variance and competes with the variance reduction due to each new observation. The problem is that the variance reduction rate with ΣnN is faster (quadratic) than that of the bandwidth (linear): N − Σ N = (α R − Σ N )(R + Σ N )−1 Σ N . Arrives therefore Σn+1 h n n n n a moment when the ever smaller piece of information provided by the new observation is exactly compensated by the bandwidth perturbation. A complementary and enlightening interpretation of our results can be put forward by noting that each observation in Eq. (30) contributes differently to the estimated posterior mean value, i.e. each y j carries a different weight. In particular, the weighting ratio between first (oldest) and last (most recent) observations roughly scales like e−nαh , which signifies that the RPF estimator loses memory of previous observations exponentially fast. This loss of memory is directly A critical analysis of resampling strategies for the regularized particle filter responsible for the inability of the estimator to process the information provided by the full history of observations as exhaustively as the Kalman estimator, since it acts as an effective temporal resolution. The lower bound on the RMSE obtained in theorem 1 is thus simply the translation of this temporal resolution in state space. Returning to Fig. 1, we check the validity of our results by comparing them with numerical simulations of the one-dimensional stationary HMM introduced in section 2.2. Interestingly, although conclusions of theorem 1 based on Eqs. (24,25) were derived in the asymptotic limit N → ∞, numerical simulations support their well-foundedness already for N = 1000 particles. The late time fluctuations in the RMSE of the RPF correspond to those of mean value in Eq. (31). Next, because limN→∞ αh = 0, we expect according to theorem 1 the lower bound to decrease as N increases. This is clearly illustrated by the blue curve in the left frame of Fig. 1. Increasing the observation noise variance obviously leads to the opposite effect (green curve). We plotted as a dashed black line the analytical prediction based on the Kalman filter from Eq. (28), where the observation noise variance R/Σ0 was quenched from the value 0.25 to 1 at n = 300. As one can see, the computed posterior variance on the state reacts to the quench by increasing and converging towards the new asymptotic fixed point. Notice that increasing dx is also detrimental (not shown), since limdx →∞ αh = 1 according to Eq. (14). Next, we show in the right frame that other bandwidth selection criteria such as Silverman and Scott’s rule of thumbs or the direct plug-in method by Sheather and Jones [33] lead to the same problem when resampling is performed at each step. Another natural strategy is to perform resampling only occasionally. However, resampling periodically every p step only allows reducing the location of the fixed point roughly a factor 1/p, as is shown in the following corollary. Corollary 1 Given a resampling period p ∈ N∗ and an integer 0 ≤ q < p, the RPF estimator for the posterior covariN ance matrix Σnp+q converges exponentially fast towards the non-vanishing q-dependent solution: lim Σ N n→∞ np+q = αh R (1 + O(e−nαh )) . p + αh q (32) As a result, the asymptotic covariance matrix fluctuates between the upper bound αh R/p and the lower bound αh R/(p+ (p − 1)αh ). Likewise, the estimated mean value converges exponentially fast towards a random variable centered around the observation mean value xn , with a q-dependent residual covariance N N lim E[(µnp+q − xn )(µnp+q − xn )T ] n→∞ = αh p + αh (2 + αh )q R. 2 + αh (p + αh q)2 p This translates in an asymptotic RMSE = O( αh /p). 7 Proof This can be proven by deriving from Eq. (27) the new expression for the posterior covariance matrix when αnp+q = αh δq,0 : !−1 np+q N Σnp+q n = (1 + αh ) R R + [ j−1] p ∑ (1 + αh ) Σ0 Σ0 , j=1 (34) where we defined [ j − 1] p as the integer part of ( j − 1)/p . Similar calculations allow obtaining the corresponding expression for the mean value: 1 Σ N Σ −1 µ0 (1 + αh )n np+q 0  np+q  (1 + αh )[ j−1] p y j 1 N −1 ∑ j=1 Σ Σ + I− . np+q (1 + αh )n np+q 0 ∑ j=1 (1 + αh )[ j−1] p N µnp+q = (35) t u That the RMSE remains lower bounded by a positive constant when resampling is performed periodically is illustrated numerically in the left frame of Fig. 2, where the analytical lower bound (32) is indicated by the dotted line. 3.3 Kernel bandwidth modulation One is thus left with two possibilities in order to allow the estimator to keep up with the Kalman filter prediction: either resample less and less often with time (which seems compatible with the idea of resampling only if the ESS falls lower than a critical threshold, see subsection 3.4), or choose the bandwidth parameter differently so that consistency of the estimator is maintained despite performing resampling at each time. To begin with, it is clear from theorem 1 that choosing {αn }n≥1 such that limn→∞ αn = 0 enforces that limn→∞ RMSE(x̂n , xn ) = 0 (this can easily be proven by contradiction). This idea was actually hinted at in [7]. We proceed one step further by characterizing in theorem 2 which sequences ensure that the rate of convergence of the RPF estimator is optimal in the sense defined below. Definition 1 (Optimal convergence rate) The rate of convergence of an estimator x̂n towards the true state xn as the number of observations n → ∞ will be called optimal if it is comparable with that given by the inverse of the Fisher information matrix: RMSE(x̂n , xn ) = O(n−1/2 ). (33) Since the Kalman filter estimator is asymptotically efficient, this implies in particular that the optimal rate of convergence is that given by the Kalman filter. 8 Pierre Carmier et al. 1 1 RPF, ESScrit = 1 SIR, ESScrit = 1 RPF, ESScrit = 0.9 RPF, ESScrit = 0.1 SIR, ESScrit = 0.1 SIS RMSE RMSE p=2 SIR, ESScrit = 1 RPF, ESScrit = 0.9 SIR, ESScrit = 0.1 SIS 0,1 0,1 0,01 1 10 n 100 1 10 100 n Fig. 2 Left frame: Comparison of RPF and SIR simulations for different values of the resampling ratio. Sequential importance sampling (SIS) is a special case of the SIR algorithm when no resampling is performed (ESScrit = 0). The Kalman filter expectation is provided for reference (solid black line). Estimation based on the RPF with p = 2 periodic resampling is also displayed (solid maroon) and shown to saturate around the analytically predicted solution (dotted line). Right frame: Same but for a prior location µ0 three standard deviations away from the mean observation. This time, the SIR approximation breaks down, as opposed to the RPF which remains well-behaved. Theorem 2 Let {αn }n≥1 be a sequence of positive numbers as in Eq. (27). If αn = O(n−1 ), the RPF estimator converges at an optimal rate. In contrast, given any ε ∈]0, 1/2[, if αn ≈ nε−1 , then ∃ c ∈ R+ ∀n ≥ 1 RMSE ≥ cn(ε−1)/2 . 2R/n, and for the mean value Proof Suppose that ∃ c ∈ R+ ∀n ≥ 1 nαn ≤ c. Then, using that x − x2 /2 < log (1 + x) < x for x > 0, one has that ∏nj=1 (1 + α j ) = O(nc ), and thus also that ∑nj=1 ∏k−1 j=0 (1 + c+1 α j ) = O(n ). Plugging this in Eq. (27) implies that ΣnN = O(R/n) and therefore that the RPF estimator converges at an optimal rate. In contrast, if αn ≈ nε−1 , then the same reasoning implies that ∏nj=1 (1 + α j ) = O(exp (nε /ε)). Making use of the following integral inequality centered around the observation mean value xn and with residual covariance E[(µnN − xn )(µnN − xn )T ] ≈ 4R/(3n). n→∞ Thus, optimal convergence rate is recovered, as expected from theorem 2. Interestingly, as compared to Eq. (30), the dependence of Eq. (37) on the observations is long-ranged: the weighting ratio between the last and the first observations scales linearly with n instead of exponentially as in Eq. (30). This illustrates that consistency of the regularized estimator requires that memory of past observations should be kept long enough. Note that such a requirement, while understandable for parameter estimation, may be irrelevant for tracking applications where memory of the past might be considered relatively useless. n−1 nε−1 n−1 jε jε ∑ exp ( ε ) ≤ ∑ ( j + 1)ε−1 exp ( ε ) j=0 j=0 ≤ Z n 0 (36) nε xε dx xε−1 exp ( ) ≤ exp ( ) , ε ε we deduce that ∃ c ∈ R+ ∀n ≥ 1 ΣnN ≥ cnε−1 R. Finally, notε ε ing that ∑n−1 j=0 exp (2 j /ε) ≥ exp (2(n − 1)/ε), we conclude + (ε−1)/2 that ∃ c ∈ R ∀n ≥ 1 RMSE ≥ cn . t u This result still leaves us with a wide range of sequences at our disposal. Finding a suitable statistical criterion both justifying this type of kernel bandwidth modulation (and therefore different from the mean integrated squared error used to derive Eq. (14)) and allowing to identify a sequence which is optimal in some sense remains an open question. Let us look at two examples for the sequence {αn }n≥1 . • Example 1: αn = (n + αh−1 )−1 . For this choice, products and sums in Eq. (27) can be computed exactly and we get for the covariance matrix ΣnN ≈ n→∞ µnN ≈ n→∞ 2 n2 n ∑ jy j (1 + O(n−2 )) (37) j=1 • Example 2: αn = αh e−nαh . In this case, one cannot compute sums and products in Eq. (27) exactly but one can easily show that ∏nj=1 (1+αh e− jαh ) converges to a non-zero limit using that it is a strictly increasing bounded sequence: n 1 ≤ ∏ (1 + αh e− jαh ) ≤ exp ( j=1 αh ). −1 e αh (38) j−1 This result allows immediately deducing that ∑nj=1 ∏k=0 (1+ αh e−kαh ) = O(n), and thus that ΣnN = O(R/n) and that the mean value j−1 µnN ≈ n→∞ ∑nj=1 ∏k=0 (1 + αh e−kαh )y j j−1 ∑nj=1 ∏k=0 (1 + αh e−kαh )  1 + O(n−1 ) (39) A critical analysis of resampling strategies for the regularized particle filter is centered around the observation mean value xn with residual covariance E[(µnN −xn )(µnN −xn )T ] = O(R/n), using that j−1 ∏k=0 (1 + αh e−kαh )2 is also bounded. Optimal convergence rate is thus once more recovered, this time with a weighting ratio between different observations bounded by ∏∞j=1 (1 + αh e− jαh ). This strategy of modulating the bandwidth by enforcing it to decrease fast enough is positively supported by numerical simulations in the right frame of Fig. 1. It thus constitutes a functional method to overcome the limitations in the RPF we discussed earlier. Note that a different strategy discussed in Ref. [36] consists in counterbalancing the variance originating from the bandwidth perturbation by rescaling the particle values towards their center of mass. Centering the (i) kernel densities around the shrunken values axn|n−1 + (1 − √ a)µnN , and taking a = 1 − αh , one can indeed verify that the posterior density in the RPF asymptotically coincides with that expected from the Kalman filter approach. 3.4 Strategies based on the resampling ratio We now examine another possibility, which is to perform resampling only if the ESS introduced in Eq. (10) becomes lower than a determined threshold which we shall refer to as the resampling ratio ESScrit [15]. In the left frame of Fig. 2, we compare the posterior RMSE for different values of this threshold, both for the RPF and the SIR algorithm. As one can clearly see, as soon as the resampling ratio is smaller than 1, the RPF yields results in agreement with the exact solution. The SIR algorithm provides comparable results, whatever the value of the resampling ratio. However, if the location µ0 of the prior density is taken farther away from the correct value, the situation changes since estimating the posterior mean value µn accurately will increasingly depend on the ability of particles to explore phase space well enough to diffuse towards the correct value. This is illustrated √ in the right frame of Fig. 2, where µ0 was taken √ to be 3 Σ0 away from the observed mean value, instead of Σ0 until now. In this case, the SIR algorithm almost always fails to correctly estimate the posterior variance due to sample impoverishment arising as a direct consequence of severe weight degeneracy. In fact, the estimated variance often goes to zero, reflecting the fact that only a single particle eventually survives the resampling process. On the other hand, the RPF proves very robust in this situation and provides correct results as before, despite the fact that its RMSE has a tendency to underestimate the optimal Kalman expectation. Note that the curves displayed on Fig. 2 are outputs of single particle filter simulations (no averaging is performed). Resampling conditional on a sub-unit value of ESScrit thus also appears to resolve the RPF shortcomings discussed earlier. One can actually show that the resampling frequency 9 for a sub-unit resampling ratio decreases exponentially fast with the number of observations, thereby justifying that the posterior RMSE should no longer be lower bounded by a positive constant. We provide below a formal proof of this statement in the case of the stationary HMM. Lemma 2 Assume that ESScrit < 1. Then the spacing between consecutive resampling times increases exponentially fast with the number of observations for a stationary HMM. Proof Our starting point is the observation that  2 (i) 1 N n g (y |x ) ∏ ∑ N i=1 j=1 j j j| j−1 ESSn lim = lim (i) n N→∞ N N→∞ 1 N 2 N ∑i=1 ∏ j=1 g j (y j |x j| j−1 ) R 2 n π (dx ) g (y |x ) f (dx |x ) n+1 ∏ j j j j j 0 0 j−1 j=1 X . = R n 2 π (dx ) n+1 ∏ 0 0 j=1 g j (y j |x j ) f j (dx j |x j−1 ) X (40) For simplicity, we consider the case of the one-dimensional stationary state, where integration with respect to the Markov kernels reduces to ∏nj=1 g j (y j |x0 ). It is then a simple task to compute the effective sample size: p   γn (2 + γn ) ESSn hµ0 − yi2n lim = exp − N→∞ N 1 + γn Σ0 (1 + γn )(2 + γn )   p hµ0 − yi2n . 2γn exp − ≈ n→∞ 2Σ0 (41) We see that ESSn depends sensitively on how close the ML hyin is from the typical particle value µ0 and on the quantity γn := R/(nΣ0 ). The number of observations essentially reduces the effective observation noise variance. If resampling is performed at step n, then one can express the ESS at step n + m asymptotically as p n(2m + n) ESSn+m ≈ . (42) n,m→∞ N m+n The value of m required for the ESS to fall below a critical threshold ESScrit N, with ESScrit ∈ [0, 1], can then easily be calculated and we get m ESSn+m < ESScrit ⇔ > βcrit N n with q 1 − ESS2crit q βcrit = . 1 − 1 − ESS2crit (43) (44) Iterating, we thus see that the number of steps mk asymptotically required to perform resampling for the kth time grows exponentially fast: k−1 mk = βcrit (n + ∑ m j ) = (1 + βcrit )mk−1 j=1 k−1 = βcrit (1 + βcrit ) n. (45) 10 Pierre Carmier et al. 1 1 0,8 ESS RMSE 0,6 1 0,4 0,1 ESS 0,8 0,2 0,6 0,4 0,2 0 1 1 10 10 n ESScrit=1 ESScrit=0.5 ESScrit=0.9 ESScrit=1(SIR) ESScrit=1(oracle) ESScrit=0.9(oracle) αh/(1+nαh) 5 ESScrit=0.5, N=10 100 100 1 Fig. 3 Main: Normalized effective sample size (ESS) for N = 1000 particles as a function of the number of noiseless observations n in logarithmic scale for the stationary HMM. The exponential growth of the characteristic time required for the ESS to fall below a given threshold (here ESScrit = 0.5 indicated by the dashed line) is manifest. Inset: Same but for noisy observations. This time the exponential growth is somewhat less apparent due to the random fluctuations. 10 n Fig. 4 Normalized root mean squared error of the estimated parameter a in the logistic map as a function of the number of observations in logarithmic scale for N = 1000 particles and normalized observation noise variance R/Σ0 = 0.33. The saturation in the RMSE (solid red) testifies that the effect predicted for linear models remains valid in nonlinear cases. Other strategies comparably improve the estimation. (46) t u Note that similar conclusions were reached in [8]. We provide numerical simulations supporting this claim in Fig. 3. Interestingly, we compared the results we obtain for noisy observations (inset) with that for noiseless observations (symbols in main frame). The latter can be interpreted as representing the most favourable scenario, in which observations are always equal to the noiseless signal, and shall therefore be referred to from now on as the oracle limit, by analogy with the influential decision-theoretic concept [3]. As one can notice in the inset, the exponential growth of the resampling step sizes can be occasionally violated if observations cause large fluctuations in the exponential term of Eq. (41). These fluctuations also explain why the ESS is not necessarily monotonous between consecutive resampling times for noisy observations. Equipped with lemma 2, we can now conclude our demonstration that the RPF estimator is well-behaved as soon as ESScrit < 1. Theorem 3 Assume that ESScrit < 1. Then the rate of convergence of the RPF estimator is optimal in the sense of definition 1. Proof According to the previous lemma, we know that the spacing between consecutive resampling times increases exponentially fast, with rate 1 + βcrit . As a consequence,    log (1+α )  n log n h log (1+βcrit ) = O n log (1+βcrit ) , ∏ (1 + α j ) = O (1 + αh ) j=1 100 and thus ∃ c ∈ R+ ∀n ≥ 1 ∏nj=1 (1 + α j ) = O(nc ). The same reasoning as that followed in the proof of theorem 2 allows us to conclude. t u 4 Extension to non-linear models We now provide numerical evidence that the above results qualitatively hold in the case of non-linear models. We shall consider two examples: the logistic map, which is notably famous for possessing regions of parameter space displaying chaos, and a multi-dimensional plant growth model. 4.1 Logistic map The logistic map, popularized by Robert May [29], is a discretized version of the logistic equation first introduced by Verhulst in the 19th century to describe population dynamics with a finite carrying capacity. It is described by the deceptively simple equation xn+1 = axn (1−xn ), with X = [0, 1] for a ∈ [0, 4]. The nature of the state dynamics can change drastically depending on the value of a: it converges to a stationary solution for 0 ≤ a ≤ 3, oscillates between multiple values for 3 < a ≤ ac , and displays chaotic behavior for a > ac , where ac ' 3.57, with islands of stability found amid. The effect of the initial condition, on the other hand, is often of litte relevance and shall be assumed known to us: x0 = 0.5. In the following, we seek to estimate a given multiplicative A critical analysis of resampling strategies for the regularized particle filter 11 4 2000 rn µRUE 3,8 1000 3,6 3,4 0 100 50 3,2 150 100 50 1 0,8 σRUE ln 300 200 100 0 0,6 0,4 0,2 50 n 100 150 0 50 n 100 Fig. 5 Upper left: Observations of sugarbeet root mass rn (noisy = symbols, noiseless = thick line). Lower left: Likewise for leaf mass ln . Upper right: Evolution of the mean value of the estimated parameter RUE in the LNAS model after each new observation at time n, for ESScrit = 0.5 and various particle numbers: N = 1000 (blue), N = 104 (brown), N = 105 (black) and N = 106 (yellow). Convergence of the particle filter estimation towards the true posterior mean value is apparent, as a comparison with a SIR simulation testifies (N = 106 , dashed red). Lower right: Likewise for the normalized standard deviation. noisy observations yn = xn η, with η ∼ log N(1, R). Starting from a prior distribution a(i) ∼ N(3.0, 0.3), the resulting inference of parameter a given observations generated with the value a∗ = 3.33 and R = 0.1 is displayed in Fig. 4. Saturation of RMSE(ân , a∗ ) when resampling is performed at each step is clearly apparent (solid red). This effect disappears using either of the resampling strategies we discussed earlier, however, as the comparison with a benchmark simulation for N = 105 particles (solid black) testifies. Interestingly, we compared the results we obtain for noisy observations (thick lines) with that in the oracle limit (dotted lines). The RMSE obtained in the latter case acts as a lower bound with respect to that obtained for noisy observations, with numerical simulations even indicating that limn→∞ RMSE(ân , a∗ ) = 0 in this case for ESScrit < 1. If instead we choose to work in the chaotic parameter region and take a∗ > ac , our numerical results (not shown) seemingly point to the fact that correctly inferring the value of a∗ is always challenging, even in the oracle limit. The same can be told for the estimation of the initial condition x0 , for a fixed known value of a. The reason for this behavior seems to stem from the fact that, in such situations, the information provided by observations on the quantity of interest is a (rapidly) decreasing function of time. This loss of memory on the initial condition ultimately limits the resolution with which inference can be carried, as concentration results recently obtained in a similar context may testify [32]. 4.2 LNAS model Next, we look at a more elaborate model, which describes the growth of leaf mass ln and root mass rn of a sugarbeet plant as a function of daily temperature Tn and radiation φn . The latter constitute environmental variables, while the former are the hidden states. This model is a simplified version of the LNAS model [11]. In particular, we consider deterministic transition functions. Leaf and root masses are updated as       ln ln−1 an = + qn , (47) rn rn−1 1 − an where qn is the daily produced biomass and an is an allocation function. Biomass production is governed by the BeerLambert law   −1 qn = RUE φn 1 − e−ρ ln , (48) where RUE is the radiation use efficiency and ρ −1 the leaf mass density. Allocation depends on the thermal time τn as   γ 1 τn an = 1 − erf[ √ log ( )] , (49) 2 µa 2σa where γ controls early biomass partition, erf is the error function and (µa , σa ) are parameters governing the shape of the allocation function. Thermal time increases monotonically as a function of temperature as τn = τn−1 + max[0, Tn ]. The system is initialized as τ0 = r0 = 0, and l0 6= 0 such that ρ −1 l0  1. For environmental variables, we use real data obtained from a weather station in France. The filtering problem in the present case then consists in estimating the parameters (RUE, γ, µa ), given independent prior den(i) sities RUE(i) ∼ N(3.8, 0.3), γ (i) ∼ N(0.7, 0.05) and µa ∼ N(500, 50), and given multiplicative noisy observations of the hidden states ln η and rn η with η ∼ log N(1, R). We shall assume ρ and σa known beforehand. Because we no longer have access to the optimal posterior density, as opposed to the case of the stationary model, 12 Pierre Carmier et al. 650 0,68 600 3,6 0,66 3,4 0,64 550 500 0,62 3,2 0,6 100 50 450 100 50 1 1 2 0,8 0,8 1,5 0,4 0,2 0 0,4 n 100 0 1 0,5 0,2 50 100 50 a 0,6 σµ 0,6 σγ σRUE µµ µγ µRUE 4 a 0,7 3,8 50 n 100 0 50 n 100 Fig. 6 Upper left: Evolution of the mean value of the estimated parameter RUE in the LNAS model after each new observation at time n, for N = 1000 particles and different resampling strategies: ESScrit = 0.5 (blue), αn = αh /(1 + nαh ) (violet), ESScrit = 0 (orange). Lower left: Likewise for the normalized standard deviation. The bootstrap particle filter expectations (ESScrit = 1.0 (dashed red), ESScrit = 0.5 (dashed blue)) are clearly flawed with respect to the benchmark limit (N = 106 particles, solid yellow), while the RPF provides excellent results already for N = 1000 particles. Middle: Likewise for γ. Right: Likewise for µa . we plot the evolution of posterior standard deviations and mean values of each parameter (instead of the RMSE) and use results obtained by the RPF for N = 106 particles and ESScrit = 0.5 as a benchmark. We checked that this corresponds to the optimal posterior density by plotting the results obtained for N = 106 particles using the SIR algorithm by comparison, and indeed observed that convergence as a function of N is achieved (see Fig. 5). These simulations were carried by running our algorithms on the computing mesocenter Fusion. Given observations generated with values (RUE∗ , γ ∗ , µa∗ ) = (3.56, 0.625, 550) and R = 0.1, the resulting inference for various numbers of particles and resampling strategies is displayed in Fig. 6. We see that the performance of the RPF for N = 1000 particles and ESScrit = 0.5 is already close to that obtained in the benchmark scenario. Using our kernel bandwidth modulation strategy, we additionally demonstrate that equivalent results can be obtained even when ESScrit = 1, whereas the traditional choice of Eq. (14) leads to an unstable exploration of parameter space (not shown). This holds independently of the chosen parameter. In contrast, expectations based on the bootstrap particle filter or in the absence of any resampling are evidently unable to capture the correct behavior for the posterior variance. As a consequence, these particle filters will fail to provide appropriate credibility regions for the parameters and thereby make any reliable prediction impossible. This is also illustrated in table 1 where we compared the performances of our various resampling strategies, each time averaged over 10 independent runs. These results thus clearly demonstrate the ability of the RPF to outperform such traditional particle filters for a moderate number of particles. 5 Conclusions To conclude, we demonstrated that the choice of resampling strategy in the regularized particle filter can be paramount, as far as estimation of the posterior probability density is concerned. In particular, using analytical arguments inspired from linear Gaussian state-space models, we proved that resampling on a systematic basis causes the RMSE to be lower bounded by a constant which depends on the number of particles and on the dimensionality of the state space. Numerical evidence supporting our claims, including for nonlinear state-space models, was also highlighted. Finally, we showed that if one introduces a resampling ratio, or if the kernel bandwidth is appropriately modulated, then the regularized particle filter clearly outperforms traditional bootstrap particle filters. As a closing remark, we note that the idea we highlighted in this paper of progressively reducing the bandwidth perturbation seems related to recent approaches known as tempering [34], which consist in building a probability measure which depends on a tunable parameter allowing one to smoothly transport particles from the prior π0 to the posterior πn . Similar ideas have also been invoked to perform Bayesian update progressively [12], and investigating the ramifications of such connections in more detail would certainly be worthy of interest. We also leave for future research the question of which statistical criterion (Kullback-Leibler divergence, Wasserstein metric, etc.) could justify this type of kernel bandwidth modulation. Acknowledgements The authors wish to thank Gautier Viaud for useful conversations at various stages of this work. References 1. Andrieu, C., Doucet, A., Holenstein, R.: Particle Markov chain Monte Carlo methods. J. Royal Stat. Soc. B 72(3), 269–342 (2010) 2. Campillo, F., Rossi, V.: Convolution particle filter for parameter estimation in general state-space models. IEEE Transactions on Aerospace and Electronic Systems 45(3), 1063–1072 (2009) 3. Candes, E.J.: Modern statistical estimation via oracle inequalities. Acta Numerica 15, 257325 (2006) A critical analysis of resampling strategies for the regularized particle filter 13 Table 1 Comparison of particle filter predictions for different resampling strategies at n = 100 averaged over 10 runs. µRUE σRUE µγ σγ µ µa σ µa Benchmark 3.521 0.0325 0.632 0.0070 542.6 8.297 RPF (ESScrit = 0.5) 3.479 (0.0096) 0.0487 (0.0041) 0.639 (0.0026) 0.0146 (0.0016) 537.1 (2.37) 14.43 (1.69) RPF (αn = (n + αh−1 )−1 ) 3.505 (0.0291) 0.0341 (0.0083) 0.636 (0.0090) 0.0074 (0.0032) 540.4 (7.55) 9.996 (1.74) 4. Cappé, O., Moulines, E., Ryden, T.: Inference in Hidden Markov Models. Springer Verlag (2005) 5. Carmier, P.: Bayesian inference in linear Gaussian hidden Markov models: a tutorial on the Kalman filter. in preparation 6. Carpenter, J., Clifford, P., Fearnhead, P.: Improved particle filter for nonlinear problems. IEE Proceedings - Radar, Sonar and Navigation 146(1), 2–7 (1999) 7. Chen, Y.: Bayesian inference in plant growth models for prediction and uncertainty assessment. Ecole Centrale des Arts et Manufactures (2014) 8. Chopin, N.: A sequential particle filter for static models. Biometrika 89, 539–552 (2002) 9. Chopin, N.: Central limit theorem for sequential Monte Carlo methods and its application to Bayesian inference. Annals of Statistics 32, 2385–2411 (2004) 10. Chopin, N., Jacob, P.E., Papaspiliopoulos, O.: SMC2 : an efficient algorithm for sequential analysis of state space models. J. Royal Stat. Soc. B 75(3), 397–426 (2013) 11. Cournede, P.H., Chen, Y., Wu, Q., Baey, C., Bayol, B.: Development and evaluation of plant growth models: Methodology and implementation in the pygmalion platform. Mathematical Modeling of Natural Phenomena 8, 112–130 (2013) 12. Daum, F., Huang, J.: Particle flow for nonlinear filters with loghomotopy. Proc. SPIE 6969, 696,918 (2008) 13. DelMoral, P.: Feynman-Kac Formulae: Genealogical and Interacting Particle Systems with Applications. Springer (2004) 14. DelMoral, P., Doucet, A., Jasra, A.: Sequential Monte Carlo samplers. J. Roy. Stat. Soc. B 68(3), 411–436 (2006) 15. DelMoral, P., Doucet, A., Jasra, A.: On adaptive resampling strategies for sequential Monte Carlo methods. Bernoulli 18(1), 252– 278 (2012) 16. Doucet, A., de Freitas, N., Gordon, N.: Sequential Monte Carlo methods in practice. Springer Verlag (2001) 17. Gauchi, J.P., Villa, J.P.: Nonparametric particle filtering approaches for identification and inference in nonlinear state-space dynamic systems. Statistics and Computing 23, 523–533 (2013) 18. Gordon, N., Salmond, D., Smith, A.: A novel approach to nonlinear/non-Gaussian Bayesian state estimation. IEE Proc. F 140, 107–113(6) (1993) 19. Hol, J., Schon, T., Gustafsson, F.: On resampling algorithms for particle filters. In: IEEE Nonlinear Statistical Signal Processing Workshop, pp. 79–82 (2006) 20. Ionides, E.L., Bhadra, A., Atchadé, Y., King, A.A.: Iterated filtering. Ann. Stat. 39(3), 1776–1802 (2011) 21. Jacob, P.: Sequential Bayesian inference for implicit hidden Markov models and current limitations. ESAIM: Procs. 51, 24–48 (2015) 22. Kalman, R.: A new approach to linear filtering and prediction problems. J. Basic Engineering 82, 35–45 (1960) 23. Kalman, R., Bucy, R.: New results in linear filtering and prediction theory. J. Basic Engineering 83, 95–107 (1961) 24. Kantas, N., Doucet, A., Singh, S.S., Maciejowski, J.M., Chopin, N.: On particle methods for parameter estimation in state-space models. Statistical Science 30(3), 328–351 (2015) SIR (ESScrit = 0.5) 3.554 (0.0431) 0.0126 (0.0161) 0.623 (0.0095) 0.0024 (0.0030) 547.2 (18.08) 4.764 (5.89) SIS (ESScrit = 0) 3.503 (0.0569) 0.0060 (0.0049) 0.634 (0.0089) 0.0007 (0.0005) 540.4 (10.50) 2.477 (3.09) 25. Kong, A., Liu, J.S., Wong, W.H.: Sequential imputations and Bayesian missing data problems. J. Americ. Stat. Assoc. 89(425), 278–288 (1994) 26. LeGland, F., Musso, C., Oujdane, N.: An analysis of regularized interacting particle methods for nonlinear filtering. In: Proceedings of the 3rd IEEE European Workshop on Computer-Intensive Methods in Control and Signal Processing, pp. 167–174 (1998) 27. Liu, J., West, M.: Combined parameter and state estimation in simulation-based filtering (Ch. 10), in Sequential Monte Carlo methods in practice. Springer Verlag (2001) 28. Liu, J.S., Chen, R.: Sequential Monte Carlo methods for dynamic systems. J. Americ. Stat. Assoc. 93(443), 1032–1044 (1998) 29. May, R.: Simple mathematical models with very complicated dynamics. Nature 261, 459–467 (1976) 30. Musso, C., Oujdane, N., LeGland, F.: Improving regularized particle filters (Ch. 12), in Sequential Monte Carlo methods in practice. Springer Verlag (2001) 31. Parzen, E.: On estimation of a probability density function and mode. Ann. Math. Stat. 33(3), 1065–1076 (1962) 32. Paulin, D., Jasra, A., Crisan, D., Beskos, A.: On concentration properties of partially observed chaotic systems. unpublished (2016). URL https://arxiv.org/abs/1608.08348 33. Sheather, S.: Density estimation. Statistical Science 19, 588–597 (2004) 34. Svensson, A., Schön, T.B., Lindsten, F.: Learning of state-space models with highly informative observations: a tempered sequential Monte Carlo solution. unpublished (2017). URL https: //arxiv.org/abs/1702.01618 35. Tsybakov, A.: Introduction to Nonparametric Estimation. Springer (2009) 36. West, M.: Approximating posterior distributions by mixtures. J. Roy. Stat. Soc. B 55(2), 409–422 (1993) A Optimal bandwidth selection There are various ways [33] of choosing the bandwidth parameter hn in Eq. (13). The most popular choice relies on minimizing the mean integrated squared error (MISE) between the true posterior probability density function p and the kernel density pNh (x) = ∑Ni=1 Kh (x − x(i) )/N, with x(i) ∼ p(x):   MISE(h) = E ||pNh − p||2L2 = ||E[pNh ] − p||2L2 + Z dz V[pNh (z)] , (50) pR dz p(z)2 . As where we introduced the L2 (R) norm p 7→ ||p||L2 = explicited above, the MISE can allegedly be decomposed into the inteN Rgrated squared bias and the integrated variance. Observing that E[ph (x)] = dz p(z)Kh (x − z) and developing p around x as a Taylor series, one obtains: E[pNh (x)] − p(x) = h2 00 p (x) 2 Z dz z2 K1 (z) + o(h2 ) . (51) 14 Pierre Carmier et al. Likewise, the variance can be computed by decomposing E[pNh (x)2 ] into diagonal and non-diagonal contributions: E[pNh (x)2 ] = 1 N Kn = Σn|n−1 BTn (Bn Σn|n−1 BTn + Rn )−1 , Z dz p(z)Kh (x − z)2 Z 2 N(N − 1) + dz p(z)K (x − z) h N2 (52) such that V[pNh (x)] = (||K1 ||2L2 p(x) + o(1))/(Nh). Injecting these results in Eq. (50) and minimizing with respect to h is straightforward and provides the optimal choice: h5MISE = ||K1 ||2L2 N||p00 ||2L2 ( dz z2 K1 (z))2 R . (53) Note that this implies that MISE ∝ N −4/5 . The only problem left is that this choice depends on the second moment of the underlying true probability density function which is generally unknown. There are different strategies to estimate this quantity, which we will not delve into [33]. If we assume that both p and K are Gaussian distributed, 5/2 the expression for h reduces to the simple h5MISE = 4Σ p /(3N) which coincides with Eq. (14) for dx = 1. B Kalman filter equations The Kalman filter equations (19) can be derived recursively in two steps, starting from the probability density function at time n − 1. The first step is the prediction step, in which we seek to determine p(x̂n |y1:n−1 ), in other words how the probability density function is propagated between two time steps. Using Eq. (18), one can easily show that µn|n−1 := E[x̂n |y1:n−1 ] = An µn−1 (54) using that state noise has null expectancy, and Σn|n−1 := E[(x̂n − µn|n−1 )(x̂n − µn|n−1 )T ] = An Σn−1 ATn + Qn (55) using that state noise is uncorrelated with the dynamics. The second step is the update step, in which we seek to compute the posterior moments µn and Σn , expressions for which are traditionally obtained by enforcing unbiasedness of the estimator and minimizing the mean squared error, as we will now show. We begin by writing the posterior mean as a linear combination between the prior mean and the observation, that is µn = Kn0 µn−1 + Kn yn . Enforcing E[x̂n − µn |y1:n−1 ] = 0 leads to Kn0 = (I − Kn Bn )An , and thus: µn = (I − Kn Bn )µn|n−1 + Kn yn (56) which expresses the posterior mean as a linear combination between the predicted mean and the observation, with a tradeoff controlled by the so-called Kalman gain matrix Kn , an expression for which will be derived below. We begin by computing Σn , which follows directly from the previous equation: Σn = Cov[(I − Kn Bn )(x̂n − µn|n−1 ) + Kn ηn ] = (I − Kn Bn )Σn|n−1 (I − Kn Bn )T + Kn Rn KnT . (57) Here we defined Cov[x̂] = E[x̂x̂T ] as a shorthand and used the fact that observation noise is uncorrelated with the dynamics. The Kalman gain is then obtained by minimizing the mean squared error, which corresponds to the trace of the posterior covariance matrix: 0= ∂ Tr[Σn ] ∂ Kn = −2Σn|n−1 BTn + 2Kn Bn Σn|n−1 BTn + 2Kn Rn , where derivation with respect to a matrix is performed element-wise. Solving Eq. (58) yields the Kalman gain expression (58) (59) where matrix inversion is justified by positive definiteness. Injecting this in Eq. (57), we obtain a much simpler expression for the posterior covariance matrix: Σn = (I − Kn Bn )Σn|n−1 . (60) From Eqs. (59,60), we also derive the useful and synthetic relation Σn BTn = Kn Rn . Finally, using this and rearranging Eqs. (56,60), we obtain the central result Eq. (19). Notice that we made no real use of the assumption of Gaussian distributions. In fact, the above results hold true irrespective of the underlying probability density function, provided noises are centered. The distinctive feature of the Gaussian case is that the knowledge of the first two moments allows recovering the entire distribution. Specifically, for Gaussian probability density functions, the Kalman filter equations can actually also be derived without any particular assumptions using Bayes rule.
10math.ST
arXiv:1605.03778v2 [math.GR] 16 Nov 2016 Frobenius restricted varieties in numerical semigroups Aureliano M. Robles-Pérez∗† and José Carlos Rosales∗‡ Abstract The common behaviour of many families of numerical semigroups led up to defining, firstly, the Frobenius varieties and, secondly, the (Frobenius) pseudo-varieties. However, some interesting families are still out of these definitions. To overcome this situation, here we introduce the concept of Frobenius restricted variety (or R-variety). We will generalize most of the results for varieties and pseudo-varieties to R-varieties. In particular, we will study the tree structure that arise within them. Keywords: R-varieties; Frobenius restricted number; varieties; pseudo-varieties; monoids; numerical semigroups; tree (associated to an R-variety). 2010 AMS Classification: 20M14 1 Introduction In [11], the concept of (Frobenius) variety was introduced in order to unify several results which have appeared in [1], [3], [16], and [17]. Moreover, the work made in [11] has allowed to study other notables families of numerical semigroups, such as those that appear in [7], [9], [12], and [13]. There exist families of numerical semigroups which are not varieties but have a similar structure. For example, the family of numerical semigroups with maximal embedding dimension and fixed multiplicity (see [15]). The study of this family, in [2], led to the concept of m-variety. In order to generalize the concepts of variety and m-variety, in [8] were introduced the (Frobenius) pseudo-varieties. Moreover, recently, the results obtained in [8] allowed us to study several interesting families of numerical semigroups (for instance, see [10]). ∗ Both authors are supported by the project MTM2014-55367-P, which is funded by Ministerio de Economı́a y Competitividad and Fondo Europeo de Desarrollo Regional FEDER, and by the Junta de Andalucı́a Grant Number FQM-343. The second author is also partially supported by Junta de Andalucı́a/Feder Grant Number FQM-5849. † Departamento de Matemática Aplicada, Universidad de Granada, 18071-Granada, Spain. E-mail: [email protected] ‡ Departamento de Álgebra, Universidad de Granada, 18071-Granada, Spain. E-mail: [email protected] 1 In this work, our aim will be to introduce and study the concept of Rvariety (that is, Frobenius restricted variety). We will see how it generalizes the concept of pseudo-variety and we will show that there exist significant families of numerical semigroups which are R-varieties but not pseudo-varieties. Let N be the set of nonnegative integers. A numerical semigroup is a subset S of N such that it is closed under addition, contains the zero element, and N\ S is finite. It is well known (see [14, Lemma 4.5]) that, if S and T are numerical semigroups such that S T , then S ∪ {max(T \ S)} is another numerical semigroup. We will denote by FT (S) = max(T \ S) and we will call it as the Frobenius number of S restricted to T . An R-variety is a non-empty family R of numerical semigroups that fulfills the following conditions. 1. R has a maximum element with respect to the inclusion order (that we will denote by ∆(R)). 2. If S, T ∈ R, then S ∩ T ∈ R. 3. If S ∈ R and S 6= ∆(R), then S ∪ {F∆(R) (S)} ∈ R. In Section 2 we will see that every pseudo-variety is an R-variety. Moreover, we will show that, if V is a variety and T is a numerical semigroup, then VT = {S ∩ T | S ∈ V} is an R-variety. In fact, we will prove that every R-variety is of this form. Let R be an R-variety and let M be a submonoid of (N, +). We will say that M is an R-monoid if it can be expressed as intersection of elements of R. It is clear that the intersection of R-monoids is another R-monoid and, therefore, we can define the R-monoid generated by a subset of ∆(R). In Section 3 we will show that every R-monoid admits a unique minimal R-system of generators. In addition, we will see that, if M is an R-monoid and x ∈ M , then M \ {x} is another R-monoid if and only if x belongs to the minimal R-system of generators of M . In Section 4 we will show that the elements of an R-variety, R, can be arranged in a tree with root ∆(R). Moreover, we will prove that the set of children of a vertex S, of such a tree, is equal to {S \ {x} | x is an element of the minimal R-system of generators of S and x > F∆(R) (S) . This fact will allow us to show an algorithmic process in order to recurrently build the elements of an R-variety. Finally, in Section 5 we will see that, in general and contrary to what happens with varieties and pseudo-varieties, we cannot define the smallest R-variety that contains a given family F of numerical semigroups. Nevertheless, we will show that, if ∆ is a numerical semigroup such that S ⊆ ∆ for all S ∈ F , then there exists the smallest R-variety (denoted by R(F , ∆)) containing F and having ∆ as maximum (with respect the inclusion order). Moreover, we will prove that R(F , ∆) is finite if and only if F is finite. In such a case, that fact will allow us to compute, for a given R(F , ∆)-monoid, its minimal R(F , ∆)-system of 2 generators. In this way, we will obtain an algorithmic process to determine all the elements of R(F , ∆) by starting from F and ∆. Let us observe that the proofs, of some results of this work, are similar to the proofs of the analogous results for varieties and pseudo-varieties. However, in order to get a self-contained paper, we have not omitted several of such proofs. 2 Varieties, pseudo-varieties, and R-varieties It is said that M is a submonoid of (N, +) if M is a subset of N which is closed for the addition and such that 0 ∈ M . It particular, if S is a submonoid of (N, +) such that N \ S is finite, then S is a numerical semigroup. Let A be a non-empty subset of N. Then it is denoted by hAi the submonoid of (N, +) generated by A, that is, hAi = {λ1 a1 + · · · + λn an | n ∈ N \ {0}, a1 , . . . , an ∈ A, λ1 , . . . , λn ∈ N}. It is well known (see for instance [14, Lemma 2.1]) that hAi is a numerical semigroup if and only if gcd(A) = 1. Let M be a submonoid of (N, +) and let A ⊆ N. If M = hAi, then it is said that A is a system of generators of M . Moreover, it is said that A is a minimal system of generators of M if M 6= hBi for all B A. It is a classical result that every submonoid M of (N, +) has a unique minimal system of generators (denoted by msg(M )) which, in addition, is finite (see for instance [14, Corollary 2.8]). Let S be a numerical semigroup. Being that N \ S is finite, it is possible to define several notable invariants of S. One of them is the Frobenius number of S (denoted by F(S)) which is the greatest integer that does not belong to S (see [6]). Another one is the genus of S (denoted by g(S)) which is the cardinality of N \ S. Let S be a numerical semigroup different from N. Then it is obvious that S ∪ {F(S)} is also a numerical semigroup. Moreover, from [14, Proposition 7.1], we have that T is a numerical semigroup with g(T ) = g + 1 if and only if there exist a numerical semigroup S and x ∈ msg(S) such that g(S) = g, x > F(S), and T = S \ {x}. This result is the key to build the set of all numerical semigroups with genus g + 1 when we have the set of all numerical semigroups with genus g (see [14, Proposition 7.4]). In [11] it was introduced the concept of (Frobenius) variety in order to generalize the previous situation to some relevant families of numerical semigroups. It is said that a non-empty family of numerical semigroups V is a (Frobenius) variety if the following conditions are verified. 1. If S, T ∈ V, then S ∩ T ∈ V. 2. If S ∈ V and S 6= N, then S ∪ {F(S)} ∈ V. However, there exist families of numerical semigroups that are not varieties, but have a very similar behavior. By studying these families of numerical semigroups, we introduced in [8] the concept of (Frobenius) pseudo-variety. 3 It is said that a non-empty family of numerical semigroups P is a (Frobenius) pseudo-variety if the following conditions are verified. 1. P has a maximum element with respect to the inclusion order (that we will denote by ∆(P)). 2. If S, T ∈ P, then S ∩ T ∈ P. 3. If S ∈ P and S 6= ∆(P), then S ∪ {F(S)} ∈ P. From the definitions, it is clear that every variety is a pseudo-variety. Moreover, as a consequence of [8, Proposition 1], we have the next result. Proposition 2.1. Let P be a pseudo-variety. Then P is a variety if and only if N ∈ P. The following result asserts that the concept of R-variety generalizes the concept of pseudo-variety. Proposition 2.2. Every pseudo-variety is an R-variety. Proof. Let P be a pseudo-variety. In order to prove that P is an R-variety, we have to show that, if S ∈ P and S 6= ∆(P), then S ∪ {F∆(P) (S)} ∈ P. Since P is a pseudo-variety, we know that S ∪ {F(S)} ∈ P. Thus, to finish the proof, it is enough to see that F(S) = F∆(P) (S). On the one hand, it is clear that F∆(P) (S) ≤ F(S). On the other hand, since S ∪ {F(S)} ∈ P, then we have that F(S) ∈ ∆(P). Therefore, F(S) ∈ ∆(P) \ S and, consequently, F(S) ≤ F∆(P) (S). In the next example we see that there exist R-varieties that are not pseudovarieties. Example 2.3. Let R be the set formed by all numerical semigroups which are contained in the numerical semigroup h5, 7, 9i. It is clear that R is an R-variety. However, since S = h5, 7, 9i \ {5} ∈ R, S 6= ∆(R) = h5, 7, 9i, F(S) = 13, and S ∪ {13} ∈ / R, we have that R is not a pseudo-variety. Generalizing the above example, we can obtain several R-varieties, most of which are not pseudo-varieties. 1. Let T be a numerical semigroup. Then LT = {S | S is a numerical semigroup and S ⊆ T } is an R-variety. Observe that LT is the set formed by all numerical subsemigroups of T . 2. Let S1 and S2 be two numerical semigroups such that S1 ⊆ S2 . Then [S1 , S2 ] = {S | S is a numerical semigroup and S1 ⊆ S ⊆ S2 } is an R-variety. 3. Let T be a numerical semigroup and let A ⊆ T . Then R(A, T ) = {S | S is a numerical semigroup and A ⊆ S ⊆ T } is an R-variety. Observe that both of the previous examples are particular cases of this one. 4 Remark 2.4. Let p, q be relatively prime integers such that 1 < p < q. Let us take the numerical semigroups S1 = hp, qi and S2 = S21 = {s ∈ N | 2s ∈ S1 }. In [4, 5], Kunz and Waldi study the family of numerical semigroups [S1 , S2 ], which is an R-variety but not a pseudo-variety. The next result establishes when an R-variety is a pseudo-variety. Proposition 2.5. Let R be an R-variety. Then R is a pseudo-variety if and only if F(S) ∈ ∆(R) for all S ∈ R such that S 6= ∆(R). Proof. (Necessity.) If R is a pseudo-variety and S ∈ R with S 6= ∆(R), then S ∪ {F(S)} ∈ R. Therefore, F(S) ∈ ∆(R). (Sufficiency.) In order to show that R is a pseudo-variety, it will be enough to see that S ∪ {F(S)} ∈ R for all S ∈ R such that S 6= ∆(R). For that, since F(S) ∈ ∆(R), then it is clear that F∆(R) (S) = F(S) and, therefore, S ∪ {F(S)} = S ∪ {F∆(R) (S)} ∈ R. An immediate consequence of Propositions 2.1 and 2.5 is the following result. Corollary 2.6. Let R be an R-variety. Then R is a variety if and only if N ∈ R. Our next purpose, in this section, will be to show that to give an R-variety is equivalent to give a pair (V, T ) where V is a variety and T is a numerical semigroup. Before that we need to introduce some concepts and results. Let S be a numerical semigroup. Then we define recurrently the following sequence of numerical semigroups. • S0 = S, • if Si 6= N, then Si+1 = Si ∪ {F(Si )}. Since N \ S is a finite set with cardinality equal to g(S), then we get a finite chain of numerical semigroups S = S0 S1 · · · Sg(S) = N. We will denote by C(S) the set {S0 , S1 , . . . , Sg(S) } and will say that it is the chain of numerical semigroups associated to S. If F is a non-empty family of numerical semigroups, S then we will denote by C(F ) the set S∈F C(S). Let F be a non-empty family of numerical semigroups. We know that there exists the smallest variety containing F (see [11]). Moreover, by [11, Thoerem 4], we have the next result. Proposition 2.7. Let F be a non-empty family of numerical semigroups. Then the smallest variety containing F is the set formed by all finite intersections of elements of C(F ). Now, let R be an R-variety. By applying repeatedly that, if S ∈ R and S 6= ∆(R), then S ∪ {F∆(R) (S)} ∈ R, we get the following result. Lemma 2.8. Let R be an R-variety. If S ∈ R and n ∈ N, then S ∪{x ∈ ∆(R) | x ≥ n} ∈ R. 5 We are ready to show the announced result. Theorem 2.9. Let V be a variety and let T be a numerical semigroup. Then VT = {S ∩ T | S ∈ V} is an R-variety. Moreover, every R-variety is of this form. Proof. By Proposition 2.1, we know that, if V is a variety, then N ∈ V and, therefore, T is the maximum of VT (that is, T = ∆(VT )). On the other hand, it is clear that, if S1 , S2 ∈ VT , then S1 ∩ S2 ∈ VT . Now, let S ∈ V such that S ∩ T 6= T and let us have t = FT (S ∩ T ). In order to conclude that VT is an R-variety, we will see that (S ∩ T ) ∪ {t} ∈ VT . First, let us observe that t = max(T \ (S ∩ T )) = max(T \ S). Then, because S ∈ V and V is a variety, we can easily deduce that S̄ = S ∪ {t, →} ∈ V. Moreover, (S ∩ T ) ∪ {t} ⊆ (S ∩ T ) ∪ ({t, →} ∩ T ) = S̄ ∩ T . Let us see now that S̄ ∩ T ⊆ (S ∩ T ) ∪ {t}. In other case, there exists t′ > t such that t′ ∈ T and t′ ∈ / S, in contradiction with the maximality of t. Therefore, (S∩T )∪{t} = S̄∩T and S̄ ∈ V. Consequently, (S ∩ T ) ∪ {t} ∈ VT . Let R be an R-variety and let V be the smallest variety containing R. To conclude the proof of the theorem, we will see that R = V∆(R) . It is clear that R ⊆ V∆(R) . Thus, let us see the reverse one. For that, we will prove that, if S ∈ V, then S ∩ ∆(R) ∈ R. In effect, by Proposition 2.7 we have that, if S ∈ V, then there exist S1 , . . . , Sk ∈ C(R) such that S = S1 ∩ · · · ∩ Sk . Therefore, S ∩ ∆(R) = (S1 ∩ ∆(R)) ∩ · · · ∩ (Sk ∩ ∆(R)). Since R is an R-variety, then R is closed under finite intersections. Thereby, to see that S ∩∆(R) ∈ R, it is enough to show that Si ∩ ∆(R) ∈ R for all i ∈ {1, . . . , k}. Since Si ∈ C(R), then it is clear that there exist Si′ ∈ R and ni ∈ N such that Si = Si′ ∪{ni , →}. Therefore, Si ∩ ∆(R) = Si′ ∪ {x ∈ ∆(R) | x ≥ ni } ∈ R, by applying Lemma 2.8. The above theorem allows us to give many examples of R-varieties starting from already known varieties. 1. Let us observe that, if V is a variety and T ∈ V, then VT = {S ∩ T | S ∈ V} = {S ∈ V | S ⊆ T } is an R-variety contained in V. Thus, for instance, we have that the set formed by all Arf numerical semigroups, which are contained in a certain Arf numerical semigroup, is an R-variety. 2. Observe also that, if V is a variety and T is a numerical semigroup such that T ∈ / V, then VT = {S ∩ T | S ∈ V} is an R-variety not contained in V (because T ∈ VT and T ∈ / V). Let us take, for example, the variety V of all Arf numerical semigroups and T = h5, 8i ∈ / V. In such a case, VT is the R-variety formed by the numerical semigroups which are the intersection of an Arf numerical semigroup and T . Corollary 2.10. Let R be an R-variety and let U be a numerical semigroup. Then RU = {S ∩ U | S ∈ R} is an R-variety. Proof. By applying Theorem 2.9, we have that there exist a variety V and a numerical semigroup T such that R = VT = {S ∩ T | S ∈ V}. Therefore, 6 RU = {S∩T ∩U | S ∈ V} = VT ∩U , which is clearly an R-variety (by Theorem 2.9 again). The next result says us that Theorem 2.9 remains true when variety is replaced with pseudo-variety. Corollary 2.11. Let P be a pseudo-variety and let T be a numerical semigroup. Then PT = {S ∩ T | S ∈ P} is an R-variety. Moreover, every R-variety is of this form. Proof. By Proposition 2.2, we know that, if P is a pseudo-variety, then P is an R-variety. Thereby, by applying Corollary 2.10, we conclude that PT is an R-variety. Now, by Theorem 2.9, we know that, if R is an R-variety, then there exist a variety V and a numerical semigroup T such that R = VT . To finish the proof, it is enough to observe that all varieties are pseudo-varieties. Let us see an illustrative example of the above corollary. Example 2.12. From [8, Example 7], we have the pseudo-variety P = {h5, 6, 8, 9i, h5, 6, 9, 13i, h5, 6, 8i, h5, 6, 13, 14i, h5, 6, 9i, h5, 6, 14i, h5, 6, 13i, h5, 6, 19i, h5, 6i} . Thereby, we have that PT is an R-variety for each numerical semigroup T . 3 Monoids associated to an R-variety In this section, R we will be an R-variety. Now, let M be a submonoid of (N, +). We will say that M is an R-monoid if it is the intersection of elements of R. The next result is easy to proof. Lemma 3.1. The intersection of R-monoids is an R-monoid. From the above lemma we have the following definition: let A ⊆ ∆(R). We will say that R(A) is the R-monoid generated by A if R(A) is equal to the intersection of all the R-monoids which contain the set A. Observe that R(A) is the smallest R-monoid which contains the set A (with respect to the inclusion order). The next result has an easy proof too. Lemma 3.2. If A ⊆ ∆(R), then R(A) is equal to the intersection of all the elements of R which contain the set A. Let us take A ⊆ ∆(R). If M = R(A), then we will say that A is an Rsystem of generators of M . Moreover,we will say that A is a minimal R-system of generators of M if M 6= R(B) for all B A. The next purpose in this section will be to show that every R-monoid has a unique minimal R-system of generators. For that, we will give some previous lemmas. We can easily deduced the first one from Lemma 3.2. 7 Lemma 3.3. Let A, B be two subsets of ∆(R) and let M be an R-monoid. We have that 1. if A ⊆ B, then R(A) ⊆ R(B); 2. R(A) = R(hAi); 3. R(M ) = M . If M is an R-monoid, then M is a submonoid of (N, +). Moreover, as we commented in Section 2, we know that there exists a finite subset A of M such that M = hAi. Thereby, by applying Lemma 3.3, we have that M = R(M ) = R(hAi) = R(A). Consequently, A is a finite R-system of generators of M . Thus, we can establish the next result. Lemma 3.4. Every R-monoid has a finite R-system of generators. In the following result, we characterize the minimal R-systems of generators. Lemma 3.5. Let A ⊆ ∆(R) and M = R(A). Then A is a minimal R-system of generators of M if and only if a ∈ / R(A \ {a}) for all a ∈ A. Proof. (Necessity.) If a ∈ R(A \ {a}), then A ⊆ R(A \ {a}). Thus, by Lemma 3.3, we get that M = R(A) ⊆ R(R(A \ {a})) = R(A \ {a}) ⊆ R(A) = M . Therefore, M = R(A \ {a}), in contradiction with the minimality of A. (Sufficiency.) If A is not a minimal R-system of generators of M , then there exists B A such that R(B) = M . Then, by Lemma 3.3, if a ∈ A \ B, then a ∈ M = R(B) ⊆ R(A \ {a}), in contradiction with the hypothesis. The next result generalizes an evident property of submonoids of (N, +). More concretely, every element x of a submonoid M of (N, +) is expressible as a non-negative integer linear combination of the generators of M that are smaller than or equal to x. Lemma 3.6. Let A ⊆ ∆(R) and x ∈ R(A). Then x ∈ R({a ∈ A | a ≤ x}). Proof. Let us suppose that x 6∈ R({a ∈ A | a ≤ x}). Then, from Lemma 3.2, we know that there exists S ∈ R such that {a ∈ A | a ≤ x} ⊆ S and x 6∈ S. By applying now Lemma 2.8, we have that S̄ = S ∪ {m ∈ ∆(R) | m ≥ x + 1} ∈ R. Observe that, obviously, A ⊆ S̄ and x ∈ / S̄. Therefore, by applying once again Lemma 3.2, we get that x ∈ / R(A), in contradiction with the hypothesis. We are now ready to show the above announced result. Theorem 3.7. Every R-monoid admits a unique minimal R-system of generators. In addition, such a R-system is finite. Proof. Let M be an R-monoid and let A, B be two minimal R-systems of generators of M . We are going to see that A = B. For that, let us suppose that A = {a1 < a2 < · · · } and B = {b1 < b2 < · · · }. If A 6= B, then 8 there exists i = min{k | ak 6= bk }. Let us assume, without loss of generality, that ai < bi . Since ai ∈ M = R(A) = R(B), by Lemma 3.6, we have that ai ∈ R({b1 , . . . , bi−1 }). Because {b1 , . . . , bi−1 } = {a1 , . . . , ai−1 }, then ai ∈ R({a1 , . . . , ai−1 }), in contradiction with Lemma 3.5. Finally, by Lemma 3.4, we have that the minimal R-system of generators is finite. If M is a R-monoid, then the cardinality of the minimal R-system of generators of M will be called the R-range of M . Example 3.8. Let S, T be two numerical semigroups such that S ⊆ T . We define recurrently the following sequence of numerical semigroups. • S0 = S, • if Si 6= T , then Si+1 = Si ∪ {FT (Si )}. Since T \ S is a finite set, then we get a finite chain of numerical semigroups S = S0 S1 · · · Sn = T . We will denote by C(S, T ) the set {S0 , S1 , . . . , Sn } and will say that it is the chain of S restricted to T . It is clear that C(S, T ) is an R-variety. Moreover, it is also clear that, for each i ∈ {1, . . . , n}, Si is the smallest element of C(S, T ) containing FT (Si−1 ). Therefore, {FT (Si−1 )} is the minimal C(S, T )-system of generators of Si for all i ∈ {1, . . . , n}. Let us also observe that the empty set, ∅, is the minimal C(S, T )-system of generators of S0 . Thereby, the C(S, T )-range of Si is equal to 1, if i ∈ {1, . . . , n}, and 0, if i = 0. It is well known that, if M is a submonoid of (N, +) and x ∈ M , then M \{x} is another submonoid of (N, +) if and only if x ∈ msg(M ). In the next result we generalize this property to R-monoids. Proposition 3.9. Let M be an R-monoid and let x ∈ M . Then M \ {x} is an R-monoid if and only if x belongs to the minimal R-system of generators of M . Proof. Let A be the minimal R-system of generators of M . If x 6∈ A, then A ⊆ M \{x}. Therefore, M \{x} is a R-monoid containing A and, consequently, M = R(A) ⊆ M \ {x}, which is a contradiction. Conversely, by Theorem 3.7, we have that, if x ∈ A, then R(M \ {x}) 6= R(A) = M . Thereby, R(M \ {x}) = M \ {x}. Consequently, M \ {x} is a R-monoid. Let us illustrate the above proposition with an example. Example 3.10. Let T be a numerical semigroup and let A ⊆ T . Then we know that R(A, T ) = {S | S is a numerical semigroup and A ⊆ S ⊆ T } is an R-variety. By applying Proposition 3.9, we easily deduce that, if S ∈ R(A, T ), then the minimal R(A, T )-system of generators of S is {x ∈ msg | x ∈ / A}. From Theorem 2.9 we know that every R-variety is of the form VT = {S ∩T | S ∈ V}, where V is a variety and T is a numerical semigroup. Now, our purpose is to study the relation between V-monoids and VT -monoids. 9 Proposition 3.11. Let M be a submonoid of (N, +) and let T be a numerical semigroup. Then M is a VT -monoid if and only if there exists a V-monoid M ′ such that M = M ′ ∩ T . Proof. T(Necessity.) If M is a VT -monoid, then there exists F ⊆ VT such that M = S∈F S. But, if S ∈ F , then S ∈ VT and, consequently, there exists S ′ ∈ VTsuch that S = S ′ ∩ T . Now, let F ′ = {S ′ ∈ V | S ′ ∩ T ∈ F } and let M ′ = S ′ ∈F ′ S ′ . Then it is clear that M ′ is a V-monoid and that M = M ′ ∩ T . (Sufficiency.) If M ′ is a V-monoid, then there exists F ′ ∈ V such that T ′ ′ M =T S ′ ∈F ′ S . Let F = {S ′ ∩ T | S ′ ∈ F ′ }. Then it is clear that F ⊆ VT and that S∈F S = M ′ ∩ T . Therefore, M ′ ∩ T is a VT -monoid. Observe that, as a consequence of the above proposition, we have that the set of VT -monoids is precisely given by {M ∩ T | M is a V-monoid}. Corollary 3.12. Let T be a numerical semigroup. If A ⊆ T , then VT (A) = V(A) ∩ T . Proof. By Proposition 3.11, we know that V(A) ∩ T is aVT -monoid containing A. Therefore, VT (A) ⊆ V(A) ∩ T . Let us see now the opposite inclusion. By applying once more Proposition 3.11, we deduce that there exists a V-monoid M such that VT (A) = M ∩ T . Thus, it is clear that A ⊆ M and, thereby, V(A) ⊆ M . Consequently, V(A)∩T ⊆ M ∩ T = VT (A). From Corollary 3.12, we have that the set formed by the VT -monoids is {V(A) ∩ T | A ⊆ T } = {M ∩ T | M is a V-monoid and its minimal V-system of generators is including in T }. Moreover, observe that, if T ∈ V, then VT (A) = V(A) and, therefore, in such a case the set formed by all the VT monoids coincides with the set formed by all the V-monoids that are contained in T . For some varieties there exist algorithms that allow us to compute V(A) by starting from A. Thereby, we can use such results in order to compute VT (A). Let us see two examples of this fact. Example 3.13. An LD-semigroup (see [12]) is a numerical semigroup S fulfilling that a + b − 1 ∈ S for all a, b ∈ S \ {0}. Let V the set formed by all LD-semigroups. In [12] it is shown that V is a variety. Let T = h5, 7, 9i (observe that T ∈ / V). By Theorem 2.9, we know that VT = {S ∩ T | S ∈ V} is an R-variety. Let us suppose that we can compute VT ({5}). In [12] we have an algorithm to compute V(A) by starting from A. By using such algorithm, in [12, Example 33] it is shown that V({5}) = h5, 9, 13, 17, 21i. Therefore, by applying Corollary 3.12, we have that VT ({5}) = h5, 9, 13, 17, 21i∩ h5, 7, 9i = h5, 9, 17, 21i. Example 3.14. An PL-semigroup (see [7]) is a numerical semigroup S fulfilling that a+b+1 ∈ S for all a, b ∈ S\{0}. Let V the set formed by all PL-semigroups. In [7] it is shown that V is a variety and it is given an algorithm to compute V(A) 10 by starting from A. Let T = h4, 7, 13i (observe that T ∈ V). By Theorem 2.9, we know that VT = {S ∩ T | S ∈ V} is an R-variety. Let us suppose that we can compute VT ({4, 7}). From [7, Example 48], we know that V({4, 7}) = h4, 7, 9i. Thus, by applying Corollary 3.12, we have that VT ({4, 7}) = h4, 7, 9i ∩ h4, 7, 13i = h4, 7, 13i. Let T be a numerical semigroup. We know that, if M is a VT -monoid, then there exists a V-monoid, M ′ , with minimal V-system of generators contained in T , such that M = M ′ ∩ T . The next result says us that, in this situation, the minimal V-system of generators of M ′ is just the minimal VT -system of generators of M . Proposition 3.15. Let A ⊆ T . Then A is the minimal VT -system of generators of VT (A) if and only if A is the minimal V-system of generators of V(A). Proof. (Necessity.) Let us suppose that A is not the minimal V-system of generators of V(A). That is, there exists B A such that V(B) = V(A). Then, from Corollary 3.12, we have that VT (A) = V(A) ∩ T = V(B) ∩ T = VT (B). Therefore, A is not the minimal VT -system of generators of VT (A). (Sufficiency.) Let us suppose that A is not the minimal VT -system of generators of VT (A). Then VT (B) = VT (A) for some subset B A. On the other hand, due to A is the minimal V-system of generators of V(A), from Lemma 3.5, we have an element a ∈ A such that a ∈ / V(B). Consequently, a ∈ V(A) ∩ T and a ∈ / V(B) ∩ T . Finally, from Corollary 3.12, VT (A) = V(A) ∩ T 6= V(B) ∩ T = VT (B), which is a contradiction. We finish this section with two examples that illustrate the above proposition. Example 3.16. Let V be such as in Example 3.13 and let T = h4, 6, 7i. From [12, Example 26], we know that V({4, 7, 10}) = h4, 7, 10, 13i and, moreover, that {4} is its minimal V-system of generators. Then, from Proposition 3.15, {4} is the minimal V-system of generators of VT ({4, 7, 10}) = h4, 7, 10, 13i ∩ h4, 6, 7i. Example 3.17. Let V be such as in Example 3.14 and let T = h3, 4i. From [7, Example 44], we know that {3} is the minimal V-system of generators os S = h3, 7, 11i. Therefore, by Proposition 3.15, {3} is the minimal VT -system of generators of S ∩ T . 4 The tree associated to an R-variety Let V be a non-empty set and let E ⊆ {(v, w) ∈ V × V | v 6= w}. It is said that the pair G = (V, E) is a graph. In addition, the vertices and edges of G are the elements of V and E, respectively. Let x, y ∈ V and let us suppose that (v0 , v1 ), (v1 , v2 ), . . . , (vn−1 , vn ) is a sequence of different edges such that v0 = x and vn = y. Then, it is said that such a sequence is a path (of length n) connecting x and y. 11 Let G be a graph. Let us suppose that there exists r, vertex of G, such that it is connected with any other vertex x by a unique path. Then it is said that G is a tree and that r is its root. Let x, y be vertices of a tree G and let us suppose that there exists a path that connects x and y. Then it is said that x is a descendant of y. Specifically, it is said that x is a child of y when (x, y) is an edge of G. From now on in this section, let R denote an R-variety. We define the graph G(R) in the following way, • R is the set of vertices of G(R); • (S, S ′ ) ∈ R × R is an edge of G(R) if and only if S ′ = S ∪ {F∆(R) (S)}. If S ∈ R, then we can define recurrently (such as we did in Example 3.8) the sequence of elements in R, • S0 = S, • if Si 6= ∆(R), then Si+1 = Si ∪ {F∆(R) (Si )}. Thus, we obtain a chain (of elements in R) S = S0 S1 · · · Sn = ∆(R) such that (Si , Si+1 ) is an edge of G(R) for all i ∈ {0, . . . , n − 1}. We will denote by CR (S) the set {S0 , S1 , . . . , Sn } and will say that it is the chain of S in R. The next result is easy to prove. Proposition 4.1. G(R) is a tree with root ∆(R). Observe that, in order to recurrently construct G(R) starting from ∆(R), it is sufficient to compute the children of each vertex of G(R). Let us also observe that, if T is a child of S, then S = T ∪ {F∆(R) (T )}. Therefore, T = S \ {F∆(R) (T )}. Thus, if T is a child of S, then there exists an integer x > F∆(R) (S) such that T = S \ {x}. As a consequence of Propositions 3.9 and 4.1, and defining F∆(R) (∆(R)) = −1, we have the following result. Theorem 4.2. The graph G(R) is a tree with root equal to ∆(R). Moreover, the set formed by the children of a vertex S ∈ R is {S \ {x} | x is an element of the minimal R-system of generators of S and x > F∆(R) (S) . We can reformulate the above theorem in the following way. Corollary 4.3. The graph G(R) is a tree with root equal to ∆(R). Moreover, the set formed by the children of a vertex S ∈ R is {S \ {x} | x ∈ msg(S), x > F∆(R) (S) and S \ {x} ∈ R . We illustrate the previous results with an example. Example 4.4. We are going to build the R-variety R = [h5, 6i, h5, 6, 7i] = {S | S is a numerical semigroup and h5, 6i ⊆ S ⊆ h5, 6, 7i}. Observe that, if S ∈ R and x ∈ msg(S), then S \{x} ∈ R if and only if x ∈ / {5, 6}. Moreover, the maximum of R is ∆ = h5, 6, 7i. By applying Corollary 4.3, we can recurrently build G(R) in the following way. 12 • h5, 6, 7i has got a unique child, which is h5, 6, 7i \ {7} = h5, 6, 13, 14i. Moreover, F∆ (h5, 6, 13, 14i) = 7. • h5, 6, 13, 14i has got two children, which are h5, 6, 13, 14i \ {13} = h5, 6, 14i and h5, 6, 13, 14i \ {14} = h5, 6, 13i. Moreover, F∆ (h5, 6, 14i) = 13 and F∆ (h5, 6, 13i) = 14. • h5, 6, 13i has not got children. • h5, 6, 14i has got a unique child, which is h5, 6, 14i \ {14} = h5, 6, 19i. Moreover, F∆ (h5, 6, 19i) = 14. • h5, 6, 19i has got a unique child, which is h5, 6, 19i \ {19} = h5, 6i. Moreover, F∆ (h5, 6i) = 19. • h5, 6i has not got children. Therefore, in this situation, G(R) is given by the next diagram. h5, 6, 7i ✻ h5, 6, 13, 14i ✯ ❨❍ ❍ ✟✟ ✟ ❍ h5, 6, 14i h5, 6, 13i ✻ h5, 6, 19i ✻ h5, 6i Observe that, if we represent the vertices of G(R) using their minimal R-systems of generators, then we have that G(R) is given by the following diagram. R({7}) ✻ R({13, 14}) ✯ ❨❍ ❍ ✟✟ ✟ ❍ R({14}) R({13}) ✻ R({19}) ✻ R(∅) Let us observe that the R-variety R = [h5, 6i, h5, 6, 7i] depict in the above example is finite and, therefore, we have been able to build all its elements in a finite number of steps. If the R-variety is infinite, then it is not possible such situation. However, as a consequence of Theorem 4.2, we can show an algorithm in order to compute all the elements of the R-variety when the genus is fixed. 13 Algorithm 4.5. INPUT: A positive integer g. OUTPUT: {S ∈ R | g(S) = g}. (1) If g < g(∆(R)), then return ∅. (2) Set A = {∆(R)} and i = g(∆(R)). (3) If i = g, then return A. (4) For each S ∈ A, compute the set BS formed by all elements of the minimal R-system of generators of S that are greater than F∆(R) (S). [ (5) If BS = ∅, then return ∅. S∈A (6) Set A = [  S \ {x} | x ∈ BS , i = i + 1, and go to (3). S∈A We illustrate the operation of this algorithm with an example. Example 4.6. Let ∆ = h4, 6, 7i = {0, 4, 6, 7, 8, 10, →}. It is clear that g(∆) = 5. Let R = {S | S is a numerical semigroup and {4, 6} ⊆ S ⊆ ∆}. We have that R is an infinite R-variety because h4, 6, 2k + 1i ∈ R for all k ∈ {5, →}. By using Algorithm 4.5, we are going to compute the set {S ∈ R | g(S) = 8}. • A = {∆}, i = 5. • B∆ = {7}. • A = {h4, 6, 11, 13i}, i = 6. • Bh4,6,11,13i = {11, 13}. • A = {h4, 6, 13, 15i, h4, 6, 11i}, i = 7. • Bh4,6,13,15i = h13, 15i and Bh4,6,11i = ∅. • A = {h4, 6, 15, 17i, h4, 6, 13i}, i = 8. • The algorithm returns {h4, 6, 15, 17i, h4, 6, 13i}. Our next purpose in this section will be to show that, if R is an R-variety and T ∈ R, then the set formed by all the descendants of T in the tree G(R) is also an R-variety. It is clear that, if S, T ∈ R, then S is a descendant of T if and only if T ∈ CR (S). Therefore, we can establish the following result. Lemma 4.7. Let R be an R-variety and S, T ∈ R. Then S is a descendant of T if and only if there exists n ∈ N such that T = S ∪ {x ∈ ∆(R) | x ≥ n}. As an immediate consequence of the above lemma, we have the next one. Lemma 4.8. Let R be an R-variety and S, T ∈ R such that S 6= T . If S is a descendant of T , then F∆(R) (S) = FT (S). Now we are ready to show the announced result. 14 Theorem 4.9. Let R be an R-variety and T ∈ R. Then D(T ) = {S ∈ R | S is a descendant of T in the tree G(R)} is an R-variety. Proof. Clearly, T is the maximum of D(T ). Let us see that, if S1 , S2 ∈ D(T ), then S1 ∩ S2 ∈ D(T ). Since, from Lemma 4.7, we know that there exist n1 , n2 ∈ N such that T = Si ∪ {x ∈ ∆(R) | x ≥ ni }, i = 1, 2, it is sufficient to show that T = (S1 ∩ S2 ) ∪ {x ∈ ∆(R) | x ≥ min{n1 , n2 }}. It is obvious that (S1 ∩ S2 ) ∪ {x ∈ ∆(R) | x ≥ min{n1 , n2 }} ⊆ T . Let us see now the opposite inclusion. For that, let t ∈ T such that t ∈ / S1 ∩ S2 . Then t ∈ / S1 or t ∈ / S2 and, therefore, t ∈ {x ∈ ∆(R) | x ≥ n1 } or t ∈ {x ∈ ∆(R) | x ≥ n2 }. Thereby, t ∈ {x ∈ ∆(R) | x ≥ min{n1 , n2 }}. Consequently, T ⊆ (S1 ∩ S2 ) ∪ {x ∈ ∆(R) | x ≥ min{n1 , n2 }}. By applying again Lemma 4.7, we can assert that S1 ∩ S2 ∈ D(T ). Finally, let S ∈ D(T ) such that S 6= T . From Lemma 4.8, S ∪ {FT (S)} = S ∪ {F∆(R) (S)} ∈ R and, in consequence, S ∪ {FT (S)} ∈ D(T ). From the previous comment to [8, Example 7], we know that, if V is a variety and T ∈ V, then D(T ) is a pseudo-variety and, moreover, every pseudo-variety can be obtained in this way. Therefore, there exist R-varieties which are not the set formed by all the descendants of an element belonging to a variety. The following result shows that an R-variety can be obtained as the set formed by intersecting all the descendants, of an element belonging to a variety, with a numerical semigroup. Corollary 4.10. Let V be a variety, let ∆ ∈ V, and let T be a numerical semigroup. Let D(∆) = {S | S is a descendant of ∆ in G(V)} and let D(∆, T ) = {S ∩ T | S ∈ D(∆)}. Then D(∆, T ) is an R-variety. Moreover, every R-variety can be obtained in this way. Proof. If V is a variety, then V is an R-variety and, by applying Theoem 4.9, we have that D(∆) is an R-variety. From Corollary 2.10, we conclude that D(∆, T ) is an R-variety. If R is an R-variety, by Theorem 2.9, we know that there exist a variety V and a numerical semigroup T such that R = {S ∩ T | S ∈ V}. Now, it is clear that V = D(N) = {S | S is a descendant of N in G(V)}. Therefore, we have that R = {S ∩ T | S ∈ D(N)} = D(N, T ). In the next result we see that the above corollary is also true when we write pseudo-variety instead of variety. Corollary 4.11. Let P be a pseudo-variety, let ∆ ∈ P, and let T be a numerical semigroup. Let D(∆) = {S | S is a descendant of ∆ in G(P)} and let D(∆, T ) = {S ∩ T | S ∈ D(∆)}. Then D(∆, T ) is an R-variety. Moreover, every R-variety can be obtained in this way. 15 Proof. If P is a pseudo-variety, then P is an R-variety and, by applying Theorem 4.9, we have that D(∆) is an R-variety as well. Now, from Corollary 2.10, we have that D(∆, T ) is an R-variety. That every R-variety can be obtained in this way is an immediate consequence of Corollary 4.10 and having in mind that each variety is a pseudovariety. We conclude this section by illustrating the above corollary with an example. Example 4.12. Let P the pseudo-variety which appear in Example 2.12. In [8, Example 7] it is shown that G(P) is given by the next subtree. h5, 6, 8, 9i ✯ ❨❍ ❍ ✟✟ ✟ ❍ h5, 6, 9, 13i h5, 6, 8i ✯ ❨❍ ❍ ✟✟ ✟ ❍ h5, 6, 13, 14i h5, 6, 9i ✯ ❨❍ ❍ ✟✟ ✟ ❍ h5, 6, 14i h5, 6, 13i ✻ h5, 6, 19i ✻ h5, 6i By applying Corollary 4.11, we have that, if T is a numerical semigroup, then R = {S ∩ T | S ∈ D(h5, 6, 13, 14i)} is an R-variety. Let us observe that D(h5, 6, 13, 14i) = {h5, 6, 13, 14i, h5, 6, 14i, h5, 6, 13i, h5, 6, 19i, h5, 6i}. 5 The smallest R-variety containing a family of numerical semigroups In [11, Proposition 2] it is proved that the intersection of varieties is a variety. As a consequence of this, we have that there exists the smallest variety which contains a given family of numerical semigroups. On the other hand, in [8] was shown that, in general, the intersection of pseudo-varieties is not a pseudo-variety. Nevertheless, in [8, Theorem 4] it is proved that there exists the smallest pseudo-variety which contains a given family of numerical semigroups. Our first objective in this section will be to show that, in general, we cannot talk about the smallest R-variety which contains a given family of numerical semigroups. Lemma 5.1. Let F be a family of numerical semigroups and let ∆ be a numerical semigroup such that S ⊆ ∆ for all S ∈ F . Then there exists an R-variety R such that F ⊆ R and max(R) = ∆. 16 Proof. Let R = {S | S is a numerical semigroup and S ⊆ ∆}. From Item 1 in Example 2.3, we have that R is an R-variety. Now, it is trivial that F ⊆ R and max(R) = ∆. The proof of the next lemma is straightforward and we can omit it. Lemma 5.2. Let {R such that  max(Ri ) = ∆ T i }i∈I be a family of R-varieties T for all i ∈ I. Then i∈I Ri is an R-variety and max i∈I Ri = ∆. The following result says us that there exists the smallest R-variety which contains a given family of numerical semigroups and has a certain maximum. Proposition 5.3. Let F be a family of numerical semigroups and let ∆ be a numerical semigroup such that S ⊆ ∆ for all S ∈ F . Then there exists the smallest R-variety which contains F and with maximum equal to ∆. Proof. Let R be the intersection of all the R-varieties containing F and with maximum equal to ∆. From Lemmas 5.1 and 5.2 we have the conclusion. We will denote by R(F , ∆) the R-variety given by Proposition 5.3. Now we are interested in describe the elements of such an R-variety. Lemma 5.4. Let S1 , S2 , . . . , Sn , ∆ be numerical semigroups such that Si ⊆ ∆ for all i ∈ {1, . . . , n}. Then F∆ (S1 ∩ · · · ∩ Sn ) = max {F∆ (S1 ), . . . , F∆ (Sn )}. Proof. We have that F∆ (S1 ∩ · · · ∩ Sn ) = max (∆ \ (S1 ∩ · · · ∩ Sn )) = max ((∆ \ S1 ) ∪ · · · ∪ (∆ \ Sn )) = max {max(∆ \ S1 ), . . . , max(∆ \ Sn )} = max {F∆ (S1 ), . . . , F∆ (Sn )} . Let us recall that, if S and ∆ are numerical semigroups such that S ⊆ ∆, then we defined C(S, ∆) in Example 3.8 (that is, the chain of S restricted to ∆). If F is a family of numerical semigroups such that S ⊆ ∆ for all S ∈ F , S then we will denote by C(F , ∆) the set S∈F C(S, ∆). Theorem 5.5. Let F be a family of numerical semigroups and let ∆ be a numerical semigroup such that S ⊆ ∆ for all S ∈ F . Then R(F , ∆) is the set formed by all the finite intersections of elements in C(F , ∆). Proof. Let R = {S1 ∩ · · · ∩ Sn | n ∈ N \ {0} and S1 , . . . , Sn ∈ C(F , ∆)}. Having in mind that R(F , ∆) is an R-variety which contains F and with maximum equal to ∆, we easily deduce that R ⊆ R(F , ∆). Let us see now that R is an R-variety. On the one hand, it is clear that ∆ = max(R) and that, if S, T ∈ R, then S ∩ T ∈ R. On the other hand, let S ∈ R such that S 6= ∆. Then S = S1 ∩ · · · ∩ Sn for some S1 , . . . , Sn ∈ C(F , ∆). Now, from Lemma 5.4, we have that F∆ (S) = max {F∆ (S1 ), . . . , F∆ (Sn )} and, thus, F∆ (Si ) ≤ F∆ (S) for all i ∈ {1, . . . , n}. Let us observe that, if F∆ (S) > F∆ (Si ), then Si ∪ {F∆ (S)} = Si . Moreover, if F∆ (S) = F∆ (Si ), then we get Si ∪ {F∆ (S)} = Si ∪ {F∆ (Si )} ∈ C(F , ∆). Therefore, Si ∪ {F∆ (S)} ∈ C(F , ∆) for all i ∈ {1, . . . , n}. Since S ∪{F∆ (S)} = (S1 ∪{F∆ (S)})∩· · ·∩(Sn ∪{F∆ (S)}), then S ∪ {F∆ (S)} ∈ R. Consequently, R is an R-variety. Finally, since R is an R-variety which contains F and with maximum equal to ∆, then R(F , ∆) ⊆ R and, thereby, we conclude that R = R(F , ∆). 17 Let us observe that, if F is a finite family, then C(F , ∆) is a finite set and, therefore, R(F , ∆) is a finite R-variety. Lemma 5.6. Let R and R′ be two R-varieties. If R ⊆ R′ , then ∆(R) ⊆ ∆(R′ ). Proof. If R ⊆ R′ , then ∆(R) ∈ R′ . Therefore, ∆(R) ⊆ ∆(R′ ). The next example shows us that, in general, we cannot talk about the smallest R-variety which contains a given family of numerical semigroups. Example 5.7. Let F = {h5, 6i, h5, 7i}. As a consequence of Lemma 5.6, the candidate to be the smallest R-variety which contains F must have as maximum the numerical semigroup h5, 6, 7i (that is, the smallest numerical semigroup containing h5, 6i and h5, 7i). Thus, the candidate to be the smallest R-variety which contains F is R(F , h5, 6, 7i). Let us see now that R(F , h5, 6, 7i) 6⊆ R(F , h5, 6, 7, 8i) and, in this way, that there does not exist the smallest R-variety which contains F . In order to do it, we will show that h5, 6, 7i ∈ / R(F , h5, 6, 7, 8i). In fact, by applying Theorem 5.5, if h5, 6, 7i ∈ R(F , h5, 6, 7, 8i), then we deduce that there exist S1 ∈ C(h5, 6i, h5, 6, 7, 8i) and S2 ∈ C(h5, 7i, h5, 6, 7, 8i) such that S1 ∩ S2 = h5, 6, 7i. Since S1 ∈ C(h5, 6i, h5, 6, 7, 8i), then there exists n1 ∈ N such that S1 = h5, 6i ∪ {x ∈ h5, 6, 7, 8i | x ≥ n1 }. Moreover, h5, 6, 7i ⊆ S1 and, thereby, n1 ≤ 7. Consequently, 8 ∈ S1 . By an analogous reasoning, we have that 8 ∈ S2 too. Consequently, 8 ∈ S1 ∩ S2 = h5, 6, 7i, which is false. Let R be an R-variety. We will say that F (subset of R) is a system of generators of R if R = R(F , ∆(R)). Let us observe that, in such a case, R is the smallest R-variety which contains F and with maximum equal to ∆(R). We will say that an R-variety, R, is finitely generated if there exists a finite set F ⊆ R such that R = R(F , ∆(R)) (that is, if R has a finite system of generators). As a consequence of Theorem 5.5, we have the following result. Corollary 5.8. An R-variety is finitely generated if and only if it is finite. From now on, F will denote a family of numerical semigroups and ∆ will denote a numerical semigroup such that S ⊆ ∆ for all S ∈ F . Our purpose is to give a method in order to compute the minimal R(F , ∆)-system of generators of a R(F , ∆)-monoid by starting from F and ∆. If A ⊆ ∆, then for each S ∈ F we define ( S, if A ⊆ S, α(S) = S ∪ {x ∈ ∆ | x ≥ xS }, if A * S, where xS = min{a ∈ A | a ∈ / S}. As a consequence of Lemma 3.2 and Theorem 5.5, we have the next result. T Lemma 5.9. The R(F , ∆)-monoid generated by A is S∈F α(S). Recalling that R(F , ∆)(A) denotes the R(F , ∆)-monoid generated by A, we have the following result. 18 Proposition 5.10. If A ⊆ ∆, then B = {xS | S ∈ F and A 6⊆ S} is the minimal R(F , ∆)-system of generators of R(F , ∆)(A). Proof. Let us observe that, if S ∈ F , then A ⊆ S if and only if B ⊆ S. Moreover, if A 6⊆ S, then min{a ∈ A | a ∈ / S} = min{b ∈ B | b ∈ / S}. Therefore, by applying Lemma 5.9, we have that R(F , ∆)(A) = R(F , ∆)(B). Consequently, in order to prove that B is the minimal R(F , ∆)-system of generators of R(F , ∆)(A), will be enough to see that, if C B, then R(F , ∆)(C) 6= R(F , ∆)(A). In effect, if C B, then there exists S ∈ F such that xS ∈ / C and, thereby, we have that C ⊆ S or that min{c ∈ C | c ∈ / S} > xS . Now, by applying once more time Lemma 5.9, we easily deduce that xS ∈ / R(F , ∆)(C). Since xS ∈ B ⊆ A, then we get that A 6⊆ R(F , ∆)(C) and, therefore, R(F , ∆)(C) 6= R(F , ∆)(A). As an immediate consequence of the above proposition we have the next result. Corollary 5.11. Every R(F , ∆)-monoid has R(F , ∆)-range less than or equal to the cardinality of F . We will finish this section by illustrating its content with an example. Example 5.12. Let F = {h5, 7, 9, 11, 13i, h4, 10, 11, 13i} and ∆ = h4, 5, 7i. We are going to compute the tree G(R(F , ∆)). First of all, to compute the minimal R(F , ∆)-system of generators of h4, 5, 7i, we apply Proposition 5.10 with A = {4, 5, 7}. Since xh5,7,9,11,13i = 4 and xh4,10,11,13i = 5, then {4, 5} is such a minimal R(F , ∆)-system. Now, because F∆ (h4, 5, 7i) = −1, and by applying Theorem 4.2, we get that h4, 5, 7i has two children, h4, 5, 7i \ {4} = h5, 7, 8, 9, 11i (with F∆ (h5, 7, 8, 9, 11i) = 4) and h4, 5, 7i \ {5} = h4, 7, 9, 10i (with F∆ (h4, 7, 9, 10i) = 5). Now, if we take A = {5, 7, 8, 9, 11} in Proposition 5.10, then we have that xh5,7,9,11,13i = 8 and xh4,10,11,13i = 5. Thus, we conclude that {5, 8} is the minimal R(F , ∆)-system of h5, 7, 8, 9, 11i. Moreover, since F∆ (h5, 7, 8, 9, 11i) = 4, then Theorem 4.2 asserts that h5, 7, 8, 9, 11i \ {5} = h7, 8, 9, 10, 11, 12, 13i (with F∆ (h7, 8, 9, 10, 11, 12, 13i) = 5) and h5, 7, 8, 9, 11i \ {8} = h5, 7, 9, 11, 13i (with F∆ (h5, 7, 9, 11, 13i) = 8) are the two children of h5, 7, 8, 9, 11i. With A = {4, 7, 9, 10}, we get that {4, 7} is the minimal R(F , ∆)-system of h4, 7, 9, 10i. By recalling that F∆ (h4, 7, 9, 10i) = 5, we conclude that h4, 7, 9, 10i has only one child, that is h4, 7, 9, 10i\{7} = h4, 9, 10, 11i (with F∆ (h4, 9, 10, 11i) = 7). By repeating the above process, we get the whole tree G(R(F , ∆)). 19 h4, 5, 7i ✟ ✯ ❨❍ ❍ ✟ ✟ ❍ h5, 7, 8, 9, 11i h4, 7, 9, 10i ✯ ❨❍ ❍ ✻ ✟✟ ✟ ❍ h7, 8, 9, 10, 11, 12, 13i h5, 7, 9, 11, 13i h4, 9, 10, 11i ✯ ✟ ❨ ❍ ✻ ✟ ❍ ✟ ❍ h8, 9, 10, 11, 12, 13, 14, 15i h7, 9, 10, 11, 12, 13, 15i h4, 10, 11, 13i ✐PP P ✻ PP h9, 10, 11, 12, 13, 14, 15, 16, 17i h8, 10, 11, 12, 13, 15, 17i ✻ h10, 11, 12, 13, 14, 15, 16, 17, 18, 19i Now, we are going to represent the vertices of G(R(F , ∆)) using their minimal R(F , ∆)-systems of generators. Moreover, we add to each vertex the corresponding Frobenius number restricted to ∆. Thus, we clarify all the steps to build the tree G(R(F , ∆)). R(F , ∆)({4, 5}), −1 ✯ ✟ ❨ ❍ ❍❍ ✟✟ R(F , ∆)({5, 8}), 4 R(F , ∆)({4, 7}), 5 ✯ ✟ ❨ ❍ ✻ ❍❍ ✟✟ R(F , ∆)({7, 8}), 5 R(F , ∆)({5}), 8 R(F , ∆)({4, 9}), 7 ✯ ✟ ❨ ❍ ✻ ✟ ❍ ✟ ❍ R(F , ∆)({8, 9}), 7 R(F , ∆)({7}), 8 R(F , ∆)({4}), 9 ✐ P PP ✻ PP R(F , ∆)({9}), 8 R(F , ∆)({8}), 9 ✻ R(F , ∆)(∅), 9 6 Conclusion We have been able to give a structure to certain families of numerical semigroups which are not (Frobenius) varieties or (Frobenius) pseudo-varieties. For that we have generalized the concept of Frobenius number to the concept of restricted Frobenius number and, then, we have defined the R-varieties (or (Frobenius) restricted variety). After studying relations among varieties, pseudo-varieties, and R-varieties, we have introduced the concepts of R-monoid and minimal R-system of generators of a R-monoid, which lead to associate a tree with each R-variety and, in consequence, obtain recurrently all the elements of an R-variety. Finally, although in general it is not possible to define the smallest R-variety that contains a given family F of numerical semigroups, we have been able to 20 give an alternative when we fix in advance the maximum of the smallest Rvariety. References [1] M. Bras-Amorós, P. A. Garcı́a-Sánchez, Patterns on numerical semigroups, Linear Algebra Appl. 414 (2006), 652–669. [2] M. Bras-Amorós, P. A. Garcı́a-Sánchez, and A. Vico-Oton, Nonhomogeneous patterns on numerical semigroups, Int. J. Algebra Comput. 23 (2013), 1469–1483. [3] M. Delgado, P. A. Garcı́a-Sánchez, J. C. Rosales, J. M. Urbano-Blanco, Systems of proportionally modular Diophantine inequalities, Semigroup Forum 76 (2008), 469–488. [4] E. Kunz, On the type of certain numerical semigroups and a question of Wilf, Semigroup Forum 93 (2016), 205–210. [5] E. Kunz, R. Waldi, Geometrical illustration of numerical semigroups and of some of their invariants, Semigroup Forum 89 (2014), 664–691. [6] J. L. Ramı́rez Alfonsı́n, The Diophantine Frobenius problem (Oxford Univ. Press, 2005). [7] A. M. Robles-Pérez, J. C. Rosales, The numerical semigroup of phrases’ lengths in a simple alphabet, The Scientific World Journal 2013 (2013), Article ID 459024, 9 pages. [8] A. M. Robles-Pérez, J. C. Rosales, Frobenius pseudo-varieties in numerical semigroups, Ann. Mat. Pura Appl. 194 (2015), 275–287. [9] A. M. Robles-Pérez, J. C. Rosales, Numerical semigroups in a problem about cost-effective transport. To appear in Forum Math. DOI: 10.1515/forum-2015-0123 [10] A. M. Robles-Pérez, J. C. Rosales, Numerical semigroups in a problem about economic incentives for consumers. Preprint (arXiv:1605.03900 [math.GR]). [11] J. C. Rosales, Families of numerical semigroups closed under finite intersections and for the Frobenius number, Houst. J. Math. 34 (2008), 339–348. [12] J. C. Rosales, M. B. Branco, D. Torrão, Sets of positive integers closed under product and the number of decimal digits, J. Number Theory 147 (2015), 1–13. [13] J. C. Rosales, M. B. Branco, D. Torrão, Bracelet monoids and numerical semigroups, Appl. Algebr. Eng. Commun. Comput. 27 (2016), 169–183. 21 [14] J. C. Rosales and P. A. Garcı́a-Sánchez, Numerical semigroups (Developments in Mathematics, vol. 20, Springer, New York, 2009). [15] J. C. Rosales, P. A. Garcı́a-Sánchez, J. I. Garcı́a-Garcı́a and M. B. Branco, Numerical semigroups with maximal embedding dimension, Int. J. Commutat. Rings 2 (2003), 47–53. [16] J. C. Rosales, P. A. Garcı́a-Sánchez, J. I. Garcı́a-Garcı́a and M. B. Branco, Arf numerical semigroups, J. Algebra 276 (2004), 3–12. [17] J. C. Rosales, P. A. Garcı́a-Sánchez, J. I. Garcı́a-Garcı́a and M. B. Branco, Saturated numerical semigroups, Houst. J. Math. 30 (2004), 321–330. 22
4math.GR
1 Sparse Representation for Wireless Communications Zhijin Qin1 , Jiancun Fan2 , Yuanwei Liu3 , Yue Gao3 , and Geoffrey Ye Li4 1 Lancaster University, Lancaster, UK Xi’an Jiaotong University, Xi’an, China 3 Queen Mary University of London, London, UK 4 Georgia Institute of Technology, Atlanta, GA, USA arXiv:1801.08206v1 [cs.IT] 24 Jan 2018 2 Abstract—Sparse representation can efficiently model signals in different applications to facilitate processing. In this article, we will discuss various applications of sparse representation in wireless communications, with focus on the most recent compressive sensing (CS) enabled approaches. With the help of the sparsity property, CS is able to enhance the spectrum efficiency and energy efficiency for the fifth generation (5G) networks and Internet of Things (IoT) networks. This article starts from a comprehensive overview of CS principles and different sparse domains potentially used in 5G and IoT networks. Then recent research progress on applying CS to address the major opportunities and challenges in 5G and IoT networks is introduced, including wideband spectrum sensing in cognitive radio networks, data collection in IoT networks, and channel estimation and feedback in massive MIMO systems. Moreover, other potential applications and research challenges on sparse representation for 5G and IoT networks are identified. This article will provide readers a clear picture of how to exploit the sparsity properties to process wireless signals in different applications. Keywords: Wireless communications, compressive sensing, sparsity property, 5G, Internet of Things. I. I NTRODUCTION Sparse representation expresses some signals as a linear combination of a few atoms from a prespecified and over-complete dictionary [1]. This form of sparse (or compressible) structure arises naturally in many applications [2]. For example, audio signals are sparse in frequency domain, especially for the sounds representing tones. Image processing can exploit a sparsity property in the discrete cosine domain, i.e. many discrete cosine transform (DCT) coefficients of images are zero or small enough to be regarded as zero. This type of sparsity property has enabled intensive research on signal and data processing, such as dimension reduction in data science, wideband sensing in cognitive radio networks (CRNs), data collection in large-scale wireless sensor networks (WSNs), and channel estimation and feedback in massive MIMO. Traditionally, signal acquisition and transmission adopt the procedure with sampling and compression. As massive connectivity is expected to be supported in the fifth generation (5G) networks and Internet of Things (IoT) networks, the amount of generated data becomes huge. Therefore, signal processing has been confronted with challenges on high sampling rates for data acquisition and large amount of data for storage and transmission, especially in IoT applications with powerconstrained sensor nodes. Except for developing more advanced sampling and compression techniques, it is natural to ask whether there is an approach to achieve signal sampling and compression simultaneously. As an appealing approach employing sparse representations, compressive sensing (CS) technique [3] has been proposed to reduce data acquisition costs by enabling sub-Nyqusit sampling. Based on the advanced theory [4], CS has been widely applied in many areas. The key idea of CS is to enable exact signal reconstruction from far fewer samples than that is required by the NyquistShannon sampling theorem provided that the signal admits a sparse representation in a certain domain. In CS, compressed samples are acquired via a small set of nonadaptive, linear, and usually randomized measurements, and signal recovery is usually formulated as an l0 norm minimization problem to find the sparsest solution satisfying the constraints. Since l0 -norm minimization is an NP-hard problem, most of the exiting research contributions on CS solve it by either approximating it to a convex l1 -norm minimization problem [4] or adopting greedy algorithms, such as orthogonal match pursuit (OMP). It is often the case that the sparsifying transformation is unknown or difficult to determine. Therefore, projecting a signal to its proper sparse domain is quite essential in many applications that invoke CS. In 5G and IoT networks, the identified sparse domains mainly include frequency domain, spatial domain, wavelet domain, DCT domain, etc. CS can be used to improve spectrum efficiency (SE) and energy efficiency (EE) for these networks. By enabling the unlicensed usage of 2 spectrum, CRNs exploit spectral opportunities over a wide frequency range to enhance the network SE. In wideband spectrum sensing, spectral signals naturally exploit a sparsity property in frequency domain due to low utilization of spectrum [5], [6], which enables sub-Nyquist sampling on cognitive devices. Another interesting scenario is a small amount of data collection in large-scale WSNs with power-constrained sensor nodes, such as smart meter monitoring infrastructure in IoT applications. In particular, the monitoring readings usually have a sparse representation in DCT domain due to the temporal and spatial correlations [7]. CS can be applied to enhance the EE of WSNs and to extend the lifetime of sensor nodes. Moreover, massive MIMO is a critical technique for 5G networks. In massive MIMO systems, channels corresponding to different antennas are correlated. Furthermore, a huge number of channel coefficients can be represented by only a few parameters due to a hidden joint sparsity property caused by the shared local scatterers in the radio propagation environment. Therefore, CS can be potentially used in massive MIMO systems to reduce the overhead for channel estimation and feedback and facilitate precoding [8]. Even though various applications have different characters, it is worth noting that the signals in different scenarios share a common sparsity property even though the sparse domains can be different, which enables CS to enhance the SE and EE of wireless communications networks. There have been some interesting surveys on CS [9] and its applications [10]–[12]. One of the most popular articles on CS [9] has provided an overview on the theory of CS as a novel sampling paradigm that goes against the common wisdom in data acquisition. CS-enabled sparse channel estimation has been summarized in [10]. In [11], a comprehensive review of the application of CS in CRNs has been provided. A more specific survey on compressive covariance sensing has been presented in [12] that includes the reconstruction of second-order statistics even in the absence of prior sparsity information. These existing surveys serves different purposes. Some cover the basic principles for beginners and others focus on specific aspects of CS. Different from the existing literature, our article provides a comprehensive overview of the recent contributions on CS-enabled wireless communications from the perspective of adopting different sparse domain projections. In this article, we will first introduce the basic principles of CS briefly. Then we will present the different sparse domains for signals in wireless communications. Subsequently, we will provide CS-enabled frameworks in various wireless communications scenarios, including wideband spectrum sensing in CRNs, data collection in large-scale WSNs, and channel estimation and feedback for massive MIMO, as they have been identified to be critical to 5G and IoT networks and share the same spirit by exploiting the sparse domains aforementioned. Within each identified scenario, we start with projecting a signal to a sparse domain, then introduce the CSenabled framework, and finally illustrate how to exploit joint sparsity in the CS-enabled framework. Moreover, the reweighted CS approaches for each scenario will be discussed, where the weights are constructed by prior information depending on specific application scenarios. The other potential applications and research challenges on applying CS in wireless networks will also be discussed and followed by conclusions. This article gives readers a clear picture on the research and development of the applications of CS in different scenarios. By identifying the different sparse domains, this article illustrates the benefits and challenges on applying CS in wireless communication networks. II. S PARSE R EPRESENTATION Sparse representation of signals has received extensive attention due to its capacity for efficient signal modelling and related applications. The problem solved by the sparse representation is to search for the most compact representation of a signal in terms of a linear combination of the atoms in an overcomplete dictionary. In the literature, three aspects of research on the sparse representation have been focused: 1) Pursuit methods for solving the optimization problem, such as matching pursuit and basis pursuit; 2) Design of the dictionary, such as the K-SVD method; 3) Applications of the sparse representation, such as wideband spectrum sensing, channel estimation of massive MIMO, and data collection in WSNs. General sparse representation methods, such as principal component analysis (PCA) and independent component analysis (ICA), aim to obtain a representation that enables sufficient reconstruction. It has been demonstrated that PCA and ICA are able to deal with signal corruption, such as noise, missing data, and outliers. For sparse signals without measurement noise, CS can recover the sparse signals exactly with random measurements. Furthermore, the random measurements significantly outperform measurements based on PCA and ICA for the sparse signals without corruption [13]–[15]. In the following, we will focus on the principles of CS and the common sparse domains potentially used in 5G and IoT scenarios. 3 A. Principles of Standard Compressive Sensing The principles of standard CS, such as to be performed at a single node, can be summarized into the following three parts [3]: 1) Sparse Representation: Generally speaking, sparse signals contain much less information than their ambient dimension suggests. Sparsity of a signal is defined as the number of non-zero elements in the signal under a certain domain. Let f be an N -dimensional signal of interest, which is sparse over the orthonormal transformation basis matrix Ψ ∈ RN ×N , and s be the sparse representation of f over the basis Ψ. Then f can be given by f = Ψs. (1) Apparently, f can be the time or space domain representation of a signal, and s is the equivalent representation of f in the Ψ domain. For example, if Ψ is the inverse Fourier transform (FT) matrix, then s can be regarded as the frequency domain representation of the time domain signal, f. Signal f is said to be K -sparse in the Ψ domain if there are only K (K  N ) out of the N coefficients in s that are non-zero. If a signal is able to be sparsely represented in a certain domain, the CS technique can be invoked to take only a few linear and non-adaptive measurements. 2) Projection: When the original signal f arrives at the receiver, it is processed by the measurement matrix Φ ∈ RP ×N with P < N , to get the compressed version of the signal, that is, x = Φf = ΦΨs=Θs, (2) where Θ = ΦΨ is an P × N matrix, called the sensing matrix. As Φ is independent of signal f, the projection process is non-adaptive. Fig. 1 illustrates how the different sensing matrices Θ influence the projection of a signal from high dimension to its space, i.e., mapping s ∈ R3 to x ∈ R2 . As shown in Fig. 1, s = s s 0 is a three-dimensional signal. When s is mapped into a!two-dimensional space by 1 −1 0 taking Θ1 = as the sensing matrix, the 0 0 1 original signal s cannot be recorded based on the projection under Θ1 . This is because that the plane spanned by the two row vectors of Θ1 is orthogonal to signal s as shown in Fig. 1(a). Therefore, Θ1 corresponds to the worst projection. As shown in Fig. 1(b), we can also ob! 1 0 0 serve that the projection by taking Θ2 = 0 0 1 is not a good one. It is noted that the plane spanned by the two row vectors of Θ2 can only contain part of information of the sparse signal s, and the sparse component in the direction of s2 is missed when the signal s is projected into the two-dimensional space. ! 1 1 0 When the sensing matrix is set to Θ3 = , 0 0 1 as shown in Fig. 1(c), the signal s can be fully recorded as it falls into the plane spanned by the two row vectors of Θ3 . Therefore, Θ3 results in a good projection and s can be exactly recovered by its projection x in the twodimensional space. Then it is natural to ask what type of projection is good enough to guarantee the exact signal recovery? The key of CS theory is to find out a stable basis Ψ or measurement matrix Φ to achieve exact recovery of the signal with length N from P measurements. It seems an undetermined problem as P < N . However, it has been proved in [4] that exact recovery can be guaranteed under the following conditions: • Restricted isometry property (RIP): Measurement matrix Φ has the RIP of order K if kΦf k2`2 ≤ 1 + δK (3) 1 − δK ≤ kf k2`2 holds for all K -sparse signal f , where δK is the restricted isometry constant of a matrix Φ. • Incoherence property: Incoherence property requires that the rows of measurement matrix Φ cannot sparsely represent the columns of the sparsifying matrix Ψ and vice verse. More specifically, a good measurement will pick up a little bit information of each component in s based on the condition that Φ is incoherent with Ψ. As a result, the extracted information can be maximized by using the minimal number of measurements. It has been pointed out that verifying both the RIP condition and incoherence property is computationally complicated but they could be achieved with a high probability simply by selecting Φ as a random matrix. The common random matrices include Gaussian matrix, Bernoulli matrix, or almost all others matrices with independent and identically distributed (i.i.d.) entries. Besides, with the properties of the matrix with i.i.d. entries Φ, the matrix Θ = ΦΨ is also random i.i.d., regardless of the choice of Ψ. Therefore, the random matrices are universal as they are random enough to be incoherent with any fixed basis. It has been demonstrated that random measurements can universally capture the information relevant for many compressive signal processing applications without any prior knowledge of either the signal class and its sparse domain or the ultimate signal processing task. Moreover, for Gaussian matrices the number of measurements required to guarantee the exact signal recovery 4 s2 s2 s2 s   S = s  0   s S =  s   0   s1 s3 s1 s3  1 −1 0  Θ1 =   0 0 1 (a) Worst projection s   S = s  0   s1 s3 1 0 0 Θ2 =   0 0 1 1 1 0 Θ3 =   0 0 1 (b) Bad projection (c) Good projection Fig. 1: Projection of a sparse signal with one non-zero component with different sensing matrices. 3) Signal Reconstruction: After the compressed measurements are collected, the original signal should be reconstructed. Since most of the basis coefficients in s are negligible, the original signal can be reconstructed by finding out the minimal set of coefficients that matches 1 0.8 0.6 Pd is almost minimal. However, random matrices inherently have two major drawbacks in practical applications: huge memory buffering for storage of matrix elements, and high computational complexity due to their completely unstructured nature [16]. Compared to the standard CS that limits its scope to standard discrete-to-discrete measurement architectures using random measurement matrices and signal models based on standard sparsity, more structured sensing architectures, named structured CS, have been proposed to implement CS on feasible acquisition hardware. So far, many efforts have been put on the design of structured CS matrices, i.e., random demodulator [17], to make CS implementable with expense of performance degradation. Particularly, the main principle of random demodulator is to multiply the input signal with a high-rate pseudonoise sequence, which spreads the signal across the entire spectrum. Then a low-pass anti-aliasing filter is applied and the signal is captured by sampling it at a relatively low rate. With the additional digital processing to reduce the burden on the analog hardware, random demodulator bypasses the need for a high-rate analogue-to-digital converter (ADC) [17]. A comparison of Gaussian sampling matrix and random demodulator is provided in Fig. 2 in terms of detection probability with different compression ratios P/N . From the figure, the Gaussian sampling matrix performs better than the random demodulator. 0.4 0.2 Random demodulator Gaussian distributed matrix 0 -2 10 -1 10 P/N 0 10 Fig. 2: Detection probability versus compression ratio with different measurement matrices. In this case, the signal is one-sparse and the simulation iteration is 1000. the set of compressed measurements x, that is, by solving ŝ = arg min ksk`p subject to Θs = x, s (4) where k·k`p is the `p -norm and p = 0 corresponds to counting the number of non-zero elements in s. However, the reconstruction problem in (4) is both numerically unstable and NP-hard [3] when `0 -norm is used. So far, there are mainly two types of relaxations to problem (4) to find a sparse solution. The first type is convex relaxation, where `1 -norm is used to substitute `0 -norm in (4). Then (4) can be solved by standard convex solvers, e.g., cvx. It has been proved that `1 norm results in the same solution as `√ 0 norm when RIP is satisfied with the constant δ2k < 2 − 1 [18]. Another type of solution is to use a greedy algorithm, such as OMP [19], to find a local optimum in each iteration. In comparison with the convex relaxation, the greedy algo- 5 rithm usually requires lower computational complexity and time cost, which makes it more practical for wireless communication systems. Furthermore, the recent result has shown that the recovery accuracy achieved by some greedy algorithms is comparable to the convex relaxation but requiring much lower computational cost [20]. B. Reweighted Compressive Sensing As aforementioned, `1 -norm is a good approximation for the NP-hard `0 -norm problem when RIP holds. However, the large coefficients are penalized more heavily than the small ones in `1 -norm minimization, which leads to performance degradation on signal recovery. To balance the penalty on the large and the small coefficients, reweighted CS is introduced by providing different penalties on those large and small coefficients. A reweighted `1 -norm minimization framework [3] has been developed to enhance the signal recovery performance with fewer compressed measurements by solving ŝ = arg min kWsk`1 subject to Θs = x, s (5) where W is a diagonal matrix with w1 , . . . , wn on the diagonal and zeros elsewhere. Moreover, `p -norm, e.g. 0 < p < 1, is utilized to lower the computational complexity of signal recovery process caused by the `1 -norm optimization problem. Iterative reweighted least-square (IRLS) based CS approach has been proposed in [21] to solve (4) in a non-convex approach as ŝ = arg min s N X wi si subject to Θs = x, i=1 (l−1) p−2 where wi = si (6) where M is the the set of nodes in the network. As stated in (2), Θm is the sensing matrix deployed at the m-th node, and sm is a sparse signal of interest. DCS becomes a standard CS when M = 1. In the applications of standard CS, the signal received at the same node has its sparsity property due to its intracorrelation. While for the networks with multiple nodes, signals received at different nodes exhibit strong intercorrelation. The intra-correlation and inter-correlation of signals from the multiple nodes lead to a joint sparsity property. The joint sparsity level is usually smaller than the aggregate over the individual signal’s sparsity level. As a result, the number of compressed measurements required for exact recovery in DCS can be reduced significantly compared to the case performing standard CS at each single node independently. In DCS, there are two closely related concepts: distributed networks and distributed CS solvers. The distributed networks refer to networks that different nodes perform data acquisition in a distributed way and the standard CS can be applied at each node individually to perform signal recovery. While for DCS solver as proposed in [25], the data acquisition process requires no collaboration among sensors and the signal recovery process is performed at several computational nodes, which can be distributed in a network or locally placed within a multiple core processor. Generally, it is of interest to minimize both computation cost and communication overhead in DCS. The most popular application scenario of DCS is that all signals share the common sparse support but with different non-zero coefficients. is computed based on the result (l−1) of the last iteration, si . It is worth noting that (4) becomes non-convex when p < 1. The existing algorithms cannot guarantee to reach a global optimum and may only produce local minima. However, it has been proved [22], [23] that under some circumstances the reconstruction in (4) will reach a unique and global minimizer [24], which is exactly ŝ = s. Therefore, we can still exactly recover the signal in practice. C. Distributed Compressive Sensing The distributed compressive sensing (DCS) [25] is an extension of the standard one by considering networks with M nodes. At the m-th node, measurement xm can be given by xm = Θm sm , ∀m ∈ M, (7) D. Common Sparse Domains for CS-enabled 5G and IoT Networks CS-enabled sub-Nyquist sampling is possible only if the signal is sparse in a certain domain. The common sparse domains utilized in CS-enabled 5G and IoT networks include frequency domain, wavelet domain, discrete cosine domain, angular domain, to name a few. 1) Frequency domain: due to low spectrum utilization, the wideband spectrum signal shows a sparse property when it is converted into the frequency domain. 2) Discrete cosine domain: due to temporal correlation, signals in some applications, such as environment information monitoring, show a sparse property in the discrete cosine domain as the readings normally do not change too much within a short period. 3) Spatial domain: as the number of paths as well as the angle-of-arrival are much smaller than the 6 Joint sparsity Unoccupied 1) Spatial-frequency domain: An illustration of the DCS-enabled cooperative CRN is given in Fig. 3, where the joint sparsity in the spatial-frequency domain is utilized. Specifically, each column represents the signal received at each location, which is sparse in frequency domain as only a few channels are occupied. At different locations, the same frequency bands may be occupied, but the signal powers for each frequency band are various due to fading and shadowing. Therefore, different columns of the matrix share the common sparse support though each node operates without cooperation. With the DCS framework, each node performs sub-Nyquist sampling individually first and then the original signals can be recovered simultaneously. More details on this issue will be discussed in Section III. 2) Spatial-temporal domain: In WSNs, sensor nodes are deployed to periodically monitor data and to send the compressed data to the sink. Then the sink is responsible for recovering the original reading by CS algorithms as the readings across all sensor nodes exhibit both spatial and temporal correlations, as we can see from the discussion in Section IV. 3) Angular-time domain: Massive MIMO channels between some users and the massive base station (BS) antennas appear the spatial common sparsity in both the time domain and the angular domain, as we will discuss in detail in Section V. Different sparse domains and their applications in 5G and IoT networks are summarized in Table I, where ‘WT’ is short for wavelet transform. In addition to the listed sparse domains and their applications, it is worth noting that the core of applying CS is to identify how to exploit the sparse property in 5G and IoT networks. In the following, we discuss three major applications of CS in 5G and IoT networks. ... ... ... ... ... For multi-node cases, due to the spatical correlation, the joint sparsity is exploited to apply DCS in spatialx domains, where ‘x’ can be any of the aforementioned domains. Here, we give some examples on how the joint sparsity is utilized in different scenarios in 5G and IoT networks: J sensors at different locations I channels number of antennas in massive MIMO systems, the channel conditions can be represented by a limited number of parameters. In this case, the spatial domain turns into the angular domain. Occupied Fig. 3: Spatial-frequency correlation. III. C OMPRESSIVE S ENSING ENABLED C OGNITIVE R ADIO N ETWORKS In this section, we introduce the applications of CS in CRNs. Radio frequency (RF) spectrum is a valuable but tightly regulated resource due to its unique and important role in wireless communications. The demand for RF spectrum is increasing due to a rapidly expanding market of multimedia wireless services while the usable spectrum is becoming scarce due to the current rigid spectrum allocation policies. However, according to the reports from the Federal Communications Commission (FCC) and the Office of Communications (Ofcom), localized temporal and geographic spectrum utilization is extremely low and unbalanced in reality. Cognitive radio (CR) has become a promising solution to solve the spectrum scarcity problem, by allowing unlicensed secondary users (SUs) to opportunistically access a licensed band when the licensed primary user (PU) is absent. In order to avoid any harmful interference to the PUs, SUs in CRNs should be aware of the spectrum occupancy over the spectrum of interest. Spectrum sensing, which detects the spectrum holes, the frequency bands that are not utilized by PUs, is one of the most challenging tasks in CR. As the radio environment changes over time and space, an efficient spectrum sensing technique should be capable of tracking these fast changes [26]. A good approach for detecting PUs is to adopting the traditional narrowband sensing algorithms, which include energy detection, matched-filtering, and cyclostationary feature detection. Here, the term narrowband implies that the frequency range is sufficiently narrow such that the channel frequency response can be considered as flat. In other words, the bandwidth of interest is less than the coherence bandwidth of the channel [27]. While the present spectrum sensing algorithms have 7 TABLE I: Common sparse domains and their applications in 5G and IoT networks. Sparse domain Applications Why sparse? Sparsity property Frequency domain Sparsifying transform FT Wideband spectrum sensing Single sparsity Spatial domain - Discrete cosine domain Wavelet domain Spatial-frequency domain Spatial-discrete cosine/wavelet domain Angular-time domain DCT Channel estimation in massive MIMO Sensor data gathering Low spectrum utilization in practice Number of paths is much fewer than the number of antennas Temporal correlation Sensor data gathering Cooperative wideband spectrum sensing Active node detection/data gathering Temporal correlation Spatial correlation and low spectrum utilization Spatial and temporal correlation Single sparsity Joint sparsity Channel estimation in massive MIMO Number of paths and degrees of arrival are much fewer than the number of antennas Joint sparsity WT FT DCT/WT - focused on exploiting spectral opportunities over a narrow frequency band, future CRNs will eventually be required to exploit spectral opportunities over a wide frequency range from hundreds of megahertz (MHz) to several gigahertz (GHz), in order to improve spectrum efficiency and achieve higher opportunistic throughput. As driven by the Nyquist-Shannon sampling theory, a simple approach is to acquire the wideband signal directly by a high-speed ADC, which is particularly challenging or even unaffordable, especially for energyconstrained devices, such as smart phones or even battery-free devices. Therefore, revolutionary wideband spectrum sensing techniques become more than desired to release the burden on high-speed ADCs. A. Standard Compressive Spectrum Sensing Recent development on CS theory inspires subNyquist sampling, by utilizing the sparse nature of signals [3]. Driven by the inborn nature of the sparsity property of signals in wireless communications, e.g., the sparse utilization of spectrum, CS theory is capable of enabling sub-Nyquist sampling for wideband spectrum sensing. 1) Energy Detection based Compressive Spectrum Sensing: CS theory has been applied to wideband spectrum sensing in [28], where sub-Nyquist sampling is achieved without loss of any information. A general framework for compressive spectrum sensing with the energy detection method is summarized as shown in Fig. 4, where the analog signal at the receiver, r (t) has a sparse representation sf in the frequency domain. The received signals are then sampled at a sub-Nyquist rate. Due to low spectrum utilization, sf can be recovered from the under-sampled measurements. Then the energy Single sparsity Single sparsity Joint sparsity of each channel can be calculated, and therefore the spectrum occupancy can be determined. Lately, it has been identified in [29] that the CSenabled system is somewhat sensitive to noise, exhibiting a 3 dB SNR loss per octave of subsampling, which parallels the classic noise-folding phenomenon. In order to improve robustness to noise, a denoised compressive spectrum sensing algorithm has been proposed in [6]. The sparsity level is required in advance in order to determine the lower sampling rate at SUs locally without loss of any information. However, sparsity level is dependent on spectrum occupancy, which is usually unavailable in dynamic CR networks. In order to solve this problem, a have proposed a two-step CS scheme has been proposed in [30] to minimize the sampling rates when the sparsity level is changing. In this approach, the actual sparsity level is estimated first and the number of compressed measurements to be collected is then adjusted before sampling. However, this algorithm introduces extra computational complexity by performing the sparsity level estimation. In order to avoid sparsity level estimation, Sun et al. [31] have proposed to adjust the number of compressed measurements adaptively by acquiring compressed measurements step by step in continuous sensing slots. However, this iterative process incurs higher computational complexities at the SU as (4) has to be solved several times until the exact signal recovery is achieved. A low-complexity compressive spectrum sensing algorithm has been proposed in [5] by alleviating the iterative process of signal recovery. More specifically, geolocation data can provide a rough estimation of the sparsity level to minimize the sampling rates. Subsequently, data from geolocation database is utilized as the prior information for signal recovery. By doing so, signal recovery performance is improved with 8 significant reduction on the computational complexity and minimal number of measurements. 2) Compressive Power Spectral Density Estimation: Different from the aforementioned approaches that concentrate on spectral estimation with perfect reconstruction of the original signals, compressive power spectral density (PSD) estimation provides another approach for spectrum detection without requiring complete recovery of the original signals. Compressive PSD estimation has been widely applied as the original signals are not actually required in many signal processing applications. For wideband spectrum sensing applications with spectrally sparse signals, only the PSD, or equivalently the autocorrelation function, needs to be recovered as only the spectrum occupancy status is required for each channel. Polo et al. [32] have proposed to reconstruct the autocorrelation of the compressed signal to provide an estimate of the signal spectrum by utilizing the sparsity property of the edge spectrum, in which the CS is performed directly on the wide-band analog signal. Nevertheless, the compressive measurements are assumed to be wide-sense stationary in [32], which is not true for some compressive measurement matrices. Subsequently, Lexa et al. [33] have proposed a multicoset sampling based power spectrum estimation method, by exploiting the fact that a wide-sense stationary signal corresponds to a diagonal covariance matrix of the frequency domain representation of the signal. Additionally, Leus et al. [34] have solved the power spectrum blind sampling problem based on a periodic sampling procedure and have further proposed a simple least-square (LS) reconstruction method for power spectrum recovery. 3) Beyond Sparsity: For spectrum blind sampling, the goal is to perfectly reconstruct the spectrum and subNyquist rate sampling is only possible if the spectrum is sparse. However, sub-Nyquist rate sampling can be achieved in [34] without making any constraints on the power spectrum, but the LS reconstruction requires some rank conditions to be satisfied. Leus et al. [35] have further proposed an efficient power spectrum reconstruction and a novel multicoset sampling implementation by exploiting the spectral correlation properties, without requiring any sparsity constraints on the power spectrum. More recently, Cohen and Eldar [36] have developed a compressive power spectrum estimation framework for both sparse and non-sparse signals as well as blind and non-blind detection in the sparse case. For each one of those scenarios, the minimal sampling rate allowing perfect reconstruction of the signal’s power spectrum is derived in a noise-free environment. B. Cooperative Spectrum Sensing with Joint Sparsity In spectrum sensing, the performance is degraded by noise uncertainty, deep fading, shadowing and hidden nodes. Cooperative spectrum sensing (CSS) has been proposed to improve sensing performance by exploiting the collaboration among all the participating nodes. In CRNs, a CSS network constructs a multi-node network. As aforementioned, joint sparsity property and lowrank property can be utilized to recover the original signals simultaneously with fewer measurements and the DCS is utilized as it fits the CSS model perfectly. In the existing literature, cooperative compressive spectrum sensing mainly include two categories: i) centralized approaches; ii) decentralized approaches. A centralized approach involves a fusion center (FC) performing signal recovery by utilizing the compressed measurements contributed by the spatially distributed SUs. In [6], a robust wideband spectrum sensing algorithm has been proposed for centralized CSS. Specifically, each SU senses a segment of the spectrum at sub-Nyquist rate to reduce the sensing burden. With the collected compressive measurements, CS recovery algorithms are performed at the FC in order to recover the original signals by exploiting the sparse nature of spectrum occupancy. It is worth noting that the sparse property of signals received at the SUs can be transformed into the low-rank property of the matrix constructed at the FC. In the case of CSS with subNyquist sampling, the measurements collected by the participating SUs are sent to the FC, where the joint sparsity or low-rank property is exploited to recover the complete matrix. A typical decentralized approach has been proposed in [37], in which the decentralized consensus optimization algorithm can attain high sensing performance at a reasonable computational cost and power overhead by utilizing the joint sparsity property. Different from the centralized approach, signal recovery or matrix completion is performed at each individual node in the decentralized approaches. Compared with the centralized approaches, the decentralized ones are more robust as it adopts a FC-free network structure. Another advantage of the decentralized approaches is that they allow the recovery of individual sparse components at each node as well as the common sparse components shared by all participating nodes. Furthermore, the privacy and security issues in CSS have been investigated in [38] by exploiting joint sparsity in the frequency and spatial domains. In [38], measurements corrupted by malicious users are removed during the signal recovery process at the FC so that the recovery 9 r(t) Compressive sampling x = Φr ( t ) −1 rf  Θ=ΦF  x × = Px1 Spectrum recovery + sˆ f Decide spectrum occupacy Energy detection min sˆ f lp 2 s.t. Θ ⋅ h f sˆ f − x ≤ ε 2 PxN K non-zero entries K<P<N P<k<N sf wf Nx1 Nx1 Fig. 4: Framework of compressive spectrum sensing with energy detection. accuracy and security of the considered networks can be improved. C. Compressive Spectrum Sensing with Prior Information In conventional compressive spectrum sensing, only the sparsity property is utilized. Certain prior information is available in some scenarios and can be exploited to improve performance of wideband spectrum sensing in CRNs. For example, in the case of spectrum sensing over TV white space (TVWS), where the PUs are TV signals and the transmitted waveforms are determined by the standard, this prior information together with the specifications dictated by the spectrum regulatory bodies, i.e., carrier frequencies, bandwidths, can be also utilized to enhance the signal recovery performance. Thus, it is reasonable to assume that the PSD of the individual transmission is known up to a scaling factor. As discussed in II-B, reweighted CS normally introduces weights to provide different penalties on large and small coefficients, which naturally inspires the application of reweighted CS in wideband spectrum sensing with available prior information. In [39], the whole spectrum is divided into different segments as the bounds between different types of primary radios are known in advance. Within each segment, an iteratively reweighted `1 /`2 formulation has been proposed to recover the original signals. In [5], a low-complexity wideband spectrum sensing algorithm for the TVWS spectrum has been proposed to improve the signal recovery performance, in which the weights are constructed by utilizing the prior information from the geolocation database. For example, in the TVWS spectrum, there are 40 TV channels and each channel spans over 8 MHz that can be either occupied or not. Hence, the TV signals show a group sparsity property in the frequency domain as the non-zero coefficients show up in clusters. A more efficient approach has been developed in [40] by utilizing such group sparsity property. Moreover, the signals in wideband spectrum sensing have the following two characteristics: i) the input signals are stationary so that their covariance matrices are redundant; ii) most information in practical signals is concentrated on the first few lags of the autocorrelation. Inspired by these characteristics, a spectral prior information assisted structured covariance estimation algorithm has been proposed in [41] with low-computational complexity, which especially fits in application on low-end devices. D. Potential Research We have reviewed some research results in CS-enabled CRNs. There are still many open research issues in the area, especially when practical constraints are considered. In this section, we will introduce a couple of important ones. 1) Performance Limitations under Practical Constraints: Although there exist many research contributions in the field of compressive spectrum sensing, most of them have assumed some ideal operating conditions. In practice, there may exist various imperfection, such as noise uncertainty, channel uncertainty, dynamic spectrum occupancy, and transceiver hardware imperfection [11]. 10 For example, the centralized compressive spectrum sensing normally considers ideal reporting channels, which is not the case in practice. This imperfection may lead to significant performance degradation in practice. Another example comes from the measurement matrix design. As shown in Fig. 2, the Gaussian distributed matrix achieves better performance but with a higher implementation cost. Even through some structured measurement matrices, such as random demodulator, with a lower cost and acceptable recovery performance degradation, have been proposed to enable the implementation of CS as a replacement of high-speed ADCs, the nonlinear recovery process limits its implementation. Therefore, it is a big challenge to further investigate compressive spectrum sensing in the presence of practical imperfection and to develop a common framework to combat their aggregate effects in CS-enabled CRNs. 2) Generalized Platform for Compressive Spectrum Sensing: The existing hardware implementation of subNyquits sampling system follows the procedure that the theoretic algorithm is specifically designed for the current available hardware devices. However, it is very difficult or sometimes even impossible to extend the current hardware architectures to implement other existing compressive spectrum sensing algorithms. Thus, it is desired to have a generalized hardware platform, which can be easily adjusted to implement different compressive spectrum sensing algorithms with different types of measurement matrices and recovery algorithms. IV. C OMPRESSIVE S ENSING ENABLED L ARGE -S CALE W IRELESS S ENSOR N ETWORKS WSNs provide the ability to monitor diverse physical characteristics of the real world, such as sound, temperature, and humidity, by incorporating information and communication technologies (ICT), which are especially important to various IoT applications. In the typical setup of WSNs, a large number of inexpensive and maybe individually unreliable sensor nodes with limited energy storage and low computational capability are distributed in the smart environment to perform a variety of data processing tasks, such as sensing, data collection, classification, modeling, and tracking. Cyber-physical systems (CPSs) merge wireless communication technologies and environment dynamics for efficient data acquisition and smart environments control. Typically, a CPS consists of a large number of sensor nodes and actuator nodes, which monitor and control a physical plant, respectively, by transmitting data to an elaboration node, named local controller (LC) or FC. Traditional environment information monitoring approaches take sensing samples at a predefined speed uniformly at power-constrained sensor nodes and then report the data to a LC/FC, which is normally powerful and is capable of handling complex computations. The data transmitted to the LC/FC usually have redundancies, which can be exploited to reduce power consumption for data transmission. A common and efficient method is to compress at each individual sensor node and then transmit. However, data compression introduces additional power consumption for individual sensor node although the power consumption on data transmission is reduced. Furthermore, this approach is unsuitable for real-time applications owing to the high latency in data collection and the high computational complexity to execute a compression algorithm at the power-constrained sensor node. It is noted that most natural signals can be transformed to a sparse domain, such as discrete cosine domain or wavelet domain, where a small number of the coefficients can represent most of the power of the signals that used to be represented by a large number of samples in their original domains. In fact, the data collected at each sensor node show a sparsity property in the discrete cosine domain or the wavelet domain due to the temporal correlation. Inspired by this, CS can be applied at each sensor node to collect the compressed measurements directly and then send to the LC/FC or the neighbour nodes. As a result, fewer measurements are sampled and transmitted and the corresponding power consumption is reduced significantly. Power consumption of sensor nodes mainly comes from sensing, data processing, and communications with the LC/FC. In a large-scale WSN, the sensor nodes with low power level would wish to take samples at a lower speed or even turn themselves into the sleep mode in order to extend lifetime. As the signal received at each sensor node shows temporal correlation and neighboring nodes show spatial correlation, the joint sparsity can be exploited to recover signals from all sensor nodes even though samples from part of the participating sensor nodes are missed. The active sensor nodes can be preselected according to their power levels, therefore, with invoking of CS in WSNs, lifetime of sensor nodes and the whole network can be extended. The existing work on CS-enabled WSNs mainly falls into the aforementioned two categories: data gathering and active node selection, which will be introduced subsequently. A. Data Gathering In the traditional setting up of data gathering, there are a large number of sensor nodes deployed in a WSN 11 to collect monitoring data. Each sensor node generates a reading periodically and then sends it to the LC/FC, which is normally powerful and capable of conducting complex computation. As the sensor nodes are generally limited in computation and energy storage, the data gathering process in WSNs should be energy efficient with low overhead, which becomes very challenging in IoT scenarios where a huge number of sensor nodes are deployed. Taking the temperature monitoring as an example, the adjacent sensors will generate the similar readings as the temperatures of nearby locations are similar. Furthermore, for each sensor node, the readings from adjacent snapshots are close to each other. The above two important observations indicate the temporal-spatial correlations among temperature readings, which enables the application of CS to reduce the network overhead as well as to extend the network lifetime. Moreover, such a joint sparsity is smaller than the aggregate over the individual signal sparsity, which results in a further reduction in the number of required measurements to exactly recover the original signals. Instead of applying compression on the data after it is sampled and buffered, each sensor node collects the compressed measurements directly by projecting the signal to its sparse domain. At each individual sensor node, one can naively obtain separate measurements of its signal and then recover the signal for each sensor separately at the LC/FC by utilizing the intra-signal correlation. Moreover, it is also possible to obtain compressed measurements that each of them is a combination of all signals from the cooperative sensor nodes in a WSN. Subsequently, signals can be recovered simultaneously by exploiting both the inter-signal and intra-signal correlations at the LC/FC. 1) Measurement Matrix Design: When adopting CS techniques for data gathering in WSNs, sampling at uniformly distributed random moments satisfies the RIP if the sparse basis Ψ is orthogonal. For an arbitrary sensor node i, the P × N measurement matrix can be a spike one that only has P number of non-zero items, as shown by   0 1 0 0 ... 0  0 0 0 1 ... 0    . (8) Φi =    .. .   0 0 0 0 ... 1 Sensor node will take a sample at the moment when the corresponding item in Φi is one. However, random sampling is not proper for practical WSNs since two samples may be too close to each other, which becomes very challenging for the cheap sensor nodes. In order to solve this issue, Chen and Wassell [7] have proposed a random sampling scheme by utilizing the temporal correlation of signals received at a sensor node. In the proposed scheme, the sensor node will send a pseudorandom generator seed to the FC and then send out the samples that are obtained at an affordable highest rate until a sampling rate indicator (SRI) is received from the FC. Here, the SRI is decided based on the recovery accuracy calculated at the FC. Once the recovery accuracy goes out the required range, the sensor node will gradually increase its sampling rate until the recovery error becomes acceptable. By adopting such a scheme, the sensor node can adjust its sampling rate adaptively without the knowledge of the sparsity level. In order to further reduce the sampling rate at sensor nodes, spatial correlation is exploited in combination with temporal correlation. Therefore, joint sparsity property can be exploited at the FC to reduce the number of required measurements. More recently, a big data enabled WSNs framework has been proposed in [42], which invokes CS for data completion with a minimal number of samples. The proposed data collection framework consists of two core components: i) at the cloud, an online learning component predicts the minimal amount of data to be collected to reduce the amount of data for transmission, and these data are considered as the principal data and their amount is constrained by CS; ii) at each individual node, a local control component tunes the collection strategy according to the dynamics and unexpected environment variation. Combining these two components, this framework can reduce power consumption and guarantee data quality simultaneously. 2) Abnormal Sensor Detection: In the CS-enabled data gathering processing, abnormal sensor readings may still lead to severe degradation on signal recovery at the LC/FC even if CS shows robustness to abnormal sensor readings as it does not rely on the statistical distribution of data to be preserved during runtime. This is because that the abnormal readings will damage the sparsity property of signals, as shown in Fig. 5. Therefore, it is critical to find out those abnormal sensors to guarantee the security of WSNs and make it abnormality-free. Generally, abnormal readings are caused by either internal errors or external events according to their specific patterns. Abnormal readings due to internal errors fail to represent the sensed physical data, thus they should be removed at least. But the abnormal readings caused by the external events should be preserved as they reflect the actual scenarios of WSNs. Inspired by recovering data from over-complete dictionary, an abnormal detection mechanism has been 12 (a) Original signal (c) Abnormal signal (b) Discrete cosine transform of original signal (d) Discrete cosine transform of abnormal signal Fig. 5: Effect of abnormal readings on the sparsity level of temperature readings in discrete cosine domain. proposed to enhance the compressibility of the signals. First, the abnormal values are detected with the help of recovering signal from an over-complete dictionary. Second, the failing sensor nodes are categorized into different types according to their patterns. Thirdly, the failing nodes caused by the internal errors are removed and then the data recovery is carried out to obtain the ordinal data. B. Active Node Selection In large-scale WSNs, the events are relatively sparse in comparison with the number of sensor nodes. Due to the power constraint, it is unnecessary to activate all sensor nodes at all the time. By utilizing the sparsity property constructed by the spatial correlation, the number of active sensor nodes in each time slot can be significantly reduced without scarifying performance. Taking the smart monitoring system as an example as shown in Fig. 6, the number of source nodes is N , and there are K (K  N ) sparse events that are generated by the N source nodes. By invoking CS, only M (M ≤ N ) active sensor nodes are required to capture the K sparse events. 1) Centralized Node Selection: A centralized node selection approach has been proposed in [43] by applying CS and matrix completion at the LC/FC with the purpose of optimizing the network throughput and extending the lifetime of sensors. As a node is either active or sleeping, the state index for a node becomes binary, i.e., X ∈ {0, 1}. While conventional node selection in WSNs only exploits the spatial correlation of sensor nodes, Chen and Wassell [44] have exploited the temporal correlation by using the support of the data reconstructed in the previous recovery period to select the active nodes. Specifically, the FC performs an optimized node selection, which is formulated as the design of a specialized measurement matrix, where the sensing matrix, Φ, consists of selected rows of an identity matrix as shown in (8). The sensing costs of taking samples from different sensor nodes are assumed to be equal in most of the node selection approaches. However, in WSNs with power- 13 Active node Link in centralized network Inactive node Link in decentralized network Fig. 6: Node selection in compressive sensing based wireless sensor networks. constrained sensor nodes, this assumption does not hold due to the different physical conditions at different sensor nodes. For example, it is preferred to activate sensor nodes with adequate energy rather than those almost running out of energy to extend the lifetime of WSNs. Therefore, a cost-aware node selection approach has been proposed in [45] to minimize the sampling cost of the whole WSNs with constraints on the reconstruction accuracy. 2) Decentralized Node Selection: Different from the DCS, which normally conducts signal recovery at the FC by utilizing the data collected from the distributed sensing sources via exploiting the joint sparsity, decentralized CS-enabled WSNs approach aims to achieve innetwork processing for node selection. A decentralized approach has been proposed in [46] to perform node selection by allowing each active sensor node to monitor and recover its local data only, by collaborating with its neighboring active sensor nodes through onehop communication, and iteratively improving the local estimation until reaching the global optimum. It should be noted that an active sensor node not only optimizes for itself, but also for its inactive neighbors. Moreover, in order to extend the network lifetime, an in-network CS framework has been developed in [47] by enabling each sensor node to make an autonomous decision on the data compression and forward strategy with the purpose of minimizing the number of packets to be transmitted. Generally speaking, the drawbacks for distributed node selection approach come from the following two aspects: i) the optimized node selection requires an iterative process, which may require a long period; ii) the flexibility to vary the number of active sensor nodes is limited, especially according to the dynamic sparsity levels or the channel conditions, which could be time-varying. While for the centralized approach, extra bandwidth resource and power consumption are required to coordinate active sensor nodes. C. Potential Research Even though extensive research has been carried out to investigate the application of CS in WSNs, most of them have focused on reducing power consumption at sensor nodes and extending the network lifetime. However, in large-scale WSNs for different IoT applications, big data should be exploited to enhance CS recovery accuracy in addition to further reduce the power consumption. 1) Machine Learning aided Adaptive Measurement Matrix Design: The core concept for sparse representation is the same even though different applications bring different constraints. Therefore, it is straightforward to ask if there is a general framework for the sparse representation of the data in different 5G and IoT applications for urban scenarios. In order to take the minimal number of samples from the set of sensor nodes with the best capability, i.e., highest power levels, the measurement matrix should be properly designed. It has been demonstrated that machine learning can be an efficient tool to aid the measurement matrix design so that the lifetime of the whole network as well each 14 individual sensor node can be extended to the most. Furthermore, it should be noted that when designing a measurement matrix, the possibility of implementation in real network is one of the most critical factors to be considered. We believe that extensive research work in this direction is highly desired. 2) Data Privacy in CS-enabled IoT Networks: The sensing data collected from a variety of featured sensors in IoT networks, our daily activities, surroundings, and even the physical information, can be recorded and analyzed, which at the same time greatly intensifies the risk of privacy exposure. There are few effective privacypreserving mechanisms in mobile sensing systems. In order to provide privacy protection, privacy-preserving noise has been proposed to be added to the original data to guarantee effective privacy. The added noise will dominate the data when the original sparse data points are zero or near zero, thus reducing the data sparsity. However, CS aims to achieve kind of efficiency for sparse data processing. Then it comes into a conflict countable between privacy and efficiency during big data processing in CS-enabled IoT networks. Therefore, extensive research work is expected in this area. V. C HANNEL ACQUISITION AND P RECODING IN M ASSIVE MIMO To satisfy high data rate requirements caused by increasing mobile applications, a lot of efforts have been made to improve transmission SE. An effective way is to exploit the spatial degrees of freedom (DoF) provided by large-scale antennas at the transmitter and the receiver to form massive MIMO systems [48]. It has been shown in [48] that the spatial resolution of a large-scale antenna array will be very high and the channels corresponding to different users are approximately orthogonal when the number of the antennas at the BS are very large. Consequently, linear processing is good enough to make the system performance to approach optimum if the CSI is known at the BS. Accurate CSI at the BS is essential for massive MIMO to obtain the above advantage. Due to the large channel dimension, downlink CSI acquisition in massive MIMO systems sometimes becomes challenging even if uplink CSI estimation is relatively simple. In time-division duplexing (TDD) systems, the downlink CSI can be easily obtained by exploiting channel reciprocity. However, most of the practical deployed systems mainly employ frequency-division duplex (FDD), where the channel reciprocity does not hold any more. In this situation, the downlink channel has to be estimated directly and then fed back to the BS, which will result in the extremely high overhead. To address CSI estimation and feedback issue in FDD systems, sparsity of massive MIMO channels must be exploited. Some CS-enabled CSI acquisition methods for FDD massive MIMO have been proposed, where the correlation in massive MIMO channels has been successfully exploited to reduce the amount of training symbols and feedback overhead. In this section, we focus on the CS-enabled channel acquisition and its related applications. We will first introduce the channel sparsity feature and then discuss channel estimation and feedback, and precoding and detection subsequently. It should be noted that mmWave communications are often used with massive MIMO techniques since short wavelength here makes it very easy to pack a large number of antennas in a small area. The channel acquisition and precoding based on CS in mmWave massive MIMO will be also included in the following discussion even if mmWave channels are slightly different from the traditional wireless channels. A. Sparsity of Channels In the channel acquisition and precoding schemes based on CS, the key idea is to use the channel sparsity. Although the channel sparsity in massive MIMO generally exists in the time domain, the frequency domain, and the spatial domain, we mainly focus on the spatial domain channel sparsity in this section. In conventional MIMO systems, a rich-scattering multipath channel model is often assumed so that the channel coefficients can be modelled as independent random variables. However, this assumption is not true any more in massive MIMO systems. It has been shown that the massive MIMO channel is spatial correlated and has a sparse structure in the spatial domain. This correlation and sparsity is due to two reasons: the exploitation of high radio frequency and the deployment of large-scale antenna arrays in future wireless communications. In high frequency band, the channels have fewer propagation paths while more transmit and receive antennas will make the distinguished paths to be much fewer than the number of channel coefficients, which makes the rich scatters to become limited or sparse. As shown in Fig. 7, a classical channel model with limited scatterers at the BS is often used in the literature [49]. In this model, different user channels have a partially common sparsity support due to the shared scatterers and an independent sparsity support caused by the individual scatterers in the propagation environments. By using this sparsity structure, many CS-enabled channel acquisition and precoding schemes have been proposed, as we will discuss in the following. 15 Scatters for user 1 at BS side Local scatters for user 1 Initial channel,H k Sparsity representation, Hk H1  AH1 Common scatters for all users BS with large scale antennas Individual parameters Common parameters Local scatters for user K Scatters for user K at BS side H K  AHK Non-zero elements Zero elements Fig. 7: Channel model with limited scatters, where A is the spatial correlation matrix. B. Compressive Pilot Design In order to obtain a good channel estimation, the length of the orthogonal training sequence must be at least same as the number of transmit antenna elements. Due to a huge number of antennas at the BS in massive MIMO systems, the downlink pilots occupy a high proportion of the resources. Consequently, the traditional pilot design is not applicable here. It is necessary to design specific pilots to reduce the training overhead in FDD massive MIMO systems. It has been shown that channel spatial correlation or sparsity can be used to shrink the original channel to an effective one with a much lower dimension so that low-overhead training is enough in massive MIMO systems. Based on this principle, CS-enabled pilot design schemes have been proposed in [50]. When exploiting the CS theory to acquire the CSI in the correlated FDD MIMO systems, how much training should be sent is a very important question. Once the amount of the training is determined, the training symbols can be designed by using of the channel common or/and individual sparsity in the correlated massive MIMO systems. Besides using the common support, a new pilot structure with joint common and dedicated support has been proposed in [50], where the common one is used to estimate the common channel parameters of the related users in multi-user massive MIMO systems while the dedicated one is used to estimate the individual channel parameters of each user. Besides the general massive MIMO systems, a compressed hierarchical multiresolution codebook has also been designed specially for mmWave massive MIMO systems to construct training beamforming vectors [51]. Based on this idea, a lot of different hierarchical multiresolution codebooks have been proposed from different angles. For example, in [52], a compressive beacon codebook with different sets of pseudorandom phases has been designed. In [53], a common codebook satisfying the conflicting design requirements as well as validating practical mmWave systems has been proposed through utilizing the strong directivity of mmWave channels. In [54], a multi-resolution uniform-weighting based codebook, with similar to an normalized DFT matrix, has been proposed to reduce the implementation complexity, where the estimation of the angle of arrival (AoA) and angle of departure (AoD) will have a much lower training overhead. Therefore, the codebook based beamforming training procedure can achieve a good balance between complexity and high performance for the practical systems. C. Compressive Channel Estimation and Feedback CS can be used to reduce the cost of the channel estimation and feedback by exploiting the channel sparsity. The existing CS based channel estimation and feedback schemes can be divided into the following three categories according to exploiting sparsity in different domains. 16 1) With Time Domain Sparsity: It has been shown that the channel is slowly-varying in various applications so that the prior channel estimation result can be still used to reconstruct the subsequent channels, as illustrated in Fig. 8. By using the structure in the figure, several CS algorithms have been proposed in [8], [55], [56] to recover massive MIMO channels. Exploiting the common time-domain support, a CSenabled differential CSI estimation and feedback scheme has been proposed in [55]. The scheme in [56] further combines LS and CS techniques to improve estimation performance. In this scheme, the LS and CS techniques can be used to estimate a dense vector obtained by projecting into the previous support and a sparse vector obtained by projecting into the null space of the previous support, respectively. Since the current channel vector has only a small number of non-zero elements outside the support of the previous channel, the proposed scheme can reduce the pilot overhead and improve the tracking performance of the channel subspace. Since the quality of the prior support information will affect the estimation accuracy, a greedy pursuit-based approach with the prior support information and its quality information has been developed in [8], where the prior support information is adaptively exploited based on its quality information to further improve the channel estimation performance. Besides channel estimation, several channel feedback schemes have been also proposed in [55] and [49]. To exploit the common support, a CS-enabled differential CSI feedback scheme has been developed in [55] by using the temporal correlation of MIMO channels. The proposed scheme can reduce the feedback overhead by about 20% compared with the direct CS-enabled channel feedback. In [49], a robust closed-loop pilot and channel state information at the transmitter (CSIT) feedback resource adaptation framework has been developed by using the temporal correlation of multiuser massive MIMO channels. In this framework, the pilot and feedback resources can be adaptively adjusted for successful CSIT recovery under unknown and time-varying channel sparsity levels. 2) With Spatial Domain Sparsity: In practice, the antenna spacing in massive MIMO is usually set to be half-wave length to keep the array aperture compact. Furthermore, the BS with a large-scale antenna array is generally deployed at the top of high buildings such that there are only limited local scatters [57]. In this case, the large-scale MIMO channels exhibit strong angulardomain sparsity or spatial sparsity. This channel sparsity property can be used to reduce the channel estimation and feedback overhead in FDD massive MIMO systems. In [58], a block optimization algorithm is employed to extract the common angular support information from the channel matrices. The extracted common support information is then used to form the weighted factors and design a weighted block optimization algorithm to estimate the channel matrix. In [59], a spatial sparsitybased compression mechanism has been proposed to reduce the load of the channel feedback. In this mechanism, random projection with unknown sparsity basis and direct compression based on known sparsity basis are used. Since the spatial sparsity will reduce channel rank, a dictionary learning method, which captures the communication environment and the antennas property, has been proposed to obtain the compressed channel estimation. After the compressed hierarchical multiresolution codebook is designed in [51]–[54], the corresponding channel estimation schemes can be developed. In these schemes, the hierarchical multi-resolution codebook can be capable of generating variable beam width radiation patterns to facilate the usage of robust adaptive multipath channel estimation algorithms. Meanwhile, the exploitation of adaptive compressive sensing algorithm will also reduce implementation complexity and estimation error. 3) With Spatial-Temporal Sparsity: In the above schemes, the temporal-domain sparsity and the spatialdomain one are independently exploited. In practice, they can be jointly used to further reduce the cost of channel estimation and feedback. In [60], a structured-CS enabled differential joint channel training and feedback scheme has been proposed, where a structured compressive sampling matching pursuit (S-CoSaMP) algorithm uses the structured spatial-time sparsity of wireless MIMO channels to reduce the training and feedback overhead. In [61], a Bayesian CS based feedback mechanism has been proposed for time-varying spatially and temporally correlated vector auto-regression wireless channels, where the feedback rate can be adaptively adjusted. 4) With Spatial-Frequency Sparsity: Besides the spatial-temporal sparsity, the spatial-frequency one can also be exploited to reduce the cost of channel estimation and feedback. In [62], the sparsity in the spatialfrequency domain is first exploited and an adaptive CSenabled feedback scheme is correspondingly proposed to reduce the feedback overhead. In this scheme, the feedback can be dynamically configured based on the channel conditions to improve the efficiency. Due to sharing sparse common support for the adjacent subcarriers in orthogonal frequency division modulation (OFDM), an approximate message passing with the nearest neighbor sparsity pattern learning (AMP-NNSPL) algorithm has been developed to adaptively learn the underlying structure to obtain better performance. 17 Zero entry Non-zero entry Measurement matrix NM  L  Sparse basis of channel  LG Received signals Sparse representation y  g  w Estimate ĝ based on pursuit algorithms h  g Support from Support from prior signals current signals (a) Support from prior and current signals Channel reconstruction h  gˆ Received signals corresponding to N received symbols y   r0T T rLT   NM 1 (b) Compressive channel estimation by using time-domain correlation Fig. 8: Illustration of compressive channel estimation with time-domain correlation signal support. D. Precoding and Detection The precoder design based on the estimated CSI is a very important problem in massive MIMO systems, especially in the mmWave wideband systems. Since wideband mmWave massive MIMO channel generally exhibits frequency selective fading, the precoder design based on the estimated CSI will become challenging. Generally, the sparse structure of mmWave massive MIMO channels in angle domain or beam space can be used to simplify the precoder design [63], [64]. In [63], compressive subspace estimation is used to get the full channel information and then design the precoder to maximize the system SE. In order to reduce the CSI acquisition cost and address the mismatch between few radio frequency chains and many antennas, the hybrid precoding design with baseband and radio frequency precoders has been used in mmWave massive MIMO systems. However, this hybrid precoding will introduce performance loss. In order to mitigate performance loss, an iterative OMP has been utilized to refine the quality of hybrid precoders [64]. Meanwhile, a limited feedback technique has also been proposed for hybrid precoding to reduce the feedback cost. CS can be also used in signal detection of massive MIMO with spatial modulation (SM). In massive SMMIMO, the maximum likelihood (ML) detector has a prohibitively high complexity. Thanks to the structured sparsity of multiple SM signals, a low-complexity signal detector based on CS has been introduced to improve signal detection performance. In [65], a joint SM transmission scheme for user equipment and a structured CS-enabled multi-user detector for the BS have been developed, the proposed detector can reliably detect the resultant SM signals with low complexity by exploiting the intrinsical sparse features. In the above, we mainly discuss CSI acquisition and precoding based on CS theory in FDD massive MIMO systems. In practice, the CS theory can be also applied to TDD massive MIMO systems. A channel estimation approach based on block-structured CS has been developed in [66], where the common support in sparse channels and the channel reciprocity in TDD mode are used simultaneously so that the computational complexity and pilot overhead can be reduced significantly. E. Potential Research As we can see from the above discussion, CS has been successfully used in massive MIMO to improve the performance of channel estimation and precoding. However, there are still many open topics before implementing CS in massive MIMO systems. We will discuss some of them in this section. 1) Effect of Antenna Deployment: Due to space limitation, large-scale antenna may be deployed at various topologies, i.e., centralized or distributed. Since the different antenna topologies corresponding to different channel sparsity, the effect of antenna configuration on the performance of CS-enabled channel estimation is still open. 2) Measure of Channel Sparsity: As mentioned before, the channel sparsity is very important to CS-enabled channel estimation. In the current research works, various sparsity models have been assumed and exploited in channel acquisition. Many of these assumed sparsity models lack of verification by measurement results. It is desired that either the sparsity model or the CS-enabled approach can be confirmed by some measurement results under different propagation conditions. 3) Channel Estimation and Feedback with Joint Support: In the above channel estimation and feedback schemes, one or two of the three types of channel sparsity are used to improve the channel estimation performance and reduce the feedback overhead. If all three types of channel sparsity are used, can we further improve performance? How much performance gain can be achieved if possible? 18 4) Channel Estimation and Feedback with Unknown Support: Channel sparsity directly affects CS-enabled channel estimation performance. However, it is still a challenging problem how to get the information on channel sparsity support. At the same time, it is also worth to study how channel estimation and feedback schemes should be designed without channel sparsity support. VI. OTHER C OMPRESSIVE S ENSING A PPLICATIONS In addition to the aforementioned applications, CS has been applied in various other areas in wireless communications. Some of them are introduced in this section. A. Compressive Sensing Aided Localization In a multiple target localization network, the multiple target locations can be formulated as a sparse matrix in the discrete spatial domain. By exploiting the spatial sparsity, instead of recording all received signal strengths (RSSs) over the spatial grid to construct a radio map from targets, only far fewer number of RSS measurements need to be collected at runtime. Subsequently, the target locations can be recovered from the collected measurements through solving an `1 minimization problem. As a result, the multiple target locations can be recovered accordingly. B. Compressive Sensing Aided Impulse Noise Cancellation In certain applications, such as OFDM, impulsive noise will degrade the system performance severely. OFDM signal is often processed in the frequency domain. Even if impulse noise only lasts a short period of time, it affects a wide frequency range. By regarding impulse noise as a sparse vector, CS technique has been exploited to mitigate such type of impulse noise [67]. Such a group sparsity property inspires us to apply CS to active RRH selection in green C-RANs to minimize the network power consumption [68], [69]. Additionally, in the uplink of C-RANs, the channel estimation from the active users to the RRHs is the key to achieve the spatial multiplexing gain. Generally, the number of active users is low in C-RANs, which makes it possible to apply CS to reduce the uplink training overhead for channel estimation. Moreover, the correlation among active users at different RRHs exhibit a joint sparsity property, which can further facilitate the active user detection and channel estimation in C-RANs [70]. VII. C ONCLUDING R EMARKS This article has provided a comprehensive overview of sparse representation with applications in wireless communications. Specifically, after introducing the basic principles of CS, the common sparse domains in 5G and IoT networks have been identified. Subsequently, three CS-enabled networks, including wideband spectrum sensing in CRNs, data collection in IoT networks, and channel estimation and feedback in massive MIMO systems, have been discussed by exploiting different sparsity properties. From the above discussions, it has been concluded that by invoking of CS, the SE and EE of 5G and IoT networks can be enhanced from different perspectives. Furthermore, potential research challenges have been identified to provide a guide for researchers interested in the sparse representation in 5G and IoT networks. ACKNOWLEDGMENT Jiancun Fan is supported by the National Natural Science Foundation of China under Grant 61671367, the China Postdoctoral Science Foundations under Grant 2014M560780 and Grant 2015T81031. Yue Gao is supported by funding from Physical Sciences Research Council (EPSRC) in the U.K. with Grant No. EP/R00711X/1. C. Compressive Sensing Aided Cloud Radio Access Networks R EFERENCES Cloud radio access networks (C-RANs) has been proposed as a promising technology to support massive connectivity in 5G networks. In C-RAN, the BSs are replaced by remote radio heads (RRHs) and connected to a central processor via digital backhaul links. Thanks to the spatial and temporal variation of the mobile traffic, it is feasible to switch off some RRHs with guarantee on the quality of service in green C-RANs. More specifically, one RRH will be switched off only when all the coefficients in its beamformer are set to zeros. [1] M. Zibulevsky and M. Elad, “L1-L2 optimization in signal and image processing,” IEEE Signal. Proc. Mag., vol. 27, no. 3, pp. 76–88, May 2010. [2] A. M. Bruckstein, D. L. Donoho, and M. Elad, “From sparse solutions of systems of equations to sparse modeling of signals and images,” SIAM review, vol. 51, no. 1, pp. 34–81, Feb. 2009. [3] E. Candes, “Compressive sampling,” in Proc. Int. Congress Math., vol. 3, Madrid, Spain, Oct. 2006, pp. 1433–1452. [4] E. J. Candes, J. Romberg, and T. Tao, “Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information,” IEEE Trans. Inf. Theory, vol. 52, no. 2, pp. 489–509, Feb. 2006. 19 [5] Z. Qin, Y. Gao, and C. G. Parini, “Data-assisted low complexity compressive spectrum sensing on real-time signals under subNyquist rate,” IEEE Trans. Wireless Commun., vol. 15, no. 2, pp. 1174–1185, Feb. 2016. [6] Z. Qin, Y. Gao, M. D. Plumbley, and C. G. Parini, “Wideband spectrum sensing on real-time signals at sub-Nyquist sampling rates in single and cooperative multiple nodes,” IEEE Trans. Signal Process., vol. 64, no. 12, pp. 3106–3117, Jun. 2016. [7] W. Chen and I. J. Wassell, “Energy-efficient signal acquisition in wireless sensor networks: a compressive sensing framework,” IET Wireless Sensor Systems, vol. 2, no. 1, pp. 1–8, Mar. 2012. [8] X. Rao and V. K. Lau, “Compressive sensing with prior support quality information and application to massive MIMO channel estimation with temporal correlation,” IEEE Trans. Signal Process., vol. 63, no. 18, pp. 4914–4924, Sep. 2015. [9] E. J. Candes and M. B. Wakin, “An introduction to compressive sampling,” IEEE Signal. Proc. Mag., vol. 25, no. 2, pp. 21–30, Mar. 2008. [10] C. R. Berger, Z. Wang, J. Huang, and S. Zhou, “Application of compressive sensing to sparse channel estimation,” IEEE Commun. Mag., vol. 48, no. 11, pp. 164–174, Nov. 2010. [11] S. K. Sharma, E. Lagunas, S. Chatzinotas, and B. Ottersten, “Application of compressive sensing in cognitive radio communications: A survey,” IEEE Commun. Surveys Tuts., vol. 18, no. 3, pp. 1838–1860, thirdquarter 2016. [12] D. Romero, D. D. Ariananda, Z. Tian, and G. Leus, “Compressive covariance sensing: Structure-based compressive sensing beyond sparsity,” IEEE Signal. Proc. Mag., vol. 33, no. 1, pp. 78–93, Jan. 2016. [13] H. S. Chang, Y. Weiss, and W. T. Freeman, “Informative sensing of natural images,” in IEEE International Conference on Image Processing (ICIP), Cairo, Egypt, Nov. 2009, pp. 3025–3028. [14] J. Wright, Y. Ma, J. Mairal, G. Sapiro, T. S. Huang, and S. Yan, “Sparse representation for computer vision and pattern recognition,” Proc. IEEE, vol. 98, no. 6, pp. 1031–1044, Jun. 2010. [15] H. S. Chang, Y. Weiss, and W. T. Freeman, “Informative sensing,” CoRR, vol. abs/0901.4275, 2009. [Online]. Available: http://arxiv.org/abs/0901.4275 [16] E. Candes and J. Romberg, “Sparsity and incoherence in compressive sampling,” Inverse problems, vol. 23, no. 3, p. 969, Apr. 2007. [17] J. Tropp, J. Laska, M. Duarte, J. Romberg, and R. Baraniuk, “Beyond nyquist: Efficient sampling of sparse bandlimited signals,” IEEE Trans. Inf. Theory, vol. 56, no. 1, pp. 520–544, Jan. 2010. [18] E. J. Cands, “The restricted isometry property and its implications for compressed sensing,” Comptes Rendus Mathematique, vol. 346, no. 9, pp. 589 – 592, 2008. [Online]. Available: http://www.sciencedirect.com/ science/article/pii/S1631073X08000964 [19] J. A. Tropp and A. C. Gilbert, “Signal recovery from random measurements via orthogonal matching pursuit,” IEEE Trans. Inf. Theory, vol. 53, no. 12, pp. 4655–4666, Dec. 2007. [20] J. W. Choi, B. Shim, Y. Ding, B. Rao, and D. I. Kim, “Compressed sensing for wireless communications: Useful tips and tricks,” IEEE Commun. Surveys Tuts., vol. 19, no. 3, pp. 1527–1550, thirdquarter 2017. [21] B. D. Rao and K. Kreutz-Delgado, “An affine scaling methodology for best basis selection,” IEEE Trans. Signal Process., vol. 47, no. 1, pp. 187–200, Jan. 1999. [22] R. Chartrand, “Exact reconstruction of sparse signals via nonconvex minimization,” IEEE Signal Process. Lett., vol. 14, no. 10, pp. 707–710, Oct. 2007. [23] R. Chartrand and V. Staneva, “Restricted isometry properties and nonconvex compressive sensing,” Inverse Problems, vol. 24, no. 3, p. 035020, May. 2008. [24] R. Chartrand and W. Yin, “Iteratively reweighted algorithms for compressive sensing,” in Proc. IEEE Int. Conf. Acoust. Speech Signal Process.(ICASSP), Las Vegas, NV, Mar. 2008, pp. 3869– 3872. [25] D. Baron, M. F. Duarte, M. B. Wakin, S. Sarvotham, and R. G. Baraniuk, “Distributed compressive sensing,” 2009. [26] Y.-C. Liang, Y. Zeng, E. Peh, and A. T. Hoang, “Sensingthroughput tradeoff for cognitive radio networks,” IEEE Trans. Wireless Commun., vol. 7, no. 4, pp. 1326–1337, Apr. 2008. [27] H. Sun, A. Nallanathan, C.-X. Wang, and Y. Chen, “Wideband spectrum sensing for cognitive radio networks: a survey,” IEEE Wireless Commun., vol. 20, no. 2, pp. 74–81, Mar. 2013. [28] Z. Tian and G. Giannakis, “Compressed sensing for wideband cognitive radios,” in Proc. IEEE Int. Conf. Acoust. Speech Signal Process.(ICASSP), Honolulu, HI, Apr. 2007, pp. 1357– 1360. [29] M. A. Davenport, J. N. Laska, J. R. Treichler, and R. G. Baraniuk, “The pros and cons of compressive sensing for wideband signal acquisition: Noise folding versus dynamic range,” IEEE Trans. Signal Process., vol. 60, no. 9, pp. 4628– 4642, Sep. 2012. [30] Y. Wang, Z. Tian, and C. Feng, “Sparsity order estimation and its application in compressive spectrum sensing for cognitive radios,” IEEE Trans. Wireless Commun., vol. 11, no. 6, pp. 2116–2125, Jun. 2012. [31] H. Sun, W.-Y. Chiu, and A. Nallanathan, “Adaptive compressive spectrum sensing for wideband cognitive radios,” IEEE Commun. Lett., vol. 16, no. 11, pp. 1812–1815, Nov. 2012. [32] Y. L. Polo, Y. Wang, A. Pandharipande, and G. Leus, “Compressive wide-band spectrum sensing,” in Proc. IEEE Int. Conf. Acoust. Speech Signal Process.(ICASSP), Taipei, Taiwan, Apr. 2009, pp. 2337–2340. [33] M. A. Lexa, M. E. Davies, J. S. Thompson, and J. Nikolic, “Compressive power spectral density estimation,” in Proc. IEEE Int. Conf. Acoust. Speech Signal Process.(ICASSP), Prague, Czech Republic, May 2011, pp. 3884–3887. [34] G. Leus and D. D. Ariananda, “Power spectrum blind sampling,” IEEE Signal Process. Lett., vol. 18, no. 8, pp. 443–446, Aug. 2011. [35] D. D. Ariananda and G. Leus, “Compressive wideband power spectrum estimation,” IEEE Trans. Signal Process., vol. 60, no. 9, pp. 4775–4789, Sep. 2012. [36] D. Cohen and Y. C. Eldar, “Sub-Nyquist sampling for power spectrum sensing in cognitive radios: A unified approach,” IEEE Trans. Signal Process., vol. 62, no. 15, pp. 3897–3910, Aug. 2014. [37] F. Zeng, C. Li, and Z. Tian, “Distributed compressive spectrum sensing in cooperative multihop cognitive networks,” IEEE J. Sel. Areas Signal. Proc., vol. 5, no. 1, pp. 37 –48, Feb. 2011. [38] Z. Qin, Y. Gao, and M. D. Plumbley, “Malicious user detection based on low-rank matrix completion in wideband spectrum sensing,” IEEE Trans. Signal Process., vol. 66, no. 1, pp. 5–17, Jan. 2018. [39] Y. Liu and Q. Wan, “Enhanced compressive wideband frequency spectrum sensing for dynamic spectrum access,” EURASIP J. Adv. Signal Process., vol. 2012, no. 1, p. 177, Dec. 2012. [40] Y. C. Eldar, P. Kuppinger, and H. Bolcskei, “Block-sparse signals: Uncertainty relations and efficient recovery,” IEEE Trans. Signal Process., vol. 58, no. 6, pp. 3042–3054, Jun. 2010. [41] D. Romero and G. Leus, “Wideband spectrum sensing from compressed measurements using spectral prior information,” 20 [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] IEEE Trans. Signal Process., vol. 61, no. 24, pp. 6232–6246, Dec. 2013. L. Kong, D. Zhang, Z. He, Q. Xiang, J. Wan, and M. Tao, “Embracing big data with compressive sensing: A green approach in industrial wireless networks,” IEEE Commun. Mag., vol. 54, no. 10, pp. 53–59, Oct. 2016. Z. Qin, Y. Liu, Y. Gao, M. Elkashlan, and A. Nallanathan, “Wireless powered cognitive radio networks with compressive sensing and matrix completion,” IEEE Trans. Commun., vol. 65, no. 4, pp. 1464–1476, Apr. 2017. W. Chen and I. J. Wassell, “Optimized node selection for compressive sleeping wireless sensor networks,” IEEE Trans. Veh. Technol., vol. 65, no. 2, pp. 827–836, Feb. 2016. ——, “Cost-aware activity scheduling for compressive sleeping wireless sensor networks,” IEEE Trans. Signal Process., vol. 64, no. 9, pp. 2314–2323, May 2016. Q. Ling and Z. Tian, “Decentralized sparse signal recovery for compressive sleeping wireless sensor networks,” IEEE Trans. Signal Process., vol. 58, no. 7, pp. 3816–3827, Jul. 2010. C. Caione, D. Brunelli, and L. Benini, “Distributed compressive sampling for lifetime optimization in dense wireless sensor networks,” IEEE Trans. Ind. Informat., vol. 8, no. 1, pp. 30–40, Feb. 2012. T. L. Marzetta, “Noncooperative cellular wireless with unlimited numbers of base station antennas,” IEEE Trans. Wireless Commun., vol. 9, no. 11, pp. 3590–3600, Nov. 2010. A. Liu, F. Zhu, and V. K. Lau, “Closed-loop autonomous pilot and compressive CSIT feedback resource adaptation in multi-user FDD massive MIMO systems,” IEEE Trans. Signal Process., vol. 65, no. 1, pp. 173–183, Jan. 2017. V. K. Lau, S. Cai, and A. Liu, “Closed-loop compressive CSIT estimation in FDD massive MIMO systems with 1 bit feedback,” IEEE Trans. Signal Process., vol. 64, no. 8, pp. 2146–2155, Apr. 2016. A. Alkhateeb, O. El Ayach, G. Leus, and R. W. Heath, “Channel estimation and hybrid precoding for millimeter wave cellular systems,” IEEE J. Sel. Areas Signal. Proc., vol. 8, no. 5, pp. 831–846, 2014. Z. Marzi, D. Ramasamy, and U. Madhow, “Compressive channel estimation and tracking for large arrays in mm-wave picocells,” IEEE J. Sel. Areas Signal. Proc., vol. 10, no. 3, pp. 514–527, 2016. J. Song, J. Choi, and D. J. Love, “Common codebook millimeter wave beam design: Designing beams for both sounding and communication with uniform planar arrays,” IEEE Trans. Commun., vol. 65, no. 4, pp. 1859–1872, 2017. G. Wang, S. A. Naeimi, and G. Ascheid, “Low complexity channel estimation based on dft for short range communication,” in Proc. IEEE Int. Conf. Commun. (ICC). IEEE, 2017, pp. 1–7. W. Shen, L. Dai, Y. Shi, X. Zhu, and Z. Wang, “Compressive sensing-based differential channel feedback for massive MIMO,” Electr. Lett., vol. 51, no. 22, pp. 1824–1826, Oct. 2015. Y. Han, J. Lee, and D. J. Love, “Compressed sensing-aided downlink channel training for FDD massive MIMO systems,” IEEE Trans. Commun., vol. 65, no. 7, pp. 2852–2862, Jul. 2017. L. Lu, G. Li, A. Swindlehurst, A. Ashikhmin, and R. Zhang, “An overview of massive MIMO: Benefits and challenges,” IEEE J. Sel. Topics Signal Process., vol. 8, no. 5, pp. 742–758, Oct. 2014. C. C. Tseng, J. Y. Wu, and T. S. Lee, “Enhanced compressive downlink CSI recovery for FDD massive MIMO systems using weighted block-minimization,” IEEE Trans. Commun., vol. 64, no. 3, pp. 1055–1067, Mar. 2016. M. S. Sim, J. Park, C.-B. Chae, and R. W. Heath, “Compressed channel feedback for correlated massive MIMO systems,” J. of Commun. and Netw., vol. 18, no. 1, pp. 95–104, Feb. 2016. [60] W. Shen, L. Dai, Y. Shi, B. Shim, and Z. Wang, “Joint channel training and feedback for FDD massive MIMO systems,” IEEE Trans. Veh. Technol., vol. 65, no. 10, pp. 8762–8767, Oct. 2016. [61] X.-L. Huang, J. Wu, Y. Wen, F. Hu, Y. Wang, and T. Jiang, “Rate-adaptive feedback with Bayesian compressive sensing in multiuser MIMO beamforming systems,” IEEE Trans. on Wireless Commun., vol. 15, no. 7, pp. 4839–4851, Jul. 2016. [62] P.-H. Kuo, H. Kung, and P.-A. Ting, “Compressive sensing based channel feedback protocols for spatially-correlated massive antenna arrays,” in Proc. Wireless Commun. Netw. Conf. (WCNC), Paris, France, Apr. 2012, pp. 492–497. [63] K. Venugopal, N. Gonzlez-Prelcic, and R. W. Heath, “Optimality of frequency flat precoding in frequency selective millimeter wave channels,” IEEE Wireless Commun. Lett., vol. 6, no. 3, pp. 330–333, Jun. 2017. [64] J. Mirza, B. Ali, S. S. Naqvi, and S. Saleem, “Hybrid precoding via successive refinement for millimeter wave MIMO communication systems,” IEEE Commun. Lett., vol. 21, no. 5, May 2017. [65] Z. Gao, L. Dai, Z. Wang, S. Chen, and L. Hanzo, “Compressivesensing-based multiuser detector for the large-scale SM-MIMO uplink,” IEEE Trans. Veh. Technol., vol. 65, no. 10, pp. 8725– 8730, Oct. 2016. [66] Y. Nan, L. Zhang, and X. Sun, “Efficient downlink channel estimation scheme based on block-structured compressive sensing for tdd massive MU-MIMO systems,” IEEE Wireless Commun. Lett., vol. 4, no. 4, pp. 345–348, Aug. 2015. [67] A. B. Ramirez, R. E. Carrillo, G. Arce, K. E. Barner, and B. Sadler, “An overview of robust compressive sensing of sparse signals in impulsive noise,” in European Signal Process. Conf. (EUSIPCO), Aug. 2015, pp. 2859–2863. [68] Y. Shi, J. Zhang, and K. B. Letaief, “Group sparse beamforming for green cloud-RAN,” vol. 13, no. 5, pp. 2809–2823, May 2014. [69] B. Dai and W. Yu, “Sparse beamforming and user-centric clustering for downlink cloud radio access network,” IEEE Access, vol. 2, pp. 1326–1339, Oct. 2014. [70] X. Xu, X. Rao, and V. K. N. Lau, “Active user detection and channel estimation in uplink cran systems,” in Proc. IEEE Int. Conf. Commun. (ICC), London, UK, Jun. 2015, pp. 2727–2732.
7cs.IT
THE GENERIC CHARACTER TABLE OF A SYLOW p-SUBGROUP OF A FINITE CHEVALLEY GROUP OF TYPE D4 arXiv:1508.06937v2 [math.RT] 10 Feb 2017 SIMON M. GOODWIN, TUNG LE AND KAY MAGAARD Abstract. Let U be a Sylow p-subgroup of the finite Chevalley group of type D4 over the field of q elements, where q is a power of a prime p. We describe a construction of the generic character table of U . 1. Introduction Let p be a prime and let q be a power of p. Let G be a finite reductive group over the field of q elements, and let U be a Sylow p-subgroup of G. The aim of this paper is to describe a construction of the generic character table of U for the case where G is split and of type D4 . This generic character table can be determined immediately from the sequence of propositions and lemmas in Section 5. The construction is “uniform” over primes p > 2, but we observe differences for the bad prime p = 2. There has been much research into constructing generic character tables of G. For G of small rank these have been programmed into the computing system CHEVIE, [10]. More recently there has been interest in generic character tables for Borel and parabolic subgroups of G, see for example [17], [19], [21], [22] and [25], where many cases for G of Fq -rank 3 or less are considered. These papers and similar methods have led to applications in determining decomposition numbers in the modular character theory of G, see for example, [1], [18], [20], [23], [26], [34] and [41]. There has been a great deal of research interest in the character theory of U , with motivation coming from understanding how this character theory varies with q. Interest in properties of U for G = GLn (q) goes back to G. Higman [16], where the conjugacy classes of U are considered. In [31], G. Lehrer determined how discrete series characters decompose when restricted to U for G = GLn (q). This led to a study of the irreducible characters of U and in particular it was conjectured that the degrees of the irreducible characters are always a power of q, and that the number of characters of degree q d , for d ∈ Z≥0 is given by a polynomial in q with integer coefficients; this refines a well known conjecture attributed to Higman. There has been further work in this direction, for G = GLn (q), by I. M. Isaacs, and more generally on the character theory of algebra groups, see [27] and [28]. In particular, Isaacs verified that the degree of any irreducible character of an algebra group over Fq is a power of q. For other recent developments we refer, for example, to the work of A. Evseev [8], E. Marberg [32], and I. Pak and A. Soffer [35]; in particular, we remark that the results of [35] suggest that the aforementioned conjecture on the number of characters being given by a polynomial in q is false. An interesting aspect of the character theory of U is the theory of supercharacters, which was first studied by André, see for example [2]; this theory was fully developed by Diaconis and Isaacs in [6]. 1 There has been much interest on the complex irreducible characters of Sylow p-subgroups of finite reductive groups of other types. For instance, it has been proved that for G of type B, C or D the degrees of all irreducible characters of U (q) are powers of q if and only if p 6= 2, see [36], [37] and [40]. There has been much further interest in determining certain families of irreducible character, see for example [15], [33], [38] and [39]. Recently, a notion of supercharacters of U for G of types B, C and D was introduced by André and Neto in [3]. For p larger than the Coxeter number of G, the Kirillov orbit method gives a bijection between the coadjoint orbits of U on its Lie algebra and the irreducible characters of U ; in [13] an algorithm is given, which is used to calculate a parametrization of these coadjoint orbits when G is split and of rank less than or equal to 8, excluding type E8 . We refer the reader also to [30] for other results on the parametrization of irreducible characters of U . From now on we suppose G is a finite Chevalley group of type D4 . The two key ingredients that enable us to calculate the generic table of U are the papers [24] and [14], which provide a parametrization of the irreducible characters and the conjugacy classes of U ; we also use [4] for the conjugacy classes for the case p = 2. Our construction of this generic character table is given in such a way that it is straightforward to convert it to a computer file that can be used in future calculations. Our parametrization of the characters and conjugacy classes of U partitions them into families that are independent of q, as can be observed in Tables 3 and 4. We have refined the parameterizations from [14] and [24], so that they are stable under the automorphisms of G coming from the graph automorphisms of the Dynkin diagram; this is likely to be of significant benefit for applications. Our calculations are based on developing the methods from [24]. A key additional ingredient is that we modify those constructions making them more explicit by realizing the irreducible characters of U as induced characters of linear characters of certain subgroups. By the generic character table we mean the table with rows labelled by the families of the characters, and columns labelled by the families of representatives of conjugacy classes. The values in the table are given by expressions depending on the parameters for the families and on q. This can be viewed as an extension of the ideas discussed above regarding how the character theory of U varies with q. We observe that the characters and their values are uniform for p > 2, whereas for p = 2 there are differences. More explicitly the parametrization of the family of irreducible characters F8,9,10 is different for p = 2, and although the parametrization of the characters in the families F11 and F12 is not different for p = 2, the values of these characters do differ. These differences give some explanation of why p = 2 is a bad prime for D4 . We summarize our results in the following theorem. Theorem 1.1. Let G be a a finite Chevalley group of type D4 over Fq and let U be a Sylow p-subgroup of G. The generic character table of U is determined from: the parametrization of the conjugacy classes given in Section 3; the parametrization of the irreducible characters given in Section 4; and the character values given in Section 5. The methods in this paper serve as a model, which can be applied to determine generic character tables of Sylow p-subgroups of finite groups of Lie type, where p is the defining characteristic. We outline the structure of paper. First we recall the required theory and notation regarding the finite Chevalley group of type D4 in Section 2. Then in Sections 3 and 4, we 2 recall the results from [4], [12] and [24] giving the parametrization of the conjugacy classes and irreducible characters of U . The majority of the work is done in Section 5, where we determine the character values. Acknowledgements: We would like to thank the referee for many helpful suggestions that led to improvements in the paper. We also thank A. Paolini for pointing out some corrections. Part of this research was completed during a visit of the second author to the University of Birmingham; we thank the LMS for a grant to cover his expenses. 2. Notation and Setup Let p be a prime, let q be a power of p, and denote the finite field with q elements by Fq . We let G denote a simply connected simple algebraic group of type D4 defined and split over Fp ; in other words G is Spin8 defined over Fp . Let B be a Borel subgroup of G defined over Fp , let U be the unipotent radical of B, and T ⊆ B be a maximal torus defined over Fp . For a subgroup H of G defined over Fp , we write H = H(q) for the group of Fq -rational points of H. So G = G(q) is a finite Chevalley group of type D4 and U = U(q) is a Sylow p-subgroup of G. We cite [7, Sec. 3], as a reference for the theory of algebraic groups over finite fields, and for the terminology used here. + ∼ We note that G = Spin+ 8 (q) is not a simple group, but that G/Z(G) = P Ω8 (q) is a simple group. As we are mainly interested in U in this paper, which is isomorphic to its image in G/Z(G), this distinction causes us no harm. Let Φ be a root system of G with respect to T and let Φ+ be the system of positive roots determined by B. We write {α1 , α2 , α3 , α4 } for the corresponding base of simple roots ordered so that the Dynkin diagram of Φ is t α1@ @ @t α2 α3 t α4 t For α = 1 2 1 1 P4 i=1 ai αi ∈ Φ we write ht(α) = P4 i=1 ai for the height of α. We use the notation for the root α1 + α2 + 2α3 + α4 ∈ Φ+ and we use a similar notation for the remaining positive roots. We enumerate the roots in Φ+ as shown in Table 1 below. The triality automorphism of the Dynkin diagram can be lifted to an automorphism of G that stabilizes T and B, and restricts to an automorphism of G. We refer the reader to [5, Section 4.2] for more information and let τ denote this automorphism of G. In a similar way we can define three automorphisms of G corresponding to the involutory automorphisms of the Dynkin diagram given by switching two of the outer vertices. We denote these by σ12 , σ14 and σ24 in the obvious way. The group G is generated by the root elements xα (t) for α ∈ Φ and t ∈ Fq . We may choose these root elements so that, for α, β ∈ Φ such that α + β ∈ Φ, we have [xα (t), xβ (u)] = xα+β (±tu) and the signs are invariant under τ and the σij . For positive roots, we use the abbreviation xi (t) := xαi (t) and let Xi = {xi (t) | t ∈ Fq }, for i = 1, 2, . . . , 12. We have τ (xi (t)) = xiρ (t) where ρ is the permutation ρ = (1, 4, 2)(5, 7, 6)(8, 9, 10); and 3 Height Roots 1 α1 2 3 4 5 α2 1 α5 := 1 0 0 1 α8 := 1 0 1 1 α11 := 1 1 1 1 α12 := 2 1 1 α3 α6 := α9 := 0 1 0 1 1 1 1 0 α4 0 α7 := 1 1 0 0 α10 := 1 1 1 Table 1. Positive roots of the root system Φ of type D4 . have a similar description for the automorphisms σij . The commutators [xi (t), xj (u)] = xi (t)−1 xj (u)−1 xi (t)xj (u) are given in Table 2. All [xi (t), xj (u)] not listed in this table are equal to 1. We refer the reader to [5, Chapter 4] for details on root elements and commutator relations. [x1 (t), x3 (u)] [x1 (t), x7 (u)] [x2 (t), x3 (u)] [x2 (t), x7 (u)] [x3 (t), x4 (u)] [x4 (t), x5 (u)] [x4 (t), x8 (u)] [x6 (t), x9 (u)] = = = = = = = = x5 (tu), x9 (tu), x6 (tu), x10 (tu), x7 (−tu), x9 (tu), x11 (tu), x12 (−tu), [x1 (t), x6 (u)] [x1 (t), x10 (u)] [x2 (t), x5 (u)] [x2 (t), x9 (u)] [x3 (t), x11 (u)] [x4 (t), x6 (u)] [x5 (t), x10 (u)] [x7 (t), x8 (u)] = = = = = = = = x8 (tu), x11 (tu), x8 (tu), x11 (tu), x12 (tu), x10 (tu), x12 (−tu), x12 (−tu). Table 2. Commutator relations for type D4 . We have that U is the subgroup of GQ generated by the elements xi (ti ) for i = 1, 2, . . . , 12 and ti ∈ Fq . In fact we have that U = 12 i=1 Xi . It turns out that it is convenient for us to write our elements of U with an element from X3 at the front, and we use the notation (2.1) x(t) = x3 (t3 )x1 (t1 )x2 (t2 )x4 (t4 )x5 (t5 ) · · · x12 (t12 ), where t = (t1 , . . . , t12 ). There is a further piece of notation that we use frequently in the sequel, we define the normal subgroups Mi of U for i = 1, . . . , 13 by (2.2) M1 = U, M2 = X1 X2 12 Y Xj , j=4 M3 = X2 12 Y j=4 4 Xj and (2.3) Mi = 12 Y Xj for i = 4, . . . , 13. j=i 3. Conjugacy Classes and their Representatives In [14], an algorithm for calculating the conjugacy classes of Sylow p-subgroups of finite Chevalley groups in good characteristic is described; so we assume p > 2 for the first part of this section. This algorithm was implemented in GAP4 [9] and, in particular, used to determine the conjugacy classes of U = U (q). The conjugacy class representatives are given as minimal representatives as defined in [11] and discussed below. (For ease of exposition we temporarily let x1 = xα3 , x2 = xα1 and x3 = xα2 in the next paragraph.) The idea behind the calculation of minimal representatives is to recursively determine the orbits of U on U/Mi+1 for i = 1, . . . , 12; recall that Mi+1 is defined in (2.2). To explain this we consider the set A(x, i) = {xxi (t)Mi+1 | t ∈ Fq } ⊆ U/Mi+1 for x ∈ U . The centralizer CU (xMi ) acts on A(x, i) by conjugation. The key results for the theory of minimal representatives are [11, Lem. 5.1 and Prop. 6.2], which imply the following dichotomy: (I) all elements of A(x, i) are conjugate under CU (xMi ); or (R) no two elements of A(x, i) are conjugate under CU (xMi ). We say that i is an inert point of x if (I) holds and i is a ramification point of x if (R) holds. We say x(t) as defined in (2.1) is the minimal representative of its conjugacy class if ti = 0 whenever i is an inert point of x(t). Thanks to [11, Prop. 5.4 and Prop. 6.2], the minimal representatives of conjugacy classes give a complete set of representatives of the conjugacy classes in U . In Table 3, we present the minimal representatives of the conjugacy classes in U (q). Starting with the minimal representatives calculated as in [14], we have parameterized the conjugacy classes giving representatives partitioned into families. This has been done to reduce the number of families required to what appears to be an optimal number. The first column of Table 3 gives a label for the family, then in the second column a parametrization of the elements of the family is given, where the notational convention is that an ai is an element of F× q = Fq \ {0}, a bi is any element of Fq , and for a sequence of the form ci1 , . . . , cir the cij are elements of Fq , which are not all zero. These parameters have to satisfy the conditions given in the third column. In the fourth column we give the number of elements in the family. The families are constructed so that the size of the centralizer of an element in the family does not depend on the choice, and the final column gives this centralizer size. The families of representatives have been chosen, so that they are permuted by the automorphisms τ , σ12 , σ14 and σ24 . Thus we can read off the action of these automorphisms on the conjugacy classes. However, for the family, C1,2,4,q6 , it is not possible for p = 3 to get this stability under the triality automorphism and we have to distinguish the cases p = 3 and p > 3; we note that the family given for p = 3 is actually also valid for p > 3. To end this section we explain the differences in the parametrization of the conjugacy classes for p = 2, where the theory of minimal representatives fails. First we note that there are a number of families, where there is a relation between parameters involving a sum of two 5 Label C1,2,3,4 Representative x3 (a3 )x1 (a1 )x2 (a2 )x4 (a4 ) Conditions Number (q − 1)4 Centralizer q4 C1,2,3 C1,3,4 C2,3,4 x3 (a3 )x1 (a1 )x2 (a2 )x9 (b9 )x10 (b10 ) x3 (a3 )x1 (a1 )x4 (a4 )x8 (b8 )x10 (b10 ) x3 (a3 )x2 (a1 )x4 (a4 )x8 (b8 )x9 (b9 ) b9 /a1 + b10 /a2 = 0 b8 /a1 + b10 /a4 = 0 b8 /a2 + b9 /a3 = 0 (q − 1)3 q (q − 1)3 q (q − 1)3 q q5 q5 q5 C1,3 C2,3 C3,4 x3 (a3 )x1 (a1 )x10 (b10 ) x3 (a3 )x2 (a2 )x9 (b9 ) x3 (a3 )x4 (a4 )x8 (b8 ) (q − 1)2 q (q − 1)2 q (q − 1)2 q q5 q5 q5 C1,2,4,q6 (p > 3) C1,2,4,q6 (p = 3) C1,2,4,q7 x1 (a1 )x2 (a2 )x4 (a4 )x5 (c5 )x6 (c6 )x7 (c7 ) x1 (a1 )x2 (a2 )x4 (a4 )x6 (c6 )x7 (c7 ) x1 (a1 )x2 (a2 )x4 (a4 )x12 (b12 ) c5 /a1 + c6 /a2 + c7 /a4 = 0 (q − 1)3 (q 2 − 1) (q − 1)3 (q 2 − 1) (q − 1)3 q q6 q6 q7 C1,2,q6 C1,2,q7 C1,2,q8 C1,4,q6 C1,4,q7 C1,4,q8 C2,4,q6 C2,4,q7 C2,4,q8 x1 (a1 )x2 (a2 )x5 (c5 )x6 (c6 )x7 (c7 ) x1 (a1 )x2 (a2 )x9 (a9 )x10 (a10 ) x1 (a1 )x2 (a2 )x12 (b12 ) x1 (a1 )x4 (a4 )x5 (c5 )x6 (c6 )x7 (c7 ) x1 (a1 )x4 (a4 )x8 (a8 )x10 (a10 ) x1 (a1 )x4 (a4 )x12 (b12 ) x2 (a2 )x4 (a4 )x5 (c5 )x6 (c6 )x7 (c7 ) x2 (a2 )x4 (a4 )x8 (a8 )x9 (a9 ) x2 (a2 )x4 (a2 )x12 (b12 ) c5 /a1 + c6 /a2 = 0 a9 /a1 + a10 /a2 = 0 (q − 1)2 (q 2 − 1) (q − 1)3 (q − 1)2 q (q − 1)2 (q 2 − 1) (q − 1)3 (q − 1)2 q (q − 1)2 (q 2 − 1) (q − 1)3 (q − 1)2 q q6 q7 q8 q6 q7 q8 q6 q7 q8 C1,q6 C1,q7 C1,q8 C2,q6 C2,q7 C2,q8 C4,q6 C4,q7 C4,q8 x1 (a1 )x6 (c6 )x7 (c7 ) x1 (a1 )x10 (a10 ) x1 (a1 )x12 (b12 ) x2 (a2 )x5 (c5 )x7 (c7 ) x2 (a2 )x9 (a9 ) x2 (a2 )x12 (b12 ) x4 (a4 )x5 (c5 )x6 (c6 ) x4 (a4 )x8 (a8 ) x4 (a4 )x12 (b12 ) (q − 1)(q 2 − 1) (q − 1)2 (q − 1)q (q − 1)(q 2 − 1) (q − 1)2 (q − 1)q (q − 1)(q 2 − 1) (q − 1)2 (q − 1)q q6 q7 q8 q6 q7 q8 q6 q7 q8 C3 x3 (a3 )x8 (b8 )x9 (b9 )x10 (b10 )x11 (b11 ) (q − 1)q 4 q8 1)3 q q8 1)3 (q − (q − 1)2 q (q − 1)3 (q − 1)2 q (q − 1)3 (q − 1)2 q q8 q9 q8 q9 q8 q9 C5,6,7 c5 /a1 + c7 /a4 = 0 a8 /a1 + a10 /a4 = 0 c6 /a2 + c7 /a4 = 0 a8 /a2 + a9 /a4 = 0 (q − x5 (a5 )x6 (a6 )x7 (a7 )x11 (b11 ) C5,6,q8 C5,6,q9 C5,7,q8 C5,7,q9 C6,7,q8 C6,7,q9 x5 (a5 )x6 (a6 )x9 (a9 )x10 (a10 ) x5 (a5 )x6 (a6 )x11 (b11 ) x5 (a5 )x7 (a7 )x8 (a8 )x10 (a10 ) x5 (a5 )x7 (a7 )x11 (b11 ) x6 (a6 )x7 (a7 )x8 (a8 )x9 (a9 ) x6 (a6 )x7 (a7 )x11 (b11 ) C5,q8 C5,q9 C6,q8 C6,q9 C7,q8 C7,q9 x5 (a5 )x10 (a10 ) x5 (a5 )x11 (b11 ) x6 (a6 )x9 (a9 ) x6 (a6 )x11 (b11 ) x7 (a7 )x8 (a8 ) x7 (a7 )x11 (b11 ) (q − 1)2 (q − 1)q (q − 1)2 (q − 1)q (q − 1)2 (q − 1)q q8 q9 q8 q9 q8 q9 C8,9,10 x8 (c8 )x9 (c9 )x10 (c10 ) q3 − 1 q 10 C11 x11 (a11 ) q−1 q 11 C12 x12 (b12 ) q q 12 a9 /a5 + a10 /a6 = 0 a8 /a5 + a10 /a7 = 0 a8 /a6 + a9 /a7 = 0 Table 3. Representatives of conjugacy classes in U (q) for p > 2 terms and this has to be replaced by just setting one of the parameters equal to zero. For example in C1,2,3 , we have to replace the representatives simply with x3 (a3 )x1 (a1 )x2 (a2 )x10 (b10 ) and there are no conditions. This does lead to the families of representatives not being stable under the automorphisms, but this cannot be helped. The more significant differences are as follows. 6 p=2 • The family C1,2,3,4 is replaced by the family C1,2,3,4 . The representatives are of the form x3 (a3 )x1 (a1 )x2 (a2 )x4 (a4 )x10 (d10 ), where d10 is either 0, or an element of Fq not in the image of the map t 7→ a3 a2 a4 (t2 + t). So there are 2(q − 1)4 representatives in this family. Their centralizers have order 2q 4 . • The family C1,2,4,q6 should be included as in the p = 3 case in the table above. • The family C1,2,4,q7 is replaced by two families. p=2 – C1,2,4,2q 7 . The representatives are of the form x1 (a1 )x2 (a2 )x4 (a4 )x10 (a10 )x12 (d12 ), where d12 is either 0, or an element of Fq not in the image of the map t 7→ a1 a2 a4 t2 + a1 a10 t. So there are 2(q − 1)4 representatives in this family. Their centralizers have order 2q 7 . p=2 3 – C1,2,4,q 7 . The representatives are of the form x1 (a1 )x2 (a2 )x4 (a4 ). There are (q−1) representatives in this family and their centralizers have order q 7 . • The family C5,6,7 is replaced by two new families namely. p=2 – C5,6,7,2q 8 . The representatives are of the form x5 (a5 )x6 (a6 )x7 (a7 )x10 (a10 )x11 (d11 ), where d11 is either 0, or an element of Fq not in the image of the map t 7→ a5 a6 a7 t2 + a5 a10 t. There are 2(q − 1)4 representatives in this family and their centralizers have order 2q 8 . p=2 – C5,6,7,q 8 . The representatives are of the form x5 (a5 )x6 (a6 )x7 (a7 ). The number of representatives in this family is (q − 1)3 and their centralizers have order q 8 . 4. The irreducible characters of U In [24], the irreducible characters of U were determined giving a partition into families, which are given in Table 4 for the case p > 2. We have modified these constructions to make them more explicit, so that we can realize them all as induced characters from linear characters of certain subgroups of U . In the next section we calculate the values of the characters, and in doing so we explain their construction. We explain the contents of Table 4. The first column gives the name of the family and the second column gives the names of the characters in that family. The notational convention is that parameters denoted by ai range over F× q = Fq \ {0}, and parameters denoted by bi range over Fq . The subscripts in the notation give an idea of “where these parameters act”, as can be understood from the descriptions of how the characters are constructed given in the next section. For some families there is a relation between some of the parameters and this is given in the third column. The fourth column records the number of characters in that family. The families are constructed in such a way that the degree of the characters in a family is constant, and the fifth column gives this degree. The triality automorphism τ of G, permutes the families of characters by acting on the subscripts of the families by the permutation ρ; similarly the automorphisms σ12 , σ14 and σ24 act on the families. As mentioned earlier, we have updated the parametrization from [24, §4], so that we can read off the action of these automorphisms on the characters. Though it is not possible to do this for the family F5,6,7 for p = 3. We end this section by noting that for p = 2, the parametrization of irreducible characters is slightly different. As explained in [24], the family denoted F8,9,10 is more complicated p=2 and has to be replaced by the family F8,9,10 , which consists of two types of characters as explained below and in more detail at the end of §5.4. 7 Family Notation F12 Number Degree χa1212 ,b1 ,b2 ,b4 q 3 (q − 1) q4 F11 χa1111 ,b5 ,b6 ,b7 ,b3 q 4 (q − 1) q3 F8,9,10 8 ,a9 ,a10 ,b3 χa8,9,10 q(q − 1)3 q3 F8,9 8 ,a9 ,a6 ,a7 χa8,9,q 3 a6 /a8 + a7 /a9 = 0 (q − 1)3 q3 8 ,a9 ,b2 ,b3 ,b4 χa8,9,q 2 b2 /a8 + b4 /a9 = 0 q 2 (q − 1)2 q 2 8 ,a10 ,a5 ,a7 χa8,10,q 3 a5 /a8 + a7 /a10 = 0 (q − 1)3 8 ,a10 ,b1 ,b3 ,b4 χa8,10,q 2 b1 /a8 + b4 /a10 = 0 q 2 (q − 1)2 q 2 9 ,a10 ,a5 ,a6 χa9,10,q 3 a5 /a9 + a6 /a10 = 0 (q − 1)3 9 ,a10 ,b1 ,b2 ,b3 χa9,10,q 2 b1 /a9 + b2 /a10 = 0 q 2 (q − 1)2 q 2 F8,10 F9,10 F8 F9 F10 Conditions q3 q3 χa8,q8 ,a3 7 (q − 1)2 q3 χa8,q8 ,b23 ,b4 q 2 (q − 1) q2 χa9,q9 ,a3 6 (q − 1)2 q3 χa9,q9 ,b22 ,b3 q 2 (q − 1) q2 10 ,a5 χa10,q 3 (q − 1)2 q3 10 ,b1 ,b2 χa10,q 2 q 2 (q − 1) q2 5 ,a6 ,a7 ,b1 ,b2 ,b4 F5,6,7 (p > 3) χa5,6,7 b1 /a5 + b2 /a6 + b4 /a7 = 0 q 2 (q − 1)3 q 5 ,a6 ,a7 ,b2 ,b4 F5,6,7 (p = 3) χa5,6,7 q 2 (q − 1)3 q F5,6 5 ,a6 ,b1 ,b2 ,b4 χa5,6 b1 /a5 + b2 /a6 = 0 q 2 (q − 1)2 q F5,7 5 ,a7 ,b1 ,b2 ,b4 χa5,7 b1 /a5 + b4 /a7 = 0 q 2 (q − 1)2 q F6,7 6 ,a7 ,b1 ,b2 ,b4 χa6,7 b2 /a6 + b4 /a7 = 0 q 2 (q − 1)2 q F5 χa55 ,b2 ,b4 q 2 (q − 1) q F6 χa66 ,b1 ,b4 q 2 (q − 1) q F7 χa77 ,b1 ,b2 q 2 (q − 1) q Flin χblin1 ,b2 ,b3 ,b4 q4 1 Table 4. The irreducible characters of U for p > 2. 8 ,a9 ,a10 3 3 • The characters χa8,9,10,q 3 . There are (q − 1) of these and they have degree q . 8 • The characters χ q3 . 2 a8 ,a9 ,a10 ,a5,6,7 ,d1,2,4 ,d3 3 8,9,10, q2 . There are 4(q − 1)4 of these and their degree is The parameters d1,2,4 and d3 can each take one of two values as explained at the end of §5.4. Also for p = 2 the parametrization of characters where there is a relation between parameters involving the sum of two terms has to be updated in a similar way to the corresponding situation for conjugacy class representatives. For example, in the family F5,6 , we just have 5 ,a6 ,b2 (so we have set b1 = 0 and b2 ranges over Fq ). characters χa5,6 5. Determining the character values In the following subsections we give the construction of the irreducible characters and determine the character values. We split up our determination of the character values according to the families given in Table 4, and in each of these subsections we calculate the values of the irreducible characters on elements of U . For the families considered in §5.1, §5.2 and §5.3 we determine the character values on general elements of U , whereas for the other characters we take advantage of the representatives of the conjugacy classes from Table 3. Before we embark on calculating the values of the irreducible characters of U , we give some notation that we use. i2π Tr(x) Denote by Tr : Fq → Fp the trace map, and define φ : Fq → C× by φ(x) = e p , so that φ is a nontrivial character from the additive group of Fq to the multiplicative group C× . We record two important elementary observations about φ that we require frequently in the sequel. First we note P that, for t ∈ Fq , we have φ(st) = 1 for all s ∈ Fq if and only t = 0, second we note that s∈Fq φ(s) = 0. Let H be a finite group. We write Z(H) for the centre of H. Let K be a subgroup of H, let x ∈ H, h ∈ H and let ψ : K → C. We write ψ̇ : H → C for the function defined by ψ̇(x) = ψ(x) if x ∈ K and ψ̇(x) = 0 if x ∈ / K. We denote conjugation by h −1 h h x = h xh and ψ : H → C is defined by ψ(x) = ψ̇(xh ). If ψ is a class function on K, then we write ψ HPfor the induced class function on H, which is given by the standard 1 h formula ψ H (h) = |K| x∈H ψ̇(x ). We use the notation x(t) from (2.1), where we recall that x3 (t3 ) is on the left. Frequently, we consider quotients of U by the normal subgroups Mi defined in (2.2). When we do this we often want to identify the root subgroup Xj with its image in U/Mi for j < i, and we will Q do this without further explanation. We consider subgroups V of U/Mi of the form where I is a subset of {1, . . . , i}. For such a subgroup V we use the notation j∈I Xj , Q xV (t) = j∈I xj (tj ) to denote a general element of V , where the factors are ordered as in x(t), so that x3 (t3 ) is on the left (if 3 ∈ I). We often use the notation δs,0 , where s ∈ Fm q for some m, which is defined as usual by δs,0 = 1 if s = 0 and δs,0 = 0 if s 6= 0. As mentioned earlier, we have adapted the construction of the characters from [24] so that they are more explicit. In particular, we realise each of the irreducible characters as an induced character of a certain subgroup, which leads to a more precise parametrization. Given these differences, we briefly explain why our constructions line up with those in [24]. For each irreducible character χ that we construct, we give a subgroup V of a quotient U/M of U and a linear character λ of V . Then χ is equal to the induced character λU/M 9 inflated to U possibly tensored with a linear character of U . In each case there is a subgroup X of U/M , which is a transversal of V in U/M . In each of subsequent subsections, where we calculate the characters values, we state what V and X are. We also justify that the induced characters that we obtain are indeed irreducible, and that the characters as given in Table 4 are distinct. The main tool for achieving this is the Clifford theory for characters of special groups of type q 1+2m , as is also the case in [24]. Now we can count the number of characters that we have constructed in each family, and verify that this gives the same numbers in [24]. Therefore, we can deduce that we have covered all of the irreducible characters of U . 5.1. The family Flin . Here we state the value of χblin1 ,b2 ,b3 ,b4 on all elements of U . We note that M5 is the commutator subgroup of U , and the characters χblin1 ,b2 ,b3 ,b4 are precisely the characters of U/M5 inflated to U ; they are all the linear characters of U . The following formula, therefore, defines these characters. χblin1 ,b2 ,b3 ,b4 (x(t)) = φ(b1 t1 + b2 t2 + b3 t3 + b4 t4 ). ∗ . The characters in the families F5 , F6 , F7 , F5,6 , F5,7 , F6,7 and F5,6,7 5.2. The family F5,6,7 can all be constructed in essentially the same way. Thus we combine these families and ∗ . denote their union by F5,6,7 5 ,c6 ,c7 ,b1 ,b2 ,b4 We begin by giving the construction of the characters χc5,6,7 , where c5 , c6 , c7 ∈ Fq are not all zero and b1 , b2 , b4 ∈ Fq . From these characters we obtain all of the characters in c5 ,c6 ,c7 ,b1 ,b2 ,b4 ∗ F5,6,7 . First we note that M8 is in the kernel of χ5,6,7 . As explained at the start of the section we identify Xi with its image in U/M8 for i = 1, 2, . . . , 7. We have that U/M8 = X3 X1 X2 X4 X5 X6 X7 , and that V = X1 X2 X4 X5 X6 X7 ∼ = F6q is an 6 elementary abelian subgroup of U/M8 of order q , and X = X3 is a transversal of U in U/M8 . We define the linear character λc5 ,c6 ,c7 of V by λc5 ,c6 ,c7 (xV (t)) = φ(c5 t5 + c6 t6 + c7 t7 ). 5 ,c6 ,c7 Let χc5,6,7 be the character of U/M8 we obtain by inducing λc5 ,c6 ,c7 ; by a mild abuse 5 ,c6 ,c7 of notation we also write χc5,6,7 for the character of U given by inflation. The character c5 ,c6 ,c7 ,b1 ,b2 ,b4 5 ,c6 ,c7 χ5,6,7 is defined by tensoring χc5,6,7 with the linear character χblin1 ,b2 ,0,b4 . 5 ,c6 ,c7 ,b1 ,b2 ,b4 The following proposition gives the character values of χc5,6,7 . It is clear from the x c5 ,c6 ,c7 c5 ,c6 ,c7 calculations in the proof below that λ 6= λ for all x ∈ X with x 6= 1, so that χc5 ,c6 ,c7 ,b1 ,b2 ,b4 is irreducible by an application of Clifford theory. Proposition 5.1. c5 ,c6 ,c7 ,b1 ,b2 ,b4 χ5,6,7 (x(t)) = qδ(t3 ,c5 t1 +c6 t2 +c7 t4 ),0 φ(b1 t1 + b2 t2 + b4 t4 + c5 t5 + c6 t6 + c7 t7 )). 5 ,c6 ,c7 Proof. We write λ for λc5 ,c6 ,c7 and χ for χc5,6,7 . We have that X = X3 is a transversal of V in U , and also that Z(U/M8 ) = X5 X6 X7 . From the induction formula we easily obtain that χ(x(t)) = 0 if t3 6= 0, and also that χ(x(t)) = δt3 ,0 χ(x1 (t1 )x2 (t2 )x4 (t4 ))λ(x5 (t5 )x6 (t6 )x7 (t7 )). Thus it suffices to calculate χ(x1 (t1 )x2 (t2 )x4 (t4 )). We have X x3 (s) χ(x1 (t1 )x2 (t2 )x4 (t4 )) = λ(x1 (t1 )x2 (t2 )x4 (t4 )) s∈Fq = X λ((x1 (t1 )x2 (t2 )x4 (t4 ))x3 (s) ) s∈Fq 10 = X λ([x1 (t1 ), x3 (s)][x2 (t2 ), x3 (s)][x4 (t4 ), x3 (s)]) s∈Fq = X λ(x5 (st1 )x6 (st2 )x7 (st4 )) s∈Fq = X φ(s(c5 t1 + c6 t2 + c7 t4 )) s∈Fq = qδc5 t1 +c6 t2 +c7 t4 ,0 . From this we can deduce the proposition.  5 ,c6 ,c7 ,b1 ,b2 ,b4 We note that the characters χc5,6,7 can be equal for different values of bi . A fairly c ,c ,c ,b0 ,b0 ,b0 5 6 7 1 2 4 5 ,c6 ,c7 ,b1 ,b2 ,b4 = χ5,6,7 easy calculation shows that χc5,6,7 if and only if (b1 −b01 , b2 −b02 , b4 −b04 ) is a multiple of (c5 , c6 , c7 ). Thus we choose representatives as follows for p 6= 2, 3. • If c5 6= 0 and c6 , c7 = 0, then we take b1 = 0. • If c5 , c6 6= 0 and c7 = 0, then we take b1 , b2 such that c6 b1 + c5 b2 = 0. • If c5 , c6 , c7 6= 0, then we take b1 , b2 , b4 such that c6 c7 b1 + c5 c7 b2 + c5 c6 b4 = 0. We deal with the other cases symmetrically with respect to the triality. This gives the characters as in Table 4, and we can give their character values from Proposition 5.1. We note that for p = 2 or p = 3 we have to choose our representatives slightly differently. For p = 3 the only difference is when c5 , c6 , c7 6= 0 and this is shown in Table 4. In the case p = 2, and we have c5 , c6 6= 0 and c7 = 0, then we take b1 = 0, and we deal with the other cases symmetrically with respect to the triality. 5.3. The Families F8 , F9 , F10 , F8,9 , F8,10 and F9,10 . The characters in the families F8 , F9 , F10 , F8,9 , F8,10 and F9,10 are constructed in a similar way, so we deal with them together. We include the details for the characters in the family F8,9 and then remark that the calculations for the family F8 are entirely similar. The character in the families F9 , F10 , F8,10 and F9,10 are defined from characters in F8 or F8,9 through the triality τ . Thus the values of these characters can be immediately deduced. From Table 4 we see that the characters in F8,9 fall into two subfamilies determined by degree. We start with the characters of degree q 3 and explain the construction of the characters in this family. First we note that M10 lies in the kernel of the characters in F8,9 . We have that U/M10 = Q9 i=1 Xi and we define the normal subgroup Y V = Xi i6=1,2,4 of U/M10 . We have that V is isomorphic to F6q and so is elementary abelian, and X = X1 X2 X4 is a transversal of V in U/M10 . Therefore, we have linear characters λa8 ,a9 ,a6 ,a7 of V defined by λa8 ,a9 ,a6 ,a7 (xV (t)) = φ(a6 t6 + a7 t7 + a8 t8 + a9 t9 ), where a8 , a9 , a6 , a7 ∈ F× q and we assume that (a6 , a7 ) is not a multiple of (a8 , a9 ). Then we a8 ,a9 ,a6 ,a7 define χ8,9,q3 to be the character we obtain by inducing λa8 ,a9 ,a6 ,a7 to U/M10 . 11 From the calculations of the character values in Proposition 5.2 below, we observe that λ 6= λa8 ,a9 ,a6 ,a7 for all x ∈ X with x 6= 1.. Therefore, an application of Clifford 8 ,a9 ,a6 ,a7 is irreducible. theory implies that each χa8,9,q 3 We proceed to consider the characters in F8,9 of degree q 2 . Again we have that M10 is in the kernel of these characters. We consider the subgroup Y W = Xi x a8 ,a9 ,a6 ,a7 i6=1,5 of U/M10 . We note that M = X6 X7 is a normal subgroup of W , that W/M is isomorphic to F5q and that X = X1 X5 is a transversal of W in U/M10 . Therefore, we have linear characters µa8 ,a9 of W defined by µa8 ,a9 (xW (t)) = φ(a8 t8 + a9 t9 ), a8 ,a9 a8 ,a9 where a8 , a9 ∈ F× q . Then we define χ8,9,q 2 to be the character we obtain by inducing µ 0,b2 ,b3 ,b4 8 ,a9 8 ,a9 ,b2 ,b3 ,b4 are given by tensoring χa8,9,q to U/M10 . The characters χa8,9,q . 2 with χlin 2 a8 ,a9 0 a8 ,a9 To see that χ8,9,q2 is irreducible we can consider the restriction µ of µ to the subgroup 0 V 0 = X2 X6 X8 X9 of V . Then we let χ0 = µ0U , where U 0 is the subgroup X1 X2 X5 X6 X8 X9 of U/M10 . Now V 0 is normal in U 0 and it is an easy calculation to check that x µ0 6= µ0 for all x ∈ X with x 6= 1. Now we deduce that χ0 is irreducible by an application of Clifford theory. a8 ,a9 ,b2 ,b3 ,b4 8 ,a9 From this it follows that χa8,9,q is irreducible. 2 is irreducible and thus also χ8,9,q 2 We now state our proposition giving the values of the characters in F8,9 . Proposition 5.2. (a) 8 ,a9 ,a6 ,a7 χa8,9,q (x(t)) = q 3 δ(t1 ,t2 ,t3 ,t4 ,t5 ,a8 t6 +a9 t7 ),0 φ(a6 t6 + a7 t7 + a8 t8 + a9 t9 ). 3 (b) If t3 = 0, then 8 ,a9 ,b2 ,b3 ,b4 χa8,9,q (x(t)) = q 2 δ(t1 ,t5 ,a8 t2 +a9 t4 ,a8 t6 +a9 t7 ),0 φ(b2 t2 + b4 t4 + a8 t8 + a9 t9 ). 2 If t3 6= 0, then a8 ,a9 ,b2 ,b3 ,b4 χ8,9,q (x(t)) = 2 qδ(t1 ,a8 t2 +a9 t4 ),0 φ(b2 t2 + b3 t3 + b4 t4 + a8 t8 + a9 t9 + t5 (a8 t2 + a9 t4 − (a8 t6 + a9 t7 )/t3 )). 8 ,a9 ,a6 ,a7 Proof. (a) We write λ = λa8 ,a9 ,a6 ,a7 and χ = χa8,9,q . We consider the series of normal 2 subgroups of U/M10 Y Y V0 = U/M10 , V1 = Xi , V2 = Xi , V3 = V. i6=1 i6=1,2 First we calculate the values of λV2 . We have Z(V2 ) = X6 X7 X8 X9 , so that λV2 (xV2 (t)) = λV2 (x3 (t3 )x4 (t4 )x5 (t5 ))λ(x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )). Also λV2 (xV2 (t)) = 0 if t4 6= 0. Thus it suffices to determine λV2 (x3 (t3 )x5 (t5 )). Now for s ∈ Fq , we have (x3 (t3 )x5 (t5 ))x4 (s) = x3 (t3 )x5 (t5 )x7 (−st3 )x9 (−st5 ) in U/M10 . Therefore, X λV2 (x3 (t3 )x5 (t5 )) = λ(x3 (t3 )x5 (t5 )x7 (−st3 )x9 (−st5 )) s∈Fq 12 X = φ(−a7 st3 − a9 st5 ) s∈Fq X = φ(−s(a7 t3 + a9 t5 )) s∈Fq = qδa7 t3 +a9 t5 ,0 . and thus λV2 (xV2 (t)) = qδ(t4 ,a7 t3 +a9 t5 ),0 φ(a6 t6 + a7 t7 + a8 t8 + a9 t9 ). Next we induce λV2 to V1 ; this requires a very similar calculation, which we omit. We obtain λV1 (xV1 (t)) = q 2 δ(t2 ,t4 ,a7 t3 +a9 t5 ,a6 t3 +a8 t5 ),0 φ(a6 t6 + a7 t7 + a8 t8 + a9 t9 ). Our assumption that (a6 , a7 ) is not a multiple of (a8 , a9 ) implies that for the above to be nonzero we require t3 , t5 = 0. Thus we deduce that λV1 (xV1 (t)) = q 2 δ(t2 ,t3 ,t4 ,t5 ),0 φ(a6 t6 + a7 t7 + a8 t8 + a9 t9 ). Now we do the final induction up to U/M10 to obtain χ. First we observe that Z(V0 ) = X8 X9 and it is easy to check that χ(x(t)) = 0 if any of t1 , t2 , t3 , t4 or t5 is equal to 0. Thus it suffices to calculate χ(x6 (t6 )x7 (t7 )), and we obtain X λV1 (x6 (t6 )x7 (t7 )x8 (−st6 )x9 (−st7 )) χ(x6 (t6 )x7 (t7 )) = s∈Fq = q2 X φ(a6 t7 + a7 t7 − a8 st6 − a9 st7 ) s∈Fq = q 3 δ0,a8 t6 +a9 t7 φ(a6 t6 + a7 t7 ). 8 ,a9 ,a6 ,a7 Putting this all together we obtain the stated value of χa8,9,q . 3 a8 ,a9 a8 ,a9 (b) We write µ = µ and χ = χ8,9,q2 . In order to determine the value of χ we first note that Z(U/M10 ) = X8 X9 and that we have χ(x(t)) = 0 if t1 6= 0. Thus it suffices to calculate χ(x3 (t3 )x2 (t2 )x4 (t4 )x5 (t5 )x6 (t6 )x7 (t7 )). Next we calculate that (x3 (t3 )x2 (t2 )x4 (t4 )x5 (t5 )x6 (t6 )x7 (t7 ))x5 (s5 )x1 (s1 ) = x3 (t3 )x2 (t2 )x4 (t4 )x5 (t5 − s1 t3 )x6 (t6 )x7 (t7 )x8 (−s1 t6 + s5 t2 + s1 t2 t3 )x9 (−s1 t7 + s5 t4 + s1 t3 t4 ). Thus, χ(x3 (t3 )x2 (t2 )x4 (t4 )x5 (t5 )x6 (t6 )x7 (t7 )) is equal to X µ(x3 (t3 )x2 (t2 )x4 (t4 )x5 (t5 )x6 (t6 )x7 (t7 ))x5 (s5 )x1 (s1 ) ) s1 ,s5 ∈Fq = X δt5 −s1 t3 ,0 φ(a8 (−s1 t6 + s5 t2 + s1 t2 t3 ) + a9 (−s1 t7 + s5 t4 + s1 t3 t4 )). s1 ,s5 ∈Fq If t3 = 0, then we see that this is equal to X δt5 ,0 φ(a8 (−s1 t6 + s5 t2 ) + a9 (−s1 t7 + s5 t4 )) = q 2 δ(t5 ,a8 t2 +a9 t4 ,a8 t6 +a9 t7 ),0 . s1 ,s5 ∈Fq Whereas for t3 6= 0, in the sum over s1 we only get a nonzero contribution for s1 = t5 /t3 , thus we get 13 X φ(a8 (−t5 t6 /t3 + s5 t2 + t2 t5 ) + a9 (−t5 t7 /t3 + s5 t4 + t4 t5 )) = s5 ∈Fq qδa8 t2 +a9 t4 ,0 φ(t5 (a8 t2 + a9 t4 − (a8 t6 + a9 t7 )/t3 )). 8 ,a9 ,b2 ,b3 ,b4 From the formulas above we deduce the stated values of χa8,9,q . 2  8 ,a9 ,a6 ,a7 can be equal for different values of ai . From the character We note the characters χa8,9,q 3 a0 ,a0 ,a0 ,a0 8 ,a9 ,a6 ,a7 8 9 6 7 = χ8,9,q if and only if (a08 , a09 , a06 , a07 ) is obtained from values we observe that χa8,9,q 3 3 (a8 , a9 , a6 , a7 ) by adding a multiple of (a8 , a9 ) to (a6 , a7 ). So we choose (a6 , a7 ) such that a6 a9 + a7 a8 = 0, except when p = 2 where we just put a6 = 0. a08 ,a09 ,b02 ,b03 ,b04 8 ,a9 ,b2 ,b3 ,b4 = χ8,9,q if and only if (a08 , a09 , b02 , b03 , b04 ) is obtained Also we observe that χa8,9,q 3 3 from (a8 , a9 , b2 , b3 , b4 ) by adding a multiple of (a8 , a9 ) to (b2 , b4 ). So we choose a coset representative such that b2 a9 + b4 a8 = 0 (except in the case p = 2 where we just take b2 = 0). We move on to briefly discuss the characters in the family F8 . These can be defined in essentially the same way as those in F8,9 . The characters of degree q 3 are denoted χa8,q8 ,a3 7 8 ,a9 ,a6 ,a7 and are defined in exactly the same way as χa8,9,q except we set a9 = 0 and a6 = 0. 3 a8 ,b3 ,b4 8 ,a9 ,b2 ,b3 ,b4 The characters χ8,q2 are defined in the same way as χa8,9,q except we set a9 = 0 2 and b2 = 0. Thus we can immediately deduce the values of these characters given in the proposition below. Proposition 5.3. (a) χa8,q8 ,a3 7 (x(t)) = q 3 δ(t1 ,t2 ,t3 ,t4 ,t5 ,t6 ),0 φ(a7 t7 + a8 t8 ). (b) If t3 = 0, then a8 ,b3 ,b4 χ8,q (x(t)) = q 2 δ(t1 ,t2 ,t5 ,t6 ),0 φ(b4 t4 + a8 t8 ). 2 If t3 6= 0, then χa8,q8 ,b23 ,b4 (x(t)) = qδ(t1 ,t2 ),0 φ(b3 t3 + b4 t4 + a8 (t8 − t5 t6 /t3 )). 5.4. The Family F8,9,10 . We begin with the assumption that p > 2, as the situation for p = 2 is slightly different and is discussed at the end of the section. First we note that M11 lies in the kernel of the characters in F8,9,10 . We have that U/M11 = Q10 i=1 Xi and we define the normal subgroup Y V = Xi i6=1,2,4 of U/M11 . We have that V is isomorphic to F7q and that X = X1 X2 X4 is a transversal of V in U/M11 . We define the character λa8 ,a9 ,a10 of V by λa8 ,a9 ,a10 (xV (t)) = φ(a8 t8 + a9 t9 + a10 t10 ) a8 ,a9 ,a10 for a8 , a9 , a10 ∈ F× to be the character obtained by inducing q . Then we define χ8,9,10 8 ,a9 ,a10 ,b3 a8 ,a9 ,a10 λ to U/M11 . The irreducible characters χa8,9,10 in the family F8,9,10 are then a8 ,a9 ,a10 0,0,b3 ,0 obtained by tensoring χ8,9,10 with the linear character χlin . The construction of these characters is the same as in [24, §4], where they are shown to be irreducible and distinct. In order to obtain the values of χ we take advantage of the conjugacy class representatives in Table 3. First note that since χ(x(t)) = 0 for x(t) 6∈ V , so we do not need to consider 14 any conjugacy classes in Table 3 above the family C3 . We split up our calculations for the remaining elements by considering elements in the family C3 , and those lying in any of the other classes. Proposition 5.4. Suppose p > 2. 8 ,a9 ,a10 ,b3 (x(t)) = 0. (a) Suppose that at least one of t1 , t2 or t4 is nonzero. Then χa8,9,10 (b) Let x(t) = x3 (t3 )x8 (t8 )x9 (t9 )x10 (t10 ), where t3 6= 0. Then X 8 ,a9 ,a10 ,b3 (x(t)) = qφ(b3 t3 + a8 t8 + a9 t9 + a10 t10 ) φ(−a8 a9 a10 t3 s2 ). χa8,9,10 s∈Fq (c) Let x(t) = x5 (t5 )x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )x10 (t10 ). Then 8 ,a9 ,a10 ,b3 (x(t)) = q 3 δ(t5 ,t6 ,t7 ),0 φ(a8 t8 + a9 t9 + a10 t10 ). χa8,9,10 P Remark 5.5. Before we proceed to the proof, we remark on the term t∈Fq φ(−a8 a9 a10 t3 t2 ) P in (b) (for the case t3 6= 0). Clearly this can be deduced from the value of t∈Fq φ(t2 ): if P P −a8 a9 a10 t3 ∈ F× φ(−a8 a9 a10 t3 t2 ) = t∈Fq φ(t2 ) and if −a8 a9 a10 t3 ∈ q is a square, then t∈F q P P P 2 2 2 F× q is not a square, then t∈Fq φ(−a8 a9 a10 t3 t ) = − t∈Fq φ(t ). The sum t∈Fq φ(t ) is referred to as a quadratic For q = p the value of this GaussP sum is well known: P Gauss sum. √ √ if p ≡ 1 mod 4, then t∈Fp φ(t2 ) = p, and if p ≡ −1 mod 4, then t∈Fp φ(t2 ) = i p. However, for general q the situation is more complicated: it is known that the absolute value √ is q, see for example [29, Proposition 11.5], but a formula giving the exact value appears not to be known in general. Proof. We begin by noting that it suffices to consider the case b3 = 0. We write λ = λa8 ,a9 ,a10 8 ,a9 ,a10 and χ = χa8,9,10 . (a) We dealt with this case in the discussion before the statement of the proposition. (b) The first step is to calculate in U/M11 that x3 (t3 )x1 (s1 )x2 (s2 )x4 (s4 ) = x3 (t3 )x5 (−s1 t3 )x6 (−s2 t3 )x7 (−s4 t3 )x8 (s1 s2 t3 )x9 (s1 s4 t3 )x10 (s2 s4 t3 ). Therefore, we have X χ(x3 (t3 )) = φ(a8 s1 s2 t3 + a9 s1 s4 t3 + a10 s2 s4 t3 ) s1 ,s2 ,s4 ∈Fq X = φ(a10 s2 s4 t3 ) s2 ,s4 ∈Fq X = X φ(s1 (a8 s2 + a9 s4 )t3 ) s1 ∈Fq φ(a10 t3 s2 s4 )qδ0,a8 s2 +a9 s4 s2 ,s4 ∈Fq =q X φ(−a10 a9 s24 t3 /a8 ) s4 ∈Fq =q X φ(−a8 a9 a10 t3 s2 ). s∈Fq For the last equality we just substitute s4 = a8 s. Now using that Z(U/M11 ) = X8 X9 X10 , the value of χ given in (b) can be deduced. (c) In this case the starting point is to calculate in U/M11 that 15 (x5 (t5 )x6 (t6 )x7 (t7 ))x1 (s1 )x2 (s2 )x4 (s4 ) = x5 (t5 )x6 (t6 )x7 (t7 )x8 (−s1 t6 − s2 t5 )x9 (−s1 t7 − s4 t5 )x10 (−s2 t7 − s4 t6 ). Therefore, χ(x5 (t5 )x6 (t6 )x7 (t7 )) is equal to X X X φ(−s1 (a8 t6 + a9 t7 )) φ(−s2 (a8 t5 + a10 t7 )) φ(−s4 (a9 t5 + a10 t6 )) s1 ∈Fq s4 ∈Fq s2 ∈Fq 3 = q δ(a8 t6 +a9 t7 ,a8 t5 +a10 t7 ,a9 t5 +a10 t6 ),0 . Now the linear system a8 t6 + a9 t7 = 0 a8 t5 + a10 t7 = 0 a9 t5 + a10 t6 = 0 has only the trivial solution t5 = t6 = t7 = 0, as we are assuming p > 2. Thus we get χ(x5 (t5 )x6 (t6 )x7 (t7 )) = q 3 δ(t5 ,t6 ,t7 ),0 . Now using that Z(U/M11 ) = X8 X9 X10 , the value of a8 ,a9 ,a10 ,b3 χ8,9,10 given in (c) can be deduced.  To end this section we consider the case p = 2, where the situation is more complicated. a8 ,a9 ,a10 8 ,a9 ,a10 The characters χa8,9,10,q for p > 3. 3 are defined in the same way as the characters χ8,9,10 a ,a ,a ,a ,d ,d 8 9 10 5,6,7 1,2,4 3 There are also characters denoted χ8,9,10,q , which are defined as follows. 3 /2 Q Again we let V = i6=1,2,4 Xi and let a = a5,6,7 , a8 , a9 , a10 ∈ F× q . We define the linear a8 ,a9 ,a10 ,a character λ = λ of V by λ(xV (t)) = φ(a8 a9 at5 + a8 a10 at6 + a9 a10 at7 + a8 t8 + a9 t9 + a10 t10 ). Now let Y124 = {1, x1 (a10 a)x2 (a9 a)x4 (a8 a)} and V̄ = Y124 V . We can extend λ to V̄ in two ways, namely λ̄d1,2,4 , where λ̄d1,2,4 (x1 (a10 a)x2 (a9 a)x4 (a8 a)) = (−1)d1,2,4 for d1,2,4 ∈ F2 . We then induce λ̄d1,2,4 to U/M11 to obtain a character ψ d1,2,4 , which is irreducible as shown in [24, §4]. Now let d3 be either 0 or an element of Fq , which is not in the image of the map a8 ,a9 ,a10 ,a5,6,7 ,d1,2,4 ,d3 s 7→ aa8 a9 a10 s + a8 a9 a10 s2 . Then we define χ8,9,10,q by tensoring ψ d1,2,4 with 3 /2 0,0,d3 ,0 χlin . The proposition below states the values of these characters, these can be deduced from [30, Thm. 2.3]. Note that with our specific choice of φ, we have ker(φ) = {tp − t : t ∈ Fq }. −p p p−1 Thus for each a ∈ F× t | t ∈ Fq } as q , we have that ker(φ) = a Ta , where Ta = {t − a defined in [30, Definition 1.2]. In turn this implies that aφ as defined in [30, Definition 1.4] 8 ,a9 ,a10 is equal to a−p . We note that the values for χa8,9,10,q 3 look different to those for p > 2, which is explained by the fact that the quadratic Gauss sums for p = 2 are clearly zero. Proposition 5.6. Let p = 2. (a) 3 8 ,a9 ,a10 χa8,9,10,q 3 (x(t)) = δ(t1 ,t2 ,t3 ,t4 ,a8 t5 +a10 t7 ,a8 t6 +a9 t7 ),0 q φ(a8 t8 + a9 t9 + a10 t10 ). (b) Let a = a5,6,7 . If (t1 , t2 , t4 ) 6∈ {(0, 0, 0), (a10 a, a9 a, a8 a)}, then a ,a ,a ,a 8 9 10 5,6,7 χ8,9,10,q 3 /2 ,d1,2,4 ,d3 16 (x(t)) = 0. If x(t) = x1 (a10 r)x2 (a9 r)x4 (a8 r)x5 (a10 t)x6 (a9 t)x7 (a8 t)x8 (t8 )x9 (t9 )x10 (t10 ), where r ∈ {0, a} and t, t8 , t9 , t10 ∈ Fq , then q3 φ(d1,2,4 r + a8 a9 a10 at + a8 t8 + a9 t9 + a10 t10 ). 2 For r ∈ {0, a} and x(t) = x3 (t3 )x1 (a10 r)x2 (a9 r)x4 (a8 r)x5 (t5 )x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )x10 (t10 ), a ,a ,a ,a 8 9 10 5,6,7 χ8,9,10,q 3 /2 a ,a ,a ,a 8 9 10 5,6,7 χ8,9,10,q 3 /2 ,d1,2,4 ,d3 ,d1,2,4 ,d3 (x(t)) = (x(t)) = q2 t7 δt3 , a−p φ(d1,2,4 r + d3 t3 + a8 a9 a10 a + a8 a9 a10 2 a8 2 (a8 a9 a10 ) t5 t7 t6 t7 + )( + ) + a8 t8 + a9 t9 + a10 t10 ). ( −p a a10 a8 a9 a8 5.5. The Family F11 . Q First we note that M12 lies in the kernel of the characters in F11 . We have that U/M12 = 11 i=1 Xi and we define the normal subgroup Y V = Xi i6=1,2,4 of U/M12 . We have that V is isomorphic to F8q and X = X1 X2 X4 is a transversal of V in U/M12 . We define the character λa11 ,b5 ,b6 ,b7 of V by λa11 ,b5 ,b6 ,b7 (xV (t)) = φ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) for a11 ∈ F× q and b5 , b6 , b7 ∈ Fq . a11 ,b5 ,b6 ,b7 We define χ11 to be the character obtained by inducing λa11 ,b5 ,b6 ,b7 to U/M12 . The a11 ,b5 ,b6 ,b7 ,b3 a11 ,b5 ,b6 ,b7 irreducible characters χ11 in the family F11 are then obtained by tensoring χ11 3 ,0 with the linear character χ0,0,b . lin Using [30, Lemma 1.5] with Z = X11 , Y = X8 X9 X10 , X = X1 X2 X4 and M = X3 X5 X6 X7 , a0 ,b0 ,b0 ,b0 ,b0 a11 ,b5 ,b6 ,b7 ,b3 we obtain that each χ11 is irreducible, and that χa1111 ,b5 ,b6 ,b7 ,b3 = χ1111 5 6 7 3 if and only if (a11 , b5 , b6 , b7 , b3 ) = (a011 , b05 , b06 , b07 , b03 ). The fact that the hypothesis of that lemma holds follows from the fact that XY Z forms a subgroup of V which is special of type q 1+6 . In order to obtain the values of χa1111 ,b5 ,b6 ,b7 ,b3 in Proposition 5.7 below, we take advantage of the conjugacy class representatives in Table 3. We assume p > 2 at first, as the situation is slightly different for p = 2, which we discuss after. First note that since χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = 0 for x(t) 6∈ V , we can deal with any conjugacy classes in Table 3 above the family C3 quickly in (a). Dealing with elements in the family C3 in (b) is the most complicated part of the proposition. Part (c) covers all of those in the families C5,6,7 , C5,6 and C5 , and then we can then use the triality automorphism τ to determine the values on representatives in the classes C5,7 , C6,7 , C6 and C7 . We finish by considering the remaining classes together in (d), a11 ,b5 ,b6 ,b7 ,b3 . so that we have determined the value of χ11 Proposition 5.7. Suppose p > 2. (a) Suppose that at least one of t1 , t2 or t4 is nonzero. Then χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = 0. (b) Let x(t) = x3 (t3 )x8 (t8 )x9 (t9 )x10 (t10 )x11 (t11 ), where t3 6= 0. Then a11 ,b5 ,b6 ,b7 ,b3 χ11 (x(t)) = qφ(b3 t3 + a11 t11 )(qδ(b6 t3 +a11 t9 ,b7 t3 +a11 t8 ),0 ) 17 X φ(−(b5 t3 + a11 t10 )s + (b6 t3 + a11 t9 )(b7 t3 + a11 t8 )(a11 t3 )−1 s−1 )). s∈F× q (c) (i) Let x(t) = x5 (t5 )x6 (t6 )x7 (t7 )x11 (t11 ), where t5 , t6 , t7 6= 0. Then X χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) φ(−a11 t5 t6 t7 s2 ). s∈Fq (ii) Let x(t) = x5 (t5 )x6 (t6 )x9 (t9 )x10 (t10 )x11 (t11 ), where t5 6= 0. Then χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = q 2 δt6 t9 ,t5 t10 φ(b5 t5 + b6 t6 + a11 t11 ). (d) Let x(t) = x8 (t8 )x9 (t9 )x10 (t10 )x11 (t11 ). Then χa1111 ,b5 ,b6 ,b7 ,b3 = q 3 δ(t8 ,t9 ,t10 ),0 φ(a11 t11 ). P Remark 5.8. Before the proof, we comment on the term of the form s∈Fq φ(As + Bs ), where A, B ∈ F× q in (b). It seems that a general formula for this is not known. Proof. We note that it suffices to deal with the case b3 = 0 and we let λ = λa11 ,b5 ,b6 ,b7 and χ = χa11 ,b5 ,b6 ,b7 . (a) We dealt with this case in the discussion before the statement of the proposition. (b) First we note that Z(U/M12 ) = X11 . Therefore, it suffices to calculate the values of χ(x3 (t3 )x8 (t8 )x9 (t9 )x10 (t10 )). We calculate (x3 (t3 )x8 (t8 )x9 (t9 )x10 (t10 ))x1 (s1 )x2 (s2 )x4 (s4 ) = x3 (t3 )x5 (−t3 s1 )x6 (−t3 s2 )x7 (−t3 s4 )x8 (t8 + t3 s1 s2 ) x9 (t9 + t3 s1 s4 )x10 (t10 + t3 s2 s4 )x11 (−t9 s2 − t10 s1 − t8 s4 − t3 s1 s2 s4 )). Thus we see that χ(x3 (t3 )x8 (t8 )x9 (t9 )x10 (t10 )) is equal to X φ(−b5 t3 s1 − b6 t3 s2 − b7 t3 s4 + a11 (−t9 s2 − t10 s1 − t8 s4 − t3 s1 s2 s4 )) s1 ,s2 ,s4 ∈Fq X = φ(−b5 t3 s1 − b6 t3 s2 + a11 (−t9 s2 − t10 s1 )) s1 ,s2 ∈Fq X = X φ(−(b7 t3 + a11 t8 + a11 t3 s1 s2 )s4 ) s4 ∈Fq φ(−b5 t3 s1 − b6 t3 s2 + a11 (−t9 s2 − t10 s1 ))qδb7 t3 +a11 t8 +a11 t3 s1 s2 ,0 s1 ,s2 ∈Fq  =q X φ((−b6 t3 − a11 t9 )s2 )δb7 t3 +a11 t8 ,0 s2 ∈Fq  + X φ(−b5 t3 s1 − a11 t10 s1 ) s1 ∈F× q =q X φ((−b6 t3 − a11 t9 )s2 )δb7 t3 +a11 t8 +a11 t3 s1 s2 ,0  s2 ∈Fq qδ(b7 t3 +a11 t8 ,b6 t3 +a11 t9 ),0 18  + X  φ(−(b5 t3 + a11 t10 )s1 )φ((b6 t3 + a11 t9 )(b7 t3 + a11 t8 )(a11 t3 )−1 s−1 1 ) s1 ∈F× q = q(qδ(b7 t3 +a11 t8 ,b6 t3 +a11 t9 ),0 X + φ(−(b5 t3 + a11 t10 )s + (b6 t3 + a11 t9 )(b7 t3 + a11 t8 )(a11 t3 )−1 s−1 )). s∈F× q This gives the formula in (b). (c) We moveQon to consider the case where t3 = 0 and t5 6= 0. Consider the normal subgroup W = i6=1 Xi of U/M12 . A calculation shows that λW (x5 (t5 )x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )x10 (t10 )x11 (t11 )) = qφ(b5 t5 + b6 t6 + b7 t7 + a11 (−t−1 5 t8 t9 + t11 )). To obtain χ(x5 (t5 )x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )x10 (t10 )x11 (t11 )) we just have to induce this formula over X1 to U/M12 . First we consider elements of the conjugacy class C5,6,7 , and we get χ(x5 (t5 )x6 (t6 )x7 (t7 )x11 (t11 )) X = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) φ(−a11 t−1 5 (−s1 t6 )(−s1 t7 )) s1 ∈Fq = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) X φ(−a11 t5 t6 t7 s2 ) s∈Fq as stated in (i). Next we consider elements in the class C5,6 or C5 and we get χ(x5 (t5 )x6 (t6 )x9 (t9 )x10 (t10 )x11 (t11 )) X = qφ(b5 t5 + b6 t6 + a11 t11 ) φ(−a11 t−1 5 ((−s1 t6 )t9 − s1 t10 )) s1 ∈Fq = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) X φ(a11 t−1 5 s1 (t6 t9 + t10 )) s∈Fq 2 = q δt6 t9 +t10 ,0 φ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) as stated in (ii). (d) This is an easy calculation, which we omit.  In the case p = 2, the only difference is that we now have to consider elements of the form x5 (t5 )x6 (t6 )x7 (t7 )x10 (t10 )x11 (t11 ) even when t5 , t6 , t7 6= 0, to cover the family of conjugacy p=2 classes C5,6,7,2q 8 ; the value given below is in a form where we do not have a closed formula. p=2 Also the value for the family C5,6,7,q 8 is simplified as the quadratic Gauss sum is equal to 0. Lemma 5.9. Let p = 2. (a) Let x(t) = x5 (t5 )x6 (t6 )x7 (t7 )x10 (t10 )x11 (t11 ), where t5 , t6 , t7 , t10 ∈ F× q and t11 ∈ Fq . Then X χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) φ(a11 (t5 t6 t7 s2 + t5 t10 s)). s∈Fq 19 (b) Let x(t) = x5 (t5 )x6 (t6 )x7 (t7 ), where t5 , t6 , t7 ∈ F× q . Then χa1111 ,b5 ,b6 ,b7 ,b3 (x(t)) = 0. Proof. (a) We can proceed as in the case p > 2 and we obtain the formula λW (x5 (t5 )x6 (t6 )x7 (t7 )x8 (t8 )x9 (t9 )x10 (t10 )x11 (t11 )) = qφ(b5 t5 + b6 t6 + b7 t7 + a11 (t−1 5 t8 t9 + t11 )). Now we induce over X1 to obtain χ(x5 (t5 )x6 (t6 )x7 (t7 )x10 (t10 )x11 (t11 )) = X λW (x5 (t5 )x6 (t6 )x7 (t7 )x8 (s1 t6 )x9 (s1 t7 )x10 (t10 )x11 (s1 t10 + t11 )) s1 ∈Fq = X 2 qφ(b5 t5 + b6 t6 + b7 t7 + a11 (t−1 5 s1 t6 t7 + s1 t10 + t11 ) s1 ∈Fq = qφ(b5 t5 + b6 t6 + b7 t7 + a11 t11 ) X φ(a11 (t5 t6 t7 s2 + t5 t10 s)). s∈Fq (b) This is obtained directly from the calculation for p > 2 by noting that the sum there is equal to 0.  Q 5.6. The Family F12 . Let V = i6=3,5,6,7 Xi and W = X8 X9 X10 X11 . Then W is a normal subgroup of V and the quotient V /W is elementary abelian isomorphic to F4q . Also X = X3 X5 X6 X7 is a transversal of V in U . Given a12 ∈ F× q , we define the linear character a12 a12 λ : V → C by λ (xV (t)) = φ(a12 t12 ). Then we define χa1212 = (λa12 )U and χa1212 ,b1 ,b2 ,b4 = χa1212 χblin1 ,b2 ,0,b4 . Using [30, Lemma 1.5] with Z = X12 , Y = X8 X9 X10 X11 , X = X3 X5 X6 X7 and M = a0 ,b0 ,b0 ,b0 a12 ,b1 ,b2 ,b4 X1 X2 X4 , we obtain that each χa1112 ,b1 ,b2 ,b4 is irreducible, and that χ11 = χ1112 1 2 4 if and only if (a12 , b1 , b2 , b4 ) = (a012 , b01 , b02 , b04 ). The hypothesis of that lemma holds due to the fact that XY Z forms a subgroup of V which is special of type q 1+8 . In the next proposition we state the values of χa1212 ,b1 ,b2 ,b4 by considering a number of cases, which cover all of the conjugacy class representatives in Table 3. We note that in (c) we only deal with conjugacy classes up to the action of τ . We first restrict to the case p > 2, and then afterwards we describe some differences that occur for the case p = 2. Proposition 5.10. Suppose that p > 2. (a) Suppose that t3 6= 0. Then χa1212 ,b1 ,b2 ,b4 (x(t)) = 0. (b) Suppose x(t) lies in one of the families C1,2,4,q6 , C1,2,q6 , C1,4,q6 , C2,4,q6 , C1,q6 , C2,q6 or C4,q6 . Then χa1212 ,b1 ,b2 ,b4 (x(t)) = 0. (c) The values of χa1212 ,b1 ,b2 ,b4 on the families of conjugacy classes C1,2,4,q7 , C1,2,q7 , C1,2,q8 , C1,q7 and C1,q8 are given as follows. 20 C1,2,4,q7 : χa1212 ,b1 ,b2 ,b4 (x1 (t1 )x2 (t2 )x4 (t4 )x12 (t 12 )) X = qφ(b1 t1 + b2 t2 + b4 t4 + a12 t12 ) φ(−a12 t1 t2 t4 s2 ), for t1 , t2 , t4 ∈ F× q and t12 ∈ Fq . C1,2,q7 : C1,2,q8 : s∈Fq a12 ,b1 ,b2 ,b4 (x1 (t1 )x2 (t2 )x9 (t9 )x10 (t10 )) = q 2 δ0,t10 t1 −t2 t9 φ(b1 t1 + b2 t2 ), χ12 for t1 , t2 , t9 , t10 ∈ F× q . a12 ,b1 ,b2 ,b4 (x1 (t1 )x2 (t2 )x12 (t12 )) = q 2 φ(b1 t1 + b2 t2 + a12 t12 ), χ12 for t1 , t2 ∈ F× q and t12 ∈ Fq . a12 ,b1 ,b2 ,b4 (x1 (t1 )x10 (t10 )) = 0, for t1 , t10 ∈ F× χ12 q . a12 ,b1 ,b2 ,b4 2 (x1 (t1 )x12 (t12 )) = q φ(b1 t1 + a12 t12 ), for t1 ∈ F× χ12 q and t12 C1,q7 : C1,q8 : Q (d) Let x(t) = i≥5 xi (ti ). Then ∈ Fq . a12 ,b1 ,b2 ,b4 (x(t)) = q 4 δ0,(t5 ,t6 ,t7 ,t8 ,t9 ,t10 ,t11 ) φ(a12 t12 ). χ12 Proof. It is clear that it suffices to calculate the values of χa1212 . We write λ = λa12 and χ = χa1212 . In order to explain our calculations, we introduce some intermediate subgroups. We let V1 = V X7 , V2 = V X6 X7 and V3 = V X5 X6 X7 . To abbreviate notation we write λi = λVi for each i = 1, 2, 3. By direct calculation we find λ1 (xV1 (t)) = qδ(t7 ,t8 ),0 φ(a12 t12 ), and  (5.1) λ2 (xV2 (t)) = qδ0,(t6 ,t7 ) φ(a12 (t12 − t9t1t8 )) if t1 = 6 0 2 q δ0,(t6 ,t7 ,t8 ,t9 ) φ(a12 t12 ) if t1 = 0. We do not calculate λ3 fully here, but do note that (5.2) λ3 (xV3 (t)) = δ0,(t5 ,t6 ,t7 ) λ3 (xV3 (t)). (a) It is clear that χ(x(t)) = 0, if t3 6= 0. (b) Let x = x1 (c1 )x2 (c2 )x4 (c4 )x5 (e5 )x6 (e6 )x7 (e7 ) lie in the family C1,2,4,q6 and consider y = xx3 (s3 ) for s3 ∈ Fq . The theory of minimal representatives outlined in Section 3 implies that the coefficient of one of x5 , x6 or x7 in y must be nonzero. Therefore, χ(x) = P x3 (s) ) = 0 by (5.2). s∈Fq ψ̇3 (x Similar arguments deal with the other families in the statement. (c) First we show that if one of t1 , t2 or t4 is nonzero, then ! ! Y Y (5.3) χ xi (ti ) = λ3 xi (ti ) . i6=3,5,6,7 i6=3,5,6,7 We just Q deal with the case t1 6= 0, as the other cases can be dealt with similarly. Consider y = i6=3,5,6,7 xi (ti )x3 (s3 ) , for s3 ∈ Fq . We calculate the coefficient of x5 in y to be t1 s3 . Therefore, by (5.2), the only nonzero term in the right side of ! ! Y X Y λ̇3 xi (ti )x3 (s3 ) χ xi (ti ) = i6=3,5,6,7 s3 ∈Fq is when s3 = 0. 21 i6=3,5,6,7 We now give the calculation for C1,2,4,q7 χ(x1 (t1 )x2 (t2 )x4 (t4 )x12 (t12 )) = λ3 (x1 (t1 )x2 (t2 )x4 (t4 )x12 (t12 )) X = λ̇2 ((x1 (t1 )x2 (t2 )x4 (t4 )x12 (t12 ))x5 (s5 ) ) s5 ∈Fq = X λ̇2 (x1 (t1 )x2 (t2 )x8 (t2 s5 )x4 (t4 )x9 (t4 s5 )x12 (t12 )) s5 ∈Fq = X λ̇2 (x1 (t1 )x2 (t2 )x4 (t4 )x8 (t2 s5 )x9 (t4 s5 )x11 (−t2 t4 s5 )x12 (t12 )) s5 ∈Fq = qφ(a12 t12 ) X φ(−a12 t1 t2 t4 s2 ). s∈Fq The first equality is given by (5.3), and the last uses (5.1) and substitution s = t1 s5 . We omit the calculations for the other conjugacy classes in (c), as they are very similar. (d) This is a straightforward calculation, which we omit.  p=2 p=2 For the case p = 2, we just have to deal with the classes C1,2,4,2q 7 and C1,2,4,q 7 , which we do in the following lemma. The calculations involved are a minor modification to those for the class C1,2,4 for p > 2, so we omit the proof. p=2 p=2 Lemma 5.11. Let p = 2. The values of on the classes C1,2,4,2q 7 and C1,2,4,q 7 are given as follows. p=2 C1,2,4,2q χa1212 ,b1 ,b2 ,b4 (x1 (t1 )x2 (t2 )x4 (t4 )x10 (t10 )x12 (t12 )) 7: P = qφ(b1 t1 + b2 t2 + b4 t4 + a12 t12 ) s∈Fq φ(a12 (st1 t10 + t1 t2 t4 s2 )), for t1 , t2 , t4 , t10 ∈ F× q and t12 ∈ Fq . p=2 C1,2,4,q χa1212 ,b1 ,b2 ,b4 (x1 (t1 )x2 (t2 )x4 (t4 )x12 (t12 )) = 0, for t1 , t2 , t4 ∈ F× 7: q and t12 ∈ Fq . References [1] J. An and G. Hiss, Restricting unipotent characters in finite symplectic groups, Comm. Algebra 39 (2011), no. 3, 1104–1130. [2] C. A. M. André, The basic character table of the unitriangular group J. Algebra 241 (2001), no. 1, 437–471. [3] C. André and A. Neto, A supercharacter theory for the Sylow p-subgroups of the finite symplectic and orthogonal groups, J. Algebra 322 (2009), 1273–1294. [4] J. D. Bradley and S. M. Goodwin, Conjugacy classes in Sylow p-subgroups of finite Chevalley groups in bad characteristic, Comm. Algebra 42 (2014), no. 8, 3245–3258. [5] R. W. Carter, Simple groups of Lie type, A Wiley-Interscience publication, London, 1972. [6] P. Diaconis, I.M. Isaacs, Supercharacters and superclasses for algebra groups, Trans. Amer. Math. Soc. 360 (2008), no. 5, 2359–2392. [7] F. Digne and J. Michel, Representations of finite groups of Lie type, London Mathematical Society Student Texts 21, Cambridge University Press, Cambridge, 1991. [8] A. Evseev, Reduction for characters of finite algebra groups, J. Algebra 325 (2011), 321–351. [9] The GAP Group, GAP – Groups, Algorithms, and Programming, Version 4.4.12 (2008), http://www.gap-system.org. 22 [10] M. Geck, G. Hiss, F. Lübeck, G. Malle and G. Pfeiffer, CHEVIE A system for computing and processing generic character tables for finite groups of Lie type, Weyl groups and Hecke algebras, Appl. Algebra Engrg. Comm. Comput. 7 (1996), 175–210. [11] S. M. Goodwin, On the conjugacy classes in maximal unipotent subgroups of simple algebraic groups, Transform. Groups 11 (2006), no. 1, 51–76. [12] S. M. Goodwin, P. Mosch and G. Röhrle, Calculating conjugacy classes in Sylow p-subgroups of finite Chevalley groups of rank six and seven, LMS J. Comput. Math. 17 (2014), no. 1, 109–122. , On the coadjoint orbits of maximal unipotent subgroups of reductive groups, Transform. Groups [13] 21 (2016), no. 2, 399–426. [14] S. M. Goodwin and G. Röhrle, Calculating conjugacy classes in Sylow p-subgroups of finite Chevalley groups, J. Algebra 321 (2009), 3321–3334. [15] R. Gow, M. Marjoram and A. Previtali On the irreducible characters of a Sylow 2-subgroup of the finite symplectic group in characteristic 2, J. Algebra 241 (2001), 393–409 [16] G. Higman, Enumerating p-groups. I: Inequalities, Proc. London Math. Soc. 10 (1960), 24–30. [17] F. Himstedt, Character tables of parabolic subgroups of Steinberg’s triality groups, J. Algebra 281 (2004), 774–822. , On the 2-decomposition numbers of Steinberg’s triality groups 3 D4 (q), q odd, J. Algebra 309 [18] (2007), 569–593. , Character tables of parabolic subgroups of Steinberg’s triality groups 3 D4 (2n ), J. Algebra 316 [19] (2007), 254–283. [20] On the decomposition numbers of the Ree groups 2 F4 (q 2 ) in non-defining characteristic, J. Algebra 325 (2011), 364–403. [21] F. Himstedt and S. Huang, Character table of a Borel subgroup of the Ree groups 2 F4 (q 2 ), LMS J. Comput. Math. 12 (2009), 1–53. [22] , Character tables of the maximal parabolic subgroups of the Ree groups 2 F4 (q 2 ), LMS J. Comput. Math. 13 (2010), 90–110. [23] , On the decomposition numbers of Steinberg’s triality groups 3 D4 (2n ) in odd characteristics, Comm. Algebra 41 (2013), no. 4, 1484–1498. [24] F. Himstedt, T. Le and K. Magaard Characters of the Sylow p-subgroups of the Chevalley groups D4 (pn ), J. Algebra 332 (2011), 414–427. [25] F. Himstedt and F. Noeske, Decomposition numbers of SO7 (q) and Sp6 (q), J. Algebra 413 (2014), 15–40. [26] , Restricting unipotent characters in special orthogonal groups, LMS J. Comput. Math. 18 (2015), 456–488. [27] I. M. Isaacs, Characters of groups associated with finite algebras, J. Algebra, 177 (1995), 708–730. [28] , Counting characters of upper triangular groups, J. Algebra 315 (2007), no. 2, 698–719. [29] H. Iwaniec and E. Kowalski, Analytic number theory, American Mathematical Society Colloquium Publications 53. American Mathematical Society, Providence, RI, 2004. [30] T. Le and K. Magaard, On the character degrees of Sylow p-subgroups of Chevalley groups G(pf ) of type E, Forum Math. 27 (2015), no. 1, 1–55. [31] G. Lehrer, Discrete series and the unipotent subgroup, Compos. Math., 28 (1974), 9–19. [32] E. Marberg, Combinatorial methods for character enumeration for the unitriangular groups, J. Algebra 345 (2011), 295–323. [33] M. Marjoram, Irreducible characters of a Sylow p-subgroup of the orthogonal group, Comm. Algebra 27 (1999), 1171–1195. [34] T. Okuyama and K. Waki, Decomposition numbers of Sp(4, q), J. Algebra 199 (1998), 544–555. [35] I. Pak and A. Soffer, On Higman’s k(Un (Fq )) conjecture, preprint, arxiv:1507.00411. [36] A. Previtali, On a conjecture concerning character degrees of some p-groups, Arch. Math. 65 (1995) 375–378. [37] J. Sangroniz, Character degrees of the Sylow p-subgroups of classical groups, Groups St. Andrews 2001 in Oxford. Vol. II, 487–493, London Math. Soc. Lecture Note Ser., 305, Cambridge Univ. Press, Cambridge, 2003. 23 [38] , Irreducible characters of large degree of Sylow p-subgroups of classical groups, J. Algebra 321 (2009), 1480–1496. [39] F. Szechtman, Irreducible characters of Sylow subgroups of symplectic and unitary groups, J. Algebra 303 (2006), 722–730. [40] B. Szegedy, Characters of the Borel and Sylow subgroups of classical groups, J. Algebra 267 (2003), 130–136 [41] K. Waki, A note on decomposition numbers of G2 (2n ), J. Algebra 274 (2004), 602–606. School of Mathematics, University of Birmingham, Birmingham, B15 2TT, U.K. E-mail address: [email protected] E-mail address: [email protected] Department of Mathematics and Applied Mathematics, University of Pretoria, Pretoria 0002, South Africa E-mail address: [email protected] 24
4math.GR
A Pseudo Knockoff Filter for Correlated Features Jiajie Chen ∗, Anthony Hou †, Thomas Y. Hou ‡ arXiv:1708.09305v3 [stat.ME] 19 Sep 2017 September 21, 2017 Abstract In [3], the authors introduce a new variable selection procedure called the knockoff filter to control the false discovery rate (FDR) and prove that this method achieves exact FDR control. Inspired by the work of [3], we propose and analyze a pseudo-knockoff filter that inherits some advantages of the original knockoff filter and has more flexibility in constructing its knockoff matrix. Although we have not been able to obtain exact FDR control of the pseudo knockoff filter, we show that it satisfies an expectation inequality that offers some insight into FDR control. Moreover, we provide some partial analysis of the pseudo knockoff filter for the half Lasso and the least squares statistics. Our analysis indicates that the inverse of the covariance matrix of the feature matrix plays an important role in designing and analyzing the pseudo knockoff filter. Our preliminary numerical experiments show that the pseudo knockoff filter with the half Lasso statistic has FDR control. Moreover, our numerical experiments show that the pseudo-knockoff filter could offer more power than the original knockoff filter with the OMP or Lasso Path statistic when the features are correlated and non-sparse. 1 Introduction In many applications, we need to study a statistical model that consists of a response variable and a large number of potential explanatory variables and determine which variables are truly associated with the response. In [3], Barber and Candès introduce the knockoff filter to control the FDR in a statistical linear model. More specifically, the knockoff filter constructs knockoff variables that mimic the correlation structure of the true feature variables to obtain exact FDR control in finite sample settings. It has been demonstrated that this method has more power than existing selection rules when the proportion of null variables is high. 1.1 A brief review of the knockoff filter Consider the following linear regression model y = Xβ + ǫ, where the feature matrix X is a n × p ( n ≥ p) matrix with full rank, its columns have been normalized to be unit vectors in the l2 norm, and ǫ is a Gaussian noise N (0, σ 2 In ). The knockoff filter begins with the construction of a knockoff matrix X̃ that obeys X̃ T X̃ = X T X, X̃ T X = X T X − diag(s), (1) where si ∈ [0, 1], i = 1, 2, ..., p. The positive definiteness of the Gram matrix [X X̃]T [X X̃] requires diag(s)  2X T X. ∗ Applied and Computational Mathematics, Caltech; Email: [email protected] Department of Statistics, Harvard University; Email: [email protected] ‡ Applied and Computational Mathematics, Caltech; Email: [email protected] † 1 (2) The first condition in (1) ensures that X̃ has the same covariance structure as the original feature matrix X. The second condition in (1) guarantees that the correlations between distinct original and knockoff variables are the same as those between the original variables. To ensure that the method has good statistical power to detect signals, we should choose sj as large as possible to maximize the difference between Xj and its knockoff X̃j . These two conditions are crucial in establishing the exchangeability condition [3], which in turn gives exact FDR control. After constructing the knockoff matrix, one needs to calculate a statistic, Wj , for each pair of Xj and X̃j . One of the knockoff statistics considered in [3] is the Lasso path statistic, which is defined as Wj = max(Zj , Z̃j ) · sign(Zj − Z̃j ), where Zj and Z̃j are the solutions of the Lasso path problem given below:   1 2 ||y − Xb − X̃ b̃||2 + λ(||b||1 + ||b̃||1 ) , (β̂(λ), β̃(λ)) = argmin 2 (b,b̃) Zj = sup{λ : β̂j (λ) 6= 0}, Z̃j = sup{λ : β̃j (λ) 6= 0}. The final step is to run the knockoff+ selection procedure at level q   1 + #{j : Wj ≤ −t} T , min t > 0 : ≤ q , Ŝ , {j : Wj ≥ T } . #{j : Wj ≥ t} ∨ 1 (3) The main result in [3] is that such procedure controls exact FDR " # #{j ∈ Ŝ : βj = 0} F DR , E ≤ q, ∀q ∈ (0, 1) . #{j ∈ Ŝ} ∨ 1 A knockoff filter for high-dimensional selective inference and model free knockoffs have been recently established in [4, 5]. This research has inspired a number of follow-up works, such as [6, 7, 9, 14–16]. The power (the proportion of true discoveries) of the knockoff filter depends critically on the value of si . In [6], we perform some analysis and numerical experiments on the knockoff filter to understand how (1) and (2) impose a constraint on si when the features are correlated. Our analysis shows that si could be small for strongly correlated features. On the other hand, for strongly correlated features with a finite sample size, we simply do not have enough resolution in the data to tell which variables are responsible for the response. In this case, it is more appropriate to define clusters of these correlated variables and ask whether there is any signal in those clusters rather than trying to decide which variable within the cluster is truly significant. We note that a prototype knockoff filter based on group clustering of correlated data has been proposed in [14], and a group knockoff filter has been also proposed by Dai and Barber in [7] with exact FDR control. In [6], we also propose a PCA prototype group selection filter that achieves exact FDR control. Our PCA prototype group selection filter has the advantage of being more efficient and has higher power for correlated features. A localized knockoff filter has been proposed by Xu et al [16]. There are several other feature selection methods that offer some level of FDR control (e.g. [1, 2, 8, 10–13]). We refer to [3] for a thorough comparison between the knockoff filter and these other approaches. 1.2 Three classes of pseudo knockoff filters In this paper, we propose several pseudo-knockoff filters that inherit some advantages of the original knockoff filter and have greater flexibility in constructing their pseudo-knockoff matrix. In the pseudo knockoff filter, we seek to establish a weaker version of the exchangeability condition by relaxing the second condition in (1). The first condition that we impose on the pseudo knockoff filter is the following orthogonality condition: (X + X̃)T (X − X̃) = 0. 2 (4) It can be shown that this condition is equivalent to X T X = X̃ T X̃, X T X̃ = X̃ T X. In a linear model y = Xβ + ǫ, ǫ ∼ N (0, σ 2 In ), this orthogonality condition implies that the projection of ǫ onto span(X + X̃) and span(X − X̃) are independent. In this paper, we consider three classes of pseudo knockoffs. For the first class of pseudo knockoff filters, the pseudo knockoff matrix X̃ is chosen to be orthogonal to X, i.e. X T X̃ = X̃ T X = 0. We call this pseudo knockoff the orthogonal pseudo knockoff. It maximizes the difference between the pseudo knockoff matrix X̃ and its original design matrix X. Due to this orthogonality condition, we can always distinguish the original Xj and its pseudo knockoff X̃j , independent of the correlation structure of X. The second class of pseudo knockoff filters is called the block diagonal pseudo knockoff. We begin by constructing a block diagonal matrix B that satisfies the property B  Σ−1 . We can then solve for X̃ from the relationship B = 4[(X − X̃)T (X − X̃)]−1 . More specifically, we consider a −1 −1 −1 block diagonal matrix B = 2diag(S11 , S22 , ..., Skk ), where Sii ’s are invertible matrices. It can be shown that the condition (4) and the constraint B  Σ−1 imply that X T X = X̃ T X̃, X T X − X T X̃ = diag(S11 , S22 , ..., Skk ). (5) It is interesting to note that the pseudo knockoff matrix, X̃, in (5) is exactly a group knockoff matrix of X in [7]. Moreover, if we further impose Sii to be a diagonal matrix for i = 1, 2, ..., k, then X̃ is a knockoff matrix of X [3]. In this sense, we can consider the block diagonal pseudo knockoff filter as a generalization of the knockoff filter. We note that the group knockoff filter is designed for group selection while the block diagonal pseudo knockoff filter is designed for feature selection. The third class of the pseudo knockoff filter is called the banded knockoff filter by imposing B to be a banded matrix. The construction is similar to the case when B is a block diagonal matrix. 1.3 A half Lasso statistic We propose to use a half penalized method to construct our pseudo knockoff filter. More specifically, the pseudo knockoff statistic is based on the solution of the following half penalized optimization problem 1 (6) min ||y − X β̂ − X̃ β̃||22 + P (β̂ + β̃), β̂,β̃ 2 where P (x) is an even non-negative and non-decreasing function in each coordinate of x. An important consequence of the orthogonality condition (4) is that we can reformulate the half penalized problem into two sub-problems, i.e the minimization problem (6) is equivalent to the following minimization problem: ) ( ) ( 1 X − X̃ 1 X + X̃ ls || (β̂ + β̃ ls − β̂ − β̃)||22 + P (β̂ + β̃) + min || (β̂ ls − β̃ ls − (β̂ − β̃))||22 , min 2 2 2 2 β̂−β̃ β̂+β̃ where β ls and β̃ ls are the least squares coefficients by regressing y on the augmented feature matrix [X, X̃]. If we choose P ≡ 0, we recover the least squares method. If we choose P = λ|| · ||l1 , we obtain a half Lasso method, which we introduce in [6]. Once we solve the half penalized problem, we can construct the pseudo knockoff statistic as follows Wj , (β̂j + β̃j ) · sign(β̂j − β̃j ) or Wj = max (|β̂j |, |β̃j |) · sign(|β̂j | − |β̃j |). (7) We can show the following symmetry property of the pseudo knockoff filter. Conditional on some σ- field, we have for any threshold t that d #{j : βj = 0 and Wj ≥ t} = #{j : βj = 0 and Wj ≤ −t}. 3 (8) 1.4 Partial analysis of the pseudo knockoff filter The construction of our pseudo knockoff filter does not satisfy the exchangeability property, which is crucial for the knockoff filter in establishing exact FDR control by using a supermartingale argument [3]. In this paper, we provide some partial analysis for the pseudo knockoff filter by trying to establish the following expectation inequality:   #{j : Wj ≥ t, βj = 0} ≤1 (9) E #{j : Wj ≤ −t, βj = 0} + m for any fixed threshold t > 0 and some m ∈ N+ that depends on the pseudo knockoff matrix X̃. This inequality can be considered as an approximation to the corresponding expectation inequality for the knockoff filter:   #{j : Wj ≥ T, βj = 0} E ≤ 1, (10) #{j : Wj ≤ −T, βj = 0} + 1 for an adaptive threshold T . In this paper, we establish the expectation inequality (9) for the block diagonal and the banded pseudo knockoff filters. For the orthogonal pseudo knockoff filter, we use a probabilistic argument to obtain a relatively tight upper bound to the expectation in (9) for t = 0 when Σ−1 is diagonally dominated or when Σ−1 has some special structure. Interestingly, our analysis reveals that the decaying property of Σ−1 plays an important role in determining the performance of the pseudo knockoff filter and the knockoff filter. We also carry out a number of numerical experiments to test the performance of the three classes of pseudo knockoff filters and compare their performance with that of the knockoff filter. In the examples that we consider in this paper, we find that the three classes of pseudo knockoff filters with the half Lasso statistic have FDR control. The orthogonal pseudo knockoff filter seems to offer the most power among all other pseudo knockoff filters. In the case when the features are highly correlated and non-sparse (e.g. about 20% non-null features), the orthogonal pseudo knockoff filter offers more power than the knockoff filter with the OMP or Lasso Path statistic. In the extreme case when Σ−1 decays very slowly away from its main diagonal, the knockoff filter with the OMP or the Lasso Path statistic tends to lose considerable power. The orthogonal pseudo knockoff filter still offers reasonably high power in this case. The rest of the paper is organized as follows. In Section 2, we introduce the three classes of pseudo-knockoff filters and discuss some essential properties of the pseudo knockoff filters. In Section 3, we present a number of numerical experiments to demonstrate the effectiveness of the proposed methods. In Section 4, we provide some partial analysis of the pseudo knockoff filters and present additional numerical experiments to compare the performance of the pseudo knockoff filters with the knockoff filter using the OMP and the Lasso Path statistics. 2 2.1 A pseudo knockoff filter An expectation inequality In the knockoff filter, the exchangeability property is essential [3]. This important property allows one to apply a supermartingale argument to obtain the following expectation inequality   #{j : Wj ≥ T, βj = 0} ≤ 1, (11) E #{j : Wj ≤ −T, βj = 0} + 1 for an adaptive threshold T . The above estimate plays a crucial role in establishing exact FDR control of the knockoff filter [3]. Our motivation is to relax the second constraint in (1) in a way such that (11) is still approximately valid. In particular, we consider a modified version of (11) 4  #{j : Wj ≥ t, βj = 0} ≤1 E #{j : Wj ≤ −t, βj = 0} + m  (12) for any fixed threshold t > 0 and some m ∈ N+ that depends on the pseudo knockoff matrix X̃. To see how (12) relates to FDR control, we first define the pseudo knockoff+ adaptive threshold T as follows   #{j : Wj ≤ −t} + m ≤q . (13) Tm , min t : #{j : Wj ≥ t} ∨ 1 By the definition of Tm , we have     #{j ∈ S0 : Wj ≥ T } #{j ∈ S0 : Wj ≥ T } #{j ∈ S0 : Wj ≤ −T } + m F DR , E · =E #{j : Wj ≥ T } ∨ 1 #{j ∈ S0 : Wj ≤ −T } + m #{j : Wj ≥ T } ∨ 1   #{j : Wj ≥ T, βj = 0} ≤q·E , #{j : Wj ≤ −T, βj = 0} + m (14) where S0 = {j : βj = 0}. For m = 1, (11) and (14) establish FDR control of the knockoff filter. One may consider (12) as an approximation of (11). Our numerical study shows that when (12) is valid, (11) is approximately valid and we have FDR control for the pseudo knockoff filter. However, (12) alone does not give exact FDR control since Tm is a random variable. 2.2 The Basic Constraint and a Symmetry Property The basic constraint of the pseudo knockoff matrix is given by X̃ T X̃ = X T X, X T X̃ = X̃ T X. (15) The correlation structure and the commutativity imply (X + X̃)T (X − X̃) = X T X + X̃ T X − X T X̃ − X̃ T X̃ = 0. (16) We can prove that (15) and (16) are equivalent. If (16) holds, we have X T X−X̃ T X̃ = X T X̃ −X̃ T X. Note that the right hand side is a symmetric matrix, while the left hand side is a skew-symmetric matrix. It follows that X T X − X̃ T X̃ is symmetric and skew-symmetric. Thus we must have X T X − X̃ T X̃ = 0, which further implies X T X̃ − X̃ T X = 0. These two equations establish (15). The orthogonality condition (16) is the foundation of the pseudo knockoff filter and leads to a symmetry property of the pseudo knockoff filter. Least squares coefficients mented design matrix [X X̃] Consider the least squares coefficients of regressing y on the aug- y ∼ X β̂ ls + X̃ β̃ ls = X − X̃ ls X + X̃ ls (β̂ + β̃ ls ) + (β̂ − β̃ ls ). 2 2 Using y = Xβ + ǫ and the orthogonality condition (16), we have a simple expression of the least squares coefficients, " #T " #−1 !   ls X+X̃ T ls X + X̃ X − X̃ X − X̃ X + X̃ ( ) ǫ β̂ + β̃ − β 2  , , = 2 2 2 2 β̂ ls − β̃ ls − β ( X−2 X̃ )T ǫ (17)  h  i−1  (1)  ( X+2 X̃ )T X+2 X̃ ( X+2 X̃ )T ǫ , ǫ i−1 = h . ǫ(2) ( X−2 X̃ )T X−2 X̃ ( X−2 X̃ )T ǫ 5 The above relationship will be used repeatedly throughout the paper. Denote η , β̂ ls + β̃ ls = β + ǫ(1) , ξ , β̂ ls − β̃ ls = β + ǫ(2) . (18) From the orthogonality property (16), we know that ( X+2 X̃ )T ǫ and ( X−2 X̃ )T ǫ have independent multivariate normal distributions. Using (17), we know that ǫ(1) and ǫ(2) , η = β̂ ls + β̃ ls and ξ = β̂ ls − β̃ ls are also independent. The Pseudo Knockoff Statistic Similar to the knockoff filter process, we construct a pseudo knockoff statistic for each pair of the original feature Xj and its pseudo knockoff X̃j . Consider a half penalized optimization problem 1 min ||y − X β̂ − X̃ β̃||22 + P (β̂ + β̃). β̂,β̃ 2 (19) Denote by r the residue of regressing y onto the augmented design matrix [X X̃], i.e. r = y − X β̂ ls − X̃ β̃ ls . The geometric property of the least squares method implies r ⊥ X, X̃, which leads to ||y − X β̂ − X̃ β̃||22 = ||r + X β̂ ls + X̃ β̃ ls − X β̂ − X̃ β̃||22 = ||r||22 + ||X β̂ ls + X̃ β̃ ls − X β̂ − X̃ β̃||22 . Using the orthogonality condition (X + X̃)T (X − X̃) = 0 and the fact that r is independent of β̂, β̃, we can exclude the residue r from the optimization problem (19) and reformulate it as follows 1 1 1 min ||y − X β̂ − X̃ β̃||22 + P (β̂ + β̃) = min ||r||22 + ||X β̂ ls + X̃ β̃ ls − X β̂ − X̃ β̃||22 + P (β̂ + β̃) 2 β̂,β̃ 2 β̂,β̃ 2 1 ⇐⇒ min ||X β̂ ls + X̃ β̃ ls − X β̂ − X̃ β̃||22 + P (β̂ + β̃) β̂,β̃ 2 ) ) ( ( 1 X − X̃ ls 1 X + X̃ ls ls 2 ls 2 || (β̂ + β̃ − β̂ − β̃)||2 + P (β̂ + β̃) + || (β̂ − β̃ − (β̂ − β̃))||2 = min 2 2 2 2 β̂,β̃ ( ) ( ) 1 X + X̃ ls 1 X − X̃ ls ls 2 ls 2 ⇐⇒ min || (β̂ + β̃ − β̂ − β̃)||2 + P (β̂ + β̃) + min || (β̂ − β̃ − (β̂ − β̃))||2 , 2 2 2 2 β̂+β̃ β̂−β̃ (20) ls ls where β̂ and β̃ are the least squares coefficients given in (17). It is easy to derive that the solution of these problems can be expressed as β̂ + β̃ = f (β̂ ls + β̃ ls ) = f (η), β̂ − β̃ = β̂ ls − β̃ ls = ξ , (21) for some function f : Rp → Rp . We construct the pseudo knockoff statistic as follows Wj , (β̂j + β̃j ) · sign(β̂j − β̃j ) or Wj = max (|β̂j |, |β̃j |) · sign(|β̂j | − |β̃j |). (22) The pseudo knockoff statistic satisfies the following two properties. Amplitude Property The amplitude of W is decided by β̂ + β̃ = f (η) and |β̂ − β̃| = |ξ|. In fact, using the definition of W and (21), we have |W | = |β̂ + β̃| = |f (η)| or 1 |W | = |β̂| ∨ |β̃| = (|β̂ + β̃ + |β̂ − β̃|| ∨ |β̂ + β̃ − |β̂ − β̃||). 2 Sign Property The sign of W is determined by sign(β̂ + β̃) and sign(β̂ − β̃). Since sign(|β̂|− |β̃|) = sign(|β̂|2 − |β̃|2 ), we have sign(W ) = sign(β̂ + β̃) · sign(β̂ − β̃) = sign(f (η)) · sign(ξ), for both definitions of W . Now we show that the pseudo knockoff statistic satisfies a symmetry property. 6 Proposition 2.1. (The Symmetry Property of the Pseudo Knockoff Statistic) Conditional on η, we have for any threshold t that d #{j : βj = 0 and Wj ≥ t} = #{j : βj = 0 and Wj ≤ −t}, (23) where the pseudo knockoff statistic Wj is defined in (22). Proof. According to (18) and (21), the solution of the half penalized problem can be expressed as β̂ + β̃ = f (η) = f (β + ǫ(1) ), (ǫ(1) , ǫ(2) ) (ǫ(1) , −ǫ(2) ) β̂ − β̃ = ξ = β + ǫ(2) . Next, we replace by to generate a new pair of solutions (2) (2) From (18), changing ǫ to −ǫ does not change η. Thus, we obtain β̂ new + β̃ new = f (η) = β̂ + β̃, From (24) and (25), we have (24) (β̂ new , β̃ new ). β̂ new − β̃ new = β − ǫ(2) . (β̂ new + β̃ new )S0 = f (η)S0 = (β̂ + β̃)S0 , (2) (β̂ new − β̃ new )S0 = (β − ǫ(2) )S0 = −ǫS0 = −(β̂ − β̃)S0 , (25) (26) where S0 , {j : βj = 0}. The amplitude and sign property of W imply |WSnew | = |WS0 | and 0 sign(WSnew ) = sign((f (η))S0 · (−ξ)S0 ) = −sign((f (η))S0 · (ξ)S0 ) = −sign(WS0 ). 0 Hence WSnew = −WS0 . 0 Recall that WS0 is generated by ǫ(1) , ǫ(2) and that ǫ(1) , ǫ(2) have independent multivariate normal distributions with zero mean. Conditional on η (or equivalently ǫ(1) ), we have d d (ǫ(1) , ǫ(2) ) = (ǫ(1) , −ǫ(2) ) =⇒ WS0 = WSnew = −WS0 . 0 (27) As a result, conditional on η, we get d #{j : βj = 0 and Wj ≥ t} = #{j : βj = 0 and Wj ≤ −t}, for any threshold t > 0.  Pseudo knockoff least squares and half Lasso statistics We give two examples of the pseudo knockoff statistics. The least squares statistic Let P ≡ 0 in (20). The half penalized problem becomes the least squares problem of the response y and the augmented design matrix [X X̃]. A half Lasso statistic In [6], we introduce a half penalized method for the knockoff filter. The derivation in (20) implies that we can also apply this idea to the pseudo knockoff filter. Specifically, we choose P (x) = λ||x||1 in (20) to obtain a half Lasso statistic: 1 min ||y − X β̂ − X̃ β̃||22 + λ||β̂ + β̃||1 . β̂,β̃ 2 Let β̂, β̃ be the solution of the least squares or the half Lasso problem and we define the pseudo knockoff statistic Wj = |β̂j + β̃j |sign(β̂ − β̃) or Wj , max(|β̂j |, |β̃j |)·sign(|β̂j |−|β̃j |). The symmetry property (23) of these statistics is guaranteed by Proposition 2.1. The tuning parameter λ can be determined by a projection 1 λ=µ· √ ||U T y||2 , n − 2p where U ∈ Rn×(n−2p) is an orthonormal matrix such that [X X̃]T U = 0 and µ is a parameter that we can choose empirically. In fact, U T y is exactly the residue of regressing y onto [X X̃]. One can verify the symmetry property of the pseudo knockoff statistic with this tuning parameter using a similar argument. 7 2.3 Three Classes of the Pseudo Knockoff Matrix We have proposed the basic constraint (15) for the pseudo knockoff matrix in the last section. In this section, we impose an additional constraint on X̃ so that we can establish an additional property on the pseudo knockoff statistic. In particular, we are interested in three classes of pseudo knockoff matrices, namely the orthogonal, the block diagonal, and the banded pseudo knockoff matrices. 2.3.1 An Orthogonal Construction In this special pseudo knockoff filter, we impose an orthogonal constraint on the second condition of (15) X T X = X̃ T X̃, X T X̃ = X̃ T X = 0 (28) to yield the orthogonal pseudo knockoff matrix. To construct an orthogonal pseudo knockoff matrix X̃, we first find the SVD of X ∈ Rn×p : X = U DV T , U ∈ Orthn×p , D = diag{σ1 , ..., σp } and V ∈ Orthp×p . We then choose any orthonormal matrix W ∈ Rn×p , whose column space is orthogonal to that of X (i.e. X T W = 0), and construct the pseudo knockoff matrix X̃ as X̃ = W DV T . It is easy to verify that X̃ satisfies the pseudo matrix condition (28). 2.3.2 A Block Diagonal Construction It follows from (17) and (18) that the covariance matrix of ǫ(2) , or equivalently ξ, is given by B , 4[(X − X̃)T (X − X̃)]−1 . (29) We can design B to yield a special correlation structure on ξ. Due to the existing constraint (15) or (16), the covariance matrix B cannot be chosen arbitrarily. Below we give a necessary and sufficient condition on B to find X̃ that satisfies (16) and (29). Necessary Condition on B Assume that there exists some X̃ that satisfies (16) and (29) and X − X̃ has full rank. Performing SVD on (X − X̃)/2, we have (X − X̃)/2 = PM−1 for some orthonormal matrix P ∈ Rn×p and some invertible matrix M ∈ Rp×p . As a result, we get B = [(PM−1 )T (PM−1 )]−1 = MMT and X̃ = X − 2PM−1 . Substituting the last equation into the orthogonal condition (X + X̃)T (X − X̃) = 0 (16), we obtain 4(X − PM−1 )T PM−1 = 0 Since P ∈ Rn×p ⇐⇒ M−1 = P T X is orthonormal, we have ⇐⇒ =⇒ X T P P T X  X T IX = X T X = Σ =⇒ M−T M−1 = M−T PT X B = (X T P P T X)−1 . B = (X T P P T X)−1  Σ−1 . (30) Sufficiency We prove that the condition (30) on B is sufficient to find a X̃ that satisfies (16) (or (15)) and (29). To see this, we construct X̃ as follows X̃ = X(I − 2Σ−1 B−1 ) + 2UCB−1 (31) where C ∈ Rp×p satisfies CT C = B − Σ−1 and U ∈ Rn×p is an orthonormal matrix with UT X = 0. We can verify that X̃ constructed from (31) satisfies (16) and (29) in the Appendix. −1 −1 −1 ), A Block Diagonal Construction Consider a block diagonal matrix B = 2diag(S11 , S22 , ..., Skk where Sii ’s are invertible matrices. The constraint on B is equivalent to 2B−1 = diag(S11 , S22 , ..., Skk )  2Σ. (32) Hence (X − X̃)T (X − X̃) = 4B−1 = 2diag(S11 , S22 , ..., Skk ). Using this relationship together with the basic constraint (15), i.e. X T X = X̃ T X̃, X T X̃ = X̃ T X, we obtain X T X = X̃ T X̃, X T X − X T X̃ = diag(S11 , S22 , ..., Skk ). 8 (33) Construction Assume that X can be clustered into (XG1 , XG2 , ..., XGk ), |Gi | = gi . Inspired by the group knockoff construction in [7], we first choose Sii as T Sii , γΣGi ,Gi = γXG XGi , i = 1, 2, ..., k. i The constraint (32) implies γ · diag(ΣG1 ,G1 , ΣG2 ,G2 , ..., ΣGk ,Gk )  2Σ. In order to maximize the difference between X and X̃, γ should be chosen as large as possible: γ ≤ min{1, 2 · λmin (DΣD)}, −1/2 −1/2 −1/2 where D = diag(ΣG1 ,G1 , ΣG2 ,G2 , ..., ΣGk ,Gk ). To ensure that the matrix (X + X̃)T (X + X̃) is 1 min{1, 2 · λmin (DΣD)} in our numerical experiments. Once we nonsingular, we choose γ = 1.2 construct B, we can generate the pseudo knockoff matrix via the procedure described earlier. Connection between the pseudo knockoff filter and the knockoff filter. By comparing our block diagonal pseudo knockoff construction with the group knockoff filter in [7], we can see that the pseudo knockoff matrix, X̃, in (33) is actually a group knockoff matrix of X. Moreover, if Sii is a diagonal matrix for i = 1, 2, .., k, then X̃ is a knockoff matrix of X [3]. Recall that the second constraint in (1) in the original knockoff filter requires that X T X − X T X̃ be a diagonal matrix. In the block diagonal pseudo knockoff filter, we only requite that X T X − X T X̃ be a block diagonal matrix. In this sense, we can consider the block diagonal construction of the pseudo knockoff filter as a generalization of the group knockoff matrix proposed by Dai-Barber in [7]. The group knockoff filter is originally designed for group selection with group FDR control while our block diagonal pseudo knockoff filter is designed for feature selection. We will show that the pseudo knockoff filter with the block diagonal construction satisfies (12) and provide some partial analysis of this method later on. Our numerical experiments seem to suggest that this method works reasonably well. 2.3.3 A Banded Matrix Construction Consider a banded matrix B with band width m, i.e. Bij = 0 if |i − j| > m. We are mostly interested in m = 2. The other cases can be handled similarly. There are many approaches to construct B that satisfy B  Σ−1 . We propose one of these approaches and outline the main steps as follows. Extract the tri-diagonal elements of Σ−1 , i.e.  (Σ−1 )11 (Σ−1 )12  .. ..  (Σ−1 )21 . .  D, . . .. ..  (Σ−1 )p−1,p −1 (Σ )p,p−1 (Σ−1 )pp Step 1: Extraction     .   In general, D is not a positive definite matrix. We need to modify the diagonal elements of D to get a positive definite matrix. Step 2: Modification of D We consider the following modification of D: e ii = Dii + D D2i,i+1 , i = 1, 2, ..., p − 1, Di+1,i+1 e pp = Dpp , D e ij = Dij , ∀i 6= j. D e is positive definite, we consider vT Dv e for an arbitrary vector v 6= 0 ∈ Rp . To see that D ! p−1 p−1 X X D2i,i+1 T e Di,i+1 vi vi+1 + Dpp vp2 vi2 + 2 Dii + v Dv = Di+1,i+1 i=1 i=1 ! p−1 2 X D i,i+1 2 Di+1,i+1 vi+1 + = v2 + 2Di,i+1 vi vi+1 + D11 v12 Di+1,i+1 i i=1 9 = p−1 X i=1 1 Di+1,i+1 (Di,i+1 vi + Di+1,i+1 vi+1 )2 + D11 v12 > 0, ∀ v 6= 0. e is positive definite, we take Step 3: Construction of B Since D e −1/2 Σ−1 D e −1/2 ) · D, e B , τ λmax (D e −1/2 Σ−1 D e −1/2 )I  D e −1/2 Σ−1 D e −1/2 , we have where τ ≥ 1 is a parameter. Since λmax (D e 1/2 · λmax (D e −1/2 Σ−1 D e −1/2 )I · D e 1/2  D e 1/2 · D e −1/2 Σ−1 D e −1/2 · D e 1/2 = Σ−1 . B = τD e T (X + X) e is nonsingular. In our numerical experiments, we choose τ = 1.2 to ensure that (X + X) Remark 1. For some design matrices with a special correlation structure, we can use a different construction to increase the difference between X and X̃. If X can be clustered into a number of groups such that the between-group correlation is weak, we can utilize the block diagonal construction. If the correlation between Xi , Xj decreases rapidly as |i − j| increases, we can adopt the banded construction to increase the difference between X and X̃. Independence Let m be the largest block size of B in the block diagonal construction or the band width in the banded construction. Since the covariance matrix of ξ = β̂ ls − β̃ ls is B, we can divide ξi , 1 ≤ i ≤ p into m groups C1 , C2 , ..., Cm such that the random variables in the same group are mutually independent. For the block diagonal construction, Ci consists of the i-th element in each block if there exists such an element. For the banded construction, Ci , {j : j ≡ i(mod m), 1 ≤ j ≤ p}. It is easy to verify that the random variables within each group are independent. 2.4 A theoretical result for the expectation inequality In this section, we prove (12) for the pseudo knockoff statistic that is constructed using either a block diagonal or a banded matrix construction. Theorem 2.2. Assume that the pseudo knockoff matrix is generated via a block diagonal or a banded construction and the pseudo knockoff statistic is defined as W , (β̂ + β̃) · sign(β̂ − β̃). For any t > 0, we have   #{j ∈ S0 : Wj ≥ t} ≤1, (34) E #{j ∈ S0 : Wj ≤ −t} + m where m is the largest group size in the block diagonal construction or the band width in the banded construction. When m = 1, (34) replicates a result similar to (11). Proof. Let F be the σ-field generated by η. Since |W | = |f (η)| by our choice of W , conditional on η, we can determine |W | and Nt , {j ∈ S0 : |Wj | ≥ t}. We will show that the conditional expectation satisfies   #{j ∈ S0 : Wj ≥ t} E F ≤ 1. (35) #{j ∈ S0 : Wj ≤ −t} + m Once we obtain (35), we can integrate both sides to obtain (34). From our previous discussion, we can divide Nt into m groups C1P , C2 , ..., Cm (Ci ⊂ S0 ) such that the elements of ξCi are mutually independent. Obviously, |Nt | = ki=1 |Ci |. Using the following Cauchy-Schwarz inequality m m X a2 X i i=1 bi i=1 m X 1 ai )2 ⇐⇒ Pm bi ≥ ( i=1 i=1 ai i=1 10 Pm ai ≥ Pi=1 , a i , bi > 0 , m bi i=1 bi m X a2 i with ai = |Ci | + 1, bi = #{j ∈ Ci : Wj ≤ −t} + 1, we obtain     #{j ∈ S0 : Wj ≥ t} |Nt | + m F = E Pm E F −1 #{j ∈ S0 : Wj ≤ −t} + m i=1 (#{j ∈ Ci : Wj ≤ −t} + 1) " # m X (|Ci | + 1)2 1 ≤E F −1 |Nt | + m #{j ∈ Ci : Wj ≤ −t} + 1 i=1   m X |Ci | + 1 |Ci | + 1 E F −1 = |Nt | + m #{j ∈ Ci : Wj ≤ −t} + 1 i=1    m X #{j ∈ Ci : Wj ≥ t} |Ci | + 1 = 1+E F − 1. |Nt | + m #{j ∈ Ci : Wj ≤ −t} + 1 (36) i=1 Here, we use #{j ∈ Ci : Wj ≤ −t} + 1 + #{j ∈ Ci : Wj ≥ t} = |Ci | + 1 to obtain the first and the last equality, and use the fact that |Nt |, |Ci | are measurable w.r.t F to yield the second equality. Note that ξ and η are independent, sign(ξj ), j ∈ Ci are mutually independent, and ξS0 have mean zero multivariate normal distributions. Conditional on F, sign(Wj ) = sign(f (η)j )sign(ξj ), j ∈ Ci are independent and thus sign(Wj ), j ∈ Ci obeys a binomial distribution. We yield     #{j ∈ Ci : Wj ≥ t} #{j ∈ Ci : Wj > 0} E F =E F ≤ 1. (37) #{j ∈ Ci : Wj ≤ −t} + 1 #{j ∈ Ci : Wj < 0} + 1 Therefore, the last line in (36) is bounded by m −1+ X 2 1 2(|Ci | + 1) = −1 + · (|Nt | + m) = 1 . |Nt | + m |Nt | + m (38) i=1 Combining (36) with (38) yields (35). Finally, we integrate both sides of (35) to conclude the proof.  Remark 2. In order to control the expectation in (34) by 1, we consider the conditional expectation (35) and add the maximal group size m (or the band width in the banded construction) in the denominator. We show that this is optimal. Let us consider the block diagonal construction with β = 0 (no signal). Recall that the covariance matrix of ξ is block diagonal, i.e. B = diag(D11 , D22 , ..., Dkk ) . Assume that the size of each block is m and the off-diagonal elements of Dii are close to the diagonal elements. Accordingly, ξi , ξj are strongly correlated if i, j are in the same block or are independent if i, j come from different blocks. Let t = 0 in (35). Conditional on η, we have sign(Wj ) = sign((f (η))j )sign(ξj ). If sign((f (η))j )’s are the same in each block, i.e. sign((f (η))i,j ) = sign((f (η))i,l ), we yield Z1 , p X i=1 1Wi >0 = m k X X i=1 j=1 1Wi,j >0 = m k X X i=1 j=1 1ξi,j ·(f (η))i,j >0 ≈ m k X i=1 1ξi,1 ·(f (η))i,1 >0 = m k X 1Wi,1 >0 . i=1 Here, ξi,j and Wi,j are the j-th element in block i. In the above derivation, we have used that ξi , ξj P are strongly correlated if i, j are in the same block. Similar analysis can be applied to Z2 , pi=1 1Wi <0 . Plugging these estimates into the expectation, we obtain " # " Pk # P m ki=1 1Wi,1 >0 1 Z1 W >0 i,1 i=1 E( F) ≈ E F =E F . P P Z2 + m m + m ki=1 1Wi,1 <0 1 + ki=1 1Wi,1 <0 Since ξi,1 are mutually independent with mean 0, 1Wi,1 >0 are i.i.d and obeys a binomial distribution. Thus, the expectation on the right hand side is 1 − 2−k . Consequently, for any m̃ < m, it is likely that the expectation E(Z1 /(Z2 + m̃) F) exceeds 1. 11 In the above analysis, we rely on the fact that the amplitude of WS0 and sign(WS0 ) are controlled by independent random variables η, ξ. In our numerical experiments, we find that the signed max statistic, i.e. W = |β̂| ∨ |β̃| · sign(|β̂| − |β̃|), is more powerful than the statistic in (34). To establish (34) for the signed max statistic, we cannot apply the same argument since the amplitude of WS0 depends on η and |ξS0 |. If the pseudo knockoff matrix is generated by the block diagonal construction, we have the following result. Theorem 2.3. Assume that the pseudo knockoff matrix is generated by the block diagonal construction. For any t > 0, (34) is true for the signed max statistic. Proof. From the amplitude property of the signed max statistic, |WS0 | depends on η, |ξS0 |. Let F be the σ-field generated by η and |ξS0 |. In the following, we will use the same notations Nt , Ci (Ci ⊂ S0 ) as in the proof of Theorem 2.2. Note that (36) does not rely on the independence of ξCi . Based on the previous proof, we only need to verify (37). For the block diagonal construction, the elements of Ci come from different blocks. Note that (2) (2) V ar(ξ) = B = diag(S11 , S22 , ..., Skk ) and ξS0 = ǫS0 (see (18)). We can change the sign of ǫS0 in any (2) block Si1 i1 , Si2 i2 , ..., Sij ij without changing |ξS0 | and the joint distribution of ǫS0 . Consequently, conditional on F, the elements of sign(ξCi ) are mutually independent. Using the independence of sign(ξCi ) together with the sign property of W , we conclude that the elements of sign(WCi ) are i.i.d random variables satisfying P (sign(WCi ,j ) = 1) = P (sign(WCi ,j ) = −1) = 1/2. Finally, conditional on F, #{j ∈ Ci : Wj ≥ t} ∼ Binomial(|Ci |, 1/2) and #{j ∈ Ci : Wj ≤ −t} = |Ci | − #{j ∈ Ci : Wj ≥ t} imply (37).  Variance of the numerator We show that the variance of the numerator in (34) for t = 0+ is O(mp). Denote N0 , {j ∈ S0 : (f (η))j 6= 0}. By definition, N0 is determined by η. Based on the sign property of W and the fact that ξ is a multi-normal random variable, conditional on η, N0 = {j ∈ S0 : Wj 6= 0} and {j ∈ S0 : Wj > 0} = {j ∈ N0 : Wj > 0} almost surely. For the block diagonal or banded pseudo knockoff, we can divide N0 into m groups C1 , C2 , ..., Cm (Ci ⊂ S0 ) such that the elements of ξCi are mutually independent. Applying the Cauchy-Schwarz inequality yields m m X X V ar(#{j ∈ Ci : Wj > 0} η) #{j ∈ Ci : Wj > 0} η) ≤ m V ar(#{j ∈ S0 : Wj > 0} η) = V ar( i=1 i=1 m X m X X X m|N0 || 1 )= = O(mp). (39) ( V ar(1Wj >0 |η)) = m ( =m 4 4 i=1 j∈Ci i=1 j∈Ci To obtain the second and the third equality, we apply a property of Wj in the proof of Theorem 2.2 and Theorem 2.3 that sign(Wj ), j ∈ Ci are i.i.d conditional on η with P (sign(Wj ) = 1|η) = P (sign(Wj ) = −1|η) = 1/2. It is interesting to perform a similar variance estimate for the knockoff filter. Since the knockoff statistic W has the property that sign(Wj ), j ∈ S0 are i.i.d conditional on |W | with P (sign(Wj ) = 1|F) = P (sign(Wj ) = −1|F) = 1/2, we obtain V ar(#{j ∈ S0 : Wj > 0} F) = |S0 |/4 = O(p), where F is the σ- field generated by |W |. 3 Numerical results for the pseudo knockoff filter In this section, we perform a number of numerical experiments to test the robustness of the pseudo knockoff filter and study the performance of various methods. Default Setting 12 i.i.d Notations. βi ∼ {±A} means that βi takes value A or −A independently with equal probability 1/2. We denote the orthogonal pseudo knockoff, the pseudo knockoff with the block diagonal construction, and the pseudo knockoff with the banded construction as orthogonal, block diagonal and banded. Data Throughout all simulations, the noise ǫ ∈ Rn is a standard Gaussian, i.e. ǫ ∼ N (0, In ). Given some covariance matrix Σ, we first draw the rows of the design matrix X ∈ Rn×p from a multivariate normal distribution N (0, Σ), and then normalize the columns of X. The pseudo knockoff matrix (orthogonal, block diagonal or banded) is generated according to Section 2.3; the knockoff matrix is generated by the standard SDP construction in [3]. To generate the signal i.i.d strength β ∈ Rp , we choose k coefficients βi1 , βi2 , ..., βik randomly and set βij ∼ {±A}.Finally, the response variable y ∈ Rn is generated from y = Xβ + ǫ. Without specification, the sample size is p = 500, n = 1500, the sparsity is k = 30, the signal amplitude is A = 3.5 and the covariance matrix is Σ = Ip . Pseudo Knockoff+ Threshold We introduce the pseudo knockoff+ adaptive threshold Tm in (13) and discuss how (13) and (12) contribute to the FDR control. In Remark 2, we argue that the inequality (12) is tight in some extreme case. In general, adding m to the denominator is an over-estimate. Our numerical study indicates that we can replace m by 1 and the associated expectation is still close to 1 in the numerical examples that we consider in this paper. In the following numerical experiments, we choose T1 as the adaptive threshold to select features. We note that this criterion is exactly the same as the original knockoff+ adaptive threshold. The nominal FDR level in the definition of T1 is q = 20%. Metrics We use the following metrics to study the robustness of various methods: the FDR (the mean false discovery proportion), the power (the proportion of true discoveries) and the expectation, which is defined as the mean of #{j : Wj ≥ T1 & βj = 0} . #{j : Wj ≤ −T1 & βj = 0} + 1 (40) Methods The methods that we focus on include the orthogonal, the block diagonal, the banded pseudo knockoff filters with the half Lasso statistic (λ = 0.75), and the knockoff filter with the orthogonal matching pursuit (OMP) statistic [3]. The reason we choose the OMP statistic for the knockoff filter is because the OMP statistic seems to give the most robust performance among other knockoff statistics from our numerical study in this paper and in [6]. For the banded pseudo knockoff filter, we construct Wj = (β̂j + β̃j ) · sign(β̂j − β̃j ); for the other methods, we use the signed max statistic, i.e. Wj = |β̂j | ∨ |β̃j | · sign(|β̂j | − |β̃j |). 3.1 Numerical evidence of FDR control for the pseudo knockoff filter In this subsection, we perform extensive numerical experiments to test whether the pseudo knockoff filter has FDR control. For this purpose, we apply it to select features in the linear model y = Xβ+ǫ with different design matrices under various extreme conditions. The default simulated data is discussed at the beginning of Section 3 and we vary one of the default settings in each experiment as follows (one setting is varied while keeping the others unchanged). (a) Sparsity: k varies from 10, 20, 30, ..., 90, 100. (b) Signal amplitude: A varies from 2.8, 2.9, ..., 4.2. (c) Correlation Structure: We use the covariance matrix Σ ∈ R500×500 , Σij = ρ|i−j| and vary the correlation level ρ = 0, 0.1, ..., 0.9. (d) The sample size: We vary the sample size n = 150l, p = 50l and sparsity k = 10l with l ∈ {2, 3, ..., 12}. 13 FDR Expectation Power(%) Group Structure: We consider a design matrix X ∈ R1500×500 with a group structure. Specifically, we assume that the features Xj can be clustered into 100 groups with 5 features in each group. To generate a different group structure, we choose the covariance matrix Σii = 1, Σij = ρ for i 6= j in the same group and Σij = γ · ρ for i 6= j in different groups and generate the design matrix X as in the previous discussion. (e) The within-group correlation: γ = 0 is fixed and ρ varies from 0, 0.1, 0.2, ..., 0.9. (f ) The between-group correlation: ρ = 0.5 is fixed and γ varies from 0, 0.1, 0.2, ..., 0.9. We test the orthogonal, banded, and block diagonal pseudo knockoff filters and pay particular attention to the FDR control, the power and the expectation (mean of the ratio defined in (40)). Each experiment is repeated 200 times to calculate the mean FDR, the mean power, and the expectation. The design matrix X and the pseudo knockoff matrices X̃ are fixed over these trials. 80 80 80 60 60 60 40 40 40 20 20 20 0 0 0 1 1 1 0.8 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.15 0.15 0.15 0.1 0.1 0.1 0.05 0.05 0.05 10 40 70 100 2.8 Sparsity k 3.1 3.4 3.7 4 Orthogonal Banded Block Diagonal 0 0.2 Signal amplitude A 0.4 0.6 Correlation ρ 0.8 FDR Expectation Power(%) Figure 1: Testing the orthogonal, the banded, and the block diagonal pseudo knockoff+ at a nominal FDR q = 20% by varying sparsity, the signal amplitude, or the feature correlation. 80 80 80 60 60 60 40 40 40 20 20 20 0 0 0 1 1 1 0.8 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0.2 0.15 0.15 0.15 0.1 0.1 0.1 0.05 0.05 0.05 100 200 300 400 500 Number of feature p 600 0 0.2 0.4 0.6 0.8 Within−group correlation ρ Orthogonal Banded Block Diagonal 0 0.2 0.4 0.6 0.8 Between−group correlation γ Figure 2: Testing the orthogonal, the banded, and the block diagonal pseudo knockoff+ at a nominal FDR q = 20% by varying one of the following: the number of features p, the within-group correlation, and the between-group correlation. The dotted line in Figure 1 and Figure 2 represents the prescribed FDR q or constant 1 as a 14 reference. In all figures, we observe that the FDR is controlled by the nominal level q = 20%. From the results of the expectation, we observe that all of them are close to or less than 1, which can be explained by Theorem 2.2, though the definition of this expectation (averaged ratio defined in (40)) is different from that in (34). Meanwhile, the orthogonal pseudo knockoff+ offers more power than the banded and the block diagonal pseudo knockoff filters. We have also applied the least squares statistic in these experiments. For the banded and the block diagonal pseudo knockoff+, we observe that the least squares statistic controls FDR. For the orthogonal pseudo knockoff, if ξi are strongly correlated (covariance matrix is 2(X T X)−1 ), the least squares statistic is not robust and cannot control FDR. By adding a half penalized term in (19), the performance of the half Lasso statistic is more robust than that of the least squares statistic. We will provide some partial analysis of the orthogonal pseudo knockoff later on. 3.2 The pseudo knockoff filter in some correlated scenarios In the correlated case, the diagonal matrix diag(s) in the original knockoff filter constrained by (2) is small and leads to poor performance of the knockoff filter. A main advantage of the pseudo knockoff filter is that it relaxes the constraint of X̃ in (15). In some correlated scenarios with a special structure, we can construct the pseudo knockoff matrix adapting to such structure and improve the power. To illustrate the effectiveness of the pseudo knockoff filter+, we perform a comparison between the knockoff filter and the pseudo knockoff filter. Methods We use the representative statistics that give the most robust performance in both the knockoff filter and the pseudo knockoff filter based on our numerical experiments for the examples that we consider. Specifically, we compare the knockoff filter with the OMP statistic with the pseudo knockoff with the half Lasso statistic (λ = 0.75). FDR Power(%) Group Structure We consider a design matrix X ∈ R1500×500 with a group structure. In particular, we consider experiment (e) in Section 3.1. The within-group correlation factor ρ varies from 0.5, 0.55, 0.6, ..., 0.95 and the between-group correlation factor is γ = 0. We use a slightly larger signal amplitude A = 5 and consider two sparsity cases: k = 30 and k = 100. In all other settings, we use the default values. By taking advantage of the a priori knowledge of the correlation structure of X, we use the block diagonal pseudo knockoff filter. We choose m = 5 in our construction of the block diagonal pseudo knockoff matrix. We also compare the orthogonal pseudo knockoff using the half Lasso statistic with the knockoff filter using the OMP statistic. 100 100 80 80 60 60 40 40 20 20 0 0.2 0 0.2 0.1 0.1 0 0.5 0.6 0.7 0.8 0 0.5 0.9 Sparsity k=30, Within−group Corr ρ Orthogonal Block Diagonal Knockoff OMP 0.6 0.7 0.8 0.9 Sparsity k=100, Within−group Corr ρ Figure 3: Comparing the orthogonal, the block diagonal pseudo knockoff filter and the knockoff filter with the OMP statistic at nominal FDR q = 20% by varying the within-group correlation. In both figures, the pseudo knockoff filter controls FDR successfully. In the very sparse case 15 (left sub figure), the block diagonal pseudo knockoff filter is not as robust as the knockoff filter. Based on our analysis of the least squares statistic, we know that the half Lasso statistic favors the non-sparse case. We observe that it offers more power than the knockoff filter with the OMP statistic in the right figure where the sparsity is k = 100. FDR Power(%) Decaying Structure We consider a design matrix X ∈ R1500×500 with some decaying structure. Specifically, the design matrix X is generated from N (0, Σ) with Σij = ρ|i−j| , where ρ varies from 0.5, 0.55, ..., 0.95. We use a slightly larger signal amplitude A = 5 and consider two sparsity cases: k = 30 and k = 100. Other settings use the default values. We know a priori that the off-diagonal elements of Σ−1 decay rapidly, i.e. |(Σ−1 )i,j | → 0 as |i − j| increases. Thus, it makes sense to apply the banded pseudo knockoff filter. In addition, we apply the orthogonal pseudo knockoff and the knockoff with the OMP statistic for comparison. 100 100 80 80 60 60 40 40 20 20 0 0.2 0 0.2 0.1 0.1 0 0.5 0.6 0.7 0.8 Sparsity k=30, Correlation ρ 0 0.5 0.9 Orthogonal Banded Knockoff OMP 0.6 0.7 0.8 Sparsity k=100, Correlation ρ 0.9 Figure 4: Comparing the orthogonal, the banded pseudo knockoff filter and the knockoff filter with the OMP statistic at a nominal FDR q = 20% by varying the within-group correlation. From Figure 4, the pseudo knockoff filters control FDR in both cases. In the non-sparse case, the two pseudo knockoff filters offer more power than the knockoff filter with the OMP statistic. In these correlated examples with a special correlation structure, we see that designing a special pseudo knockoff that adapts to the problem could increase the power of the pseudo knockoff filter. Moreover, we observe that the orthogonal pseudo knockoff filter offers more power than the other pseudo knockoff filters in each experiment. 4 Partial analysis of the orthogonal pseudo knockoff From the previous numerical results, we observe that the orthogonal pseudo knockoff offers more power than other pseudo knockoff filters and still retains robust FDR control. In this section, we perform further numerical experiments to gain some insight and provide some partial analysis. 4.1 Approximate monotonicity of the expectation of (34) The FDR control of the banded or the block diagonal pseudo knockoff relies on Theorem 2.2 and the expectation inequality (34). This result is based on the fact that ξS0 can be classified into several groups such that the random variables in the same group are mutually independent. For the orthogonal pseudo knockoff, we have not made use of any special correlation structure of the design matrix. Thus, we cannot expect that (34) or a similar result holds. We denote the expectation of the key ratio quantity in (34) with m = 1 as a function of t:   #{j : Wj ≥ t, βj = 0} . F (t) , E #{j : Wj ≤ −t, βj = 0} + 1 16 Inspired by the supermartingale argument in [3], we investigate whether F (t) decreases monotonically with respect to t. We use settings (a), (c), (e) and (f) in Section 3.1, respectively, to study numerically the behavior of F (t) for a range of t (averaged over 200 trials). Note that these settings correspond to different correlation structures of X. We apply the half Lasso signed max statistic (λ = 0.75) and plot the heat map of the expectation. The x-axis corresponds to the range of t varying from 0, 0.2, 0.4, ..., 5 and the y-axis corresponds to the values of the sparsity or the correlation. Correlation ρ Sparsity k 100 80 60 40 20 0.4 0.8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 0.9 0.7 0.5 0.3 0.1 0 0.4 0.8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 1 0.7 0.8 0.5 0.6 0.3 0.4 0.1 0.2 4.8 0 Bet−group Corr γ Wit−group Corr ρ 0 0.9 0.4 0.8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 4.8 0.9 0 1 0.7 0.8 0.5 0.6 0.3 0.4 0.1 0.2 4.8 0 0.4 0.8 1.2 Threshold t 1.6 2 2.4 2.8 3.2 3.6 4 4.4 4.8 Threshold t Figure 5: Computing the variance of F (t) in different scenarios using the orthogonal pseudo knockoff filter. We vary one of the following default parameters in each sub figure: sparsity k, the correlation factor ρ (Σij = ρ|j−j|), the within-group correlation factor ρ and the between-group correlation γ. In each experiment, F (t) varies slightly for small t and decreases almost monotonically for large t . Based on these numerical observations, we focus on F (0+) in order to gain some insight on the behavior of F (t). 4.2 Property of the Orthogonal Pseudo Knockoff Symmetry Property (23) Since X T X̃ = 0 is symmetric, the symmetry property Proposition 2.1 holds for the orthogonal pseudo knockoff. The identical distribution property From (17) and (18), the covariance matrix of η and ξ are A = 4[(X + X̃)T (X + X̃)]−1 and B = 4[(X − X̃)T (X − X̃)]−1 , respectively. The orthogonality condition implies A = 2(X T X)−1 = 2Σ−1 = B. Note that E(η) = β = E(ξ) and that η and ξ are independent multivariate normal distributions. η and ξ are independent and identically distributed. Control of the ratio We introduce the following notations, which will be used frequently later. Σ = X T X, D = diag(Σ−1 ) = diag(d1 , d2 , .., dp ), Z1 , #{j ∈ S0 : Wj > 0}, g −1 = D −1/2 Σ−1 D −1/2 , Σ Z2 , #{j ∈ S0 : Wj < 0}. g −1 ) = 1. We have the following results. By definition, we have (Σ ii 17 (41) Theorem 4.1. For any δ ∈ (0, 1), the orthogonal pseudo knockoff with the statistic defined in (22) satisfies   g −1 ) 1+δ (1 + 3π)λmax (Σ Z1 ≥ E|Nη |−1 , (42) ≤ P 2 Z2 1−δ πδ   1 Z1 E 1 Z1 ≤ 1+δ ≤ , (43) Z2 Z2 1−δ 1−δ g g −1 ) denotes the largest eigenvalue of Σ −1 . In where Nη , #{j ∈ S0 : Wj 6= 0} and λmax (Σ particular, if Wi 6= 0 ∀i ∈ S0 almost surely, we have        Z1 1+δ 1 1 g g −1 −1 −2 −1 + 3 min λmax (Σ ), 4(si di ) (44) ≥ min λmax (Σ ), 2(si di ) P ≤ 2 Z2 1−δ δ |S0 | π 2 −1 g g −1 )/(δ 2 |S |)) = O(λ −1 which is of order O(λmax (Σ 0 max (Σ )/(δ p)). Here, di = (Σ )ii , si is the P −α −1 , α ∈ {1, 2}. knockoff factor in (2) and (si di )−α , |S0 | j∈S0 (si di ) Remark 3. (42) controls the ratio Z1 /Z2 in a probabilistic sense. By the definition of F (t), F (0+) = g −1 are all 1. E(Z1 /(Z2 + 1)) and is bounded by E(Z1 /Z2 ). Note that the diagonal elements of Σ P p g g g g −1 ) = −1 −1 −1 From p = T r(Σ i=1 λi (Σ ) and λi (Σ ) > 0, we have λmax (Σ ) < p. We will demonstrate g −1 is well-conditioned and the number of null features |S | is large enough, later that if the matrix Σ 0 the ratio Z1 /Z2 is bounded by a constant close to 1 with high probability. We would like to draw a connection between the probabilistic upper bound (44) and the knockoff filter. Since the amplitude of si is associated with the power of the knockoff filter, the right hand side relates to the powerof the knockoff. Based on Σii = 1 and 0 ≺ Σ, one can prove di ≥ 1. To  1 vT , v ∈ R(p−1) , 0 ≺ E ∈ R(p−1)×(p−1) . The positive definiteness of see this, we denote Σ = v E Σ guarantees 0 < 1 − v T E−1 v ≤ 1. It follows d1 = (1 − v T E−1 v)−1 ≥ 1. Similarly, we can prove di ≥ 1. If si is not small and is bounded from below (e.g. using the modified SDP construction in [6]), then the quantity s−1 cannot be too large. We can obtain a good control of Z1 /Z2 in the i probabilistic sense if |S0 | is large enough. 4.3 The Mean-Variance Argument From the sign property of W , we know sign(WS0 ) = sign((f (η))S0 ) · sign(ξS0 ). Denote Yi = 1Wi >0 . In order to estimate the variance of Z1 , Z2 , we first analyze the covariance of each pair (Yi , Yj ), i, j ∈ S0 . Lemma 4.2. Conditional on η, for any null variable i, j, we have 3 g 1 g −1 )2 . (Σ−1 )ij (1(f (η))i >0 − 1(f (η))i <0 )(1(f (η))j >0 − 1(f (η))j <0 ) + (Σ Cov(Yi , Yj |η) ≤ ij 2π 2 e −1 )ij is defined in (41). where (Σ (45) We will defer the proof to the Appendix. The Mean and Variance of Zi Denote Nη , {j ∈ S0 : (f (η))j 6= 0}. Obviously, Nη is measurable with respect to the σ-field generated by η. Since ξ = β̂ ls − β̃ ls 6= 0 almost surely, we have Wj = 0 ⇐⇒ f (η)j = 0 almost surely and thus Nη = {j ∈ S0 : Wj 6= 0} almost surely. The means of Yi and Zj are straight forward. For i ∈ S0 , we have E(Yi |η) = 1fi (η)>0 E(1ξi >0 |η) + 1fi (η)<0 E(1ξi <0 |η) = 1fi (η)>0 E(1ξi >0 ) + 1fi (η)<0 E(1ξi <0 ), 1 1 = (1fi (η)>0 + 1fi (η)<0 ) = (46) 2 2 |Nη | , Z1 + Z2 = |Nη |, E(Z1 |η) = E(Z2 |η) = 2 18 where we use the fact that η and ξ are independent. Next, we show that     3  1 g g −1 −1 −1 −2 min λmax (Σ ), 2(si di ) V ar(Z1 |η) ≤ |Nη | + min λmax (Σ ), 4(si di ) . (47) 2π 2 P Here (si di )−α = |Nη |−1 i∈Nη (si di )−α . Denote wi , 1fi (η)>0 − 1fi (η)<0 . Using (45), we have V ar(Z1 |η) ≤ X i,j∈Nη T (Σ g −1 ) g −1 ) X (Σ wN Nη Nη wNη 3 g 3 ij η 2 g −1 −1 )2 Cov(Yi , Yj |η) ≤ wi wj + (Σ )ij = + T r((Σ Nη Nη ) 2π 2 2π 2 i,j∈Nη (48) −1/2 −1 −1/2 g g −1 −1 From diag(s)  (2) and the definition of Σ (41), we have Σ  2D (diag(s)) D . g g −1 −1 Meanwhile, Σ  λmax (Σ )I. It follows   T T T −1/2 −1 −1/2 g g −1 ) −1 )I wN ( Σ w ≤ min w λ ( Σ w , 2w (D (diag(s)) D ) w Nη Nη Nη Nη N η Nη |Nη | Nη Nη max Nη η   g −1 ), 2(s d )−1 (49) = |Nη | min λmax (Σ i i 2X T X g −1 )I, D−1/2 (diag(s))−1 D−1/2 are diagonal and |w | = 1. (s d )−1 Here, we use the fact that λmax (Σ i i i is the average of (si di )−1 over i ∈ Nη . For any positive definite matrix 0 ≺ P  Q, we have T r(Q2 − P2 ) = T r((Q − P)(Q + P)) = T r((Q − P)1/2 (Q − P)1/2 (Q + P)1/2 (Q + P)1/2 ) =T r((Q − P)1/2 (Q + P)1/2 (Q + P)1/2 (Q − P)1/2 ) = T r(RRT ) ≥ 0, R = (Q − P)1/2 (Q + P)1/2 −1/2 (diag(s))−1 D−1/2 ) g −1 ) Taking P = (Σ Nη Nη , Q = 2(D Nη Nη , we yield −1/2 g −1 )2 T r((Σ (diag(s))−1 D−1/2 )2Nη Nη ) = 4|Nη |(si di )−2 Nη Nη ) ≤ 4T r((D P 2 g −1 ) = 1. We have Note that for any 0  A, T r(A2 ) = λi (A) ≤ λmax (A)T r(A) and (Σ ii g g g g −1 −1 −1 )2 −1 T r((Σ Nη Nη ) ≤ λmax (Σ )T r((Σ )Nη Nη ) = |Nη |λmax (Σ ). (50) (51) Combining (48), (49),(50) and (51) yields (47). Proof of Theorem 4.1 Proof. Conditional on η, we apply E(Z1 |η) = E(Z2 |η) = |Nη |/2 = (Z1 + Z2 )/2 (46), (47), and the Chebyshev inequality to yield 1 1 V ar(Z2 η) P (Z2 ≤ (1 − δ)EZ2 η) = P (Z2 ≥ (1 + δ)EZ2 η) = P (|Z2 − EZ2 | ≥ δEZ2 η) ≤ 2 2 2δ (E(Z2 η))2      1 1 g g −1 ), 2(s d )−1 + 3 min λ −1 ), 4(s d )−2 min λmax (Σ ≤ 2 ( Σ max i i i i δ |Nη | π g −1 ) (1 + 3π)λmax (Σ (52) ≤ πδ2 |Nη | P Here (si di )−α = |Nη |−1 i∈Nη (si di )−α , α = 1, 2. The first identity holds since the symmetry d property (23) implies that Z2 = Z1 = |Nη | − Z2 . The estimate (42) follows from integrating the last inequality in (52). If Wi 6= 0 ∀i ∈ S0 almost surely, we have Nη = S0 almost surely. It follows P |Nη | = |S0 | and (si di )−α = |S0 |−1 i∈S0 (si di )−α almost surely. Consequently, we can integrate the second inequality in (52) to yield (44). Next, we prove (43). Recall that conditional on η, Z1 + Z2 = |Nη | , nη . We know Z1 ≤ nη 1+δ obtain 2 ⇐⇒ Z2 ≥ (1− δ) 2. Consequently, we  1−δ Z 2E(Z1 1Z2 ≥(1−δ)nη /2 |η) Z1 Z1 2E(Z1 |η) 1 1 Z1 ≤ 1+δ η = E 1Z2 ≥(1−δ)nη /2 η ≤ ≤ = E Z2 Z2 1−δ Z2 (1 − δ)nη (1 − δ)nη 1−δ Integrating both sides yields the desired result (43). 19  4.4 Some Special Design Matrices For some special design matrices, we can improve the estimate of V ar(Z1 ) in (47) and get better control of Z1 /Z2 . In our simulations, we observe that the orthogonal pseudo knockoff filter offers robust FDR control and works better than other pseudo knockoff filters and the knockoff filter with the OMP statistic in these scenarios. We would like to offer a partial explanation of this phenomenon. A diagonally dominated case Let X ∈ Rn×p and Σ = X T X. We consider several classes of design matrices described below. (a) For any i 6= j, hXi , Xj i , XiT Xj = ρ, ρ ∈ [0, 1). (b) Assume that X can be clustered into k groups, X = (XC1 , XC2 , ..., XCk ). The within-group correlation of group i is ρi for some ρi ∈ [0, 1) and the between-group correlation is zero. (c) The sizes of different groups are equal. The within-group correlation is ρ and the betweengroup correlation is γ · ρ. Case (b) and (c) correspond to setting (e) and (f) in Section 3.1. Denote E , Σ−1 for convenience. g −1 ) = E /(E1/2 E1/2 ). For the design matrices described above, we can show that From (41), (Σ ij ij ii jj P −1 −1 Σ−1 is diagonally dominated, i.e. j6=i |(Σ )ij | < Σii .The proof is a bit technical and tedious. We will omit the proof here. From Lemma 4.2, we have Cov(Yi , Yj |η) ≤ 3 g 1 g g −1 )2 ≤ c |(Σ −1 ) |, (Σ−1 )ij wi wj + (Σ 0 ij ij 2π 2 c0 = 1 3 + <2 2π 2 (53) Using the fact that Σ−1 is diagonally dominated, we can improve the estimate of V ar(Z1 |η) in (47) 1/2  1/2  X X X X |E | |E | |E | ij ij  ij  g −1 ) | = c  c0 |(Σ V ar(Z1 η) ≤ ≤ c0  ij 0 1/2 1/2 E E ii jj i,j∈Nη Eii Ejj i,j∈Nη i,j∈Nη i,j∈Nη 1/2  1/2 1/2  1/2   X 1 X X 2Eii X 2Ejj X 1 X    = 2c0 |Nη |. |Eij |  |Eij | ≤ c0  =c0  Eii Ejj Eii Ejj i∈Nη j∈Nη j∈Nη i∈Nη i∈Nη j∈Nη P Here, we have used Eij = Eji and the diagonal dominated assumption to yield j∈Nη |Eij | ≤ Pp |E | ≤ 2E . Accordingly, the estimate of Z /Z in Theorem 4.1 can be improved. ij ii 1 2 j=1 Proposition 4.3. Assume that Σ−1 = (X T X)−1 is diagonally dominated, the orthogonal pseudo knockoff satisfies   i Z1 1+δ 2 + 6π h −1 P , ≥ E (#{j ∈ S : W = 6 0}) ≤ 0 j Z2 1−δ πδ2 If Wi 6= 0 ∀i ∈ S0 almost surely, the upper bound becomes (2 + 6π)/(πδ2 |S0 |) = O((δ2 p)−1 ). Exponentially Decaying Class Assume that |(Σ−1 )ij | ≤ Cρ|i−j| for ρ ∈ [0, 1) and some constant C. The design matrix in setting (c) in Section 3.1 has a similar structure. One can prove that (Σ−1 )ii ≥ 1 using the fact that Σii = 1 and Σ is positive definite. By our assumption, we have g g g −1 ) | ≤ |(Σ−1 ) | ≤ Cρ|i−j| . Hence, we have λ −1 −1 |(Σ ij ij max (Σ ) ≤ ||Σ ||l1 ≤ 2C/(1 − ρ). Using (47) and Theorem 4.1, we yield   2c0 C|Nη | Z1 4c0 C 1+δ 4c0 C g −1 )|N | ≤ , P E|Nη |−1 ≈ 2 . ≥ ≤ 2 V ar(Z1 η) ≤ c0 λmax (Σ η 1−ρ Z2 1−δ δ (1 − ρ) δ (1 − ρ)|S0 | where c0 = (1+3π)/(2π). If 1−ρ ≥ c1 for some positive constant c1 not too small, this probabilistic upper bound is of the order O((δ2 |S0 |)−1 ) = O((δ2 p)−1 ). 20 Summary Let Fkf be the σ- field generated by all |Wi | in the knockoff filter, B = 4[(X − X̃)T (X − X̃)], N0 , #{i ∈ S0 : |Wi | = 6 0}, m be the maximal group size or the band width, and Z1 (t) , #{i ∈ S0 : Wi ≥ t}, Z2 (t) , #{i ∈ S0 : Wi ≤ −t} ∀t > 0. In particular, Z1 (0) , #{i ∈ S0 : Wi > 0}, Z2 (0) , #{i ∈ S0 : Wi < 0}. We summarize the variance estimates for several classes of pseudo knockoff filters and the knockoff filter as follows. We note that X̃ in all filters satisfies X T X = X̃ T X̃, and B  Σ−1 being diagonal is equivalent to the second constraint in (1) and (2). Filter Knockoff Block Diagonal Banded Orthogonal Constraint on X̃ B  Σ−1 being diagonal B  Σ−1 being block diagonal B  Σ−1 being banded B = 2Σ−1 or X T X̃ = 0 FDR Control Exact. For adaptive T , E(Z1 (T ))/(Z2 (T ) + 1) ≤ 1 Partial. For fixed t > 0, E(Z1 (t)/(Z2 (t)) + m) ≤ 1 Partial. For fixed t > 0, E(Z1 (t)/(Z2 (t)) + m) ≤ 1 P (Z1 (0)/Z2 (0) ≥ (1 + δ)/(1 − δ)) g −1 )/|N |) ≤ 2c0 (δ)−2 E(λmax (Σ 0 Conditional Variance V ar(Z1 (0)|Fkf ) = |N0 |/4 V ar(Z1 (0)|η) ≤ |N0 |m/4 V ar(Z1 (0)|η) ≤ |N0 |m/4 V ar(Z1 (0)|η) g −1 ) ≤ c0 |N0 |λmax (Σ We focus on the conditional variance of the pseudo knockoff. The estimate of V ar(Z1 (0)|η) of the block diagonal or the banded pseudo knockoff is given by (39) and V ar(Z1 (0)|F) of the knockoff is discussed in the paragraph after (39). For small m, V ar(Z1 |η) of the block diagonal or the banded pseudo knockoff is of the same order as that of the knockoff. For the orthogonal g −1 ) and c = (1 + 3π)/(2π). pseudo knockoff, V ar(Z1 (0)|η) in the above table is c0 |N0 |λmax (Σ 0 g g −1 is well-conditioned, e.g. Σ −1 is diagonally dominated or X is one of the design matrices If Σ g −1 ) is small and V ar(Z (0)|η) is O(|N |). Note that we discussed in this section, then λmax (Σ 1 0 E(Z1 |η) = E(Z2 |η) = |N0 |/2. If V ar(Z1 (0)|η) is bounded by C|N0 |α for α < 2 and some universal constant C, the mean-variance argument provides a relatively tight upper bound (that is close to 1) for Z1 (0)/Z2 (0) as |N0 | tends to infinity. This preliminary analysis offers some insight as to why the pseudo knockoff filter may offer FDR control similar to that of the knockoff filter in the examples that we consider here. Based on the mean-variance argument, it is reasonable to conjecture that if V ar(Z1 (0)|η) ≤ C|N0 | for some universal constant C, then the pseudo knockoff may have FDR control similar to that of the knockoff. 4.5 An extreme example The banded or the block diagonal pseudo knockoff filters are constructed for those design matrices with some special correlation structure, i.e. either the off-diagonal elements of (X T X)−1 decay rapidly or (X T X)−1 can be approximated by a block diagonal matrix or a banded matrix. In this subsection, we consider a class of design matrices that violate these assumptions. Specifically, the covariance matrix M to generate X ∈ R1500×500 (X ∼ N (0, M)) satisfies (M−1 )ij = ρ ∀i 6= j and (M−1 )ii = 1 for some ρ ≥ 0. We need to normalize the columns of X to be a unit vector. We focus on two sparsity levels with k = 30 and k = 100, and choose the signal amplitude to be A = 5 i.i.d (βi ∼ {±A}). We let ρ vary from 0, 0.1, 0.2, ..., 0.9. We construct the pseudo knockoff matrix according to Section 2.3 with m = 2 (m is the largest block size or the band width). In Figure 6, we can see that the orthogonal pseudo knockoff with the half Lasso statistic has FDR control and considerable power for varying ρ, while the knockoff filter with the OMP statistic has almost no power. The banded and the block diagonal pseudo knockoff filters with the half Lasso statistic are also considered. They control FDR but lose a lot of power for ρ > 0. Since the off-diagonal elements of Σ−1 do not decay and Σ−1 is not block diagonal or banded, there is no advantage of using these pseudo knockoff filters in this extreme example. To understand why the knockoff filter with the OMP or the Lasso Path statistics performs 21 Power(%) FDR 100 100 80 80 60 60 40 40 20 20 0 1 0 1 0.5 0.5 0 0 0.2 0.4 0.6 Sparsity k=30, Correlation ρ 0 0.8 Orthogonal half Lasso Orthogonal LS Knockoff OMP Knockoff Lasso Path 0 0.2 0.4 0.6 Sparsity k=100, Correlation ρ 0.8 Figure 6: Comparing the orthogonal pseudo knockoff filter with the half Lasso and least squares statistics with the knockoff filter with the OMP and the Lasso path statistics at a nominal FDR q = 20% by varying the correlation ρ. The figures show the mean power and the mean FDR averaged over 200 trials. poorly in this example, we analyze the correlation between Xj and X̃j . Based on the second constraint of the knockoff filter (2), we use an argument similar to (49). More specifically, we Pp 1 g −1 v ≤ 2vT D−1/2 (diag(s))−1 D−1/2 v with v = (1, 1, .., 1)T ∈ RP . This gives have vT Σ i=1 si di ≥ P (Σg −1 ) ij g g −1 is defined in (41). By the construction of X, we have (Σ −1 ) = 1 and , where Σ ii i,j 2 −1 g −1 (Σ )ij ≈ ρ, ∀i 6= j. Note that di ≥ 1. The lower bound of mean(s ) is approximately equal i to 12 (1 + (p − 1)ρ) ≈ pρ/2. If si generated by the SDP construction distributes evenly, we obtain ej are strongly si = O((pρ)−1 ). For ρ 6= 0 and p large enough, si is very small and thus Xj and X e correlated. We have computed the mean correlation of Xj , Xj numerically (the knockoff matrix is generated via the SDP construction). For the mildest case of ρ = 0.1, the mean correlations ej for the banded, the block diagonal pseudo knockoff filters, the knockoff filter, and the of Xj , X orthogonal pseudo knockoff filter are 0.976, 0.981, 0.971, and 0, respectively. The strong correlation ej explains the weak power of the block diagonal and the banded pseudo knockoff between Xj , X filters and the knockoff filter with the OMP statistic. The orthogonal pseudo knockoff filter still ej to be orthogonal by construction. has a reasonable amount of power since we force Xj , X From the FDR result, we see that the Lasso path statistic is not robust. Note that the Lasso path is not computed exactly, but approximated by a fine grid of λ. Typically, the number of grid points to approximate λ is chosen to be 5p. Since Xj and X̃j are strongly correlated, this level of grid resolution for λ may not be fine enough to separate the entrance time of Xj and X̃j . From our simulations, we observe that Xj and X̃j enter into the model at the same λ, which leads to Wj = 0. In order to determine which one enters the model earlier, we need to refine the grid. However, refining the grid resolution leads to a considerable increase in the computational cost of the Lasso path statistic. To show that the FDR of the Lasso Path statistic is indeed under control as predicted by the knockoff theory in [3], we reduce the sample size to p = 100, n = 300 (sparsity k = 20 and k = 6), and increase the number of realizations to 1000 and implement the Lasso path statistic with the number of grid points for λ equal to 50p. Using this level of resolution, we observe that the mean FDR is controlled at q = 20%. However, the statistical power of the Lasso Path statistic is also greatly reduced and is less than 10% for large values of ρ (ρ ≥ 0.5). Based on the performance of these two knockoff statistics, we find that the OMP statistic is more robust. Variance of the orthogonal pseudo knockoff filter with different statistics Although the orthogonal pseudo knockoff filter with the least squares statistic maintains a lot of power, its 22 mean FDR is more than the prescribed q = 20% (i.e. we lose the FDR control for the least squares g −1 ) is of order 1 + (p − 1)ρ ≈ pρ. Therefore, the statistic). Based on our construction of X, λmax (Σ 2 estimate of V ar(Z1 |η) in (47) is O(p ) if Nη = S0 and |S0 | ≈ p. Consequently, the upper bound in Theorem 4.1 is O(δ−2 ) and we may lose control of Z1 /Z2 for some statistics. To understand the difference between the mean FDR of the half Lasso and the least squares statistic, we compute V ar(Z1 ) numerically over 200 trials. The results are plotted in the figure below. Variance of the half Lasso Variance of least squares 0.16 ρ = 0.1 ρ = 0.3 ρ = 0.5 ρ = 0.7 ρ = 0.9 0.12 0.08 2 0.07 Var(Z1) / p Var(Z1) / p 0.14 0.1 0.06 0.05 0.04 0.03 0.02 0.08 0.01 0.06 100 200 300 400 500 600 700 800 Number of features p 0 100 200 300 400 500 600 700 800 Number of features p Figure 7: Numerical computation of the variance of the orthogonal pseudo knockoff filter with different statistics by varying the sample size (n, p) = (3p, p). Here the sparsity k = 0.2p. Different curves show the variance of Z1 in different correlation structures. We focus on the order of V ar(Z1 ). The left figure shows that V ar(Z1 ) of the half Lasso statistic is O(p) and the constant is about 0.1, while the right figure shows that V ar(Z1 ) of the least squares statistic is O(p2 ) and the constant varies for different ρ. The results of ρ = 0, 0.2, 0.4, 0.6, 0.8 are qualitatively similar. The variance of the least squares obtained from our simulation matches well with our theoretical estimate and thus its FDR may lose control in the extreme example (Figure 6). The numerical variance of the half Lasso statistic, however, is order O(p), which is much better than O(p2 ) in the estimate (47). Therefore, the mean-variance argument shows that the upper bound in (42) is O((δ2 p)−1 ), which explains why we still have FDR control of the orthogonal pseudo knockoff filter with the half Lasso signed max statistic in this extreme example. From the numerical results in this subsection and Section 3, we see that a half penalty in (19), e.g. the l1 penalty λ|| · ||1 , reduces the variance of Z1 significantly, which leads to robust performance of the orthogonal pseudo knockoff filter. We do not fully understand why a half Lasso penalty reduces the variance from O(p2 ) to O(p) in the extreme example. From our numerical experiments, we observe that the combination of the orthogonal pseudo knockoff and the half Lasso signed max statistic seems to offer the most power among other pseudo knockoff filters. It would be worthwhile to further study the effect of a half penalty to take full advantage of the orthogonal pseudo knockoff filter. 5 Concluding remarks In this paper, we introduce three classes of pseudo knockoff filters. These pseudo knockoff filters preserve some essential features of the original knockoff filter but offer more flexibility in constructing the knockoff matrix, especially when the features are highly correlated or when the inverse of the covariance matrix, Σ−1 , decays very slowly away from its main diagonal. We provide a partial analysis of the pseudo knockoff filters by investigating the expectation inequality (9), which is a variant of the corresponding expectation inequality (10) for the knockoff filter. We establish this expectation inequality for the block diagonal and the banded pseudo knockoff filters. For the orthogonal pseudo knockoff filter, we provide a probabilistic analysis based on the mean-variance argument. This analysis gives an upper bound on the the expectation of interest. In the case when 23 Σ−1 is diagonally dominated or when Σ−1 has some special structure, this probabilistic analysis provides a relatively tight upper bound for the expectation of interest. This analysis offers some partial explanation why the pseudo knockoff filters provide FDR control in the examples that we consider in this paper. We have also performed a number of numerical experiments to test the performance of the pseudo knockoff filters and compare them with the knockoff filter. In the case when the features are highly correlated and the non-sparse case (e.g. about 20% non-null features), the orthogonal pseudo knockoff filter offers more power than the knockoff filter with the OMP or Lasso Path statistic. In the extreme case when Σ−1 decays very slowly away from its main diagonal, the knockoff filter with the OMP or the Lasso Path statistic tends to lose considerable power. The orthogonal pseudo knockoff filter still offers reasonably high power in this case. The study presented in this paper is still at a very preliminary stage and further study is required to fully understand the advantages and the limitations of the pseudo knockoff filters. Appendix Verification of the construction (31) of X̃. tions show that Let X̃ be constructed from (31). Direct calcula- (X − X̃)T (X − X̃) = [(2XΣ−1 − 2UC)B−1 ]T [(2XΣ−1 − 2UC)B−1 ] =4B−1 (Σ−1 X T XΣ−1 + CT UT UC)B−1 = 4B−1 (Σ−1 + CT C)B−1 = 4B−1 . (X + X̃)T (X − X̃) = [X(2I − 2Σ−1 B−1 ) + 2UCB−1 ]T [2XΣ−1 B−1 − 2UCB−1 ] =4(I − Σ−1 B−1 )T X T XΣ−1 B−1 − 4B−1 CT UT UCB−1 =4(I − B−1 Σ−1 )B−1 − 4B−1 C T CB−1 = 4(I − B−1 Σ−1 )B−1 − 4B−1 (B − Σ−1 )B−1 = 0 . Here, we use UT X = X T U = 0. The first identity implies (29) and the second is exactly the orthogonal condition (16). Proof of Lemma 4.2 Conditional on η, we can determine Nη = {j ∈ S0 : Wj 6= 0}. Recall that d ξ and η are independent and ξS0 = −ξS0 . We have E(1ξi >0 |η) = E(1ξi >0 ) = 1/2, i ∈ So and for any i, j ∈ Nη , 1 1 1 E(1ξi >0 1ξj <0 ) − + E(1ξi >0 1ξj >0 ) − = E(1ξi >0 ) − = 0. 4 4 2 1 1 Similarly, E(1ξi <0 1ξj >0 ) − 4 = −(E(1ξi >0 1ξj >0 ) − 4 ), ∀i, j ∈ S0 . Meanwhile, the symmetry of ξS0 implies E(1ξi <0 1ξj <0 ) = E(1ξi >0 1ξj >0 ). Therefore, we obtain Cov(Yi , Yj |η) = E(Yi Yj |η) − E(Yi |η)E(Yj |η) = E(Yi Yj |η) − 1 4 1 =E[(1fi (η)>0 1ξi >0 + 1fi (η)<0 1ξi <0 ) · (1fj (η)>0 1ξj >0 + 1fj (η)<0 1ξj <0 )|η] − 4     1 1 + 1fi (η)>0 1fj (η)<0 E(1ξi >0 1ξj <0 ) − =1fi (η)>0 1fj (η)>0 E(1ξi >0 1ξj >0 ) − 4 4     (54) 1 1 + 1fi (η)<0 1fj (η)>0 E(1ξi <0 1ξj >0 ) − + 1fi (η)<0 1fj (η)<0 E(1ξi <0 1ξj <0 ) − . 4 4 1 =(E(1ξi >0 1ξj >0 ) − )(1fi (η)>0,fj (η)>0 − 1fi (η)>0,fj (η)<0 − 1fi (η)<0,fj (η)>0 + 1fi (η)<0,fj (η)<0 ) 4 1 1 =(E(1ξi >0 1ξj >0 ) − )(1fi (η)>0 − 1fi (η)<0 )(1fj (η)>0 − 1fj (η)<0 ) = (E(1ξi >0 1ξj >0 ) − )wi wj , 4 4 where wi , 1fi (η)>0 − 1fi (η)<0 . By definition, wi = 1 or −1. From Cov(ξ) = B = 2Σ−1 , we      ξi Bii Bij ∼ N 0, . Since normalizing know that the joint distribution of (ξi , ξj ) is ξj Bji Bjj 24     1 µij ∼ N 0, , where µij = µij 1 g −1 ) , µ = µij = (Σ ij (55) ξi , ξj does not change their sign, we assume that 1/2 1/2 g −1 ) (see (41)). Define Bij /(Bii Bjj ) = (Σ ij  ξi ξj and let P (ξi , ξj ) and Ps (·) be the probability distribution function of (ξi , ξj ) and the standard normal distribution, respectively. Using 0 ≤ ex − 1 − x ≤ Ps (ξi )Ps (ξj ) up to µ2 x2 x 2 (e 1x>0 + 1) by taking x , − µ2 ξi2 +µ2 ξj2 −2µξi ξj , 2(1−µ2 ) we expand P (ξi , ξj ) − p Ps (ξi )Ps (ξj ) p (1 + x − 1 − µ2 + ex − 1 − x)wi wj 1 − µ2 p Ps (ξi )Ps (ξj ) ≤ p ((1 + x − 1 − µ2 )wi wj + ex − 1 − x) 1 − µ2 p Ps (ξi )Ps (ξj ) x2 (ex 1x>0 + 1) ) ≤ p ((1 + x − 1 − µ2 )wi wj + 2 1 − µ2   p Ps (ξi )Ps (ξj ) x2 x2 1x>0 = p . (1 + x − 1 − µ2 )wi wj + + P (ξi , ξj ) 2 2 1 − µ2 [P (ξi , ξj ) − Ps (ξi )Ps (ξj )]wi wj = Integrating both sides with respect to ξi , ξj in the region ξi , ξj > 0 gives     Z p Ps (ξi )Ps (ξj ) x2 1 2 p wi wj ≤ dξi dξj (1 + x − 1 − µ )wi wj + E(1ξi >0 1ξj >0 ) − 4 2 1 − µ2 ξi ,ξj >0 Z x2 1x>0 P (ξi , ξj ) + dξi dξj , I + II + III . (56) 2 ξi >0,ξj >0 Since Ps (·) is standard Gaussian distribution and x = − moments in I, II explicitly. For I, we have I= ≤ = 1 µ2 1 µ 1 − (p − 1) + 4 2π(1 − µ2 )3/2 4 (1 − µ2 )3/2 1 − µ2 µ2 ξi2 +µ2 ξj2 −2µξi ξj , 2(1−µ2 ) ! we can calculate all the wi wj µ2 µwi wj µ 1 1 1 + ((1 − µ2 )−3/2 − 1) + ( p − 1) − 2π 2π 4 4 (1 − µ2 )3/2 1 − µ2 (57) µ2 (1 − µ2 )−3/2 − 1 1 µ2 1 µwi wj µwi wj p + − + c1 (µ)µ2 , + p , 2 2 2 2π 2π µ 2π 4 1−µ 1−µ 1+ 1−µ where the coefficients of µ2 and is bounded near µ = 0. We use E(ξ1ξ>0 ) = √ c1 (µ)2 ≥ 0 collects 1 1/ 2π, E(ξ 1ξ>0 ) = 2 for the standard Gaussian ξ to obtain the first equality, and |wi | = |wj | = 1 to obtain the inequality. For the second term, we get Z µ2 (1 − π8 µ + 2µ2 ) µ2 2 2 2 P (ξ )P (ξ )(2ξ ξ − µ(ξ + ξ )) dξ dξ = II = , c2 (µ)µ2 , s i s j i j i j i j 8(1 − µ2 )5/2 ξi ,ξj >0 8(1 − µ2 )5/2 (58) (1− 8 µ+2µ2 ) π where c2 (µ) = 8(1−µ 2 )5/2 ≥ 0 is bounded near µ = 0. Since ξi , ξj > 0 and x = − µ ≤ 0 implies x ≤ 0, or equivalently 1x>0 ≤ 1µ>0 . Note that x=− µ2 ξi2 +µ2 ξj2 −2µξi ξj , 2(1−µ2 ) µ2 ξi2 + µ2 ξj2 − 2µξi ξj 2µ2 ξi ξj − 2|µ|ξi ξj |µ|ξi ξj ≤ − = , ∀ ξi , ξj > 0. 2 2 2(1 − µ ) 2(1 − µ ) (1 + |µ|) 25 For ξi , ξj > 0, we have x2 1x>0 ≤  |µ|ξi ξj 1+|µ| 2 1µ>0 . Therefore, we obtain 1 |µ2 1µ>0 | 1 E(ξi2 ξj2 1ξi ,ξj >0 ) III = E(x2 1x>0 1ξi ,ξj >0 ) ≤ 2 2 (1 + |µ|)2 1 |µ2 1µ>0 | 1 |µ2 1µ>0 | 3 4 4 1/2 ≤ (E(ξ 1 )E(ξ 1 )) = , 1µ>0 c3 (µ)µ2 , i ξi >0 j ξj >0 2 (1 + |µ|)2 2 (1 + |µ|)2 2 where c3 (µ) = 3 4(1+|µ|)2 (59) is bounded near µ = 0. Combining (56), (57), (58) and (59), we yield   1 µ µ Cov(Yi , Yj |η) = E(1ξi >0 1ξj >0 ) − wi wj +(c1 (µ)+c2 (µ)+c3 (µ)1µ>0 )µ2 , wi wj +c(µ)µ2 . wi wj ≤ 4 2π 2π Here, c(µ) = c1 (µ) + c2 (µ) + c3 (µ)1µ>0 . Since ci (µ) is a non-negative and an explicit function of µ, it is not difficult to show that c(µ) < 23 for |µ| < 12 . For |µ| > 1/2, we use the estimate Cov(Yi , Yj |η) ≤ 1/4 ≤ −1/2π + 32 µ2 . Finally, we conclude Cov(Yi , Yj |η) ≤  1 µ µ 3 wi wj + c(µ)µ2 ∧ ≤ wi wj + µ2 , 2π 4 2π 2 g −1 ) is defined in (55). This proves Lemma 4.2. where µ = (Σ ij Acknowledgements. The research was in part supported by NSF Grants DMS 1318377 and DMS 1613861. The research of the first author was performed during his visit to ACM at Caltech. We would like to thank Professor Emmanuel Candes for his many valuable comments and suggestions to our work. We would also like to thank Professor Lucas Janson for his interest and comments on the earlier version of this manuscript and Dr. Pengfei Liu for the insightful discussions on the pseudo knockoff. References [1] Y. Benjamini and Y. Hochberg. Controlling the false discovery rate: a practical and powerful approach to multiple testing. J. Roy. Statist. Soc. Ser. B, 57(1):289300, 1995. [2] Y. Benjamini and D. Yekutieli. The control of the false discovery rate in multiple testing under dependency. Ann. Statist., 29(4):11651188, 2001. [3] R. Foygel Barber, E. J. Candès. Controlling the false discovery rate via knockoffs. Ann. Statist., 43(5):20552085, 2015. [4] R. Foygel Barber, E. J. Candès. A knockoff filter for high-dimensional selective inference. arXiv:1602.03574v1, 2016. [5] E. J. Candès, Y. Fan, L. Janson, and J. Lv, Panning for gold: Model-free knockoffs for highdimensional controlled variable selection.arXiv:1610.02351, 2016. [6] J. Chen, A. Hou, and T. Y. Hou, Some analysis of the knockoff filter and its variants for highly correlated features, preprint, 2016. [7] R. Dai and R. Foygel Barber. The knockoff filter for FDR control in group-sparse and multitask regression. arXiv preprint arXiv:1602.03589,2016. [8] M. G. G’Sell, S. Wager, A. Chouldechova, and R. Tibshirani. False discovery rate control for sequential selection procedures, with application to the Lasso. 2013. arXiv:1309.5352. 26 [9] L. Janson and W. Su. Familywise error rate control via knockoffs.arXiv:1505.06549v3, 2015. [10] H. Liu, K. Roeder, and L. Wasserman. Stability approach to regularization selection (StARS) for high dimensional graphical models. Adv. Neural Inf. Process. Syst., 23:14321440, 2010. [11] N. Meinshausen and P. Bühlmann. Stability selection. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(4):417473, 2010. [12] A. J. Miller. Selection of subsets of regression variables. J. Roy. Statist. Soc. Ser. A, 147(3):389425, 1984. [13] A. Miller. Subset selection in regression, volume 95 of Monographs on Statistics and Applied Probability. Chapman & Hall/CRC, Boca Raton, FL, second edition, 2002. [14] S. Reid and R. Tibshirani. Sparse regression and marginal testing using cluster prototypes. Biostat., 17(2):364-376, 2016. [15] W. Su, J. Qian, and L. Liu. Communication-efficient false discovery rate control via knockoff aggregation. arXiv:1506.05446v2,2015. [16] Q. Xu, J. Xiong, X. Cao, and Y. Yao. False discovery rate control and statistical quality assessment of annotators in crowdsourced ranking. arXiv:1605.05860,2016 27
10math.ST
Continuous-Time Influence Maximization of Multiple Items Scalable Influence Maximization for Multiple Products in Continuous-Time Diffusion Networks Nan Du [email protected] Google Research, 1600 Amphitheatre Pkwy, Mountain View, CA 94043 Yingyu Liang [email protected] Department of Computer Science, Princeton University, Princeton, NJ 08540 arXiv:1612.02712v2 [cs.SI] 29 Jan 2017 Maria-Florina Balcan [email protected] School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213 Manuel Gomez-Rodriguez [email protected] MPI for Software Systems, Kaiserslautern, Germany 67663 Hongyuan Zha Le Song [email protected] [email protected] College of Computing, Georgia Institute of Technology, Atlanta, GA 30332 Abstract A typical viral marketing model identifies influential users in a social network to maximize a single product adoption assuming unlimited user attention, campaign budgets, and time. In reality, multiple products need campaigns, users have limited attention, convincing users incurs costs, and advertisers have limited budgets and expect the adoptions to be maximized soon. Facing these user, monetary, and timing constraints, we formulate the problem as a submodular maximization task in a continuous-time diffusion model under the intersection of one matroid and multiple knapsack constraints. We propose a randomized algorithm estimating the user influence1 in a network (|V| nodes, |E| edges) to an accuracy of  with n = O(1/2 ) randomizations and Õ(n|E| + n|V|) computations. By exploiting the influence estimation algorithm as a subroutine, we develop an adaptive threshold greedy algorithm achieving an approximation factor ka /(2 + 2k) of the optimal when ka out of the k knapsack constraints are active. Extensive experiments on networks of millions of nodes demonstrate that the proposed algorithms achieve the state-of-the-art in terms of effectiveness and scalability. Keywords: Influence Maximization, Influence Estimation, Continuous-time Diffusion Model, Matroid, Knapsack 1. Introduction Online social networks play an important role in the promotion of new products, the spread of news, the success of political campaigns, and the diffusion of technological innovations. In these contexts, the influence maximization problem (or viral marketing problem) typically has the following flavor: identify a set of influential users in a social network, who, when 1. Partial results in the paper on influence estimation have been published in a conference paper: Nan Du, Le Song, Manuel Gomez-Rodriguez, and Hongyuan Zha. Scalable influence estimation in continuous time diffusion networks. In Advances in Neural Information Processing Systems 26, 2013. 1 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song convinced to adopt a product, shall influence other users in the network and trigger a large cascade of adoptions. This problem has been studied extensively in the literature from both the modeling and the algorithmic aspects (Richardson and Domingos, 2002; Kempe et al., 2003; Leskovec et al., 2007; Chen et al., 2009, 2010a,b, 2011, 2012; Ienco et al., 2010; Goyal et al., 2011a,b; Gomez-Rodriguez and Schölkopf, 2012), where it has been typically assumed that the host (e.g., the owner of an online social platform) faces a single product, endless user attention, unlimited budgets and unbounded time. However, in reality, the host often encounters a much more constrained scenario: • Multiple-Item Constraints: multiple products can spread simultaneously among the same set of social entities. These products may have different characteristics, such as their revenues and speed of spread. • Timing Constraints: the advertisers expect the influence to occur within a certain time window, and different products may have different timing requirements. • User Constraints: users of the social network, each of which can be a potential source, would like to be exposed to only a small number of ads. Furthermore, users may be grouped by their geographical locations, and advertisers may have a target population they want to reach. • Product Constraints: seeking initial adopters entails a cost to the advertiser, who needs to pay to the host and often has a limited amount of money. For example, Facebook (i.e., the host) needs to allocate ads for various products with different characteristics, e.g., clothes, books, or cosmetics. While some products, such as clothes, aim at influencing within a short time window, some others, such as books, may allow for longer periods. Moreover, Facebook limits the number of ads in each user’s sidebar (typically it shows less than five) and, as a consequence, it cannot assign all ads to a few highly influential users. Finally, each advertiser has a limited budget to pay for ads on Facebook and thus each ad can only be displayed to some subset of users. In our work, we incorporate these myriads of practical and important requirements into consideration in the influence maximization problem. We account for the multi-product and timing constraints by applying product-specific continuous-time diffusion models. Here, we opt for continuous-time diffusion models instead of discrete-time models, which have been mostly used in previous work (Kempe et al., 2003; Chen et al., 2009, 2010a,b, 2011, 2012; Borgs et al., 2012). This is because artificially discretizing the time axis into bins introduces additional errors. One can adjust the additional tuning parameters, like the bin size, to balance the tradeoff between the error and the computational cost, but the parameters are not easy to choose optimally. Extensive experimental comparisons on both synthetic and real-world data have shown that discrete-time models provide less accurate influence estimation than their continuoustime counterparts (Gomez-Rodriguez et al., 2011; Gomez-Rodriguez and Schölkopf, 2012; Gomez-Rodriguez et al., 2013; Du et al., 2013a,b). However, maximizing influence based on continuous-time diffusion models also entails additional challenges. First, evaluating the objective function of the influence maximization problem (i.e., the influence estimation problem) in this setting is a difficult graphical model 2 Continuous-Time Influence Maximization of Multiple Items inference problem, i.e., computing the marginal density of continuous variables in loopy graphical models. The exact answer can be computed only for very special cases. For example, Gomez-Rodriguez and Schölkopf (2012) have shown that the problem can be solved exactly when the transmission functions are exponential densities, by using continuous time Markov processes theory. However, the computational complexity of such approach, in general, scales exponentially with the size and density of the network. Moreover, extending the approach to deal with arbitrary transmission functions would require additional nontrivial approximations which would increase even more the computational complexity. Second, it is unclear how to scale up influence estimation and maximization algorithms based on continuous-time diffusion models to millions of nodes. Especially in the maximization case, the influence estimation procedure needs to be called many times for different subsets of selected nodes. Thus, our first goal is to design a scalable algorithm which can perform influence estimation in the regime of networks with millions of nodes. We account for the user and product constraints by restricting the feasible domain over which the maximization is performed. We first show that the overall influence function of multiple products is a submodular function and then realize that the user and product constraints correspond to constraints over the ground set of this submodular function. To the best of our knowledge, previous work has not considered both user and product constraints simultaneously over general unknown different diffusion networks with non-uniform costs. In particular, (Datta et al., 2010) first tried to model both the product and user constraints only with uniform costs and infinite time window, which essentially reduces to a special case of our formulations. Similarly, (Lu et al., 2013) considered the allocation problem of multiple products which may have competitions within the infinite time window. Besides, they all assume that multiple products spread within the same network. In contrast, our formulations generally allow products to have different diffusion networks, which can be unknown in practice. Soma et al. (2014) studied the influence maximization problem for one product subject to one knapsack constraint over a known bipartite graph between marketing channels and potential customers; Ienco et al. (2010) and Sun et al. (2011) considered user constraints but disregarded product constraints during the initial assignment; and, Narayanam and Nanavati (2012) studied the cross-sell phenomenon (the selling of the first product raises the chance of selling the second) and included monetary constraints for all the products. However, no user constraints were considered, and the cost of each user was still uniform for each product. Thus, our second goal is to design an efficient submodular maximization algorithm which can take into account both user and product constraints simultaneously. Overall, this article includes the following major contributions: • Unlike prior work that considers an a priori described simplistic discrete-time diffusion model, we first learn the diffusion networks from data by using continuous-time diffusion models. This allows us to address the timing constraints in a principled way. • We provide a novel formulation of the influence estimation problem in the continuoustime diffusion model from the perspective of probabilistic graphical models, which allows heterogeneous diffusion dynamics over the edges. 3 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song • We propose an efficient randomized algorithm for continuous-time influence estimation, which can scale up to millions of nodes and estimate the influence of each node to an accuracy of  using n = O(1/2 ) randomizations. • We formulate the influence maximization problem with the aforementioned constraints as a submodular maximization under the intersection of matroid constraints and knapsack constraints. The submodular function we use is based on the actual diffusion model learned from the data for the time window constraint. This novel formulation provides us a firm theoretical foundation for designing greedy algorithms with theoretical guarantees. • We develop an efficient adaptive-threshold greedy algorithm which is linear in the e number of products and proportional to O(|V| + |E ∗ |), where |V| is the number of ∗ nodes (users) and |E | is the number of edges in the largest diffusion network. We then prove that this algorithm is guaranteed to find a solution with an overall influence ka of at least 2+2k of the optimal value, when ka out of the k knapsack constraints are active. This improves over the best known approximation factor achieved by polynomial time algorithms in the combinatorial optimization literature. Moreover, whenever advertising each product to each user entails the same cost, the constraints reduce to an intersection of matroids, and we obtain an approximation factor of 1/3, which is optimal for such optimization. • We evaluate our algorithms over large synthetic and real-world datasets and show that our proposed methods significantly improve over previous state-of-the-arts in terms of both the accuracy of the estimated influence and the quality of the selected nodes in maximizing the influence over independently hold-out real testing data. In the remainder of the paper, we will first tackle the influence estimation problem in section 2. We then formulate different realistic constraints for the influence maximization in section 3 and present the adaptive-thresholding greedy algorithm with its theoretical analysis in section 4; we investigate the performance of the proposed algorithms in both synthetic and real-world datasets in section 5; and finally we conclude in section 6. 2. Influence Estimation We start by revisiting the continuous-time diffusion model by Gomez-Rodriguez et al. (2011) and then explicitly formulate the influence estimation problem from the perspective of probabilistic graphical models. Because the efficient inference of the influence value for each node is highly non-trivial, we further develop a scalable influence estimation algorithm which is able to handle networks of millions of nodes. The influence estimation procedure will be a key building block for our later influence maximization algorithm. 2.1 Continuous-Time Diffusion Networks The continuous-time diffusion model associates each edge with a transmission function, that is, a density over the transmission time along the edge, in contrast to previous discrete-time models which associate each edge with a fixed infection probability (Kempe et al., 2003). 4 Continuous-Time Influence Maximization of Multiple Items Moreover, it also differs from discrete-time models in the sense that events in a cascade are not generated iteratively in rounds, but event timings are sampled directly from the transmission function in the continuous-time model. Continuous-Time Independent Cascade Model. Given a directed contact network, G = (V, E), we use the independent cascade model for modeling a diffusion process (Kempe et al., 2003; Gomez-Rodriguez et al., 2011). The process begins with a set of infected source nodes, A, initially adopting certain contagion (idea, meme or product) at time zero. The contagion is transmitted from the sources along their out-going edges to their direct neighbors. Each transmission through an edge entails random waiting times, τ , drawn from different independent pairwise waiting time distributions(one per edge). Then, the infected neighbors transmit the contagion to their respective neighbors, and the process continues. We assume that an infected node remains infected for the entire diffusion process. Thus, if a node i is infected by multiple neighbors, only the neighbor that first infects node i will be the true parent. As a result, although the contact network can be an arbitrary directed network, each diffusion process induces a Directed Acyclic Graph (DAG). Heterogeneous Transmission Functions. Formally, the pairwise transmission function fji (ti |tj ) for a directed edge j → i is the conditional density of node i getting infected at time ti given that node j was infected at time tj . We assume it is shift invariant: fji (ti |tj ) = fji (τji ), where τji := ti − tj , and causal: fji (τji ) = 0 if τji < 0. Both parametric transmission functions, such as the exponential and Rayleigh function (Gomez-Rodriguez et al., 2011), and nonparametric functions (Du et al., 2012) can be used and estimated from cascade data. Shortest-Path Property. The independent cascade model has a useful property we will use later: given a sample of transmission times of all edges, the time ti taken to infect a node i is the length of the shortest path in G from the sources to node i, where the edge weights correspond to the associated transmission times. 2.2 Probabilistic Graphical Model for Continuous-Time Diffusion Networks The continuous-time independent cascade model is essentially a directed graphical model for a set of dependent random variables, that is, the infection times ti of the nodes, where the conditional independence structure is supported on the contact network G. Although the original contact graph G can contain directed loops, each diffusion process (or a cascade) induces a directed acyclic graph (DAG). For those cascades consistent with a particular DAG, we can model the joint density of ti using a directed graphical model: p ({ti }i∈V ) = Y i∈V p (ti |{tj }j∈πi ) , (1) where each πi denotes the collection of parents of node i in the induced DAG, and each term p(ti |{tj }j∈πi ) corresponds to a conditional density of ti given the infection times of the parents of node i. This is true because given the infection times of node i’s parents, ti is independent of other infection times, satisfying the local Markov property of a directed graphical model. We note that the independent cascade model only specifies explicitly the pairwise transmission function of each directed edge, but does not directly define the conditional density p(ti |{tj }j∈πi ). 5 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song However, these conditional densities can be derived from the pairwise transmission functions based on the Independent-Infection property: p (ti |{tj }j∈πi ) = X j∈πi fji (ti |tj ) Y l∈πi ,l6=j S(ti |tl ), (2) which is the sum of the likelihoods that node i is infected by each parent node j. More precisely, each term in the summation can be interpreted as the likelihood fji (ti |tj ) of node i being infected at ti by node j multiplied by the probability S(ti |tl ) that it has survived from the infection of each other parent node l 6= j until time ti . Perhaps surprisingly, the factorization in Equation (1) is the same factorization that can be used for an arbitrary induced DAG consistent with the contact network G. In this case, we only need to replace the definition of πi (the parent of node i in the DAG) to the set of neighbors of node i with an edge pointing to node i in G. This is not immediately obvious from Equation (1), since the contact network G can contain directed loops which seems to be in conflict with the conditional independence semantics of directed graphical models. The reason why it is possible to do so is as follows: any fixed set of infection times, t1 , . . . , td , induces an ordering of the infection times. If ti ≤ tj for an edge j → i in G, hji (ti |tj ) = 0, and the corresponding term in Equation (2) is zeroed out, making the conditional density consistent with the semantics of directed graphical models. Instead of directly modeling the infection times ti , we can focus on the set of mutually independent random transmission times τji = ti − tj . Interestingly, by switching from a node-centric view to an edge-centric view, we obtain a fully factorized joint density of the set of transmission times  Y p {τji }(j,i)∈E = (j,i)∈E fji (τji ), (3) Based on the Shortest-Path property of the independent cascade model, each variable ti can be viewed as a transformation from the collection of variables {τji }(j,i)∈E . More specifically, let Qi be the collection of directed paths in G from the source nodes to node i, where each path q ∈ Qi contains a sequence of directed edges (j, l). Assuming all source nodes are infected at time zero, then we obtain variable ti via X  ti = gi {τji }(j,i)∈E |A = min q∈Qi (j,l)∈q τjl , (4) where the transformation gi (·|A) is the value of the shortest-path minimization. As a special case, we can now compute the probability of node i infected before T using a set of independent variables:   Pr {ti ≤ T |A} = Pr gi {τji }(j,i)∈E |A ≤ T . (5) The significance of the relation is that it allows us to transform a problem involving a sequence of dependent variables {ti }i∈V to one with independent variables {τji }(j,i)∈E . Furthermore, the two perspectives are connected via the shortest path algorithm in weighted directed graph, a standard well-studied operation in graph analysis. 6 Continuous-Time Influence Maximization of Multiple Items 2.3 Influence Estimation Problem in Continuous-Time Diffusion Networks Intuitively, given a time window, the wider the spread of infection, the more influential the set of sources. We adopt the definition of influence as the expected number of infected nodes given a set of source nodes and a time window, as in previous work (Gomez-Rodriguez and Schölkopf, 2012). More formally, consider a set of source nodes A ⊆ V, |A| ≤ C which get infected at time zero. Then, given a time window T , a node i is infected within the time window if ti ≤ T . The expected number of infected nodes (or the influence) given the set of transmission functions {fji }(j,i)∈E can be computed as σ(A, T ) = E hX i∈V i X I {ti ≤ T |A} = i∈V Pr {ti ≤ T |A} , (6) where I {·} is the indicator function and the expectation is taken over the the set of dependent variables {ti }i∈V . By construction, σ(A, T ) is a non-negative, monotonic nondecreasing submodular function in the set of source nodes shown by Gomez-Rodriguez and Schölkopf (2012). Essentially, the influence estimation problem in Equation (6) is an inference problem for graphical models, where the probability of event ti ≤ T given sources in A can be obtained by summing out the possible configuration of other variables {tj }j6=i . That is Z ∞ Z T ··· Pr{ti ≤ T |A} = 0 Z ··· ti =0 ∞ Y j∈V 0 p tj |{tl }l∈πj  Y j∈V  dtj , (7) which is, in general, a very challenging problem. First, the corresponding directed graphical models can contain nodes with high in-degree and high out-degree. For example, in Twitter, a user can follow dozens of other users, and another user can have hundreds of “followers”. The tree-width corresponding to this directed graphical model can be very high, and we need to perform integration for functions involving many continuous variables. Second, the integral in general can not be evaluated analytically for heterogeneous transmission functions, which means that we need to resort to numerical integration by discretizing the domain [0, ∞). If we use N levels of discretization for each variable, we would need to enumerate O(N |πi | ) entries, exponential in the number of parents. Only in very special cases, can one derive the closed-form equation for computing Pr{ti ≤ T |A}. For instance, Gomez-Rodriguez and Schölkopf (2012) proposed an approach for exponential transmission functions, where the special properties of exponential density are used to map the problem into a continuous time Markov process problem, and the computation can be carried out via a matrix exponential. However, without further heuristic approximation, the computational complexity of the algorithm is exponential in the size and density of the network. The intrinsic complexity of the problem entails the utilization of approximation algorithms, such as mean field algorithms or message passing algorithms. We will design an efficient randomized (or sampling) algorithm in the next section. 2.4 Efficient Influence Estimation in Continuous-Time Diffusion Networks Our first key observation is that we can transform the influence estimation problem in Equation (6) into a problem with independent variables. With the relation in Equation (5), 7 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song we can derive the influence function as X   Pr gi {τji }(j,i)∈E |A ≤ T σ(A, T ) = i∈V i hX   I gi {τji }(j,i)∈E |A ≤ T , =E i∈V (8) where the expectation is with respect to the set of independent variables {τji }(j,i)∈E . This equivalent formulation suggests a naive sampling (NS) algorithm for approximating σ(A, T ): draw n samples of {τji }(j,i)∈E , run a shortest path algorithm for each sample, and finally average the results (see Appendix A for more details). However, this naive sampling approach has a computational complexity of O(nC|V||E| + nC|V|2 log |V|) due to the repeated calling of the shortest path algorithm. This is quadratic to the network size, and hence not scalable to millions of nodes. Our second key observation is that for each sample {τji }(j,i)∈E P, we are only interested in the neighborhood size of the source nodes, i.e., the summation i∈V I {·} in Equation (8), rather than in the individual shortest paths. Fortunately, the neighborhood size estimation problem has been studied in the theoretical computer science literature. Here, we adapt a very efficient randomized algorithm by Cohen (1997) to our influence estimation problem. This randomized algorithm has a computational complexity of O(|E| log |V| + |V| log2 |V|) and it estimates the neighborhood sizes for all possible single source node locations. Since it needs to run once for each sample of {τji }(j,i)∈E , we obtain an overall influence estimation algorithm with O(n|E| log |V| + n|V| log2 |V|) computation, nearly linear in network size. Next we will revisit Cohen’s algorithm for neighborhood estimation. 2.4.1 Randomized Algorithm for Single-Source Neighborhood-Size Estimation Given a fixed set of edge transmission times {τji }(j,i)∈E and a source node s, infected at time zero, the neighborhood N (s, T ) of a source node s given a time window T is the set of nodes within distance T from s, i.e.,   N (s, T ) = i gi {τji }(j,i)∈E ≤ T, i ∈ V . (9) Instead of estimating N (s, T ) directly, the algorithm will assign an exponentially distributed random label ri to each network node i. Then, it makes use of the fact that the minimum of a set of exponential random variables {ri }i∈N (s,T ) is still an exponential random variable, but with its parameter being equal to the total number of variables, that is, if each ri ∼ exp(−ri ), then the smallest label within distance T from source s, r∗ := mini∈N (s,T ) ri , will distribute as r∗ ∼ exp {−|N (s, T )|r∗ }. Suppose we randomize over the labeling m times and obtain m such least labels, {r∗u }m u=1 . Then the neighborhood size can be estimated as m−1 |N (s, T )| ≈ Pm u . u=1 r∗ (10) which is shown by Cohen (1997) to be an unbiased estimator of |N (s, T )|. This is an elegant relation since it allows us to transform the counting problem in (9) to a problem of finding the minimum random label r∗ . The key question is whether we can compute the least label r∗ efficiently, given random labels {ri }i∈V and any source node s. 8 Continuous-Time Influence Maximization of Multiple Items Cohen (1997) designed a modified Dijkstra’s algorithm (Algorithm 3) to construct a data structure r∗ (s), called least label list, for each node s to support such query. Essentially, the algorithm starts with the node i with the smallest label ri , and then it traverses in breadthfirst search fashion along the reverse direction of the graph edges to find all reachable nodes. For each reachable node s, the distance d∗ between i and s, and ri are added to the end of r∗ (s). Then the algorithm moves to the node i0 with the second smallest label ri0 , and similarly find all reachable nodes. For each reachable node s, the algorithm will compare the current distance d∗ between i0 and s with the last recorded distance in r∗ (s). If the current distance is smaller, then the current d∗ and ri0 are added to the end of r∗ (s). Then the algorithm move to the node with the third smallest label and so on. The algorithm is summarized in Algorithm 3 in Appendix B. Algorithm 3 returns a list r∗ (s) per node s ∈ V, which contains information about distance to the smallest reachable labels from s. In particular, each list contains pairs of distance and random labels, (d, r), and these pairs are ordered as ∞ > d(1) > d(2) > . . . > d(|r∗ (s)|) = 0 (11) r(1) < r(2) < . . . < r(|r∗ (s)|) , (12) where {·}(l) denotes the l-th element in the list. (see Appendix B for an example). If we want to query the smallest reachable random label r∗ for a given source s and a time T , we only need to perform a binary search on the list for node s: r∗ = r(l) , where d(l−1) > T ≥ d(l) . (13) Finally, to estimate |N (s, T )|, we generate m i.i.d. collections of random labels, run Algorithm 3 on each collection, and obtain m values {r∗u }m u=1 , which we use in Equation (10) to estimate |N (i, T )|. The computational complexity of Algorithm 3 is O(|E| log |V| + |V| log2 |V|), with expected size of each r∗ (s) being O(log |V|). Then the expected time for querying r∗ is O(log log |V|) using binary search. Since we need to generate m set of random labels and run Algorithm 3 m times, the overall computational complexity for estimating the singlesource neighborhood size for all s ∈ V is O(m|E| log |V| + m|V| log2 |V| + m|V| log log |V|). For large-scale network, and when m  min{|V|, |E|}, this randomized algorithm can be much more efficient than approaches based on directly calculating the shortest paths. 2.4.2 Constructing Estimation for Multiple-Source Neighborhood Size When we have a set of sources, A, its neighborhood is the union of the neighborhoods of its constituent sources [ N (A, T ) = N (i, T ). (14) i∈A This is true because each source independently infects its downstream nodes. Furthermore, to calculate the least label list r∗ corresponding to N (A, T ), we can simply reuse the least label list r∗ (i) of each individual source i ∈ A. More formally, r∗ = mini∈A minj∈N (i,T ) rj , 9 (15) Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song where the inner minimization can be carried out by querying r∗ (i). Similarly, after we obtain m samples of r∗ , we can estimate |N (A, T )| using Equation (10). Importantly, very little additional work is needed when we want to calculate r∗ for a set of sources A, and we can reuse work done for a single source. This is very different from a naive sampling approach where the sampling process needs to be done completely anew if we increase the source set. In contrast, using the randomized algorithm, only an additional constant-time minimization over |A| numbers is needed. 2.4.3 Overall Algorithm So far, we have achieved efficient neighborhood size estimation of |N (A, T )| with respect to a given set of transmission times {τji }(j,i)∈E . Next, we will estimate the influence by averaging over multiple sets of samples for {τji }(j,i)∈E . More specifically, the relation from (8)   m−1 σ(A, T ) = E{τji }(j,i)∈E [|N (A, T )|] = E{τji } E{r1 ,...,rm }|{τji } Pm u , u=1 r∗ (16) suggests the following overall algorithm : Continuous-Time Influence Estimation (ConTinEst): 1. Sample n sets of random transmission times {τijl }(j,i)∈E ∼ Q (j,i)∈E fji (τji ). Q 2. Given a set of {τijl }(j,i)∈E , sample m sets of random labels {riu }i∈V ∼ i∈V exp(−ri ).  P  P ul 3. Estimate σ(A, T ) by sample averages σ(A, T ) ≈ n1 nl=1 (m − 1)/ m r . ul =1 ∗ What is even more important is that the number of random labels, m, does not need to be very large. Since the estimator for |N (A, T )| is unbiased (Cohen, 1997), essentially the outer-loop of averaging over n samples of random transmission times further reduces the variance of the estimator in a rate of O(1/n). In practice, we can use a very small m (e.g., 5 or 10) and still achieve good results, which is also confirmed by our later experiments. Compared to (Chen et al., 2009), the novel application of Cohen’s algorithm arises for estimating influence for multiple sources, which drastically reduces the computation by cleverly using the least-label list from single source. Moreover, we have the following theoretical guarantee (see Appendix C for the proof). Theorem 1 Draw the following number of samples for the set of random transmission times   CΛ 2|V| n ≥ 2 log (17)  α where Λ := maxA:|A|≤C 2σ(A, T )2 /(m − 2) + 2V ar(|N (A, T )|)(m − 1)/(m − 2) + 2a/3 and |N (A, T )| ≤ |V|, and for each set of random transmission times, draw m sets of random labels. Then |b σ (A, T ) − σ(A, T )| ≤  uniformly for all A with |A| ≤ C, with probability at least 1 − α. 10 Continuous-Time Influence Maximization of Multiple Items The theorem indicates that the minimum number of samples, n, needed to achieve certain accuracy is related to the actual size of the influence σ(A, T ), and the variance of the neighborhood size |N (A, T )| over the random draw of samples. The number of random labels, m, drawn in the inner loop of the algorithm will monotonically decrease the dependency of n on σ(A, T ). It suffices to draw a small number of random labels, as long as the value of σ(A, T )2 /(m − 2) matches that of V ar(|N (A, T )|). Another implication is that influence at larger time window T is harder to estimate, since σ(A, T ) will generally be larger and hence require more random samples. 3. Constraints of Practical Importance By treating our proposed influence estimation algorithm ConTinEst as a building block, we can now tackle the influence maximization problem under various constraints of practical importance. Here, since ConTinEst can estimate the influence value of any source set with respect to any given time window T , the Timing Constraints can thus be naturally satisfied. Therefore, in the following sections, we mainly focus on modeling the MultipleItem Constraints, the User Constraints and the Product Constraints. 3.1 Multiple-Item Constraints Multiple products can spread simultaneously across the same set of social entities over different diffusion channels. Since these products may have different characteristics, such as the revenue and the speed of spread, and thus may follow different diffusion dynamics, we will use multiple diffusion networks for different types of products. Suppose we have a set of products L that propagate on the same set of nodes V. The diffusion network for product i is denoted as Gi = (V, Ei ). For each product i ∈ L, we search for a set of source nodes Ri ⊆ V to which we can assign the product i to start its campaign. We can represent the selection of Ri ’s using an assignment matrix A ∈ {0, 1}|L|×|V| as follows: Aij = 1 if j ∈ Ri and Aij = 0 otherwise. Based on this representation, we define a new ground set Z = L × V of size N = |L| × |V|. Each element of Z corresponds to the index (i, j) of an entry in the assignment matrix A, and selecting element z = (i, j) means assigning product i to user j (see Figure 1 for an illustration). We also denote Z∗j = L×{j} and Zi∗ = {i} × V as the j-th column and i-th row of matrix A, respectively. Then, under the above mentioned additional requirements, we would like to find a set of assignments S ⊆ Z so as to maximize the following overall influence f (S) = X ai σi (Ri , Ti ), (18) i∈L where σi (Ri , Ti ) denote the influence of product i for a given time Ti , {ai > 0} is a set of weights reflecting the different benefits of the products and Ri = {j ∈ V : (i, j) ∈ S}. We now show that the overall influence function f (S) in Equation (18) is submodular over the ground set Z. Lemma 2 Under the continuous-time independent cascade model, the overall influence f (S) is a normalized monotone submodular function of S. 11 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song j i Figure 1: Illustration of the assignment matrix A associated with partition matroid M1 and group knapsack constraints. If product i is assigned to user j, then Aij = 1 (colored in red). The ground set Z is the set of indices of the entries in A, and selecting an element (i, j) ∈ Z means assigning product i to user j. The user constraint means that there are at most uj elements selected in the j-th column; the product constraint means that the total cost of the elements selected in the i-th row is at most Bi . Proof By definition, f (∅) = 0 and f (S) is monotone. By Theorem 4 in Gomez-Rodriguez and Schölkopf (2012), the component influence function σi (Ri , Ti ) for product i is submodular in Ri ⊆ V. Since non-negative linear combinations of submodular functions are P still submodular, fi (S) := ai σi (Ri , Ti ) is also submodular in S ⊆ Z = L×V, and f (S) = i∈L fi (S) is submodular. 3.2 User Constraints Each social network user can be a potential source and would like to be exposed only to a small number of ads. Furthermore, users may be grouped according to their geographical locations, and advertisers may have a target population they want to reach. Here, we will incorporate these constraints using the matroids which are combinatorial structures that generalize the notion of linear independence in matrices (Schrijver, 2003; Fujishige, 2005). Formulating our constrained influence maximization task with matroids allows us to design a greedy algorithm with provable guarantees. Formally, suppose that each user j can be assigned to at most uj products. A matroid can be defined as follows: Definition 3 A matroid is a pair, M = (Z, I), defined over a finite set (the ground set) Z and a family of sets (the independent sets) I, that satisfies three axioms: 1. Non-emptiness: The empty set ∅ ∈ I. 2. Heredity: If Y ∈ I and X ⊆ Y , then X ∈ I. 3. Exchange: If X ∈ I, Y ∈ I and |Y | > |X|, then there exists z ∈ Y \ X such that X ∪ {z} ∈ I. 12 Continuous-Time Influence Maximization of Multiple Items An important type of matroid is the partition matroid where the ground set Z is partitioned into disjoint subsets Z1 , Z2 , . . . , Zt for some t and I = {S | S ⊆ Z and |S ∩ Zi | ≤ ui , ∀i = 1, . . . , t} for some given parameters u1 , . . . , ut . The user constraints can then be formulated as Partition matroid M1 : partition the ground set Z into Z∗j = L × {j} each of which corresponds to a column of A. Then M1 = {Z, I1 } is I1 = {S|S ⊆ Z and |S ∩ Z∗j | ≤ uj , ∀j} . 3.3 Product Constraints Seeking initial adopters entails a cost to the advertiser, which needs to be paid to the host, while the advertisers of each product have a limited amount of money. Here, we will incorporate these requirements using knapsack constraints which we describe below. Formally, suppose that each product i has a budget Bi , and assigning item i to user j costs cij > 0. Next, we introduce the following notation to describe product constraints over the ground set Z. For an element z = (i, j) ∈ Z, define its cost as P c(z) := cij . Abusing the notation slightly, we denote the cost of a subset S ⊆ Z as c(S) := z∈S c(z). Then, in a feasible solution S ⊆ Z, the cost of assigning product i, c(S ∩ Zi∗ ), should not be larger than its budget Bi . Now, without loss of generality, we can assume Bi = 1 (by normalizing cij with Bi ), and also cij ∈ (0, 1] (by throwing away any element (i, j) with cij > 1), and define Group-knapsack: partition the ground set into Zi∗ = {i} × V each of which corresponds to one row of A. Then a feasible solution S ⊆ Z satisfies c(S ∩ Zi∗ ) ≤ 1, ∀i. Importantly, these knapsack constraints have very specific structure: they are on different groups of a partition {Zi∗ } of the ground set and the submodular function f (S) = P i ai σi (Ri , Ti ) is defined over the partition. In consequence, such structures allow us to design an efficient algorithm with improved guarantees over the known results. 3.4 Overall Problem Formulation Based on the above discussion of various constraints in viral marketing and our design choices for tackling them, we can think of the influence maximization problem as a special case of the following constrained submodular maximization problem with P = 1 matroid constraints and k = |L| knapsack constraints, maxS⊆Z f (S) (19) subject to c(S ∩ Zi∗ ) ≤ 1, S∈ P \ 1 ≤ i ≤ k, Ip , p=1 where, for simplicity, we will denote all the feasible solutions S ⊆ Z as F. This formulation in general includes the following cases of practical importance : 13 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Uniform User-Cost. An important case of influence maximization, which we denote as the Uniform Cost, is that for each product i, all users have the same cost ci∗ , i.e., cij = ci∗ . Equivalently, each product i can be assigned to at most bi := bBi /ci∗ c users. Then the product constraints are simplified to Partition matroid M2 : for the product constraints with uniform cost, define a matroid M2 = {Z, I2 } where I2 = {S|S ⊆ Z and |S ∩ Zi∗ | ≤ bi , ∀i} . In this case, the influence maximization problem defined by Equation (19) becomes the problem with P = 2 matroid constraints and no knapsack constraints (k = 0). In addition, if we assume only one product needs campaign, the formulation of Equation (19) further reduces to the classic influence maximization problem with the simple cardinality constraint. User Group Constraint. Our formulation in Equation (19) essentially allows for general matroids which can model more sophisticated real-world constraints, and the proposed formulation, algorithms, and analysis can still hold. For instance, suppose there is a hierarchical community structure on the users, i.e., a tree T where leaves are the users and the internal nodes are communities consisting of all users underneath, such as customers in different countries around the world. In consequence of marketing strategies, on each community C ∈ T , there are at most uC slots for assigning the products. Such constraints are readily modeled by the Laminar Matroid, which generalizes the partition matroid by allowing the set {Zi } to be a laminar family (i.e., for any Zi 6= Zj , either Zi ⊆ Zj , or Zj ⊆ Zi , or Zi ∩ Zj = ∅). It can be shown that the community constraints can be captured by the matroid M = (Z, I) where I = {S ⊆ Z : |S ∩ C| ≤ uC , ∀C ∈ T }. In the next section, we first present our algorithm, then provide the analysis for the uniform cost case and finally leverage such analysis for the general case. 4. Influence Maximization In this section, we first develop a simple, practical and intuitive adaptive-thresholding greedy algorithm to solve the continuous-time influence maximization problem with the aforementioned constraints. Then, we provide a detailed theoretical analysis of its performance. 4.1 Overall Algorithm There exist algorithms for submodular maximization under multiple knapsack constraints achieving a 1 − 1e approximation factor by (Sviridenko, 2004). Thus, one may be tempted to convert the matroid constraint in the problem defined by Equation (19) to |V| knapsack constraints, so that the problem becomes a submodular maximization problem under |L| + |V| knapsack constraints. However, this naive approach is not practical for large-scale scenarios because the running time of such algorithms is exponential in the number of knapsack constraints. Instead, if we opt for algorithms for submodular maximization under k knapsack constraints and P matroids constraints, the best approximation factor achieved 1 (Badanidiyuru and Vondrák, 2014). However, by polynomial time algorithms is P +2k+1 14 Continuous-Time Influence Maximization of Multiple Items Algorithm 1: Density Threshold Enumeration 1 2 3 Input: parameter δ; objective f or its approximation fb; assignment cost c(z), z ∈ Z Set d = max {f ({z}) : z ∈ Z}; n o 2d 2d , (1 + δ) P +2k+1 , . . . , P 2|Z|d do for ρ ∈ P +2k+1 +2k+1 Call Algorithm 2 to get Sρ ; Output: argmaxSρ f (Sρ ) this is not good enough yet, since in our problem k = |L| can be large, though P = 1 is small. Here, we will design an algorithm that achieves a better approximation factor by exploiting the following key observation about the structure of the problem defined by Equation (19): the knapsack constraints are over different groups Zi∗ of the whole ground set, and the objective function is a sum of submodular functions over these different groups. The details of the algorithm, called BudgetMax, are described in Algorithm 1. BudgetMax enumerates different values of a so-called density threshold ρ, runs a subroutine to find a solution for each ρ, which quantifies the cost-effectiveness of assigning a particular product to a specific user, and finally outputs the solution with the maximum objective value. Intuitively, the algorithm restricts the search space to be the set of most cost-effective allocations. The details of the subroutine to find a solution for a fixed density threshold ρ are described in Algorithm 2. Inspired by the lazy evaluation heuristic (Leskovec et al., 2007), the algorithm maintains a working set G and a marginal gain threshold wt , which geometrically decreases by a factor of 1 + δ until it is sufficiently small to be set to zero. At each wt , the subroutine selects each new element z that satisfies the following properties: 1. It is feasible and the density ratio (the ratio between the marginal gain and the cost) is above the current density threshold; 2. Its marginal gain f (z|G) := f (G ∪ {z}) − f (G) is above the current marginal gain threshold. The term “density” comes from the knapsack problem, where the marginal gain is the mass and the cost is the volume. A large density means gaining a lot without paying much. In short, the algorithm considers only high-quality assignments and repeatedly selects feasible ones with marginal gain ranging from large to small. Remark 1. The traditional lazy evaluation heuristic also keeps a threshold, however, it only uses the threshold to speed up selecting the element with maximum marginal gain. Instead, Algorithm 2 can add multiple elements z from the ground set at each threshold, and thus reduces the number of rounds from the size of the solution to the number of thresholds O( 1δ log Nδ ). This allows us to trade off between the runtime and the approximation ratio (refer to our theoretical guarantees in section 4.2). 15 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Algorithm 2: Adaptive Threshold Greedy for Fixed Density Input: parameters ρ, δ; objective f or its approximation fb; assignment cost c(z), z ∈ Z;set of feasible solutions F; and d from Algorithm 1. 1 Set dρ = max {f ({z}) : z ∈ Z, f ({z}) ≥ c(z)ρ};   dρ δd 2 Set wt = (1+δ)t for t = 0, . . . , L = argmini wi ≤ N and wL+1 = 0; 3 4 5 6 7 Set G = ∅; for t = 0, 1, . . . , L, L + 1 do for z 6∈ G with G ∪ {z} ∈ F and f (z|G) ≥ c(z)ρ do if f (z|G) ≥ wt then Set G ← G ∪ {z}; Output: Sρ = G Remark 2. Evaluating the influence of the assigned products f is expensive. Therefore, we will use the randomized algorithm in Section 2.4.3 to compute an estimation fb(·) of the quantity f (·). 4.2 Theoretical Guarantees Although our algorithm is quite intuitive, it is highly non-trivial to obtain the theoretical guarantees. For clarity, we first analyze the simpler case with uniform cost, which then provides the base for analyzing the general case. 4.2.1 Uniform Cost As shown at the end of Section 3.4, the influence maximization, in this case, corresponds to the problem defined by Equation (19) with P = 2 and no knapsack constraints. Thus, we can simply run Algorithm 2 with ρ = 0 to obtain a solution G, which is roughly a 1 P +1 -approximation. Intuition. The algorithm greedily selects feasible elements with sufficiently large marginal gain. However, it is unclear whether our algorithm will find good solutions and whether it will be robust to noise. Regarding the former, one might wonder whether the algorithm will select just a few elements while many elements in the optimal solution O will become infeasible and will not be selected, in which case the greedy solution G is a poor approximation. Regarding the latter, we only use the estimation fb of the influence f (i.e., |fb(S) − f (S)| ≤  for any S ⊆ Z), which introduces additional error to the function value. A crucial question, which has not been addressed before (Badanidiyuru and Vondrák, 2014), is whether the adaptive threshold greedy algorithm is robust to such perturbations. Fortunately, it turns out that the algorithm will provably select sufficiently many elements of high quality. First, the elements selected in the optimal solution O but not selected in G can be partitioned into |G| groups, each of which is associated with an element in G. Thus, the number of elements in the groups associated with the first t elements in G, by the property of the intersection of matroids, are bounded by P t. See Figure 2 for an illustration. Second, the marginal gain of each element in G is at least as large as that of any 16 Continuous-Time Influence Maximization of Multiple Items Gt g1 gt−1 g2 g|G| gt G ······ ······ O\G C1 Ct−1 C2 Ct C|G| St i=1 Ci Figure 2: Notation for analyzing Algorithm 2. The elements in the greedy solution G are arranged according to the order in which Algorithm 2 selects them in Step 3. The elements in the optimal solution O but not in the greedy solution G are partitioned into groups {Ct }1≤t≤|G| , where Ct are those elements in O \ G that are still feasible before selecting gt but are infeasible after selecting gt . element in the group associated with it (up to some small error). This means that even if the submodular function evaluation is inexact, the quality of the elements in the greedy solution is still good. The two claims together show that the marginal gain of O \ G is not much larger than the gain of G, and thus G is a good approximation for the problem. Formally, suppose we use an inexact evaluation of the influence f such that |fb(S) − f (S)| ≤  for any S ⊆ Z, let product i ∈ L spread according to a diffusion network Gi = (V, Ei ), and i∗ = argmaxi∈L |Ei |. Then, we have: Theorem 4 Suppose fb is evaluated up to error  = δ/16 with ConTinEst. For influence maximization with uniform cost,  Algorithm 2 (with  ρ = 0) outputs a solution G with f (G) ≥ |Ei∗ |+|V| |L||V| 1−2δ e + δ3 . 3 f (O) in expected time O δ2 The parameter δ introduces a tradeoff between the approximation guarantee and the runtime: larger δ decreases the approximation ratio but results in fewer influence evaluations. Moreover, the runtime has a linear dependence on the network size and the number of products to propagate (ignoring some small logarithmic terms) and, as a consequence, the algorithm is scalable to large networks. Analysis. Suppose G = {g1 , . . . , g|G| } in the order of selection, and let Gt = {g1 , . . . , gt }. Let Ct denote all those elements in O \ G that satisfy the following: they are still feasible before selecting the t-th element gt but are infeasible after selecting gt . Equivalently, Ct are all those elements j ∈ O \ G such that (1) j ∪ Gt−1 does not violate the matroid constraints but (2) j ∪ Gt violates the matroid constraints. In other words, we can think of Ct as the optimal elements “blocked” by gt . Then, we proceed as follows. S By the property of the intersection of matroids, the size of the prefix ti=1 Ct is bounded by P t. As a consequence of this property, for any Q ⊆ Z, the sizes of any two maximal independent subsets T1 and T2 of Q can only differ by a multiplicative factor at most P . This can be realized with the following argument. First, note that any element z ∈ T1 \ T2 , 17 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song {z} ∪ T2 violates at least one of the matroid constraints since T2 is maximal. Then, let {Vi }1≤i≤P denote all elements in T1 \ T2 that violate the i-th matroid, and partition T1 ∩ T2 arbitrarily among these Vi ’s so that they cover T1 . In this construction, the size of each Vi must be at most |T2 |, since otherwise by the Exchange axiom, there would exist z ∈ Vi \ T2 that can be added to T2 , without violating the i-th matroid, leading to a contradiction. Therefore, |T1 | is at most P times |T2 |. St Next, we apply the above property as follows. Let Q be the union of Gt and St i=1 Ct . t On one hand, G is a maximal independent subset of Q, since no element in i=1 S Ct can be added to Gt without violating the matroid constraints. On the other hand,S ti=1 Ct is an independent subset of Q, since it is part of the optimal solution. Therefore, ti=1 Ct has size at most P times |Gt |, which is P t. Note that the properties of matroids are crucial for this analysis, which justifies our formulation using matroids. In summary, we have Pt Claim 1 i=1 |Ci | ≤ P t, for t = 1, . . . , |G|. Now, we consider the marginal gain of each element in Ct associated with gt . First, suppose gt is selected at the threshold τt > 0. Then, any j ∈ Ct has marginal gain bounded by (1 + δ)τt + 2, since otherwise j would have been selected at a larger threshold before τt by the greedy criterion. Second, suppose gt is selected at the threshold wL+1 = 0. Then, any j ∈ Ct has marginal gain approximately bounded by Nδ d. Since the greedy algorithm must pick g1 with fb(g1 ) = d and d ≤ f (g1 ) + , any j ∈ Ct has marginal gain bounded by δ N f (G) + O(). Putting everything together we have: Claim 2 Suppose gt is selected at the threshold τt . Then f (j|Gt−1 ) ≤ (1+δ)τt +4+ Nδ f (G) for any j ∈ Ct . Since the evaluation of the marginal gain of gt should be at least τt , this claims essentially indicates that the marginal gain of j is approximately bounded by that of gt . Since there are not many elements in Ct (Claim 1) and the marginal gain of each of its elements is not much larger than that of gt (Claim 2), we can conclude that the marginal S|G| gain of O \ G = i=1 Ct is not much larger than that of G, which is just f (G). Claim 3 The marginal gain of O \ G satisfies X f (j|G) ≤ [(1 + δ)P + δ]f (G) + (6 + 2δ)P |G|. j∈O\G P Finally, since by submodularity, f (O) ≤ f (O ∪ G) ≤ f (G) + j∈O\G f (j|G), Claim 3 shows that f (G) is close to f (O) up to a multiplicative factor roughly (1 + P ) and additive factor O(P |G|). Given that f (G) > |G|, it leads to roughly a 1/3-approximation for our influence maximization problem by setting  = δ/16 when evaluating fb with ConTinEst. Combining the above analysis and the runtime of the influence estimation algorithm, we have our final guarantee in Theorem 4. Appendix D.1 presents the complete proofs. 4.2.2 General Case In this section, we consider the general case, in which users may have different associated costs. Recall that this case corresponds to the problem defined by Equation (19) with P = 1 matroid constraints and k = |L| group-knapsack constraints. Here, we will show that there is a step in Algorithm 1 which outputs a solution Sρ that is a good approximation. 18 Continuous-Time Influence Maximization of Multiple Items Intuition. The key idea behind Algorithm 1 and Algorithm 2 is simple: spend the budgets efficiently and spend them as much as possible. By spending them efficiently, we mean to only select those elements whose density ratio between the marginal gain and the cost is above the threshold ρ. That is, we assign product i to user j only if the assignment leads to large marginal gain without paying too much. By spending the budgets as much as possible, we mean to stop assigning product i only if its budget is almost exhausted or no more assignments are possible without violating the matroid constraints. Here we make use of the special structure of the knapsack constraints on the budgets: each constraint is only related to the assignment of the corresponding product and its budget, so that when the budget of one product is exhausted, it does not affect the assignment of the other products. In the language of submodular optimization, the knapsack constraints are on a partition Zi∗ of the ground set and the objective function is a sum of submodular functions over the partition. However, there seems to be a hidden contradiction between spending the budgets efficiently and spending them as much as possible. On one hand, efficiency means the density ratio should be large, so the threshold ρ should be large; on the other hand, if ρ is large, there are just a few elements that can be considered, and thus the budget might not be exhausted. After all, if we set ρ to be even larger than the maximum possible value, then no element is considered and no gain is achieved. In the other extreme, if we set ρ = 0 and consider all the elements, then a few elements with large costs may be selected, exhausting all the budgets and leading to a poor solution. Fortunately, there exists a suitable threshold ρ that achieves a good tradeoff between the two and leads to a good approximation. On one hand, the threshold is sufficiently small, so that the optimal elements we abandon (i.e., those with low-density ratio) have a total gain at most a fraction of the optimum; on the other hand, it is also sufficiently large, so that the elements selected are of high quality (i.e., of high-density ratio), and we achieve sufficient gain even if the budgets of some items are exhausted. Theorem 5 Suppose fb is evaluated up to error  = δ/16 with ConTinEst. In Algorithm 1, there exists a ρ such that f (Sρ ) ≥ max {ka , 1} f (O) (2|L| + 2)(1 + 3δ) where ka is the number of active knapsack constraints: ka = |{i : Sρ ∪ {z} 6∈ F, ∀z ∈ Zi∗ }| . e The expected running time is O  |Ei∗ |+|V| δ2 + |L||V| δ4  . 1 Importantly, the approximation factor improves over the best known guarantee P +2k+1 = 1 2|L|+2 for efficiently maximizing submodular functions over P matroids and k general knapsack constraints. Moreover, since the runtime has a linear dependence on the network size, the algorithm easily scales to large networks. As in the uniform cost case, the parameter δ introduces a tradeoff between the approximation and the runtime. 19 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Analysis. The analysis follows the intuition. Pick ρ = solution, and define 2f (O) P +2k+1 , where O is the optimal O− := {z ∈ O \ Sρ : f (z|Sρ ) < c(z)ρ + 2} , O+ := {z ∈ O \ Sρ : z 6∈ O− } . Note that, by submodularity, O− is a superset of the elements in the optimal solution that we abandon due to the density threshold and, by construction, its marginal gain is small: f (O− |Sρ ) ≤ ρc(O− ) + O(|Sρ |) ≤ kρ + O(|Sρ |), where the small additive term O(|Sρ |) is due to inexact function evaluations. Next, we proceed as follows. First, if no knapsack constraints are active, then the algorithm runs as if there were no knapsack constraints (but only on elements with density ratio above ρ). Therefore, we can apply the same argument as in the case of uniform cost (refer to the analysis up to Claim 3 in Section 4.2.1); the only caveat is that we apply the argument to O+ instead of O \ Sρ . Formally, similar to Claim 3, the marginal gain of O+ satisfies f (O+ |Sρ ) ≤ [(1 + δ)P + δ]f (Sρ ) + O(P |Sρ |), where the small additive term O(P |Sρ |) is due to inexact function evaluations. Using 1 that f (O) ≤ f (Sρ ) + f (O− |Sρ ) + f (O+ |Sρ ), we can conclude that Sρ is roughly a P +2k+1 approximation. Second, suppose ka > 0 knapsack constraints are active and the algorithm discovers that the budget of product i is exhausted when trying to add element z to the set Gi = G∩Zi∗ of selected elements at that time. Since c(Gi ∪ {z}) > 1 and each of these elements has density above ρ, the gain of Gi ∪ {z} is above ρ. However, only Gi is included in our final solution, so we need to show that the marginal gain of z is not large compared to that of Gi . To do so, we first realize that the algorithm greedily selects elements with marginal gain above a decreasing threshold wt . Then, since z is the last element selected and Gi is nonempty (otherwise adding z will not exhaust the budget), the marginal gain of z must be bounded by roughly that of Gi , which is at least roughly 21 ρ. Since this holds for all active knapsack ka constraints, then the solution has value at least k2a ρ, which is an P +2k+1 -approximation. Finally, combining both cases, and setting k = |L| and P = 1 as in our problem, we have our final guarantee in Theorem 5. Appendix D.2 presents the complete proofs. 5. Experiments on Synthetic and Real Data In this section, we first evaluate the accuracy of the estimated influence given by ConTinEst and then investigate the performance of influence maximization on synthetic and real networks by incorporating ConTinEst into the framework of BudgetMax. We show that our approach significantly outperforms the state-of-the-art methods in terms of both speed and solution quality. 20 Continuous-Time Influence Maximization of Multiple Items −3 x 10 0.08 200 relative error 100 relative error 0.06 150 Influence Core-perphery 8 0.04 0.02 50 NS ConTinEst 0 2 4 6 8 0 2 10 10 T 6 4 2 3 10 #samples 0 5 10 4 10 20 30 #labels 40 50 20 30 #labels 40 50 20 30 #labels 40 50 −3 x 10 20 0.08 8 10 0.04 0.02 5 NS ConTinEst 0 relative error 0.06 relative error Influence Random 15 2 4 6 8 0 2 10 10 T 6 4 2 3 10 #samples 0 4 10 10 −3 x 10 9 0.08 8 8 6 5 4 0.04 0.02 3 2 1 relative error 0.06 relative error Influence Hierarchy 7 NS ConTinEst 2 4 6 8 T (a) Influence vs. time 10 0 2 10 6 4 2 3 10 #samples 4 10 (b) Influence vs. #samples 0 10 (c) Error vs. #labels Figure 3: Influence estimation for core-periphery, random, and hierarchical networks with 1,024 nodes and 2,048 edges. Column (a) shows estimated influence by NS (near ground truth), and ConTinEst for increasing time window T ; Column (b) shows ConTinEst’s relative error against number of samples with 5 random labels and T = 10; Column (c) reports ConTinEst’s relative error against the number of random labels with 10,000 random samples and T = 10. 21 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song 5.1 Experiments on Synthetic Data We generate three types of Kronecker networks (Leskovec et al., 2010) which are synthetic networks generated by a recursive Kronecker product of a base 2-by-2 parameter matrix with itself to generate self-similar graphs. By tuning the base parameter matrix, we are able to generate the Kronecker networks which can mimic different structural properties of many real networks. In the following, we consider networks of three different types of structures: (i ) core-periphery networks (parameter matrix: [0.9 0.5; 0.5 0.3]), which mimic the information diffusion traces in real-world networks (Gomez-Rodriguez et al., 2011), (ii ) random networks ([0.5 0.5; 0.5 0.5]), typically used in physics and graph theory (Easley and Kleinberg, 2010) and (iii ) hierarchical networks ([0.9 0.1; 0.1 0.9]) (Clauset et al., 2008). Next, we assign a pairwise transmission function for every directed edge in each type of network and set its parameters at random. In our experiments, we use the Weibull distribution from (Aalen et al., 2008),   β t β−1 −(t/α)β f (t; α, β) = e , t ≥ 0, (20) α α where α > 0 is a scale parameter and β > 0 is a shape parameter. The Weibull distribution (Wbl) has often been used to model lifetime events in survival analysis, providing more flexibility than an exponential distribution. We choose α and β from 0 to 10 uniformly at random for each edge in order to have heterogeneous temporal dynamics. Finally, for each type of Kronecker network, we generate 10 sample networks, each of which has different α and β chosen for every edge. 5.1.1 Influence Estimation To the best of our knowledge, there is no analytical solution to the influence estimation given Weibull transmission function. Therefore, we compare ConTinEst with the Naive Sampling (NS) approach by considering the highest degree node in a network as the source, and draw 1,000,000 samples for NS to obtain near ground truth. In Figure 3, Column (a) compares ConTinEst with the ground truth provided by NS at different time window T , from 0.1 to 10 in networks of different structures. For ConTinEst, we generate up to 10,000 random samples (or sets of random waiting times), and 5 random labels in the inner loop. In all three networks, estimation provided by ConTinEst fits the ground truth accurately, and the relative error decreases quickly as we increase the number of samples and labels (Column (b) and Column (c)). For 10,000 random samples with 5 random labels, the relative error is smaller than 0.01. 5.1.2 Influence Maximization with Uniform Cost In this section, we first evaluate the effectiveness of ConTinEst to the classic influence maximization problem where we have only one product to assign with the simple cardinality constraint on the users. We compare to other influence maximization methods developed based on discrete-time diffusion models: traditional greedy by (Kempe et al., 2003), with discrete-time Linear Threshold Model (LT) and Independent Cascade Model (IC) diffusion models, and the heuristic methods SP1M, PMIA and MIA-M by (Chen et al., 2009, 2010a, 2012). For Influmax, since it only supports exponential pairwise transmission functions, 22 400 ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M 400 350 300 influence 300 350 250 200 150 200 250 200 150 150 100 50 50 50 10 20 30 40 0 0 50 10 20 #sources 400 ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M 400 350 350 300 influence 300 30 40 0 0 50 10 20 #sources 250 200 150 30 40 50 4 5 #sources 300 ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M 250 200 250 influence 450 influence ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M 250 100 100 0 0 Influence by Time 300 ConTinEst(Wbl) ConTinEst(Exp) Greedy(IC) SP1M PMIA MIA-M influence 450 influence Influence by Size Continuous-Time Influence Maximization of Multiple Items 200 150 150 100 100 100 50 50 50 0 0 1 2 3 4 0 0 5 1 2 T 3 4 0 0 5 1 2 T (a) Core-periphery 3 T (b) Random (c) Hierarchy Figure 4: Influence σ(A, T ) achieved by varying number of sources |A| and observation window T on the networks of different structures with 1,024 nodes, 2,048 edges and heterogeneous Weibull transmission functions. Top row: influence against #sources by T = 5; Bottom row: influence against the time window T using 50 sources. Uniform Cost x 10 BudgetMax GreedyDegree Random x 10 2.5 influence influence 1.5 4 3 1 Uniform Cost 1.5 1 16 32 # products (a) By products 64 0 4 1.5 1 BudgetMax GreedyDegree Random 0.5 0.5 8 x 10 2 2 0.5 0 4 Uniform Cost 4 2.5 BudgetMax GreedyDegree Random influence 4 2 8 12 16 product constraints 20 (b) By product constraints 0 2 4 6 8 user constraints 10 (c) By user constraints Figure 5: Over the 64 product-specific diffusion networks, each of which has 1,048,576 nodes, the estimated influence (a) for increasing the number of products by fixing the product-constraint at 8 and user-constraint at 2; (b) for increasing product-constraint by user-constraint at 2; and (c) for increasing user-constraint by fixing product-constraint at 8. For all experiments, we have T = 5 time window. we fit an exponential distribution per edge by NetRate (Gomez-Rodriguez et al., 2011). Furthermore, Influmax is not scalable. When the average network density (defined as the average degree per node) of the synthetic networks is ∼ 2.0, the run time for Influmax 23 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song is more than 24 hours. In consequence, we present the results of ConTinEst using fitted exponential distributions (Exp). For the discrete-time IC model, we learn the infection probability within time window T using Netrapalli’s method (Netrapalli and Sanghavi, 2012). The learned pairwise infection probabilities are also served for SP1M and PMIA, which approximately calculate the influence based on the IC model. For the discretetime LT model, we set the weight of each incoming edge to a node u to the inverse of its in-degree, as in previous work (Kempe et al., 2003), and choose each node’s threshold uniformly at random. The top row of Figure 4 compares the expected number of infected nodes against the source set size for different methods. ConTinEst outperforms the rest, and the competitive advantage becomes more dramatic the larger the source set grows. The bottom row of Figure 4 shows the expected number of infected nodes against the time window for 50 selected sources. Again, ConTinEst performs the best for all three types of networks. Next, using ConTinEst as a subroutine for influence estimation, we evaluate the performance of BudgetMax with the uniform-cost constraints on the users. In our experiments we consider up to 64 products, each of which diffuses over one of the above three different types of Kronecker networks with ∼ one million nodes. Further, we randomly select a subset of 512 nodes VS ⊆ V as our candidate target users, who will receive the given products, and evaluate the potential influence of an allocation over the underlying one-million-node networks. For BudgetMax, we set the adaptive threshold δ to 0.01 and the cost per user and product to 1. For ConTinEst, we use 2,048 samples with 5 random labels on each of the product-specific diffusion networks. We repeat our experiments 10 times and report the average performance. We compare BudgetMax with a nodes’ degree-based heuristic, which we refer to as GreedyDegree, where the degree is treated as a natural measure of influence, and a baseline method, which assigns the products to the target nodes randomly. We opt for the nodes’ degree-based heuristic since, in practice, large-degree nodes, such as users with millions of followers in Twitter, are often the targeted users who will receive a considerable payment if he (she) agrees to post the adoption of some products (or ads) from merchants. GreedyDegree proceeds as follows. It first sorts the list of all pairs of products i and nodes j ∈ VS in descending order of node-j’s degree in the diffusion network associated to product i. Then, starting from the beginning of the list, it considers each pair one by one: if the addition of the current pair to the existing solution does not violate the predefined matroid constraints, it is added to the solution, and otherwise, it is skipped. This process continues until the end of the list is reached. In other words, we greedily assign products to nodes with the largest degree. Due to the large size of the underlying diffusion networks, we do not apply other more expensive node centrality measures such as the clustering coefficient and betweenness. Figure 5 summarizes the results. Panel (a) shows the achieved influence against number of products, fixing the budget per product to 8 and the budget per user to 2. As the number of products increases, on the one hand, more and more nodes become assigned, so the total influence will increase. Yet, on the other hand, the competition among products for a few existing influential nodes also increases. GreedyDegree achieves a modest performance, since high degree nodes may have many overlapping children. In contrast, BudgetMax, by taking the submodularity of the problem, the network structure and the diffusion dynamics of the edges into consideration, achieves a superior performance, especially as the number 24 Continuous-Time Influence Maximization of Multiple Items of product (i.e., the competition) increases. Panel (b) shows the achieved influence against the budget per product, considering 64 products and fixing the budget per user to 2. We find that, as the budget per product increases, the performance of GreedyDegree tends to flatten and the competitive advantage of BudgetMax becomes more dramatic. Finally, Panel (c) shows the achieved influence against the budget per user, considering 64 products and fixing the budget per product to 8. We find that, as the budget per user increases, the influence only increases slowly. This is due to the fixed budget per product, which prevents additional new nodes to be assigned. This meets our intuition: by making a fixed number of people watching more ads per day, we can hardly boost the popularity of the product. Additionally, even though the same node can be assigned to more products, there is hardly ever a node that is the perfect source from which all products can efficiently spread. 5.1.3 Influence Maximization with Non-Uniform Cost In this section, we evaluate the performance of BudgetMax under non-uniform cost constraints, using again ConTinEst as a subroutine for influence estimation. Our designing of user-cost aim to mimic a real scenario, where advertisers pay much more money to celebrities with millions of social network followers than to normal citizens. To do so, we let 1/n ci ∝ di where ci is the cost, di is the degree, and n ≥ 1 controls the increasing speed of cost with respect to the degree. In our experiments, we use n = 3 and normalize ci to be within (0, 1]. Moreover, we set the product-budget to a base value from 1 to 10 and add a random adjustment drawn from a uniform distribution U (0, 1). We compare our method to two modified versions of the above mentioned nodes’ degreebased heuristic GreedyDegree and to the same baseline method. In the first modified version of the heuristic, which we still refer to as GreedyDegree, takes both the degree and the corresponding cost into consideration. In particular, it sorts the list of all pairs of products i and nodes j ∈ VS in descending order of degree-cost ratio dj /cj in the diffusion network associated to product i, instead of simply the node-j’s degree, and then proceeds similarly as before. In the second modified version of the heuristic, which we refer as GreedyLocalDegree, we use the same degree-cost ratio but allow the target users to be partitioned into distinct groups (or communities) and pick the most cost-effective pairs within each group locally instead. Figure 6 compares the performance of our method with the competing methods against four factors: (a) the number of products, (b) the budget per product, (c) the budget per user and (d) the time window T , while fixing the other factors. In all cases, BudgetMax significantly outperforms the other methods, and the achieved influence increases monotonically with respect to the factor value, as one may have expected. In addition, in Figure 6(e), we study the effect of the Laminar matroid combined with group knapsack constraints, which is the most general type of constraint we handle in this paper (refer to Section 3.4). The selected target users are further partitioned into K groups randomly, each of which has, Qi , i = 1 . . . K, limit which constrains the maximum allocations allowed in each group. In practical scenarios, each group might correspond to a geographical community or organization. In our experiment, we divide the users into 8 equal-size groups and set Qi = 16, i = 1 . . . K to indicate that we want a balanced allocation in each group. Figure 6(e) shows the achieved influence against the budget per user for K = 8 equally-sized groups and Qi = 16, i = 1 . . . K. In contrast to Figure 6(b), the total 25 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song x 10 1.5 8000 influence influence 10000 4 2 BudgetMax GreedyDegree Random 6000 4000 Non−uniform cost 4 2 BudgetMax GreedyDegree Random 1 0.5 8 16 32 # products 64 (a) By products 8 10 0 1 1.5 2 2.5 product budget 3 (b) By product budgets Non−uniform cost 1 0 2 4 6 8 user constraints 10 (c) By user constraints Non−uniform cost 12000 BudgetMax GreedyDegree Random 10000 6 10 influence influence Non−uniform cost BudgetMax GreedyDegree Random 0.5 2000 0 4 x 10 1.5 influence Non−uniform cost 12000 4 10 8000 6000 4000 BudgetMax GreedyDegree GreedyLocalDegree Random 2000 2 10 2 5 time 10 15 (d) By time 0 2 4 6 8 user constraints 10 (e) By group limits Figure 6: Over the 64 product-specific diffusion networks, each of which has a total 1,048,576 nodes, the estimated influence (a) for increasing the number of products by fixing the product-budget at 1.0 and user-constraint at 2; (b) for increasing product-budget by fixing user-constraint at 2; (c) for increasing user-constraint by fixing product-budget at 1.0; (d) for different time window T; and (e) for increasing user-constraint with group-limit 16 by fixing product-budget at 1.0. 26 Continuous-Time Influence Maximization of Multiple Items Uniform cost Uniform cost 70 1 60 0.8 0.6 time(s) accuracy 50 0.4 40 30 20 0.2 10 BudgetMax(Adaptive) BudgetMax(Lazy) 0 1 5 10 15 20 25 30 35 40 45 50 δ (a) δ vs. accuracy BudgetMax(Adaptive) BudgetMax(Lazy) 0 1 5 10 15 20 25 30 35 40 45 50 δ (b) δ vs. time Figure 7: The relative accuracy and the run-time for different threshold parameter δ. estimated influence does not increase significantly with respect to the budget (i.e., number of slots) per user. This is due to the fixed budget per group, which prevents additional new nodes to be assigned, even though the number of available slots per user increases. 5.1.4 Effects of Adaptive Thresholding In Figure 7, we investigate the impact that the threshold value δ has on the accuracy and runtime of our adaptive thresholding algorithm and compare it with the lazy evaluation method. Note that the performance and runtime of lazy evaluation do not change with respect to δ because it does not depend on it. Panel (a) shows the achieved influence against the threshold δ. As expected, the larger the δ value, the lower the accuracy. However, our method is relatively robust to the particular choice of δ since its performance is always over a 90-percent relative accuracy even for large δ. Panel (b) shows the runtime against the threshold δ. In this case, the larger the δ value, the lower the runtime. In other words, Figure 7 verifies the intuition that δ is able to trade off the solution quality of the allocation with the runtime time. 5.1.5 Scalability In this section, we start with evaluating the scalability of the proposed algorithms on the classic influence maximization problem where we only have one product with the cardinality constraint on the users. We compare it to the state-of-the-art method Influmax (Gomez-Rodriguez and Schölkopf, 2012) and the Naive Sampling (NS) method in terms of runtime for the continuous-time influence estimation and maximization. For ConTinEst, we draw 10,000 samples in the outer loop, each having 5 random labels in the inner loop. We plug ConTinEst as a subroutine into the classic greedy algorithm by (Nemhauser et al., 1978). For NS, we also draw 10,000 samples. The first two experiments are carried out in a single 2.4GHz processor. 27 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song > 24 hours 5 10 4 2 10 time(s) time(s) time(s) 3 3 10 2 10 1 10 1 1 10 ConTinEst 0 2 3 4 NS Influmax 5 6 7 #sources 8 10 ConTinEst 0 10 9 10 1 3 10 2 10 10 1 4 10 10 > 24 hours 5 10 4 10 10 > 24 hours 5 10 2 (a) Core-Periphery 3 4 NS Influmax 5 6 7 #sources 8 ConTinEst 0 10 9 10 1 2 (b) Random 3 4 NS Influmax 5 6 7 #sources 8 9 10 (c) Hierarchy Figure 8: Runtime of selecting increasing number of sources on Kronecker networks of 128 nodes and 320 edges with T = 10. > 24 hours 5 10 4 3 2 10 time(s) time(s) time(s) 4 10 10 3 10 2 10 1 10 1 1 10 ConTinEst 0 2 2.5 NS 3 3.5 density Influmax 4 (a) Core-Periphery 4.5 5 10 ConTinEst 0 10 1.5 3 10 2 10 10 > 24 hours 5 10 4 10 10 1.5 > 24 hours 5 10 2 2.5 NS 3 3.5 density (b) Random Influmax 4 4.5 5 ConTinEst 0 10 1.5 2 2.5 NS 3 3.5 density Influmax 4 4.5 5 (c) Hierarchy Figure 9: Runtime of selecting 10 sources in networks of 128 nodes with increasing density by T = 10. Figure 8 compares the performance of increasingly selecting sources (from 1 to 10) on small Kronecker networks. When the number of selected sources is 1, different algorithms essentially spend time estimating the influence for each node. ConTinEst outperforms other methods by order of magnitude and for the number of sources larger than 1, it can efficiently reuse computations for estimating influence for individual nodes. Dashed lines mean that a method did not finish in 24 hours, and the estimated run time is plotted. Next, we compare the run time for selecting 10 sources with increasing densities (or the number of edges) in Figure 9. Again, Influmax and NS are order of magnitude slower due to their respective exponential and quadratic computational complexity in network density. In contrast, the run time of ConTinEst only increases slightly with the increasing density since its computational complexity is linear in the number of edges. We evaluate the speed on large core-periphery networks, ranging from 100 to 1,000,000 nodes with density 1.5 in Figure 10. We report the parallel run time only for ConTinEst and NS (both are implemented by MPI running on 192 cores of 2.4Ghz) since Influmax is not scalable. In contrast to NS, the performance of ConTinEst increases linearly with the network size and can easily scale up to one million nodes. 28 Continuous-Time Influence Maximization of Multiple Items 6 10 > 48 hours 5 time(s) 10 4 10 3 10 2 10 ConTinEst NS 2 10 3 10 4 10 #nodes 5 10 6 10 Figure 10: For core-periphery networks by T = 10, runtime of selecting 10 sources with increasing network size from 100 to 1,000,000 by fixing 1.5 network density. Uniform Cost 2 Uniform Cost 10 50 time(s) time(s) 45 1 10 40 0 10 4 8 16 32 # products 64 (a) Speed by products 35 4 10 5 10 #nodes (b) Speed by nodes 6 10 Figure 11: Over the 64 product-specific diffusion networks, each of which has 1,048,576 nodes, the runtime (a) of allocating increasing number of products and (b) of allocating 64 products to 512 users on networks of varying size. or all experiments, we have T = 5 time window and fix product-constraint at 8 and user-constraint at 2. 29 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song 3.5 ConTinEst IC LT SP1M PMIA 3 MAE 2.5 2 1.5 1 0.5 10 20 30 T 40 50 Figure 12: In MemeTracker dataset, comparison of the accuracy of the estimated influence in terms of mean absolute error. Finally, we investigate the performance of BudgetMax in terms of runtime when using ConTinEst as subroutine to estimate the influence. We can precompute the data structures and store the samples needed to estimate the influence function in advance. Therefore, we focus only on the runtime for the constrained influence maximization algorithm. BudgetMax runs on 64 cores of 2.4Ghz by using OpenMP to accelerate the first round of the optimization. We report the allocation time for increasing number of products in Figure 11(a), which clearly shows a linear time complexity with respect to the size of the ground set. Figure 11(b) evaluates the runtime of allocation by varying the size of the network from 16,384 to 1,048,576 nodes. 5.2 Experiments on Real Data In this section, we first quantify how well our proposed algorithm can estimate the true influence in the real-world dataset. Then, we evaluate the solution quality of the selected sources for influence maximization under different constraints. We have used the public MemeTracker datasets (Leskovec et al., 2009), which contains more than 172 million news articles and blog posts from 1 million mainstream media sites and blogs. 5.2.1 Influence Estimation We first trace the flow of information from one site to another by using the hyperlinks among articles and posts as in the work of Gomez-Rodriguez et al. (2011); Du et al. (2012). In detail, we extracted 10,967 hyperlink cascades among top 600 media sites. We then evaluate the accuracy of ConTinEst as follows. First, we repeatedly split all cascades into a 80% training set and a 20% test set at random for five times. On each training set, we learn one continuous-time model, which we use for ConTinEst, and a discrete-time model, which we use for the competitive methods: IC, SP1M, PMIA and MIAM-M. For the continuous-time 30 Continuous-Time Influence Maximization of Multiple Items 80 60 70 60 40 influence influence 50 30 50 40 30 20 ConTinEst Greedy(IC) SP1M PMIA MIAM-M 10 0 0 10 20 30 40 ConTinEst(Wbl) Greedy(IC) SP1M PMIA MIA-M 20 10 0 0 50 5 #sources 10 15 20 T (a) Influence vs. #sources (b) Influence vs. time Figure 13: In MemeTracker dataset, (a) comparison of the influence of the selected nodes by fixing the observation window T = 5 and varying the number sources, and (b) comparison of the influence of the selected nodes by fixing the number of sources to 50 and varying the time window. model, we opt for NetRate (Gomez-Rodriguez et al., 2011) with exponential transmission functions (fixing the shape parameter of the Weibull family to be one) to learn the diffusion networks by maximizing the likelihood of the observed cascades. For the discrete-time model, we learn the infection probabilities using the method by Netrapalli and Sanghavi (2012). Second, let C(u) be the set of all cascades where u was the source node. By counting the total number of distinct nodes infected before T in C(u), we can quantify the real influence of node u up to time T . Thus, we can evaluate the quality of the influence estimation by computing the average (across nodes) Mean Absolute Error (MAE) between the real and the estimated influence on the test set, which we show in Figure 12. Clearly, ConTinEst performs the best statistically. Since the length of real cascades empirically conforms to a power-law distribution, where most cascades are very short (2-4 nodes), the gap of the estimation error is not too large. However, we emphasize that such accuracy improvement is critical for maximizing long-term influence since the estimation error for individuals will accumulate along the spreading paths. Hence, any consistent improvement in influence estimation can lead to significant improvement to the overall influence estimation and maximization task, which is further confirmed in the following sections. 5.2.2 Influence Maximization with Uniform Cost We first apply ConTinEst to the continuous-time influence maximization task with the simple cardinality constraint on the users. We evaluate the influence of the selected nodes in the same spirit as influence estimation: the true influence is calculated as the total number of distinct nodes infected before T based on C(u) of the selected nodes. Figure 13 shows that the selected sources given by ConTinEst achieve the best performance as we vary the number of selected sources and the observation time window. 31 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Next, we evaluate the performance of BudgetMax on cascades from Memetracker traced from quotes which are short textual phrases spreading through the websites. Because all published documents containing a particular quote are time-stamped, a cascade induced by the same quote is a collection of times when the media site first mentioned it. In detail, we use the public dataset released by Gomez-Rodriguez et al. (2013), which splits the original Memetracker dataset into groups, each associated to a topic or real-world event. Each group consists of cascades built from quotes which were mentioned in posts containing particular keywords. We considered 64 groups, with at least 100,000 cascades, which play the role of products. Therein, we distinguish well-known topics, such as “Apple” and “Occupy Wall-Street”, or real-world events, such as the Fukushima nuclear disaster in 2013 and the marriage between Kate Middleton and Prince William in 2011. We then evaluate the accuracy of BudgetMax in the following way. First, we evenly split each group into a training and a test set and then learn one continuous-time model and a discrete-time model per group using the training sets. As previously, for the continuoustime model, we opt for NetRate (Gomez-Rodriguez et al., 2011) with exponential transmission functions, and for the discrete-time model, we learn the infection probabilities using the method by Netrapalli and Sanghavi (2012), where the step-length is set to one. Second, we run BudgetMax using both the continuous-time model and the discrete-time model. We refer to BudgetMax with the discrete-time model as the Greedy(discrete) method. Since we do have no ground-truth information about cost of each node, we focus our experiments using a uniform cost. Third, once we have found an allocation over the learned networks, we evaluate the performance of the two methods using the cascades in the test set as follows: given a group-node pair (i, j), let C(j) denote the set of cascades induced by group i that contains node j. Then, we take the average number of nodes coming after j for all the cascades in C(j) as a proxy of the average influence induced by assigning group i to node j. Finally, the influence of an allocation is just the sum of the average influence of each group-node pair in the solution. In our experiments, we randomly select 128 nodes as our target users. Figure 14 summarizes the achieved influence against four factors: (a) the number of products, (b) the budget per product, (c) the budget per user and (d) the time window T, while fixing the other factors. In comparison with the Greedy(IC) and a random allocation, BudgetMax finds an allocation that indeed induces the largest diffusion in the test data, with an average 20-percent improvement overall. In the end, Figure 15 investigates qualitatively the actual allocations of groups (topics or real-world events; in red) and sites (in black). Here, we find examples that intuitively one could expect: “japantoday.com” is assigned to Fukushima Nuclear disaster or “finance.yahoo.com” is assigned to “Occupy Wall-street”. Moreover, because we consider several topics and real-world events with different underlying diffusion networks, the selected nodes are not only very popular media sites such as nytimes.com or cnn.com but also several modest sites (Bakshy et al., 2011), often specialized or local, such as freep.com or localnews8.com. 32 Continuous-Time Influence Maximization of Multiple Items Uniform cost influence 3000 Uniform cost 4000 BudgetMax Greedy(discrete) Random 3000 influence 4000 2000 1000 2000 1000 0 4 8 16 32 # products 0 4 64 (a) By products 3000 1200 2500 1000 2000 1500 BudgetMax Greedy(discrete) Random 8 16 32 # user constraints (c) By user constraints 64 Uniform cost 1400 influence influence Uniform cost 1000 8 16 32 # product constraints (b) By product constraints 3500 500 4 BudgetMax Greedy(discrete) Random 800 BudgetMax Greedy(discrete) Random 600 400 64 200 2 5 time (d) By time 10 15 Figure 14: Over the inferred 64 product-specific diffusion networks, the true influence estimated from separated testing data (a) for increasing the number of products by fixing the product-constraint at 8 and user-constraint at 2; (b) for increasing product-constraint by fixing user-constraint at 2; (c) for increasing user-constraint by fixing product-constraint at 8; (d) for different time window T. 6. Conclusion We have studied the influence estimation and maximization problems in the continuous-time diffusion model. We first propose a randomized influence estimation algorithm ConTinEst, which can scale up to networks of millions of nodes while significantly improves over previous state of the art methods in terms of the accuracy of the estimated influence. Once we have a subroutine for efficient influence estimation in large networks, we then tackle the problem of maximizing the influence of multiple types of products (or information) in 33 e Up ris als et Al -Q ae da an y Se Sy ri Nav om om Fukush mlive.c s8.c m es m co .co m .co dailybre io . es nda il 0. gsto 13 di ar tim livin al1 co sta n me wg du c lo hin ele lnew loca ima Nu clear Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song c Oc y up e nc Pri y.co m internationalentertainment.blogspot.com obs ve J rotests Europe Debt om dalje.c m h.co kwc g .or ub h s m co icle s. art w ne bf m w fina ntr m om m uk . l.co te.com daytondailynews.com co .co ay nd om .c ne m ily. oo.c es ily .yah ed a co tim oca uts a n. ny tod an jap rnel advoca ws .c om ieg o.c om free p.co m hurriye tdailyn ews.co m cn newark da nce ce bou or m' Mass P m ng ing dd e sW llia Wi Ste eze.co ba a W tre lls Figure 15: The allocation of memes to media sites. realistic continuous-time diffusion networks subject to various practical constraints: different products can have different diffusion structures; only influence within a given time window is considered; each user can only be recommended a small number of products; and each product has a limited campaign budget, and assigning it to users incurs costs. We provide a novel formulation as a submodular maximization under an intersection of matroid constraints and group-knapsack constraints, and then design an efficient adaptive threshold greedy algorithm with provable approximation guarantees, which we call BudgetMax. Experimental results show that the proposed algorithm performs remarkably better than other scalable alternatives in both synthetic and real-world datasets. There are also a few interesting open problems. For example, when the influence is estimated using ConTinEst, its error is a random variable. How does this affect the submodularity of the influence function? Is there an influence maximization algorithm that has better tolerance to the random error? These questions are left for future work. 34 Continuous-Time Influence Maximization of Multiple Items Acknowledgments Nan Du is supported by the Facebook Graduate Fellowship 2014-2015. Maria-Florina Balcan and Yingyu Liang are supported in part by NSF grant CCF-1101283 and CCF-0953192, AFOSR grant FA9550-09-1-0538, ONR grant N00014-09-1-075, a Microsoft Faculty Fellowship, and a Raytheon Faculty Fellowship. Le Song is supported in part by NSF/NIH BIGDATA 1R01GM108341, ONR N00014-15-1-2340, NSF IIS-1218749, NSF CAREER IIS1350983, Nvidia and Intel. Hongyuan Zha is supported in part by NSF/NIH BIGDATA 1R01GM108341, NSF DMS-1317424 and NSF CNS-1409635. References Odd Aalen, Oernulf Borgan, and Håkon K Gjessing. Survival and event history analysis: a process point of view. Springer, 2008. Ashwinkumar Badanidiyuru and Jan Vondrák. Fast algorithms for maximizing submodular functions. In SODA. SIAM, 2014. Eytan Bakshy, Jake M. Hofman, Winter A. Mason, and Duncan J. Watts. Everyone’s an influencer: Quantifying influence on twitter. In WSDM, pages 65–74, 2011. Christian Borgs, Michael Brautbar, Jennifer Chayes, and Brendan Lucier. Influence maximization in social networks: Towards an optimal algorithmic solution. arXiv preprint arXiv:1212.0884, 2012. Wei Chen, Yajun Wang, and Siyu Yang. Efficient influence maximization in social networks. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 199–208. ACM, 2009. Wei Chen, Chi Wang, and Yajun Wang. Scalable influence maximization for prevalent viral marketing in large-scale social networks. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 1029–1038. ACM, 2010a. Wei Chen, Yifei Yuan, and Li Zhang. Scalable influence maximization in social networks under the linear threshold model. In Data Mining (ICDM), 2010 IEEE 10th International Conference on, pages 88–97. IEEE, 2010b. Wei Chen, Alex Collins, Rachel Cummings, Te Ke, Zhenming Liu, David Rincon, Xiaorui Sun, Yajun Wang, Wei Wei, and Yifei Yuan. Influence maximization in social networks when negative opinions may emerge and propagate. In SDM, pages 379–390. SIAM, 2011. Wei Chen, Wei Lu, and Ning Zhang. Time-critical influence maximization in social networks with time-delayed diffusion process. In AAAI, 2012. Aaron Clauset, Cristopher Moore, and M.E.J. Newman. Hierarchical structure and the prediction of missing links in networks. Nature, 453(7191):98–101, 2008. 35 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Edith Cohen. Size-estimation framework with applications to transitive closure and reachability. Journal of Computer and System Sciences, 55(3):441–453, 1997. Samik Datta, Anirban Majumder, and Nisheeth Shrivastava. Viral marketing for multiple products. In Proceedings of the 2010 IEEE International Conference on Data Mining, pages 118–127, 2010. Nan Du, Le Song, Alex Smola, and Ming Yuan. Learning networks of heterogeneous influence. In Advances in Neural Information Processing Systems 25, pages 2789–2797, 2012. Nan Du, Le Song, Manuel Gomez-Rodriguez, and Hongyuhan Zha. Scalable influence estimation in continuous time diffusion networks. In Advances in Neural Information Processing Systems 26, 2013a. Nan Du, Le Song, Hyenkyun Woo, and Hongyuan Zha. Uncover topic-sensitive information diffusion networks. In Artificial Intelligence and Statistics (AISTATS), 2013b. David Easley and Jon Kleinberg. Networks, Crowds, and Markets: Reasoning About a Highly Connected World. Cambridge University Press, 2010. Satoru Fujishige. Submodular functions and optimization, volume 58. Elsevier Science Limited, 2005. Manuel Gomez-Rodriguez and Bernhard Schölkopf. Influence maximization in continuous time diffusion networks. In Proceedings of the 29th International Conference on Machine Learning, pages 313–320, 2012. Manuel Gomez-Rodriguez, David Balduzzi, and Bernhard Schölkopf. Uncovering the temporal dynamics of diffusion networks. In Proceedings of the 28th International Conference on Machine Learning, 2011. Manuel Gomez-Rodriguez, Jure Leskovec, and Bernhard Schölkopf. Structure and Dynamics of Information Pathways in On-line Media. In Proceedings of the 6th International Conference on Web Search and Web Data Mining, 2013. Amit Goyal, Wei Lu, and Laks V. S. Lakshmanan. Celf++: optimizing the greedy algorithm for influence maximization in social networks. In WWW (Companion Volume), pages 47– 48, 2011a. Amit Goyal, Wei Lu, and Laks V. S. Lakshmanan. Simpath: An efficient algorithm for influence maximization under the linear threshold model. In ICDM, pages 211–220, 2011b. Dino Ienco, Francesco Bonchi, and Carlos Castillo. The meme ranking problem: Maximizing microblogging virality. In ICDM Workshops, 2010. David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a social network. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 137–146. ACM, 2003. 36 Continuous-Time Influence Maximization of Multiple Items Jure Leskovec, Andreas Krause, Carlos Guestrin, Christos Faloutsos, Jeanne VanBriesen, and Natalie Glance. Cost-effective outbreak detection in networks. In P. Berkhin, R. Caruana, and X. Wu, editors, Conference on Knowledge Discovery and Data Mining, pages 420–429. ACM, 2007. URL http://doi.acm.org/10.1145/1281192.1281239. Jure Leskovec, Lars Backstrom, and Jon Kleinberg. Meme-tracking and the dynamics of the news cycle. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 497–506. ACM, 2009. Jure Leskovec, Deepayan Chakrabarti, Jon Kleinberg, Christos Faloutsos, and Zoubin Ghahramani. Kronecker graphs: An approach to modeling networks. Journal of Machine Learning Research, 11(Feb):985–1042, 2010. Wei Lu, Francesco Bonchi, Goyal Amit, and Laks V. S. Lakshmanan. The bang for the buck: fair competitive viral marketing from the host perspective. In KDD, pages 928–936, 2013. Ramasuri Narayanam and Amit A Nanavati. Viral marketing for product cross-sell through social networks. In Machine Learning and Knowledge Discovery in Databases. 2012. George Nemhauser, Laurence Wolsey, and Marshall Fisher. An analysis of the approximations for maximizing submodular set functions. Mathematical Programming, 14:265–294, 1978. Praneeth Netrapalli and Sujay Sanghavi. Learning the graph of epidemic cascades. In SIGMETRICS/PERFORMANCE, pages 211–222. ACM, 2012. ISBN 978-1-4503-1097-0. Matthew Richardson and Pedro Domingos. Mining knowledge-sharing sites for viral marketing. In Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 61–70. ACM, 2002. Alexander Schrijver. Combinatorial Optimization, volume 24 of Algorithms and Combinatorics. Springer, 2003. Tasuku Soma, Naonori Kakimura, Kazuhiro Inaba, and Ken-ichi Kawarabayashi. Optimal budget allocation: Theoretical guarantee and efficient algorithm. In Proceedings of The 31st International Conference on Machine Learning, pages 351–359, 2014. Tao Sun, Wei Chen, Zhenming Liu, Yajun Wang, Xiaorui Sun, Ming Zhang, and Chin-Yew Lin. Participation maximization based on social influence in online discussion forums. In Proceedings of the International AAAI Conference on Weblogs and Social Media, 2011. Maxim Sviridenko. A note on maximizing a submodular set function subject to knapsack constraint. Operations Research Letters, 32:41–43, 2004. 37 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Appendix A. Naive Sampling Algorithm The graphical model perspective described in Section 2.2 suggests a naive sampling (NS) algorithm for approximating σ(A, T ): n o n l 1. Draw n samples, τji , i.i.d. from the waiting time product distribution (j,i)∈E l=1 Q (j,i)∈E fji (τji ); 2. For each sample n o l τji and for each node i, find the shortest path from source n o  l nodes to node i; count the number of nodes with gi τji ≤ T; (j,i)∈E (j,i)∈E 3. Average the counts across n samples. Although the naive sampling algorithm can handle arbitrary transmission function, it is not scalable to networks with millions of nodes. We need to compute the shortest path for each node and each sample, which results in a computational complexity of O(n|E| + n|V| log |V|) for a single source node. The problem is even more pressing in the influence maximization problem, where we need to estimate the influence of source nodes at different location and with increasing number of source nodes. To do this, the algorithm needs to be repeated, adding a multiplicative factor of C|V| to the computational complexity (C is the number of nodes to select). Then, the algorithm becomes quadratic in the network size. When the network size is in the order of thousands and millions, typical in modern social network analysis, the naive sampling algorithm become prohibitively expensive. Additionally, we may need to draw thousands of samples (n is large), further making the algorithm impractical for large-scale problems. Appendix B. Least Label List The notation “argsort((r1 , . . . , r|V| ), ascend)” in line 2 of Algorithm 3 means that we sort the collection of random labels in ascending order and return the argument of the sort as an ordered list. • Node labeling : e(0.2) < b(0.3) < d(0.4) < a(1.5) < c(1.8) < g(2.2) < f (3.7) 2 ))252) ))553)1 ))554) 3 ))15)) • Neighborhoods: N (c, 2) = {a, b, c, e}; N (c, 3) = {a, b, c, d, e, f }; 2 2 4 555 1 ))155) • Least-label list: r∗ (c) : (2, 0.2), (1, 0.3), (0.5, 1.5), (0, 1.8) 1 ))35)) • Query: r∗ (c, 0.8) = r(a) = 1.5 ))552) Figure 16: Graph G = (V, E), edge weights {τji }(j,i)∈E , and node labeling {ri }i∈V with the associated output from Algorithm 3. 38 Continuous-Time Influence Maximization of Multiple Items Algorithm 3: Least Label List Input: a reversed directed graph G = (V, E) with edge weights {τji }(j,i)∈E , a node labeling {ri }i∈V Output: A list r∗ (s) for each s ∈ V 1 for each s ∈ V do ds ← ∞, r∗ (s) ← ∅ 2 for i in argsort((r1 , . . . , r|V| ), ascend) do 3 empty heap H ← ∅; 4 set all nodes except i as unvisited; 5 push (0, i) into heap H; 6 while H 6= ∅ do 7 pop (d∗ , s) with the minimum d∗ from H; 8 add (d∗ , ri ) to the end of list r∗ (s); 9 ds ← d∗ ; 10 for each unvisited out-neighbor j of s do 11 set j as visited; 12 if (d, j) in heap H then 13 Pop (d, j) from heap H; 14 Push (min {d, d∗ + τjs } , j) into heap H; 15 else if d∗ + τjs < dj then 16 Push (d∗ + τjs , j) into heap H; Figure 16 shows an example of the Least-Label-List. The nodes from a to g are assigned to exponentially distributed labels with mean one shown in each parentheses. Given a query distance 0.8 for node c, we can binary-search its Least-label-list r∗ (c) to find that node a belongs to this range with the smallest label r(a) = 1.5. Appendix C. Theorem 1 Theorem 1 Sample the following number of sets of random transmission times   CΛ 2|V| n > 2 log  α where Λ := maxA:|A|≤C 2σ(A, T )2 /(m − 2) + 2V ar(|N (A, T )|)(m − 1)/(m − 2) + 2a/3, |N (A, T )| 6 a, and for each set of random transmission times, sample m set of random labels. Then we can guarantee that |b σ (A, T ) − σ(A, T )| 6  simultaneously for all A with |A| 6 C, with probability at least 1 − α. Proof Let Sτ := |N (A, T )| for a fixed set of {τji } and then σ(A, T ) = Eτ [Sτ ]. The randomized estimator Sbτ = (m − Pm ualgorithm with mbrandomizations produces an bunbiased 2 1)/( u=1 r∗ ) for Sτ , i.e., Er|τ [Sτ ] = Sτ , with variance Er|τ [(Sτ −Sτ ) ] = Sτ2 /(m−2) (Cohen, 1997). 39 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song Then Sbτ is also an unbiased estimator for σ(A, T ), since Eτ,r [Sbτ ] = Eτ Er|τ [Sbτ ] = Eτ [Sτ ] = σ(A, T ). Its variance is V ar(Sbτ ) := Eτ,r [(Sbτ − σ(A, T ))2 ] = Eτ,r [(Sbτ − Sτ + Sτ − σ(A, T ))2 ] = Eτ,r [(Sbτ − Sτ )2 ] + 2 Eτ,r [(Sbτ − Sτ )(Sτ − σ(A, T ))] + Eτ,r [(Sτ − σ(A, T ))2 ] = Eτ [Sτ2 /(m − 2)] + 0 + V ar(Sτ ) = σ(A, T )2 /(m − 2) + V ar(Sτ )(m − 1)/(m − 2) Then using Bernstein’s inequality, we have, for our final estimator σ b(A, T ) = that ! n2 Pr {|b σ (A, T ) − σ(A, T )| > } 6 2 exp − 2V ar(Sbτ ) + 2a/3 1 n Pn l=1 Sτ l , b (21) where Sbτ < a 6 |V|. Setting the right hand side of relation (21) to α, we have that, with probability 1 − α, sampling the following number sets of random transmission times   2 2V ar(Sbτ ) + 2a/3 log n> 2  α   2 2σ(A, T ) /(m − 2) + 2V ar(Sτ )(m − 1)/(m − 2) + 2a/3 2 = log 2  α we can guarantee that our estimator to have error |b σ (A, T ) − σ(A, T )| 6 . If we want to insure that |b σ (A, T ) − σ(A, T )| 6  simultaneously hold for all A such that |A| 6 C  |V|, we can first use union bound with relation (21). In this case, we have that, with probability 1 − α, sampling the following number sets of random transmission times   2|V| CΛ n > 2 log  α we can guarantee that our estimator to have error |b σ (A, T ) − σ(A, T )| 6  for all A with |A| 6 C. Note that we have define the constant Λ := maxA:|A|≤C 2σ(A, T )2 /(m − 2) + 2V ar(Sτ )(m − 1)/(m − 2) + 2a/3. Appendix D. Complete Proofs for Section 4 D.1 Uniform Cost In this section, we first prove a theorem for the general problem defined by Equation (19), considering a normalized monotonic submodular function f (S) and general P (Theorem 7) and k = 0, and then obtain the guarantee for our influence maximization problem (Theorem 4). 40 Continuous-Time Influence Maximization of Multiple Items  Suppose G = g1 , . . . , g|G| in the order of selection, and let Gt = {g1 , . . . , gt }. Let Ct denote all those elements in O \ G that satisfy the following: they are still feasible before selecting the t-th element gt but are infeasible after selecting gt . Formally,  Ct = z ∈ O \ G : {z} ∪ Gt−1 ∈ F, {z} ∪ Gt 6∈ F . In the following, we will prove three claims and then use them to prove the Theorems 7 and 4. Recall that for any i ∈ Z and S ⊆ Z, the marginal gain of z with respect to S is denoted as f (z|S) := f (S ∪ {z}) − f (S) and its approximation is denoted by fb(z|S) = fb(S ∪ {z}) − fb(S). Also, when |f (S) − fb(S)| ≤  for any S ⊆ Z, we have |fb(z|S) − f (z|S)| ≤ 2 for any z ∈ Z and S ⊆ Z. Pt Claim 1. i=1 |Ci | ≤ P t, for t = 1, . . . , |G|. Proof We first show the following property about matroids: for any Q ⊆ Z, the sizes of any two maximal independent subsets T1 and T2 of Q can only differ by a multiplicative factor at most P . Here, T is a maximal independent subset of Q if and only if: • T ⊆ Q; • T ∈F = TP i=1 Ip ; • T ∪ {z} 6∈ F for any z ∈ Q \ T . To prove the property, note that for any element z ∈ T1 \ T2 , {z} ∪ T2 violates at least one of the matroid constraints since T2 is maximal. Let {Vi }1≤i≤P denote all elements in T1 \ T2 that violate the i-th matroid, and then partition T1 ∩ T2 using these Vi ’s so that they cover T1 . Note that the size of each Vi must be at most that of T2 , since otherwise by the Exchange axiom, there would exist z ∈ Vi \ T2 that can be added to T2 without violating the i-th matroid, leading to a contradiction. Therefore, |T1 | is at most P times |T2 |. St Now we apply the property to prove the claim. Let Q be the union of Gt and St i=1 Ct . t On one hand, G is a maximal independent subset of Q, since no element in i=1 S Ct can be added to Gt without violating the matroid constraints. On the other hand,S ti=1 Ct is an independent subset of Q, since it is part of the optimal solution. Therefore, ti=1 Ct has size at most P times |Gt |, which is P t. Claim 2. Suppose gt is selected at the threshold τt . Then, f (j|Gt−1 ) ≤ (1 + δ)τt + 4 + δ N f (G), ∀j ∈ Ct . Proof First, consider τt > wL+1 = 0. Since gt is selected at the threshold τt , we have that fb(gt |Gt−1 ) ≥ τt and thus f (gt |Gt−1 ) ≥ τt − 2. Any j ∈ Ct could have been selected at an 41 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song earlier stage, since adding j to Gt−1 would not have violated the constraint. However, since j 6∈ Gt−1 , that means that fb(j|Gt−1 ) ≤ (1 + δ)τt . Then, f (j|Gt−1 ) ≤ (1 + δ)τt + 2. Second, consider τt = wL+1 = 0. For each j ∈ Ct , we have fb(j|G) < greedy algorithm must pick g1 with fb(g1 ) = d and d ≤ f (g1 ) + , then δ N d. Since the δ f (G) + 4. N The claim follows by combining the two cases. f (j|G) < Claim 3. The marginal gain of O \ G satisfies X f (j|G) ≤ [(1 + δ)P + δ]f (G) + (6 + 2δ)P |G|. j∈O\G Proof Combining Claim 1 and Claim 2, we have: X j∈O\G f (j|G) = |G| X X f (j|G) ≤ (1 + δ) |G| X |Ct |τt + δf (G) + 4 t=1 t=1 j∈Ct ≤ (1 + δ) |G| X |G| X |Ct | t=1 |Ct |τt + δf (G) + 4P |G|. t=1 P|G| P|G| Further, t=1 |Ct |τt ≤ P t=1 τt by Claim 1Pand a technicalP lemma (Lemma 6). Finally, the claim follows from the fact that f (G) = t f (gt |Gt−1 ) ≥ t (τt − 2). Pt Lemma 6 If i=1 σi−1 ≤ tPfor t = 1, . . . , K and ρi−1 ≥ ρi for i = 1, . . . , K − 1 with P K ρi , σi ≥ 0, then K i=1 ρi−1 . i=1 ρi σi ≤ Proof Consider the linear program V = s.t. max σ K X ρi σi i=1 t X σi−1 ≤ t, t = 1, . . . , K, i=1 σi ≥ 0, i = 1, . . . , K − 1 with dual W = s.t. min u K−1 X K X tut−1 i=1 ut ≥ ρi , i = 0, . . . , K − 1, t=i ut ≥ 0, t = 0, . . . , K − 1. 42 Continuous-Time Influence Maximization of Multiple Items As ρi ≥ ρi+1 , thePsolution ui = ρi − ρP i+1 , i = 0, . . . , K − 1 (where ρK = 0) is dual feaK K t(ρ − ρ ) = sible with value t i=1 ρi−1 . By weak linear programming duality, t=1 P t−1 PK K i=1 ρi−1 . i=1 ρi σi ≤ V ≤ W ≤ Theorem 7 Suppose we use Algorithm 2 to solve the problem defined by Equation (19) with k = 0, using ρ = 0 and fb to estimate the function f , where |fb(S) − f (S)| ≤  for all S ⊆ Z. It holds that the algorithm returns a greedy solution G with f (G) ≥ 1 4P |G| f (O) −  (1 + 2δ)(P + 1) P + cf where O is the optimal solution, using O( Nδ log Nδ ) evaluations of fb. Proof By submodularity and Claim 3, we have: X f (O) ≤ f (O ∪ G) ≤ f (G) + f (j|G) ≤ (1 + δ)(P + 1)f (G) + (6 + 2δ)P |G|, j∈O\G which leads to the bound in the theorem. Since there are O( 1δ log Nδ ) thresholds, and there are O(N ) evaluations at each threshold, the number of evaluations is bounded by O( Nδ log Nδ ). Theorem 7 essentially shows f (G) is close to f (O) up to a factor roughly (1 + P ), which then leads to the following guarantee for our influence maximization problem. Suppose product i ∈ L spreads according to diffusion network Gi = (V, Ei ), and let i∗ = argmaxi∈L |Ei |. Theorem 4. In the influence maximization problem with uniform cost, Algorithm 2 (with ρ  = 0) is able to  output a solution G that satisfies f (G) ≥ 1−2δ 3 f (O) in expected time |Ei∗ |+|V| |L||V| e O . + 3 2 δ δ Proof In the influence maximization problem, the number of matroids is P = 2. Also note that |G| ≤ f (G) ≤ f (O), which leads to 4|G| ≤ 4f (O). The approximation guarantee then follows from setting  ≤ δ/16 when using ConTinEst (Du et al., 2013a) to estimate the influence. The runtime is bounded as follows. In Algorithm 2, we need to estimate the marginal gain of adding one more product to the current solution. In ConTinEst (Du et al., 2013a), building the initial data structure takes time   1 |V| 2 O (|Ei∗ | log |V| + |V| log |V|) 2 log δ δ and afterwards each function evaluation takes time   1 |V| O log log |V| . log δ2 δ  As there are O Nδ log Nδ evaluations where N = |L||V|, the runtime of our algorithm follows. 43 Du, Liang, Balcan, Gomez-Rodriguez, Zha and Song D.2 General case As in the previous section, we first prove that a theorem for the problem defined by Equation (19) with general normalized monotonic submodular function f (S) and general P (Theorem 8), and then obtain the guarantee for our influence maximization problem (Theorem 5). Theorem 8 Suppose Algorithm 1 uses fb to estimate the function f which satisfies |fb(S) − f (S)| ≤  for all S ⊆ Z. Then, there exists a ρ such that f (Sρ ) ≥ max {1, |Aρ |} f (O) − 8|Sρ | (P + 2k + 1)(1 + 2δ) where Aρ is the set of active knapsack constraints: Aρ = {i : Sρ ∪ {z} 6∈ F, ∀z ∈ Zi∗ }. 2 f (O). By submodularity, we Proof Consider the optimal solution O and set ρ∗ = P +2k+1 h i 2|Z|d 2d have d ≤ f (O) ≤ |Z|d, so ρ ∈ P +2k+1 , P +2k+1 , and there is a run of Algorithm 2 with ρ such that ρ∗ ∈ [ρ, (1 + δ)ρ]. In the following we consider this run. Case 1 Suppose |Aρ | = 0. The key observation in this case is that since no knapsack constraints are active, the algorithm runs as if there were only matroid constraints. Then, the argument for matroid constraints can be applied. More precisely, let O+ := {z ∈ O \ Sρ : f (z|Sρ ) ≥ c(z)ρ + 2} O− := {z ∈ O \ Sρ : z 6∈ O+ } . Note that all elements in O+ are feasible. Following the argument of Claim 3 in Theorem 7, we have: f (O+ |Sρ ) ≤ ((1 + δ)P + δ)f (Sρ ) + (4 + 2δ)P |Sρ |. (22) Also, by definition, the marginal gain of O− is: f (O− |Sρ ) ≤ kρ + 2|O− | ≤ kρ + 2P |Sρ |, (23) where the last inequality follows from the fact that Sρ is a maximal independent subset, O− is an independent subset of O ∪ Sρ , and the sizes of any two maximal independent subsets in the intersection of P matroids can differ by a factor of at most P . Plugging (22)(23) into f (O) ≤ f (O+ |Sρ ) + f (O− |Sρ ) + f (Sρ ), we obtain the bound f (Sρ ) ≥ (6 + 2δ)P |Sρ | f (O) − . (P + 2k + 1)(1 + δ) (P + 1)(1 + δ) Case 2 Suppose |Aρ | > 0. For any i ∈ Aρ (i.e., the i-th knapsack constraint is active), consider the step when i is added to Aρ . Let Gi = G ∩ Zi∗ , and we have c(Gi ) + c(z) > 1. 44 Continuous-Time Influence Maximization of Multiple Items Since every element g we include in Gi satisfies fb(g|G) ≥ c(g)ρ with respect to the solution Gi when g is added. Then f (g|G) = fi (g|Gi ) ≥ c(g)ρ − 2, and we have: fi (Gi ∪ {z}) ≥ ρ[c(Gi ) + c(z)] − 2(|Gi | + 1) > ρ − 2(|Gi | + 1). (24) Note that Gi is non-empty since otherwise the knapsack constraint will not be active. Any element in Gi is selected before or at wt , so fi (Gi ) ≥ wt − 2. Also, note that z is not selected in previous thresholds before wt , so fi ({z} |Gi ) ≤ (1 + δ)wt + 2 and thus, fi ({z} |Gi ) ≤ (1 + δ)fi (Gi ) + 2(2 + δ). (25) Combining Eqs. 24 and 25 into fi (Gi ∪ {z}) = fi (Gi ) + fi ({z} |Gi ) leads to fi (Gi ) ≥ 2(|Gi | + 3 + δ) 1 2(|Gi | + 3 + δ) ρ − ≥ ρ∗ − (2 + δ) (2 + δ) 2(1 + 2δ) (2 + δ) f (O) ≥ − 5|Gi |. (P + 2k + 1)(1 + 2δ) Summing up over all i ∈ Aρ leads to the desired bound. Suppose item i ∈ L spreads according to the diffusion network Gi = (V, Ei ). Let i∗ = argmaxi∈L |Ei |. By setting  = δ/16 in Theorem 8, we have: Theorem 5. In Algorithm 1, there exists a ρ such that f (Sρ ) ≥ max {ka , 1} f (O) (2|L| + 2)(1 + 3δ) where ka is the  number of active  knapsack constraints. The expected runtime to obtain the |L||V| |Ei∗ |+|V| e solution is O + δ4 . δ2 45
8cs.DS
arXiv:1211.1477v1 [math.AC] 7 Nov 2012 ON THE FINITENESS AND STABILITY OF CERTAIN SETS OF ASSOCIATED PRIME IDEALS OF LOCAL COHOMOLOGY MODULES Nguyen Tu Cuonga and Nguyen Van Hoangb,c a Institute of Mathematics, Hanoi, Vietnam Thai Nguyen University of Education, Thai Nguyen, Vietnam c Meiji Institute for Advanced Study of Mathematical Sciences, Meiji University, Kawasaki, Japan b Abstract1 . Let (R, m) be a Noetherian local ring, I an ideal of R and N a finitely generated R-module. Let k≥ − 1 be an integer and r = depthk (I, N ) the length of a maximal N -sequence in dimension > k in I defined by M. Brodmann and L. T. Nhan (Comm. Algebra, 36 (2008), 1527-1536). For a subset S ⊆ Spec R we set S≥k = {p ∈ S | dim(R/p)≥k}. We first prove in this paper that AssR (HIj (N ))≥k is a finite set for all j≤r . Let N = ⊕n≥0 Nn be a finitely generated graded R-module, where R is a finitely generated standard graded algebra over R0 = R. Let r be the eventual value of depth S k (I, Nn ). Then our second result says that for all l≤r the sets j≤l AssR (HIj (Nn ))≥k are stable for large n. 1 Introduction Let (R, m) be a Noetherian local ring, I an ideal of R and N a finitely generated R-module. In 1990, C. Huneke [11, Problem 4] asked whether the set of associated primes of HIj (N ) is finite for all finitely generated modules N and all I. Affirmative answers were given by Huneke-R.Y. Sharp [12] and G. Lyubeznik [16] for equicharacteristic regular local rings. Although, A. Singh [20] and M. Katzman [13] provided examples of finitely generated modules having some local cohomology modules with infinite associated prime ideals, the problem is still true in many situations, such as [4], [14], [16], [17], [19]. However, little is known about the finiteness of AssR (HIj (N )). Brodmann-L.T. Nhan introduced the notion of N -sequence in dimension > k in [5]: Let k be an integer with k ≥ −1. A sequence x1 , . . . , xr of elements of m is called an N -sequence in dimension 1 Key words and phrases: associated prime, local cohomology, generalized local cohomology, N -sequence in dimension > k. 2000 Subject Classification: 13D45, 13D07, 13C15 a E-mail: [email protected] b E-mail: [email protected] 1 > k if xi ∈ / p for all p ∈ AssR (N/(x1 , . . . , xi−1 )N ) with dim(R/p) > k and all i = 1, . . . , r. They also showed that every maximal N -sequence in dimension > k in I has the same length. This common length is denoted by depthk (I, N ). Note that depth−1 (I, N ) is just depth(I, N ), depth0 (I, N ) is the filter depth f-depth(I, N ) defined by R. Lü-Z. Tang [15], and depth1 (I, N ) is the generalized depth gdepth(I, N ) defined by Nhan [19]. Let S be a subset of Spec(R) and k ≥ −1 an integer. We set S≥k = {p ∈ S | dim(R/p) ≥ k}. The first main result of this paper is to prove the following theorem. Theorem 1.1. Let (R, m) be a Noetherian local ring, I an ideal of R and N a finitely generated R-module. Let k be an integer with k ≥ −1 and r = depthk (I, N ). If r < ∞ and x1 , . . . , xr is an N -sequence in dimension > k in I, then for any integer j ≤ r the set AssR (HIj (N ))≥k is finite. Moreover, we have [ [ AssR (HIj (N ))≥k = AssR (N/(x1 , . . . , xj )N )≥k ∩ V (I) j≤l j≤l for all l ≤ r. Let R = ⊕n≥0 Rn be a finitely generated standard graded algebra over R0 = R and ⊕n≥0 Nn a finitely generated graded R-module. In 1979, M. Brodmann [2] had proved that the set AssR (Nn ) is stable for large n. Based on this result he showed in [3, Theorem 2 and Proposition 12] that the integer depth(I, Nn ) takes a constant value for large n. We generalized this last one in [8] and showed that depthk (I, Nn ) takes S a constant value rk for large n. Moreover, in [8], we also prove that the set j≤r1 AssR (HIj (Nn )) ∪ {m} is stable for large n, where r1 is the stable value of depth1 (I, Nn ) for large n. Then the second main result of this paper is the following theorem. Theorem 1.2. Let (R, m) be a Noetherian local ring and I an ideal of R. Let R = ⊕n≥0 Rn be a finitely generated standard graded algebra over R0 = R and N = ⊕n≥0 Nn a finitely generated graded R-module. For each integer k ≥ −1, let value of depthk (I, Nn ). Then for each integer l ≤ r the set S r be the eventual j Ass (H (N )) is stable for large n. R n ≥k j≤l I For two finitely generated R-modules M and N , J. Herzog [10] defined the generalized local cohomology module HIj (M, N ) of M and N with respect to I by HIj (M, N ) = limn ExtjR (M/I n M, N ). −→ It is clear that if M = R, HIj (R, N ) is just the ordinary local cohomology module HIj (N ) of N with respect to I. Therefore all questions about local cohomology modules discussed above can be asked for generalized local cohomology modules. Thus, to prove the two theorems above, we will show in this paper the generalizations of them for generalized local cohomology. Let us explain the organization of the paper. In the next section, we present auxiliary results on generalized local cohomology modules, the maximal length of an N -sequence in dimension > k in certain ideals of R and relationships between them. In Section 3, we show a generalization of Theorem 1.1 for generalized local cohomology 2 modules (Theorem 3.1). As consequences, we get again one of main results [19, Theorem 3.1] of Nhan (see Corollary 3.3) and a generalization of the main results of Brodmann-Nhan [5, Theorems 1.1 and 1.2] (see Corollary 3.5). The last section is devoted to prove Theorem 4.4, which is a generalization of Theorem 1.2 for generalized local cohomology modules. Then we can derive from Theorem 4.4 a generalization of the main result of [8, Theorem 1.2] for generalized local cohomology modules (see Corollary 4.5) and some new results about the asymptotic stability of the sets of associated prime ideals of Ext-modules (see Corollaries 4.6 and 4.7). 2 Generalized local cohomology module Throughout this paper we use following notations: we denote by (R, m) a Noetherian local ring with the maximal ideal m, and M , N finitely generated R-modules; let S be a subset of Spec R and k ≥ −1 an integer, we set S≥k = {p ∈ S | dim(R/p) ≥ k} and S>k = {p ∈ S | dim(R/p) > k}; for an ideal I of R, IM is the annihilator of the R-module M/IM . We first recall the notion of generalized local cohomology module defined by Herzog in [10]. Definition 2.1. For an integer j ≥ 0, the j th generalized local cohomology module HIj (M, N ) of M and N with respect to I is defined by HIj (M, N ) = limn ExtjR (M/I n M, N ). −→ It is clear that HIj (R, N ) is just the ordinary local cohomology module of N with respect to I. On the other hand, Ext-modules can be also determined in many cases by generalized local cohomology modules. HIj (N ) Lemma 2.2. (cf. [7, Lemma 2.1]) If I ⊆ ann(M ) or ΓI (N ) = N then j HIj (M, N ) ∼ = ExtR (M, N ) for all j ≥ 0. The following definition of a generalization of regular sequences is introduced by Brodmann-Nhan in [5, Definition 2.1]. Definition 2.3. Let k ≥ −1 be an integer. A sequence x1 , . . . , xr of elements of m is called an N -sequence in dimension > k if xi ∈ / p for all p ∈ AssR (N/(x1 , . . . , xi−1 )N )>k and all i = 1, . . . , r. It is clear that x1 , . . . , xr is an N -sequence in dimension > −1 if and only if it is a regular sequence of N ; and x1 , . . . , xr is an N -sequence in dimension > 0 if and only if it is a filter regular sequence of N introduced by P. Schenzel, N. V. Trung and the first author in [9]. Moreover, x1 , . . . , xr is an N -sequence in dimension > 1 if and only if it is a generalized regular sequence of N defined by Nhan in [19]. Remark 2.4. (i) It is easy to see that if x1 , . . . , xr is an N -sequence in dimension > k, then so is xn1 1 , . . . , xnr r for all n1 , . . . , nr ∈ N. 3 (ii) Note that every maximal N -sequence in dimension > k in an ideal I has the same length, this common length is denoted by depthk (I, N ) (see [8]). Furthermore, depth−1 (I, N ) is the usual depth depth(I, N ) of N in I, depth0 (I, N ) is the filter depth f-depth(I, N ) of N in I denoted by Lü-Tang in [15], and depth1 (I, N ) is just the generalized depth gdepth(I, N ) of N in I defined by Nhan [19]. Lemma 2.5. ([8, Lemma 2.3]) Let k ≥ −1 be an integer. Then depthk (I, N ) = inf{depthk−i (Ip , Np ) | p ∈ SuppR (N/IN )≥i } for all 0 ≤ i ≤ k + 1, where we use the convention that inf(∅) = ∞. The following two results are useful in the sequel. Lemma 2.6. (cf. [1, Proposition 5.5]) The following equality is true depth(IM , N ) = inf{i | HIi (M, N ) 6= 0}. Lemma 2.7. ([6, Theorem 2.4]) Let r = depth(IM , N ). Assume that r < ∞ and let x1 , . . . , xr be a regular sequence of N in IM . Then   AssR HIr (M, N ) = AssR N/(x1 , . . . , xr )N ∩ V (IM ). 3 Proof of Theorem 1.1 and its consequences The following theorem for generalized local cohomology modules implies Theorem 1.1 when M = R. Theorem 3.1. Let (R, m) be a Noetherian local ring, I an ideal of R and M, N finitely generated R-modules. Let k be an integer with k ≥ −1 and r = depthk (IM , N ). If r < ∞ and x1 , . . . , xr is an N -sequence in dimension > k in IM , then for any integer l ≤ r we have [ [ AssR (HIj (M, N ))≥k = AssR (N/(x1 , . . . , xj )N )≥k ∩ V (IM ). j≤l j≤l Therefore AssR (HIj (M, N ))≥k is a finite set for all j ≤ r. S Proof. Let l be an integer with 0 ≤ l ≤ r. For each p ∈ j≤l AssR (HIj (M, N ))≥k / AssR (HIj (M, N )) there exists an integer j0 ≤ l such that p ∈ AssR (HIj0 (M, N )) and p ∈ for all j < j0 . Assume that p ∈ / AssR (N/(x1 , . . . , xj )N ) for all j < j0 , then pRp ∈ / AssRp ((N/(x1 , . . . , xj )N )p ). Hence AssRp ((N/(x1 , . . . , xj )N )p ) = AssRp ((N/(x1 , . . . , xj )N )p )≥1 for all j < j0 . Since x1 /1, . . . , xj0 /1 is a filter regular sequence of Np by Lemma 2.5 and the hypothesis of x1 , . . . , xj0 , it follows that x1 /1, . . . , xj0 /1 is a regular 4 sequence of Np , and so depth((IM )p , Np ) ≥ j0 . Since p ∈ AssR (HIj0 (M, N )), HIj0 (M, N )p 6= 0. Thus depth((IM )p , Np ) ≤ j0 by Lemma 2.6, and hence we obtain that depth((IM )p , Np ) = j0 . This yields by Lemma 2.7 that AssRp (HIj0 (M, N )p ) = AssRp ((N/(x1 , . . . , xj0 )N )p ) ∩ V ((IM )p ). Hence p ∈ AssR (N/(x1 , . . . , xj0 )N ) ∩ V (IM ). Thus [ [ AssR (HIj (M, N ))≥k ⊆ AssR (N/(x1 , . . . , xj )N )≥k ∩ V (IM ). j≤l j≤l S Conversely, for any p ∈ j≤l AssR (N/(x1 , . . . , xj )N )≥k ∩V (IM ), there is an integer e ≤ l such that p ∈ AssR (N/(x1 , . . . , xe )N ) and p ∈ / AssR (N/(x1 , . . . , xj )N ) for all j < e. So pRp ∈ / AssRp ((N/(x1 , . . . , xj )N )p ) for all j < e. Hence AssRp ((N/(x1 , . . . , xj )N )p ) = AssRp ((N/(x1 , . . . , xj )N )p )≥1 for all j < e. Therefore x1 /1, . . . , xe /1 is a regular sequence of Np , and so that depth((IM )p , Np ) ≥ e. Keep in mind that p ∈ AssR (N/(x1 , . . . , xe )N ), so depth((IM )p , (N/(x1 , . . . , xe )N )p ) = 0. Thus we get depth((IM )p , Np ) = e. It follows by Lemma 2.7 that p ∈ AssR (HIe (M, N )). This implies that [ [ AssR (HIj (M, N ))≥k ⊇ AssR (N/(x1 , . . . , xj )N )≥k ∩ V (IM ), j≤l j≤l and the theorem follows. Theorem 1.1 and Theorem 3.1 lead to many consequences. It was showed in [5, Proposition S 2.6] that if x1 , . . . , xr is a permutable N -sequence in dimension > k then n1 ,...,nr ∈N AssR (N/(xn1 1 , . . . , xnr r )N )≥k is a finite set. By virtue of Theorem 3.1 we can prove this result without the hypothesis that x1 , . . . , xr is a permutable N -sequence in dimension > k. Corollary 3.2. Let k be an integer with k ≥ −1 and x1 , . . . , xr an N -sequence in dimension > k (not necessary permutable). Then [ [ n AssR (N/(xn1 1 , . . . , xj j )N )≥k = AssR (N/(x1 , . . . , xj )N )≥k j≤r for all n1 , . . . , nr ∈ N. In particular, is a finite set. j≤r S n1 ,...,nr ∈N S n j≤r AssR (N/(xn1 1 , . . . , xj j )N )≥k Proof. Let n1 , . . . , nr be positive integers, then xn1 1 , . . . , xnr r is an N -sequence in dimension > k by Remark 2.4. For each integer i with 0 ≤ i ≤ r, we set Ii = (x1 , . . . , xi ). Since AssR (N/(xn1 1 , . . . , xni i )N )≥k = AssR (N/(xn1 1 , . . . , xni i )N )≥k ∩ V (Ii ) 5 for any r-tuple of positive integers n1 , . . . , nr , it follows from Theorem 1.1 that  [[  [[ n AssR (HIji (N ))≥k = AssR (N/(xn1 1 , . . . , xj j )N )≥k ∩ V (Ii ) i≤r i≤r j≤i = [ j≤i n AssR (N/(xn1 1 , . . . , xj j )N )≥k . j≤r Then the corollary follows from the fact that the set on the left hand of the equality is independent of the choice of n1 , . . . , nr . Setting k = 1 in Corollary 3.2 we get the following corollary which covers Theorem 3.1 of [19]. Corollary 3.3. Let x1 , . . . , xr be a generalized regular sequence of N . Then [ [ n AssR (N/(xn1 1 , . . . , xj j )N ) ∪ {m} = AssR (N/(x1 , . . . , xj )N ) ∪ {m} j≤r j≤r for all n1 , . . . , nr ∈ N. In particular, is a finite set. S n1 ,...,nr ∈N S n j≤r AssR (N/(xn1 1 , . . . , xj j )N ) Corollary 3.4. Let k be an integer with k ≥ −1. Set r = depth pk (ann(M ), N ). If r < ∞ and x1 , . . . , xr is an N -sequence in dimension > k in ann(M ), then for any integer l ≤ r we have [ [ AssR (ExtjR (M, N ))≥k = AssR (N/(x1 , . . . , xj )N )≥k ∩ V (ann(M )). j≤l j≤l p √ Proof. Set I = ann(M ). It is easy to see that IM = IM = I. Hence r = depthk (IM , N ) and x1 , . . . , xr is an N -sequence in dimension > k in IM . j Moreover, we have in this case that ExtjR (M, N ) ∼ = HI (M, N ) by Lemma 2.2. Therefore the conclusion follows from Theorem 3.1. Let j ≥ 0, t > 0 be integers. Let a = (a1 , . . . , as ) be elements of R and t = (t1 , . . . , ts ) an s-tuple of positive integers. For an ideal I we set T j (I t , N ) = AssR (ExtjR (R/I t , N )) and T j (at , N ) = AssR (ExtjR (R/(at11 , . . . , atss ), N )). Then we get the following relation between these sets. Corollary 3.5. Let k ≥ −1 be an integer, I an ideal of R and r =√depthk (I, N ). If r < ∞ and x1 , . . . , xr is an N -sequence in dimension > k in I. Then, for any system of generators a1 , . . . , as of I and all integer l ≤ r, we have [ [ [ T j (I t , N )≥k = AssR (N/(x1 , . . . , xj )N )≥k ∩ V (I) = T j (at , N )≥k j≤l j≤l j≤l 6 for all t ∈ N and all tS∈ Ns . In particular, for any integer j ≤ r the sets S j t j t t∈N T (I , N )≥k and t∈Ns T (a , N )≥k are contained in the finite set [ i≤j Proof. Since √ It = AssR (N/(x1 , . . . , xi )N )≥k ∩ V (I). q √ I = (at11 , . . . , atss ) for all positive integer t, t1 , . . . , ts , thanks to Corollary 3.4 we obtain by setting M = R/I t and M = R/(at11 , . . . , atss ) that [ [ AssR (ExtjR (R/I t , N ))≥k = AssR (N/(x1 , . . . , xj )N )≥k ∩ V (I) and j≤l [ j≤l AssR (ExtjR (R/(at11 , . . . , atss ), N ))≥k = j≤l [ j≤l AssR (N/(x1 , . . . , xj )N )≥k ∩ V (I) for all l ≤ r, and the corollary follows. Remark 3.6. The main result of Brodmann-Nhan [5, Theorems 1.1 and 1.2] i says that S for a non negative integer S r, if dim Supp HI (N ) ≤ k for all i < r, then the sets t∈N T j (I t , N )≥k and t∈Ns T j (at , N )≥k are contained in the finite S set i≤j AssR (ExtiR (R/I, N )) for all j ≤ r. Moreover, if x1 , . . . , xr is at the same time a permutable N -sequence in dimension > k and a permutable I-filter regular sequence in I, then these sets are contained in the finite set [ AssR (N/(x1 , . . . , xj )N )≥k+1 ∪ AssR (N/(x1 , . . . , xi )N )k , (*) i≤j where AssR (N/(x1 , . . . , xi )N )k = {p ∈ AssR (N/(x1 , . . . , xi )N ) | dim R/p = k}. In fact, since the S equality in Corollary 3.5 S do not depend on t and t, thus for any j ≤ r the sets t∈N T j (I t , N )≥k and t∈Ns T j (at , N )≥k are contained in the S S set i≤j T i (I, N )≥k = i≤j AssR (ExtiR (R/I, N ))≥k . This shows that Corollary 3.5 covers Theorem 1.1 of [5]. Moreover, let p ∈ T j (I t , N )≥k ∪ T j (at , N )≥k for some t, t. If dim(R/p) = k then p belongs to the set (∗) by Corollary 3.5. If dim(R/p) ≥ k + 1 then depth(Ip , Np ) = r. Therefore j = r in this case, and so p ∈ T r (I, N ). Since ExtrR (R/I, N ) ∼ = HIr (R/I, N ) by Lemma 2.2, it follows by Lemma 2.7 that p ∈ Ass(N/(x1 , . . . , xr )N )≥k+1 . Thus Corollary 3.5 also covers Theorem 1.2 of [5] for local rings without the assumption that x1 , . . . , xr is at the same time a permutable N -sequence in dimension > k and a permutable I-filter regular sequence in I. 4 Proof of Theorem 1.2 and its consequences In this section we always denote by R = ⊕n≥0 Rn a finitely generated standard graded algebra over R0 = R and N = ⊕n≥0 Nn a finitely generated graded 7 R-module. Firstly, we recall two results on the asymptotic stability of associated prime ideals [2] (see also [18, Theorem 3.1]) and of generalized depths depthk (I, Nn ) [8, Theorem 1.1] as follows. Lemma 4.1. The set AssR (Nn ) is stable for large n. Lemma 4.2. ([8, Theorem 1.1]) Let k be an integer with k ≥ −1. Then depthk (I, Nn ) is independent of n for large n. In view of Lemma 4.2, if r = depthk (I, Nn ) for all large n then we call that r is the eventual value of depthk (I, Nn ). Lemma 4.3. Let k be an integer with k ≥ −1 and r the eventual value of depthk (I, Nn ). Assume that 1 ≤ r ≤ ∞. Then there exists a sequence x1 , . . . , xr in I which is an Nn -sequence in dimension > k for all large n. Proof. Let r ≥ 1 be the eventual value of depthk (I, Nn ). By Lemma 4.1 we can choose x1 ∈ I such that x1 ∈ / p for all p ∈ AssR (Nn )>k and all large n. Then depthk (I, Nn /x1 Nn ) = r − 1 for all large n. By the induction assumption, there exists a sequence x2 , . . . , xn ∈ I to be an Nn /x1 Nn -sequence in dimension > k for all large n. Thus x1 , . . . , xr is the sequence as required. Proof of Theorem 1.2. Theorem 1.2 follows immediately from the following theorem when M = R. Theorem 4.4. Let (R, m) be a Noetherian local ring, I an ideal of R and M finitely generated R-module. Let R = ⊕n≥0 Rn be a finitely generated standard graded algebra over R0 = R and N = ⊕n≥0 Nn a finitely generated graded Rmodule. For each integer k ≥ −1, let r be the eventual value of depthk (IM , Nn ). Then for each integer l ≤ r, the set [ AssR (HIj (M, Nn ))≥k j≤l is finite and stable for large n. Proof. Let r be the eventual S value of depthk (IM , Nn ). We need to show that for any integer l ≤ r the set j≤l AssR (HIj (M, Nn ))≥k is finite and stable for large n. By Lemmas 4.1 and 4.2, we can find a large integer t such that AssR (Nn /IM Nn ) is stable and r = depthk (IM , Nn ) for all n ≥ t. Set d = dim(Nt /IM Nt ). We consider three cases as follows. Case 1. If d < k, then r = ∞ and the conclusion follows as [ AssR (HIj (M, Nn ))≥k = ∅ j≤l for all n ≥ t. 8 Case 2. If d = k, then r = ∞. It follows for all positive integers n ≥ t that [ AssR (HIj (M, Nn ))≥d ⊆ SuppR (Nn /IM Nn )≥d = AssR (Nn /IM Nn )≥d , j≤l since the set AssR (Nn /IM Nn )≥d only consists of all minimal elements with dim(R/p) = d. Hence [[ [ X= AssR (HIj (M, Nn ))≥d ⊆ AssR (Nn /IM Nn ), n≥t j≤l n≥t therefore X is finite by Lemma 4.1. Thus we can take t sufficiently large such that for each p ∈ X then [ p∈ AssR (HIj (M, Nn ))≥d j≤l for infinitely many n ≥ t. Now for each p ∈ X we set s to be the eventual value of depth((IM )p , (Nn )p ), then we can write s = depth((IM )p , (Nn )p ) for all n ≥ n(p) for some integer n(p) ≥ t. Then HIs (M, Nn )p 6= 0 for all n ≥ n(p). Moreover, by the definition of X, it implies that s ≤ l. Hence p is a minimal element of SuppR (HIs (M, Nn )), and so that [ p ∈ AssR (HIs (M, Nn ))≥d ⊆ AssR (HIj (M, Nn ))≥d j≤l for all n ≥ n(p). Therefore the set [ AssR (HIj (M, Nn ))≥d j≤l is finite and stable for all n ≥ max{n(p) | p ∈ X}. Case 3. Assume that d > k. Then r < ∞. If l = 0, then AssR (HI0 (M, Nn ))≥k = AssR (Nn )≥k ∩ V (IM ) is finite and stable for large n by Lemma 4.1. Assume that 1 ≤ l ≤ r. In this case, by Lemma 4.3, there exists a sequence x1 , . . . , xr in IM which is an Nn -sequence in dimension > k for all n ≥ u for some integer u ≥ t. By Theorem 3.1, we get the following equality [ [ AssR (HIj (M, Nn ))≥k = AssR (Nn /(x1 , . . . , xj )Nn )≥k ∩ V (IM ) j≤l j≤l for all n ≥ u. Therefore we conclude by Lemma 4.1 that the following set [ AssR (HIj (M, Nn ))≥k j≤l is finite and stable for large n as required. 9 The rest of this section devotes to consider many consequences of Theorem 4.4. By replacing k = −1, 0, 1 in Theorem 4.4, we get the following result which is an extension of the main result in [8, Theorem 1.2] for generalized local cohomology modules. Corollary 4.5. Let r, r0 and r1 be the eventual values of depth(IM , Nn ), f-depth(IM , Nn ) and gdepth(IM , Nn ), respectively. Then the following statements are true.  (i) The set AssR HIr (M, Nn ) is finite and stable for large n. S (ii) For each integer l0 ≤ r0 the set j≤l0 AssR (HIj (M, Nn )) is finite and stable for large n. S (iii) For each integer l1 ≤ r1 the set j≤l1 AssR (HIj (M, Nn )) ∪ {m} is finite and stable for large n. Proof. (i) Since HIj (M, Nn ) = 0 for all j < r and all large n, so that [  AssR (HIj (M, Nn ))≥−1 = AssR HIr (M, Nn ) j≤r is finite and stable for large n by Theorem 4.4. (ii) The conclusion follows from Theorem 4.4 and the equality [ [ AssR (HIj (M, Nn )) AssR (HIj (M, Nn ))≥0 = j≤l0 j≤l0 for all l0 ≤ r0 and all large n. (iii) For each l1 ≤ r1 we have [ [ AssR (HIj (M, Nn ))≥1 ∪ {m} = AssR (HIj (M, Nn )) ∪ {m} j≤l1 j≤l1 for all large n. Therefore the result follows by Theorem 4.4. p Note that if I = ann(M ) then HIj (M, Nn ) =√ExtjR (M, Nn ) for all j ≥ 0 by Lemma 2.2. Moreover, in this case we have IM = IM = I. Therefore Theorem 4.4 leads to the following immediate consequence. Corollary 4.6. Let k be an integer with k ≥ −1 S and r the eventual value of depthk (ann(M ), Nn ). Then for any l ≤ r the set j≤l AssR (ExtjR (M, Nn ))≥k is stable for large n. For an integer j ≥ 0, an ideal I of R, a system a = (a1 , . . . , as ) of elements of R, and a s-tuple t = (t1 , . . . , ts ) ∈ Ns , as in the previous section we set T j (I t , Nn ) = AssR (ExtjR (R/I t , Nn )), T j (at , Nn ) = AssR (ExtjR (R/(at11 , . . . , atss ), Nn )). Then we have 10 Corollary 4.7. Let k ≥ −1 be an integer, I an ideal of R and r the eventual value of depthk (I, Nn ). Let a1 , . . . , as be a system of generators of I and an integer l ≤ r. Then for all positive integers t, t1 , . . . , ts the following sets [ [ T j (I t , Nn )≥k and T j (at , Nn )≥k j≤l j≤l are stable for large n. Moreover, if r < ∞ then [ [ T j (I t , Nn )≥k = T j (at , Nn )≥k j≤l j≤l are stable for all large n. Proof. By Lemma 4.2, we find a large integer u such that r =√depthk (I, √ Nn ) t = I I = for all n ≥ u. Let t, t , . . . , t be positive integers. Since 1 s q t1 ts (a1 , . . . , as ) , therefore √ r = depthk ( I, Nn ) = depthk (I t , Nn ) = depthk ((at11 , . . . , atss ), Nn ) for all n ≥ u. This implies Corollary 4.6 Sby setting M = R/I t and S from t1 j t ts M = R/(a1 , . . . , as ) that j≤l T (I , Nn )≥k and j≤l T j (at , Nn )≥k are stable for large n. We now ∞. Then, for any n ≥ u, we have by S assume that r < S Corollary 3.5 that j≤l T j (I t , Nn )≥k = j≤l T j (at , Nn )≥k for all for all positive integers t, t1 , . . . , ts . Thus they are stable for all large n. Acknowledgements: The authors would like to thank the referee for pointing out a mistake in Remark 3.6. This work is funded by Vietnam National Foundation for Science and Technology Development (NAFOSTED), and the second author is also partially supported by Vietnam Ministry of Training and Education under grant number B2012-TN03-02. References [1] M. H. Bijan-Zadeh, A common generalization of local cohomology theories, Glasgow Math. J., 21 (1980), 173-181. [2] M. Brodmann, Asymptotic stability of AssR (M/I n M ), Proc. Amer. Math. Soc., (1) 74 (1979), 16-18. [3] M. Brodmann, The Asymptotic nature of the analytic spread, Math. Proc. Camb. Phil. Soc., 86 (1979), 35-39. [4] M. Brodmann and A. L. Faghani, A Finiteness result for associated primes of local cohomology modules, Proc. Amer. Math. Soc., (10) 128 (2000), 2851 - 2853. [5] M. Brodmann and L. T. Nhan, A finiteness result for associated primes of certain Ext-modules, Comm. Algebra, 36 (2008), 1527-1536. 11 [6] N. T. Cuong and N. V. Hoang, Some finite properties of generalized local cohomology modules, East-West J. Math., (2) 7 (2005), 107-115. [7] N. T. Cuong and N. V. Hoang, On the vanishing and the finiteness of supports of generalized local cohomology modules, Manuscripta Math., (1) 126 (2008), 59-72 . [8] N. T. Cuong, N. V. Hoang and P. H. Khanh, Asymptotic stability of certain sets of associated prime ideals of local cohomology modules, Comm. Algebra, 38 (2010), 4416-4429. [9] N. T. Cuong, P. Schenzel and N. V. Trung, Verallgemeinerte Cohen-Macaulay Moduln, Math. Nachr., 85 (1978), 57-73. [10] J. Herzog, Komplexe, Auflösungen und Dualität in der Lokalen Algebra, Habilitationsschrift, Universität Regensburg, 1970. [11] C. Huneke, Problems on local cohomology, Free resolutions in commutative algebra and algebraic geometry (Sundance, Utah, 1990), Res. Notes Math., 2 (1992), 93 - 108. [12] C. Huneke and R. Y. Sharp, Bass numbers of local cohomology modules, Trans. Amer. Math. Soc., 339 (1993), 765 - 779. [13] M. Katzman, An example of an infinite set of associated primes of a local cohomology module, J. Algebra, 252 (2002), 161-166. [14] K. Khashyarmanesh and Sh. Salarian, On the associated primes of local cohomology modules, Comm. Algebra, 27 (1999), 6191 - 6198. [15] R. Lü and Z. Tang, The f-depth of an ideal on a module, Math. Proc. Camb. Phil. Soc., (7) 130 (2001), 1905-1912. [16] G. Luybeznik, Finiteness properties of local cohomoly modules (an application of D-modules to commutative algebra), Invent. Math., 113 (1993), 41-55. [17] T. Marley, Associated primes of local cohomology module over rings of small dimension, Manuscripta Math., (4) 104 (2001), 519 - 525. [18] L. Melkersson, On asymptotic stability for sets of prime ideals connected with the powers of an ideal, Math. Proc. Camb. Phil. Soc., 107 (1990), 267-271. [19] L. T. Nhan, On generalized regular sequences and the finiteness for associated primes of local cohomology modules, Comm. Algebra, 33 (2005), 793-806. [20] A. Singh, p-torsion elements in local cohomology modules, Math. Res. Lett., 7 (2000), 165-176. 12
0math.AC
Stability and Stabilization of Fractional-order Systems with Different Derivative Orders: An LMI Approach Pouya Badri1, Mahdi Sojoodi1* 1 Advanced Control Systems Laboratory, School of Electrical and Computer Engineering, Tarbiat Modares University, Tehran, Iran.  Abstract— Stability and stabilization analysis of fractional-order linear time-invariant (FO-LTI) systems with different derivative orders is studied in this paper. First, by using an appropriate linear matrix function, a single-order equivalent system for the given different-order system is introduced by which a new stability condition is obtained that is easier to check in practice than the conditions known up to now. Then the stabilization problem of fractional-order linear systems with different fractional orders via a dynamic output feedback controller with a predetermined order is investigated, utilizing the proposed stability criterion. The linear matrix inequality based procedure of developing stabilizing output feedback control is preserved in spite of the complexity of assuming the most complete linear controller model, with direct feedthrough parameter. The proposed stability and stabilization theorems are applicable to FO-LTI systems with different fractional orders in one or both of and intervals. Eventually, some numerical examples are presented to confirm the obtained analytical results. Keywords: Fractional-order system, different fractional orders, stability, stabilization, linear matrix inequality, dynamic output feedback. I. INTRODUCTION Recently, study of applications of fractional calculus in the modeling and control of various real-world systems have attracted increasing interest [1, 2]. This is mainly due to the fact that fractional-order models can more precisely describe systems having responses with anomalous dynamics and long memory transients. Furthermore, many natural, biological, and practical engineering systems have inherent properties which can be better explained by fractional-order models. Accordingly, controllerdesigning methods for systems modeled by fractional-order dynamics are of great interest. Utilizing fractional-order controllers is a proper method for controlling such systems, because of their high performance and robustness [3, 4]. Moreover, stability and stabilization have become fundamental issues for all control systems including fractional-order systems, because in the most of control systems, stability is the first objective to be accomplished. In this paper, we are particularly concerned with fractional-order linear time-invariant (LTI) systems with different orders. This kind of system representation is used to analyze linear electrical circuits composed of resistors, supercondensators (ultracapacitors), coils, and voltage (current) sources [5], and formulate the problem of model reference adaptive control of fractional-order systems presented in [6]. Relaxation processes, viscoelastic materials models, and diffusion phenomena can be easily modeled by multi-order fractional differential equations [7]. The stability of fractional-order feedback systems was investigated in [8], by adapting classical root locus plot analysis to some viscoelastic structures. For fractional differential systems in state-space form, both internal and external stabilities are investigated in [9]. Stability of FO-LTI systems with different fractional orders is addressed in [10], using its characteristic equation. Multi-term fractional differential equations such as Bagley–Torvik and Basset equations were discussed in [11], where the solution is The authors are with the School of Electrical and Computer Engineering, Tarbiat Modares University, Tehran, Iran, P.O. Box 14115. [email protected], [email protected] (corresponding author to provide phone: +98 21 8288-3902) proposed under the assumption that fractional derivatives are rational numbers. Stabilization of uncertain multi-order fractional systems with fractional orders is investigated in [12] using extended state observer. The utilization of linear matrix inequality (LMI)-based methods has been increased by the evolution of efficient numerical procedures to solve convex optimization problems [13–17] defined by LMI conditions. Appropriate LMI conditions for asymptotically stability analysis of FO-LTI systems with fractional orders in and intervals are presented in [18] and [19], respectively. The problem of pseudo-state feedback stabilization of fractional-order systems is presented in [19]. Necessary and sufficient conditions for the stability and stabilization of fractional-order interval systems is addressed in [20]. Furthermore, in [21], the robust stability and stabilization of fractional-order linear systems with positive real uncertainty are investigated. State feedback controller is utilized in the most of mentioned studies, in which all individual states are needed. However, in some cases measuring all states is impossible due to economic issues or physical limitations, where using output feedback control seems to be effective [14]. Moreover, it should be noted that dynamic controllers are superior to the static ones because of their more performance efficiency and degrees of freedom in achieving control objectives [22]. A large number of controller design procedures lead to high order controllers with expensive implementation, undesirable reliability, maintenance difficulties, and potential numerical errors. On the other hand, plant or controller order reduction methods do not always guarantee the desired closed-loop performance. Therefore, designing a controller with a low and fixed order, chosen by the designer according to the requirements of the problem, is an efficient solution [14]. Motivated by the above discussion, in this paper, using an appropriate linear matrix function, a singleorder equivalent system for the given different-order system is introduced by which a new stability condition is derived that is easier to check in practice comparing to the conditions known so far. As far as we know, there is no result on the analytical design of a stabilizing dynamic output feedback controller for fractional-order systems with different orders in the literature. In this paper, the stabilization problem of fractional-order linear systems with different fractional orders through a dynamic output feedback controller with a predetermined order is investigated based on the proposed stability theorem. The LMIbased approach of developing stabilizing controller is preserved, despite the intricacy of assuming the most complete model of linear controller with direct feedthrough parameter. Moreover, the proposed stability and stabilization theorems are applicable to FO-LTI systems with different fractional orders in one or both of and intervals. The rest of this paper is organized as follows. In section II, some preliminary concepts, lemmas, and definitions are included. Problem formulation is presented in section III. Section IV is devoted to the main results of the paper where a single-order equivalent system for the given different-order system is presented, a new stability condition is investigated for such systems, and the stabilization analysis of fractional-order systems with different orders is addressed. Some numerical examples are provided in Section V to illustrate the efficiency and validity of the proposed method. Eventually, section VI draws the conclusion. ( ) is the greatest Notation: Throughout the paper is the symbol of pseudo inverse, ). common divisor of n-tuple ( and represent the -th row and -th column of matrix , respectively. Moreover, is a matrix of suitable dimensions with zero entries and denotes the imaginary unit. Function space , - is the space of functions , having continuous -th derivative. ( ) Furthermore, symbols , ⌈ ⌉, ⌊ ⌋, and stand for natural number set, ceiling function, floor function, and -th derivative of , respectively. II. PRELIMINARIES In this section, some basic concepts of fractional-order calculus and useful definitions and lemmas are presented. The following Caputo fractional derivative definition is adopted throughout this paper, due to its integer–order initial value that makes it applicable to physical systems. ( ) ( ) . / ( ) , where ( ) is Gamma function defined by ( ) and to or greater than . In the sequel, wherever the notation operator is meant. is used, the Caputo fractional derivative is the smallest integer that is equal For the proofs of the theorems in this paper, we will use the following lemmas. , with Lemma 1 [11]. Let there exists some - for some and and some . Moreover, let , -. Then be such that (1) Lemma 2 [11]. Let , - and ( ) , . ⌈ ⌉. Moreover, assume that and ( ) Lemma 3 [23]. Commensurate system satisfied | ( ( ))| , -. Then, ( ) is stable if the following conditions are (2) , for all eigenvalues ( ) of the matrix . ( ) Lemma 4 [19]: Let , and . The fractional-order system is asymptotically stable if and only if there exists a positive definite Hermitian matrix such that ̅̅ / . ( ̅ ̅) ( ( ) and the set ) , ({ in which (3) , where Definition 1. For any square matrix function is defined as follows: ) with ( ) , ( ). III. PROBLEM FORMULATION Consider the following fractional-order linear time-invariant FO-LTI system the linear matrix (4) ( ) ( ) [ ( ) ] ( ) (5) ( ) ( ) ( ) subject to the initial conditions ( )( ) . ( ) (6) ⌊ ⌋, / ( ) in which different fractional orders of the system, ( ) ( Furthermore, , matrices with appropriate dimensions. ( ), Defining denotes the pseudo-state vector, is the control input, and ) ( ) , and , and are the is the output vector. are known constant , one can obtain the following equivalent pseudo-state space system () ( ) ( ) ( ), in which ( ), (7) ( (8) ) , and ( ) (9) , with initial conditions ( ) ( )( and ( ) ( ) { ( ( ) { ) ( ) ⌊ ⌋ (10) is easily obtained using the linear matrix function F in Definition 1, as follows ( ) ( ) also we have ( ) where and . ) , , ( [ ] , , and ( ) , (11) ) - , (12) are submatrices in the -th row and -th column of partitioned matrices , , IV. MAIN RESULTS In this section, first, an equivalent single-order system for the given different-order system (5) is derived using the matrix function (4). Then, utilizing the equivalent system, a new stability condition is derived for system (5) and an LMI approach is proposed for designing a dynamic output feedback control law to stabilize the fractional-order system (5), using the stabilizing controller parameters of system (7). A. Equivalency First, equivalency of systems (5) and (7) is proved in the following theorem. Theorem 1. Consider the fractional-order linear system (5). Defining to be the greatest common divisor of s the FO-LTI systems (5) and (7) subject to the initial conditions ( ) and ( ) are equivalent in the following sense: ⌈ ⌉ 1. Whenever , defined in (7) and (8), with , - for some is the pseudo-state of the FO-LTI system (7), is the pseudo-state of (5). 2. Whenever is the pseudo-state of (5), , defined in (7) and (8), is the pseudo-state of the FO-LTI system (7). Proof. In the case that all fractional derivatives of FO-LTI system (5) are equal, we have which brings about the equality of systems (5) and (7). Therefore, from now on we assume that at least one of the s is different from the others. As a result we have . In order to prove the first claim, we have to assume that ( ) is the pseudo-state vector of system (7), and we define , . Since , by a repeated application of Lemma 1 combined with (9), we obtain , , ( ) ( ( ) (13) ( ) ) ( ) , ( ) According to the rows of and , which are made from that , the last equation can be rewritten as follows ( ( ) By definition, ( ) ( ) [ ] ) ( ) and rows respectively, and the fact (14) ( ) ( ) ( ) and considering (14) for we have ( ) ( ) Therefore, ( ) is the pseudo-state vector of system (5). In addition, it is obvious from equation system (13) that for we have ( ) ( ) ( ) ( ) ( ) ( ) ( ) Therefore, ( ) also satisfies the initial conditions (6). ( ) is the pseudo-state of system For the second claim we have to assume that (5) with the initial conditions (6). The equation system (13) is valid in this case too, and therefore it ( ) follows that is the pseudo-state vector of system (7) with the initial conditions ( ) ( ) . / . ( ) / ⌊ ⌋ whenever of Lemma 2 reveals that ( )( ) . and ( ) ( ) / ( ) ( ) for . Finally, an application in the other cases, and it completes the proof. ∎ B. STABILITY In this subsection a necessary and sufficient condition is established for the asymptotical stability of system (5) with ( ) . Theorem 2. The fractional-order linear system (5) with ( ) orders , if and only if there exists a Hermitian matrix ̅ ̅) ( ̅ ̅) ( is asymptotically stable for different such that (15) , in which and is defined in (11). Proof. It can be easily concluded that since the fractional orders are different from each other, then . Therefore, It follows from Lemma 4 that the fractional-order system (7) is asymptotically stable if and only if there exists a positive definite Hermitian matrix such that (15) holds, and since according to Theorem 1 the pseudo states of original system (5) are in the subset of system (7) pseudo states, asymptotically stability of (7) results that of the system (5). For the proof of necessity we suppose that system (5) is asymptotically stable. As derived in [5], pseudostates of system (5), i.e. ( ) , are equal to some finite linear combination of ⌈ ⌉ ( ( ) pseudo-states of system (7), i.e. ( ) functions, with this in mind and according to (13), ( ) , are some finite linear combination of ⌈ ⌉ ) ( ( ( ) ) ) functions. Due to the asymptotically stability of ( ) together with the fact that ( ) is a vanishing term and ( ( ) ) holds, it can be concluded that pseudo-states of system (7) are some finite linear combinations of asymptotically stable functions, which brings about the asymptotically stability of ( ) , and it completes the proof. ∎ C. Stabilization The main purpose of this subsection is to design a fixed-order dynamic output feedback controller that asymptotically stabilizes the FO-LTI system (5) using LMIs. Hence, the following dynamic output feedback controller is presented ( ) ( ) ( ) ( ) (16) ( )] [ ( ) ( ) ( ) with , in which is the arbitrary order of the controller, and , , controller unknown parameters with appropriate dimensions. The resulting closed-loop augmented FO-LTI system using (5) and (16) is as follows , and are the ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (17)   ( )] [ where ( ) [ ( ) ] ( ) [ Next, a stabilization result is established. ]  (18) Theorem 3. Considering closed-loop system in (17), if a positive definite Hermitian matrix ( ) ( ) in the form of ( )  alongside with matrices [ (19)  exist in a way that , ]  ( where ( ̅ ) ) ̅ ̅) (  then, the dynamic output feedback controller parameters of and ̅ ̅̅̅) ̅ ̅̅̅) ( ( (20)  ̅̅) ̅̅) ( ( (21)   make the FO-LTI system in (5) asymptotically stable. Proof. It follows from Theorem 1 that the closed-loop FO-LTI system (17) is asymptotically stable if ( ) ( ) such that there exists a positive definite Hermitian matrix (22) ( ( ̅ ̅) ̅ ̅)   where (23) ( * +)  in (4). By some manipulations, it can be easily in which is the linear matrix function defined concluded that ( * where matrices matrix [ ] , , and (  ) ( (24) ]  are defined in (11) and (12). According to (22) and (24), and assuming )in the form of (19), the inequality (22) can be written as follows ( +) [ ̅ ̅) ( ̅̅)  (25) The matrix inequality (25) is not linear due to several multiplications of variables. Therefore, by changing variables as the linear matrix inequality of (20) is obtained. ∎ V.   (26) SIMULATION In this section, some numerical examples are given to validate the effectiveness of the derived results. Various efficient LMI Parsers and Solvers can be used to determine the feasibility of the proposed constraints and obtain the parameters of the controller design problem. In this paper, we use YALMIP parser [24] and SeDuMi [25] solver in Matlab tool [26]. A. Example 1 Consider system (5) with the following parameters (27)   According to the stability criterion proposed in [10], characteristic equation of above system is as follows [ ] (28)   The roots of characteristic equation (28) along with the stability boundary are depicted in Fig. 1. It can be concluded from [10] that the system (27) is asymptotically stable since roots of equation (28) satisfy the condition | ( )| , in which . The same conclusion can be drawn from proposed Theorem 2 with a relatively simpler method. The eigenvalues of and stability boundaries , with are demonstrated in Fig. 2. ( ) ( ) is stable for According to Lemma 3 and Fig. 2, the system ( ( )), since the eigenvalues of are located on the left side of boundaries. Subsequently, according to Theorem 2, system (5) with the parameters in (27) is asymptotically stable. Since the characteristic equation (28) is of order 372 and , checking the eigenvalues of is far easier than checking the arguments of roots of characteristic equation (28), which is obvious from Figures 1 and 2. Fig. 1. Roots of characteristic equation (28) and stability boundaries with for the system of Example 1. Fig. 2. The eigenvalues of and stability boundaries , with for the system of Example 1. B. Example 2 Consider the dynamic output feedback stabilization problem of the fractional-order system (5) with the following parameters (29)   The eigenvalues of and stability boundaries , with are depicted in Fig. 3. ( ) ( ) is unstable for According to Lemma 3 and Fig. 3, the system ( ( )), since one of the eigenvalues of are located on the right side of boundaries. Therefore, according to Theorem 2, system (5) with the parameters in (29) is unstable. However, according to Theorem 3, it can be concluded that this fractional-order system is asymptotically stabilizable utilizing the obtained dynamic output feedback controllers of arbitrary orders in the form of (16), tabulated in Table 1. The eigenvalues of are located in stability region which is depicted in Fig. 3. According to Theorem 3, stability of implies the stability of . Fig. 4 shows the time response of open-loop system and the resulted closed-loop system of form (17) via obtained controller with . It is obvious from Fig. 4 that all states of the closed-loop system asymptotically converge to zero. 0 1 , 0 1 - TABLE 1. CONTROLLER PARAMETERS OF EXAMPLE 2 OBTAINED BY THEOREM 3 0 0 0 0 -0.21 1 -1.10 1.77 1.73 -0.16 2 0 1 0 1 , - -0.16 Fig. 3. The eigenvalues of , and stability boundaries , with for the system of Example 2 with . Fig. 4. The time response of the open-loop (red) and closed-loop system in Example 2 via obtained output feedback controllers with (black), (blue) (red). C. Example 3 Dynamic output feedback stabilization problem of the fractional-order system (5) is considered with the following parameters (30)   The eigenvalues of and stability boundaries , with are demonstrated in Fig. 5. ( ) ( ) is unstable for According to Lemma 3 and Fig. 5, the system ( ( )), since not all of the eigenvalues of are located on the left side of boundaries. Thus, according to Theorem 2, system (5) with the parameters in (30) is unstable. However, according to Theorem 3, it can be concluded that this fractional-order system is asymptotically stabilizable utilizing the obtained dynamic output feedback controllers of arbitrary orders in the form of (16), tabulated in Table 2. The eigenvalues of are located in stability region which is depicted in Fig. 3. According to Theorem 3, stability of implies the stability of . Fig. 6 shows the time response of open-loop system and the 0 1 0 1 , - resulted closed-loop system of form (17) via obtained controllers with and . It is obvious from Fig. 6 that all the closed-loop system states asymptotically converge to zero. Furthermore, control effort signals of the obtained controllers are depicted in Fig. 7 in order to have an accurate comparison. It can be concluded from Fig. 6 and Fig. 7 that, with almost the same control effort amount, the obtained dynamic output feedback controllers, even with a low order of , have more appropriate control actions compared to that of the static controller of . Moreover, it is obvious that for output feedback stabilizing of fractional-order systems with orders in both and intervals, a unified method is utilized. TABLE 2. CONTROLLER PARAMETERS OF EXAMPLE 3 OBTAINED BY THEOREM 3 0 0 1 -21.78 2 Fig. 5. The eigenvalues of , 0 0 1 , 1 0 , and stability boundaries , with 0 1.28 2.46 1.20 - 1.14 for the system of Example 3 with . Fig. 6. The time response of the open-loop (red) and closed-loop system in Example 3 via obtained output feedback controllers with (black), (blue). Fig.7. The control effort of the dynamic output feedback controllers of Example 3 obtained by Theorem 3. VI. CONCLUSION In this paper using an appropriate linear matrix function, a single-order equivalent system for the given different-order system is introduced through which a new stability condition has been obtained that is easier to check in practice compared with the conditions known up to now (Theorem 1 and 2). Then the stabilization problem of fractional-order linear systems with different fractional orders via a dynamic output feedback controller with a predetermined order has been addressed based on the proposed stability criterion (Theorem 3). The LMI-based approach of developing stabilizing controller is preserved, in spite of the intricacy of assuming the most complete model of linear controller. The proposed stability and stabilization theorems are applicable to FO-LTI systems with different fractional orders in one or both of and intervals. Eventually, some numerical examples are presented to show the validity of the proposed theorems. REFERENCES 1. Badri V, Tavazoei MS, “Achievable Performance Region for a Fractional-Order Proportional and Derivative Motion Controller,” IEEE Trans. Ind. Electron., vol. 62, no. 11, pp. 7171–7180 (2015). 2. Badri V, Tavazoei MS, “Some Analytical Results on Tuning Fractional-Order [ProportionalIntegral] Controllers for Fractional-Order Systems,” IEEE Trans. Control Syst. Technol., vol. 24, no. 3, pp. 1059–1066 (2016). 3. Podlubny I, “Fractional-order systems and -controllers,” IEEE Trans. Autom. Control, vol. 44, no. 1, pp. 208–214 (1999). 4. Jin Y, Chen YQ, Xue D, “Time-constant robust analysis of a fractional order [proportional derivative] controller,” IET Control Theory Appl., vol. 5, no. 1, pp. 164–172 (2011). 5. Kaczorek T, “Positive Linear Systems Consisting of n Subsystems With Different Fractional Orders,” IEEE Trans. Circuits Syst. Regul. Pap., vol. 58, no. 6, pp. 1203–1210 (2011). 6. Wei Y, Hu Y, Song L, Wang Y, “Tracking Differentiator Based Fractional Order Model Reference Adaptive Control: The Case,” in 53rd IEEE Conference on Decision and Control, pp. 6902–6907 (2014). 7. Taghavian H, Tavazoei MS, “Robust stability analysis of uncertain multiorder fractional systems: Young and Jensen inequalities approach,” Int. J. Robust Nonlinear Control (2017). 8. Skaar SB, Michel AN, Miller RK, “Stability of viscoelastic control systems,” IEEE Trans. Autom. Control, vol. 33, no. 4, pp. 348–357 (1988). 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. Matignon D, “Stability Results For Fractional Differential Equations With Applications To Control Processing,” in In Computational Engineering in Systems Applications, pp. 963–968 (1996). Deng W, Li C, Lü J, “Stability analysis of linear fractional differential system with multiple time delays,” Nonlinear Dyn., vol. 48, no. 4, pp. 409–416 (2007). Diethelm K, The Analysis of Fractional Differential Equations: An Application-Oriented Exposition Using Differential Operators of Caputo Type. Springer (2010). Chen L, Chen G, Wu R, Tenreiro Machado J a., Lopes AM, Ge S, “Stabilization of Uncertain Multi-Order Fractional Systems Based on the Extended State Observer,” Asian J. Control, DOI: 10.1002/asjc.1618 (2018). Sabatier J, Moze M, Farges C, “LMI Stability Conditions for Fractional Order Systems,” Comput Math Appl, vol. 59, no. 5, pp. 1594–1609 (2010). Badri P, Amini A, Sojoodi M, “Robust fixed-order dynamic output feedback controller design for nonlinear uncertain suspension system,” Mech. Syst. Signal Process., vol. 80, pp. 137–151 (2016). Zhang H, Wang X, Lin X, “Stability and Control of Fractional Chaotic Complex Networks with Mixed Interval Uncertainties,” Asian J. Control, vol. 19, no. 1, pp. 106–115 (2017). Amini A, Mohammadi A, Asif A, “Event-based consensus for a class of heterogeneous multi-agent systems: An LMI approach,” in 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3306–3310 (2017). Thuan MV, Huong DC, “New Results on Stabilization of Fractional-Order Nonlinear Systems via an LMI Approach,” Asian J. Control, DOI: 10.1002/asjc.1644 (2018). Moze M, Sabatier J, Oustaloup A “LMI Tools for Stability Analysis of Fractional Systems,” IDETC/CIE2005 Proceedings, pp. 1611–1619 (2005). Farges C, Moze M, Sabatier J, “Pseudo-state feedback stabilization of commensurate fractional order systems,” Automatica, vol. 46, no. 10, pp. 1730–1734 (2010). Lu J-G, Chen G, “Robust Stability and Stabilization of Fractional-Order Interval Systems: An LMI Approach,” IEEE Trans. Autom. Control, vol. 54, no. 6, pp. 1294–1299 (2009). Ma Y, Lu J, Chen W, “Robust stability and stabilization of fractional order linear systems with positive real uncertainty,” ISA Trans., vol. 53, no. 2, pp. 199–209 (2014). Sontag ED, Mathematical Control Theory: Deterministic Finite Dimensional Systems. Springer Science & Business Media, (2013). Matignon D, “Stability properties for generalized fractional differential systems,” ESAIM Proc., vol. 5, pp. 145–158 (1998). Löfberg J, “YALMIP : a toolbox for modeling and optimization in MATLAB,” in 2004 IEEE International Symposium on Computer Aided Control Systems Design, pp. 284–289 (2004). Labit Y, Peaucelle D, Henrion D, “SEDUMI INTERFACE 1.02: a tool for solving LMI problems with SEDUMI,” in Proceedings. IEEE International Symposium on Computer Aided Control System Design, pp. 272–277 (2002). Higham DJ, Higham NJ, MATLAB Guide: Second Edition. SIAM, (2005).
3cs.SY
arXiv:1610.00525v1 [math.AC] 3 Oct 2016 LINEARITY DEFECT OF THE RESIDUE FIELD OF SHORT LOCAL RINGS RASOUL AHANGARI MALEKI Abstract. Let (R, m, k) be a Noetherian local ring with maximal ideal m and residue field k. The linearity defect of a finitely generated R-module M , which is denoted ldR (M ), is a numerical measure of how far M is from having linear resolution. We study the linearity defect of the residue field. We give a positive answer to the question raised by Herzog and Iyengar of whether ldR (k) < ∞ implies ldR (k) = 0, in the case when m4 = 0. 1. Introduction and notation This paper is concerned with the notion of the linearity defect of the residue field of a commutative Noetherian local ring. This invariant was introduced by Herzog and Iyengar [3] and has been further studied by Iyengar and Römer [4], Şega [6] and Nguyen [5]. Let us recall the definition of the linearity defect. Throughout this paper (R, m, k) will denote a commutative Noetherian local ring with maximal ideal m and residue field k. Let ∂ ∂n−1 ∂ n 1 F : · · · → Fn −→ Fn−1 −−−→ · · · → F1 −→ F0 → 0 be a minimal complex (i.e. ∂i (Fi ) ⊆ mFi−1 for all i ≥ 0) of finitely generated free R-modules. Then the complex has a filtration {Fp F}p≥0 with (Fp F)i = mp−i Fi for all p and i where, by convention, mj = R for all j ≤ 0. The associated graded complex with respect to this filtration is called the linear part of F and denoted by linR (F). Let N be an R-module. The notation Rg will stand for the associated graded ring ⊕i≥0 mi /mi+1 and N g for the associated graded Rg -module ⊕i≥0 mi N/mi+1 N . By construction, linR (F) is a graded complex of graded free Rg -modules and has the property that g linR n (F) = Fn (−n), for all n. For more information about this complex, we again refer to [3] and [4]. Let M be a finitely generated R-module. The linearity defect of M is defined to be the number ldR (M ) := sup{i ∈ Z| Hi (linR (F)) 6= 0}, where F is a minimal free resolution of M . By definition, ldR (M ) can be infinite and ldR (M ) ≤ d is finite if and only if (Syzd (M ))g has a linear resolution over the standard graded algebra Rg , where Syzd (M ) is the dth syzygy module of M . In particular, ldR (M ) = 0 if and only if M g has a linear resolution over Rg and then linR (F) is a minimal graded free resolution of M g . The notion of the linearity defect can be defined, in the same manner, for graded modules over a standard graded 2010 Mathematics Subject Classification. 13D07 (primary), 13D02 (secondary) . Key words and phrases. Minimal free resolutions, Linearity defect. This research was in part supported by a grant from IPM (No. 94130028). This work was also supported by the Iran National Science Foundation (INSF) grant No. 95001343. 1 2 RASOUL AHANGARI MALEKI algebra A over a field k. In [3], the authors proved that if ldA (k) < ∞, then ldA (k) = 0. Motivated by this known result in the graded case, the following natural question raised in [3]. Question 1. If ldR (k) < ∞, does it follow that ldR (k) = 0? If Rg is Cohen-Macaulay, Şega [6] showed that the question has positive answer in the case that R is a complete intersection. Also, she gave an affirmative answer when m3 = 0. Another positive answer to the question is given by the author and Rossi [1] when R is of homogeneous type, that Rg is dimk TorR i (k, k) = dimk Tori (k, k) for all i. In this paper we show that this problem has an affirmative answer when m4 = 0. The proof relies on the existence of a DG algebra structure of a minimal free resolution of residue field k. 2. Preliminaries and the main result Şega provided an interpretation of linearity defect in term of vanishing of special maps. For each n ≥ 0 and i ≥ 0 we consider the map n+1 n υin (M ) : TorR ) → TorR i (M, R/m i (M, R/m ) induced by the natural surjection R/mn+1 → R/mn . For simplicity, we set υin := υin (k) when M = k. Theorem 2.1. [6, Theorem 2.2] Let M be a finitely generated R-module and d be an integer. Then the following conditions are equivalent. (1) ldR (M ) ≤ d; (2) υin (M ) = 0 for all i ≥ d + 1 and all n ≥ 0. Remark 2.2. Let i ≥ 0. Assume that F is a minimal free resolution of a finitely generated R-module ′ M . Then by [6, 2.3 (2 )], the following statements are equivalent. (1) υi1 (M ) = 0; (2) if x ∈ Fi satisfies ∂i (x) ∈ m2 Fi−1 , then x ∈ mFi . Let S be a unitary commutative ring. Given an S-complex C, we write |c| = i (the homological degree of c) when c ∈ Ci . When we write c ∈ C we mean c ∈ Ci for some i. A (graded commutative) DG algebra over S is a non-negative S-complex (D, ∂) with a morphism of complexes called the product µD : D ⊗ S D → D a ⊗ b 7→ ab satisfying the following properties: (i) unital: there is an element 1 ∈ D0 such that 1a = a1 = a for a ∈ D; (ii) associative: a(ba) = (ab)c for all a, b, c ∈ D; (iii) graded commutative: ab = (−1)|a||b| ba ∈ D|a|+|b| for all a, b ∈ D and a2 = 0 when |a| is odd. The fact that µ is a morphism of complexes is expressed by the Leibniz rule: ∂(ab) = ∂(a)b + (−1)|a| a∂(b) For more information on DG algebras we refer to [2]. 3 Remark 2.3. If (D, ∂) is a DG algebra over S. Using Leibniz rule, one can see that the subcomplex of cycles Z(D) is a DG subalgebra of D and the boundaries B(D) is a DG ideal of Z(D). Thus the product on D induces a product on the homology H(D) = Z(D)/B(D). In particular, ⊕i≥0 Hn (D) is a graded module over commutative ring H0 (D). Tate constructed a DG algebra (free) resolution of k. Furthermore, such a resolution can be chosen to be minimal, see [2, Theorem 6.3.5], which we refer a minimal Tate resolution of k over R. The following lemma shows that the linear part of a minimal Tate resolution of k inherits a DG algebra structure from that of the resolution. Lemma 2.4. Let (F, ∂) be a minimal Tate resolution of k. Then linR (F) has a DG algebra structure induced by that of F. Proof. Let µF : F ⊗R F → F be a morphism of complexes which defines the product on F. Set S = Rg . Since F is minimal we see that F ⊗R F is a minimal complex as well. Hence the morphism induces a morphism of graded S-complexes linR (µF ) : linR (F ⊗R F) → linR (F) such that if i, n ≥ 0 and x∗ is the image of an element x ∈ mi (F ⊗R F)n in mi (F ⊗R F)n /mi+1 (F ⊗R F)n , then linR (µF ) maps x∗ into the image of µ(x) in mi Fn /mi+1 Fn . There is also a natural isomorphism of graded S-complexes λ : linR (F) ⊗S linR (F) → linR (F ⊗R F) such that if i, j, n, m ≥ 0 and x ∈ mi Fn and y ∈ mj Fm with images x∗ in mi Fn /mi+1 Fn and y ∗ in mj Fm /mj+1 Fm respectively, then λ maps x∗ ⊗ y ∗ into the image of x ⊗ y in mi+j (F ⊗R F)n+m /mi+j+1 (F ⊗R F)n+m , see [4, Lemma 2.7]. Now, define (the product) R µlin (F) : linR (F) ⊗S linR (F) → linR (F) as the composition linR (µF ) ◦ λ. Since µ satisfies conditions (i), (ii), (iii) of the definition of DG R algebras, one can see that µlin (F) satisfies the same properties as well. Therefore the linear part of F is a DG algebra over S augmented to k.  Let m∗ denote the homogeneous maximal ideal of Rg . The following is a direct consequence of the above lemma. Corollary 2.5. If F is a minimal free resolution of k, then m∗ Hn (linR (F)) = 0 for all n. Proof. The assertion follows from Remark 2.3 with considering the fact that H0 (linR (F)) = Rg /m∗ .  In what will follow, let (F, ∂) be a minimal free resolution of residue field k with differential map ∂. The differential map of linR (F) which is induced by ∂ will be denoted by ∂ ∗ . We recall that linR (F)n = Fng (−n). For any i, n ≥ 0 and x ∈ mi Fn , ∂ ∗ maps x + mi+1 Fn , the image of x in mi Fn /mi+1 Fn , into the image of ∂(x) in mi+1 Fn−1 /mi+2 Fn−1 that is ∂(x) + mi+2 Fn−1 . Proposition 2.6. Let d be an integer. If ldR (k) ≤ d, then the following hold. (1) υd1 = 0. ∗ . (2) m∗ Ker ∂d∗ = m∗ Im ∂d+1 4 RASOUL AHANGARI MALEKI ∗ . Proof. For the simplicity, we set Z = Ker ∂d∗ and B = Im ∂d+1 (1) If υd1 6= 0, then there exists an element e ∈ Fd \ mFd such that ∂d (e) ∈ m2 Fd−1 , by 2.2 . Let e∗ be the image of e in the quotient module Fd /mFd . Then ∂d∗ (e∗ ) = 0 and so e∗ is a cycle in linR (F). Applying 2.5, we have m∗ Z ⊆ B and therefore m∗ e∗ ⊆ B. As e∗ is an element of a basis of the free module Fdg (−d) and B ⊆ m∗ Fdg (−d), it is straightforward to see that m∗ e∗ is a direct summand of B. By the hypothesis, B has a linear resolution. This implies that the same property holds for m∗ e∗ . Therefore k has a linear resolution over Rg and consequently linR (F) is acyclic. Hence υd1 = 0 and this is a contradiction. For (2), it is enough to show that m∗ Z ⊆ m∗ B. First we claim that m∗ Z is generated in degree at least d + 2 and m∗ Z ⊆ B. Indeed since υd1 = 0, applying Remark 2.2, one has Z ⊆ m∗ Fdg (−d) and consequently m∗ Z is generated in degree at least d + 2. The second part of the claim follows from Corollary 2.5. On the other hand, B has a linear resolution, by the hypothesis. Hence B is generated by elements of degree d + 1 and then all its elements of degree at least d + 2 contained in m∗ B. Now, putting these two considerations together, we get m∗ Z ⊆ m∗ B.  Now, we are ready to prove our main result. Theorem 2.7. Assume that R is Artinian with m4 = 0. If ldR (k) < ∞, then ldR (k) = 0. Proof. Let d be a non-negative integer and ldR (k) ≤ d. We prove by descending induction on d. The case where d = 0 is clear. Let d > 0. Applying Proposition 2.6, we have υd1 = 0. Since m4 = 0, it follows from [6, Theorem 7.1] that υd2 = 0. Again since m4 = 0 obviously υdi = 0 for all i ≥ 3, by the definition of the map υdi . Therefore, from 2.1 we get ldR (k) ≤ d − 1. This completes the induction and finishes the proof.  Acknowledgments. The author would like to express great thanks to the referee for valuable comments and suggestions which have improved the exposition of this paper. This research was in part supported by a grant from IPM (No. 94130028). This work was also jointly supported by the Iran National Science Foundation (INSF) and Alzahra University grant No. 95001343. References [1] R. Ahangari Maleki, M.E. Rossi, Regularity and linearity defect of modules over local rings, J. Commut. Algebra 6 (2014) 485-504. [2] L.L. Avramov, Infinite free resolutions, in: Six Lectures on Commutative Algebra, Bellaterra, 1996, in: Progr. Math., vol. 166, Birkhäuser, Basel, 1998, pp. 1-118. [3] J. Herzog, S. Iyengar, Koszul modules, J. Pure Appl. Algebra 201 (2005) 154–188. [4] S. Iyengar, T. Römer, Linearity defects of modules over commutative rings, J. Algebra 322 (2009) 3212-3237. [5] H.D. Nguyen, Notes on the linearity defect and applications, arXiv:1411.0261. [6] L.M. Şega, On the linearity defect of the residue field, J. Algebra 384 (2013) 276–290. Rasoul Ahangari Maleki, School of Mathematics, Institute for Research in Fundamental Sciences (IPM), P.O. Box: 19395-5746, Tehran, Iran E-mail address: [email protected], [email protected]
0math.AC
End-to-End Prediction of Buffer Overruns from Raw Source Code via Neural Memory Networks arXiv:1703.02458v1 [cs.SE] 7 Mar 2017 Min-je Choi and Sehun Jeong and Hakjoo Oh and Jaegul Choo Department of Computer Science and Engineering Korea University, Seoul {devnote5676, gifaranga, hakjoo_oh, jchoo}@korea.ac.kr Abstract Detecting buffer overruns from a source code is one of the most common and yet challenging tasks in program analysis. Current approaches based on rigid rules and handcrafted features are limited in terms of flexible applicability and robustness due to diverse bug patterns and characteristics existing in sophisticated real-world software programs. In this paper, we propose a novel, datadriven approach that is completely end-to-end without requiring any hand-crafted features, thus free from any program language-specific structural limitations. In particular, our approach leverages a recently proposed neural network model called memory networks that have shown the state-of-the-art performances mainly in question-answering tasks. Our experimental results using source code samples demonstrate that our proposed model is capable of accurately detecting different types of buffer overruns. We also present in-depth analyses on how a memory network can learn to understand the semantics in programming languages solely from raw source codes, such as tracing variables of interest, identifying numerical values, and performing their quantitative comparisons. 1 Introduction Detecting potential bugs in software programs has long been a challenge ever since computers were first introduced. To tackle this problem, researchers in the domain of programming languages developed various techniques called static analysis, which tries to find potential bugs in source codes without having to execute them based on a solid mathematical framework [Cousot and Cousot, 1977]. However, designing a static analyzer is tightly coupled with a particular programming language, and it is mainly based on a rigid set of rules designed by a few experts, considering numerous types of possible program states and bug cases. Thus, even with its slight syntax changes frequently found in real-world settings, e.g., several variants of ANSI C languages, a significant amount of engineering effort is required to make a previously designed analyzer applicable to the other similar languages. To overcome these limitations, one can suggest datadriven, machine learning-based approaches as the rapid growth of deep neural networks in natural language processing has proved its effectiveness in solving similar problems such as defect predictions. Studies show that deep convolutional neural networks (CNNs) and recurrent neural networks (RNNs) are capable of learning patterns or structures within text corpora such as source codes, so they can be applied to programming language tasks such as bug localization [Lam et al., 2016], syntax error correction [Bhatia and Singh, 2016; Pu et al., 2016], and code suggestion [White et al., 2015]. Despite their impressive performances at detecting syntaxlevel bugs and code patterns, deep neural networks have shown less success at understanding how data values are transferred and used within source codes. This semantic level of understanding requires not only knowledge on the overall structure but also the capability to track the data values stored in different variables and methods. Although the aforementioned deep learning models may learn patterns and structures, they cannot keep track of how values are changed. This restriction greatly limits their usefulness in program analysis since run-time bugs and errors are usually much more difficult to detect and thus are often treated with greater importance. In response, we introduce a new deep learning model with the potential of overcoming such difficulties: memory networks [Weston et al., 2015b; Sukhbaatar et al., 2015]. Memory networks are best described as neural networks with external memory ‘slots’ to store previously introduced information for future uses. Given a question, it accesses relevant memory slots via an attention mechanism and combines the values of the accessed slots to reach an answer. While long short-term memories (LSTMs) and earlier models also have external memories, theirs tend to evolve as longer sequences of information are fed in to the network, thus failing to fully preserve and represent information introduced at earlier stages. Memory networks on the other hand can preserve the given information even during long sequences. This unique aspect of memory networks makes it and its variant models [Kumar et al., 2016; Henaff et al., 2016] perform exceptionally well at question answering tasks, e.g., the Facebook bAbI task [Weston et al., 2015a], a widely-used QA benchmark set. The structure of these tasks comprises a story, a query, and an answer, from which a model has to predict the correct answer to the task mentioned in the query by accessing relevant parts of the given story. These tasks are logical questions such as locating an object, counting numbers, or basic induction/deduction. All questions can be correctly answered by referring to appropriate lines of the given story. We point out that this task setting is in fact similar to that of a buffer overrun analysis that requires the understanding of previous lines in a source code to evaluate whether a buffer access is valid. Both tasks require knowledge not only on how each line works but also on how to select the best relevant information from previous lines. It is this very situation at which our work sets a starting point. In this study we set the objective as demonstrating a datadriven model free of hand-crafted features and rules, and yet capable of solving tasks with the complexity of buffer overrun analyses. We present how memory networks can be effectively applied to tasks that require the understanding of not only syntactic aspects of a source code but also more complex tasks such as how values are transferred along code lines. We present how our models can learn the concept of numbers and numerical comparison simply by training on such buffer overrun tasks without any additional information. We also introduce a generated source code dataset that was used to compensate for difficulties we faced in our data-driven approach. As far as our knowledge goes, our proposed approach is the first to use deep learning to directly tackle a run-time error prediction task such as buffer overruns. In Section 2, we cover previous work related to our task. In Section 3, we redefine our tasks, introduce our generated dataset and its purposes, and propose characteristics of the memory network model and how it is applied to this domain. In Section 4, we report experimental results and further discuss the performance of memory networks and notable characteristics it learned during the process. In Section 5 we conclude our work and discuss future work as well as the potential of memory networks for future tasks. 2 Related Work To improve traditional static analysis techniques in the programming language domain, data-driven approaches based on machine learning have been recently studied. Obtaining general properties of a target program, namely, invariants, is one of the prime examples. When concrete data of target programs such as test cases or logs are available, data-driven approaches can be used to identify general properties [Sharma et al., 2012; Sharma et al., 2013b; Sharma et al., 2013a; Sankaranarayanan et al., 2008b; Sankaranarayanan et al., 2008a; Nori and Sharma, 2013], similar to static analysis techniques. This use case is particularly useful when a target program has inherent complexity that makes contemporary static analyzers to compromise either of precision and cost, but is bundled with test cases that can cover most of cases. Meanwhile, following the upsurge in the developing field of neural computing and deep learning, many models have been applied to natural language texts, especially in identifying language structure and patterns. Socher et al. [Socher et al., 2013] introduced recursive neural networks which parse a sentence into subsections. [Sutskever et al., 2014] proposed RNNs that learn structures of long text sequences. Source codes of a program can also be seen as a text corpus with its own grammar structure, thus being applicable for such neural network models. [Karpathy et al., 2015] showed that a character-level LSTM trained with Linux kernel codes is capable of detecting features such as brackets or sentence length as well as generating simulated codes that greatly resemble actual ones in syntactic structure. Motivated by such results in the pattern discovery of source codes, several approaches have been taken to solve practical issues in source code analysis. [Pu et al., 2016] and [Bhatia and Singh, 2016] gathered data from programming assignments submitted for a MOOC class to train a correction model which corrects syntax errors in assignments. [Huo et al., 2016] and [Lam et al., 2016] applied attention-based CNN models to detect buggy source codes. [Allamanis et al., 2014] learned coding styles by searching for patterns with neural networks. While these approaches proved that neural networks are capable of detecting patterns within codes, they are limited to detecting only syntax errors or bugs and not the transition of values stored inside variables or functions of a source code program. Neural networks with external memories have shown better performances in inference or logical tasks compared to contemporary models. Following the introduction of neural Turing machines [Graves et al., 2014] and memory networks [Weston et al., 2015b; Sukhbaatar et al., 2015], many variants of these models were applied to various tasks other than QA tasks such as sentiment analysis, part-of-speech tagging [Kumar et al., 2016], and information extraction from documents [Miller et al., 2016]. Yet, so far there has been no work that applies a memory network-based model to tasks with the complexity of semantic analysis in source codes. 3 Model Description In this section, we first provide the rationale for solving buffer overruns as a QA task. We also introduce a source codebased training dataset that we designed. Lastly, we describe the structure of our model which is based on the memory network [Sukhbaatar et al., 2015] and how it predicts buffer overruns from a source code. 3.1 Benchmark Source Code Generation (a) bAbI task example (b) buffer overrun code sample Figure 1: Comparison of a bAbI and a buffer overrun tasks Comparison of bAbI tasks and buffer overruns. We return to our statement that analyzing buffer overruns is similar to solving bAbI tasks. Consider Fig. 1. The bAbI task shown in Fig. 1(a) is given a story (lines 1-7) and a query (line 8). A solver model understands this task by looking at ‘John’ void fun () { int ent2=4; char ent9[10]=“”; char ent8[24]=“”; memset(ent9,‘K’,10); ent9[9]=‘\0’; memset(ent8,‘R’,23); ent8[23]=‘0’; ent9[27]=‘H’; return; } // end (a) Level 1: buffer access direct void fun () { int ent4=30; char ent2=‘x’; char* ent9; char ent5[10]=“”; memset(ent5,‘K’,10-1); ent5[10-1]=‘0’; ent9=(char*)malloc (42*sizeof(char)) ent9[0]=‘0’; strcpy(ent9,ent5); return; } // end void fun () { int ent4=30; char ent5[10]=“”; char* ent9; memset(ent5,‘M’,10-1); ent5[9]=‘\0’; ent9=(char*)malloc (ent4*sizeof(char)); ent9[0]=‘\0’; strcpy(ent9,ent5); return; } // end (b) Level 2: strcpy access (c) Level 3: int allocation void fun () { int ent1=2; ent1=25; char* ent2; char ent4[ent1]=“”; ent2=(char*)malloc (14*sizeof(char)) memset(ent4,‘K’,ent1); ent2[0]=‘K’; memcpy(ent2,ent4, ent1*sizeof(char)); return; } //end (d) Level 4: memcpy access, int reallocation Figure 2: Different levels of buffer overrun tasks and ‘where’ from the query and then attends the story to find lines related to ‘John.’ Lines 3 and 5 are chosen as candidates. The model understands from the sequential structure that line 5 contains more recent, thus relevant information. In the end, the model returns the answer ‘garden’ by combining the query and the information from line 5. Meanwhile, the task of Fig. 1(b) is to discriminate whether the buffer access made at line 6 is valid. Our analyzer first understands that its objective is to compare the size of the character array entity_2 and the integer variable entity_1. Next, it searches for the length of entity_2 at line 3, where 53 is allocated to the variable. It also gains knowledge from line 2 that entity_1 is equivalent to 70. The remaining task is to compare the integer variables 53 and 70 and return an alarm (unsafe) if the index exceeds the length of the character array. One can think of lines 1-5 as a story and line 6 as a query, perfectly transforming this problem into a bAbI task. Limitations of test suites. Although test suites such as Juliet Test Suite for C programming language [Boland and Black, 2012] are designed for benchmarking buffer overrun and other program analysis tasks, the data is not diverse enough. Code samples differ by only a small fraction such as a different variable nested in a conditional statement or loop, while a large portion of code appears repeatedly over several samples. A data-driven model will inevitably learn from only the small variations and ignore a large portion of the code where much of the valuable information is stored. Program structure. We tackle this problem of data inadequacy by generating our own training source code dataset.1 Our dataset adopts buffer access functions and initialization methods from Juliet to maintain at least an equal level of task complexity, while also preserving an underlying structure that makes it applicable for deep learning approaches. Each sample is a void function of 10 to 30 lines of C code and consists of three stages: initialization, allocation, and query. During the initialization stage, variables are initialized as either characters, character arrays, or integers. At the allocation stage, these variables are assigned values using randomly generated integers between 1 to 100. Buffer sizes are allocated to character arrays with malloc and memset functions. At the 1 The generated dataset and generator codes are available at https://github.com/mjc92/buffer_overrun_ memory_networks query stage, a buffer access is attempted on one of the allocated character arrays via a direct access on an array index (Fig. 2(a)). We formulate this task into a binary classification problem where an ‘unsafe’ sign is returned if a character array is accessed with a string or index that exceeds its size. Naming conventions. We assume that a limited number of individual variables appear in each program sample. Each variable is given the name entity_n where n ∈ {i|0 5 i 5 Nupper , i ∈ Z} and Nupper is an integer set by default to 10. Each n is assigned randomly to variables and invariant of their introduced order or data type. One can imagine a situation where an agent (variable) is given a fake ID (entity name) for a particular task (sample). The agent learns to complete the task with that fake ID, then discards it upon task completion, and selects a new one for the subsequent task. In this manner, we can prevent entities from learning task-specific knowledge and instead train them as representations of universal variables which can replace any kind of variable that appears in a program. We can easily apply our model to real-life source codes using this naming convention by simply changing the names of newly introduced variables and methods to different entities. Adding complexity. Our model has to adapt to more realistic source codes with complex structures. Possible settings that complicate our task include • selecting only the appropriate variables out of several dummy variables, • introducing different buffer access methods requiring the comparison of two character arrays such as strcpy or memcpy functions, • allocating the sizes of character arrays not with integers but indirectly with previously assigned integer variables, • reallocating integer variables prior to or after their use in allocating a character array. We first assign a number of dummy variables to each sample program. Each dummy variable is initialized and allocated in the same manner as the ones actually used in the buffer access. We include the use of strcpy (Fig. 2(b)) / memcpy (Fig. 2(d)) functions for buffer accesses. We also add cases where character arrays are allocated not directly by integers, but indirectly with additionally introduced integer variables (Fig. 2(c)). Given this setting, the model has to learn to store the integer value allocated to the integer variable first, then Mval memory blocks attention vector Eval search lines query line 1 void fun() 2 { 3 int entity_19 = 70; 4 char entity_14[53] = “”; 5 char entity_7[73] = “”; 6 memset(entity_14,‘K’,52); 7 entity_14[52]=‘\0’; 8 entity_14[entity_9] = ‘r’; 9 return; 10 } Eaddr (a) Input encoding response vector o3 o2 o1 Maddr answer u3 u2 u1 p1 p2 p3 W u0 (b) Memory storage (c) Memory search (d) Multiple hops and output Figure 3: Our proposed memory network-based model for buffer overrun tasks use that value to obtain the length of the character array. Finally, we add further cases where the additional integer variable itself is reallocated (Fig. 2(d)), either before or after it is used to define the character array length. Now the model has to learn to choose whether the previously assigned or reallocated value was used for allocating a character array. Our generated source codes are equivalent to an expanded version of Juliet test suite in terms of data flow, that is, the flow of data values defined and used within a source code. Compared to codes in Juliet which only define the source and destination variables that will be used for buffer access, ours include dummy variables which are defined and used similarly. The inclusion of various settings such as memory allocation using assigned integer variables instead of raw integers and reassignment of variables also increase data flow. In overall, our source codes provide a tougher environment for models to solve buffer overrun tasks than the existing Juliet dataset as there are more variations to consider. 3.2 Model Structure The overall structure of our model is displayed in Fig. 3. Input encoding (Fig. 3(a)). The memory network takes in as input a program code X consisting of n search lines X1 , X2 , · · · , Xn and a single buffer access line or query Xq . A single program line Xm is a list of words l 2 1 . With V as the vocabulary size, we define , · · · , wm wm , wm l xm as the V -dimensional one-hot vector representation of a l word wm . We set an upper limit N for the max number of lines a memory can store, and we pad zeros for the remaining lines if a program is shorter than N lines. Note that every word in the source code is treated as a word token. This includes not only variable names (entity), type definitions (int) and special characters, (‘[0 , ‘∗0 ), but also integers as well. This setting matches our concept of an endto-end model that does not require explicit parsing. While it is possible to apply parsers to extract numbers and represent them differently from other word tokens, this would contradict our goal of applying a purely data-driven approach. Treating integers as individual word tokens means that our model will not be given any prior information regarding the size differences between numbers, and thus has to learn such numerical concepts by itself. We further discuss this in Section 4. Next, we compute vector representations for each sentence using its words. Each word is represented in a d-dimensional vector using an embedding matrix Eval ∈ Rd×V . We also multiply a column vector lj to the j-th word vector for each word to allocate different weights according to word positions. This concept known as position encoding [Sukhbaatar et al., 2015] enables our model to discriminate the different roles of variables when two or more identical words appear in a single sentence. Without such settings, our model may fail to discriminate between source and destination variables such as in a strcpy function. The memory representation mi of line i consisting of J words and the k-th element ljk of the position encoding vector lj ∈ Rd for word j in the line i are obtained as mi = Σtj=1 lj · Axji , (1) ljk = (1 − j/J) − (k/d) (1 − 2j/J) , (2) where ‘·’ is element-wise multiplication. Memory storage (Fig. 3(b)). Next, we allocate our encoded sentences mi into matrices called memory blocks. Fig. 3(b) shows two memory blocks, the mem ory value block Mval∈ RN ×d and the memory address block Maddr ∈ RN ×d . Each sentence is allocated into one row of memory block, namely a memory slot. Mval stores semantical information about the contents of a code line while Maddr stores information for locating how much to address each line. For this reason, sentences are encoded using two different word embedding matrices, Eval and Eaddr for Mval and Maddr , respectively. Memory search (Fig. 3(c)). The query is encoded into a representation using Eaddr . We denote the initial query embedding as u0 . By computing the inner products between the query embedding and each slot of the memory address block, then applying a softmax function to the resulting vector, we obtain the attention vector p which indicates how related each line is to the query. The i-th element of p is obtained as  T  pi = softmax u0 Maddr , (3) with the softmax function as softmax (zi ) = ezi /Σj ezi . The response vector o is computed as in o = Σi pi (Mval )i . (4) (5) Table 1: Comparison on generated source codes. Inside brackets are the standard deviations CNN LSTM Memory network acc level 1 F1 auc acc level 2 F1 auc acc level 3 F1 auc acc level 4 F1 0.67 0.69 0.75 0.73 0.71 0.81 0.61 0.61 0.66 0.62 0.62 0.67 (0.01) (0.02) (0.01) (0.02) (0.02) (0.01) (0.01) (0.03) (0.01) (0.01) (0.03) (0.01) 0.8 0.84 0.92 0.82 0.80 0.90 0.69 0.66 0.76 0.67 0.64 0.75 (0.01) (0.01) (0.00) (0.01) (0.02) (0.01) (0.00) (0.01) (0.01) (0.01) (0.02) (0.01) 0.84 0.84 0.92 0.86 0.85 0.93 0.83 0.83 0.90 0.82 0.82 0.90 (0.01) (0.01) (0.01) (0.01) (0.02) (0.01) (0.02) (0.02) (0.02) (0.02) (0.02) (0.02) This vector contains information collected over all lines of the memory value block according to their attention weights obtained from the memory address block. This is equivalent to searching the memory for different parts of information with respect to a given query. Multiple hops and output (Fig. 3(d)). The response vector o can be either directly applied to a weight matrix W to produce an output, or added to strengthen the query u. In the latter case, the query is updated as in Eq. (6) by simply adding the response vector to the previous query embedding. uk+1 = uk + ok learning models for such tasks, we used existing deep learning models often used for text classification tasks as baselines. That is, we included a CNN for text classification [Kim, 2014] and a two-layer LSTM binary classifier. All models were trained with Adam [Kingma and Ba, 2014] at a learning rate of 1e-2. We used the classification accuracy, F1 score, and the area under the ROC curve (AUC) as performance metrics. We averaged the scores of the ten best cases with the smallest training error. Table 2: Different levels of test sets (6) Level 1 We repeat from Eq. (3) to obtain a new response vector. Our model iterates through multiple hops where at each hop the desired information to be obtained from the memory slightly changes. This accounts for situations where a model has to first look for lines where an array is allocated, and then gather information from lines stating the size of the variables used for allocating the array size. The final output is a floating value ranging from 0 (unsafe) to 1 (safe), which we round to the nearest integer to obtain a binary prediction result. 4 Experiments In this section, we present both quantitative and qualitative results of our experiments on model performance and learned characteristics. 4.1 auc Quantitative Evaluation Experiment settings. Our main dataset consists of C-style source codes discussed in Section 3.2. We used a single training set consisting of 10,000 sample programs. We generated four test sets with 1,000 samples each and assigned them levels one to four, with a higher level indicating a more complex condition (see Table 2). Samples ranged from 8 to 33 lines of code, with an average of 16.01. A total of 196 unique words appeared in the training set. A maximum of four dummy variables were added to each sample. We used random integers between 0 and 100 for buffer allocation and access. We conducted every experiment on a Intel (R) Xeon (R) CPU E52687W v3 @ 3.10GHz machine equipped with two GeForce GTX TITAN X GPUs. All models were implemented with Tensorflow 0.12.1 using Python 2.7.1 on an Ubuntu 14.04 environment. Model Comparison. We set our memory network to three hops with a memory of 30 lines and the embedding size of d = 32. As there has been no previous work on using deep Direct buffer access Access by strcpy / memcpy Allocation by int variable Reallocation of int variable √ Level 2 √ √ Level 3 √ √ √ Level 4 √ √ √ √ Performance results shown in Table 2 demonstrate that all models decrease in performance as task levels increase, due to our level assignment. Of the deep learning models, only memory networks performed consistently at a high level on all four level settings with accuracy rates higher than 80%. This is expected since their hops allow them to solve even complex situations such as variable reallocation and different buffer access types. Meanwhile, CNNs failed to complete even the simplest tasks since they cannot capture the sequential information in input sentences and instead apply convolutional filters to words of all regions on an equal basis. Any positional information is discarded. Memory networks require substantially shorter computing time compared to other models, requiring an average of 0.63s per epoch, while LSTMs and CNNs each require 7.13s and 13.21s. As for the latter models, the number of computations is proportional to the number of words that appear in a code. However, memory networks sum up all words of a sentence to form a single representation, and thus computation time relies on the number of lines instead of individual words. This significantly reduces computation time. Interestingly, LSTM models also performed well when set to easier tasks. Results show that LSTMs performed comparably to memory networks, even equaling them on Level 1 tasks. However, its performance sharply dropped when used on higher level tasks. This partial success of LSTMs relates to the simple structure of Level 1 tasks. The size of the character array always appears before the index to access, so the model can cheat by comparing the only two numbers that appear within the entire code. This cheating becomes obsolete (a) Cosine similarities (b) L2-norm distances (c) Representations of learned word embeddings (d) Visualization with t-SNE Figure 4: Visualizations of word embedding vectors of numbers 1-100. Red and blue indicate high and low values, respectively. as higher-level tasks require knowledge only obtainable by attending previous lines in a stepwise manner. 4.2 search range query results Qualitative Analysis code lines 1st hop 2nd hop 3rd hop void fun () 0.0E+00 0.0E+00 0.0E+00 { 0.0E+00 0.0E+00 0.0E+00 int entity_1 = 31; 0.0E+00 0.0E+00 1.1E-22 entity_1 = 48; 0.0E+00 0.0E+00 1.0E+00 char entity_7[6] = ""; 0.0E+00 1.0E+00 0.0E+00 char* entity_9; 4.8E-31 0.0E+00 0.0E+00 entity_9 = (char*)malloc(entity_1*sizeof(char)); 1.0E+00 0.0E+00 0.0E+00 entity_9[0] = '0'; 0.0E+00 0.0E+00 0.0E+00 memset(entity_7,'z',6-1); 0.0E+00 0.0E+00 0.0E+00 entity_7[6-1] = '0'; 0.0E+00 0.0E+00 0.0E+00 memcpy(entity_9,entity_7,6*sizeof(char)); 48>6? Answer: Safe Prediction: Safe Prediction confidence: 99.99% Figure 5: Prediction result with attention per hop We further examine the performance of our memory network model and the steps it takes to obtain a correct answer. We also present visualization results on how our model learns the concepts of numbers and numerical comparison without being explicitly supervised about such tasks. Tracking hop-wise results. In order to prove that our model solves the tasks in our desired manner, that is, by attending and collecting relevant information from different parts of the memory at different hops, we analyze individual prediction cases by inspecting which parts of information our model has obtained from taking each hop. Fig. 5 displays an example of buffer overrun analysis using our model. We can observe that when given a strcpy buffer access as a query, the model’s initial attention shifts to the sentence where the destination buffer (entity_3) is allocated. The model decides here to next look for entity_9, which contains the size used for allocating to entity_3. During the next hop it attends the line where the source buffer (entity_2) is allocated and obtains data of 99, the size of entity_2. At the last hop the memory network visits entity_9 and obtains 69. After the three hops, the destination size 69 is compared with source size 99, and being a smaller number, returns ‘unsafe’ as a result. The prediction confidence in Fig. 5 indicates how close the predicted value is to the ground answer. Numerical concepts automatically learned. Recall from Section 3 that our model was not given any prior information regarding the notion of quantitative values. Interestingly, our model learned to compare between different numbers. Fig. 4 displays visualization results using only the word embedding vectors corresponding to the 100 numbers. Figs. 4(a) and (b) display the cosine similarities and the L2-norm distances of all numbers from 1 to 100, with 1 at the topmost left-hand side. The colors observed at the first and third quadrants from both figures show that numbers with large differences are trained to minimize cosine similarities while maximizing L2-norm distances, thus spacing themselves apart. In contrast, similar numbers in the second and fourth quadrants have opposite characteristics, meaning they are similarly placed. The word embedding vectors of numbers across all d dimensions as seen in Fig. 4(c) further demonstrate a clear sequential order between numbers. The highlighted column forms a strong color spectrum starting from a low value which gradually increases as the corresponding number increases from 1 to 100. As all word embeddings were initialized with random values at the beginning, this spectrum indicates that our model learns by itself to assign such values for comparison purposes. Last of all, Fig. 4(d) is a t-SNE representation of all word embedding vectors. The black gradation indicates the word embeddings of numbers, with denser colors indicating larger numbers. We notice that they are embedded in a consistent direction in an increasing order. While this again shows how our model learns numerical characteristics, we also discover that dots in red, which correspond to entities from Section 3, stand out. As mentioned earlier, entities correspond to the variables that appear in source codes as integer variables or character buffers. This implies that our model learns to train word embeddings differently according to their purposes within a code. 5 Conclusions and Future Work In this work, we proposed a memory network-based model for predicting buffer overruns in programming language analysis. Our work is the first to apply a deep learning-based approach to a problem in the field of program analysis that requires both syntactic and semantic knowledge. Performance results show that memory networks are superior to other models in solving buffer overrun tasks across all difficulty levels. We also presented that our model successfully learns the notion of numbers and their quantitative comparisons from merely textual data in an end-to-end setting. Our work has room to improve in many interesting aspects. We can expand our model to cover different program analysis tasks such as pointer analysis, interval analysis, and flow- sensitivity analysis, which share similar semantic natures. We can apply advanced variants of memory networks to handle various conditions in source codes such as if and for statements. Our knowledge of models learning numerical representations can further aid deep learning models compatible with arithmetic and logical reasoning. All of these combined, our work marks a stepping stone to a fully data-driven program analyzer. References [Allamanis et al., 2014] Miltiadis Allamanis, Earl T. Barr, Christian Bird, and Charles Sutton. Learning natural coding conventions. In Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2014, pages 281–293, New York, NY, USA, 2014. ACM. [Bhatia and Singh, 2016] Sahil Bhatia and Rishabh Singh. Automated correction for syntax errors in programming assignments using recurrent neural networks. CoRR, abs/1603.06129, 2016. [Boland and Black, 2012] T. Boland and P. E. Black. Juliet 1.1 c/c++ and java test suite. Computer, 45(10):88–90, Oct 2012. [Cousot and Cousot, 1977] Patrick Cousot and Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 238–252. ACM, 1977. [Graves et al., 2014] Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. [Henaff et al., 2016] Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. Tracking the world state with recurrent entity networks. CoRR, abs/1612.03969, 2016. [Huo et al., 2016] Xuan Huo, Ming Li, and Zhi-hua Zhou. Learning unified features from natural and programming languages for locating buggy source code. In Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI 2016), pages 1606–1612, 2016. [Karpathy et al., 2015] Andrej Karpathy, Justin Johnson, and Li Fei-Fei. Visualizing and understanding recurrent networks. CoRR, abs/1506.02078, 2015. [Kim, 2014] Yoon Kim. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP 2014), pages 1746–1751, 2014. [Kingma and Ba, 2014] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [Kumar et al., 2016] Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016. [Lam et al., 2016] An Ngoc Lam, Anh Tuan Nguyen, Hoan Anh Nguyen, and Tien N. Nguyen. Combining deep learning with information retrieval to localize buggy files for bug reports. In Proceedings - 2015 30th IEEE/ACM International Conference on Automated Software Engineering, ASE 2015, pages 476–481. IEEE, 2016. [Miller et al., 2016] Alexander H. Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. CoRR, abs/1606.03126, 2016. [Nori and Sharma, 2013] Aditya V Nori and Rahul Sharma. Termination proofs from tests. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pages 246– 256. ACM, 2013. [Pu et al., 2016] Yewen Pu, Karthik Narasimhan, Armando SolarLezama, and Regina Barzilay. sk-p: a neural program corrector for moocs. In Companion Proceedings of the 2016 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity, pages 39–40, New York, New York, USA, 2016. ACM Press. [Sankaranarayanan et al., 2008a] Sriram Sankaranarayanan, Swarat Chaudhuri, Franjo Ivančić, and Aarti Gupta. Dynamic inference of likely data preconditions over predicates by tree learning. In Proceedings of the 2008 international symposium on Software testing and analysis, pages 295–306. ACM, 2008. [Sankaranarayanan et al., 2008b] Sriram Sankaranarayanan, Franjo Ivančić, and Aarti Gupta. Mining library specifications using inductive logic programming. In Proceedings of the 30th international conference on Software engineering, pages 131–140. ACM, 2008. [Sharma et al., 2012] Rahul Sharma, Aditya V Nori, and Alex Aiken. Interpolants as classifiers. In International Conference on Computer Aided Verification, pages 71–87. Springer, 2012. [Sharma et al., 2013a] Rahul Sharma, Saurabh Gupta, Bharath Hariharan, Alex Aiken, Percy Liang, and Aditya V Nori. A data driven approach for algebraic loop invariants. In European Symposium on Programming, pages 574–592. Springer, 2013. [Sharma et al., 2013b] Rahul Sharma, Saurabh Gupta, Bharath Hariharan, Alex Aiken, and Aditya V Nori. Verification as learning geometric concepts. In International Static Analysis Symposium, pages 388–411. Springer, 2013. [Socher et al., 2013] Richard Socher, Alex Perelygin, and Jy Wu. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing (EMNLP 2013), pages 1631–1642, 2013. [Sukhbaatar et al., 2015] Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Advances in Neural Information Processing Systems, pages 1–11, 2015. [Sutskever et al., 2014] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, pages 3104– 3112, 2014. [Weston et al., 2015a] Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. CoRR, abs/1502.05698, 2015. [Weston et al., 2015b] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In Int’l Conf. on Learning Representations, pages 1–15, 2015. [White et al., 2015] Martin White, Christopher Vendome, Mario Linares-Vásquez, and Denys Poshyvanyk. Toward deep learning software repositories. In Mining Software Repositories (MSR), 2015 IEEE/ACM 12th Working Conference on, pages 334–345. IEEE, 2015.
9cs.NE
arXiv:1712.04794v3 [math.GR] 15 Jan 2018 Generators and closed classes of groups Ramón Flores and José L. Rodrı́guez January 15th, 2017 Abstract We show that in the category of groups, every singly-generated class which is closed under isomorphisms, direct limits and extensions is also singly-generated under isomorphisms and direct limits, and in particular is co-reflective. We also establish several new relations between singly-generated closed classes. 1 Introduction In a category of R-modules over a certain ring R, the study of the closure of different classes under different operations has been a hot research topic for decades (see [15] for a thorough approach). The operations include extensions, subgroups, quotients, etc. In the case of R = Z, we are dealing, of course, with operations in the category of abelian groups. There is another different but related problem. Given a collection D of objects in a class C, the smallest class that contains D and is closed under certain operations is called the class generated by D under these operations. When this class is equal to C, it is said that C is generated by D under the operations, and the elements of D are called generators of C. In this situation, if D consists of only one object, the class C is said to be singly-generated under the operations. Now the question is clear: given a class C defined 0 Mathematics Subject Classification (2010): Primary: 20E34; Secondary: 20E22, 55P60. Keywords: co-reflections, cellular covers, direct limits, extensions, radicals. The first author was partially supported by FEDER-MEC grants MTM2010-20692 and MTM-201676453-C2-1-P. Second-named author was supported by grant MTM2016-76453-C2-2-P, and Grant FQM213 of the Junta de Andalucı́a. 1 by a certain property, is it possible to construct a generator for it? A standard reference for the topic is [1]. In this paper, we will deal with different versions of these two problems in the category of groups. Rather than from the vast literature in Module and Category Theory related to these topics, our motivation and strategy come from the field of Homotopy Theory. From the nineties, A.K. Bousfield, E. Farjoun and W. Chachólski ([4], [9], [13]) among others, developed an ambitious program whose main goal was to classify spaces and spectra in terms of classes defined by their generators and certain operations, particularly homotopy direct limits (cellular classes) and fibrations (periodicity classes). Taking account of this framework, the fundamental group functor gives a natural (but non-trivial) way to understand closed classes of groups from the same viewpoint. We are mainly interested in three classes of operations in the class of groups, namely taking direct limits, constructing extensions from a given kernel and cokernel, and taking quotients. The relation between the closed classes under these operations has been already studied in [10] from a different point of view. We focus on singly-generated classes, and in fact our first main result is a generation result. Given a group A, we denote by C(A) the class generated by A under direct limits, and by C(A) the class generated by A under direct limits and extensions. Then: Theorem 3.7 For any group A, there exists a group B such that C(A) = C(B). Moreover, we are able to describe B in terms of groups of the class C(A). This statement allows to generalize results of [18], where the case in which the Schur multiplier of A is trivial was studied, and also of [2] for the case of acyclic groups. It can also be seen as the group-theoretic version of the main theorem of [11], and it is in the spirit (see last section) of the generators of radicals described in [8]. Section 4 is devoted to establish relations between the closed classes under the operations mentioned above. The hierarchy is the following:  C(A)   / C(A) _ _  Cq (A)   / Ct (A)  where Cq (A) is the closure of C(A) under quotients and Ct (A) is the closure of C(A) under quotients and extensions. All these classes turn out to be co-reflective. Furthermore, we 2 find an example where the four classes are distinct (see Example 4.7). The co-reflections associated to the classes C(A), Cq (A) and Ct (A) are given respectively by the A-cellular cover CA , the A-socle SA and the A-radical TA , which are well-known notions in Group/Module Theory (see definitions in Section 2). However, for the class C(A), the existence of the corresponding co-reflection DA had been previously established [18] only for groups for which there exists a Moore space, and this goal was achieved only by topological methods. This gap in the theory is filled in this paper making use of Proposition 3.7, that guarantees the existence of DA for any group A. In general, given a group G, the philosophy is the following: a singly-generated class C and the co-reflection F associated to a certain operation, the kernel of the homomorphism F (G) → G measures how far G is from belonging to the class generated from C under the operation. We prove how the co-reflections define the corresponding closed classes, describe when possible the kernels, and discuss, for different instances of the generator, the (in)equality between the corresponding classes. In particular, we prove the following: Proposition 4.10 Suppose that for a group A the class C(A) is closed under extensions, i.e. C(A) = C(A). Then Cq (A) = Ct (A). The converse (stated as Question 4.12) is not true in general. Section 5 is devoted to give a counterexample that involves the Burnside idempotent radical and the Thompson group. It is an interesting question to find groups for which this converse is true. In fact, we are not even aware of any example of abelian group A such that SA = TA , see Proposition 4.9 and the discussion that precedes it. All the classes that appear in this paper will be supposed to be closed under isomorphisms. 2 (Co)reflections In this section we introduce the main notions that will be used throughout the rest of our paper. We will start with the classical categorical definition of co-reflection, that will be crucial for us. Definition 2.1 Given a inclusion of categories C ⊆ C ′ , where C is full in C ′ , C is coreflective in C ′ if the inclusion functor possesses a right adjoint, called co-reflection. 3 Given a co-reflective category, the co-reflection is unique up to natural isomorphism. A good survey about the topic from the categorical point of view can be found in [1]. The following definitions will be of great interest, and will be used in particular in the last section to define some interesting co-reflective subcategories of groups. Definition 2.2 Let A and H be groups. 1. The A-socle SA H is the subgroup of H generated by the images of all the homomorphisms A → H. 2. The A-radical TA H of H is the largest normal subgroup of H such that Hom(A, H/TA H) = 0. 3. The A-cellular cover of H is the unique group CA H ∈ C(A), up to isomorphism, that can be constructed from copies of A by iterated direct limits, and such that there exists a homomorphism CA H → H which induces a bijection Hom(A, CA H) ≃ Hom(A, H). Observe that this is equivalent to Hom(L, CA H) ≃ Hom(L, H) being a bijection for every L ∈ C(A). Remark 2.3 Note that similar definitions are possible if we change A by a collection A of groups indexed over a certain set I. In this case, the generator would be the free product of isomorphism classes of elements of A. Moreover, it is possible to give versions of the socle and the radical relative to a class of epimorphisms of groups. See [1] for a general treatment of these topics. Let us recall more constructive versions of some of these groups. The A-radical TA H S is the union TA (H) = i T i of a chain starting at T 0 = SA (H) and defined inductively S by T i+1 /T i = SA (H/T i ), and T λ = α T α if λ is a limit ordinal. In turn, the A-cellular cover CA G is constructed by taking coequalizers of free products of copies of A, being the homomorphisms induced by coequalizers. See details in ([18], Proposition 2.1). In the concrete case of the A-cellular cover, there is the following description, which is very useful: Theorem 2.4 ([18], Theorem 2.7) Given groups A and H, there is a central extension K ֒→ CA (H) ։ SA (H), (2.1) such that Hom(Aab , K) = 0 and the natural map Hom(A, H) → H 2 (A; K) is trivial. Moreover, this extension is universal with respect to this property. 4 The group constructions described in this section will give rise to different co-reflections, as we will see in Section 4. We will also need to recall some basics on (co)-reflections of spaces. Analogously to groups, given a pointed space M, the cellular class C(M) generated by M is the smallest class that contains M and is closed under pointed homotopy colimits. The corresponding co-reflection CWM X → X for a pointed space X, called the M-cellular cover of X, was explicitly described by Chachólski in his thesis [9] in the following way: consider the W homotopy cofiber Cof M X of the evaluation map [M,X]∗ M → X. Denote by PM the Mnullification functor, i.e. the homotopical localization with respect to a constant map (see [13], chapter 1). Then the homotopy fiber of Y → PΣM Cof M X is homotopy equivalent to CWM X. In [18] the relation between cellular covers of groups and spaces was described: if M is a 2-dimensional complex with π1 M = A, then π1 CWM K(N, 1) = CA N for every group N. 3 Generating classes of groups As said in the introduction, one of the goals of this paper is to describe a generator for the class C(A), the smallest class that contains A and is closed under direct limits and extensions. The elements of this class are usually called A-acyclic groups. In this section we will explain how to construct a generator for this class: Definition 3.1 Given a class C of groups closed under direct limits, a cellular generator for the class C is a group B such that C = C(B). In our context, C will usually be the class C(A) for some group A. These generators are not unique, and in fact several models for particular instances of A have been proposed in the literature ([2], [18]). We now present a general construction, which is inspired in the methodology of Chachólski-Parent-Stanley [11], that solved successfully the same problem in the category of topological spaces. Concretely, we translate to the grouptheoretic context their idea of small space; aside this, the proofs are very different, as their methods are homotopical in nature. We start with a set-theoretic definition: Definition 3.2 For a given infinite regular cardinal λ a group H is called λ-small (or small with respect to λ) if #H is smaller than the cofinality of λ. 5 Given a class C of groups closed under direct limits, let C[λ] be the subclass of groups H in C such that for each λ-small group K, every group homomorphism K → H factors as K → C → H for some λ-small group C in C. The following holds: Proposition 3.3 Let λ be an infinite regular cardinal. A group H is in C[λ] if and only if it is isomorphic to a direct limit of λ-small groups in C. Proof. Suppose H ∈ C[λ]. Consider the direct system of all λ-small subgroups of H that belong to C, ordered by inclusion, and let G be its direct limit. We will check that G = H. By contradiction, suppose there exists an element a ∈ G\H, and call A the subgroup that φ0 it generates. The group A is λ-small, and hence there is a factorization A → C0 → H of the inclusion A → H such that C0 is λ-small and belongs to C. Call K0 the image of φ0 , which is clearly λ-small. If K0 = A, then A is a retract of C0 , hence belongs to C (as a retract is a direct limit) and therefore a ∈ G, which is a contradiction, so we are done. If not, then A K0 , and we may proceed in the same way with the inclusion K0 < H, φ1 obtaining a factorization K0 → C1 → H. Iterating the process if necessary, we obtain a string of homomorphisms such that for every i there is a strict inclusion Ki Ki+1 : A ֒→ C0 ։ K0 ֒→ C1 ։ K1 ֒→ C2 ։ K2 ֒→ . . . , where Ci is λ-small in C for every i. As this string of arrows is a factorization of the inclusion A → H, it must eventually stabilize, and this implies that for a certain i (possibly transfinite ordinal) we have Ki = Ci = Ki+1 , and hence Ki is a retract of Ci and belongs to C. Again, this yields a ∈ G, contradiction, and then G = H. Conversely, assume that H is a direct limit of λ-small groups in C, and let us prove that H belongs to C[λ]. As every direct limit of groups is a composition of limits over filtered categories and push-outs, we only need to check these two cases. If H is the direct limit of the λ-small groups {Gα } over a filtered category, a standard compactness argument states that every homomorphism K → H factors through Gα for a certain α. Hence H belongs to C[λ]. Now if H is a pushout of groups, the short argument of the proof of Lemma 4.8.4 in [11] applies to the group-theoretic case, and implies that H ∈ C[λ]. So we are done. ✷ Now we can establish closure properties of C[λ]. The first is a straightforward consequence of the previous result: 6 Corollary 3.4 If C is closed under direct limits, C[λ] is so for every infinite regular cardinal λ. Proof. Let H be a direct limit of groups in C[λ]. By the previous proposition, H is a direct limit of λ-small groups in C, and, every direct limit of λ-small groups in C belongs to C[λ], so we are done. ✷ Observe that the proof establishes that the λ-small groups in C generate C[λ] as a cellular class. The following result is the group-theoretical analogue of [11, Theorem 6.1], although the proof is very different and purely group-theoretical. Lemma 3.5 If C is any class of groups closed under extensions, then C[λ] is also closed under extensions. π Proof. Let 1 → X → Y → Z → 1 be a short exact sequence with X and Z in C[λ]. We have to prove that Y ∈ C[λ]. Let j : K → Y be any group homomorphism, with K λsmall. Since Z ∈ C[λ], πj factors through some λ-small group Z0 in C. Taking the pullback π0 along Z0 → Z we obtain a short exact sequence 1 → X ∼ = Ker π0 → Y0 → Z0 → 1. Let j0 : K → Y0 be the induced homomorphism and consider K0 the subgroup of Y0 generated by j0 (K) and s(Z0 ) where s is a chosen section (non necessarily homomorphism) of π0 . The intersection K ′ = K0 ∩ X is λ-small because K0 is λ-small, and it is normal in K0 with K0 /K ′ ∼ = Z0 . Since X ∈ C[λ], the inclusion K ′ ֒→ X factors as K ′ ֒→ X0 → X for some small group X0 ∈ C. Let now P0 be the push-out of K0 ← K ′ → X0 , and denote by (X0 )N the normal closure of X0 in P0 . The quotient P0 /(X0 )N ∼ = Z0 , and P0 is a λ-small group in C, because both K ′ and X0 are λ-small. Observe that (X0 )N need not be in C. In any case, it is λsmall and therefore the inclusion (X0 )N → X factors through some λ-small group X1 ∈ C. Iterating this process we get an increasing chain of short sequences over X → Y → Z which are, alternatively, in C, but not exact, and exact but not in C. Here the subscript “∞” denotes the colimit of each linear sequence of homomorphisms. X0 → (X0 )N → X1 → ... → Xi → (Xi )N → ... → X∞ = (X∞ )N ↓ ↓ P0 → P0 ↓ ↓ Z0 → Z0 ↓ ↓ → P1 → ... → Pi → ↓ ↓ → Z0 → ... → Z0 → 7 ↓ Pi ↓ → ... → ↓ Z0 P∞ ↓ → ... → Z0 In the limit we get a short exact sequence 1 → X∞ = (X∞ )N → P∞ → Z0 → 1, where X∞ is λ-small and is in C, hence P∞ is λ-small and is in C too, because C is closed under extensions. Hence, K → Y factors K → P∞ → Y , and this shows that C[λ] is closed under extensions. ✷ For a given cardinal λ, let Bλ the free product of a set of representatives of isomorphism classes of λ-small groups in C(A). We will need the following result: Lemma 3.6 For every infinite regular cardinal, C(A)[λ] = C(Bλ ). Proof. If K is an element of C(A)[λ], it is by Proposition 3.3 a direct limit of λ-small groups in C(A). But every such λ-small group is a retract of Bλ , so it belongs to C(Bλ ), and hence so does K since C(Bλ ) is closed under direct limits. Conversely, every group H in C(Bλ ) is an (iterated) direct limit of copies of Bλ , and in particular a direct limit of λ-small groups, so H ∈ C(A)[λ] and we are done. ✷ Now we are ready to prove the main theorem in this section: Theorem 3.7 For any group A, there exists a group B such that C(A) = C(B). Proof. Let A be any group, λ an infinite regular limit cardinal with cf (λ) ≥ #A. Then, by Lemma 3.6, we have C(A)[λ] = C(B), where B = Bλ . In particular, the class C(A)[λ] is closed under direct limits. The conditions over λ imply that A is λ-small, and hence C(A) ⊆ C(A)[λ]. But by Lemma 3.5 C(A)[λ] is closed under extensions, so C(A) ⊆ C(A)[λ]. On the other hand, C(A)[λ] is a subclass of C(A) by definition, and the result follows. ✷ It is likely that the assumptions over the cardinals may be relaxed, but here we are not interested in some models of the cellular generators, but rather in their existence. In the next section we will use different cellular generators for concrete computations and in particular, and perhaps more important, to define in general the co-reflection associated to the class C(A) for every group A. 4 4.1 Closed classes Classes of groups and associated co-reflections Let A be a group. The goal of this section is to analyze the relations between four different classes that contain the group A, namely: 8 • The cellular class C(A), the closure of {A} under direct limits. Their elements are called A-cellular groups. • The socular class Cq (A), the closure of {A} under direct limits and quotients. Their elements are called A-generated or A-socular groups. • The radical class Ct (A), the closure of {A} under direct limits, extensions and quotients. Their elements are called A-constructible or A-radical groups. • The acyclic class C(A), the closure of {A} under direct limits and extensions. Their elements are called A-acyclic groups. The hierarchy between these classes can be depicted in the following way:  C(A)   / C(A) _ _  Cq (A)  (4.2)  / Ct (A)  We use in particular the terminology of W. Chachólski, who studied the problem in the non singly-generated case in [10]. It is known that a group G is A-cellular if and only if CA G = G ([18], section 2). We will check now that similar statements hold for A-generated and A-constructible groups. Probably this result is known to experts, but we do not know any explicit proof of it. We offer purely algebraic arguments here. Proposition 4.1 Let A and G be groups. Then: • G is A-generated if and only if SA G = G. • G is A-constructible if and only if TA G = G. Proof. For the first part, it is clear that A is A-generated. Now, if G is a direct limit of A-generated groups, it is in fact a quotient of a free product of copies of A-generated groups (which is A-generated itself), and then it is A-generated. Finally, every quotient of an A-generated group is A-generated. Conversely, if SA G = G, G is a quotient of a free product of copies de A (by definition of socle), and hence belongs to the closure of A under direct limits and quotients. 9 Let us check the second statement. Consider the class C of groups such that G = TA G. Clearly A belongs to C, so let see that C is closed under quotients and extensions. For the first, recall that for every homomorphism of groups f : H → G, f (TA H) ⊆ TA G. Then, if H = TA H and G is a quotient of H, G = TA G, and hence G belongs to C. On the other hand, assume that G is an extension G1 → G → G2 , with G1 and G2 in C. As G1 = TA G1 , G1 ⊆ TA G. Hence, there is a projection G2 → G/TA G. But G2 = TA G2 and TA (G/TA G) = 0, thus G/TA G = 0 and G = TA G. So C is also closed under extensions, and then Ct (A) ⊆ C. Now assume G = TA G. Then G is constructed out of A by means of A-socles, extensions and a direct union, and thus, by the previous case and the fact that a direct union is a direct limit, G belongs to the closure of A by direct limits, quotients and extensions. So C ⊆ Ct (A), and we are done. ✷ The previous result provides co-reflections for the respective classes. Corollary 4.2 In the previous notation, the categories C(A), Cq (A) and Cr (A) are coreflective. The co-reflections are respectively given by the A-cellular cover, the A-socle and the A-radical. ✷ In this context, the next question is immediate: giving a group A, is the class C(A) co-reflective? We will see next that Theorem 3.7 gives a general answer to this question. A partial solution was obtained in [18], where the authors assume the existence of a 2dimensional Moore space for A in order to construct the co-reflection. Recall that given a group A, a Moore space of type M(A, 1) is a CW-complex X such that π1 X = A and H2 X = 0. Then the following is proved: Theorem 4.3 ([18], Theorem 3.1) Let A be the fundamental group of a two-dimensional Moore space. Then the inclusion C(A) ֒→ Groups admits a right adjoint DA . Furthermore, for each group H, there is a central extension L ֒→ DA (H) ։ TA (H) such that Hom(Aab , L) = Ext(Aab , L) = 0, and this extension is universal (initial) with respect to this property. This result presents interesting features. First, it gives a manageable way to compute the value of the co-reflection DA H over any group H, as L is identified as the fundamental 10 group of the homotopy fiber of the M(A, 1)-nullification of K(TA H, 1), i.e. localization with respect to the constant map over M(A, 1) (see [13], chapter 1). Moreover, the similarity with Theorem 2.4 should be remarked, and in fact for every group H there exists a natural homomorphism CA N → DA N which induces a map between the corresponding extensions, and in particular the inclusion SA N ֒→ TA N. Remark that the co-reflection is constructed here in a strongly non-algebraic but homotopical way. This homotopical nature of the construction made it impossible to define DA for a general A, as it depended on the existence of a two-dimensional Moore space for the group. We will avoid the difficulty by defining DA as a cellular cover in a pure group-theoretical way. We present now our general construction of the co-reflection DA for every group A. Proposition 4.4 Let A be a group, and B a cellular generator of the class C(A). Then a group G is A-acyclic if and only if CB G = G. Proof. It is a straightforward consequence of Theorem 3.7. ✷ Corollary 4.5 For every group A, the class C(A) is co-reflective, and the co-reflection is given by CB . As co-reflections are unique, the value of CB does not depend on the concrete model for the generator B; hence, in the following this co-reflection will be denoted by DA . Note that there is no ambiguity in the notation, as again by uniqueness, the value of the co-reflection coincides with the one defined in Theorem 4.3, for the instances of A for which that theorem is valid. Finally, remark that our model for B in the previous section is built in a pure algebraic way, and hence it is the construction of DA . The following proposition provides examples of concrete computations of DA , in particular when H2 A 6= 0. Proposition 4.6 Let H and G be finite non-trivial groups, with H simple, |H| |G| and such that there is exactly a subgroup of G that is isomorphic to H. Then DH G = H, and G/H does not belong to C(H). Proof. As H is simple and normal in G, SH G = TH G = H. But for every group A we always have DA = DA TA , and hence DH G = DH TH G = DH H = H, 11 as H is clearly H-acyclic. Moreover, if G/H belonged to C(H), then G would also belong, and that is impossible because DH G 6= G. ✷ As said above, this result gives information for classes C(A) with H2 A 6= 0, a very difficult issue without a general construction of DA . For example, if H = An , G = Σn and n ≥ 5, the proposition implies that DAn Σn = An , and hence neither Σn nor Z/2 can be constructed out of An by direct limits and extensions. 4.2 Comparing the classes From now on we will concentrate in measuring the difference between the classes above. Let F be one of the four co-reflections. Given groups A and G, F G measures in general how close the group G is from belonging to the corresponding class. Moreover, the homomorphisms SA G → G, TA G → G and SA G → TA G are always injective, while the homomorphisms DA G → TA G and CA G → SA G are always surjective, so we have a commutative diagram: CA G  DA G // SA G _ // TA G (4.3)  Note that in general, CA G → DA G is neither surjective nor injective. Using an example, we start by showing that the four inclusions of classes in the diagram 4.2 above are strict in general. Of course, the previous results imply that two such classes are identical if and only if their associated co-reflections are the same. Example 4.7 Consider the group G = ha, b, c, d | a4 = b4 = c4 = d4 = 1, abab = cdcdi. This group is generated by order 4 elements, and hence TZ/2 G = G. On the other hand, it is easy to check that the Z/2-socle of G is generated by the squares of the generators, and then SZ/2 G = he, f, g, h | e2 = f 2 = g 2 = h2 = 1, ef ef = ghghi. Observe that SZ/2 G is the group N described in Example 2.11 of [18]. Hence, as CZ/2 G = CZ/2 SZ/2 G, the cellular cover of G is an extension of SZ/2 G by Z. Finally, the same 12 reasoning of the mentioned example proves that DZ/2 G is an extension of G by Z[1/2]. As these four groups are different, we have that the four inclusions of classes are strict in the case A = Z/2. Next we will discuss when the socular class Cq (A) is closed under extensions, and hence equal to the radical class Ct (A). For example, if A = Z/p for some prime p, it is known that there are many groups G such that G/Sp G has again p-torsion, and same happens if we change Z/p by ∗j≥1Z/pj ; this contrasts with the case of abelian groups, in which for L A = j≥1 Z/pj , TA N = SA N for every abelian group. When A is the additive group of the rational numbers, the situation is similar. If N is abelian, SQ N = TQ N, because the image of every homomorphism Q → N is divisible and then splits out of N. However, if N is not abelian the equality is not true in general. We have found no example of this situation in the literature, so we describe one in the sequel: Example 4.8 Let N be the push-out of inclusions Q ←֓ Z ֒→ Z[1/p]. As N is torsionfree, every homomorphism Q → N is injective. Moreover, given a subgroup A < N isomorphic to Q, SQ N is isomorphic to the subgroup generated by the conjugates of A by elements of Z[1/p]. This implies that N/SQ N = Z[1/p]/Z, which is isomorphic to Z/p∞ . As there exists an epimorphism Q → Z/p∞ , we conclude that N = TQ N, which strictly contains SQ N. It can be stated in an analogous way that SZ[1/p] N 6= TZ[1/p] N, as Q/Z has non-trivial homomorphisms from Z[1/p]; moreover, similar arguments can be used to prove that for a non-trivial set of primes J, the co-reflection SZ[J −1 ] is never equal to TZ[J −1 ] . In particular we obtain: Proposition 4.9 If A is an additive subgroup of Q, SA = TA if and only if A is trivial or A = Z. Proof. It is immediate from the previous discussion and Example 5.2 of [18] (see also [14]). ✷ The moral here is that it is not easy to find examples for which SA = TA . However, there are at least two ways of constructing such examples. The first family arises in the context of varieties of groups. Consider a set of equations, and the verbal subgroup W 13 defined by these equations in the free group F∞ . It is proved in [8] that for every W there exists a locally free group A such that the homomorphisms of W into any group G identify the W -perfect radical, and in particular, this fact guarantees that SA = TA . The inspiring (and first) “generator” of this kind was the acyclic group of Berrick-Casacuberta [2], and a closely related group will be the crucial ingredient of Proposition 5.2 below. The second family of examples can be constructed as a byproduct of Theorem 3.7, taking account of the following two results: Proposition 4.10 Suppose that for a group A the class C(A) is closed under extensions, i.e. C(A) = C(A). Then Cq (A) = Ct (A). Proof. In this case, for every group G, CA G = DA G, and then there is a diagram DA G // SA G j Id  DA G //  TA G As j should be an epimorphism, and it is always a monomorphism, it is an isomorphism. ✷ Corollary 4.11 Let A be a group. Then for any cellular generator B of the class C(A) we have SB = TB . Recall that by Theorem 3.7, it is always possible to construct such B out of any given G, and this provides many examples of groups for which SA = TA . It is natural and interesting to ask if there is a converse of the previous proposition, so we will devote the rest of the paper to the following problem: Question 4.12 If TA = SA , for a certain group A, is it true that C(A) = C(A)? We will see in Proposition 5.2 that the general answer is negative. Before, we will discuss in which cases the conjecture can be true. The following result is easy to prove and gives a sufficient condition: Proposition 4.13 Let A be a group, and assume that C(A) = Cq (A) and TA = SA . Then C(A) = C(A). 14 Proof. As the members of the classes are defined precisely as the groups for which the corresponding co-reflection is the identity, TA = SA implies Cq (A) = Ct (A), and then by hypothesis C(A) = Ct (A). But the inclusions C(A) ⊆ C(A) ⊆ Ct (A) always hold, so the result follows. ✷ It can be seen that the condition of the proposition holds for the acyclic group of Berrick-Casacuberta. However, the following example shows that the condition is not necessary in general for cellular generators of closures under extensions: Example 4.14 Given a prime p, consider a cellular generator B of the class C(Z/p). If C(B) = Cq (B), this would imply that CB = SB , and equivalently DZ/p = TZ/p . But this is not true in general, as can be deduced for instance from Example 4.7. Observe that we obtain in particular that C(B) = C(B) 6= Cq (B) = Ct (B) in this case. We finish this section with a technical description of the difference between DA and CA when SA = TA . Remember from the previous section that for every group N we have constructed DA N as the cellular cover of N with respect to a cellular generator B of C(A). As CA N is B-cellular, there is a canonical homomorphism CA N → CB N, which induces in turn a diagram of extensions: KO A KB CBO N / / CA N SBO N / / SA N Here KA and KB are the corresponding kernels. Observe that SA N = TA N implies that SB N = TA N, the right vertical homomorphism is the identity, and the difference between CA N and CB N(= DA N) is exactly the difference between KA and KB . We will need some homotopical tools in our description of the kernel of CA N → CB N. In the sequel we will denote respectively by MA and MB 2-dimensional complexes with π1 MA = A and π1 MB = B, respectively, and by Cof A and Cof B the corresponding homotopy cofibres defined at the end of Section 2 . Without loss of generality, we can assume that N = TA N = SA N, and denote X = K(N, 1). The long exact sequence of the fibration X → PΣMA Cof A gives rise to an extension of groups: π2 PΣMA Cof A → π1 (CWA X) → N. 15 On the other hand, Mayer-Vietoris sequence of the cofibration gives rise to another extension: HA → π2 Cof A → M LA , where the group on the left is the quotient of H2 N under the image of the induced L homomorphism H2 (A) → H2 (N) and the group on the right is a subgroup of the L direct sum Aab . Similar sequences exist replacing A by B. According to Section 7 of [5], the effect of PΣMA over the second homotopy group of a simply-connected space is to divide by the Aab -radical. As TA = TB , we have KA = π2 Cof A /TA (π2 Cof A ) and KB = π2 Cof B /TA (π2 Cof B ). Moreover, as the homomorphism W KA → KB is induced by the map Cof A → Cof B induced in turn by the inclusion MA → W MB , we obtain the following: Proposition 4.15 In the previous notation, the kernel of the homomorphism CA N → DA N is isomorphic to the kernel of the homomorphism π2 Cof A /TA (π2 Cof A ) → π2 Cof B /TA (π2 Cof B ). Let us remark a relationship between Cof A and Cof B . Consider W MA and W MB , with ′ the wedges respectively indexed by [MA , X]∗ and [MB , X]∗ . If B is the homotopy cofiber W W of the map MA → MB induced by inclusion, there is also a cofibration sequence ΣB ′ → Cof A → Cof B . As PΣMA B ′ is contractible, ([13], 1.D.3) implies that there is a homotopy equivalence PΣMA ΣCof A ≃ PΣMA ΣCof B . As π3 ΣCof A = π2 Cof A and same happens to Cof B , this seems an interesting way to investigate the relation between KA and KB . However, when H2 A 6= 0, MA cannot be a Moore space, and these nullifications are hard to compute. In the other case, Proposition 5.1 of [18] (based in turn in Section 5 of [5]) implies that certain localizations or completions of π2 Cof A and π2 Cof B are the same. See also section 5.2 of [16]. In general, the relation between the group co-reflections CA and CB (= DA ) has been investigated when H2 A = 0, and it is well understood when A is a cyclic group or a subring of Q (see for example [18]). As seen above, the latter is not useful in our context, as SA 6= TA for these groups. However, in the next section, we will take profit of some features of the case H2 A = 0 to describe a counterexample for Question 4.12. 16 5 The Burnside radical and the Thompson group In the following A will denote the generator constructed in ([8], Theorem 3.3) of the Burnside idempotent radical for a prime p. This is a locally-free group, and then it is torsion-free. In our computations we will need its lowest ordinary homology: Lemma 5.1 The first homology group H1 (A) is a free module over Z[1/p], and H2 A = 0. Proof. As the group is locally free, H2 A = 0. Moreover, the construction of A in the mentioned paper (as a telescope of homomorphisms that send generators to products of p-powers) implies that the first homology group is the direct limit of a system M M Z → ..., Z→ Z→ I2 I1 where: • Every direct sum is taken over a finite set of indexes. • If j < k, then Ij < Ik . • For every k, the homomorphism L Ik Z→ L Ik+1 Z takes the |Ik | components of the left group to the first |Ik | of the right group in their order, and the homomorphism is multiplication by p. Hence, the direct system that defines H1 A is a countable direct sum of copies of the p p p system Z → Z → Z → . . . and the result follows. ✷ Now consider the Thompson group F, defined by the presentation F = hx0 , x1 , x2 , . . . | x−1 i xn xi = xn+1 for i < ni. It is known that this is an infinite simple group such that H2 F is a free abelian group in two generators, see [7]. Proposition 5.2 For the group A, one has SA = TA , but DA 6= CA . Proof. As A generates the idempotent radical associated to a variety of groups, TA = SA . We will check in this proof that DA F 6= CA F . First we will compute explicitly DA F. As the radical is always a normal subgroup and F is simple and not equal to its exponent p reduction, F = TA F . According to 17 Theorem 4.3, we need to compute the kernel of the homomorphism DA F → F , which is in turn the fundamental group of the homotopy fibre of the map K(F, 1) → PM K(F, 1), being M = M(A, 1) the corresponding 2-dimensional Moore space (which exists by the local freeness of A). We can describe nullifications of nilpotent spaces, so we consider W the evaluation [M,K(F,1)] M → K(F, 1) extended over all the homotopy classes of maps M → K(F, 1). Let C be the homotopy cofibre of this map. As the wedge is M-acyclic, PM K(F, 1) = PM C. As F = TA F , C is simply-connected. Now we need to compute π2 C, which by Mayer-Vietoris is defined by an extension: M H2 F ֒→ π2 C ։ Z[1/p]. Here we have used that H2 A = 0 and the perfectness of F . Now according to ([5], Theorem 7.5), π2 PM C is the Ext-p-completion of π2 C. In the sequel we will call P the group in the right hand-side of the extension. Taking account of the fact that Hom(Z/p∞ , G) = 0 if G is free abelian and ([6],VI.2.5), we obtain an extension: M Ext(Z/p∞ , Z[1/p]) ֒→ Ext(Z/p∞ , π2 C) ։ Ext(Z/p∞ , Z ⊕ Z). As the Ext-p-completion of every p-divisible group is trivial, the term in the left is so, and the homomorphism in the right is an isomorphism. Hence by ([6],VI.2.6) we have π2 PM C = Z∧p ⊕ Z∧p , and DA F is defined by an extension: Z∧p ⊕ Z∧p ֒→ DA F ։ F. Now by Theorem 2.4, we must prove that the kernel of CA F → F cannot be isomorphic to two copies of the p-adic integers. We know that such kernel is isomorphic to π2 C/TA π2 C. As π2 C is abelian, TA π2 C = TZ[1/p] π2 C, and as the homomorphism f : π2 C → P is an epimorphism, same is true for π2 C/TZ[1/p] π2 C → P/f (TZ[1/p] π2 C). But as Z[1/p] is p-divisible, f (TZ[1/p] π2 C) is so, and then it is a free Z[1/p]-submodule of P , as Z[1/p] is a principal ideal domain. Then it is easy to check that no non-trivial quotient of a free Z[1/p]-module by a Z[1/p]-free submodule can be divisible. Assume now by reductio ab absurdum that π2 C/TZ[1/p] π2 C is isomorphic to Z∧p ⊕ Z∧p . Then P/f (TZ[1/p] π2 C) should be non-trivial, otherwise Z∧p ⊕ Z∧p would be isomorphic to a free abelian group. Moreover, as Z∧p ⊕ Z∧p is q-divisible for every q 6= p, its quotient P/f (TZ[1/p] π2 C) should be too. But P/f (TZ[1/p] π2 C) is p-divisible but not divisible, so we have a contradiction, and then DA F 6= CA F . 18 ✷ Remark 5.3 We do not know if π2 C/TZ[1/p] π2 C is a free abelian group in two generators, because we are unable to show if the extension that defines π2 C splits or not. Recall that Ext(Z[1/p], Z) = Z∧p /Z is uncountable, but only the trivial extension of Z by Z[1/p] splits. Acknowledgments. We warmly thank Jérôme Scherer for several discussions about the paper and for his thorough revision of the manuscript, which has led to a substantial improvement of the presentation. We also thank Fernando Muro for useful discussions. The first author expresses his gratitude to the Department of Mathematics of the University of Almerı́a for their kind hospitality. References [1] J. Adámek, J. Rosický, Locally presentable and accessible categories, Vol. 189, Cambridge Univ. Press, 1994. [2] A. Berrick and C. Casacuberta, A universal space for plus-constructions, Topology 38 (1999), 467–477. [3] A. K. Bousfield, Homotopy factorization systems, J. Pure Appl. Algebra 9 (1977), 207–220. [4] A. K. Bousfield, Localization and periodicity in unstable homotopy theory, J. Amer. Math. Soc. 7 (1994), 831–873. [5] A. K. Bousfield, Homotopical localizations of spaces, Amer. J. Math. 119 (1997), 1321–1354. [6] A. K. Bousfield, D. M. Kan Localization and completion in homotopy theory, Bull. Amer. Math. Soc. 77 (1971), no. 6, 1006–1010 [7] K. S. Brown, The homology of Richard Thompson’s group F, Topological and asymptotic aspects of group theory, 47—59, Contemp. Math., 394, Amer. Math. Soc., Providence, RI, 2006. [8] C. Casacuberta, J. L. Rodrı́guez, and D. Scevenels, Singly generated radicals associated with varieties of groups, Proceedings of Groups St. Andrews 1997 in Bath I, 19 London Math. Soc., Lecture Note Series 260, Cambridge University Press (1999), 202–210. [9] W. Chachólski, On the functors CWA and PA , Duke Math. J. 84, (1996), 599–631. [10] W. Chachólski, Covers of groups, An alpine expedition through algebraic topology, 109–131, Contemp. Math., 617, Amer. Math. Soc., Providence, RI, 2014. [11] W. Chachólski, P. E. Parent, and D. Stanley, Cellular generators, Proc. Amer. Math. Soc. 132, 11 (2004), 3397–3410. [12] W. Chachólski, E. Damian, E. Farjoun, and Y. Segev, The A-core and A-cover of a group, J. Algebra, 321, Issue 2, (2009), 631–666. [13] E. Farjoun, Cellular spaces, null spaces and homotopy localization, Lecture Notes in Math. 1622 Springer-Verlag, Berlin Heidelberg New York, 1996. [14] T. Fay, E. Oxford, and G. Walls, Singly generated socles and radicals, in Abelian group theory (Honolulu, Hawaii, 1983), Lecture Notes in Math. 1006, Springer, Berlin-New York (1983), 671–684. [15] R. Göbel and J. Trlifaj, Approximations and endomorphism algebras of modules, GEM 41, W. de Gruyter, Berlin, 2012. [16] J.L. Rodrı́guez, On homotopy colimits of spaces with a single homology or homotopy group, Ph. D. thesis, Universitat Autònoma de Barcelona, 1997. [17] J. L. Rodrı́guez and D. Scevenels, Universal epimorphic equivalences for group localizations, J. Pure Appl. Algebra, 148 (3) (2000), 309–316. [18] J. L. Rodrı́guez and J. Scherer, Cellular approximations using Moore spaces. Cohomological methods in homotopy theory (Bellaterra, 1998), 357–374, Progr. Math., 196, Birkhäuser, Basel, 2001. [19] J. L. Rodrı́guez and J. Scherer, A connection between cellularization for groups and spaces via two-complexes, J. Pure Appl. Algebra, 212 (2008), 1664–1673. [20] K. Varadarajan. Groups for which Moore spaces M(π, 1) exist, Ann. of Math. 84 (1966), 368–371. 20 Ramón Flores Departamento de Geometrı́a y Topologı́a, Universidad de Sevilla-IMUS E-41012 Sevilla, Spain, e-mail: [email protected] José L. Rodrı́guez Departamento de Matemáticas, Universidad de Almerı́a E-04120 Almerı́a, Spain, e-mail: [email protected] 21
4math.GR
arXiv:1703.04741v3 [cs.AI] 31 Oct 2017 Towards Moral Autonomous Systems Vicky Charisi 1 , Louise Dennis 2 , Michael Fisher2 , Robert Lieck3 , Andreas Matthias4 , Marija Slavkovik5 , Janina Loh (Sombetzki)6 , Alan F. T. Winfield7 , and Roman Yampolskiy8 1 University of Twente University of Liverpool 3 Universität Stuttgart 4 Lingnan University 5 [email protected], University of Bergen 6 University of Vienna 7 University of the West of England, Bristol 8 University of Louisville 2 November 1, 2017 Abstract Both the ethics of autonomous systems and the problems of their technical implementation have by now been studied in some detail. Less attention has been given to the areas in which these two separate concerns meet. This paper, written by both philosophers and engineers of autonomous systems, addresses a number of issues in machine ethics that are located at precisely the intersection between ethics and engineering. We first discuss the main challenges which, in our view, machine ethics posses to moral philosophy. We them consider different approaches towards the conceptual design of autonomous systems and their implications on the ethics implementation in such systems. Then we examine problematic areas regarding the specification and verification of ethical behavior in autonomous systems, particularly with a view towards the requirements of future legislation. We discuss transparency and accountability issues that will be crucial for any future wide deployment of autonomous systems in society. Finally we consider the, often overlooked, possibility of intentional misuse of AI systems and the possible dangers arising out of deliberately unethical design, implementation, and use of autonomous robots. 1 Keywords: Robot ethics, Machine ethics, Artificial morality, Autonomous systems, Verification, Transparency, Unethical AI This article is the result of a series of discussions taken within the scope of the Dagstuhl Seminar 6222 Fisher et al. [2016]. Dennis, Fisher and Winfield wish to thank EPSRC for their support, particularly via the “Verifiable Autonomy” research project (EP/L024845 and EP/L024861) Corresponding Author: Marija Slavkovik, University of Bergen, P.O.Box 7802, 5020 Bergen, Norway, [email protected] 1 Introduction The so called “trolley problem” is a thought experiment introduced in Foot [1967], whose ethical conundrum continues to fascinate today Wallach and Allen [2008]. Roughly, it can be summarized as follows: there is a runaway trolley on a railroad track and ahead on the track there are five people tied up, unable to escape being killed by the trolley. The track splits in two by a lever you control. The lever can divert the trolley on to a second track where there is one person tied up and unable to move. Is it more ethical to divert the train, or let it run its course? The emergence of driver-less cars in regular traffic has brought the trolley problem to public attention. Articles such as “Should Your Car Kill You To Save Others?”1 are flooding popular science media. It is easy, given the same problem context of traffic, to get sidetracked into confusing solving the trolley problem with controlling the impact driver-less cars will have on traffic and our society as a whole. This, of course, is not the case. Enabling machines to exhibit ethical behavior is a very complex and very real time-sensitive issue. The driver-less cars are only the forefront of a whole generation of intelligent systems that can operate autonomously and will operate as part of our society. Which ethical theory to employ for deciding whose death to avoid in a difficult traffic situation is a difficult problem. This, however is not necessarily the most important problem we would need to solve. The goal of this position paper is to discuss what does engineering machine ethics entail. Once we as a society have discerned what is the right thing for an artificial autonomous system to do, how can we make sure the machine does it? The problem of identifying, discerning, and recommending concepts of right and wrong is the domain of moral philosophy. Moral philosophy, together with the law, act as a system of recommendations regarding which 1 http://www.popularmechanics.com/cars/a21492/the-self-driving-dilemma/ 2 possible actions are to be considered right or wrong (ignoring, for the moment, ethics systems that do not specifically address the morality of individual actions, e.g. character-based ethics, and which are less useful for the problem at hand). Driver-less vehicles are the most visible of a whole range of technologies. This range includes also the assisted living technologies, as well as the various embedded decision aid software and solutions. We have been using intelligent systems with varying degree of autonomy for the past fifty years: industrial robots, intelligent programming of household appliances, automated trains, etc. However, what all of these machines have in common is that they either operate in a segregated space, a so called working envelope, or they have no capabilities to cause damage to their environment. Driver-less vehicles are obviously going to “break” both these restrictions. How can we build intelligent autonomous systems that uphold the ethical values of the society in which they are embedded? This is the main concern of machine ethics, a new interdisciplinary area of research within Artificial Intelligence (AI) Moor [2006]; Allen et al. [2006]; Wallach et al. [2008]; Wallach and Allen [2008]; Anderson et al. [2016]. It is clear that choosing the best moral theory to implement in a particular intelligent autonomous system is not a simple question. It is primarily a question for moral philosophy and opens new challenges in this field. In Section 2 we give a brief overview of these challenges. For a long time, people and societies have been the only intelligent decision-makers. Moral philosophy has been developed with the often implicit assumption that the moral agent is a human. It is not at all clear to what extent existing moral theories extend to non-human decision-makers. Even if it is shown to be easy to replace a human agent with an artificial agent in a moral theory, and some societal decision is made concerning which ethical behavior in machines is desirable or sufficient, we are still faced with a set of problems regarding the implementation of ethical reasoning. These are the problems we analyze here: implementation, verification, trust, confidence and transparency and the prevention of intentionally unethical systems. Moral theories are inherently ambiguous in recommendations of moral behavior, thus reflecting the context dependency of what constitutes a moral choice. We already know that artificial systems, when compared to people, are not good at handling ambiguity. Enabling machines to deal with contextambiguity in decision-making is a core Artificial Intelligence problem Russell and Norvig [2015]. In Section 3 we give an overview of the most intuitive approaches to implementing ethical behavior in autonomous systems and 3 discuss the advantages and shortcomings of these approaches. Human societies have a multitude of means for ensuring its members behave within the socially accepted boundaries of morality. We can say that a person behaves ethically because they have an individual and personal motivation to do so, without going into how this motivation is formed. The motivation for an artificial agent to behave ethically originates not personally from the agent, but from other actors. These actors can broadly be organized intro three groups: the designers of the artificial agent, its users, and the various societal regulators whose job it is to make sure that order in society is maintained. It is all of these actors that need to be reassured that their own particular motivations for the AI system to behave ethically are met. Hence, a big concern when engineering machine ethics is not only that ethical behavior is accomplished, but also that the ethical behavior can be verified. This is the issue we discuss in Section 4. In Section 5 we focus on issues of transparency and accountability for machine ethics implementations. Since there are several actors outside of the ethical agent who are supplying the motivation for ethical behavior, the implementation of this behavior must be transparent to those actors to the extent and in a manner sufficient for their needs. Transparency is a key element in enabling society to have the right amount of trust and confidence in the operations of an AI system. Lastly in Section 6 we discuss the possible dangers for society that lie in engineering machine ethics. Like all technology, AI systems can also be abused to further criminal activities. AI systems can be deliberately built to behave unethically and illegally, but they also can be induced, deliberately or by accident, into exhibiting socially undesirable behavior. The main contribution of this position paper is an integral overview of the immediate challenges and open questions faced when pursuing the problem of engineering of machine ethics. This paper is a result of a week long discussion among experts of different fields within the scope of the Dagstuhl Seminar 162222 , and incorporates various ideas that arose as a result of discussions among interdisciplinary experts. Position papers that focus on machine ethics as a whole have been produced and they offer interesting insights in the problem as a whole, see for example Moor [2006]; Anderson and Leigh Anderson [2007]; Bonnefon et al. [2016]; Anderson et al. [2016], but to the best of our knowledge, this is the only document devoted specifically to the problem of engineering machine ethics. 2 The report on this seminar is available Fisher et al. [2016]. 4 2 Challenges for Machine Moral Philosophy Normative ethics is the branch of moral philosophy concerned with developing methods for deciding how one aught to act. The purpose of devising a moral theory, within normative ethics, is to develop a consistent and coherent system that can be followed to unambiguously identify an action as good or bad. Numerous specific theories have been developed, the most notable of which are perhaps utilitarianism Harsanyi [1977], Kantianism Ellington [1993], and Ross’s ethical theory Ross [1930]. All of the moral theories so far developed in philosophy have been built around several underlying assumptions. First and foremost is the assumption that the reasoning and decision making when following the moral theory is done by an agent that is a human. The immediate specific question we can pose to moral philosophy is: given a specific normative moral theory, how is the theory affected if an artificial agent replaces a human agent in it? A more subtle assumption in normative ethics is the assumption that the agent has de facto the ability of being a moral agent. This means that the theory is developed for a being that is capable of understanding concepts of right and wrong. The debate of whether an artificially created entity can be a moral agent is still far from settled Etzioni and Etzioni [2017]. Wallach and Allen [Wallach and Allen, 2008, Chapter 2] hint at the idea that how ethically sensitive an artificial system can be depends on how able of autonomous action it is. At this point in the development of the field of machine ethics it is fair to summarise that the capacity for moral agency of an artificial system is more of a sliding scale rather than a Boolean value. There are at least two questions to moral philosophy we can pose. The first is: how to define a scale of moral agency to describe the moral abilities of current and future artificial agents. The second question again is about going back to specific normative moral theories and checking how the theory is affected by replacing a full moral agent with an agent that is “lower” on the newly devised moral agency scale. Perhaps the concept of moral agency is altogether inadequate when discussing autonomous intelligent systems and a new concept needs to be devised. There is a further weaker assumption in normative ethics, which is the assumption that the agents of the theory are able to accept and act upon considered judgements Elgin [1996]. Consider judgments are “common sense agreements” about what is good or bad in particular instances or cases. For example, the idea that murder is bad except in exceptional circumstances, is a considered judgment. This, let us call it considered judgment ability assumption, is reflected in the numerous moral dilemmas encountered in 5 the normative ethics literature, the trolly problem being the most popular example. A dilemma in normative ethics, understood in a very broad sense, is a problem of choosing between two options each of which violating one or more considered judgment. An artificial agent does not possess a common sense understanding unless one is programmed into him. The engineering of common sense, or rather background knowledge, has been a notoriously elusive problem in artificial intelligence. The dilemmas we encounter in machine ethics reflect this. Consider for example the so called Cake or Death problem introduced in Armstrong [2015] which describes a situation in which an agent is unsure if if killing people is ethical or baking them a nice cake is ethical. Solving Cake or Death is not an ethical problem in moral philosophy, it is trivial. However, the question of which are the essential considered judgments that necessarily have to be implemented in machines is not a trivial problem. This would depend on the nature and abilities of a specific class of artificial agents. In contrast to focussing on a general theory of discerning right from wrong, there is a need for normative ethics to identify and develop a minimal such theory. Building moral machines by implementing human morality is a natural approach. After all, it is human society that those machine are entering and it is human sensibilities and values that they have to uphold. An alternative, or perhaps parallel approach would be to build a normative ethics theory exclusively for artificial agent. An example of such a theory comes to us from science fiction - the three laws of robotics of Prof. Isaak Asimov Asimov [1950]. The shortcomings of Asimov’s laws of robotics have been extensively argued by the author himself, but they have also been given a serious philosophical consideration Leigh Anderson [2008] and attempts have been made for their implementation Dennis et al. [2015]; Vanderelst and Winfield [2017]; Caycedo Alvarez et al. [2017]. The development of machine moral theory is an interesting open area for study in normative ethics. The question that has to be addressed first perhaps is what constitutes a viable, desirable, or good theory for artificial agents? We are perhaps primed by the cultural influence of Asimov’s laws of robotics to ask: what is it that a robot should never do? But thinking in absolutes is not likely to be viable for machine moral theories any more than it is viable for human normative ethics. Regardless of what comes our of normative ethics in the future, any moral theory developed for artificial agents must be developed to the point of being implementable. Prescriptions of good behaviour suffice for people, for machines we need algorithms. 6 An algorithm necessarily includes a specification of all possible scenarios and context in which an ethical decision can be made. Therefore it is necessary that machine normative ethicists, computer scientists and engineers collaborate closely towards developing machine moral philosophy, with this collaboration perhaps being one of the challenges as well. 3 Different Approaches, their Advantages and Challenges An intelligent system is one that is capable of communicating with, and reasoning about, its environment and other systems. An autonomous system is one that is capable of, to a certain extent, unsupervised operation and decision-making. Wallach, Allen, and Smit Wallach et al. [2008]; Wallach and Allen [2008] argue that very intuitively, ethical behavior in machines can be accomplished in at least two different ways. The first approach is to identify a set of ethical rules, perhaps by choosing a normative ethic theory, around which a decision-making algorithm can be implemented. The second approach is to have a machine evolve or “learn” to discern right from wrong without it having be explicitly guided by any one ethic theory. They refer to these two approaches as the top-down and bottom-up approach respectively. A hybrid approach in their sense is one in which an agent starts with a set of rules or values and modifies them into a system for discerning right from wrong. Artificial Intelligence (AI) has grown into a large field that incorporates many approaches, which can be, very tentatively, classified into soft computing approaches, which include statistical methods, machine learning and probabilistic reasoning, and traditional symbolic AI methods, which includes logic-based reasoning Russell and Norvig [2015]. The question of how to implement machine ethics in an intelligent autonomous system necessarily hinges on the AI methods that system uses. Different AI approaches would be subject to different machine ethics implementations and we need to consider their malleability to machine ethic approaches, as well as their risks and advantages in this respect. We here roughly classify the current and future machine ethics implementations based on the main AI approach used into soft machine ethics and symbolic machine ethics mirroring the two largest traditional branches of AI methodology. We discuss both of these approaches and their advantages and challenges. We should note at this point that a hybrid approach here would be one that combines symbolic methods, such as for example rule 7 based reasoning, with soft methods such as for example supervised learning. The bottom-up approach of Wallach et al. [2008]; Wallach and Allen [2008] naturally lends itself to be approached by using soft computing AI methods, whereas their top-down approach is perhaps best “served” by symbolic AI methods. 3.1 Soft and Symbolic AI Methods for machine ethics Within engineering, a top-down approach towards solving a task consists in breaking down the task iteratively into smaller sub-tasks until one obtains tasks that can be directly implemented. Problems best solvable by a topdown approach are ones in which the problem, and its context, are fully understood and can be formally specified. This is normally the case when the problem occurs in a controlled environment. These problem properties are also ones required for a successful solution by implementation using symbolic AI methods such as rule based reasoning. There are numerous ways in which a symbolic AI approach can be taken to develop ethical behaviour in a system. The most frequent in the literature is to constrain the choices of the system using rules derived from an ethical theory. This is the approach taken in Arkin et al. [2012], for developing the concept of ethical governor, and also in Dennis et al. [2016b] where the ethical theory used is a version of Ross’s ethical theory Ross [1930]. The Dennis et al. [2016b] work considers a hybrid autonomous system three-layer architecture: a continuous system controlled by a rational software agent, which makes discrete decisions, via a continuous control layer that allows for a dynamic environment interaction and feedback. The rational software agent is provided with an ethical policy, a total order over abstract ethical principles such as “do no harm”, “do not damage property” etc. The agent relies on external entities to identify if, and which, of her possible actions impinges on some of these abstract ethical principles. Having her actions annotated, the agent chooses between possible actions by selecting the one that is minimally unethical with respect to the given ethical policy. In contrast, Bendel [2016] proposes a method for building annotated decision trees for making simple ethical choices. A bottom-up approach to problem solving in engineering starts with describing instances of desired solutions by using adequate parameters and the proceeding to build up a procedure for identifying solutions based on these parameters. Machine learning methods in AI take a bottom-up approach to problem solving. There are several examples of using machine learning to implement machine ethics, such as for example Anderson and 8 Anderson [2014] andAbel et al. [2016]. In Anderson and Anderson [2014] inductive logic programming is used over a corpus of particular cases of ethical dilemma to discover ethical preference principles. Each case relates two actions, one more ethical than the other. The preference between the actions depends on ethically relevant features that actions involve such as harm, benefit, respect for autonomy, etc. Each feature is represented as an integer that specifies the degree of its presence (positive value) or absence (negative value) in a given action. The system is able to extract an ethical rule from the cases it is presented with and thus to a certain extent is able to learn to discern right from wrong. In Abel et al. [2016] reinforcement learning is used to learn what the most moral of two actions is, by rewarding the “correct” decisions an agent makes and “punishing” the bad “wrong” ones. Whether a soft or symbolic AI method is used depends on the nature of the problem that needs to be solved. The two families of methods tackle problem from different sides and are not mutually exclusive. Each of the methods comes with its own advantages and challenges with respect to building ethical behaviour in an intelligent autonomous system. 3.2 Advantages and challenges of using Symbolic AI Methods Symbolic AI methods are best suited for ethical reasoning in limited domains when the context of the decision-making problems can be predicted. To use symbolic based reasoning, an ethical theory needs to chosen before constructing and deploying the system and this theory does not change throughout the system’s usage. This allows for a thorough and well-informed process of decision-making and the verification of the system prior its practical application. Different ethical principles and theories may explicitly be encoded into the system giving clear options to decide upon. Any parameters that are left open for definition by the customer or to be learned from interaction with the environment have a clear function and it is possible to verify that they do not violate more general ethical principles. Symbolic AI methods also come with their set of challenges and limitations. General ethical guidelines are typically formulated on a very abstract level. Much philosophical discourse on ethics is concerned with problems occurring when applying such general guidelines to concrete situations. It is thus not clear if, and how, general ethical guidelines can be leveraged to solve concrete problems of decision making in practice. For a real-world system the connection to the non-discrete sensory-motor level must be made. There are many ways to transform continuous sensor values into discrete 9 propositions that can be used in reasoning. General guidelines or even single terms and concepts are only (if at all) implementable in a reduced way, i.e. restricted to one preferably clear interpretation. Due to their context sensitive definition it is not possible to consider every possible interpretation of an abstract guideline or term in implementing them in an artificial system Matthias [2011]. Furthermore, symbolic AI approaches risk conflicts between the implemented ethical theories and principles. If only one theory is implemented, e.g. Kant’s Categorical Imperative Ellington [1993] or Isaac Asimov’s first Law of Robotics3 , then this theory would determine the specific maxims that are to be defined situationally by the artificial system. Winfield Winfield et al. [2014] describes experimental trials of a minimally ethical robot which implements Asimov’s three laws of robotics. The chosen theory must be such as to allow implementable rules to be derived from it. Such a monistic approach assumes that there exist no moral dilemmas, i.e. that the implemented theory is able to give a conflict-free rule to make a decision in every context (Winfield et al. [2014] experimentally shows how a single ethical rule performs when faced with a balanced ethical dilemma). Deciding on a specific set of ethical principles involves settling longstanding philosophical disputes in an ad-hoc way. It is possible that governmental bodies might take the lead in outlining high-level ethical guidance to designers. For example, Germany’s ministry of transport recently announced the intention to set out a basic ethical policy to be followed by car designers stipulating that property damage takes always precedence over personal injury, that there must be no classification of people, for example, on size, age and the like, and that – ultimately – it is the manufacturer who is liable4 . Symbolic AI approaches require that any kind of “common sense” is explicitly coded using the formal language of the method. This severely impacts the scalability of the machine ethics solution. As it is well understood in the AI sub-discipline of knowledge representation and reasoning, the more expressive the formal language for encoding knowledge is, the more computationally expensive reasoning becomes. It is not a problem of having or symbolically encoding a large amount of information, but a problem of computing logical entailment or consistency, which are in the core of deep reasoning and are known to be of non-deterministic computational com3 The laws can be found quoted in Wikipedia, at http://en.wikipedia.org/wiki/ Three_Laws_of_Robotics 4 http://www.wiwo.de/politik/europa/selbstfahrende-autos-dobrindtgruendet-ethikkommission-fuer-automatisiertes-fahren/14513384.html 10 plexity. Therefore, it is unsurprising that the most recent major AI breakthroughs have been achieved using statistical processing of information and shallow reasoning. That being said, some symbolic-methods, such as model checking, are scalable within reasonable parameters, and have been vastly deployed in the information processing industry. 3.3 Advantages and challenges of using Soft AI Methods Soft AI methods are best applicable when we know the kind of data the AI system receives from interacting with the environment and, while the overall objective might not be well known or specified, we still have an idea how to process these data in a useful manner. For instance, the vision pipeline of a household robot is designed to extract obstacles (walls, tables, etc.), objects of interest (books on a shelf etc.), and its own position from the sensory data because this information is useful for a wide range of tasks it will be required to perform. Most real-world AI systems will be partly designed using a soft AI method at least on the lower sensory-motor level. Because soft AI methods are based on synthesis of actions and choices, with respect to the task of building an ethical AI the major question here is: how do components designed in a bottom-up fashion affect the overall ethical properties of the system? Soft AI methods do not require predetermines moral principles , ethical theories or sets of rules, but instead formulate basal parameters and intend to implement competences whereby an artificial system acts autonomously. This can be done, for example, via trial and error or other modes of learning such as imitation, induction and deduction, exploration, learning through reward, association and conditioning Cangelosi and Schlesinger [2014]. Soft AI methods can be separated into models of evolution Froese and Di Paolo [2010] and models of human socialization Fong et al. [2003]; Breazeal and Scassellati [2002]. The former simulate evolutionary moral learning, by assessing slightly different programs in an artificial system to evaluate an ethical case. Those programs that can solve the ethical task sufficiently go through to a “next round” where they are (re)combined to solve further ethical tasks. Evolutionary approaches can be used in earlier stages of moral development before considering models of human socialization. Models of human socialization consider the role of empathy and emotion for moral learning. They assume that a robot learns morality via empathy Slote [2007]. What is controversial in the philosophical discourse is that there exist two types of empathy Stüeber [2006]: perceptual empathy, when an emotion triggers an equivalent or congruent reaction in the ob11 server Misselhorn [2009], and imaginative empathy that requires a change in perspective in the form of empathising with the other, putting oneself in the observed other’s shoes. Perceptual empathy is explicable with the help of specific theories of mind or neuronal resonance and mirror neurons and has been implemented in a rudimentary fashion in artificial systems Balconi and Bortolotti [2012]; Rizzolatti and Fabbri-Destro [2008]; Mataric [2000]. Ekman Ekman [1992] implements perceptual empathy in the form of a basal affect program as an autonomous reaction scheme as a route to the implementation of morality in robots. Young children and chimpanzees are equipped with this fundamental form of empathy which forms the basis for pre-social behavior Warneken and Tomasello [2009]; Hoffman [2001]. Imaginative empathy is much more complex and develops on the basis of perceptual empathy only. It is exhibited only in human socialisation, not in non-human primates. This form of empathy is cognitively more ambitious and is involved in more complex moral reasoning and acting Gallagher [2012]. We are not aware of any attempt to implement imaginative empathy in artificial systems. Since, by means of a soft AI solution the AI system becomes a moral agent (if only in the narrowest sense of the word) one might ask whether it is likely to be more adaptable to making ethical choices in situations that are not pre-determined (which is a strong limitation to using the symbolic AI methods). Since the system learns its own ethical rules, it circumvents, to an extent (one could argue), the need to choose one particular ethical theory to implement. But this seems at least questionable. Every self-learning system must still be configured to pay attention to particular features of the data set, and to ignore others. Looking at the consequences of an action, instead of the agent’s motivation (for example) is such a choice of features that essentially determines the choice of moral theory. It seems difficult to judge at this point whether we can hope to create ethical-theory-agnostic AI systems, since every choice of relevant data features is already, to some extent, a choice of moral theory. A major challenge with using soft AI methods is that it is hard to certify whether the system fulfils any requirements one might want to impose. Indeed this is a challenge for all machine learning systems. A machine learning solution virtually behaves as a black box - the approach solves a problem successfully most of the time, but it is unclear whether a solution can be expected for sure, or why a particular solution was learned or developed for a particular problem. Soft AI methods, and machine learning in particular, have had a dramatic success recently, with machine learning methods being used in a variety of problems and contexts. This success has prompted 12 for calls to ensure that some level of explainability for the choices of the system is required, which in turn have given rise for the Explainable AI (XAI) DARPA programme 5 . In Anderson and Leigh Anderson [2015] we find one of the earliest specific implementations of XAI in machine ethics. Their system extracts a moral rule from a collection of cases and is able to explain why a particular decision is identified as more ethical referring to the learning data. Nonetheless, the black box nature of soft AI methods is likely to mean that these solutions are unsuitable for implementation in critical systems. This fundamental problem occurs irrespective of whether the ethical system itself or only low-level sub-systems are built using a soft AI solution. 3.4 Modular and Hybrid approaches Both the soft and symbolic AI methods come with advantages and challenges, but they also can complement each-other. A system is an entity comprised of several entities, thus in principle an AI system can be built using components that exploit both solution approaches. We are unaware of any implemented hybrid ethical reasoning system6 , but we can very briefly discuss some recommendations for how such a system can be created. One approach would be to separate decision-making by the ethical principles it involves. For example, decisions involving the possibility of human death should be made using a pre-programmed ethical policy, while decisions involving violation of autonomy can be based on ethical preferences learned through interaction with the system’s owner. Another approach would be to separate decision-making in different contexts, with soft AI methods being allowed as the default ethical decision-making method, while symbolic AI approaches being required to be implemented for certain specific pre-determined contexts. Alternatively a system can be designed so it first learns to recognize the ethical implications of its actions and then those implications can be used to follow an implemented ethical theory when choosing some specific course of action. Implementing ethical reasoning within a system is not sufficient, we must execute such implementation in a way that allows for verification of the quality of the resulting ethical behavior. The designers and manufacturers 5 https://www.darpa.mil/program/explainable-artificial-intelligence Although the title of van Rysewyk and Pontier [2015] claims a hybrid implemented system upon closer inspection it is not clear in which sense is the solution not a pure bottom-up approach in the sense of Wallach and Allen [2008], while the authors themselves do not offer an analysis of this type in their paper. 6 13 of AI systems necessarily have to offer reasons for their users to trust the artificial ethical system, and they also need to foresee possible malfunctions and provide means to deal with them. 4 Specification and Verification of Ethical Behavior Within our society, entities that are in a position to do us harm, be it a complex machine production tool, the surgeon operating on our unconscious body, the other drivers on the highway, or a chainsaw, are subject to licensing and certification. Certification informs consumers and experts of the properties of a product, a system, or a person in a position of responsibility. Knowing that a standard has been met allows individuals to have confidence in using machinery and to trust the decisions and actions of professionals. Tools and systems are certified to operate within designated parameters, while under (well defined) proper care. Certification confirms that the manufacturer has taken all steps necessary to avoid or minimize foreseeable risks that arise in relation to the usage of the tool. Certification for persons in position of responsibility is more complex because it involves a (possibly continuous) examination to demonstrate that the certified person has the understanding and skills necessary to perform his/her duties. Typically, this involves regulations prescribing expected behavior — often, humans must pass an examination concerning these regulations. Once we move to an autonomous system, with no human directly in control, what are our means to ensure that a systems actually matches the relevant criteria? In order to be confident in a system’s behavior we need to specify what we can expect the system to do in a particular circumstance, verify that the system does actually achieve this, and validate that our requirements are actually what the end-users want. There exist a vast range of different techniques, for example developed over many years within the field of Software Engineering Sommerville [2001]. These techniques range from the formal, such as proof, through structured, such as testing, to informal, such as user validation. All these approaches can, in principle, be applied across the range of autonomous systems, including robotics Fisher et al. [2013]. 4.1 Who is the confirmation of ethical behavior for? What constitutes an appropriate specification and verification methodology for ethical behavior depends on who is to use the results. In the case 14 of intelligent autonomous systems at least three interested parties can be discerned: the designers including developers and engineers working on developing and maintaining the systems, the end-users, owners or customers, and lastly various government and trade regulatory bodies and insurance agents. Although these three categories are the evident interested parties, this issue of interest discernment is an open problem in its own right, and as some preliminary investigations show7 finer discernment may be required. Although those actually constructing the AI system may have an intimate knowledge of its internal workings, it is still important that developers and engineers not only have confidence in their prototypes but have techniques for highlighting where issues still remain. The technology itself should not be a black box, but should be open to maintenance and analysis, and must be flexible enough to be improved dynamically. For end-users, customers and owners, the primary concern is that the AI system they interact with is safe and behaves ethically with respect to the ethical norms they themselves follow, as long as these are within the scope of what is considered ethical and legal within their society. Trust is a key issue and, in order to have trust extended to AI systems, the user needs to be informed of its range of capabilities. The future of AI systems and their proper integration within our society is subject, paradoxically, to undue levels of both optimism and pessimism in terms of the extent to which people can trust such systems. Close attention must be paid to nurturing the appropriate level of trust. AI systems are an exciting technological development that have long been anticipated as part of the future in various works of fiction and there is the temptation to play-up their apparent capabilities, particularly by early marketing when the producers are still seeking financiers for their products. This could lead to the customers placing an unwarranted level of trust in some technology, even when adequate disclaimers and use guidelines are outlined by the manufacturer, which can in turn lead to disastrous consequences8 . Such misplacement of trust is dangerous for users in the present, and may cause society to over-react in order to limit integration of technologies which given proper time to adequately develop would have been advantageous to the same society. The appearance of trustworthiness is similarly an issue when people interact with an AI system. For example, a robot might appear “experienced,” 7 http://robohub.org/should-a-carebot-bring-an-alcoholic-a-drink-pollsays-it-depends-on-who-owns-the-robot/ 8 https://www.theguardian.com/technology/2016/jun/30/tesla-autopilotdeath-self-driving-car-elon-musk 15 “benevolent,” or “sympathetic”. Such appearances are of particular concern for AI systems that are integrated in assisted living technologies. Concerns have been raised with respect to the impact assisted living technologies can have on the elderly Sharkey and Sharkey [2012]. Similarly, it has been shown that children who interact with robots derive expectations of them and ascribe abilities to them. We need to develop an understanding of the potential long-term effects of robots on child development Matthias [2015]. Trust should play a considerable role in choosing an ethical theory to implement in AI systems. The ethical theory that is easiest to implement may not necessarily be the one that is most trusted by society. This was demonstrated in the case of utilitarianism and driver-less cars Bonnefon et al. [2016]. It is important to note that trust Arkin et al. [2012] is not equal to ethics. Trust is a social construct intimately concerned with how each individual views the behavior of a robot or system. There may well be some varieties of objective trustworthiness, but there will remain many varieties of subjective trustworthiness. Many items affect users’ level of trust Salem et al. [2015], for example, the relationship between trust and harm. If you could show that robot causes no harm, would you trust it more? Those who must regulate AI systems and their integration within society also need confidence in the system. In addition, the Insurance industry needs to be clear where responsibility Sombetzki [2015] lies and so where liability lies. The concept of liability is likely to be complex and may be split over several actors, such as the manufacturers/designers, the operators and the environment. Regulation is crucial and first steps have been taken to go beyond safety and reliability regulations Bryson and Winfield [2017]; International Organization for Standardization (ISO) [2014] into considering the ethical aspects that should be taken into account British Standards Institution (BSI) [2016]. Any system operating in the real world would eventually find itself in a situation in which it will malfunction and AI systems are no exception. The question is thus how certain can one be in the verified ethical behavior of an AI system and what measures can be taken to mitigate the consequences of, and learn from, a system’s potential failure. This is the issue of having confidence in the system. In terms of safety standards, the “gold standard” is currently that of aircraft autopilot software where safety is measured as the number of accidents per miles flown. We might think that, for AI systems, at least as much confidence is needed. But, is the standard too high or even achievable? There are of course, noticeable differences between aircraft and other autonomous 16 systems. While the operational environment of an aircraft is very controlled and limited, as the aircraft must adhere to a strictly defined flying corridor, the severity of accidents is very high. E.g., any malfunction in the air is certainly fatal for all of the aircraft passengers measuring in the hundreds, whereas a miscalculation on the road does not need to be fatal since cars carry fewer passengers than airplanes. It is possible that the hours of operation per accident alone is not always the best measure to assess safety of an autonomous system, but that the severity of the damage caused and the number of individuals involved in an accident should also be taken into account Patchett et al. [2015]; Kelly and McDermid [2001]; Denney and Pai [2014]; Webster et al. [2014]. 4.2 What do we want the system to do? A key problem is specifying what our expectations of an AI system are. Although this is beginning to be codified where safety is considered, for example through robot safety standards9 , it is less clear where the ethical/moral requirements should come from and in what form should they be represented? The BS8611 standard British Standards Institution (BSI) [2016], for example, does not prescribe what the ethical requirements should be, but maps out the issues over which ethical decisions should be considered. An obvious route for ethical and legal requirements is through regulatory or standards bodies. These entities have the ability to set overall standards, potentially with the help of domain experts. In addition, designers may well have built in specific ethical codes that go beyond (though do not contradict) those prescribed by regulations. Finally, the user herself may wish to input her ethical preferences, ensuring that the AI acts in a way that is personally acceptable. Since there are multiple actors that need to define and refine the ethical requirements of the system, each with varying levels of technical expertise, the issue arises of how the ethical requirements are represented for the machine and for concerned actors. No one clear methodology emerges. One possibility is to have them represented in the form of a set of legal or formal rules, as argued in Saptawijaya and Moniz Pereira [2016]. Another possibility is to use a set of example scenarios developed to test specific ethical choices, as in Anderson and Anderson [2014]. A third, but by no means final, possibility is as a statistical envelope around a large (and possibly random) set of test cases, against which the AI system must be exhaustively assessed. 9 See International Organization for Standardization (ISO) [2016] for a range or robotic safety standards. 17 4.3 How do we show that the AI systems meets the expectations? There is a well-established body of work tackling the Verification and Validation (V&V) of systems, both hardware-centred and software-rich. The aim of Verification is to ensure that a system meets its requirements; Formal Verification takes this further, not only having precise formal requirements, but carrying out a comprehensive mathematical analysis of the system to ‘prove’ whether it corresponds to these formal requirements. There are many varieties of formal verification, the most popular being model checking Clarke et al. [1999]; Armstrong et al. [2012], whereby formal requirements are checked (usually automatically) against all possible executions of the system. Verification, via model checking, is widely used especially for the analysis of the safety and reliability of robotic systems both in terms of physical navigation Mitsch et al. [2013] and in terms of internal decisionmaking Dennis et al. [2016a]. What is being verified is that the behaviour of a particular system conforms to defined expectations. In terms of ethical/moral verification, it seems clear that if an AI system acts by following mathematically specified rules, we can potentially formally verify its highlevel behavior. Only recently, however, has the use of formal verification for ethical or moral issues begun to be addressed Dennis et al. [2016b, 2015]. A practical alternative to fully formal verification is to use sophisticated coverage-driven analysis methods, appealing to Monte-Carlo techniques and dynamic test refinement in order to systematically “cover” a wide range of practical situations. Especially where real-world interactions and devices are involved, testing is likely to be crucial. Indeed, testing for safety and reliability of robotic systems is well-established Mossige et al. [2015]. Such model-based testing is a well-developed technology but, as we move to more complex (ethical) issues sophisticated extensions may well be required. Though such approaches are typically used before deployment, related techniques provide a basis for run-time verification and compliance testing Rosu and Havelund [2005]. Testing is not as exhaustive as formal proof, but can cover many more scenarios. Validation is the process of confirming that the final system has the intended behavior once it is active in its target environment, and is often concerned with satisfying external stakeholders. For example, does our system match ethical standards or legal rules set by regulators? Does our system perform acceptably from a customer point of view, and how well do users feel that it works Lehmann et al. [2013]? There are many approaches to carrying out validation, typically involving the assessment of accuracy, 18 repeatability, trust, usability, resilience, etc. All must be extended to cope with ethical and moral concerns. It is clear that the strength and breadth of V&V research should allow us to extend and develop this towards ethical and moral concerns. However, a number of issues remain, as follows. • If the core software is not purely rule-based, for example involving some sub-symbolic learning procedures, then we will need a symbolic representation of the learned content if we are to carry out formal verification of the above form. One of the limitations of both formal verification and testing is likely to be in verifying learning procedures, especially where new ethical principles and preferences of behavior are learned. • Fully formal verification is likely to be unrealistic for complete, complex systems both because of non-symbolic components (as mentioned above) and because of practical complexity limits. However, we can formally verify parts of the system under particular circumstances. There are things that can be proved about core parts of the system and about the system’s outputs. Consequently, formal verification techniques can provide some evidence. In assessing how much confidence we need in the V&V of AI system ethics, it may be possible to leave the burden of this decision to the regulator, manufacturer or end-user as appropriate. So long as a clear indication of the extent of the V&V of a system exists a user or other interested may take the decision about the risk involved in using the system. Note that we can potentially separate regulation from verification and so allow a variety of different V&V techniques to be applied. Lastly, we would like to include here the existing efforts of validating a system that uses soft AI methods, which is the discussion of Ethical Turing Tests. Ethical Turing Tests were introduced in Allen et al. [2000]. In Anderson and Anderson [2014] this idea is further fleshed out and implemented. Under an ethical Turing test, both the AI system and an ethicist resolve the same dilemmas. The system passes the test if its choices are sufficiently similar to the ones of the ethicist. Whether a variant of a Turing test is a sufficient indicator of a certain type of “human-like” behaviour from a machine is a topic that has been argued as long as the artificial intelligence field exists. All the issues that have been raised, and exhaustively discussed in artificial intelligence, against the Turing test original can be argued to hold for an Ethical Turing test. 19 5 Transparency and accountability The opacity and transparency of deep neural network algorithms has become a major research subject area in recent years. Without knowing how the algorithm functions concerns about inherent biases in data and algorithm itself create difficulties in either discerning forensically or through explainability how decisions were made. Furthermore, there are questions as to whether the actual logic used by learning systems can be explained to people, or whether any explanation would be created after the fact. The problem with interpretability/explainability is that in some cases it may be impossible to provide a complete and accurate explanation for how a black box system has arrived at its decision. As complexity of systems increases, it is not unusual for the algorithm to extract a milliondimensional feature vector and assign unique weights to each feature. Any human-readable explanation for the decision will include some top N most important features and completely ignore the rest. A human-comprehensible explanation cant be too long or too complex. A good metaphor for this is how we explain things to children if they are not old enough to fully appreciate nuances of the problem. Where do kids come from? You buy them at the store! Any human-friendly explanation from a sufficiently complex system has to be a partially inaccurate simplification or a complete lie. The choice of the relevant criteria for an AI system to be deemed ethical will eventually need to be taken by society as a whole. Therefore transparency is of utmost importance and thus ensuring transparency is a major challenge. To this end it is necessary to identify what has to be transparent to whom, and how this can be realized. Transparency is a key requirement for ethical machines. Important attributes flow from transparency including trust, because it is hard to trust a machine unless you have some understanding of what it is doing and why, and accountability, because without transparency it becomes very difficult to understand who is responsible when a machine does not behave as we expect it to10 . An ethical machine will need to be transparent to different stakeholders in different ways – each suited to that particular stakeholder. In this section we consider the transparency needs of a range of stakeholders before considering aspects of transparency common to all. This section outlines how and why transparency is important to four different groups of stakeholders: users, regulators (including accident investigators), ethicists/lawyers and society at large. Each group has different transparency 10 Although it is important to note that transparency is not the same as accountability. 20 needs, some of which will have to be met by allowing an AI system’s ethics, and ethical logic, to be human readable, or through public engagement. Other needs will require new human-robot interfaces. Some literature exists on the topic of transparency in AI and autonomous systems. Owotoki and Mayer-Lindenberg Owotoki and F. [2007] proposes a theoretical framework for providing transparency in computational intelligence (CI) in order to expose the underlying reasoning process of an agent embodying CI models. In a recent book Taylor and Kelsey Taylor and Kelsey [2016] make the case for the importance of transparency in AI systems to an open society. For autonomous robots Wortham et al. [2016] describes early results showing that building transparency into robot action-selection can help users build a more accurate understanding of the robot. There is also no doubt that transparency is high on policy agenda: the 2016 UK Parliamentary Select Committee on Science and Technology’s final report on Robotics and AI expresses concerns over both decision making transparency and accountability and liability11 . Indeed the EU’s new General Data Protection Regulation, due to take effect as law in 2018, creates a “right to explanation” such that a user will be able to ask for an explanation of an algorithmic decision that was made about them Goodman and Flaxman [2016]. 5.1 Transparency to the user Although the critical importance of the human-machine interface is well understood, what is not yet clear is the extent to which an ethical machine’s ethics should be transparent to its user. It would seem to be unwise to rely on a user to discover a machine’s ethics by trial and error, but at the same time a machine that requires its user to undergo a laborious process of familiarisation may well be unworkable. For care robots for instance it may be appropriate for the user to configure the “ethics” settings (perhaps expressing the user’s preference for more or less privacy) or, at the very least, allowing the user to choose between a small number of “preset” ethics options. There is of course always some danger that many users will rely on the default setting. What is clear is that how these options are presented to the user is very important Matthias [2015]; they should for instance help and guide the user in thinking about their ‘value hierarchy’. The robot might for instance explain to the user 11 http://www.publications.parliament.uk/pa/cm201617/cmselect/cmsctech/145/ 145.pdf 21 “what would happen” in different situations and hence guide their preferences Theodorou et al. [2016]. For other robot types, driverless cars for instance, the ethics settings may be fixed (perhaps by law) and therefore not user configurable. However, the need for the user to understand how the car would behave in certain situations remains critically important – especially if the car’s design (or the law) requires her to act as a safety driver and assume manual control when the autopilot cannot cope. Even for fully autonomous cars in which the user is only ever a passenger, the person with legal responsibility for the car should be aware of the car’s ethics settings. For fully autonomous cars there should still be some user interface so that the passenger can discover, or perhaps ask for help, if the vehicle become unexpectedly immobile or starts behaving erratically. 5.2 Transparency to regulatory bodies It is clear that the ethics of ethical robots needs to be transparent to those responsible for (i) certifying the safety of ethical machines, and (ii) accident investigators. Both regulators and accident investigators will be working within a governance framework which includes standards and protocols. The role of the protocols is to set out how robots are certified against those standards, and – following an accident – how the accident is investigated. Regulators will need the ability to determine that a machine’s ethics comply with the appropriate standards12 , and making such a determination will require those ethics to be coded and embedded into the robot in a readable way. We might imagine something like a standard Ethics Markup Language (EML – perhaps based on XML) which codes the ethics. The EML script would be embedded in the robot in a way that is accessible to the regulator, noting that the script will need to be secured to prevent attack from hackers. Accident Investigators. When serious accidents happen, as they inevitably will (see Section 4.1), they will need to be investigated. To allow such investigation, data must to be recorded, suggesting the need for a robot equivalent of the flight data recorder. Therefore an Ethical Black Box (EBB) is proposed Winfield and Jirotka [2017]– a device that records all relevant data including, crucially, internal state data on the robot’s ethical governor. Although the data stored by the EBB would be vital for investigating all aspects of an accident, including causes unrelated to the robot’s 12 Standards Which do not yet exist. 22 ethics, here we are interested in accidents which might have been caused by a fault or deficiency in the robot’s ethics programming. By recording the sequence of internal states of the ethical reasoning in the moments before the accident, the EBB would allow an investigator to discover exactly why the robot made an incorrect decision. Information that would be important both in determining accountability, and to make recommendations for upgrading the robot’s ethics and prevent the same accident happening again. Specifying the EBB is beyond the scope of this paper, this work has been carried further in Winfield and Jirotka [2017]. It is however clear that research is needed to determine what data the EBB must record, the frequency and time window of that data, and how the privacy of that data is maintained. One thing we can be sure of however is the need for an industry standard EBB (as in the aviation industry). Different EBBs and EBB standards will of course be needed for different applications, but for driverless cars for instance, a single standard EBB should be mandated. Such an EBB would itself require an industry standard, and protocols for certification, fitting and maintenance of EBBs. 5.3 Transparency to ethicists / lawyers A third group of stakeholders includes lawyers, who might be required to advocate for AI systems’ owners, or on behalf of anyone who makes a claim against an AI system’s owner, or ethicists who might, for instance, be required to act as expert witnesses, in a court of law. If we consider an accident in which a robot’s ethics are implicated (see Section 5.2 above), it is clear that both lawyers and ethicists will need to understand (i) a robot’s ethics, (ii) the process the robot uses to make an ethical decision (in other words how its ethical reasoning works), and (iii) the data captured by the ethical black box. Providing this kind of transparency to lawyers and ethicists will not only be necessary, but is also likely to be challenging, as robot manufacturers and designers may regard such details, especially (ii), as proprietary IP. Another category of expert stakeholder includes psychologists, who might be required to either evaluate robots for their potential to cause psychological harm to the user, or as expert witnesses, in providing an investigation with an expert evaluation of the psychological harm caused to robot user(s) in a particular case. 23 5.4 Transparency to the whole of society AI systems – and especially ethical AI systems – are a disruptive technology, with potentially significant societal and economic impact, thus an easily overlooked but important stakeholder is society as a whole. We only need to consider driverless cars and trucks to appreciate the level of potential disruption, to jobs and transport policy for instance, as already reflected in the level of public and press interest in this technology. It is therefore very important that the ethics of ethical AI systems should be transparent to society at large, for two reasons. First, because citizens should be able to make informed judgments about the kinds of AI system they wish to have in their lives, and even more importantly those they do not want in their lives, so that they can lobby their elected representatives and ensure that government policy properly reflects those views. And second, if society is to have confidence in the ethics of a class of ethical AI system (driverless cars, for example) then it should accept a degree of collective responsibility for those ethics. 5.5 Technical means to bring about transparency It is clear that the different stakeholders outlined above have very different transparency needs. Some of those needs are met through making the ethical rules and logic readable (for instance for regulators, ethicists or lawyers), but for others transparency can only be met through technical means. Here we briefly outline several approaches to meeting those needs. • Assisted living AI systems would benefit from a “Why did you do that?” button which, when pressed, causes the robot to explain – perhaps using speech synthesized text – why it carried out the previous action. We could call the system behind this an “explanation module”. For an AI system with a fixed set of responses the explanation module should be relatively easy to implement, but for an AI system which learns its ethics such an implementation could be challenging; in either case the explanation module and its user interface would need very careful design in order to meet the needs of a non-technical user. • An ethical AI system which makes use of simulation based internal models as part of some ethical governor (for example Winfield et al. [2014]) might allow us to go further than the “Why did you do that?” button, by making the robot’s internal simulation accessible to the user. This would enable the user to ask the robot “What would you do?” in a given situation. Clearly such a facility would need a much 24 more sophisticated user interface than a button press, but through visualisation tools we can imagine the user watching the robot’s internal simulation running through various scenarios on a connected laptop or tablet device. Note that a similar visualisation interface would be of great value to accident investigators (Section 5.2), and expert witnesses or lawyers (section 5.3) to play back a robot’s internal simulation in the moments leading up to an accident, and what the alternatives open to the robot at the time might have been. • The technical requirements for an ethical back box (EBB) were already outlined in Section 5.2 above. 6 Dangerous and Deliberately Unethical AI Finally, it is important to be aware of the ways people may abuse or manipulate AI systems. As with all technology AI systems can also be deliberately abused for malice or to further one’s illegal goals Yampolskiy [2016]. While our primary concern is to contribute towards designing AI systems that behave ethically within a human society Sotala and Yampolskiy [2015]; Yampolskiy [2015a] and promote human and animal welfare, some concern also needs to be raised about how that AI system can protect itself against abuse Yampolskiy and Spellchecker [2016]. By abuse we, of course, do not mean mistreating the AI system in the sense in which a person or an animal can be mistreated, but taking advantage of the capabilities and opportunities offered by the AI system to commit criminal acts. The abuse of an AI system can be achieved by hacking an existing system or by deliberately creating an unethical AI system Pistono and Yampolskiy [2016]; Vanderelst and Winfield [2016]. Hacking itself can be accomplished in several ways. The code of the AI system might be directly hacked. But a system can also be manipulated by interaction and such manipulation does not necessarily require technical knowledge. This is illustrated by the shortlived Tay experiment. Tay was an artificial intelligence chatter-bot released by Microsoft Corporation on March 23, 2016 and taken offline 16 hours after launch13 . Tay was programmed to learn from conversation, however it took the netizens a very short time to “train” it into making morally questionable statements. Manipulation by interaction can be accomplished both deliberately and by accident. A learning based system can be led Yampolskiy [2014] intro eliciting bad conclusions through crafted case descriptions, etc. By this 13 http://www.bbc.com/news/technology-35890188 25 means one can slowly train systems away from moral behavior. As an example of accidental manipulation consider the example of children learning that driverless cars slow down in their presence, they might choose to make a game out of it. Children playing with car’s reactions might annoy passengers by causing delay; and might ultimately lead to the disabling of safeguards. Purposeful creation of Malevolent AI can be attempted by a number of diverse agents with varying degrees of competence and success. Each such agent would bring its own goals/resources into the equation, but what is important to understand here is just how prevalent such attempts will be and how numerous such agents can be. For example, we should be concerned about: the military developing cyber-weapons and robot soldiers to achieve dominance; governments attempting to use AI to establish hegemony, control people, or take down other governments; corporations trying to achieve monopoly, destroying the competition through illegal means; villains trying to take over the world and using AI as a dominance tool; black hats attempting to steal information, resources or destroy cyber infrastructure targets; doomsday cults attempting to bring the end of the world by any means; the depressed looking to commit suicide by AI; psychopaths trying to add their name to history books in any way possible; criminals attempting to develop proxy systems to avoid risk and responsibility; AI risk deniers attempting to demonstrate that AI is not a risk factor and so ignoring caution; and even AI safety researchers, if unethical, attempting to justify funding and secure jobs by purposefully developing problematic AI. The ethical and unethical behaviors of an AI system are not necessarily symmetrical. Existing systems define only a small part of the problem space Yampolskiy [2015b]. Apart from ethical and unethical behavior, an AI system can also exhibit a behavior that has neither been programmed nor predicted as a particular combination of otherwise ethical rules and choices. Lastly we must mention the potential for “cultural imperialism” when designing the ethical behavior of an AI system. With globalisation, a product’s production and consumers are diverse. What constitutes ethical behavior in one region may even be considered unethical in another. All the involved actors, the designers, users and society, both on the supplier and on the demand end of the AI system need to be aware of the reality that the supplier society ethics influences the ethical behavior of the AI system, which in turn influences the ethics of the society in which the AI system operates. 26 7 Summary Moral philosophy has a very rich history of studying how to discern right from wrong in a systematic, consistent and coherent way. Today we have a real need for a functional system of ethical reasoning as AI systems that function as part of our society are ready to be deployed. Building an AI system that behaves ethically is a multifaceted challenge. The questions of which ethical theory should be used to govern the AI system’s behavior has received most of the attention. Here, we focus on the problem that comes next, after what is right or wrong for a machine to do is decided – how to implement the ethical behavior. The problem of engineering ethical behavior is made complex because of the prime motivators for such behavior. For humans, the motivation for behaving ethically is primarily internal. Without falling into difficult philosophical arguments on the existence of free will, we accept that people are capable of behaving ethically because they choose to do so, although, of course, they too can be motivated towards ethical behaviour by incentives, punishments and assignment of liability. For AI systems, however, the motivation towards ethical behaviour is exclusively external because it can always be traced back to their design and it cannot be reinforced in the same way as it can be done with people. This motivation furhtermore comes from several stakeholders. We cannot claim that the full list of these stakeholders can even be known before the AI systems are fully deployed, but we can discern between the three most evident groups of stakeholders: the designers, the users and the various regulatory organs of society. Each of these stakeholders needs to play their role in deciding what is the best ethical behavior for a given AI system, but they also need to be convinced in an adequate way that the implemented behavior actually yields the desired results. A moral AI system needs to be adequately transparent and accountable to each group of stakeholders. Unlike people, who more or less share the same “hardware” and reasoning capabilities, machines and AI systems can be built using many different approaches. The implementation of ethical reasoning will depend not only on what the stakeholders need and desire, but also on what is possible given the chosen problem-solving implementation. We discussed the two basic implementation approaches reflecting two large families of AI methods: the soft AI and the symbolic AI families, and identify the challenges and advantages of each. An AI system capable of ethical behavior is necessarily a complex system. With complex systems two things are evident: that they will malfunction 27 and that they can be used to attain criminal goals. We discuss methods of verifying that an AI system behaves as designed within specified parameters, but we also discuss how the engineering of the ethical behavior impacts available options once a system malfunctions. Lastly we discuss in broad strokes what the stakeholders need to be aware of in terms of abuse of an AI system with ethical behavior capabilities, both when that abuse is intentional and accidental. References D. Abel, J. MacGlashan, and M. L. Littman. Reinforcement Learning As a Framework for Ethical Decision Making. In Workshops at the Thirtieth AAAI Conference on Artificial Intelligence, 2016. C. Allen, G. Varner, and J. Zinser. Prolegomena to any future artificial moral agent. Journal of Experimental and Theoretical Artificial Intelligence, 12:251–261, 2000. C. Allen, W. Wallach, and I. Smit. Why machine ethics? IEEE Intelligent Systems, 21(4):12–17, 2006. M. Anderson and S. Leigh Anderson. Geneth: A general ethical dilemma analyzer. In Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, July 27 -31, 2014, Québec City, Québec, Canada., pages 253–261, 2014. M. Anderson and S. Leigh Anderson. Machine ethics: Creating an ethical intelligent agent. AI Magazine, 28(4):15–26, 2007. M. Anderson and S. Leigh Anderson. Toward ensuring ethical behavior from autonomous systems: a case-supported principle-based paradigm. Industrial Robot, 42(4):324–331, 2015. M. Anderson, S. Leigh Anderson, and Vincent Berenz. Ensuring ethical behavior from autonomous systems. In Artificial Intelligence Applied to Assistive Technologies and Smart Environments, Papers from the 2016 AAAI Workshop, Phoenix, Arizona, USA, February 12, 2016, 2016. R.C. Arkin, P. Ulam, and A. R. Wagner. Moral Decision Making in Autonomous Systems: Enforcement, Moral Emotions, Dignity, Trust, and Deception. Proceedings of the IEEE, 100(3):571–589, 2012. 28 P.J. Armstrong, M. Goldsmith, G. Lowe, J. Ouaknine, H. Palikareva, A. W. Roscoe, and J. Worrell. Recent Developments in FDR. In P. Madhusudan and S. A. Seshia, editors, Computer Aided Verification: 24th International Conference, CAV 2012, Berkeley, CA, USA, July 7-13, 2012 Proceedings, volume 7358 of LNCS, pages 699–704. Springer Berlin Heidelberg, 2012. S. Armstrong. Motivated value selection for artificial agents. In Artificial Intelligence and Ethics, Papers from the 2015 AAAI Workshop, Austin, Texas, USA, January 25, 2015., 2015. http://aaai.org/ocs/index. php/WS/AAAIW15/paper/view/10183. I. Asimov. I, Robot. Gnome Press, 1950. M. Balconi and A. Bortolotti. Detection of the facial expression of emotion and self-report measures in empathic situations are influenced by sensorimotor circuit inhibition by low-frequency rtms. Brain Stimulation, 5(3):330 – 336, 2012. O. Bendel. Annotated decision trees for simple moral machines. 2016. J.F. Bonnefon, A. Shariff, and I. Rahwan. The social dilemma of autonomous vehicles. Science, 352(6293):1573–1576, 2016. C. Breazeal and B. Scassellati. Robots that imitate humans. Trends in Cognitive Sciences, 6(11):481–487, 2002. British Standards Institution (BSI). BS 8611 Robots and Robotic Devices — Guide to the ethical design and application. http://www.bsigroup.com, 2016. J. Bryson and A.F.T. Winfield. Standardizing ethical design for artificial intelligence and autonomous systems. IEEE Computer, 50(5):116–119, 2017. A. Cangelosi and M. Schlesinger. Developmental Robotics: From Babies to Robots. The MIT Press, 2014. M. Caycedo Alvarez, Ø. S. Berge, A. S. Berget, E. S. Bjørknes, D.V.K. Johnsen, F. O. Madsen, and M. Slavkovik. Implementing Asimov’s first law of robotics. In 30th Norsk Informatikkonferanse, NIK 2017, Westerdals Oslo ACT, November, 27-29, 2017, 2017. forthcoming. E. M. Clarke, O. Grumberg, and D. Peled. Model Checking. MIT Press, 1999. 29 E. Denney and J.P. Pai. Automating the assembly of aviation safety cases. IEEE Trans. Reliability, 63(4):830–849, 2014. L. A. Dennis, M. Fisher, and A. F. T. Winfield. Towards Verifiably Ethical Robot Behaviour. In Proc. AAAI Workshop on AI and Ethics, 2015. http://aaai.org/ocs/index.php/WS/AAAIW15/paper/view/10119. L. A. Dennis, M. Fisher, N. K. Lincoln, A. Lisitsa, and S. M. Veres. Practical Verification of Decision-Making in Agent-Based Autonomous Systems. Automated Software Engineering, 23(3):305–359, 2016. L. A. Dennis, M. Fisher, M. Slavkovik, and M. P. Webster. Formal Verification of Ethical Choices in Autonomous Systems. Robotics and Autonomous Systems, 77:1–14, 2016. P. Ekman. Are there basic emotions? Psychological Review, 99(3):550–553, 1992. C. Elgin. Considered Judgment. Princeton: New Jersey: Princeton University Press, 1996. J. W. Ellington. Translation of: Grounding for the Metaphysics of Morals: with On a Supposed Right to Lie because of Philanthropic Concerns by Kant, I. [1785]. Hackett Publishing Company, 1993. A. Etzioni and O. Etzioni. Incorporating ethics into artificial intelligence. The Journal of Ethics, pages 1–16, 2017. M. Fisher, L. A. Dennis, and M. Webster. Verifying Autonomous Systems. ACM Communications, 56(9):84–93, 2013. M. Fisher, C. List, M. Slavkovik, and A. F. T. Winfield. Engineering moral agents - from human morality to artificial morality (dagstuhl seminar 16222). Dagstuhl Reports, 6(5):114–137, 2016. T. Fong, I. Nourbakhsh, and K. Dautenhahn. A survey of socially interactive robots. Robotics and Autonomous Systems, 42(3–4):143 – 166, 2003. Socially Interactive Robots. P. Foot. The problem of abortion and the doctrine of double effect. Oxford Review, 5:5–15, 1967. T. Froese and E. A. Di Paolo. Modelling social interaction as perceptual crossing: An investigation into the dynamics of the interaction process. Connection Science, 22(1):43–68, March 2010. 30 S. Gallagher. Empathy, simulation, and narrative. Science in Context, 25(3):355–381, 009 2012. B. Goodman and S. Flaxman. Eu regulations on algoritic decision-making and a “right to explanation”. arXiv preprint arXiv:1606.08813, 2016. J.C. Harsanyi. Rule utilitarianism and decision theory. Erkenntnis (1975-), 11(1):25–53, 1977. M. Hoffman. Empathy and Moral Development: Implications for Caring and Justice. Cambridge University Press, 2001. International Organization for Standardization (ISO). ISO 13482: Robots and robotic devices — Safety requirements for Personal Care Robots. http://www.iso.org, 2014. International Organization for Standardization (ISO). TC299 — Robotics, 2016. T.P. Kelly and J.A. McDermid. A systematic approach to safety case maintenance. Rel. Eng. & Sys. Safety, 71(3):271–284, 2001. H. Lehmann, D. S. Syrdal, K. Dautenhahn, G.J. Gelderblom, S. Bedaf, and F. Amirabdollahian. What Should a Robot do for you? Evaluating the Needs of the Elderly in the UK. In Proc. 6th Int. Conf. on Advances in Computer-Human Interactions, pages 83–88, 2013. S. Leigh Anderson. Asimov’s ’three laws of robotics’ and machine metaethics. AI & Society, 22(4):477–493, 2008. M. J. Mataric. Getting humanoids to move and imitate. IEEE Intelligent Systems, 15(4):18–24, July 2000. A. Matthias. Algorithmic moral control of war robots: Philosophical questions. Law, Innovation and Technology, 3(2):279–301, 2011. A. Matthias. Robot lies in health care: when is deception morally permissible? Kennedy Institute of Ethics Journal, 25(2):169–162, 2015. C. Misselhorn. Empathy with inanimate objects and the uncanny valley. Minds and Machines, 19(3):345, 2009. S. Mitsch, K. Ghorbal, and A. Platzer. On Provably Safe Obstacle Avoidance for Autonomous Robotic Ground Vehicles. In Robotics: Science and Systems IX, 2013. 31 J. H. Moor. The nature, importance, and difficulty of machine ethics. IEEE Intelligent Systems, 21(4):18–21, July 2006. M. Mossige, A. Gotlieb, and H. Meling. Testing Robot Controllers using Constraint Programming and Continuous Integration. Information & Software Technology, 57:169–185, 2015. P. Owotoki and Mayer-Lindenberg F. Transparency of computational intelligence models. In Research and Development in Intelligent Systems XXIII, The 26th SGAI International Conference on Innovative Techniques and Applications of Artificial Intelligence, Proceedings, pages 387– 392. Springer, 2007. C. Patchett, M. Jump, and M. Fisher. Safety and Certification of Unmanned Air Systems. In Engineering and Technology Reference. 2015. F. Pistono and R. V Yampolskiy. Unethical research: How to create a malevolent artificial intelligence. In 25th International Joint Conference on Artificial Intelligence (IJCAI-16). Ethics for Artificial Intelligence Workshop (AI-Ethics-2016), 2016. G. Rizzolatti and M. Fabbri-Destro. The mirror system and its role in social cognition. Current Opinion in Neurobiology, 18(2):179 – 184, 2008. Cognitive neuroscience. W.D. Ross. The Right and the Good. Oxford University Press, 1930. G. Rosu and K. Havelund. Rewriting-Based Techniques for Runtime Verification. Automated Software Engineering, 12(2):151–197, 2005. S.J. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Pearson Education, 3 edition, 2015. M. Salem, G. Lakatos, F. Amirabdollahian, and K. Dautenhahn. Would You Trust a (Faulty) Robot?: Effects of Error, Task Type and Personality on Human-Robot Cooperation and Trust. In Proc. 10th Annual ACM/IEEE International Conference on Human-Robot Interaction (HRI), pages 141– 148. ACM, 2015. A. Saptawijaya and L. Moniz Pereira. Logic programming for modeling morality. Logic Journal of the IGPL, 24(4):510–525, 2016. A. Sharkey and N. Sharkey. Granny and the robots: ethical issues in robot care for the elderly. Ethics and Information Technology, 14(1):27–40, 2012. 32 M. A. Slote. The Ethics of Care and Empathy. Routledge, 2007. J. Sombetzki. Responsibility in Crisis — From the Traditional Concept of Responsibility to Systems Responsibility, 2015. I. Sommerville. Software Engineering. Pearson Studium, 2001. K. Sotala and R. V Yampolskiy. Responses to catastrophic agi risk: A survey. Physica Scripta, 90(1), 2015. K. Stüeber. Rediscovering Empathy: Agency, Folk Psycholgy, and the Human Sciences. MIT Press, 2006. R. Taylor and T. Kelsey. Transparency and the open society: Practical lessons for effective policy. Policy Press, Bristol UK, 2016. A. Theodorou, R. Wortham, and J.J. Bryson. Why is my robot behaving like that? designing transparency for real time inspection of autonomous robots. In AISB Workshop on Principles of Robotics, April 2016, Sheffield UK, Proceedings, 2016. S. P. van Rysewyk and M. Pontier. A Hybrid Bottom-Up and Top-Down Approach to Machine Medical Ethics: Theory and Data, pages 93–110. Springer International Publishing, Cham, 2015. D. Vanderelst and A.F. Winfield. The dark side of ethical robots. arXiv preprint arXiv:1606.02583, 2016. D. Vanderelst and A. Winfield. An architecture for ethical robots inspired by the simulation theory of cognition. Cognitive Systems Research, 2017. W. Wallach and C. Allen. Moral Machines: Teaching Robots Right from Wrong. Oxford University Press, 2008. W. Wallach, C.n Allen, and I. Smit. Machine morality: Bottom-up and topdown approaches for modelling human moral faculties. AI Soc., 22(4):565– 582, March 2008. F. Warneken and M. Tomasello. Varieties of altruism in children and chimpanzees. Trends in Cognitive Sciences, 13(9):397 – 402, 2009. M. Webster, N. Cameron, M. Fisher, and M. Jump. Generating Certification Evidence for Autonomous Unmanned Aircraft Using Model Checking and Simulation. Journal of Aerospace Information Systems, 11(5):258–279, 2014. 33 A.F.T. Winfield and M. Jirotka. The case for an ethical black box. In Towards Autonomous Robotic Systems - 18th Annual Conference, TAROS 2017, Guildford, UK, July 19-21, 2017, Proceedings, pages 262–273, 2017. A. F. T. Winfield, C. Blum, and W. Liu. Towards an Ethical Robot: Internal Models, Consequences and Ethical Action Selection, pages 85–96. Springer International Publishing, 2014. R.H. Wortham, A. Theodorou, and J.J. Bryson. What does the robot think? transparency as a fundamental design requirement for intelligent systems. In IJCAI-2016 Ethics for Artificial Intelligence Workshop, July 2016, New York USA, Proceedings, 2016. R. V Yampolskiy and MS Spellchecker. Artificial intelligence safety and cybersecurity: a timeline of ai failures. arXiv preprint arXiv:1610.07997, 2016. R.V. Yampolskiy. Utility function security in artificially intelligent agents. Journal of Experimental & Theoretical Artificial Intelligence, 26(3):373– 389, 2014. R. V. Yampolskiy. Artificial superintelligence: A futuristic approach, 2015. R. V Yampolskiy. The space of possible mind designs. In Artificial General Intelligence: 8th International Conference, AGI 2015, AGI 2015, Berlin, Germany, July 22-25, 2015, Proceedings, volume 9205, page 218. Springer, 2015. R. V Yampolskiy. Taxonomy of pathways to dangerous artificial intelligence. In Workshops at the Thirtieth AAAI Conference on Artificial Intelligence, 2016. 34
2cs.AI
Verifying Chemical Reaction Network Implementations: A Pathway Decomposition Approach ∗ Seung Woo Shin1 , Chris Thachuk2 , and Erik Winfree2 arXiv:1411.0782v3 [cs.CE] 10 Aug 2017 1 2 University of California, Berkeley California Institute of Technology Abstract The emerging fields of genetic engineering, synthetic biology, DNA computing, DNA nanotechnology, and molecular programming herald the birth of a new information technology that acquires information by directly sensing molecules within a chemical environment, stores information in molecules such as DNA, RNA, and proteins, processes that information by means of chemical and biochemical transformations, and uses that information to direct the manipulation of matter at the nanometer scale. To scale up beyond current proof-of-principle demonstrations, new methods for managing the complexity of designed molecular systems will need to be developed. Here we focus on the challenge of verifying the correctness of molecular implementations of abstract chemical reaction networks, where operation in a well-mixed “soup” of molecules is stochastic, asynchronous, concurrent, and often involves multiple intermediate steps in the implementation, parallel pathways, and side reactions. This problem relates to the verification of Petri nets, but existing approaches are not sufficient for providing a single guarantee covering an infinite set of possible initial states (molecule counts) and an infinite state space potentially explored by the system given any initial state. We address these issues by formulating a new theory of pathway decomposition that provides an elegant formal basis for comparing chemical reaction network implementations, and we present an algorithm that computes this basis. Our theory naturally handles certain situations that commonly arise in molecular implementations, such as what we call “delayed choice,” that are not easily accommodated by other approaches. We further show how pathway decomposition can be combined with weak bisimulation to handle a wider class that includes most currently known enzyme-free DNA implementation techniques. We anticipate that our notion of logical equivalence between chemical reaction network implementations will be valuable for other molecular implementations such as biochemical enzyme systems, and perhaps even more broadly in concurrency theory. Keywords: chemical reaction networks; molecular computing; DNA computing; formal verification; molecular programming; automated design 1 Introduction A central problem in molecular computing and bioengineering is that of implementing algorithmic behavior using chemical molecules. The ability to design chemical systems that can sense and react to the environment finds applications in many different fields, such as nanotechnology [8], medicine [13], and robotics [18]. Unfortunately, the complexity of such engineered chemical systems often makes it challenging to ∗ Preliminary versions of this manuscript appeared in the proceedings of VEMDP 2014 and are available on arXiv:1411.0782 [cs.CE]. 1 ensure that a designed system really behaves according to specification. Furthermore, since experimentally synthesizing chemical systems can require considerable resources, mistakes are generally expensive, and it would be useful to have a procedure by which one can theoretically verify the correctness of a design using computer algorithms prior to synthesis. In this paper we propose a theory that can serve as a foundation for such automated verification procedures. Specifically, we focus our attention on the problem of verifying chemical reaction network (CRN) implementations. Informally, a CRN is a set of chemical reactions that specify the behavior of a given chemical system in a well mixed solution. For example, the reaction equation A + B → C means that a reactant molecule of type A and another of type B can be consumed in order to produce a product molecule of type C. A reaction is applicable if all of its reactants are present in the solution in sufficient quantities. In case both A + B → C and C → A + B are in the CRN, we may also use the shorthand notation A + B C. In general, the evolution of the system from some initial set of molecules is a stochastic, asynchronous, and concurrent process. While abstract CRNs provide the most widely used formal language for describing chemical systems, and have done so for over a century, only recently have abstract CRNs been used explicitly as a programming language in molecular programming and bioengineering. This is because CRNs are often used to specify the target behavior for an engineered chemical system (see Figure 1). How can one realize these “target” CRNs experimentally? Unfortunately, synthesizing chemicals to efficiently interact — and only as prescribed — presents a significant, if not infeasible, engineering challenge. Fortunately, any target CRN can be emulated by a (generally more complex) “implementation” CRN. For example, in the field of DNA computing, implementing a given CRN using synthesized DNA strands is a well studied topic that has resulted in a number of translation schemes [36, 5, 31]. In order to evaluate CRN implementations prior to their experimental demonstration, a mathematical model describing the expected molecular interactions is necessary. For this purpose, software simulators that embody the relevant physics and chemistry can be used. Beyond performing simulations – which by themselves can’t provide absolute statements about the correctness of an implementation – it is often possible to describe the model of the molecular implementation as a CRN. That is, software called “reaction enumerators” can, given a set of initial molecules, evaluate all possible configuration changes and interactions, possibly generating new molecular species, and repeating until the full set of species and reactions have been enumerated. In the case of DNA systems, there are multiple software packages available for this task [24, 17]. More general biochemical implementations could be modeled using languages such as BioNetGen [16] and Kappa [10]. Given a “target” CRN which specifies a desired algorithmic behavior and an “implementation” CRN which purports to implement the target CRN, how can one check that the implementation CRN is indeed correct? As we shall see, this question involves subtle issues that make it difficult to even define a notion of correctness that can be universally agreed upon, despite the fact that in this paper we study a somewhat simpler version of the problem in which chemical kinetics, i.e. rates of chemical reactions, is dropped from consideration. However, we note that this restriction is not without its own advantages. For instance, when basing a theory on chemical kinetics, it is of interest to accept approximate matches to the target behavioral dynamics [38, 39], which may overlook certain logical flaws in the implementation that occur rarely. While theories of kinetic equivalence are possible and can in principle provide guarantees about timing [7], they can be difficult to apply to molecular engineering in practice. In contrast, a theory that ignores chemical kinetics can be exact and therefore emphasize the logical aspect of the correctness question. The main challenge in this verification problem lies in the fact that the implementation CRN is usually much more complex than the target CRN. This is because each reaction in the target CRN, which is of course a single step in principle, gets implemented as a sequence of steps which may involve “intermediate” species that were not part of the original target CRN. For example, in DNA-based implementations, the implementation CRN can easily involve an order of magnitude more reactions and species than the target CRN (the size will depend upon the level of detail in the model of the implementation [24, 17, 33, 14]). Given 2 that the intermediate species participating in implementations of different target reactions can potentially interact with each other in spurious ways, it becomes very difficult to verify that such an implementation CRN is indeed “correct.” A+B →C +D C +A→C +C A i i+B j i+j →C +k k D C +A m+n m+n→C +C A i i+B j j C +k k→D C +A m+n m+n→C +C CRN1 CRN2 CRN3 A→i i+B j j →C +k k D C +A m+n m+n→C +C A i i+B j j →C +k k D C +A m+n m+n→C +C A + g1 i + g2 i+B j + g3 g4 + j → C + k + w1 g5 + k D + w2 C +A m+n g6 + m + n → C + C + w3 CRN4 CRN5 CRN6 Figure 1: An example of CRN implementation. CRN1 represents the “target” CRN, i.e., the behavior we desire to implement, whereas CRN2-5 are potential “implementations” of this target CRN. In these CRNs, the lowercase species are “intermediate” species of the implementations, while the uppercase species are “formal” species. CRN6 illustrates the way in which “fuel” and “waste” species may appear in a typical DNA-based system, with fuel species denoted by gi and waste species denoted by wi . Removing inert waste species and ever-present fuel species from CRN6 yields CRN5. It is not immediately obvious how to precisely define what makes an implementation correct or incorrect, so it is helpful to informally examine a few examples. Figure 1 illustrates various different ways that a proposed implementation can be “incorrect.” For instance, one can easily see that CRN2 is clearly not a good implementation of CRN1, because it implements the reaction A + A + B → C + D in place of A + B → C + D. CRN3 is incorrect in a more subtle way. While a cursory look may not reveal any immediate problem with this implementation, one can check that CRN3 can get from the initial state1 ⦃A, A, B⦄ to a final state ⦃A, B, C⦄, whereas there is no way to achieve this using reactions from CRN1.2 CRN4 is incorrect in yet another way. Starting from the initial state ⦃A, C⦄, one can see that the system will sometimes get “stuck” in the state ⦃i, C⦄, unable to produce ⦃C, C⦄, with i becoming an intermediate species that is not really “intermediate.” Now, CRN5 seems to be free of any such issue, but with what confidence can we declare that it is a correct implementation of CRN1, having seen the subtle ways that an implementation can go wrong? A goal of this paper is to provide a mathematical definition of “correctness” of CRN implementations which can be used to test them in practice. In our further discussions, we will restrict our attention to implementation CRNs that satisfy the condition that we call “tidiness.” Informally stated, tidy CRNs are implementation CRNs which do not get “stuck” in the way that CRN4 got stuck above, i.e., they always can “clean up” intermediate species. This 1 2 In this paper, we use the notation ⦃ · ⦄ to denote multisets. The pathway is (A → i, i + B → j, j → C + k, C + A → m + n, m + n → C + C, C + k → j, j → i + B, i → A). 3 means that any intermediate species that are produced during the evolution of the system can eventually turn back into species of the target CRN. Of course, the algorithm we present in this paper for testing our definition of correctness will also be able to test whether the given implementation is tidy. Finally, we briefly mention that many CRN implementations also involve what are called “fuel” and “waste” species, in addition to the already mentioned intermediate species. Fuel species are helper species that are assumed to be always present in the system at fixed concentration, whereas waste species are chemically inert species that sometimes get produced as a byproduct of implemented pathways (see CRN6 of Figure 1 or for a more detailed explanation Example #1 of Section 6). While our core theory addresses the version of the problem in which there is no fuel or waste species, as we demonstrate in Section 5, it can easily be extended to handle the general case with fuel and waste species, using existing tools. 2 Motivations for a new theory To one who is experienced in formal verification, the problem seems to be closely related to various wellstudied notions such as reachability, (weak) trace equivalence, (weak) bisimulation, serializability, etc. In this section, we briefly demonstrate why none of these traditional notions seems to give rise to a definition which is entirely satisfactory for the problem at hand. The first notion we consider is reachability between formal states [28, 27, 15]. We call the species that appear in both the target and the implementation CRNs “formal,” to distinguish them from species that appear only in the implementation CRN, which we call “intermediate.” Formal states are defined to be states which do not contain any intermediate species. Since we are assuming that our implementation CRN is tidy, it then makes sense to ask whether the target CRN and the implementation CRN have the same reachability when we restrict our attention to formal states only — this is an important distinction from the traditional Petri net reachability-equivalence problem. That is, given some formal state, what is the set of formal states that can be reached from that state using reactions from one CRN, as opposed to the other CRN? Do the target CRN and the implementation CRN give rise to exactly the same reachability for every formal initial state? While it is obvious that any “correct” implementation must satisfy this condition, it is also easy to see that this notion is not very strong. For example, consider the target CRN {A → B, B → C, C → A} and the implementation CRN {A → i, i → C, C → j, j → B, B → k, k → A}. The two CRNs are implementing opposite behaviors in the sense that starting from one A molecule, the target CRN will visit formal states in the clockwise order ⦃A⦄, ⦃B⦄, ⦃C⦄, ⦃A⦄, ⦃B⦄, ⦃C⦄, . . ., whereas the implementation CRN will visit formal states in the counter-clockwise order ⦃A⦄, ⦃C⦄, ⦃B⦄, ⦃A⦄, ⦃C⦄, ⦃B⦄, . . .. Nonetheless, they still give rise to the same reachability between purely formal states. Trace equivalence [15, 21] is another notion of equivalence that is often found in formal verification literature. To our knowledge, it has not been applied in the context of CRN equivalence. We interpret its application in this context as follows. Weak trace equivalence requires that it should be possible to “label” the reactions of the implementation CRN to be either a reaction of the target CRN or a “null” reaction. This labeling must be such that for any formal initial state, any sequence of reactions that can take place in the target CRN should also be able to take place in the implementation CRN and vice versa, up to the interpretation specified by the given labeling. However, it turns out to be an inappropriate notion in our setting. For example, consider the target CRN {A B, B C, C A} and the implementation CRN {A i, B i, C i}. The dynamics of the implementation appear correct since each reaction of the target CRN can be simulated in the implementation CRN in the obvious way by exactly two reactions: the first reaction consumes the reactant and produces an intermediate species i while the second reaction consumes i and produces the intended formal species. However, these CRNs are not (weak-)trace equivalent. Consider that every reaction of the implementation CRN must be labeled by one of the six formal reactions (since the implementation CRN also consists of six reactions) and none can be labeled as a “null” reaction. 4 Since any initial reaction of the implementation CRN must begin in a formal state, and since there are only three reactions that can occur from one of the three formal states, then any trace of the target CRN that begins with one of the other three possible reactions cannot be simulated by the implementation CRN. Consider a second example with target CRN {A B, B → C, C → A} and implementation CRN {A B, B → j, j → C, C → A, C → ∅, ∅ i} where the implementation reactions {j → C, C → ∅, ∅ → i, i → ∅} are labeled as “null” and the other reactions are labeled in the obvious way that is consistent with formal species names. The implementation CRN exemplifies a common shortcoming of trace equivalence: inability to distinguish the two systems with respect to deadlock. In our example the implementation CRN can in principle simulate all finite and infinite traces of the target CRN, but once the first “null” reaction C → ∅ occurs then only “null” reactions can follow. In essence, the implementation CRN can become “stuck” whereas the target CRN cannot. While (weak-)trace equivalence cannot distinguish based on deadlock conditions as in our second example, other equivalence notions such as bisimulation can. Bisimulation [29, 4] is perhaps the most influential notion of equivalence in state transition systems such as CRNs, Petri nets, or concurrent systems [19, 34, 11]. A notion of CRN equivalence based on the idea of weak bisimulation is explored in detail in [12, 22], and indeed it proves to be much more useful than the above two notions. For bisimulation equivalence of CRNs, each intermediate species is “interpreted” as some combination of formal species, such that in any state of the implementation CRN, the set of possible next non-trivial reactions is exactly the same as it would be in the formal CRN. (Here, a “trivial” reaction is one where the interpretation of the reactants is identical to the interpretation of the products.) However, one potential problem of this approach is that it demands a way of interpreting every intermediate species in terms of formal species. Therefore, if we implement the target CRN {A → B, A → C, A → D} as {A → i, i → B, i → C, A → j, j → D}, we cannot apply this bisimulation approach because the intermediate i cannot be interpreted to be any of A, B, or C. Namely, calling it A would be a bad interpretation because i can never turn into D. Calling it B would be bad because i can turn into C whereas B should not be able to turn into C. For the same reason calling it C is not valid either. Perhaps this example deserves closer attention. We name this type of phenomenon the “delayed choice” phenomenon, to emphasize the point that when A becomes i, although it has committed to becoming either B or C instead of D, it has delayed the choice of whether to become B or C until the final reaction takes place. This is the same phenomenon occurring in the first example given when discussing (weak-)trace equivalence. Neither (weak-)trace equivalence nor bisimulation can be applied in systems that exhibit “delayed choice”. There are two reasons that the phenomenon is interesting; firstly, there may be a sense in which it is related to the efficiency of the implementation, because the use of delayed choice may allow for a smaller number of intermediate species in implementing the same CRN. Secondly, this phenomenon actually does arise in actual systems, as presented in [17]. We note an important distinction between the various notions of equivalence discussed here and those found in the Petri net literature. Whereas two Petri nets are compared for (reachability/trace/bisimulation)equivalence for a particular initial state [21], we are concerned about the various notions of equivalence of two CRNs for all initial states. This distinction may limit the applicability of common verification methodologies and software tools [20, 3], since the set of initial states is by necessity always infinite (and the set of reachable states from a particular initial state may also be infinite). Finally, we note that [25] proposes yet another notion of equivalence based on serializability from database and concurrency theory. The serializability result works on a class of implementations that are “modular”. Formal reactions are encoded by a set of implementation reactions and species. Roughly speaking, modular implementations ensure that each formal reaction has a unique and correct encoding that does not “cross-talk” with the encodings of other formal reactions. In general, this results in a one-to-one mapping between formal reactions and their encodings. Implementation CRNs satisfying the formal modularity definitions of [25] will correctly emulate their target CRN. However, this class of implementation CRNs precludes those that utilize “delayed choice”. Interestingly, when restricted to “modular” implementations, the notion of serializability and our notion of 5 pathway decomposition have a close correspondence. Our approach (originally developed in [35]) differs from any of the above in that we ignore the target CRN and pay attention only to the implementation CRN. Namely, we simply try to infer what CRN the given implementation would look like in a hypothetical world where we cannot observe the intermediate species. We call this notion “formal basis.” We show that not only is the formal basis unique for any valid implementation, but it also has the convenient property that a CRN that does not have any intermediate species has itself as its formal basis. This leads us to a simple definition of CRN equivalence; we can declare two CRNs to be equivalent if and only if they have the same formal basis. Therefore, unlike trace equivalence or weak bisimulation [12, 22], our definition is actually an equivalence relation and therefore even allows for the comparison of an implementation with another implementation. 3 3.1 Theory Overview In previous sections we saw that a reaction which is a single step in the target CRN gets implemented as a pathway of reactions which involves intermediate species whose net effect only changes the number of “formal” species molecules. For instance, the pathway A → i, i + B → j, j → C + k, k → D involves intermediate molecules i, j, and k but the net effect of this pathway is to consume A and B and produce C and D. In this sense this pathway may be viewed as an implementation of A + B → C + D. In contrast, we will not want to consider the pathway A → i, i → B, B → j, j → C to be an implementation of A → C, even though its net effect is to consume A and produce C. Intuitively, the reason is that this pathway, rather than being an indivisible unit, looks like a composition of smaller unit pathways each implementing A → B and B → C. The core idea of our definition, which we call pathway decomposition, is to identify all the pathways which act as indivisible units in the above sense. The set of these “indivisible units” is called the formal basis of the given CRN. If we can show that all potential pathways in the CRN can be expressed as compositions of these indivisible units, then that will give us ground to claim that this formal basis may be thought of as the target CRN that the given CRN is implementing. 3.2 Basic definitions The theory of pathway decomposition will be developed with respect to a chosen set F of species called the formal species; all other species will be intermediate species. All the definitions and theorems below should be implicitly taken to be with respect to the choice of F. As a convenient convention, we use upper case and lower case letters to denote formal and intermediate chemical species, respectively. Definition 1. A state is a multiset of species. If every species in a state S is a formal species, then S is called a formal state. In this paper we will use + and − to denote multiset sum and multiset difference respectively, e.g., S + T will denote the sum of two states S and T . Definition 2. If S is a state, Formal(S) denotes the multiset we obtain by removing all the intermediate species from S. Definition 3. A reaction is a pair of multisets of species (R, P ) and it is trivial if R = P . Here, R is called the set of reactants and P is called the set of products. We say that the reaction (R, P ) can occur in the state S if R ⊆ S. If both R and P are formal states, then (R, P ) is called a formal reaction. If r = (R, P ), we will sometimes use the notation r̄ to denote the reverse reaction (P, R). 6 Definition 4. If (R, P ) is a reaction that can occur in the state S, we write S ⊕(R, P ) to denote the resulting state S − R + P . As an operator, ⊕ is left-associative. Definition 5. A CRN is a (nonempty) set of nontrivial reactions. A CRN that contains only formal reactions is called a formal CRN. Definition 6. A pathway p of a CRN C is a (finite) sequence of reactions (r1 , . . . , rk ) with ri ∈ C for all i. We say that a pathway can occur in the state S if all its reactions can occur in succession starting from S. Note that given any pathway, we can find a unique minimal state from which the pathway can occur. We will call such state the minimal initial state, or simply the initial state of the pathway. Correspondingly, the final state of a pathway will denote the state S ⊕ r1 ⊕ r2 ⊕ · · · ⊕ rk where S is the (minimal) initial state of the pathway. If both the initial and final states of a pathway are formal, but not necessarily the intermediate states, it is called a formal pathway. A pathway is called trivial if its initial state equals its final state. In this paper, we will write p + q to denote the concatenation of two pathways p and q. To absorb these definitions, we can briefly study some examples. Consider the chemical reaction 2A + B → C. According to our definitions, this will be written (⦃A, A, B⦄, ⦃C⦄). Here, ⦃A, A, B⦄ is called the reactants and ⦃C⦄ is called the products, just as one would expect. Note that this reaction can occur in the state ⦃A, A, A, B, B⦄ but cannot occur in the state ⦃A, B, C, C, C, C⦄ because the latter state does not have all the required reactants. If the reaction takes place in the former state, then the resulting state will be ⦃A, B, C⦄ and thus we can write ⦃A, A, A, B, B⦄ ⊕ (⦃A, A, B⦄, ⦃C⦄) = ⦃A, B, C⦄. In this paper, although we formally define a reaction to be a pair of multisets, we will interchangeably use the chemical notation whenever it is more convenient. For instance, we will often write 2A + B → C instead of (⦃A, A, B⦄, ⦃C⦄). Note that we say that a pathway p = (r1 , r2 , . . . , rk ) can occur in the state S if r1 can occur in S, r2 can occur in S ⊕ r1 , r3 can occur in S ⊕ r1 ⊕ r2 , and so on. For example, consider the pathway that consists of 2A + B → C and B + C → A. This pathway cannot occur in the state ⦃A, A, B⦄ because even though the first reaction can occur in that state, the resulting state after the first reaction, which is ⦃C⦄, will not have all the reactants required for the second reaction to occur. In contrast, it is easy to see that this pathway can occur in the state ⦃A, A, B, B⦄, which also happens to be its minimal initial state. We also point out that we cannot directly express a reversible reaction in this formalism. Thus, a reversible reaction will be expressed using two independent reactions corresponding to each direction, e.g., A B will be expressed as two reactions: A → B and B → A. Before we proceed, we formally define the notion of tidiness which we informally introduced in Section 1. Definition 7. Let p be a pathway with a formal initial state and T its final state. Then, a (possibly empty) pathway p0 = (r1 , . . . , rk ) is said to be a closing pathway of p if p0 can occur in T and T ⊕ r1 ⊕ · · · ⊕ rk is a formal state. A CRN is weakly tidy if every pathway with a formal initial state has a closing pathway. As was informally explained before, this means that the given CRN is always capable of cleaning up all the intermediate species. For example, the CRN {A → i, i + B → C} will not be weakly tidy because if the system starts from the state ⦃A⦄, it can transition to the state ⦃i⦄ and become “stuck” in a non-formal state: there does not exist a reaction to convert the intermediate species i back into some formal species. For a more subtle example, let us consider the CRN {A → i + B, i + B → B}, which is weakly tidy according to the definition as stated above. In fact, it is easy to see that this implementation CRN will never get stuck when it is operating by itself, starting with any formal initial state. However, this becomes problematic when we begin to think about composing different CRNs. Namely, when intermediate species require other formal species in order to get removed, the implementation CRN may not work correctly if some other formal reactions are also operating in the system. For instance, if the above implementation runs 7 in an environment that also contains the reaction B → C, then it is no longer true that the system is always able to get back to a formal state. This is not ideal because the ability to compose different CRNs, at least in the case where they do not share any intermediate species, is essential for CRN implementations to be useful. To allow for this type of composition, and more importantly to allow for the proofs of Theorems in Section 3.4.2 and to make the algorithm defined in Section 4 tractable, we define a stronger notion of tidiness which is preserved under such composition. Definition 8. A closing pathway is strong if its reactions do not consume any formal species. A CRN is strongly tidy if every pathway with a formal initial state has a strong closing pathway. In the rest of the paper, unless indicated otherwise, we will simply say tidiness to mean strong tidiness. Similarly, we will simply say closing pathway to mean strong closing pathway. For some examples of different levels of tidiness, see Figure 2. A→i+j i+j →B A→i i+B →C A→i+D D→E E+i→C strongly tidy not tidy weakly tidy Figure 2: Some examples of tidy and non-tidy CRNs 3.3 Pathway decomposition Now we formally define the notion of pathway decomposition. Following our intuition from Section 3.1, we first define what it means to implement a formal reaction. Definition 9. Consider a pathway p = (r1 , . . . , rk ) and let Si = S ⊕ r1 ⊕ · · · ⊕ ri , so that S0 , S1 , . . . , Sk are all the states that p goes through. Then, p is regular if there exists a turning point reaction rj = (R0 , P 0 ) such that Formal(Si ) ⊆ S for all i < j, Formal(Si ) ⊆ T for all i ≥ j, and Formal(Sj−1 − R0 ) = ∅. Definition 10. We say that a pathway p = (r1 , . . . , rk ) implements a formal reaction (R, P ) if it is regular and R and P are equal to the initial and final states of p, respectively. While the first condition is self-evident, the second condition needs a careful explanation. It asserts that there should be a point in the pathway prior to which we only see the formal species from the initial state and after which we only see the formal species from the final state. The existence of such a “turning point” allows us to interpret the pathway as an implementation of the formal reaction (R, P ) where in a sense the real transition is occurring at that turning point. Importantly, this condition rules out such counterintuitive implementations as (A → i, i → C+j, C+j → k, k → B) or (A → i+B, i+B → j+A, j+A → B) as implementations of A → B. Note that a formal pathway that consumes but does not produce formal species prior to its turning point, and thereafter produces but does not consume formal species, is by this definition regular, and this is the “typical case.” However our definition also allows additional flexibility; for example, the reactants can fleetingly bind, as B does in the second and third reactions of (A → i, i + B → j, j → B + i, i + B → C), whose turning point is unambiguously the last reaction. One may also wonder why we need the condition Formal(Sj−1 − R0 ) = ∅. This is to prevent ambiguity that may arise in the case of catalytic reactions. Consider the pathway (A → i + A, i → B). Without the above condition, both reactions 8 in this pathway qualify as a turning point, but the second reaction being interpreted as the turning point is counterintuitive because the product A gets produced before the turning point. One problem of the above definition is that it interprets the pathway (A → i, A → i, i → B, i → B) as implementing A + A → B + B. As explained in Section 3.1, we would like to be able to identify such a pathway as a composition of smaller units. Definition 11. We say that a pathway p can be partitioned into two pathways p1 and p2 if p1 and p2 are subsequences of p (which need not be contiguous, but must preserve order) and every reaction in p belongs to exactly one of p1 and p2 . Equivalently, we can say p is formed by interleaving p1 and p2 . Definition 12. A formal pathway p is decomposable if p can be partitioned into p1 and p2 that are each formal pathways. A nonempty formal pathway that is not decomposable is called prime. For example, consider the formal pathway p = (A → i, B → i, i → C, i → D, D → j, j → E). This pathway is not prime because it can be decomposed into two formal pathways p1 = (A → i, i → C) and p2 = (B → i, i → D, D → j, j → E). Note that within each of the two subsequences, reactions must appear in the same order as in the original pathway p. In this example, p1 is already a prime pathway after the first decomposition, whereas p2 can be further decomposed into (B → i, i → D) and (D → j, j → E). In this manner, any nonempty formal pathway can eventually be decomposed into one or more prime pathways. Note that such a decomposition may not be unique, e.g., p can also be decomposed into (A → i, i → D), (B → i, i → C), and (D → j, j → E). Definition 13. The set of prime pathways in a given CRN is called the elementary basis of the CRN. The formal basis is the set of (initial state, final state) pairs of the pathways in the elementary basis. Note that the elementary basis and/or the formal basis can be either finite or infinite. The elementary basis may contain trivial pathways, and the formal basis may contain trivial reactions. Definition 14. A CRN is regular if every prime pathway implements some formal reaction (in particular, it must have a well-defined turning point reaction as defined in Definition 9). Equivalently, a CRN is regular if every prime pathway is regular. Definition 15. Two tidy and regular CRNs are said to be pathway decomposition equivalent if their formal bases are identical, up to addition or removal of trivial reactions. For clarity, we remind the reader here that the definitions and theorems in this section are implicitly taken to be with respect to the choice of F. In particular, this means that each choice of F gives rise to a j A i D m F A i j i k B j l E C k j B A i k B D C {A + B → D + E, D → F} {A → B, C → D} E B D {A → E, B + C → B + D} Figure 3: Three examples of decomposable formal pathways and the formal bases of their corresponding CRNs. The partition of reactions is marked by lines of different types and colors. In the right most example, the decomposed pathway denoted by blue lines with circles (which shows up as A → E in the formal basis) is not regular, and therefore pathway decomposition equivalence does not apply. 9 different pathway decomposition equivalence relation. For instance, CRNs {A → i, i → C} and {A → C} are clearly pathway decomposition equivalent with respect to the conventional choice of F, which contains exactly those species named with upper case letters, but if e.g. we defined F0 = F ∪ {i}, these two CRNs would not be pathway decomposition equivalent with respect to F0 . 3.4 3.4.1 Theorems Properties It is almost immediate that pathway decomposition equivalence satisfies many nice properties, some of which are expressed in the following theorems. Theorem 3.1. For any fixed choice of F, pathway decomposition equivalence with respect to F is an equivalence relation, i.e., it satisfies the reflexive, symmetric, and transitive properties. Theorem 3.2. If C is a formal CRN, its formal basis is itself. Corollary 3.3. If C1 and C2 are formal CRNs, they are pathway decomposition equivalent if and only if C1 = C2 , up to removal or addition of trivial reactions. Theorem 3.4. Any formal pathway of C can be generated by interleaving one or more prime pathways of C. It is perhaps worth noting here that the decomposition of a formal pathway may not always be unique. For example, the pathway (A → i, B → i, i → C, i → D) can be decomposed in two different ways: (A → i, i → C) and (B → i, i → D), and (A → i, i → D) and (B → i, i → C). Pathway decomposition differs from other notions such as (weak) bisimulation or (weak) trace equivalence in that it allows such degeneracy of interpretations. We note that such degeneracy, which is closely related to the previously mentioned delayed choice phenomenon, may permit a more efficient implementation of a target CRN in terms of the number of species or reactions used in the implementation CRN. For example, if we wish to implement the formal CRN consisting of the twelve reactions A B, A C, A D, B C, B D and C D, it may be more efficient to implement it as the following eight reactions: A i, B i, C i and D i. The following theorems illuminate the relationship between a tidy and regular CRN C and its formal basis F and how to better understand this degeneracy of interpretations. Definition 16. Let C be a tidy and regular CRN and F its formal basis. Suppose p = (r1 , . . . , rk ) is a formal pathway in C (i.e. ri ∈ C for all i) and q = (s1 , . . . , sl ) is a formal pathway in F (i.e. si ∈ F for all i). Then, we say p can be interpreted as q if 1. q can occur in the initial state S of p, 2. S ⊕ r1 ⊕ · · · ⊕ rk = S ⊕ s1 ⊕ · · · ⊕ sl , and 3. there is a decomposition of p such that if we replace a selected turning point reaction of each prime pathway with the corresponding reaction of F and remove all other reactions, the result is q. It is clear that the interpretation may not be unique, because there can be many different decompositions of p as well as many different choices of the turning point reactions. For example, consider the pathway p = (A → i, B → j, i → C, j → D), which has a unique decomposition into pathways (A → i, i → C) and (B → j, j → D). In each of these constituent pathways, there are two ways to select a turning point reaction. If we picked A → i and j → D, the process in condition 3 would yield (A → C, B → D) as the interpretation of p. On the other hand, if we selected i → C and B → j as our turning point reactions, p would end up being interpreted as (B → D, A → C). 10 One might also wonder why we do not simply require that p and q must have the same initial states. This is because of a subtlety in the concept of the minimal initial state, which arises due to a potential parallelism in the implementation. For instance, consider the pathway (A → i, B → A, i → B). This pathway, which can be interpreted as two formal reactions A → B and B → A occuring in parallel, has initial state ⦃A, B⦄. However, no such parallelism is allowed in the formal CRN and thus this pathway is forced to correspond to either (A → B, B → A) or (B → A, A → B), neither of which has initial state ⦃A, B⦄. Theorem 3.5. Suppose C is a tidy and regular CRN and F is its formal basis. 1. For any formal pathway q in F, there exists a formal pathway p in C whose initial and final states are equal to those of q, such that p can be interpreted as q. 2. Any formal pathway p in C can be interpreted as some pathway q in F. Proof. 1. Replace each reaction in q with the corresponding prime pathway of C. 2. Fix a decomposition of p and pick a turning point for each prime pathway. Replace the turning points with the corresponding formal basis reaction and remove all other reactions. We call the resulting pathway q. Then it suffices to show that q can occur in the initial state S of p. We show this by a hybrid argument. Define pj to be the pathway obtained by replacing the first j turning points in p by the corresponding formal basis elements and removing all other reactions that belong to those prime pathways. In particular, note that p0 = p and pl = q. We show that pj can occur in the initial state of pj−1 for all j > 0. First, write pj−1 = (r1 , . . . , rm ) and pj = (ri1 , . . . , rik , sj , rik+1 , . . . , rin ). Then it follows from the definition of a turning point that Formal(S ⊕ ri1 ⊕ · · · ⊕ rix−1 ) ⊇ Formal(S ⊕ r1 ⊕ · · · ⊕ rix −1 ) for every 1 ≤ x ≤ k. Therefore (ri1 , . . . , rik ) can occur in S. (Note that we need not worry about the intermediate species because (ri1 , . . . , rik ) has a formal initial state.) Moreover, since the definition of a turning point asserts that all the reactants must be consumed at the turning point, it also implies that Formal(S ⊕ ri1 ⊕ · · · ⊕ rik ) ⊇ Formal(S ⊕ r1 ⊕ · · · ⊕ rt−1 − X + R) where rt = (X, Y ) denotes the turning point that is being replaced by sj in this round and R denotes the reactants of sj . Therefore, sj can occur in S ⊕ ri1 ⊕ · · · ⊕ rik . Finally, it again follows from the definition of a turning point that Formal(S ⊕ ri1 ⊕ · · · ⊕ rik ⊕ sj ⊕ rik+1 ⊕ · · · ⊕ rix−1 ) ⊇ Formal(S ⊕ r1 ⊕ · · · ⊕ rix −1 ) for every k + 1 ≤ x ≤ n. We conclude that (ri1 , . . . , rik , sj , rik+1 , . . . , rin ) = p0j can occur in S. It is interesting to observe that tidiness is not actually used in the proof of Theorem 3.5 above (nor in that of Theorem 3.6 below), so that condition could be removed from the theorem statement. We retain the tidiness condition to emphasize that this is when the theorem characterizes the behavior of the CRN; without tidiness, a CRN could have many relevant behaviors that take place along pathways that never return to a formal state, and these behaviors would not be represented in its formal basis. In our final theorem we prove that pathway decomposition equivalence implies formal state reachability equivalence. Note that the converse is not true because {A → B, B → C, C → A} is not pathway decomposition equivalent to {A → C, C → B, B → A}. Theorem 3.6. If two tidy and regular CRNs C1 and C2 are pathway decomposition equivalent, they give rise to the same reachability between formal states. Proof. Suppose formal state T is reachable from formal state S in C1 , i.e. there is a formal pathway p in C1 whose initial state is S and final state is T . By Theorem 3.5, it can be interpreted as some pathway q consisting of the reactions in the formal basis of C1 . Since C1 and C2 have the same formal basis, by another application of Theorem 3.5, there exists some formal pathway p0 in C2 that can be interpreted as q. That is, the initial and final states of p0 are S and T respectively, which implies that T is reachable from S in C2 also. By symmetry between C1 and C2 , the theorem follows. 11 3.4.2 Modular composition of CRNs As we briefly mentioned in Section 3.2, it is very important for the usefulness of a CRN implementation that it be able to be safely composed with other CRNs. For instance, consider the simplest experimental setup of putting the molecules of the implementation CRN in the test tube and measuring the concentration of each species over time. In practice, the concentration measurement of species A is typically carried out by implementing a catalytic reaction that uses A to produce fluorescent material. Therefore even this simple scenario already involves a composition of two CRNs, namely the implementation CRN itself and the CRN consisting of the measurement reactions. It is evident that the ability to compose CRNs would become even more essential in more advanced applications. In this section, we prove theorems that show that pathway decomposition equivalence is preserved under composition of CRNs, as long as those CRNs do not share any intermediate species. Theorem 3.7. Let C and C 0 be two CRNs that do not share any intermediate species. Then, C ∪ C 0 is tidy if and only if both C and C 0 are tidy. Proof. For the forward direction, by symmetry it suffices to show that C is tidy. We begin by proving the following lemma. Lemma 3.8. Let C and C 0 be two CRNs that do not share any intermediate species. Let p be any formal pathway in C ∪ C 0 . If we partition p into two pathways p1 and p2 such that p1 is a pathway of C and p2 is a pathway of C 0 , then each of p1 and p2 is formal. Proof. Since C and C 0 do not share any intermediate species, it follows that all the intermediate species in the initial state of p1 will also show up in the initial state of p and all the intermediate species in the final state of p1 will also show up in the final state of p. Hence p1 must be formal. The case for p2 follows by symmetry. Now let p be any pathway in C with a formal initial state. Since p is also a pathway in C ∪ C 0 , it has a closing pathway q in C ∪ C 0 . Since s = p + q is a formal pathway, we can partition it into s1 and s2 as in the above lemma. In particular, since all the reactions in p belong to C, we have s1 = p + q1 and s2 = q2 where q1 and q2 are a partition of q such that q1 is a pathway of C and q2 is a pathway of C 0 . Since s1 is formal by the lemma, q1 is a closing pathway of p. Hence, C is tidy. For the reverse direction, suppose p is a pathway of C ∪ C 0 that has a formal initial state. Since C and 0 C do not share intermediate species, we can partition the intermediate species found in the final state of p into two multisets A and A0 , corresponding to the intermediate species used by C and C 0 respectively. Now, if we remove from p all the reactions that belong to C 0 and call the resulting pathway q, then the multiset of all the intermediate species found in the final state of q will be exactly A. This is because the removed reactions, which belonged to C 0 , cannot consume or produce any intermediate species used by C. Since C is tidy, q has a closing pathway r. This time, remove from p all the reactions that belong to C and call the resulting pathway q 0 . By a symmetric argument, q 0 must have a closing pathway r0 . Now observe that r + r0 is a closing pathway for p. Theorem 3.9. Let C and C 0 be two CRNs that do not share any intermediate species. Then, C ∪ C 0 is regular if and only if both C and C 0 are regular. Proof. For the forward direction, simply observe that any prime pathway p of C is also a prime pathway of C ∪ C 0 and therefore must be regular. Hence, C is regular. By symmetry, C 0 is also regular. For the reverse direction, let p be a prime pathway in C ∪ C 0 . Partition p into two subsequences q and q 0 , which contains all reactions of p which came from C and C 0 respectively. Since the two CRNs do not share any intermediate species, it is clear that q and q 0 must both be formal. Since p was prime, it implies that one 12 of q and q 0 must be empty. Therefore, p is indeed a prime pathway in either C or C 0 , and since each was a regular CRN, p must be regular. Theorem 3.10. Let C and C 0 be two tidy and regular CRNs that do not share any intermediate species, and F and F 0 their formal bases respectively. Then the formal basis of C ∪ C 0 is exactly F ∪ F 0 . Proof. Let p be a prime pathway in C ∪ C 0 . By the same argument as in the proof of Theorem 3.9, p is a prime pathway of either C or C 0 . Therefore, the formal basis of C ∪ C 0 is a subset of F ∪ F 0 . The other direction is trivial. We note that the ability to compose CRNs has another interesting consequence. Frequently, molecular implementations of CRNs involve intermediate species that are specific to a pathway implementing a particular reaction, such that intermediates that belong to pathways that implement different reactions do not react with each other. This is a strong constraint on the architecture of the implementations that can facilitate their verification. (For instance, it has been observed and used by Lakin et al. in [25].) We observe that in such cases Theorem 3.10 provides an easier way to find the formal basis of the implementation CRN. Namely, we can partition the CRN into disjoint subsets that do not share intermediate species with one another, find the formal basis of each subset, and then take the union of the found formal bases. For example, if the implementation CRN was {A → i, i → B, A → j, j → C, j + C → k, k → D}, then it can be partitioned into CRNs {A → i, i → B} and {A → j, j → C, j + C → k, k → D} such that they do not share intermediate species with each other. It is straightforward to see that the formal bases of these two subsets are {A → B} and {A → C, A + C → D} respectively, so the formal basis of the whole implementation CRN must be {A → B, A → C, A + C → D}. Similarly, Theorems 3.7 and 3.9 ensure that we can test for tidiness and regularity of the implementation CRN by testing tidiness and regularity of each of these subsets. 4 Algorithm In this section, we present a simple algorithm for finding the formal basis of a given CRN. The algorithm can also test tidiness and regularity. Our algorithm works by enumerating pathways that have formal initial states. The running time of our algorithm depends on a quantity called maximum width, which can be thought of as the size of the largest state that a prime pathway can ever generate. Unfortunately it is easy to see that this quantity is generally unbounded; e.g., {A → i, i → i + i, i → ∅} has a finite formal basis {A → ∅} but it can generate arbitrarily large states.3 However, since such implementations are highly unlikely to arise in practice, in this paper we focus on the bounded width case. We note that even in the bounded width case it is still nontrivial to come up with an algorithm that finishes in finite time, because it is unclear at what width we can safely stop the enumeration. 4.1 Exploiting bounded width We begin by introducing a few more definitions and theorems. Definition 17. A pathway that has a formal initial state is called semiformal. Definition 18. A semiformal pathway p is decomposable if p can be partitioned into two nonempty subsequences (which need not be contiguous) that are each semiformal pathways. It is obvious that this reduces to our previous definition of decomposability if p is a formal pathway. 3 Clearly, there may also be cases where the formal basis itself is infinite, e.g. {A → i, i → i + i, i → B}. 13 Definition 19. Let p = (r1 , . . . , rk ) be a pathway and let Si = S ⊕ r1 ⊕ · · · ⊕ ri where S is the initial state of p. The width of p is defined to be maxi |Si |. Definition 20. The branching factor of a CRN C is defined to be the following value. max max{|R|, |P |} (R,P )∈C We note that many implementations that arise in practice have small branching factors (e.g. [36, 5, 31]). Theorem 4.1. Suppose that pathway p is obtained by interleaving pathways p1 , . . . , pl . Let S be the initial state of p and S1 , . . . , Sl the initial states of p1 , . . . , pl respectively. Then, S ⊆ S1 + S2 + · · · + Sl . Theorem 4.2. If p is an undecomposable semiformal pathway of width w > 0, there exists an undecomposable semiformal pathway of width smaller than w but at least (w − b)/b, where b is the branching factor of the CRN. (Note that if w is small, the lower bound (w − b)/b might be negative. In this case, it would simply mean that there exists an undecomposable semiformal pathway of width 0, which would be the empty pathway.) Proof. Since w > 0, p is nonempty. Let p−1 denote the pathway obtained by removing the last reaction 0 the states that p−1 (R, P ) from p. Also, let S0 , . . . , Sk be the states that p goes through, and S00 , . . . , Sk−1 0 goes through. Si is potentially unequal to Si because if the last reaction in p consumes some new formal species, then the minimal initial state of p−1 might be smaller than that of p. It is obvious that the minimal initial state of p−1 is smaller than the minimal initial state of p by at most |R|, i.e., |S0 | − |S00 | ≤ |R|. This means that for all 0 ≤ i ≤ k − 1, we have that |Si | − |Si0 | ≤ |R|. Clearly, if there exists some 0 ≤ i ≤ k − 1 such that |Si | = w, then |Si0 | ≥ |Si | − |R| = w − |R| ≥ w − b, so p−1 has width at least w − b. If there exists no such i, then we have that |Sk | = w. Clearly, |Sk−1 | = |Sk | − |P | + |R| and it follows that 0 0 | ≤ |R|. | = |Sk−1 | − |Sk−1 |Sk | − |P | + |R| − |Sk−1 0 0 | ≥ w − |P | ≥ w − b. Thus, | ≤ |P |. Since |Sk | = w, we have that |Sk−1 This is equivalent to |Sk | − |Sk−1 p−1 achieves width at least w − b. Then, we decompose p−1 until it is no longer decomposable. As a result, we will end up with l ≥ 1 undecomposable pathways p1 , p2 , . . . , pl which by interleaving can generate p−1 . Also, they are all semiformal. First, we show that l is at most b. Assume towards a contradiction that l > b. Then, by the pigeonhole principle, there exists i such that (R − Formal(R), P ) can occur in the sum of the final states of p1 , . . . , pi−1 , pi+1 , . . . , pl (since |R − Formal(R)| ≤ b and (R − Formal(R), P ) can occur in the sum of the final states of p1 , . . . , pl , the at most b reactants of (R − Formal(R), P ) are distributed among l > b pathways and there exists at least one pi that does not provide a reactant and can be omitted). Then, consider the decomposition (pi , p0i ) of p−1 where p0i denotes the pathway we obtain by interleaving p1 , . . . , pi−1 , pi+1 , . . . , pl in the same order that those reactions occur in p−1 . By Theorem 4.1, p0i is semiformal. Since pj ’s are all semiformal, this means that the intermediate species in the final state of p0i will be exactly the same as those in the sum of the final states of p1 , . . . , pi−1 , pi+1 , . . . , pl . That is, the final state of p0i contains all the intermediate species that (R, P ) needs to occur, i.e., p0i with (R, P ) appended at the end should have a formal initial state. However, this means that p is decomposable which is a contradiction. Hence, l ≤ b. Now, note that if we have P l pathways each with widths w1 , . . . , wl , any pathway obtained by interleaving P them can have width at most li=1 wi . Since p−1 had width at least w − b, we have that w − b ≤ li=1 wi . P Then, if wi < (w − b)/b for all i, then li=1 wi < w − b, which is contradiction. Thus, we conclude that at least one of p1 , . . . , pl has width greater than or equal to (w − b)/b. It is also clear that its width cannot exceed w. Thus, we have found a pathway p0 which 14 1. has a smaller length than p, and 2. has width at least (w − b)/b and at most w. If p0 has width exactly w, then we have failed to meet the requirements of the claim. However, since we have decreased the length of the pathway by at least one, and the width of a zero-length pathway is always 0, we can eventually get a smaller width than w by repeating this argument. The first time that the width decreases, we will have found a pathway p0 that satisfies the theorem statement, because in that case conditions (1) and (2) must hold by the arguments above. Corollary 4.3. Suppose w and wmax are integers such that (w + 1)b ≤ wmax . Then, if there is no undecomposable semiformal pathway of width greater than w and less than or equal to wmax , then there exists no undecomposable semiformal pathway of width greater than w. Proof. Assume towards a contradiction that there exists an undecomposable semiformal pathway p of width w0 > w. If w0 ≤ wmax , then it is an immediate contradiction. Thus, assume that w0 > wmax . By Theorem 4.2, we can find a smaller undecomposable semiformal pathway q of width v where (w0 − b)/b ≤ v < w0 . Since w0 > wmax , we have that v ≥ (w0 − b)/b > (wmax − b)/b ≥ ((w + 1)b − b)/b = w. If v ≤ wmax , we have a contradiction. If v > wmax , then take q as our new p and repeat the above argument. Since v is smaller than w0 by at least one, we will eventually reach a contradiction. Thus, there exists no undecomposable semiformal pathway of width greater than w. 4.2 Overview While Corollary 4.3 gives us a way to exploit the bounded width assumption, it is still unclear whether the enumeration can be made finite, because the number of undecomposable semiformal pathways of bounded width may still be infinite. For an easy example, if the CRN consists of {A → i, i → j, j → i, j → B}, we have infinitely many undecomposable semiformal pathways of width 1, because after the initial reaction A → i, the segment i → j, j → i can be repeated arbitrarily many times without ever making the pathway decomposable. In this section, we sketch at high level how this difficulty is resolved in our finite-time algorithm. The principal technique that lets us avoid infinite enumeration of pathways is memoization. To use memoization, we first define what is called the signature of a pathway, which is a collection of information about many important properties of the pathway, such as its initial and final states, decomposability, etc. It turns out that the number of possible signatures of bounded width pathways is always finite, even if the number of pathways themselves may be infinite. This means that the enumeration algorithm does not need to duplicate pathways with the same signatures, provided the signatures alone give us sufficient information for determining the formal basis and for testing tidiness and regularity of the CRN. Therefore, the algorithm consists in enumerating all semiformal pathways of width up to (w + 1)b, where w is the maximum width of the undecomposable semiformal pathways discovered so far, while excluding pathways that have the same signatures as previously discovered pathways. It is important to emphasize that no a priori knowledge of the width bound is assumed, and the algorithm is guaranteed to halt as long as there exists some finite bound. While the existence of this algorithm shows that the problem of finding the formal basis is decidable with the bounded width assumption, the worst-case time complexity seems to be adverse as is usual for algorithms based on exhaustive search. It is an open question to understand the computational complexity of this problem as well as to find an algorithm that has better practical performance. Another important open question is whether the problem without the bounded width assumption is decidable. 15 4.3 Signature of a pathway While Corollary 4.3 gives us a way to make use of the bounded width assumption, it is still unclear whether the enumeration can be made finite, because the number of undecomposable semiformal pathways of bounded width may still be infinite. To resolve this problem, we need to define a few more concepts. Definition 21. Let p be a semiformal pathway. The decomposed final states (DFS) of p is defined as the set of all unordered pairs (T1 , T2 ) that can be obtained by decomposing p into two semiformal pathways and taking their final states. Note that for an undecomposable pathway, the DFS is the empty set. Definition 22. Let p = (r1 , . . . , rk ) be a semiformal pathway. Also, let Si = S ⊕ r1 ⊕ · · · ⊕ ri where S is the initial state of p. The formal closure of p is defined as the unique minimal state S 0 such that Formal(Si ) ⊆ S 0 for all i. Definition 23. The regular final states (RFS) of p is defined as the set of all minimal states T such that there exists a potential turning point reaction rj = (R, P ) which satisfies Formal(Si ) ⊆ S for all i < j, Formal(Si ) ⊆ T for all i ≥ j, and Formal(Sj−1 − R) = ∅. Some explanation is in order. Although the RFS definition applies equally to semiformal pathways that are or could be regular, and to semiformal pathways that are not and cannot be regular, the RFS provides a notion of “what the final state would/could be if the pathway were regular”. As examples, first consider the semiformal pathway (A → i, B + i → j, j → X + k). The second and third reactions are potential turning points, and the RFS is {⦃X⦄}. One can easily check that if the pathway were to be completed in a way that its final state does not contain X, the resulting pathway cannot be regular (e.g. were it to be closed by X + k → Y , the pathway becomes irregular). Now consider (A → i, i → B + j, B + j → k). Only the first two reactions are potential turning points, and the RFS is {⦃B⦄}. One can also check in this case that the only way that this semiformal pathway can be completed as a regular pathway is for it to have B in its final state. Finally consider (A → i, i → A + j, A + j → B), which is in fact a regular formal pathway implementing A → B. Because every reaction is a potential turning point by our definition, the RFS is {⦃A, B⦄, ⦃B⦄}. One of these states is the actual final state, corresponding to the actual turning point, and therefore we can see that this formal pathway is regular. Definition 24. The signature of the pathway is defined to be the 6-tuple of the initial state, final state, width, formal closure, DFS, and RFS. Theorem 4.4. If m is any finite number, the set of signatures of all semiformal pathways of width up to m is finite. Proof. Clearly, there is only a finite number of possible initial states, final states, widths, formal closures, and RFS. Also, since there is only a finite number of possible final states, there is only a finite number of possibilities for DFS. Theorem 4.5. Suppose p1 and p2 are two pathways with the same signature. Then, for any reaction r, p1 + (r) and p2 + (r) also have the same signature. Proof. Let p01 = p1 + (r) and p02 = p2 + (r). It is trivial that p01 and p02 have the same initial and final states, formal closure, and width. First, we show that p01 and p02 have the same DFS. Suppose (T1 , T2 ) is in the DFS of p01 . That is, there exists a decomposition (q10 , q20 ) of p01 where q10 and q20 have final states T1 and T2 . The last reaction r is either contained in q10 or q20 . Without loss of generality, suppose the latter is the case. Then, if q1 = q10 and q2 + (r) = q2 , then (q1 , q2 ) should decompose p1 , which is a prefix of p01 . Since p1 and p2 have the same DFS, there should be a decomposition (s1 , s2 ) of p2 that has the same final states as q1 and q2 . Clearly, 16 (s1 , s2 + (r)) should be a decomposition of p02 and thus (T1 , T2 ) is also in the DFS of p02 . By symmetry, it follows that p01 and p02 have the same DFS. Now we argue that p01 and p02 should have the same RFS. Suppose T is contained in the RFS of p01 . 1. If the potential turning point for T in p01 is the last reaction r, with r = (R, P ), then it must be the case that T = Formal(P ). Because p2 has the same formal closure and final state as p1 , which was sufficient to ensure that r was a valid potential turning point in p01 , r will also be a valid potential turning point in p02 . Consequently, T is also in the RFS of p02 . 2. Otherwise, the potential turning point reaction for T in p01 , call it t = (R, P ), also appears in p1 . Since the initial state of p1 must be a subset of the initial state of p01 , t is also a potential turning point for p1 . Since “midway through” the potential turning point reaction, all formal species must be gone, we conclude that in fact p1 and p01 have the same initial state. That is, R contains no formal species that aren’t already in the final state of p1 . Thus, all shared states after t are the same, and some subset T 0 of T must be contained in the RFS of p1 . By assumption, T 0 is also in the RFS of p2 , and p2 has the same final state as p1 . Since R contains no formal species that aren’t already in the final state of p2 , the initial states of p2 and p02 are the same. Consequently, the potential turning point of p2 corresponding to T 0 is also a potential turning point for p02 . This ensures that T is in the RFS for p02 . Theorem 4.6. A nonempty pathway p is a prime pathway if and only if its signature satisfies the following conditions: 1. The initial and final states are formal. 2. The DFS is the empty set. 4.4 Algorithm for enumerating signatures It is now clear that we can find the formal basis by enumerating the signatures of all undecomposable semiformal pathways. In this section we present a simple algorithm for achieving this. function enumerate(p, w, ret) if p is not semiformal or has width greater than w then return ret sig = signature of p if sig is in ret then return ret add sig to ret for every reaction rxn ret = enumerate(p + [rxn], w, ret) end for return ret end function function main() w_max = 0 b = branching factor of the given CRN while true signatures = enumerate([], w_max, {}) w = maximum width of an undecomposable pathway in signatures if (w+1)*b <= w_max then break w_max = (w+1)*b 17 end while return signatures end function The subroutine enumerate is a function that enumerates the signatures of all semiformal pathways of width at most w. Note that it uses memoization to avoid duplicating pathways that have identical signatures, as justified by Theorem 4.5. Because of this memoization, Theorem 4.4 ensures that this subroutine will terminate in finite time. The subroutine main repeatedly calls enumerate, increasing the width bound according to Corollary 4.3. It is obvious that main will terminate in finite time if and only if there exists a bound to the width of an undecomposable semiformal pathway. It is out of scope of this paper to attempt theoretical performance analysis of this algorithm or to study the computational complexity of finding the formal basis. While there are obvious further optimizations by which the performance of the above algorithm can be improved, we meet our goal of this paper in demonstrating the existence of a finite time algorithm and leave further explorations as a future task. 4.5 Testing tidiness and regularity Finally, we discuss how to use the enumerated signatures to test tidiness and regularity of the given CRN. Theorem 4.7. A CRN is tidy if and only if every undecomposable semiformal pathway has a closing pathway. Proof. The forward direction is trivial. For the reverse direction, we show that if a CRN is not tidy, there exists an undecomposable semiformal pathway that does not have a closing pathway. By definition, there exists a semiformal pathway p that does not have a closing pathway. Consider a minimal-length example of such a pathway. If p is undecomposable, then we are done. So suppose that p is decomposable into two semiformal pathways p1 and p2 . By the minimality of p, both pathways p1 and p2 must have closing pathways. However, since the final state of p has the same intermediate species as the sum of the final states of p1 and p2 (by Theorem 4.1 and the fact that p1 and p2 are semiformal), the two closing pathways concatenated will be a closing pathway of p (because a closing pathway does not consume any formal species). This contradicts that p does not have a closing pathway, and thus we conclude that the case where p is decomposable is impossible. Theorem 4.8. Let p be an undecomposable semiformal pathway that has a closing pathway. Then p also has a closing pathway q such that p + q is undecomposable. Proof. Let q be a minimal-length closing pathway for p. Note that p + q is a formal pathway. If p + q is undecomposable, we are done. So suppose that p + q decomposes into two formal pathways p1 and p2 , which by definition must both be nonempty. Then it must be the case that one of p1 or p2 contains all the reactions of p, because otherwise p must be decomposable as well. Without loss of generality, suppose p1 contains all the reactions of p. Then p2 consists only of reactions from q. This means that the reactions of q that went into p1 constitute a shorter closing pathway q for p, contradicting the minimality of q. We conclude that p + q must have been undecomposable. To test tidiness, we attempt to find a closing pathway for each undecomposable semiformal pathway p enumerated by the main algorithm. Theorem 4.7 ensures that it suffices to consider only these pathways. We do this by enumerating the signatures of all semiformal pathways of the form p + q where q is a pathway that does not consume a formal species, but only those of width up to wmax (wmax is the maximum width of 18 the undecomposable semiformal pathways discovered by the main algorithm). Theorem 4.8 ensures that it is safe to enforce this width bound. The testing of regularity is trivial, using the following theorem. Theorem 4.9. A prime pathway is regular if and only if its RFS contains its final state. Proof. The potential turning point corresponding to the final state proves regularity. If the final state is lacking in the RFS, then none of the potential turning points qualify as a turning point and the pathway is not regular. We emphasize that these methods work only because of the bounded width assumption we made on undecomposable semiformal pathways. Without this assumption, it is unclear whether these problems still remain decidable. 4.6 Optimization techniques In this section, we discuss some optimization techniques that can be used to improve the performance of the main enumeration algorithm. While we provide no theoretical analysis of these techniques, we report that there are test instances on which these techniques speed up the algorithm by many orders of magnitude. Definition 25. If S is a state, Intermediate(S) denotes the multiset that consists of exactly all the intermediate species in S. Theorem 4.10. If p is an undecomposable semiformal pathway of CRN C with an initial state of size m > 0, there exists an undecomposable semiformal pathway of C with an initial state of size smaller than m but at least min(R,P )∈C {(m − |Formal(R)|)/|Intermediate(R)|}. Proof. Since m > 0, p is nonempty. Let p−1 denote the pathway obtained by removing the last reaction (R, P ) from p. Let x be the number of formal species in R. Also, let S and S−1 denote the initial states of p and p−1 respectively. It is obvious that the initial state of p−1 is smaller than the initial state of p by at most x, i.e., |S−1 | ≥ |S| − x. Then, we decompose p−1 until it is no longer decomposable. As a result, we will end up with l undecomposable pathways p1 , p2 , . . . , pl which by interleaving can generate p−1 . Also, they are all semiformal. First, we show that l is at most y, where y is the number of intermediate species in R (clearly, x + y = |R|). Assume towards a contradiction that l > y. Then, by the pigeonhole principle, there exists i such that (Intermediate(R), P ) can occur in the sum of the final states of p1 , . . . , pi−1 , pi+1 , . . . , pl (as in the proof of Theorem 4.2). Then, consider the decomposition (pi , p0i ) of p−1 where p0i denotes the pathway we obtain by interleaving p1 , . . . , pi−1 , pi+1 , . . . , pl in the same order that those reactions occur in p−1 . By Theorem 4.1, p0i is semiformal. Since pj ’s are all semiformal, this means that the intermediate species in the final state of p0i will be exactly the same as those in the sum of the final state of p1 , . . . , pi−1 , pi+1 , . . . , pl . That is, the final state of p0i contains all the intermediate species that (Intermediate(R), P ) needs to occur, i.e., p0i with (R, P ) appended at the end should have a formal initial state. However, this means that p is decomposable which is a contradiction. Hence, l ≤ y. Now, note that if we have l semiformal pathways whose initial states P have size m1 , . . . , ml , any pathway obtained by interleaving them can have an initial state of size at most li=1 mi . Since p−1 had an initial state of size at least m − x and l ≤ y, we can conclude that at least one of p1 , . . . , pl has an initial state of size at least (m − x)/y. It is also clear that the size of its initial state cannot exceed m. Thus, we have found a pathway p0 which 1. has a smaller length than p, and 2. has an initial state of size at least min(R,P )∈C {(m − |Formal(R)|)/|Intermediate(R)|} and at most m. 19 If p0 has an initial state of size exactly m, then we have failed to meet the requirements of the claim. However, since we have decreased the length of the pathway by at least one and the initial state of a zerolength pathway is of size 0, we can eventually get an initial state of size smaller than m by repeating this process. The first time that the size of the initial state decreases, we will have found a pathway p0 that satisfies the theorem statement because in that case conditions (1) and (2) must hold by the arguments above. The above theorem allows us to maintain a bound i max on the size of initial states during enumeration, in a similar manner to how w max is maintained. Since our enumeration algorithm is essentially brute-force, imposing this additional bound may significantly reduce the number of pathways that need to be enumerated. Moreover, the proof of the above theorem immediately lets us optimize the constants in Theorem 4.2. Theorem 4.11. If p is an undecomposable semiformal pathway of width w > 0, there exists an undecomposable semiformal pathway of width smaller than w but at least (w − b)/br , where br = max {|Intermediate(R)|}. (R,P )∈C Proof. Same as the proof of Theorem 4.2, except that we argue l ≤ br instead of l ≤ b, using the argument from the proof of Theorem 4.10. The following theorem helps us further eliminate a huge number of pathways from consideration. Definition 26. Let p be a semiformal pathway. We say that p is strongly decomposable if p can be decomposed into two semiformal pathways p1 and p2 such that at least one of p1 and p2 is a formal pathway. Theorem 4.12. Let p be a semiformal pathway. If it is strongly decomposable, any semiformal pathway that contains p as a prefix is decomposable. Proof. Suppose p is strongly decomposable into formal pathway p1 and semiformal pathway p2 . We show that for any p0 , if p + p0 is semiformal, then it is decomposable into p1 and p2 + p0 . It suffices to show that p2 +p0 is semiformal. Assume towards a contradiction that the initial state of p2 +p0 contains an intermediate species. Since p2 is semiformal, it means that there is an intermediate species x contained in S − T , where T is the final state of p2 and S is the initial state of p0 . Let T 0 be the final state of p. Since p1 is formal, Intermediate(T 0 ) = Intermediate(T ). Hence, x is also contained in S − T 0 , which means that x appears in the initial state of p + p0 . This is a contradiction to our initial assumption that p + p0 was semiformal. Hence, p2 + p0 is semiformal and therefore p + p0 is decomposable. Finally, we show that CRNs that possess a certain structure can be processed extremely quickly. Since most published implementations do have this structure (e.g. [36, 5, 31]), this observation is very useful in practice. Definition 27. Let C be a CRN. We define the following two sets, which partition the set of intermediate species of C according to whether they ever participate in a reaction as a reactant. W (C) = {species x in C : x is not formal and x never appears as a reactant in reactions of C} N W (C) = {species x in C : x is not formal and x ∈ / W (C)} Moreover, for any state S, we will denote by S N W (C) the multiset containing exactly those species of S that belong to N W (C). Definition 28. A CRN C is said to have monomolecular substructure if for every reaction (R, P ) ∈ C, both |RN W (C) | and |P N W (C) | are at most one. 20 Theorem 4.13. Let C be a CRN that has monomolecular substructure and p = (r1 , . . . , rk ) any undecomposable semiformal pathway of C. Also, let S0 be the initial state of p and Si = S0 ⊕ r1 ⊕ · · · ⊕ ri all the N W (C) states that p goes through. Then, for any 0 ≤ i ≤ k, we have |Si | ≤ 1. Proof. We prove this by induction on k. If k = 1, the claim holds trivially. Now assume that the claim holds for all pathways of length up to k −1. Let p−1 be the pathway obtained by removing the last reaction rk from p. Note that rk consumes up to one intermediate species because the CRN has monomolecular substructure. Moreover, rk must consume at least one intermediate species because otherwise p can be decomposed into (r1 , . . . , rk−1 ) and (rk ). Therefore rk consumes exactly one intermediate species x, which by definition N W (C) must be in N W (C). By induction hypothesis, |Si | ≤ 1 for all 0 ≤ i ≤ k − 1 (the initial state of p−1 and the initial state of p differ only by formal species) and in particular the final state of p−1 contains at most one intermediate species that belongs to N W (C). This implies that this intermediate species must be x, because otherwise p = p−1 + (rk ) would not be semiformal. The last reaction rk consumes this x and N W (C) produces at most one intermediate species that belongs to N W (C), which means that |Sk | ≤ 1. The theorem now follows by induction. The above theorem implies that when we run our algorithm on a CRN with monomolecular substructure, there is no need to enumerate semiformal pathways that ever go through a state that contains more than one species from N W (C). 4.7 Testing pathway decomposition equivalence In this section, we have presented an algorithm for enumerating the formal basis of a given CRN, which is guaranteed to halt if there is a finite bound to the width of an undecomposable semiformal pathway. Moreover, this algorithm can also be used to test whether the CRN is tidy and regular. Hence, we are finally in a position to be able to verify the correctness of CRN implementations; namely, using the above algorithm we can test whether the target CRN and the implementation CRN are pathway decomposition equivalent. Since it immediately follows from definition that the target CRN is tidy and regular and that its formal basis is equal to itself, this verification amounts to checking that the implementation CRN is tidy and regular and that its formal basis is equal to the target CRN up to addition or removal of trivial reactions. All of these tasks can easily be achieved using our algorithm. We note that because of Theorem 3.1 our theory applies also to the more general scenario of comparing two arbitrary CRNs. In this case, one would need to enumerate the elementary and formal bases of both CRNs, verify that both CRNs are tidy and regular, and finally check that their formal bases are identical up to addition or removal of trivial reactions. 5 Handling the general case In this section, we discuss some important issues that pertain to practical applications and hint at the possibility of further theoretical investigations. As we briefly mentioned earlier, many CRN implementations that arise in practice involve not only formal and intermediate species but also what are called fuel and waste species. Fuel species are chemical species that are assumed to be always present in the system at fixed concentration, as in a buffer. For instance, DNA implementations [36, 5, 31] often employ fuel species that are present in the system in large concentrations and have the ability to transform formal species into various other intermediates. This type of “implementation” is also prevalent in biological systems, where the concentrations of energy-carrying species such as ATP, synthetic precursors such as NTPs, and general-purpose enzymes such as ribosomes and polymerases, are all maintained in roughly constant levels by the cellular metabolism. 21 In CRN verification, the standard approach to fuel species is to preprocess implementation CRNs such that all occurrences of fuel species are simply removed. For instance, if the CRN contained reaction A+g → i + t where g and t are fuel species, the preprocessed CRN will only have A → i. The justification for this type of preprocessing is that since fuel species are always present in the system in large concentrations by definition, consuming or producing a finite number of fuel species molecules do not have any effect on the system. In particular, it can be shown that holding fuel species at constant concentration, versus simply removing them from the reactions while appropriately adjusting the reaction rate constants, leads to exactly the same mass-action ODE’s and continuous-time Markov chains. On the other hand, implementations sometimes produce “waste” species as byproducts. Waste species are supposed to be chemically inert and thus cannot have interaction with other formal or intermediate species. However, in practice it is often difficult to implement a chemical species which is completely inert and therefore they may interact with other species in trivial or nontrivial ways. Therefore the main challenge is to ensure that these unwanted interactions do not give rise to a logically erroneous behavior. One way to deal with this problem is to first verify that such waste species are indeed “effectively inert” and then preprocess them in a similar manner to fuel species. To achieve this we need to answer two important questions: first, how to satisfactorily define “effectively inert” and second, how such waste species may be algorithmically identified. Another related problem which must be solved before we can use pathway decomposition is that some implementations may have multiple chemical species that are interpreted as the same formal species. (For example, see DNA implementations [36, 5] with “history domains.” An example is given in Section 6.) Since our mathematical framework implicitly assumes one-to-one correspondence between formal species of the target CRN and formal species of the implementation CRN, it is not immediately clear how we can apply our theory in such cases. Interestingly, the weak bisimulation-based approach to CRN equivalence proposed in [12, 22] does not seem to suffer from any of these problems, because it in fact does not make a particular distinction between these different types of species except fuel species. Rather, it requires that there must be a way to interpret each species that appears in the implementation CRN as one or more formal species. For instance, if {A i, B + i j, j → C} is proposed as an implementation of A + B → C, the weak bisimulation approach will interpret A and i as ⦃A⦄, B as ⦃B⦄, j as ⦃A, B⦄, and C as ⦃C⦄. Therefore the state of the system at any moment will have an instantaneous interpretation as some formal state, which is not provided by pathway decomposition. On the other hand, the weak bisimulation approach cannot handle interesting phenomena that are allowed in the pathway decomposition approach, most notably the delayed choice phenomenon explained in Section 2. Our proposed solution to the problem of wastes and multiple formal labeling is a compositional hybrid approach between weak bisimulation and pathway decomposition. Namely, we take the implementation CRN from which only the fuel species have been preprocessed, and tag as “formal” species all the species that have been labeled by the user as either an implementation of a target CRN species or a waste. All other species are tagged as “intermediates”. Then we can apply the theory of pathway decomposition to find its formal basis (with respect to the tagging, as opposed to the smaller set of species in the target CRN). Note that waste species must be tagged as “formal” rather than “intermediate” because they will typically accumulate, and thus tagging them as “intermediate” would result in a non-tidy CRN to which pathway decomposition theory does not apply. Finally, we verify that the resulting formal basis of tagged species is weak bisimulation equivalent to the target CRN under the natural interpretation, which interprets implementations of each target CRN species as the target CRN species itself and wastes as “null.” If the implementation is incorrect, or if some species was incorrectly tagged as “waste”, the weak bisimulation test will fail. See Figure 4 for example. On the other hand, we note that the weak bisimulation approach can sometimes handle interesting cases which pathway decomposition cannot. For instance, the design proposed in [31] for reversible reactions 22 A1 → i i → B1 + W A2 → j j → B2 W + j → B1 A1 → B1 + W A2 → B 2 A2 + W → B 1 A→B Implementation CRN Formal basis Under weak bisimulation Figure 4: The compositional hybrid approach for verifying an implementation of the formal CRN {A → B}. We first apply pathway decomposition, treating the upper case species as formal species and lower case species as intermediate species. Then, we apply weak bisimulation using the natural interpretation which interprets A1 and A2 as {|A|}, B1 and B2 as {|B|}, and W as ∅. Thus, in two steps, the implementation CRN has been shown to be a correct implementation of {A → B}. implements A+B C+D as {A i, i+B j, j k+C, k D}. Note that this implementation CRN is not regular according to our theory because of the prime pathway A → i, i + B → j, j → k + C, k + C → j, j → i + B, i → A. Interestingly, this type of design seems to directly oppose the foundational principles of the pathway decomposition approach. One of the key ideas that inspired pathway decomposition is that of “base touching,” namely the idea that even though the evolution of the system involves many intermediate species, a pathway implementing a formal reaction must eventually produce all its formal products and thus “touch the base.” This principle is conspicuously violated in the above pathway, because while the only intuitive way to interpret it is as A + B → C + D and then C + D → A + B, the first part does not touch the base by producing a D molecule. In contrast, the weak bisimulation approach naturally has no problem handling this implementation: i is interpreted as ⦃A⦄, j is interpreted as ⦃A, B⦄, and k is interpreted as ⦃D⦄. The fact that the two approaches are good for different types of instances motivates us to further generalize the compositional hybrid approach explained above. To define the generalized compositional hybrid approach, we begin by formally introducing the weak bisimulation approach of [12, 22]. As we have seen above, the weak bisimulation approach requires an “interpretation map” m from species of the implementation CRN to states of the target CRN. For instance, in the above example m was defined as m(A) = m(i) = ⦃A⦄, m(B) = ⦃B⦄, m(j) = ⦃A, B⦄, m(C) = ⦃C⦄, and m(D) = m(k) = ⦃D⦄. Although the domain of m is technically species of the implementation CRN, there is an obvious sense in which we can also apply P it to states, reactions, or pathways. Thus when convenient we will abuse notation to mean m(S) = x∈S m(x) for a state S, m(r) = (m(R), m(P )) for a reaction r = (R, P ), and m(p) = (m(r1 ), m(r2 ), . . . , m(rk )) for a pathway p = (r1 , . . . , rk ). Then, the following definition and theorem are adapted from [12, 22] to fit our definitions of chemical reactions and pathways. Definition 29. (Section 3.2 of [22]) A target CRN C1 and an implementation CRN C2 are weak bisimulation equivalent under interpretation m if 1. for any state S in C1 , there exists a state S 0 in C2 such that m(S 0 ) = S, 2. for any state S 0 in C2 and S = m(S 0 ), (a) if r ∈ C1 can occur in S, then there exists a pathway p = (s1 , . . . , sk ) in C2 such that S ⊕ r = m(S 0 ⊕ s1 ⊕ · · · ⊕ sk ) and m(p) is equal to (r) up to addition or removal of trivial reactions, and (b) if r0 ∈ C2 can occur in S 0 , then m(r0 ) is either a reaction in C1 or a trivial reaction, and thus m(S 0 ⊕ r0 ) = S ⊕ m(r0 ). 23 Theorem 5.1. (An immediate corollary of Theorem 1 of [22]) If a target CRN C1 and an implementation CRN C2 are weak bisimulation equivalent under interpretation m, then the following holds: 1. If S is a state in C1 , p is a pathway in C1 that can occur in S, and S 0 is a state in C2 such that m(S 0 ) = S, then there exists a pathway p0 in C2 such that p0 can occur in S 0 and m(p0 ) is equal to p up to addition or removal of trivial reactions. 2. If S 0 is a state in C2 and p0 is a pathway in C2 that can occur in S 0 , then there exists a pathway p in C1 such that p can occur in m(S 0 ) and p is equal to m(p0 ) up to addition or removal of trivial reactions. Similarly to Theorem 3.5, the above theorem establishes a kind of pathway equivalence between the target CRN and the implementation CRN. Now, we can formally define the generalized compositional hybrid approach as follows. Definition 30. Suppose we are given a target CRN C1 and an implementation CRN C2 . Let F and S denote the species of C1 and C2 respectively. Let X ⊆ S be the set of species that have been labeled by the user as implementations of target CRN species or wastes. In the compositional hybrid approach, we say C2 is a correct implementation of C1 if there exists some X ⊆ V ⊆ S such that 1. C2 with respect to V as formal species is tidy and regular, and 2. the formal basis of C2 with respect to V as formal species is weak bisimulation equivalent to C1 under some interpretation that respects the labels on X provided by the user. The flexibility to vary V can be useful: for example, intermediates that are involved in “delayed choice” pathways can be kept out of V so as to be handled by pathway decomposition, whereas intermediates involved in the aforementioned reversible reaction pathways can be retained within V so as to be handled by weak bisimulation. Finally, we prove a theorem analogous to Theorems 3.5 and 5.1, in order to provide an intuitive justification for the adequacy of the above definition. We begin by extending the notion of interpretation of pathways that we introduced in Section 3.4 to include the concept of interpretation map. Definition 31. Suppose V denotes the set of species of C2 that are being tagged as formal species in the compositional hybrid approach. Let m be an interpretation map from V to states of C1 . We say a formal pathway p = (r1 , . . . , rk ) in C2 can be interpreted as a pathway q = (s1 , . . . , sl ) in C1 under m if 1. q can occur in m(S), where S is the initial state of p, 2. m(S ⊕ r1 ⊕ · · · ⊕ rk ) = m(S) ⊕ s1 ⊕ · · · ⊕ sl , and 3. there is a decomposition of p such that if we replace the turning point reaction of each prime pathway with the corresponding element of C1 (i.e. the corresponding formal basis reaction mapped through m) and remove all other reactions, then the resulting pathway is equal to q up to addition or removal of trivial reactions. Then, the following theorem provides a sense in which two CRNs that are “equivalent” according to the compositional hybrid approach indeed do have equivalent behaviors. Theorem 5.2. Suppose an implementation CRN C2 is a correct implementation of the target CRN C1 according to the compositional hybrid approach. Then, there exists a mapping m from V to states of C1 such that the following two conditions hold. 1. Let q and S be a pathway and a state in C1 such that q can occur in S. Then, for any state S 0 in C2 that uses species from V such that m(S 0 ) = S, there exists a formal pathway p in C2 that can occur in S 0 and can be interpreted as q under m. 24 2. Any formal pathway p in C2 can be interpreted as some pathway q in C1 under m. Proof. Let m be the interpretation map provided by the weak bisimulation equivalence [12, 22], and I the formal basis of C2 with respect to V as formal species. 1. By Theorem 5.1, we have a pathway p0 in I that can occur in S 0 and m(p0 ) is equal to q up to addition or removal of trivial reactions. Now replace each reaction in p0 by the prime pathway that implements that reaction and call the resulting pathway p. Clearly, p can occur in S 0 . To show that p can be interpreted as q under m, observe that the first condition of Definition 31 follows from the fact that q can clearly occur in m(S 0 ) and S 0 is a superset of the initial state of p (because p can occur in S 0 ). Since p and p0 have the same initial and final states and m(p0 ) = q, we also satisfy the second condition. The final condition trivially follows from the way p was constructed and the fact that m(p0 ) was equal to q up to addition or removal of trivial reactions. 2. By Theorem 3.5, p can be interpreted as some pathway p0 in I. Let q be the pathway we obtain by removing all the trivial reactions from m(p0 ). Now we show that p can be interpreted as q under m. For the first condition of Definition 31, we use Theorem 5.1 to see that q can occur in m(S 0 ) where S 0 is the initial state of p0 . Since p0 can occur in the initial state of p, this implies that q can also occur in m(S) where S is the initial state of p. The second condition follows immediately from the way q was constructed and the fact that p and p0 have the same net effect. The final condition follows from the fact that p can be interpreted as p0 in I and that m(p0 ) = q up to removal of trivial reactions. As we shall see in Section 6, the compositional hybrid approach allows for the verification of interesting real-life systems that neither pathway decomposition nor bisimulation is able to handle individually. In fact, the compositional hybrid approach seems to be the most general approach proposed thus far in terms of the range of implementations that it can address, which, to our best knowledge, includes all currently known enzyme-free DNA implementation techniques. At the same time, we remark that its definition as presented in this paper does not seem to be completely satisfactory. To see why, consider the CRN {A → i, i + B1 j1 , i + B2 j2 , j1 → C, j2 → C} as an implementation of {A + B → C}. Intuitively, it seems that the compositional hybrid approach should have no problem handling this example with V = {A, B1 , B2 , C} and m(A) = ⦃A⦄, m(B1 ) = m(B2 ) = ⦃B⦄, m(C) = ⦃C⦄. Surprisingly, it turns out that the prime pathway A → i, i + B1 → j1 , j1 → i + B1 , i + B2 → j2 , j2 → C is not regular under this choice of V, because the product B1 is produced before the reactant B2 is consumed. Of course, the compositional hybrid approach can still handle this implementation because we can always choose V = {A, B1 , B2 , C, i, j1 , j2 } and delegate the whole verification to the bisimulation part. Nonetheless, it is troubling that the above pathway is considered irregular because if indeed B1 and B2 both represent B, then there is a sense in which this pathway should really be thought of as A → i, i + B → j1 , j1 → i + B, i + B → j2 , j2 → C and hence be considered regular. Towards the resolution of the above issue, we may want to imagine a modified version of hybrid approach where pathway decomposition and bisimulation are not merely composed as in the above definition, but combined in a more integrated manner. For example, we have considered a kind of “integrated” hybrid approach in which regularity and the delimiting condition of weak bisimulation [12, 22] are tested only after we apply the interpretation m to the prime pathways in the elementary basis. While empirical results suggest that such modifications may successfully fix the issue described above, their theoretical implications are yet to be understood. 25 6 Case studies In this section, we study five real-life examples from the field of DNA computing in order to demonstrate how the theory developed in this paper can be applied in practice. The code that was used to test these examples is included as part of the Nuskell suite for compiling and verifying DNA implementations (previously called BioCRN [35]). Nuskell interfaces the formal basis enumeration algorithm from Section 4 with other software pieces to form the following pipeline for verifying CRN implementations. First, the given target CRN is converted into a set of DNA molecules using the Nuskell compiler [35]. Second, all the reactions that can occur between these DNA molecules are enumerated using Grun et al.’s domain-level DNA reaction enumerator [17], from which the fuel species are pruned out as described in Section 5. The resulting reactions constitute the implementation CRN. Finally, either pathway decomposition, weak bisimulation [12, 22], or the compositional hybrid approach can be applied to the target CRN and the implementation CRN to verify that the two are indeed equivalent. The current version of Nuskell implements a special case of the compositional hybrid approach in which V = X (see Definition 30). In other words, the Nuskell compiler provides the verifier with not only the target and implementation CRNs, but also information on formal and waste labeling. For formal labeling, it uses a pattern matching algorithm described in [35] to decide which species in the implementation CRN should correspond to which formal species. For waste labeling, it currently uses the following criterion proposed in [35]: Definition 32. A species is a non-waste if it is formal or it is a reactant of a reaction that involves at least one non-waste either as a reactant or a product. An intermediate species that is not a non-waste is a waste species. Given this information, our verifier first finds the formal basis of the implementation CRN with respect to exactly those species labeled as formal or waste species by the Nuskell compiler, and then verifies that this formal basis is weak bisimulation equivalent to the target CRN under the natural interpretation that accords with the compiler’s labeling. Example #1 For the first example, we will implement the target CRN {A → X +Y +Z, A → X +Y, A → X, A → B} using the translation scheme proposed in [36]. Figure 5 shows how a unimolecular reaction (i.e. reaction with exactly one reactant) gets implemented in this translation scheme. To understand how this translation works, first note that the figure makes use of domain-level annotation as opposed to sequence-level annotation: that is, the DNA strands in Figure 5 are specified by numbered segments, or “domains,” instead of the actual nucleotide base sequences of A, G, C, and T. Here, the star is used to indicate sequence complementarity, e.g. segments 1 and 1* are complementary to each other. Under the assumption that domains otherwise have very little complementarity, this abstraction is very useful in modeling complex DNA systems. In this implementation, g and t are fuel species that are assumed to be present in large concentration. Hence, when the molecule A is present in the solution, A and g may collide and bind to each other by the 1 and 1* domains that are complementary to each other. When this happens, since the adjacent domains 2 and 3 on A and 2* and 3* on the bottom strand of g are also complementary to each other, the hybridization can continue to the right, by a process called branch migration, thus displacing the top strand of g and producing two species on the right-hand side of the first reaction. The resulting molecule i can then react with another fuel species t to produce the desired products X and Y . Note that g and t can be easily modified to implement reactions with different numbers of product molecules, e.g. A → X or A → X + Y + Z. 26 history species domain identifier ? 1 2 3 3 10 4 i 10 3 7 11 ? 1 1* 1* 2* 3* A 2 2 4 10 4 3* 10* 4* 3 2 2* 3* W1 g 11 7 2 5 6 11 7 8 9 2 3 4 11 7 10 3* 10* 4* 11* 7* 11*7* W2 t 3 10 4 11 7 i history species domain identifier 10 4 5 X 6 history species domain identifier 11 7 8 9 Y Figure 5: The implementation of A → X + Y according to the translation scheme from [36]. Dotted boxes indicate fuel species. Note that in this translation scheme each formal species molecule will retain a “history domain” specific to the gate from which it was produced. Note also that this scheme makes use of “history domains” in implementing formal species, represented by the question mark in the domain specification. For instance, in this example, any single-stranded molecule that has an arbitrary domain followed by domains 1, 2, and 3 is considered to be A. This is necessary because if the implementation consists of multiple modules like the one depicted in this figure, A molecules produced by different modules will have different history domains, each specific to the gate from which the molecule was produced. However, all those different versions of A will then be able to participate in the same set of downstream modules, because as can be seen in the figure, the history domains do not participate in the reactions employed by those modules. If we follow this translation scheme blindly, we would require exactly two fuel species for each unimolecular reaction in the target CRN. However, in the case of our target CRN {A → X + Y + Z, A → X + Y, A → X, A → B}, there is an optimization technique we can use to reduce the number of fuel species, exploiting the fact that the first three reactions in this target CRN are very similar to one another. Namely, it turns out that in this case we can share one fuel species g among those three reactions, therefore using only 6 fuel species to implement the four reactions in the target CRN rather than 2×4 = 8. In practice, researchers who experiment with actual DNA systems generally want to employ such optimizations whenever possible, because they are often crucial to the cost and efficacy of the experiment. Figure 6 illustrates how the optimized implementation works for this example. In the next step, we preprocess the fuel and waste species to obtain a simpler CRN that involves only formal and intermediate species. Although in principle waste species are handled using the compositional hybrid approach, we will assume for the sake of presentation that in this example we can treat waste species in the same way as fuel species. We note that this assumption is not far-fetched because in this example it is rather obvious that the waste species do not participate in any reaction at all. After this preprocessing, the resulting implementation CRN looks as follows: A→i i→X +Y +Z i→X +Y i→X A→j j→B Moreover, the optimized implementation no longer uses multiple history domains for a single formal species, so the theory of pathway decomposition can be directly applied to this implementation. 27 0 1 2 3 3 10 4 3 11 12 13 0 1 1* 1* 2* 3* A 2 2 4 10 7 2 3 9 6 15 8 14 11 7 12 13 5 10 4 11*7* 3* 10* 4* i 2 12*13* 3 10 3 10 4 11 7 12 13 9 6 8 11 7 5 10 4 2 11*7* 3 3 10 4 11 7 12 13 6 2 3* 10* 4* i 3 10 1 2 3 A 2 3 16 17 j 2 3 16 17 0 1 1* 2 10 4 11 12 18 3* 16* 17* 19 2 3 3 2* 3* 16 17 3* 16* 17* g6 6 11 7 8 9 Y W5 5 6 X 13 W1 g5 11 7 12 13 12 13 14 15 Z 13 10 4 11 7 8 9 Y 5 6 X W4 1* 2* 3* 16 17 4 7 5 X 3* 10* 4* g4 0 10 4 3* 10* 4* 11* 7* W3 5 10 4 4 11 7 12 10 g3 2 12 13 4 11 7 W2 3* 10* 4* i 10 4 i 3* 10* 4* 11* 7* 12* 13* g2 2 3 W1 g1 11 7 12 13 2 2* 3* 2 3 16 17 j 16 17 18 19 B Figure 6: An optimized implementation of target CRN {A → X + Y + Z, A → X + Y, A → X, A → B}. Before we proceed, we also remark that this example contains a notable instance of the delayed choice phenomenon, and therefore cannot be verified by either weak bisimulation [12, 22] nor serializability [25]. Namely, the intermediate i has multiple fates ⦃X, Y, Z⦄, ⦃X, Y ⦄, and ⦃X⦄, and hence it is unclear what its instantaneous interpretation should be. Indeed, we cannot interpret i to be any of ⦃X, Y, Z⦄, ⦃X, Y ⦄, and ⦃X⦄ because then the CRN would appear to contain reactions X + Y + Z → X + Y , X + Y → X + Y + Z, and X → X + Y + Z, respectively. Neither can we interpret i to be A, because i cannot turn into B. In contrast, pathway decomposition has no difficulty verifying this implementation CRN. Running the algorithm for enumerating the basis, we find that its elementary basis is {(A → i, i → X + Y + Z), (A → i, i → X + Y ), (A → i, i → X), (A → j, j → B)}, from which it is clear that the CRN is tidy and regular, and moreover its formal basis equals the target CRN that we desired to implement. Hence, this implementation is pathway decomposition equivalent to the target CRN. Example #2 Our second example is a verification of the network condensation procedure proposed in [17]. The domainlevel reaction enumerator from [17] can produce the output using several different semantics. One is “detailed” semantics, in which all internal configuration changes within DNA molecules are enumerated step 28 by step, one domain change at a time. Another is “condensed” semantics, in which internal configuration changes that occur within a single molecule are considered to be one step. For instance, we note that Figure 5 is an example of condensed semantics. If the first reaction in Figure 5 was enumerated using detailed semantics instead, it would be enumerated as three reactions instead of one, where the first reaction would be A binding to g by domain 1, the second reaction would be domain 2 on A hybridizing with domain 2* on the bottom strand of g (i.e. domain 2* on the top strand of g would now be displaced), and the third reaction would be domain 3 on A hybridizing with domain 3* on the bottom strand of g (i.e. the top strand is now completely released). For practical purposes, it is often convenient to use condensed semantics, which produces many fewer species and reactions while still capturing the essential behavioral features of the given system. While [17] provides its own theoretical justification for the correctness of this condensation procedure, it would be interesting to verify using pathway decomposition that the CRNs generated by the two different semantics are indeed equivalent. For example, let us consider the DNA system in Figure 7, enumerated using detailed and condensed semantics of Grun et al.’s enumerator [17]. This example was taken from Figure 4 of [17] and was slightly modified to highlight the delayed choice phenomenon inherent in the system. Condensed semantics identifies species that differ only by a reversible change of internal configuration with one another, resulting in “resting sets” of species variants that are easily interconvertible. In this example, species G and i4 are grouped together and will be treated as one species G in the condensed CRN (and similarly D and i7 as one species D). In general, this grouping gives rise to subtle issues that necessitate the use of the compositional hybrid approach (see Example #4), but we will show that the system at hand is simple enough that we can verify it using only pathway decomposition. To achieve this, we treat the CRN generated by condensed semantics as a target CRN and the CRN generated by detailed semantics as an implementation CRN. First of all, observe that the weak bisimulation approach of [12, 22] is not sufficient to verify the correctness of this condensation. For example, the intermediate species i19 does not admit an appropriate instantaneous interpretation. If it is interpreted to be ⦃A, B⦄, the system would appear to contain the reaction A + B → C + D. If it is interpreted to be ⦃C, D⦄, the system would appear to contain the reaction C + D → A + B. It cannot be interpreted as ⦃G, T ⦄, because it cannot react with an X molecule to produce W. In contrast, it is easily verified using our algorithm that the detailed CRN is tidy and regular and moreover its formal basis is {D → D, G → G, G + T → A + B, G + T → C + D, T + X → W }, which is equal to the condensed CRN up to addition or removal of trivial reactions. Therefore the condensation in this example is correct according to pathway decomposition equivalence. Example #3 As a third example, we consider the same translation scheme and optimization technique as in Example #1, this time applied to a different target CRN {A + X → X + X + A, A + X → X + X, A + X → X, A → A + X + X, A → A + X}. While this example is very similar in flavor to Example #1, we can no longer directly verify it with pathway decomposition because now there can be multiple history domains for a single formal species. As can be seen in Figure 8, there are four different implementation species that correspond to the formal species X and two different implementation species that correspond to the formal species A. Moreover, as can be seen in Figure 9, bisimulation still does not apply because of the delayed choice of species j. Hence, in this case the compositional hybrid approach is necessary to establish the equivalence between the target CRN and the implementation CRN. To verify this implementation using the compositional hybrid approach, we first enumerate species and reactions using [17], then preprocess the fuel species to obtain the implementation CRN of Figure 9, and finally run our formal basis enumerator on it treating Ai ’s, Xi ’s, and Wi ’s as formal species. It verifies that 29 a) i4 G T X i14 i13 W b) T G X W i19 A A B C c) unimolecular reaction 2 G C 3 condensed reaction A T t 2 D D i7 bimolecular reaction B i4 3 B W i19 X Figure 7: An example DNA system enumerated using detailed and condensed semantics. a) Detailed semantics enumeration. b) Condensed semantics enumeration. c) Key species shown in detail (adapted from Figure 4 of [17]). 30 12 1 2 3 13 1 A 2 3 A 2 34 5 10 6 4 11 4 12 1 5 6 11 4 X 14 4 5 6 6 X 15 4 5 X 6 2 5 6* 10* 4* g1 g1h 6 11 4 5 6 12 1 2 3 10 4 3 13 1 14 4 15 5 6* 10* 4* 12*1* 11*4* g2 X 5 34 10 4 1* 2* 3*4* 5* 6* 10 4 2 6 11 4 5 6 10 4 5 6 6* 10* 4* 11*4* g3 g4 4 13 1 1* 2* 3* 3* 13* 1* g5 g6 2 3 14 4 14*4* 5 6 15 4 15*4* 5 6 13 1 3* 13* 1* 2 3 14 4 5 6 14*4* g7 Figure 8: An optimized implementation of target CRN {A+X → X +X +A, A+X → X +X, A+X → X, A → A + X + X, A → A + X}. (Left) All species of A and X with distinct history domains. (Right) All fuel species of the optimized implementation. the implementation CRN is tidy and regular and returns the formal basis shown in Figure 9. While the formal basis turns out to be very large because of the existence of multiple history domains, it is easily shown to be weak bisimulation equivalent to the target CRN under the obvious interpretation m(Ai ) = ⦃A⦄, m(Xi ) = ⦃X⦄, m(Wi ) = ∅. Therefore the given target CRN and implementation CRN are equivalent according to the compositional hybrid approach. We remark that even though this implementation CRN contained 25 species and 19 reactions, the basis enumeration algorithm took less than one second to finish on an off-the-shelf laptop computer. This performance is perhaps surprising considering that the algorithm is based on brute-force enumeration, and it suggests that despite the adverse worst-case time complexity, the algorithm may still be practical for many instances that arise in practice. In fact, when we made full use of the optimization techniques outlined in Sections 3.4.2 and 4.6, the algorithm terminated on almost all of our test instances in less than ten seconds. The performance was particularly strong for implementations that had monomolecular substructure. For example, the translation scheme from [36] applied on a target CRN consisting of 20 reactions produces an implementation CRN consisting of 394 reactions and 387 species. However, since this implementation CRN is modular and has monomolecular substructure, our verifying algorithm was able to successfully verify it in mere 4 seconds. On the other hand, we report that the algorithm failed to terminate in an hour on some instances that did not have monomolecular substructure. Example #4 In our fourth example, we illustrate why pathway decomposition may not suffice for the verification of the condensation procedure in [17] and how the compositional hybrid approach can be used to remedy this problem. This example is almost identical to the system in Example #2, except that we remove species X and W from the system and add a different species Y , which is merely the DNA strand consisting of a single domain ‘a’. Since there are many species in this system that have an unhybridized a* domain (e.g. G, i4, A, i7, and D), molecule Y can react with those species to form various other species, thus giving rise to a reaction network that is much more complex than in Figure 7. Most importantly, we note that molecule i7 can also bind with Y to form a species which we shall call V . Since i7 is identified with D in condensed semantics, this reaction will appear as D + Y → V in the condensed CRN. However, if we try to run pathway decomposition on the detailed CRN treating as formal species only those species that appear in the condensed CRN, we will find that the prime pathway G+T → i13, i13 → i19, i19 → C +i7, i7+Y → V is irregular and thus pathway decomposition does not apply to this system (see Figure 10). The problem 31 A1 → A1 A2 → A2 A1 → i1 i1 → A1 A2 → i2 i2 → A2 i1 + X1 → j + W3 i1 + X2 → j + W4 i1 + X3 → j + W5 i1 + X4 → j + W6 i2 + X1 → j + W7 i2 + X2 → j + W8 i2 + X3 → j + W9 i2 + X4 → j + W10 j → X3 + W11 j → X3 + X4 + W12 j → A2 + X3 + X4 + W13 A1 → k + W 1 A2 → k + W 2 k → A1 + X1 + X2 + W14 k → A1 + X1 + W15 Implementation CRN A1 + X1 → X3 + W11 + W3 A1 + X2 → X3 + W11 + W4 A1 + X3 → X3 + W11 + W5 A1 + X4 → X3 + W11 + W6 A2 + X1 → X3 + W11 + W7 A2 + X2 → X3 + W11 + W8 A2 + X3 → X3 + W11 + W9 A2 + X4 → X3 + W11 + W10 A1 + X1 → X3 + X4 + W12 + W3 A1 + X2 → X3 + X4 + W12 + W4 A1 + X3 → X3 + X4 + W12 + W5 A1 + X4 → X3 + X4 + W12 + W6 A2 + X1 → X3 + X4 + W12 + W7 A2 + X2 → X3 + X4 + W12 + W8 A2 + X3 → X3 + X4 + W12 + W9 A2 + X4 → X3 + X4 + W12 + W10 A1 + X1 → A2 + X3 + X4 + W13 + W3 A1 + X2 → A2 + X3 + X4 + W13 + W4 A1 + X3 → A2 + X3 + X4 + W13 + W5 A1 + X4 → A2 + X3 + X4 + W13 + W6 A2 + X1 → A2 + X3 + X4 + W13 + W7 A2 + X2 → A2 + X3 + X4 + W13 + W8 A→A A+X →X A2 + X3 → A2 + X3 + X4 + W13 + W9 A2 + X4 → A2 + X3 + X4 + W13 + W10 A+X →X +X A1 → A1 + X1 + X2 + W14 + W1 A+X →A+X +X A1 → A1 + X1 + W15 + W1 A→A+X +X A2 → A1 + X1 + X2 + W14 + W2 A→A+X A2 → A1 + X1 + W15 + W2 After applying the interpretation Formal basis Figure 9: Applying the compositional hybrid approach to Example #3. 32 A T A C ?→A ?→B ?→B B+A→C C +B →D D→? B B C D C T C Y Y i14 i19 i13 i4 D (a) i7 V G D G D V (b) Figure 10: Conceptual issues for pathways involving resting sets with multiple interconvertible species. Species are illustrated as dots, while resting sets are indicated by circles encoding the interconvertible species. Although unimolecular reactions between the species within a given resting set form a strongly connected graph, for clarity they are not explicitly shown. (a) A graph of the resting sets and potential reaction pathways for the adjacent implementation CRN. Reaction pathways do not necessarily involve formal species, but can instead utilize equivalent species from the same resting set. (b) A subgraph of the resting sets and reaction pathways for the CRN of Example #4 that illustrates the pathway G + T → i13, i13 → i19, i19 → C + i7, i7 + Y → V . here is that species i7 should have been considered a formal species because it is identified with D, even though its name does not appear in the condensed CRN. Hence, in order to apply pathway decomposition properly, we would need a way to inform the theory that i7 is also a copy of the species D. We note that this problem is very similar to the problem of multiple history domains that we discussed in Example #3. Just as A1 and A2 had both to be considered an implementation of A, in this example we need to ensure that both D and i7 are considered an implementation of D. Thus, we can apply the compositional hybrid approach to such systems by first running pathway decomposition on the detailed CRN, treating as formal species all species from the condensed CRN and any other species that are identified with those species within resting sets, and then verifying that the resulting formal basis is weak bisimulation equivalent to the condensed CRN. In our example, this would correspond to treating species like i4 and i7 as formal species, and then using the interpretation m(G) = m(i4) = ⦃G⦄, m(D) = m(i7) = ⦃D⦄ in the bisimulation step of the compositional hybrid approach. All of this information, i.e. which species should be considered formal and what interpretation should be used, is provided to our verifier software by the reaction enumerator of [17]. This way, the irregular pathway from the previous paragraph would no longer be prime, because it can now be decomposed into G + T → i13, i13 → i19, i19 → C + i7 and i7 + Y → V . The full result of a compositional hybrid approach verification of this example is shown in Figure 11, where we can easily check that the formal basis of the detailed CRN is weak bisimulation equivalent to the condensed CRN under the interpretation m. Like Example #3, we note that this is an example of a DNA system that neither pathway decomposition nor bisimulation can verify, but the compositional hybrid approach can. 33 i13 i14 A+Y →Z i13 i19 D → i7 i14 → A + B D + Y → i41 i38 i40 i7 → D i38 i46 i7 + Y → V i40 → B + Z G → i4 i46 → B + Z G+T →A+B i46 → C + V G + T → C + i7 i19 → A + B G+Y →U i19 → C + i7 i4 → G A+Y →Z i4 + T → A + B D i4 + T → C + i7 i7 D + Y → i41 i4 + Y → i42 i7 + Y → V T +U →B+Z G T +U →C +V i4 G + T → i13 T + i42 → B + Z G+Y →U T + i42 → C + V i4 + T → i14 U → i42 i4 + Y → i42 i42 → U T + U → i38 i41 → V T + i42 → i40 U i42 V i41 V → i41 Formal basis Implementation CRN A+Y →Z D+Y →V m(A) = ⦃A⦄, m(B) = ⦃B⦄, G+T →A+B m(C) = ⦃C⦄, m(D) = m(i7) = ⦃D⦄, G+T →C +D m(G) = m(i4) = ⦃G⦄, m(T ) = ⦃T ⦄, G+Y →U m(i42) = m(U ) = ⦃U ⦄, m(Y ) = ⦃Y ⦄, T +U →B+Z m(i41) = m(V ) = ⦃V ⦄, m(Z) = ⦃Z⦄ T +U →C +V Bisimulation interpretation m Condensed CRN Figure 11: Applying the compositional hybrid approach to Example #4. 34 Example #5 For the final example, we investigate the following CRN as an implementation of {A + B → C + D + E}: A i+j i+B k+l k→C l m+n m→D j+n→E Unlike the previous examples, this CRN was not constructed by a direct application of a published CRN implementation scheme, although it was inspired by the reaction network given rise to by the “garbage collection” module of [5]. Nonetheless, this system is very interesting because it distinguishes pathway decomposition from bisimulation [12, 22] or serializability [25] without making use of the delayed choice phenomenon. Therefore it suggests that delayed choice may in fact be just one example of many interesting behaviors that are allowed by pathway decomposition but not by other approaches. First, we observe that this implementation would be deemed “incorrect” by bisimulation or serializability. To see this for bisimulation, we simply note that the interpretation of k must be C because of reaction k → C. However, this would result in k + l → i + B being interpreted as some reaction that consumes at least one C and produces at least one B, which means that this CRN cannot be a correct implementation of {A + B → C + D + E} according to bisimulation. To see it for serializability, we note that, roughly translated into our language, serializability requires every prime pathway in a module to have a well-defined turning point reaction and moreover visit the same set of states prior to the turning point reaction. In this example, the turning point reaction of a prime pathway would be defined as the first irreversible reaction that occurs in the pathway, e.g. reaction k → C in pathway (A → i + j, i + B → k + l, k → C, l → m + n, m → D, j + n → E) and reaction j + n → E in pathway (A → i + j, i + B → k + l, l → m + n, j + n → E, k → C, m → D).4 Noting that these two pathways do not visit the same set of states prior to the respective turning point reactions, we conclude that this implementation cannot be handled by serializability. However, we do remark that there could be a relaxed version of serializability which can handle this example. In contrast to the above two approaches, pathway decomposition does not have any difficulty with this example. Not only does it allow prime pathways implementing the same reaction to have different choices of turning point reactions, but it also allows them to go through different sets of states as long as each of those prime pathways is regular. In fact, our basis enumeration algorithm easily finds the formal basis of the given implementation CRN to be {A → A, A + B → A + B, A + B → C + D + E}, proving that it is a correct implementation of {A + B → C + D + E} according to pathway decomposition. 7 Conclusions The development of pathway decomposition theory was motivated by a desire for a general notion of CRN behavioral equivalence, up to ignoring rate constants and implementation intermediates. An overarching challenge is that, despite the set of species and set of reactions both being finite, the set of possible initial states may be infinite, the set of system states reachable from a given initial state may be infinite, and the set of possible pathways from a given initial state may be infinite – yet we desire a guarantee that the available 4 Lakin et al.’s definition of a turning point (which they call a “commit reaction”) is slightly different from our definition. For detail, refer to [25]. 35 behaviors within two CRNs are essentially identical, and we desire that this guarantee may be found (or refuted) algorithmically in all cases. These factors eliminate many standard approaches – such as those that only handle finite state spaces – from consideration. How well does the pathway decomposition approach meet these goals? The central concepts of pathway decomposition are quite general, allowing application of the theory to a wide range of CRNs, but some important limitations are imposed. First, species must be divided into formal species and intermediate species, and we are only concerned with “formal” pathways of reactions that start with purely formal states and end in purely formal states. (I.e. our theory does not concern itself with what may or may not happen when you start the CRN with intermediate species; they occur only in the middle of formal pathways.) The basic idea is that any such formal pathway can be decomposed (perhaps not uniquely) into interleaved sub-pathways until non-decomposable (“prime”) pathways are reached. The set of all such prime pathways defines the formal basis for the CRN – the corresponding set of initial and final states for the set of prime pathways – and two CRNs with the same formal basis are deemed equivalent. The consequence is that the sets of formal pathways in the two CRNs can be put in correspondence with each other by decomposing into prime pathways and replacing each prime pathway by its formal basis reaction. In this sense, anything that one CRN can do, can also be done by the other. However, pathway decomposition theory applies only to CRNs that are tidy (any state reached from a formal state can clean up all intermediate species and return to a formal state) and regular (every prime pathway consists of a consumptive phase followed by a productive phase, separated by a turning point reaction). The choices implicit in the formulation of pathway decomposition allow for a general and elegant theory. A primary feature is that other than regularity, there are no structural constraints on what goes on inside the prime pathways. This provides the potential for intermediates within a pathway to perform a non-trivial (deterministic or non-deterministic) computation. In particular, intermediates can be shared between prime pathways, and intermediates may not “know” which pathway they are on – a phenomenon we call “delayed choice”. This is substantially less restrictive than other related methods for CRN implementation verification [12, 22, 25]. On the other hand, in the case that a CRN can be divided into two parts with distinct intermediates, a modularity property holds such that the formal bases of the two parts can be considered independently (as in a previous method [25]). This greatly facilitates algorithmic verification of CRN implementations. Finally, because the formal basis of an implementation CRN is unique (up to choice of which species are considered formal and which are intermediates), a given implementation CRN cannot be considered a correct implementation of two distinct formal CRNs – a natural property that, again, does not hold for some related methods [12, 22]. On the other hand, the elegance and generality of pathway decomposition theory come at a cost. Because the core theory only addresses tidy CRNs, fuel and waste species must be removed by pre-processing outside the core pathway decomposition theory. Because fuels are presumed to be held at constant concentrations, they can be eliminated from the CRN representation with a change of rate constants and absolutely no effect on the dynamics. However, implementation species considered “waste” are often not entirely inert, but rather their interactions with the system are such that their presence or absence does not affect the possible formal pathways – for example, they might interact only with other “waste” species. Further, because the core theory requires a one-to-one correspondence between formal species and selected representative species in the implementation, the core theory is insufficient for implementation schemes where a formal species may be represented by molecules with variable regions, such as the “history domains” of Soloveichik et al [36]. To accommodate these concerns, we developed a compositional hybrid theory, which allows pathway decomposition to be first applied to the implementation CRN with all waste species and all representations of formal species being designated as “formal”, after which bisimulation [12, 22] is applied to the resulting formal basis to establish correctness with respect to the original formal CRN. For both the core theory and the compositional hybrid theory, “correctness” of an implementation provides guarantees that every pathway in the formal CRN can occur in the implementation and vice versa, under an appropriate interpretation of 36 implementation pathways. The compositional hybrid theory is conceptually sufficient for verifying – or finding errors in – CRNs implemented according to most published translation schemes5 . However, the algorithmic challenges of finding the formal basis for pathway decomposition theory, and of finding the interpretation function for bisimulation theory, are substantial: the verification of correctness pertains to all possible initial states of the CRNs (which are infinite in number) and all possible pathways from these states (also infinite). To meet this challenge, we developed the notion of “signatures” for partial pathways, proving that they are bounded in number for implementations for which the prime pathways have bounded width, and thus proving that at least in this case our algorithm is guaranteed to terminate, even if there are an infinite number of distinct prime pathways. Although the worst-case complexity of our algorithm is unknown, in practice implemented CRNs have a modularity property that is easily recognized and exploited, often allowing verification to complete in a matter of seconds for systems of the scale that is currently experimentally feasible6 . Although verifying CRN bisimulation equivalence in the general case is PSPACE-complete [22], the bisimulation test implemented for the compositional hybrid theory in Nuskell is a restricted case, and in practice this has not proven to be the limiting step for difficult verification cases. During the course of our investigations, we encountered a number of CRN implementations that intuitively seem correct, but which are not accepted by our theory, pointing to the need for a yet more general notion of correctness. We give four examples here. The first was previously mentioned: our notions of regularity and turning points, which appear necessary for correctly implementing irreversible reactions, preclude the use of physically reversible implementations of logically reversible reactions, such as {A+B i, i j, j C +D}. Such implementations appear in [31] and can reduce energy consumption and reduce implementation complexity exponentially [37, 9]. Interestingly, the serializability approach to verification [25] shares this restriction, but the bisimulation approach [12, 22] easily accommodates physically reversible implementations. Technically speaking, the compositional hybrid theory, which generalizes both pathway decomposition and bisimulation, can handle the above example, but it is only by “abusing” the theory by setting all species to be “formal” for its pathway decomposition step. As a second example, one might have a reaction implementation where a “waste” species is produced prior to the turning point, e.g., {A → i + W, i → A, B + i → C}. The compositional hybrid theory will not accept this implementation because in the initial pathway decomposition step, where waste W is temporarily considered “formal”, the prime pathway (A → i + W, B + i → C) is not a regular implementation of A + B → C + W because W is produced prior to the arrival of B. Although this type of situation does not commonly arise in DNA strand displacement systems, it could be ameliorated by simply eliminating waste species (as defined in Definition 32) from the implementation CRN prior to verification. A more general solution would be to propose an “integrated hybrid theory” where regularity is tested only after the bisimulation interpretation has been applied; however, this complicates attempts to prove a theorem relating formal and implementation pathways analogous to Theorem 5.2. The third example concerns situations where formal species interact in non-meaningful ways, resulting in pathways that have no net effect. As an illustration, in the implementation {A i, i + B → C, i + D j}, the pathway (A → i, i + D → j, j → D + i, i + B → C) is a prime pathway taking A + B + D to D + C, but it is not regular. Pathways like (i + D → j, j → i + D), which end where they begin and which never produce a net formal species that wasn’t previously consumed, could be called futile loops; they would arise, for example, when the implementation model explicitly accounts for fleeting binding between molecules that results in no transformation. In some published CRN-to-DNA 5 We have applied pathway decomposition to translation schemes from [36, 5, 6, 31, 8, 25], verifying implementations using many schemes, revealing errors and suggesting fixes for some schemes, identifying concerns such a potential leak pathways in other schemes, and encountering limitations of the theory for still other cases. These investigations will be reported in more detail elsewhere; some general observations are mentioned below. 6 For example, a system of ten up-to-bimolecular reactions compiles, according to the translation scheme in [36], into a implementation with 185 species and 150 reactions and verifies in about ten seconds on a 2013 MacBook Pro. 37 translation schemes, especially those that involve variable “history” domains and multiple reversible steps prior to the turning point (e.g. [5], and [36] generalized to trimolecular reactions), the involvement of futile loops can result in irregular prime pathways that interlink multiple history-distinct versions of the same signal, such as (A → i, i + B1 → j1 , j1 → B1 + i, i + B2 → j2 , j2 → C). Interestingly, the integrated hybrid theory could also address this particular problem, if it could be rigorously justified. Alternatively, it would be desirable to allow decomposition by removing such futile loops (in which case the above pathway would be considered to implement A + B → C, a sensible result) but unfortunately modifying our definitions to allow this leads to additional complexities for the notion of a “signature”, and we have not been able to generalize our algorithm while retaining a proof that it is guaranteed to terminate. The fourth example highlights a situation where our algorithm’s combinatorial explosion makes verification infeasible. Specifically, most cases where verification is fast and scalable involve translation schemes that result in implementations that are modular and have monomolecular substructure, as per Sections 3.4.2 and 4.6. However, the “garbage collection” stages in the translation schemes of [5] do not have monomolecular substructure, and our algorithms are capable of verifying only the simplest instances. Interestingly, if the garbage collection stages are removed or key garbage collection species are held at constant concentrations as fuel, then monomolecular substructure is restored and verification proceeds apace. In summary, there is room for a deeper understanding of the notion of logical correctness for CRN implementations, and of the relative capabilities of different existing theories, such as composition and modularity properties. Even in their present form, existing theories and algorithms for establishing the correctness of CRN implementations can play an important role in the development of rigorous compilers for molecular programming. We envision that future compilers for molecular programming will conform to the standards established in electrical and computer engineering: complexity is managed using an abstraction hierarchy that allows a program specification in a high-level language (such as Verilog) to be translated through a series of intermediate-level languages to a physically implementable low-level language (such as transistorlevel netlists). Furthermore, the language at each level of the hierarchy has well-defined semantics (the mathematical model describing the behavior of the program) and most importantly, formal proofs can establish that the compiler’s transformation from a higher-level language to a lower-level language preserves the essential behavioral invariants [26, 32]. For molecular programming with dynamic DNA nanotechnology, formal CRNs could serve as a higher-level language, while domain-level DNA strand displacement models could serve as a lower-level language – the semantics of which provide the implementation CRN. Note that in contrast to traditional compilers that (ideally) may be proved to be correct for all source programs, our pathway decomposition theory and algorithms are best suited for evaluating the correctness on a case-bycase basis. While proving the general correctness of a CRN-to-DNA translation scheme would obviate the need for time-consuming verification algorithms to be run, the advantages of case-by-case verification are (1) when new translation schemes are proposed, they may immediately be used with confidence prior to establishing what may be a difficult general-case proof; (2) when a new low-level semantics is considered (e.g. either more or less detail in the molecular model), again there is no need to attempt a new proof for the general case; (3) in cases where a translation scheme is in fact not correct in the general case, it may still be used with confidence for CRNs that it does implement correctly; and (4) since it is highly desirable to make experimental systems as simple as possible, formal verification can be used to establish or refute the correctness of arbitrary attempts to optimize and simplify the DNA-level design. These ideas have been implemented in the verifying compiler, Nuskell, which has already been used to catch bugs in several translation schemes [35]. Although the task of building an abstraction hierarchy for molecular programming with dynamic DNA nanotechnology seems particularly tractable, in principle the same formalism could be used to establish the correctness of other types of molecular and biochemical systems. For example, systems of protein enzymes and nucleic acid substrates have been used to construct cell-free biochemical circuits [23, 30]; given a specification for the desired behavior as a formal CRN together with a CRN describing the actual implementation 38 details, one could use pathway decomposition theory to examine its logical correctness. Similarly, pathway decomposition could provide an alternative perspective on the validity of descriptions at multiple levels of details for biological networks studied in systems biology, or as an evaluation of coarse-graining and model reduction techniques [1]. However, there are several limitations to pathway decomposition theory for these purposes. First, in many such cases rate constants are important, but pathway decomposition theory does not consider them. Related, in many cases approximate implementations are sufficient – for example, if non-conforming pathways occur very rarely in the discrete stochastic (Gillespie) dynamics for the CRN, or if non-conforming pathways “average out” in the continuous deterministic (ordinary differential equation) dynamics [38, 39, 7]. Finally, for some purposes the target behavior that the implementation aims to achieve is not best described as a CRN, but rather by some other specification language such as temporal logic. Many of these issues are explored in the literature on Petri nets [19]. However, a more fundamental concern is that CRNs are not an efficient representation for describing combinatorial processes in biology, for which more effective models have been developed [16, 10] and analyzed [2]. It is reasonable to presume that such models could in the future provide a programming language for more sophisticated molecular machines. Nonetheless, the notion of logical correctness of CRN implementations that is provided by pathway decomposition theory has already proved its effectiveness for catching logical errors in CRN-to-DNA translation schemes and appears to be particularly suitable for incorporation into automated verifying compilers for molecular programming. Acknowledgments We appreciate helpful discussions with John Baez, Luca Cardelli, Vincent Danos, Qing Dong, Robert Johnson, Stefan Badelt, and Matthew Lakin. S.W.S. was supported by California Institute of Technology’s Summer Undergraduate Research Fellowship 2009, NSF grant CCF-0832824, ARO Grant W911NF-09-10440 and NSF Grant CCF-0905626. C.T. was supported by NSF grants CCF-1213127, SHF-1718938, and a Banting Fellowship. E.W. was supported by NSF grants CCF-0832824, CCF-1213127, and CCF-1317694. References [1] Jörg Ackermann, Jens Einloft, Joachim Nöthen, and Ina Koch. Reduction techniques for network validation in systems biology. Journal of Theoretical Biology, 315:71–80, 2012. [2] Nicolas Behr, Vincent Danos, and Ilias Garnier. Stochastic mechanics of graph rewriting. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, pages 46–55. ACM, 2016. [3] Robert Brayton and Alan Mishchenko. ABC: An academic industrial-strength verification tool. In Computer Aided Verification, pages 24–40. Springer, 2010. [4] Peter Buchholz. Bisimulation relations for weighted automata. Theoretical Computer Science, 393:109–123, 2008. [5] Luca Cardelli. Strand algebras for DNA computing. Natural Computing, 10:407–428, 2011. [6] Luca Cardelli. Two-domain DNA strand displacement. Mathematical Structures in Computer Science, 23:247–271, 2013. [7] Luca Cardelli. Morphisms of reaction networks that couple structure to function. BMC Systems Biology, 8:84, 2014. [8] Yuan-Jyue Chen, Neil Dalchau, Niranjan Srinivas, Andrew Phillips, Luca Cardelli, David Soloveichik, and Georg Seelig. Programmable chemical controllers made from DNA. Nature nanotechnology, 8:755–762, 2013. 39 [9] Anne Condon, Alan J Hu, Ján Maňuch, and Chris Thachuk. Less haste, less waste: on recycling and its limits in strand displacement systems. Interface Focus, 2:512–521, 2012. [10] Vincent Danos, Jérôme Feret, Walter Fontana, Russell Harmer, and Jean Krivine. Rule-based modelling of cellular signalling. In Luı́s Caires and Vasco T. Vasconcelos, editors, International Conference on Concurrency Theory (CONCUR 2007), volume 4703 of Lecture Notes in Computer Science, pages 17–41. Springer, 2007. [11] Vincent Danos and Jean Krivine. Transactions in RCCS. In In Proc. of CONCUR, LNCS 3653, pages 398–412. Springer, 2005. [12] Qing Dong. A bisimulation approach to verification of molecular implementations of formal chemical reaction networks. Master’s thesis, Stony Brook University, 2012. [13] Shawn M. Douglas, Ido Bachelet, and George M. Church. A logic-gated nanorobot for targeted transport of molecular payloads. Science, 335:831–834, 2012. [14] Jonathan P. K. Doye, Thomas E. Ouldridge, Ard A. Louis, Flavio Romano, Petr Šulc, Christian Matek, Benedict E. K. Snodin, Lorenzo Rovigatti, John S. Schreck, Ryan M. Harrison, and William P. J. Smith. Coarse-graining DNA for simulations of DNA nanotechnology. Physical Chemistry Chemical Physics, 15:20395–20414, 2013. [15] Javier Esparza and Mogens Nielsen. Decidability issues for Petri nets. Petri Nets Newsletter, 94:5–23, 1994. [16] James R. Faeder, Michael L. Blinov, and William S. Hlavacek. Rule-based modeling of biochemical systems with BioNetGen. Methods in Molecular Biology, 500:113–67, 2009. [17] Casey Grun, Karthik Sarma, Brian Wolfe, Seung Woo Shin, and Erik Winfree. A domain-level DNA strand displacement reaction enumerator allowing arbitrary non-pseudoknotted secondary structures. arXiv preprint arXiv:1505.03738, 2015. Originally appeared in Verification of Engineered Molecular Devices and Programs (VEMDP) 2014. [18] Hongzhou Gu, Jie Chao, Shou-Jun Xiao, and Nadrian C Seeman. A proximity-based programmable DNA nanoscale assembly line. Nature, 465:202–205, 2010. [19] Monika Heiner, David Gilbert, and Robin Donaldson. Petri nets for systems and synthetic biology. Lecture Notes in Computer Science, 5016:215–264, 2008. [20] Gerard J Holzmann. The model checker SPIN. IEEE Transactions on Software Engineering, 23:279– 295, 1997. [21] Petr Jančar, Javier Esparza, and Faron Moller. Petri nets and regular processes. Journal of Computer and System Sciences, 59:476–503, 1999. [22] Robert F. Johnson, Qing Dong, and Erik Winfree. Verifying chemical reaction network implementations: A bisimulation approach. In Yannick Rondelez and Damien Woods, editors, DNA Computing and Molecular Programming, volume 9818 of Lecture Notes in Computer Science (LNCS), pages 114–134. Springer, 2016. [23] Jongmin Kim, Kristin S. White, and Erik Winfree. Construction of an in vitro bistable circuit from synthetic transcriptional switches. Molecular Systems Biology, 2:68, 2006. [24] Matthew R. Lakin and Andrew Phillips. Visual DSD. Microsoft Research. [25] Matthew R. Lakin, Darko Stefanovic, and Andrew Phillips. Modular verification of chemical reaction network encodings via serializability analysis. Theoretical Computer Science, 632:21–42, 2016. [26] Xavier Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52:107–115, 2009. 40 [27] Richard Lipton. The reachability problem requires exponential space. Research Report 62, Department of Computer Science, Yale University, New Haven, Connecticut, 1976. [28] Ernst Mayr. Persistence of vector replacement systems is decidable. Acta Informatica, 15:309–318, 1981. [29] Robin Milner. Communication and Concurrency. Prentice Hall, 1989. [30] Kevin Montagne, Raphael Plasson, Yasuyuki Sakai, Teruo Fujii, and Yannick Rondelez. Programming an in vitro DNA oscillator using a molecular networking strategy. Molecular Systems Biology, 7:466, 2011. [31] Lulu Qian, David Soloveichik, and Erik Winfree. Efficient Turing-universal computation with DNA polymers. In Yasubumi Sakakibara and Yongli Mi, editors, DNA Computing and Molecular Programming, volume 6518 of Lecture Notes in Computer Science (LNCS), pages 123–140, 2011. [32] Xavier Rival. Symbolic transfer function-based approaches to certified compilation. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’04, pages 1–13, New York, NY, USA, 2004. ACM. [33] Joseph Schaeffer. Stochastic Simulation of the Kinetics of Multiple Interacting Nucleic Acid Strands. PhD thesis, California Institute of Technology, 2013. [34] Philippe Schnoebelen and Natalia Sidorova. Bisimulation and the reduction of Petri nets. Lecture Notes in Computer Science, 1825:409–423, 2000. [35] Seung Woo Shin. Compiling and verifying DNA-based chemical reaction network implementations. Master’s thesis, California Institute of Technology, 2011. [36] David Soloveichik, Georg Seelig, and Erik Winfree. DNA as a universal substrate for chemical kinetics. Proceedings of the National Academy of Sciences, 107:5393–5398, 2010. [37] Chris Thachuk and Anne Condon. Space and energy efficient computation with DNA strand displacement systems. In Darko Stefanovic and Andrew Turberfield, editors, DNA Computing and Molecular Programming, volume 7433 of Lecture Notes in Computer Science (LNCS), pages 135–149. Springer, 2012. [38] David Thorsley and Eric Klavins. Model reduction of stochastic processes using Wasserstein pseudometrics. In American Control Conference, pages 1374–1381, 2008. [39] David Thorsley and Eric Klavins. Approximating stochastic biochemical processes with Wasserstein pseudometrics. IET Systems Biology, 4:193–211, 2010. 41
5cs.CE
Submitted to the Annals of Statistics DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION arXiv:1607.00673v2 [math.ST] 7 Apr 2018 By Marianna Pensky∗ University of Central Florida In the present paper we consider a dynamic stochastic network model. The objective is estimation of the tensor of connection probabilities Λ when it is generated by a Dynamic Stochastic Block Model (DSBM) or a dynamic graphon. In particular, in the context of the b of Λ and DSBM, we derive a penalized least squares estimator Λ b show that Λ satisfies an oracle inequality and also attains minimax lower bounds for the risk. We extend those results to estimation of Λ when it is generated by a dynamic graphon function. The estimators constructed in the paper are adaptive to the unknown number of blocks in the context of the DSBM or to the smoothness of the graphon function. The technique relies on the vectorization of the model and leads to much simpler mathematical arguments than the ones used previously in the stationary set up. In addition, all results in the paper are non-asymptotic and allow a variety of extensions. 1. Introduction. Networks arise in many areas of research such as sociology, biology, genetics, ecology, information technology to list a few. An overview of statistical modeling of random graphs can be found in, e.g., Kolaczyk (2009) and Goldenberg et al. (2011). While static network models are relatively well understood, the literature on the dynamic network models is fairly recent. In this paper, we consider a dynamic network defined as an undirected graph with n nodes with connection probabilities changing in time. Assume that we observe the values of a tensor Bi,j,l ∈ {0, 1} at times tl where 0 < t1 < · · · < tL = T . For simplicity, we assume that time instants are equispaced and the time interval is scaled to one, i.e. tl = l/L. Here Bi,j,l = 1 if a connection between nodes i and j is observed at time tl and Bi,j,l = 0 otherwise. We set Bi,i,l = 0 and Bi,j,l = Bj,i,l for any i, j = 1, · · · n and l = 1, · · · , L, and assume that Bi,j,l are independent Bernoulli random variables with Λi,j,l = P(Bi,j,l = 1) and Λi,i,l = 0. Below, we study two ∗ Supported in part by National Science Foundation (NSF), grants DMS-1407475 and DMS-1712977 MSC 2010 subject classifications: Primary 60G05; secondary 05C80, 62F35 Keywords and phrases: dynamic network, graphon, stochastic block model, nonparametric regression, minimax rate 1 2 M. PENSKY types of objects: a Dynamic Stochastic Block Model (DSBM) and a dynamic graphon. The DSBM can be viewed as a natural extension of the Stochastic Block Model (SBM) which, according to Olhede and Wolfe (2014), provides an universal tool for description of time-independent stochastic network data. In a DSBM, all n nodes are grouped into m classes Ω1 , · · · , Ωm , and probability of a connection Λi,j,l is entirely determined by the groups to which the nodes i and j belong at the moment tl . In particular, if i ∈ Ωk and j ∈ Ωk′ , then Λi,j,l = Gk,k′ ,l . Here, G is the connectivity tensor at time tl (l) with Gk,k′ ,l = Gk′ ,k,l . Denote by nk the number of nodes in class k at the moment tl , k = 1, . . . , m, l = 1, . . . , L. A dynamic graphon can be defined as follows. Let ζ = (ζ1 , · · · , ζn ) be a random vector sampled from a distribution Pζ supported on [0, 1]n . Although the most common choice for Pζ is the i.i.d. uniform distribution for each ζi , we do not make this assumption in the present paper. We further assume that there exists a function f : [0, 1]3 → [0, 1] such that for any t one has f (x, y, t) = f (y, x, t) and (1) Λi,j,l = f (ζi , ζj , tl ), i, j = 1, · · · , n, l = 1, · · · , L. Then, function f summarizes behavior of the network and can be called dynamic graphon, similarly to the graphon in the situation of a stationary network. This formulation allows to study a different set of stochastic network models than the DSBM. It is known that graphons play an important role in the theory of graph limits described in Lovász and Szegedy (2006) and Lovász (2012). The definition of the dynamic graphon above fully agrees with their theory. Indeed, for every l = 1, · · · , L, the limit of Λ∗,∗,l as n → ∞ is f (·, ·, tl ). We shall further elaborate on the notion of the dynamic graphon in Section 7. In the last few years, dynamic network models attracted a great deal of attention (see, e.g., Durante et al. (2015), Durante et al. (2016), Han et al. (2015), Kolar et al. (2010), Leonardi et al. (2016), Matias and Miele (2015), Minhas et al. (2015), Xing et al. (2010), Xu (2015), Xu and Hero III (2014) and Yang et al. (2011) among others). Majority of those paper describe changes in the connection probabilities and group memberships via various kinds of Bayesian or Markov random field models and carry out the inference using the EM or iterative optimization algorithms. While procedures described in those papers show good computational properties, they come without guarantees for the estimation precision. The only paper known to us that is concerned with estimation precision in the dynamic DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 3 setting is by Han et al. (2015) where the authors study consistency of their procedures when n → ∞ or L → ∞. On the other hand, recently, several authors carried out minimax studies in the context of stationary network models. In particular, Gao et al. (2015) developed upper and minimax lower bounds for the risk of estimation of the matrix of connection probabilities. In a subsequent paper, Gao et al. (2016) generalized the results to a somewhat more general problem of estimation of matrices with bi-clustering structures. In addition, Klopp et al. (2017) extended these results to the case when the network is sparse in a sense that probability of connection is uniformly small and tends to zero as n → ∞. Also, Zhang and Zhou (2016) investigated minimax rates of community detection in the two-class stochastic block model. The present paper has several objectives. First, we describe the nonparametric DSBM model that allows for smooth evolution of the tensor G of connection probabilities as well as changes in group memberships in time. Second, we introduce vectorization of the model that enables us to take advantage of well studied methodologies in nonparametric regression estimation. Using these techniques, we derive penalized least squares estimators b of Λ and show that they satisfy oracle inequalities. These inequalities do Λ not require any assumptions on the mechanism that drives evolution of the group memberships of the nodes in time and can be applied under very mild conditions. Furthermore, we consider a particular situation where only at most n0 nodes can change their memberships between two consecutive time points. Under the latter assumption, we derive minimax lower bounds for the risk of an estimator of Λ and confirm that the estimators constructed in the paper attain those lower bounds. Moreover, we extend those results to estimation of the tensor Λ when it is generated by a graphon function. We show that, for the graphon, the estimators are minimax optimal within a logarithmic factor of L. Estimators, constructed in the paper, do not require knowledge of the number of classes m in the context of the DSBM, or a degree of smoothness of the graphon function f if Λ is generated by a dynamic graphon. Note that unlike in Klopp et al. (2016) we do not consider a network that is sparse in a sense that probabilities of connections between classes are uniformly small. However, since our technique is based on model selection, it allows to study a network where some groups do not communicate with each other and obtain more accurate results. Moreover, as we show in Section 6, by adjusting the penalty, one can provide adaptation to uniform sparsity assumption if the number of nodes in each class is large enough. The present paper makes several key contributions. First, to the best of 4 M. PENSKY our knowledge, the time-dependent networks are usually handled via generative models that assume some probabilistic mechanism which governs the evolution of the network in time. The present paper offers the first fully non-parametric model for the time-dependent networks which does not make any of such assumptions. It treats connection probabilities for each group as functional data, allows group membership switching and enables one to exploit stability in the group memberships over time. Second, the paper provides the first minimax study of estimation of the tensor of connection probabilities in a dynamic setting. The estimators constructed in the paper are adaptive to the number of blocks in the context of the DSBM and to the smoothness of the graphon function in the case of a dynamic graphon. Moreover, the approach of the paper is non-asymptotic, so it can be used irrespective of how large the number of nodes n, the number of groups m and the number of time instants L are and what the relationship between these parameters is. Third, in order to handle the tensor-variate functional data, we use vectorization of the model. This technique allows to reduce the problem of estimation of an unknown tensor of connection probabilities to a solution of a functional linear regression problem with sub-gaussian errors. The technique is very potent and is used in a novel way. In particular, it leads to much more simple mathematics than in Gao et al. (2015) and Klopp et al. (2017). In the case of a time-independent SBM, it immediately reduces the SBM to a linear regression setting. In addition, by using the properties of the Kronecker product, we are able to reduce the smoothness assumption on the connection probabilities to sparsity assumption on their coefficients in one of the common orthogonal transforms (e.g., Fourier or wavelet). Fourth, we use the novel structure of the penalty a part of which is proportional to the logarithm of the cardinality of the set of all possible clustering matrices over L time instants. The latter allows to accommodate various group membership switching scenarios and is based on the Packing lemma (Lemma 4) which can be viewed as a version of the VarshamovGilbert lemma for clustering matrices. In particular, while all papers that studied the SBM dealt with the situation where no restrictions are placed on the set of clustering matrices, our approach allows to impose those restrictions. Finally, the methodologies of the paper admit various generalizations. For example, they can be adapted to a situation where the number of nodes in the network depends on time, or the connection probabilities have jump discontinuities, or when some of the groups have no connection with each other. Section 6 shows that the technique can be adapted to an additional uniform sparsity considered in Klopp et al. (2017) if the number of nodes in each class is large enough. DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 5 The rest of the paper is organized as follows. In Section 2, we introduce the notations and describe the vectorization of the model. In Section 3, we b of the tensor Λ. In Secconstruct the penalized least squares estimators Λ tion 4, we derive the oracle inequalities for their risks. In Section 5, we obtain b the minimax lower bounds for the risk that confirm that the estimators Λ are minimax optimal. Section 6 shows how our technique provides adaptation to uniform sparsity assumption studied in Klopp et al. (2017). Section 7 develops the nearly minimax optimal (within a logarithmic factor of L) estimators of Λ when the network is generated by a graphon. Finally, Section 8, provides a discussion of various generalizations of the techniques proposed in the paper. The proofs of all statements are placed into the Supplemental Material. 2. Notation, discussion of the model and data structures. 2.1. Notation. For any two positive sequences {an } and {bn }, an ≍ bn means that there exists a constant C > 0 independent of n such that C −1 an ≤ bn ≤ Can for any n. For any set Ω, denote cardinality of Ω by |Ω|. For any x, [x] is the largest integer no larger than x. For any vector t ∈ Rp , denote its ℓ2 , ℓ1 , ℓ0 and ℓ∞ norms by, respectively, ktk, ktk1 , ktk0 and ktk∞ . Denote by kt1 − t2 kH the Hamming distance between vectors t1 and t2 . Denote by 1 and 0 the vectors that have, respectively, only unit or zero elements. Denote by ej the vector with 1 in the j-th position and all other elements equal to zero. For a matrix A, its i-th row and j-th columns are denoted, respectively, by Ai,∗ and A∗,j . Similarly, for a tensor A ∈ Rn1 ×n2 ×n3 , we denote its lth (n1 × n2 )-dimensional sub-matrix by A∗,∗,l . Let vec(A) be the vector obtained from matrix A by sequentially stacking its columns. Denote by A ⊗ B the Kronecker product of matrices A and B. Also, Ik is the identity matrix of size k. For any subset J of indices, any vector t and any matrix A, denote the restriction of t to indices in J by tJ and the restriction of A to columns A∗,j with j ∈ J by AJ . Also, denote by t(J) the modification of vector t where all elements tj with j ∈ / J are set to zero. For any matrix A, denote its spectral and Frobenius norms by, respectively, kAkop and kAk. Denote kAkH ≡ kvec(A)kH , kAk∞ = kvec(A)k∞ and kAk0 ≡ kvec(A)k0 . For any tensor A ∈ Rn1 ×n2 ×n3 , denote kAk2 = P n3 2 l=1 kA∗,∗,l k . Denote by M(m, n) a collection of membership (or clustering) matrices Z ∈ {0, 1}n×m , i.e. matrices such that Z has exactly one 1 per row and Zik = 1 iff a node i belongs to the class Ωk and is zero otherwise. Denote by 6 M. PENSKY C(m, n, L) a set of clustering matrices such that (2) C(m, n, L) ⊆ L Y l=1 M(m, n). 2.2. Discussion of the model. Note that the values of Bi,j,l are independent given the values of Λi,j,l , that is, Bi,j,l are independent in the sense that their deviations from Λi,j,l are independent from each other. Therefore, the values of Bi,j,l are linked to each other in the same way as observations of a continuous function with independent Gaussian errors are related to each other. Moreover, in majority of papers treating dynamic block models (see, e.g., Durante et al. (2015), Han et al. (2015), Matias and Miele (2017), Yang et al. (2011) among others), similarly to the present paper, the authors assume that observations Bi,j,l are independent given Λi,j,l . Note that this is not an artificial construct: Durante et al. (2015), for example, use the model for studying international relationships between countries over time. The only difference between the present paper and the papers cited above is that we assume that the underlying connection probabilities G∗,∗,l are functionally linked (e.g., smooth) rather than being probabilistically related. Indeed, many papers that treat dynamic block models assume some Bayesian generative mechanism on the values of connection probabilities as well as on evolution of clustering matrices. In particular, they impose some prior distributions that relate G∗,∗,l+1 to G∗,∗,l and Z̃(l+1) to Z̃(l) , the matrices of underlying probabilities and the clustering matrices for consecutive time points. Since the proposed generative mechanism may be invalid, we avoid making assumptions about the probabilistic structures that generate connection probabilities and group memberships, and treat the network as a given object. However, our model enforces, in a sense, a more close but yet flexible relation between the values of Bi,j,l since G∗,∗,l are functionally (and not stochastically) related. Moreover, our theory allows to place any restrictions on the set of clustering matrices. To illustrate this point, consider just one pair of nodes (i, j) and assume that these nodes do not switch their memberships between times tl and tl+1 and also that Gi,j,l is continuous at tl . It is easy to see that if Gi,j,l is close to zero (or one), then Gi,j,l+1 is also close to zero (or one) and, hence, Bi,j,l and Bi,j,l+1 are likely to be equal to zero (or one) simultaneously. This relationship takes place in general. To simplify the narrative, just for this paragraph, denote bl = Bi,j,l , bl+1 = Bi,j,l+1 , gl = Gi,j,l and gl+1 = Gi,j,l+1 . In order we are able to assert conditional probabilities P(Bi,j,l+1 = 1|Bi,j,l = 1) ≡ P(bl+1 = 1|bl = 1) and DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 7 P(Bi,j,l+1 = 0|Bi,j,l = 0) ≡ P(bl+1 = 0|bl = 0), consider the situation where gl and gl+1 are random variables with the joint pdf p(gl , gl+1 ) such that, given gl , on the average gl+1 is equal to gl : E(gl+1 |gl ) = gl . Assume, as it is done in the present paper, that, given gl , values of bl are independent Bernoulli variables, so that b l+1 (1 − gl+1 )1−bl+1 . p(bl , bl+1 |gl , gl+1 ) = glbl (1 − gl )1−bl gl+1 It is straightforward to calculate marginal probabilities P(bl = 1) = E(gl ), P(bl+1 = 1) = E(gl+1 ) = E[E(gl+1 |gl )] = E(gl ) and the joint probability P(bl = 1, bl+1 = 1) = E(gl+1 gl ) = E[E(gl+1 gl |gl )] = E(gl2 ) which yields P(bl+1 = 1|bl = 1) − P(bl+1 = 1) = E(gl2 ) Var(gl ) − E(gl ) = >0 E(gl ) E(gl ) unless Var(gl ) = 0. The latter means that, even in the presence of the assumption of the conditional independence, the probability of interaction at the moment tl+1 is larger if there were an interaction at the moment tl than it would be in the absence of this assumption. Similarly, repeating the calculation with gl and gl+1 replaced by 1 − gl and 1 − gl+1 , obtain P(bl+1 = 0|bl = 0) − P(bl+1 = 0) = Var(gl ) > 0. E(1 − gl ) In the absence of the probabilistic assumptions on gl and gl+1 , we cannot evaluate those conditional probabilities but the relationship persists in this situation as well. 2.3. Vectorization of the model. Note that tensor Λ of connection probabilities has a lot of structure. On one hand, it is easy to check that (3) Λ∗,∗,l = Z̃(l) G∗,∗,l (Z̃(l) )T , Bi,j,l ∼ Bernoulli(Λi,j,l ), where Z̃(l) ∈ M(m, n) is the clustering matrix at the moment tl . On the other hand, for every k1 and k2 , vectors Gk1 ,k2 ,∗ ∈ RL are comprised of values of some smooth functions and, therefore, have low complexity. Usually, efficient representations of such vectors are achieved by applying some orthogonal transform H (e.g., Fourier or wavelet transform), however, we cannot apply this transform to the original data tensor for two reasons. First, the errors in the model are not Gaussian, so application of H will convert the data tensor with independent Bernoulli components into a data tensor with dependent entries that are not Bernoulli variables any more. In addition, application of this transform to the original data will not achieve 8 M. PENSKY our goals since, although vectors Gk1 ,k2 ,∗ represent smooth functions, vectors Λi,j,∗ do not, due to possible switches in the group memberships. In addition, for every l, matrix Λ∗,∗,l in (3) forms the so called bi-clustering structure (see, e.g., Gao et al. (2016)) which makes recovery of G∗,∗,l much harder than in the case of a usual regression model. In order to handle all these intrinsic difficulties, we apply operation of vectorization to Λ∗,∗,l . Denote (4) λ(l) = vec(Λ∗,∗,l ), b(l) = vec(B∗,∗,l ), g(l) = vec(G∗,∗,l ). Then, Theorem 1.2.22(i) of Gupta and Nagar (2000) yields (5) (l) (l) λ(l) = (Z̃(l) ⊗ Z̃(l) )g(l) , bi ∼ Bernoulli(λi ), i = 1, · · · , n2 , l = 1, · · · , L. (l) Note that bi in (5) are independent for different values of l but not i due (l) (l) to the symmetry. In addition, the values of bi and λi that are corresponding to diagonal elements of matrices B∗,∗,l and Λ∗,∗,l , are equal to zero by construction. Since all those values are not useful for estimation, we remove redundant entries from vectors λ(l) and b(l) for every l = 1, · · · , L. Specifically, in (5), we remove the elements in λ(l) and the rows in (Z̃(l) ⊗ Z̃(l) ) (l) (l) corresponding, respectively, to Λi1 ,i2 ,l and (Z̃i1 ,∗ ⊗ Z̃i2 ,∗ ) with i1 ≥ i2 . We denote the reductions of vectors λ(l) , b(l) and matrices (Z̃(l) ⊗ Z̃(l) ) by, respectively, θ (l) , a(l) and C̃(l) obtaining (6) θ(l) = C̃(l) g(l) , (l) (l) ai ∼ Bernoulli(θ i ), i = 1, · · · , n(n − 1)/2, l = 1, · · · , L. (l) (l′ ) Note that unlike in the case of b(l) , elements ai and ai′ are independent whenever i 6= i′ or l 6= l′ . The interesting thing here is that matrices C̃(l) are still clustering matrices, i.e., C̃(l) ∈ M(n(n − 1)/2, m2 ). Indeed, C̃(l) are binary matrices such that, for i corresponding to (i1 , i2 ) with i1 < i2 and k (l) (l) (l) corresponding to (k1 , k2 ) in (Z̃i1 ,k1 ⊗ Z̃i2 ,k2 ) one has C̃i,k = 1 if and only if the nodes i1 ∈ Ωk1 and i2 ∈ Ωk2 . Observe that although we removed the redundant elements from vectors (l) λ and b(l) , we have not done so for the vectors g(l) . Indeed, since matrices G∗,∗,l are symmetric, the elements of vectors g(l) corresponding to Gk1 ,k2 ,l and Gk2 ,k1 ,l with k1 6= k2 are equal to each other. For the sake of eliminating such redundancy (and, hence, the need of tracing the equal elements in the process of estimation), for indices k corresponding to pairs of classes (l) (k1 , k2 ) with k1 > k2 , we remove entries gk from vectors g(l) and denote the resulting vectors by q(l) . In order an equivalent of the relation (6) still holds with vectors q(l) instead of g(l) , we add together columns of matrices DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 9 Fig 1. Vectorization of the probability tensor Λ with n = 4, m = 2, N = n(n−1)/2 = 6, M = m(m + 1)/2 = 3 and L = 3. Left panel, top: transforming Λ∗,∗,l into θ (l) , l = 1, 2, 3. Left panel, middle: Λ∗,∗,1 = Z̃(1) G∗,∗,1 (Z̃(1) )T . Left panel, bottom: θ (1) = C̃(1) g(1) = C(1) q(1) . In the left panel, redundant elements of Λ are white, redundant elements of G are yellow. Right panel: θ = Cq. C̃(l) corresponding to (k1 , k2 ) and (k2 , k1 ) with k1 < k2 , obtaining new matrices C(l) . It is easy to see that, for every l, since C(l) is obtained from C̃(l) by adding columns together and since each row of C̃(l) has exactly one unit element with the rest of them being zeros, C(l) is again a clustering matrix of size [n(n − 1)/2] × [m(m + 1)/2]. In particular, for indices i and k corresponding to nodes (i1 , i2 ) and classes (Ωk1 , Ωk2 ) with i1 < i2 and (l) k1 ≤ k2 , one has Ci,k = 1 if i1 ∈ Ωk1 and i2 ∈ Ωk2 or i1 ∈ Ωk2 and i2 ∈ Ωk1 ; (l) Ci,k = 0 otherwise. The process of vectorization of the model and removing redundancy is presented in Figure 1. Using C(l) and q(l) , one can rewrite equations (6) as (7) a(l) = θ (l) + ξ (l) with θ(l) = C(l) q(l) , l = 1, · · · , L, where C(l) ∈ M(M, N ), θ (l) ∈ RN , q(l) ∈ RM , N = n(n − 1)/2 and M = (l) m(m + 1)/2. Here, for every i and l, components ai of vector a(l) are (l) (l) independent Bernoulli variables with P(ai = 1) = θ i , so that components of vectors ξ (l) are also independent for different values of i or l. If we had the time-independent SBM (L = 1) and the clustering matrix were known, equation (7) would reduce estimation of q(1) to the linear re- 10 M. PENSKY gression problem with independent sub-gaussian (Bernoulli) errors. Since in (l) the case of the DSBM, for each i, the elements gi , l = 1, · · · , L, of vector gi represent the values of a smooth function, we combine vectors in (7) into matrices. Specifically, we consider matrices A, Θ, Ξ ∈ RN ×L and Q ∈ RM ×L with columns a(l) , θ (l) , ξ (l) and q(l) , respectively. Note that if the group memberships of the nodes were constant in time, so that C(l) ∈ {0, 1}N ×M were independent of l, formula (7) would imply (8) A = Θ + Ξ, Θ = ZQ if C(l) = Z, l = 1, · · · , L. However, we consider the situations where nodes can switch group memberships in time and (8) is not true. For this reason, we proceed with further vectorization. We denote a = vec(A), θ = vec(Θ) and q = vec(Q) and observe that vectors a, θ ∈ RN L and q ∈ RM L are obtained by stacking vectors a(l) , θ (l) and q(l) in (7) vertically for l = 1, · · · , L. Define a block diagonal matrix C ∈ {0, 1}N L×M L with blocks C(l) , l = 1, · · · , L, on the diagonal. Then, (7) implies that (9) a=θ+ξ with θ = Cq = C vec(Q), where ai are independent Bernoulli(θ i ) variables, i = 1, · · · , N L. Observe that if the matrix C were known, then equations in (9) would represent a regression model with independent Bernoulli errors. Moreover, (l) T (l) (l) 2 matrix CT C is diagonal since q matrices (C ) C = (S ) , l = 1, · · · , L, (l) (l) (l) are diagonal with Sk1 ,k2 = Nk1 ,k2 , where Nk1 ,k2 is the number of pairs (i1 , i2 ) of nodes such that i1 < i2 and one node is in class Ωk1 while another is in class Ωk2 at time instant tl :  (l) (l)  if k1 6= k2 ;  n k1 n k2 , (l) (10) Nk1 ,k2 =   n(l) (n(l) − 1), if k = k . 1 2 k1 k1 Remark 1. (Directed graph). Similar vectorization algorithm can be used when the dynamic network is constructed from directed graphs or graphs with self loops. In the former case, the only redundant entries of matrices Λ∗,∗,l would be the diagonal ones while, in the latter case, Λ has no redundant elements and no row removal is necessary. Remark 2. (Biclustering structures). Vectorization presented above can significantly simplify the inference in the so called biclustering models considered, for example, by Lee et al. (2010) and Gao et al. (2016). In those DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 11 models, one needs to recover matrix X from observations of matrix Y given by Y = U1 XU2 +Ξ where matrices U1 and U2 are known and matrix Ξ has independent zero-mean Gaussian or sub-gaussian entries. As long as there are no structural assumptions on matrix X (such as, e.g., low rank), one can apply vectorization and reduce the problem to the familiar non-parametric regression problem of the form y = Ux + ξ where matrix U = U1 ⊗ U2 is known, ξ = vec(Ξ) is the vector with independent components and one needs to recover x = vec(X) from observations y = vec(Y). 3. Assumptions and estimation for the DSBM. It is reasonable to assume that the values of the probabilities q(l) of connections do not change dramatically from one time instant to another. Specifically, we assume that (1) (L) for various k = 1, · · · , M , vectors qk = (qk , · · · , qk ) represent values of (l) some smooth functions, so that qk = fk (tl ), l = 1, · · · , L. In order to quantify this phenomenon, we assume that vectors qk have sparse representation in some orthogonal basis H ∈ RL×L with HT H = HHT = IL , so that vector HqTk is sparse: it has only few large coefficients, the rest of the coefficients are small or equal to zero. This is a very common assumption in functional data analysis. For example, if H is the matrix of the Fourier transform and fk belongs to a Sobolev space or H is a matrix of a wavelet transform and fk belongs to a Besov space, the coefficients HqTk of qTk decrease rapidly and, hence, vector HqTk is sparse. In particular, one needs only few elements in vector HqTk to represent qk with high degree of accuracy. The extreme case occurs when the connection probabilities do not change in time, so that vector qk has constant components: then, for the Fourier or a periodic wavelet transform, the vector HqTk has only one non-zero element. Denote D = QHT where matrix Q is defined in the previous section and d = vec(D). Observe that vector d is obtained by stacking together the columns of matrix D = QHT while its transpose DT = HQT has vectors HqTk as its columns. Then, sparsity of the matrix D can be controlled by imposing a complexity penalty on kdk0 = kDk0 = kDT k0 on matrix D. Note that complexity penalty does not require the actual matrix D to have only few non-zero elements, it merely forces the procedure to keep only few large elements in D while setting the rest of the elements to zero and, hence, acts as a kind of hard thresholding. Note that by Theorem 1.2.22 of Gupta and Nagar (2000), one has (11) d = vec(QHT ) = (H ⊗ IM )vec(Q) = (H ⊗ IM )q = Wq, where W = (H ⊗ IM ) is an orthogonal matrix such that WT W = WWT = 12 M. PENSKY IM L . Denote (12) J ≡ JM = {j : dj 6= 0} , dJ C = 0, so that J is the set of indices corresponding to nonzero elements of the vector d. Consider a set of clustering matrices C(m, n, L) satisfying (2). At this point we impose very mild assumption on C(m, n, L): (13) log(|C(m, n, L)|) ≥ 2 log m. Assumption (13) is used just for simplifying expression for the penalty. Indeed, until now, we allowed any collection of clustering matrices, so potentially, we can work with the case where all cluster memberships are fixed in advance (although this would be a totally trivial case). Condition (13) merely means that at least two nodes at some point in time can be assigned arbitrarily to any of m classes. Later, we shall consider some special cases such as fixed membership (no membership switches over time) or limited change (only at most n0 nodes can change their memberships between two consecutive time points). We find m, J, d and C as one of the solutions of the following penalized least squares optimization problem   b C) b d, b = argmin ka − CWT dk2 + Pen(|J|, m) s.t. dJ c = 0 (14) (m, b J, m,J,d,C where C ∈ C(m, n, L), a is defined in (9), d ∈ RM L , W ∈ RM L×M L , M = m(m + 1)/2 and   11 25 m2 L (15) Pen(|J|, m) = 11 log(|C(m, n, L)|) + |J| log . 2 |J| Observe that the penalty in (15) consists of two parts. The first part accounts for the complexity of clustering and, therefore, allows one to obtain an estimator adaptive to the number of unknown groups m as long as the we can express the complexity of clustering in terms of m, n and L. The second term represents the price of estimating |J| elements of vector d and finding those |J| elements in this vector of length m(m + 1)L/2. Note that since minimization is carried out also with respect to m, optimization problem (14) should be solved separately for every m = 1, · · · , n, bM , C b M and JbM . After that, one needs to select the value M c= yielding d m( b m b + 1)/2 that delivers the minimum in (14), so that (16) b=d b c, d M b =C b c, C M Jb = JbM c. DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 13 c = (H ⊗ I c) and calculate Finally, due to (12), we set W M c T d, b b=W q (17) b = Cb b q. θ b into the tensor and taking the symmetries b by packing vector θ We obtain Λ into account. 4. Oracle inequalities for the DSBM. Denote the true value of tensor Λ by Λ∗ . Also, denote by m∗ the true number of groups, by q∗ and θ ∗ the true values of q and θ in (9) and by C∗ the true value of C. Denote by D∗ and d∗ the true values of matrix D and vector d, respectively. Let M ∗ = m∗ (m∗ + 1)/2 and W∗ = (H ⊗ IM ∗ ) be true values of M and W. Note that vector θ ∗ is obtained by vectorizing Λ∗ and then removing the redundant entries. Then, it follows from (9) that (18) a = θ∗ + ξ with θ ∗ = C∗ q∗ = C∗ (W∗ )T d∗ . Due to the relation between the ℓ2 and the Frobenius norms, one has kθ − θ ∗ k2 ≤ kΛ − Λ∗ k2 ≤ 2kθ − θ ∗ k2 , (19) and the following statement holds. Theorem 1. Consider a DSBM with a true matrix of probabilities Λ∗ b obtained according to (14)–(17). Let C(m, n, L) be a and the estimator Λ set of clustering matrices satisfying conditions (2) and (13). Then, for any t > 0, with probability at least 1 − 9e−t , one has (20) b − Λ∗ k 2 kΛ ≤ n2 L min m,J,d C∈C(m,n,L) " # 6 kCWT d(J) − θ∗ k2 38 t 4 Pen(|J|, m) + 2 + 2 2 n L n L n L " # 6 kCWT d(J) − θ∗ k2 4 Pen(|J|, m) 342 , + + 2 n2 L n2 L n L and (21) E b − Λ∗ k 2 kΛ n2 L ! ≤ min m,J,d C∈C(m,n,L) where d(J) is the modification of vector d where all elements dj with j ∈ /J are set to zero. The proof of Theorem 1 is given in the Supplementary Material. Here, we just explain its idea. Note that if the values of m and C are fixed, the problem (14) reduces to a regression problem with a complexity penalty b of d∗ is just a Pen(|J|, m). Moreover, if J is known, the optimal estimator d 14 M. PENSKY projection estimator. Indeed, denote ΥC = CWT and let ΥC,J = (CWT )J b be the reduction of matrix CWT to columns j ∈ J. Given m, b Jb and C, T c c one obtains M = m( b m b + 1)/2, W = (H ⊗ IM c), ΥC,J = (CW )J and T b c b ΥC, b Jb = (CW )Jb. Let b TC, b TC, b b b)−1 Υ b b b(Υ bb b=Υ (22) ΠC,J = ΥC,J (ΥTC,J ΥC,J )−1 ΥTC,J , Π b Jb b JbΥ C,J C,J C,J b b b, respecbe the projection matrices on the column spaces of ΥC,J and Υ C,J b is of the b=Π b b b a and vector d b b bd tively. Then, it is easy to see that Υ C,J form C,J b = (Υ b Tb bΥ b b b)−1 Υ b Tb b a. d C,J C, C,J J (23) b can be obtained as a solution of the following Hence, the values of m, b Jb and C optimization problem   b m, (C, b Jb) = argmin ka − ΠC,J ak2 + Pen(|J|, m) s.t. C ∈ C(m, n, L), m,J,C where ΠC,J and Pen(|J|, m) are defined in (22) and (15), respectively. After that, we use the arguments that are relatively standard in the proofs of oracle inequalities for the penalized least squares estimators. Note that kCWT d(J) − θ ∗ k2 in the right-hand sides of expressions (20) and (21), is the bias term that quantifies how well one can estimate the true values of probabilities θ ∗ by blocking them together, averaging the values in each block and simultaneously setting all but |J| elements of vector d to zero. If |J| is too small, then d will not be well represented by its truncated version d(J) and the bias will be large. The penalty represents the stochastic error and constitutes the ”price” for choosing too many blocks and coefficients. In particular, the second term (11/2) |J| log 25 m2 L/|J| in (15) is due to the need of finding and estimating |J| elements of the Lm(m + 1)/2-dimensional vector. The first term, log(|C(m, n, L)|), accounts for the difficulty of clustering and is due to application of the union bound in probability. Theorem 1 holds for any collection C(m, n, L) of clustering matrices satisfying assumption (13). In order to obtain some specific results, denote by Z(m, n, n0 , L) the collection of clustering matrices corresponding to the situation where at most n0 nodes can change their memberships between any two consecutive time points, so that   L−1 n n n0 (24) |Z(m, n, n0 , L)| = m m , n0 DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 15 yielding |Z(m, n, 0, L)| = mn and |Z(m, n, n, L)| = mnL . Note that the case of n0 = 0 corresponds to the scenario where the group memberships of the nodes are constant and do not depend on time while the case of n0 = n means that memberships of all nodes can change arbitrarily from one time instant to another. Since      n mne , log mn0 ≤ n0 log n0 n0 formulae (15) and (24) immediately yield the following corollary. Corollary 1. Consider a DSBM with a true matrix of probabilities b obtained according to (14)–(17) where C(m, n, L) = Λ and estimator Λ Z(m, n, n0 , L). Then, inequalities (20) and (21) hold with ∗ (25)      |J| 25 m2 L mne + log Pen(|J|, m) = 11 n log m + n0 (L − 1) log n0 2 |J| It is easy to see that the first term in (25) accounts for the uncertainty of the initial clustering, the second term is due to the changes in the group memberships of the nodes over time (indeed, if n0 = 0, this term just vanishes) while the last term is identical to the second term in the expression for the generic penalty (15). While we elaborate only on the special case where the collection of clustering matrices is given by (24), one can easily produce results similar to Corollary 1 for virtually any nodes’ memberships scenario. Remark 3. (The SBM). Theorem 1 provides an oracle inequality in the case of a time-independent SBM (L = 1). Indeed, in this case, by taking H = 1 and W = IM , obtain for any t > 0 " b − Λ∗ k2 6kCq(J) − θ ∗ k2 44 log m EkΛ (26) ≤ min + m,J,q n2 n2 n C∈M(m,n)   25 m2 22|J| 342 + log + 2 2 n |J| n and a similar result holds for the probability. Note that if |J| = m(m + 1)/2, our result coincides with the one of Gao et al. (2015). However, if many groups have zero probability of connection, then |J| is small and the righthand of (26) can be asymptotically smaller than n−1 log m+n−2 m2 obtained in Gao et al. (2015). In addition, our oracle inequality is non-asymptotic and the estimator is naturally adaptive to the unknown number of classes. (Gao et al. (2016) obtained adaptive estimators but not via an oracle inequality). 16 M. PENSKY Corollary 1 quantifies the stochastic error term in Theorem 1. The size of the bias depends on the level of sparsity of coefficients of functions qk in the basis H and on the constitution of classes. While one can study a variety of scenarios, in order to be specific, we consider the case of a balanced network model where the sizes of all the classes are proportional to each other, in particular, for some absolute constants 0 < ℵ1 ≤ 1 ≤ ℵ2 < ∞, one has (27) ℵ1 n n (l) ≤ nk ≤ ℵ2 , m m k = 1, . . . , m, l = 1, . . . , L, (l) where nk the number of nodes in class k at the moment tl . Note that the condition (27) is very common in studying random network models (see, e.g., Gao et al. (2017) or Amini and Levina (2018) among others). In addition, if class memberships are generated from the multinomial distribution with the vector of probabilities (π1 , · · · , πm ), and C1 /m ≤ πi ≤ C2 /m for some constants 0 < C1 < C2 < ∞, as it is done in, e.g., Bickel and Chen (2009), condition (27) holds with high probability. In particular, we consider networks that satisfy condition (27) but yet allow only n0 nodes switch their memberships between time instances. We denote the corresponding set of clustering matrices by Zbal (m, n, n0 , L, ℵ1 , ℵ2 ). It would seem that condition (27) should make clustering much simpler. However, as Lemma 1 below shows, this reduction does not makes estimation significantly easier since the complexity of the set of balanced clustering matrices log |Zbal (m, n, n0 , L, ℵ1 , ℵ2 )| is smaller than the complexity of the set of unrestricted clustering matrices log |Z(m, n, n0 , L)| only by, at most, a constant factor. p Lemma 1. (Balanced network model complexity) If n ≥ e n30 , then    1 mne (28) log |Zbal (m, n, n0 , L, ℵ1 , ℵ2 )| ≥ . n log m + (L − 1) n0 log 4 n0 Then, one can use the same penalty that was considered in Corollary 1, so that Theorem 1 yields the following result. Theorem 2. Consider a balanced DSBM satisfying condition (27). Let Λ∗ be the true matrix of probabilities, m∗ be the true number of classes, M ∗ = m∗ (m∗ + 1)/2, Q∗ be the true matrix p of probabilities of connections b is for pairs of classes and D∗ = Q∗ H. If n ≥ e n30 and the estimator Λ obtained as a solution of optimization problem (14) with the penalty (25) DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 17 where (29) J= M [ Jk , k=1 then, for any t > 0, with probability at least 1 − 9e−t , one has   M∗ X  ∗ 2 ∗ 2 X b 4Pen(|J|, m )  38t 6ℵ2 kΛ − Λ k ∗ 2 ≤ min (D ) + + 2 (30) k,l 2 ∗ 2 2   J n L (m ) L n L n L k=1 l∈ / Jk and a similar result holds for the expectation. In order to obtain specific upper bounds in (30), we need to impose some assumptions on the smoothness of functions Q∗k,∗ , k = 1, · · · , M ∗ . For the sake of brevity, we assume that all vectors D∗k,∗ , k = 1, · · · , M ∗ , behave similarly with respect to the basis H (generalization to the case where this is not true is rather pedestrian but very cumbersome as we point out in Section 8, Discussion). (A0). There exist absolute constants ν0 and K0 such that (31) L X (l − 1)2ν0 (D∗k,l )2 ≤ K0 , l=1 k = 1, · · · , M ∗ . Let conditions of Theorem 2 hold and D∗k,∗ satisfy asb is obtained as a solution of optimization sumption (31). If the estimator Λ problem (14), then for any t > 0, with probability at least 1 − 9e−t , one has Corollary 2.   "  # 2ν0   ∗ 2 2  2ν0 +1    ∗ 2 ∗ b kΛ − Λ k m m n 1 ≤ K̃0 min log ,  L n2 L n m∗ n  ∗   log m∗ n0 m ne t + + 2 log + 2 (32) nL n n0 n L and a similar result holds for the expectation. Here, K̃0 is an absolute constant that depends on K0 , ν0 , ℵ1 and ℵ2 only. 5. The lower bounds for the risk for the DSBM. In order to prove that the estimator obtained as a solution of optimization problem (14) is minimax optimal, we need to show that the upper bounds in Corollaries 1 18 M. PENSKY and 2 coincide with the minimax lower bounds obtained under similar constraints. For the sake of derivation of lower bounds for the error, we impose mild conditions on the orthogonal matrix H as follows: for any binary vector ω ∈ {0, 1}L one has √ √ (33) kHT ωk∞ ≤ kωk1 / L and H 1 = Le1 , where 1 = (1, 1, · · · , 1)T and e1 = (1, 0, · · · , 0)T . Assumptions (33) are not restrictive. In fact, they are satisfied for a variety of common orthogonal transforms such as the Fourier transform or a periodic wavelet transforms. First, we derive the lower bounds for the risk under the assumption that vector d is l0 -sparse and has only s nonzero components. Let Gm,L,s be a collection of tensors such that G ∈ Gm,L,s implies that the vectorized versions q of G can be written as q = WT d with kdk0 ≤ s. In order to be more specific, we consider the collection of clustering matrices Z(m, n, n0 , L) with cardinality given by (24) that corresponds to the situation where at most n0 nodes can change their memberships between consecutive time instants. In this case, Pen(|J|, m) is defined in (25). Theorem 3. Let orthogonal matrix H satisfy condition (33). Consider the DSBM where G ∈ Gm,L,s with s ≥ κm2 where κ > 0 is independent of m, n and L. Denote γ = min(κ, 1/2) and assume that L ≥ 2, n ≥ 2m, n0 ≤ min(γn, 4/3 γn m−1/9 ) and s is such that s2 log(2LM/s) ≤ 68LM n2 . (34) Then (35) inf c Λ sup G∈Gm,L,s C∈Z(m,n,n0 ,L) PΛ ( b − Λk2 kΛ ≥ C(γ) n2 L s log(Lm2 /s) + n2 L   ≥ log m n0 + 2 log nL n  mne n0  1 , 4 b is any estimator of Λ, P is the probability under the true value where Λ Λ of the tensor Λ and C(γ) is an absolute constant that depends on γ only. Theorem 3 ensures that if vector d has only s nonzero components, then the upper bounds in Corollary 1 are optimal up to a constant. In order to provide a similar assertion in the case of Corollary 2, we assume that rows of matrix D are l2 -sparse. For this purpose, we consider a collection of tensors Gm,L,ν0 such that G ∈ Gm,L,ν0 implies that Q = DH and rows Dk,∗ of matrix DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 19 D satisfy condition (31). Let as before Zbal (m, n, n0 , L, ℵ1 , ℵ2 ) be a collection of clustering matrices satisfying condition (27) and such that at most n0 nodes change their memberships between two consecutive time instances. The following statement ensures that the upper bounds in Corollary 2 are minimax optimal up to a constant factor. Theorem 4. Let orthogonal matrix H satisfy condition (33). Consider the DSBM where G ∈ Gm,L,ν0 with ν0 > 1/2, L ≥ 2 and n ≥ 2m. Then, for any absolute constants 0 < ℵ1 ≤ 1 ≤ ℵ2 < ∞, one has ( " (  )  2ν0 b − Λk2 kΛ 1  m 2 2ν0 +1  m 2 ; (36) inf sup PΛ ≥ C min n2 L L n n c G∈Gm,L,s Λ C∈Z bal + log m n0 + 2 log nL n  mne n0  1 ≥ , 4 b is any estimator of Λ, P where Zbal stands for Zbal (m, n, n0 , L, ℵ1 , ℵ2 ), Λ Λ is the probability under the true value of the tensor Λ and C is an absolute constant independent of n, m and L. Theorems 3 and 4 confirm that the estimator constructed above is minimax optimal up to a constant if G ∈ Gm,L,s and C ∈ Z(m, n, n0 , L), or G ∈ Gm,L,ν0 and C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ). Note that the terms log m/(nL) and n0 n−2 log(mne/n0 ) in (35) and (36) correspond to, respectively, the error of initial clustering and the clustering error due to membership changes. The remaining terms are due to nonparametric estimation and model selection. Assumptions (33) and (34) are purely technical and are necessary to ensure that the “worst case scenario” tensor G of connection probabilities has nonnegative components. As we mentioned earlier, conditions (33) are totally non-restrictive. Condition (34) in Theorem 3 holds whenever representation of the tensor of probabilities in the basis H is at least somewhat sparse. Indeed, if there is absolutely no sparsity (which is a very implausible scenario when smooth functions are represented in a basis) and s ≈ M L, then condition (34) reduces to m(m + 1)L ≤ Cn2 and will still be true if L is relatively small. If L is large, the situation where s ≈ M L is very unlikely. Assumption that s ≥ κm2 for some κ > 0 independent of m, n and L, restricts the sparsity level and ensures that one does not have too many classes where nodes have no interactions with each other or members of other classes. Finally, it is also worth keeping in mind that all assumptions in Theorems 3 and 4 are used for the derivation of the minimax lower bounds for 20 M. PENSKY the risk and are not necessary for either the construction of the estimator b of Λ in (14) or for the assessment of its precision in Theorems 1 and 2. Λ 6. The uniformly sparse DSBM. In the current literature, the notion of the sparse SBM refers to the case where the entries of the matrix of the connection probabilities are uniformly small: Λ = ρn Λ(0) with kΛ(0) k∞ = 1 and ρn → 0 as n → ∞. The concept is based on the idea that when the number of nodes in a network grow, the probabilities of connections between them decline. The minimax study of the sparse SBM has been carried out by Klopp et al. (2017). The logical generalization of the sparse SBM of this type would be the sparse DSBM where the elements of the tensor Λ are bounded above by ρn where ρn → 0 as n grows. We refer to this kind of network as uniformly sparse. On the other hand, not all networks become uniformly sparse as n → ∞. Indeed, in the real world, when a network grows, the number of communities increase and, while the probabilities of connections for majority of pairs of groups become very small, some of the of pairs groups will still maintain high connection probabilities. We refer to this type of network as non-uniformly sparse. The idea of such a network has been elaborated in the recent paper of Borgs et al. (2016). The authors considered heavy-tailed sparse graphs such that, in the context of the SBM, one still has Λ = ρn Λ(0) but the elements of Λ(0) are no longer bounded by one but by a quantity that grows with n. While distinguishing between very small probabilities might be essential in a clustering problem, it is not so necessary in the problem of estimation of the tensor of the connection probabilities studied in the present paper. Indeed, it is a common knowledge that, in the nonparametric regression model, in order to obtain the best error rates, one needs to replace small elements of the vector of interest by zeros rather than estimating them. Similarly, if the network is non-uniformly sparse, i.e., some pairs of groups have probabilities of connections equal or very close to zero, one would obtain an estimator with better overall precision by setting those very small connection probabilities to zeros. Although nowhere in the present paper we make an assumption that a network is sparse and, moreover, consideration of the non-uniformly sparse SBM or DSBM is not one of its objectives, the paper naturally provides the tools for minimax optimal statistical estimation in such models that deliver results with very little additional work. In addition, the techniques developed in this paper allow, with some additional work, to extend results obtained in Klopp et al. (2017) to the dynamic setting. However, majority of their results depend upon solution of optimization problem (14) under the restriction that kWT dk∞ ≤ ρn which DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 21 requires representation of the estimator via a different projection operator and will result in more cumbersome calculations. Therefore, we avoid studying this new optimization problem and only extend Corollary 2.2 of Klopp et al. (2017) that handles the case of the balanced model without placing the above-mentioned restriction. For this purpose, consider a small ρn and denote (37) rn (m) = max(ρn , m2 /n2 ). Similarly to (14), we find m, J, d and C as one of the solutions of the following penalized least squares optimization problem   b C) b d, b = argmin ka − CWT dk2 + λ0 rn (m)Pen(|J|, m) s.t. dJ c = 0 (38) (m, b J, m,J,d,C where C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ), a is defined in (9), d ∈ RM L , W ∈ RM L×M L , M = m(m + 1)/2, Pen(|J|, m) is defined in (25) and λ0 is a tuning parameter that is bounded above and below by a constant. In order the estimator has the uniform sparsity property, we need to make sure that transformation H is such that, whenever it is used for sparse representation of smooth functions, the maximum absolute value of the estimator obtained by truncation of the vector of coefficients is bounded above by a constant factor of the maximum absolute value of the original function. In particular, we denote the projection matrix on the column space of matrix (CWT )J by ΠC,J and impose the following condition on the transformation matrix H: (A1). There exists an absolute constant B0 such that for any C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ) and any vector θ (39) kΠ⊥ C,J θk∞ = kθ − ΠC,J θk∞ ≤ B0 kθk∞ . Let, as before, Λ∗ be the true matrix of probabilities, m∗ be the true number of classes, M ∗ = m∗ (m∗ + 1)/2, C∗ be the true clustering matrix, Q∗ be the true matrix of probabilities of connections for pairs of classes, D∗ = Q∗ H, d∗ = vec(D∗ ), θ ∗ = C∗ (W∗ )T d∗ and W∗ = H ⊗ IM ∗ . Theorem 5. Consider a balanced DSBM satisfying condition (27). Let ∗ ∗ matrix H be such p that condition (39) is satisfied and kΛ k∞ ≤ ρn . If ∗ 3 b is obtained as a solution of opρn ≥ ρn , n ≥ e n0 and the estimator Λ timization problem (38), then, for an absolute constant C̃0 and any t > 0, 22 M. PENSKY with probability at least 1 − 9e−t , one has ) ( ∗ 2 b − Λ∗ k2 kΠ⊥ rn (m∗ ) [Pen(|J|, m∗ ) + t] kΛ C∗ ,J θ k ≤ C̃0 min + (40) J n2 L n2 L n2 L where ΠC∗ ,J is the projection matrix on the column space of (C∗ W∗T )J and C̃0 is an absolute constant that depends on B0 , ℵ1 and ℵ2 only. In particular, if condition (31) holds with K0 replaced with ρ∗n K0 , then   "  # 2ν0   ∗ 2 2  2ν0 +1    ∗ 2 ∗ b m kΛ − Λ k m n 1 , ≤ K̃0 rn (m∗ ) min log 2 ∗  L n L n m n    m∗ ne t log m∗ n0 + 2 log + 2 (41) + nL n n0 n L Here, K̃0 is an absolute constant that depends on B0 , K0 , ν0 , ℵ1 and ℵ2 only. Results similar to (40) and (41) hold for the expectations. 7. Dynamic graphon estimation. Consider the situation where tensor Λ is generated by a dynamic graphon f , so that Λ is given by expression (1) where function f : [0, 1]3 → [0, 1] is such that f (x, y, t) = f (y, x, t) for any t and ζ = (ζ1 , · · · , ζn ) is a random vector sampled from a distribution Pζ supported on [0, 1]n . Given an observed adjacency tensor B sampled according to model (1), the graphon function f is not identifiable since the topology of a network is invariant with respect to any change of labeling of its nodes. Therefore, for any f and any measure-preserving bijection µ : [0, 1] → [0, 1] (with respect to Lebesgue measure), the functions f (x, y, t) and f (µ(x), µ(y), t) define the same probability distribution on random graphs. For this reason, we are considering equivalence classes of graphons. Note that in order for it to be possible to compare clustering of nodes across time instants, we introduce an assumption that there are no label switching in time, that is, every node carries the same label at any time tl , so that function µ is independent of t. Under this condition, we further assume that probabilities Λi,j,l do not change drastically from one time point to another, i.e. that, for every x and y, functions f (x, y, t) are smooth in t. We shall also assume that f is piecewise smooth in x and y. In order to quantify those assumptions, for each x, y ∈ [0, 1]2 , we consider a vector f (x, y) = (f (x, y, t1 ), · · · , f (x, y, tL ))T and an orthogonal transform H used in the previous sections. We assume that elements vl (x, y) of vector v(x, y) = Hf (x, y) satisfy the following assumption: DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 23 (A2). There exist constants 0 = β0 < β1 < · · · < βr = 1 and ν1 , ν2 , K1 , K2 > 0 such that for any x, x′ ∈ (βi−1 , βi ] and y, y ′ ∈ (βj−1 , βj ], 1 ≤ i, j ≤ r, one has (42) (43) [vl (x, y) − vl (x′ , y ′ )]2 ≤ K1 [|x − x′ | + |y − y ′ |]2ν1 , L X (l − 1)2ν2 vl2 (x, y) ≤ K2 . l=1 Note that, for a graphon corresponding to the DSBM model, on each of the rectangles (βi−1 , βi ] × (βj−1 , βj ], functions vl (x, y) are constant, so that vl (x, y) = 0 for l = 2, · · · , L, and ν1 = ∞. We denote the class of graphons satisfying assumptions (1), (42) and (43) by Σ(ν1 , ν2 , K1 , K2 ). In order to estimate the dynamic graphon, we approximate it by an appropriate DSBM and then estimate the probability tensor of the DSBM. Note that, since ν1 , ν2 , K1 and K2 in Assumption A are independent of x and y, one can simplify the optimization procedure in (14). Let Q be the matrix defined in (8) and (9). Note that since random variables ζ1 , . . . , ζn are time-independent, we can approximate the graphon by a DSBM where group memberships of the nodes do not change in time. Hence, , matrices C(l) are independent of l, so that C(l) = Z, (8) holds and Θ = ZQ. Denote X = AHT . Denote by V and Φ the matrices of the coefficients of Q and Θ in the transform H: V = QHT and Φ = ΘHT . Then, by (8), Θ = ZVH and Φ = ZV. Note that each row of the matrices V and Φ corresponds to one spatial location. Since, due to (43), the coefficients in the transform H decrease uniformly irrespective of the location, one can employ L1 < L columns instead of L columns in the final representations of Q and Θ. In order to simplify our presentation, we denote L1 = Lρ where 0 < ρ ≤ 1 and use the optimization procedure (14) to find m, ρ, V(ρ) and Z where V(ρ) is the submatrix of V with columns V∗,j , 1 ≤ j ≤ Lρ . Due to |J| = M Lρ and 0.5 m2 Lρ ≤ |J| ≤ m2 Lρ , in this case optimization problem (14) can be reformulated as h b (bρ) , Z) b = argmin (44) kX(ρ) − ZV(ρ) k2 (m, b ρb, V m,ρ,V(ρ) Z∈Z(m,n,0,L)  11 2 ρ 1−ρ +11n log m + m L log(25L ) 2 where Z(m, n, 0, L) is defined in (24). Then the estimation algorithm appears as follows: 24 M. PENSKY 1. Apply transform H to the data matrix A obtaining matrix X = AHT . 2. Consider a set ℜ = {ρ ∈ (0, 1] : Lρ is an integer}. For every ρ ∈ ℜ, remove all columns X∗,l with l ≥ Lρ + 1 obtaining matrix X(ρ) with EX(ρ) = ZV(ρ) ≡ Φ(ρ) where matrix V(ρ) has Lρ columns. b (bρ) , Z) b as a solution of the optimization problem (44). 3. Find (m, b ρb, V (b b b b b by packing Θ b into a tensor. 4. Choose Θ = ZV ρ) H and obtain Λ b does not require knowledge of Note that construction of the estimator Λ ν1 , ν2 , K1 and K2 , so the estimator is fully adaptive. The following statement b provides a minimax upper bound for the risk of Λ. Theorem 6. Let Σ ≡ Σ(ν1 , ν2 , K1 , K2 ) be the class of graphons satb is obtained as a solution of isfying Assumptions (1), (42) and (43). If Λ optimization problem (44) as described above, then (45) b − Λ∗ k2 EkΛ sup ≤ C min 1≤h≤n−r n2 L f ∈Σ 0≤ρ≤1  Lρ−1 I(ρ < 1) + 2ρν2 +1 h2ν1 L (h + r)2 (1 + (1 − ρ) log L) log(h + r) + + n2 L1−ρ nL  , where the constant C in (45) depends on ν1 , ν2 , K1 and K2 only. Note that h in (45) stands for h = m − r where m is the number of blocks in the DSBM which approximates the graphon, hence, h ≤ n − r. On the other hand, h ≥ 0 since one needs at least r blocks to approximate the graphon that satisfies condition (42). Since the expression in the right hand side of (45) is rather complex and is hard to analyze, we shall consider only two regimes: a) r = rn,L ≥ 2 may depend on n and L and ν1 = ∞; or b) r = r0 ≥ 1 is a fixed quantity independent of n and L. The first regime corresponds to a piecewise constant (in x and y) graphon that generates the DSBM while the second regime deals with the situation where f is a piecewise smooth function of all three arguments with a finite number of jumps. In the first case, we set h = 2, in the second case, we choose h to be a function of n and L. By minimizing the right-hand side of (45), we obtain the following statement. b be obtained as a solution of optimization problem Corollary 3. Let Λ (44) as described above. Then, for Σ ≡ Σ(ν1 , ν2 , K1 , K2 ) and C independent 25 DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION of n and L, one has (46)  ( h   1  C min  L     r 2 n log n r 2 i 2ν2ν2 +1 ;  r 2 n ) + C log r nL , b −Λ k EkΛ ≤ sup ) (  n2 L 2ν1 ν2 f ∈Σ  1   (ν +1)(2ν  ν ν+1    1 1 2 +1) log L log L 1  + ; n2  C min L n2  ∗ 2 r = rn,L ; C log n nL , r = r0 . In order to assess optimality of the penalized least squares estimator obtained above, we derive lower bounds for the minimax risk over the set Σ(ν1 , ν2 , K1 , K2 ). These lower bounds are constructed separately for each of the two regimes. Theorem 7. Let matrix H satisfy assumptions (33) and ν2 ≥ 1/2 in (43). Then, for C independent of n and L, one has ) ( b − Λk2 1 kΛ ≥ ∆(n, L) ≥ , sup PΛ (47) inf 2 n L 4 c f ∈Σ(ν1 ,ν2 ,K1 ,K2 ) Λ where (48) ∆(n, L) =  ( h   1  C min  L          C min L1  r 2 n 1 n2  i 2ν2 2ν2 +1 ; 2ν1 ν2 (ν1 +1)(2ν2 +1)  r 2 n ; ) 1 n2 +  C log r nL , ν1 ν1 +1  + r = rn,L ; C log n nL , r = r0 . It is easy to see that the value of ∆(n, L) coincides with the upper bound in (46) up to a at most a logarithmic factor of n/r or L. In both cases, the first quantities in the minimums correspond to the situation where f is smooth enough as a function of time, so that application of transform H improves estimation precision by reducing the number of parameters that needs to be estimated. The second quantities represent the case where one needs to keep all elements of vector d and hence application of the transform yields no benefits. The latter can be due to the fact that ν2 is too small or L is too low. The upper and the lower bounds in Theorems 6 and 7 look somewhat similar to the ones appearing in anisotropic functions estimation (see, e.g., Lepski (2015)). Note also that although in the case of a time-independent graphon (L = 1), the estimation precision does not improve if ν1 > 1, this is 26 M. PENSKY not true any more in the case of a dynamic graphon. Indeed, the right-hand sides in (48) become significantly smaller when ν1 , ν2 or L grow. Remark 4. (The DSBM and the dynamic graphon). Observe that the definition (1) of the dynamic graphon assumes that vector ζ is independent of t. This is due to the fact that, to the best of our knowledge, the notion of the dynamic graphon with ζ being a function of time has not yet been developed by the probability community. For this reason, we restrict our attention to the case where we are certain that, at any time point, the graphon describes the limiting behavior of the network as n → ∞. Nevertheless, we believe that when the concept of the dynamic graphon is established, our techniques will be useful for its estimation. In the case of a piecewise constant graphon, our setting corresponds to the situation where the nodes of the network do not switch their group memberships in time, so that n0 = 0 in (24). Therefore, a piecewise constant graphon (r = rn,L , ν1 = ∞) is just a particular case of the general DSBM since the latter allows any temporal changes of nodes’ memberships. However, the dynamic piecewise constant graphon formulation enables us to derive specific minimax convergence rates for estimators of Λ in terms of n, L and r. On the other hand, the piecewise smooth graphon (r = r0 , ν1 < ∞) is an entirely different object that is not represented by the DSBM. 8. Discussion. In the present paper we considered estimation of connection probabilities in the context of dynamic network models. To the best of our knowledge, this is the first paper to propose a fully non-parametric model for the time-dependent networks which treats connection probabilities for each group as the functional data and allows to exploit the consistency in the group memberships over time. The paper derives adaptive penalized least squares estimators of the tensor of the connection probabilities in a non-asymptotic setting and shows that the estimators are indeed minimax optimal by constructing the lower bounds for the risk. This is done via vectorization technique which is very useful for the task in the paper and can be very beneficial for solution of other problems such as, e.g., inference in bi-clustering models mentioned in Remark 2. In addition, we show that the correct penalty consists of two parts: the portion which accounts for the complexity of estimation and the portion which accounts for the complexity of clustering and is proportional to the logarithm of the cardinality of the set of clustering matrices. The latter is a novel result and it is obtained by using the innovative Packing lemma (Lemma 4) which can be viewed as a version of the Varshamov-Gilbert lemma for clustering matrices. Finally, the methodologies of the paper allow a variety of extensions. DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 27 1. (Inhomogeneous or non-smooth connection probabilities). Assumption (43) essentially implies that probabilities of connections are spatially homogeneous and are represented by smooth functions of time that belong to the same Sobolev class. The model, however, can be easily generalized. First, by letting H be a wavelet transform and assuming that for any fixed x and y, function f (x, y, ·) belongs to a Besov ball, one can accommodate the case where f (x, y, ·) has jump discontinuities. Furthermore, by using a weaker version of condition (43), similarly to how this was done in Klopp and Pensky (2015), we can treat the case where functions f (x, y, t) are spatially inhomogeneous. 2. (Time-dependent number of nodes). One can apply the theory above even when the number of nodes in the network changes from one time instant to another. Indeed, in this case we can form a set that includes all nodes that have ever been in the network and denote their number by n. Consider a class Ω0 such that all nodes in this class have zero probability of interaction with each other or any other node in the network. At each time instant, place all nodes that are not in the network into the class Ω0 . After that, one just needs to modify the optimization procedures by placing additional restriction that the out-of-the-network nodes indeed belong to class Ω0 and that G0,k,l = 0 for any k = 0, 1, 2, · · · , m and l = 1, · · · , L. 3. (Adaptivity to clustering complexity). Although, in the case of the DSBM, our estimator is adaptive to the unknown number of classes, it requires knowledge about the complexity of the set of clustering matrices. For example, if at most n0 nodes can change their memberships between two consecutive time points and n0 is a fixed quantity independent of n and m, we can replace n0 by log n that dominates n0 if n is large enough. However, if n0 depends on n and m, development of an adaptive estimator would require an additional investigation. SUPPLEMENTARY MATERIAL. Supplement contains proofs of all statements in the paper References. [1] Amini, A.A., Levina, E. (2018) On semidefinite relaxations for the block model. Ann. Statist., 46, 149–179. [2] Anagnostopoulos, A., Lacki, J., Lattanzi, S., Leonardi, S., Mahdian, M. (2016) Community Detection on Evolving Graphs. NIPS, 35223530. 28 M. PENSKY [3] Bickel, P.J., Chen, A. (2009) A nonparametric view of network models and newmangirvan and other modularities. Proc. Nation. Acad. Sciences, 106(50), 21068–21073. [4] Bickel, P.J., Chen, A., Levina, E. (2011) The method of moments and degree distributions for network models. Ann. Statist., 39, 2280–2301. [5] Borgs, C., Chayes, J.T., Cohn, H., Ganguly, S. (2016) Consistent nonparametric estimation of heavy-tailed sparse graphs. ArXiv:1508.06675v2 [6] Durante, D., Dunson, D.B., Vogelstein, J.T. (2015) Nonparametric Bayes Modeling of Populations of Networks. Journ. Amer. Statist. Assoc., accepted. [7] Durante, D., Yang, X. Dunson, D.B. (2016) Locally adaptive dynamic networks. Ann. Appl. Stat., 10, 2203–2232. [8] Gao, C., Lu, Yu, Zhou, H.H. (2015) Rate-optimal graphon estimation. Ann. Statist., 43, 2624–2652. [9] Gao, C., Ma, Z., Zhang, S.Y., Zhou, H.H. (2017) Achieving Optimal Misclassification Proportion in Stochastic Block Models. Journ. Machine Learn. Research, 18, 1–45. [10] Gao, C., Lu, Yu, Ma, Z., Zhou, H.H. (2016) Optimal Estimation and Completion of Matrices with Biclustering Structures. Journ. Machine Learn. Research, 17, 1–29. [11] Goldenberg, A., Zheng, A.X., Fienberg, S.E., Airoldi, E. M. (2010). A survey of statistical network models. Found. Trends Mach. Learn., 2, 129–233. [12] Gupta, A.K., Nagar, D.K. (2000) Matrix Variate Distributions. Chapman& Hall/CRC Press. [13] Han, Q., Xu, K.S., Airoldi, E.M. (2015) Consistent estimation of dynamic and multilayer block models. Proceedings of the 32nd International Conference on Machine Learning, Lille, France, 2015, 1511–1520. [14] Hsu, D., Kakade, S.M., Zhang, T. (2012) A tail inequality for quadratic forms of subgaussian random vectors. Electron. Commun. Probab., 17(52), 1–6. [15] Klopp, O., Pensky, M. (2015) Sparse high-dimensional varying coefficient model: nonasymptotic minimax study. Ann. Stat., 43, 1273–1299. [16] Klopp, O., Tsybakov, A.B., Verzelen, N. (2017) Oracle inequalities for network models and sparse graphon estimation. Ann. Statist., 45, 316–354. [17] Kolaczyk, E. D. (2009). Statistical Analysis of Network Data: Methods and Models. Springer. [18] Kolar, M., Song, L., Ahmed, A., Xing, E.P. (2010) Estimating time-varying networks. Ann. Appl. Statist., 4, 94–123. [19] Lee, M., Shen, H., Huang, J. Z., Marron, J.S.(2010) Biclustering via sparse singular value decomposition. Biometrics, 66, 1087–1095. [20] Lepski, O. (2015) Adaptive estimation over anisotropic functional classes via oracle approach. Ann. Statist., 43, 1178–1242. [21] Lovász, L., Szegedy, B. (2006) Limits of dense graph sequences. Journ. Combinatorial Theory, Ser. B, 96, 933–957. [22] Lovász, L. (2012) Large Networks and Graph Limits. Colloquium Publications of the American Mathematical Society, 60, American Mathematical Society, Providence, RI. [23] Massart, P. (2007) Concentration Inequalities and Model Selection. Springer-Verlag, Berlin, Heidelberg. [24] Matias, C., Miele, V. (2017) Statistical clustering of temporal networks through a dynamic stochastic block model. Journ. Royal Stat. Soc., Ser. B, 79, 1119–1141. [25] Minhas, S., Hoff, P.D., Warda, M.D. (2015) Relax, Tensors Are Here. Dependencies in International Processes. ArXiv:1504.08218 [26] Olhede, S.C., Wolfe, P. J. (2014) Network histograms and universality of blockmodel approximation. Proceed. Nat. Acad. Sci., 111, 14722–14727. DYNAMIC NETWORK MODELS AND GRAPHON ESTIMATION 29 [27] Pollard, D. (1990) Empitrical Processes: Theory and Applications. Institute of Mathematical Statistics. [28] Tsybakov, A. B. (2009). Introduction to Nonparametric Estimation. Springer, New York. [29] Vershynin, R. (2012). Introduction to the non-asymptotic analysis of random matrices. In Compressed Sensing, Theory and Applications, ed. Y. Eldar and G. Kutyniok, Chapter 5. Cambridge University Press. [30] Wolfe, P.J., Olhede, S.C.(2013) Nonparametric graphon estimation. ArXiv:1309.5936. [31] Xing, E.P., Fu, W., Song, L. (2010) A state-space mixed membership blockmodel for dynamic network tomography. Ann. Appl. Stat., 4, 535–566. [32] Xu, K.S. (2015) Stochastic Block Transition Models for Dynamic Networks. Proceedings of the 18th International Conference on Artificial Intelligence and Statistics (AISTATS) 2015, San Diego, CA, USA. JMLR: W&CP, 38. [33] Xu, K.S., Hero III, A.O. (2014) Dynamic stochastic blockmodels for time-evolving social networks. IEEE Journal of Selected Topics in Signal Processing, 8(4), 552–562. [34] Yang, T., Chi, Y., Zhu, S., Gong, Y., Jin, R. (2011) Detecting communities and their evolutions in dynamic social networksa Bayesian approach. Mach. Learn., 82, 157–189. [35] Zhang, A.Y., Zhou, H.H. (2016) Minimax rates of community detection in stochastic block models. Ann. Statist., 44, 2252–2280. 9. Supplemental Material: Proofs. b C, b m, 9.1. Proof of Theorem 1. Since (d, b Jb) are solutions of optimization problem (14), for any m, J, C and d one has b b k2 + Pen(|Jb|, m) bW cT d (S.1) ka − C b ≤ ka − CWT d(J) k2 + Pen(|J|, m), (J ) For any m, J, C and d, it follows from (18) that ka − CWT d(J) k2 = k(a − C∗ W∗ T d∗ ) + (C∗ W∗ T d∗ − CWT d(J) )k2 = kξk2 + kCWT d(J) − C∗ W∗ T d∗ k2 + 2ξ T (C∗ W∗ T d∗ − CWT d(J) ). Hence, plugging the last identity into the inequality (S.1), derive that for any m, J, C and d bW cT d b b − C∗ W∗T d∗ k2 ≤ kCWT d(J) − C∗ W∗T d∗ k2 (S.2) kC (J ) + ∆ + Pen(|J|, m) − Pen(|Jb|, m). b bW cT d b b − CWT d(J) )| ≤ ∆1 + ∆2 + ∆3 with Here ∆ = 2|ξ T (C (J ) (S.3) ∆1 = 2|ξ T (C∗ W∗T d∗ − CWT d(J) )|, b b b)C∗ W∗ T d∗ |, ∆3 = 2ξ T Π b b b ξ, ∆2 = 2|ξ T (IN L − Π C,J C,J b b =Π bW cT d b b b a where a is given since, due to (22) and (23), one has C C,J (J) by (18). Now, we need to find upper bounds for each of the terms in (S.3). By Lemma 2 with α = 1/2 and any t > 0, one has n o (S.4) P ∆1 − 0.5 kC∗ W∗ T d∗ − CWT d(J) k2 ≤ 4t ≥ 1 − 2e−t . Note that bW cT d b kC b (J) b b b)C∗ W∗ T d∗ k2 b b b ξk2 + k(IN L − Π − C∗ W∗ T d∗ k2 = kΠ C,J C,J b b b)C∗ W∗T d∗ k2 . ≥ k(IN L − Π C,J Therefore, applying an union bound over m = 1, · · · , n, C ∈ C(m, n, L) and J with |J| = 1, · · · , M L, we derive that for any x > 0 n o b b − C∗ W∗ T d∗ k2 < 4x bW cT d P ∆2 − 0.5 kC (J) o n b b b)C∗ W∗T d∗ k2 < 4x ≥P ∆2 − 0.5 k(IN L − Π C,J ≥1 − n X X ML X X m=1 C∈C(m,n,L) j=1 |J|=j n b b b)CWT d∗ | P 2|ξ T (IN L − Π C,J o b b b)CWT d∗ k2 < 4x . − 0.5 k(IN L − Π C,J 1 Denote  (S.5) R(m, J, L) = log(|C(m, n, L)|) + |J| log m2 Le |J|−1 + 2 log(m|J|). Then, taking into account that the number of sets J with |J| = j is  ML j  ≤  M Le j j ≤  m2 Le j j and applying Lemma 2 with α = 1/2 and x = t + R(m, J, L), derive n X ML o X −t Tb ∗ ∗T ∗ 2 b b c m−2 j −2 . b J, L) ≤ 4t ≥ 1−2e P ∆2 − 0.5 kCW d(J) b − C W d k − 4R(m, n m=1 j=1 √ P −2 = π 2 /6 < 3, the last inequality yields Since ∞ j=1 j (S.6) n o bW cT d b b − C∗ W∗ T d∗ k2 − 4R(m, b L) ≤ 4t ≥ 1 − 6e−t . P ∆2 − 0.5 kC b J, (J) Finally, in order to obtain an upper bound for ∆3 , apply Lemma 4 with b b b and again use the union upper bound over m = 1, · · · , n, C ∈ A=Π C,J C(m, n, L) and J with |J| = 1, · · · , M L similarly to the way it was done for ∆2 . Since for any projection matrix ΠC,J , one has kΠC,J kop = 1 and kΠC,J k2 = |J|, obtain that for any t > 0   3 3t b b (S.7) P ∆3 − |J | − R(m, b J, L) ≤ ≥ 1 − e−t , 2 2 where R(m, J, L) is defined in (S.5). Combining (S.2)–(S.7) and recalling b=C bW cT d b b and θ ∗ = C∗ W∗ T d∗ , obtain that, with probability at that θ (J ) least 1 − 9e−t , one has (S.8)  b − θ ∗ k2 ≤ 3kCWT d(J) − θ ∗ k2 + 11R(m, J, L) + 2|J| + 19t. kθ min m,J,q C∈C(m,n,L) In order to complete the proof of (20), observe that 2 log(|J|) ≤ 2|J| and log(|C(m, n, L)| ≥ 2 log m by (13). Therefore, one has (S.9) 11R(m, J, L) + 2|J| ≤ 2Pen(|J|, m), and (20) follows from (S.8), (S.9) and the second inequality in (19). Finally, inequality (21) R ∞can be proved by noting that for any random b − Λ∗ k2 . variable ζ one has Eζ ≤ 0 P(ζ > z)dz and using it with ζ = kΛ 2 9.2. Proofs of Lemma 1, Theorem 2 and Corollary 2. This section contains proofs of Lemma 1, Theorem 2 and Corollary 2. Proof of Lemma 1. Since |Zbal (m, n, n0 , L, 1, 1)| ≤ |Zbal (m, n, n0 , L, ℵ1 , ℵ2 )|, it is sufficient to prove (28) for ℵ1 = ℵ2 = 1. Note that   n log |Zbal (m, n, n0 , L, 1, 1)| ≥ log(n!) − m log[(n/m)!] + (L − 1) log n0  since there are nn0 ways to select n0 nodes out of n but there are more than one way to put them back. Applying Lemma 5 with γ = 1 obtain that log(n!) − m log[(n/m)!] ≥ n log(m)/4. In addition,  4       n mne n0 n0 n n log log = ≥ log > n0 log n0 4 4 n0 n0 n40 provided n4 /n40 ≥ (mne)/n0 which holds under conditions of the lemma due to m ≤ n. Proof of Theorem 2. Let m∗ be the true number of classes, M ∗ = m∗ (m∗ + 1)/2. Let C = C∗ be the true clustering matrix and (C∗ )T C∗ = (S∗ )2 where (S∗ )2 is the diagonal matrix with the number of nodes in respective pairs of classes on the diagonal. Let Q∗ be the true matrix of probabilities of connections for pairs of classes, D∗ = Q∗ H, d∗ = vec(D∗ ), θ ∗ = C∗ (W∗ )T d∗ and W∗ = H ⊗ IM ∗ . We need to find an upper bound for kC∗ (W∗ )T d∗ (J) − θ ∗ k2 in (20). Let Q∗ (J) be such that vec(Q∗ (J) ) = q∗ (J) = (W∗ )T d∗ (J) = (W∗ )T (W∗ q∗ )(J) . Then, by direct calculations, one obtains i h iT h kC∗ (W∗ )T d∗ (J) − θ ∗ k2 = q∗ (J) − (S∗ )−2 C∗ θ ∗ (S∗ )2 q∗ (J) − (S∗ )−2 C∗ θ ∗ + kθ ∗ k2 − k(S∗ )−1 (C∗ )T θ ∗ k2 . Since k(S∗ )−1 (C∗ )T θ ∗ k = kθ ∗ k and (S∗ )−2 C∗ θ ∗ = q∗ = vec(Q∗ ) = vec(D∗ H), obtain kC∗ (W∗ )T d∗ (J) − θ ∗ k2 = kS∗ (Q∗ (J) − Q∗ )k2 ∗ ≤ M X k=1 (l) max Nk l L h X l=1 (Q∗ (J) )k,l − Q∗ k,l M∗  n 2 X 2 ≤ ℵ2 kQ∗ (J) )k,∗ − Q∗ k,∗ k2 m∗ k=1 3 i2 (l) Here, k is the index corresponding to a pair of classes (k1 , k2 ), Nk1 ,k2 is defined in formula (10) and the second inequality follows from assumption (27). In order to complete the proof, note that k=1 ∗ ∗ ∗ M X kQ ∗ (J) )k,∗ −Q ∗ 2 k,∗ k = M X k=1 kD∗(Jk ) )k,∗ − D∗k,∗ k2 = M X X (D∗k,l )2 . k=1 l∈J / k Therefore, (20) implies (30). Proof of Corollary 2. Observe that it follows from (31) that one can choose Jk = {l : 1 ≤ l ≤ L0 } where L0 ≤ L. Then, (29) yields that |J| = L0 M ∗ . Moreover, due to assumption (31), obtain ∗ M X X k=1 l∈J / k 0 (D∗k,l )2 ≤ K0 M ∗ L−2ν . 0 Note also that if L0 = L, then there is no bias and the sum in (30) is identical zero. Then, (30) becomes b − Λ∗ k2 ≤ min {∆(n, L, m∗ ), 22M ∗ L} kΛ   ∗  m ne + 38 t, + 44 n log(m∗ ) + n0 L log n0 where    25 L 2 2 −2ν0 ∗ 2 ∆(n, L, m ) = min 6K0 ℵ2 n L0 + 22(m ) L0 log 0≤L0 <L L0 ∗ In order to obtain (32), minimize the right-hand side of the last expression with respect to L0 < L and note that, if L0 < L, then log(L0 ) ≍ log(L) ≍ log(n/m∗ ). 9.3. Proofs of Theorems 3 and 4. This section contains the proofs of the lower bounds for the error. The lower bounds in both, Theorem 3 and Theorem 4, consist of two parts, the clustering error and the nonparametric estimation error. We shall consider those terms separately. Proof of Theorem 3. Although the upper bounds for the risk in Corollary 1 are derived for the case of general clustering matrices, due to the fact that the balanced model clustering complexity is the same as complexity of general clustering, we derive the lower bounds for the clustering error 4 for the case when C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ). Moreover, since the case of ℵ1 = ℵ2 = 1 is the most restrictive, we prove the clustering error for this case. The clustering error. Without loss of generality, assume that γm and γn are integers. Assume that connectivity tensor G does not change with l, so G∗,∗,l = V is an m × m symmetric matrix. Let V be block diagonal and such that the diagonal blocks are equal to zero and the non-diagonal blocks are equal to F and FT , respectively, so that Vk1 ,k2 = 0 if 1 ≤ k1 , k2 ≤ (1 − γ)m or (1 − γ)m + 1 ≤ k1 , k2 ≤ m and Vk1 ,(1−γ)m+k2 = Fk1 ,k2 if k1 = 1, · · · (1 − γ)m, k2 = (1 − γ)m + 1, · · · , m. Since components of vectors Gk1 ,k2 ,∗ are constant for any k1 , k2 , then, due to condition (33), each of the vectors HFk1 ,k2 has only one non-zero component, so that the set J has at most γ(1 − γ)m2 < s nonzero elements. Consider a collection of binary vectors ω ∈ {0, 1}(1−γ)m . By VarshamovGilbert Lemma (see Tsybakov (2009)), there exists a subset Ξ of those vectors such that for any ω, ω ′ ∈ Ξ one has kω − ω ′ kH = kω − ω ′ k2 ≥ (1 − γ)m/8 ≥ m/16 and |Ξ| ≥ exp((1 − γ)m/8). Assume, without loss of generality, that m is large enough, so that exp((1−γ)m/8) ≥ γm, otherwise, choose a smaller value of γ (inequality exp((1−γ)m/8) ≥ γm is always valid for γ ≤ 1/9). Choose γm vectors ω in Ξ, enumerate them as ω (1) , · · · , ω (γm) and use them to form columns of matrix F as follows: (S.10) F∗,j = 0.5 1 + αω (j) , j = 1, · · · , γm. Then, for any j, j ′ = 1, · · · , γm, obtain (S.11) kF∗,j − F∗,j ′ k2 ≥ α2 m/16, where α is a positive constant that will be defined later. Note that for every l and k one has (S.12)      k k ke 1 l log ≤ log , log(k!) = k log k−k+ log(2πk)+o(1), ≤ l log l l 2 l where the o(1) term is smaller than 1. Therefore, it follows from the first formula in (24) that (S.13)     mne mn ≤ log |Z(m, n, n0 , L)| ≤ n log m+n0 (L−1) log n log m+n0 (L−1) log n0 n0 The term n log m in (S.13) is due to the initial clustering while the term n0 (L − 1) log (mn/n0 ) is due to temporal changes in the clusters’ memberships. 5 In what follows, we shall utilize clustering functions z (l) : [n] → [m] corresponding to clustering matrices C(l) such that z (l) (j) = k iff at the moment tl node j belongs to class Ωk , k = 1, · · · , m. Clustering error due to initial clustering. First consider the case when initial clustering error dominates. If m = 2 or m takes a small value, the proof is almost identical to the proof in Section 3.3 of Gao et al. (2015). Hence, we shall skip this part and consider the case when m is large enough, so that γm ≥ 2. Following Gao et al. (2015), we consider clustering matrices and clustering functions independent of l, so that z (l) ≡ z. Consider a sub-collection of clustering matrices F(m, n, γ) ⊂ M(m, n) such that they cluster the first n(1 − γ) nodes into the first m(1 − γ) classes uniformly and sequentially, n/m nodes in each class, i.e., the first n/m nodes are placed into class Ω1 , the second n/m nodes into class Ω2 , and so on. The remaining γn nodes are clustered into the remaining γm classes, n/m nodes into each class. Then, by Lemma 5,   . log |F(m, n, γ)| = log (γn)! [(n/m)!]γm ≥ γn log(γm)/4. Now, apply Lemma 4 with γn and γm, respectively, instead of n and m and r = γn/32. Derive that there exists a subset S(m, n, γ) of the set F(m, n, γ) such that, for any C, C′ ∈ S(m, n, γ), one has 2 {#j : z(j) 6= z ′ (j)} = kC − C′ kH ≥ γn/32. Also, by (S.66), (S.14) γn log(32mγe) γn γn log(γm) − ≥ log(γm). 4 32 16 log |S(m, n, γ)| ≥ Let Λ and Λ′ be the tensors of probabilities corresponding to, respectively, clustering matrices C, C′ ∈ S(m, n, γ) with related clustering functions z and z ′ . Then, by (S.11), due to the fact that the first n(1 − γ) nodes are clustered uniformly and sequentially, obtain n(1−γ) kΛ − Λ′ k2 = 2L = = 2Ln m 2Ln m X i=1 m(1−γ) X k=1 n X n X n X j=n(1−γ)+1 (Fz(i),z(j) − Fz ′ (i),z ′ (j) )2 (Fk,z(j) − Fk,z ′ (j) )2 j=n(1−γ)+1 j=n(1−γ)+1 kF∗,z(j) − F∗,z ′ (j) k2 ≥ 6 2Ln α2 m  #j : z(j) 6= z ′ (j) , m 16 so that (S.15) kΛ − Λ′ k2 ≥ 2−9 Ln2 α2 γ. On the other hand, if α ≤ 1/4, then, by Lemma 7, obtain that the Kullback divergence is bounded above (S.16) K(PΛ , PΛ′ ) ≤ 8 kΛ − Λ′ k2 ≤ 16α2 n2 Lγ. Set α2 = Cα log(γm)/nL and apply Theorem 2.5 of Tsybakov (2009). Due to (S.14) and (S.16), if Cα is a small enough absolute constant, 16α2 n2 Lγ = 16Cα log(γm)n < (1/8) (γn/16) log(γm) ≤ (1/8) log |S(m, n, γ)| and conditions of Theorem 2.5 are satisfied. Since Ln2 α2 γ = Cα n γ log(γm) and log(γm) ≥ C(γ) log m for some constant C(γ) dependent on γ only, derive ( ) b − Λ∗ k2 kΛ C(γ) log m PΛ sup (S.17) inf ≥ 1/4. ≥ n2 L nL c G∈Gm,L,s Λ C∈S(m,n,γ) Clustering error due to changes in the memberships. Now, we consider the case when the clustering error which is due to the temporal changes in memberships dominates the error of initial clustering. Use the same construction for G and F as Q before. Consider the following collection of clustering matrices F = L l=1 Fl where Fl is defined as follows. When l is odd, Fl contains only one matrix that clusters nodes uniformly and sequentially, i.e., the first n/m nodes go to class Ω1 , the second n/m nodes go to class Ω2 and the last n/m nodes go to class Ωm . If l is even, Fl = P(m, n, n0 , γ) where P(m, n, n0 , γ) is the set of clustering matrices that corresponds to a perturbation of the uniform sequential clustering with at most n0 nodes moved to different classes in the manner described below. Let k0 be an integer such that (S.18) k0 ≤ n0 /(γm) < k0 + 1. If k0 = 0, then n0 < γm and we choose n0 clusters out of the last γm clusters, remove one element from each of those clusters and then put those n0 elements back in such a manner that every element goes to a different cluster and no elements goes back to its own cluster. If k0 ≥ 1, we remove k0 elements from each of the last γm clusters and then put each of those k0 -tuples back, one tuple per cluster, so that none of the tuple goes back 7 to its own cluster. Then, log |F| = [L/2] log |P(m, n, n0 , γ)| where [L/2] ≥ (L − 1)/2 is the largest integer not exceeding L/2 and (  log γm n0 + n0 log(n/m) + log[(n0 − 1)!], if k0 = 0; log |P(m, n, n0 , γ)| = γm log n/m + log[(γm − 1)!], if k0 ≥ 1. k0 If n0 < γm, so that k0 = 0, then, by (S.12), obtain that log |P(m, n, n0 , γ)| ≥ n0 log(γm/n0 ) + n0 log(n/m) = n0 log(γn/n0 ). If n0 ≥ γm and k0 ≥ 1, then, by (S.12), obtain log |P(m, n, n0 , γ)| ≥ γmk0 log(n/(mk0 )). Since k0 + 1 ≤ 2k0 , obtain that k0 ≥ n0 /(2mγ). Hence, for any k0 ≥ 0 (S.19) log |P(m, n, n0 , γ)| ≥ n0 log (γn/n0 ) . 2 For every even value of l, apply Lemma 4 with γn and γm, respectively, instead of n and m and r = n0 /40 obtaining that there exists a subset Sl (m, n, n0 , γ) of the set P(m, n, n0 , γ) such that, for any C(l) , C′(l) ∈ Sl (m, n, n0 , γ), one has (S.20) kC(l) − C′(l) kH ≥ n0 /40, l = 2k, k = 1, · · · , [L/2]. By (S.19) and Lemma 4, for every even l, one has       n0 γn 80nemγ 2 nem n0 n0 log |Sl (m, n, n0 , γ)| ≥ log log log − ≥ 2 n0 40 n0 40 n0 since, due to n0 ≤ 4/3 γn m−1/9 and (80e2 )1/18 ≤ 0.75, one has (γn/n0 )20 ≥ (80e2 ) [m (γn/n0 )]2 , so that 20 log(γn/n0 ) ≥ log(80n2 m2 e2 γ 2 /n20 ) = log(nem/n0 ) + log(80nemγ 2 /n0 ). For odd values of l, let Sl (m, n, n0 , γ) contain just one clustering matrix corresponding to the Q uniform sequential clustering. Now, consider the set S(m, n, n0 , γ, L) = L l=1 Sl (m, n, n0 , γ) with   nem (L − 1)n0 log . (S.21) log |S(m, n, n0 , γ, L)| ≥ 80 n0 Let C = (C(1) , C(2) , · · · , C(L) ) and C′ = (C′(1) , C′(2) , · · · , C′(L) ) be two sets of clustering matrices with C(l) , C′(l) ∈ Sl (m, n, n0 , γ) and let z = (z1 , · · · , zL ) and z ′ = (z1′ , · · · , zL′ ) be the corresponding clustering functions. 8 Let Λ and Λ′ be the tensors of probabilities corresponding to sets of clustering matrices C, C′ ∈ S(m, n, n0 , γ, L). Then, similarly to the previous case, using (S.11), derive [L/2] n(1−γ) ′ 2 kΛ − Λ k = 2 = X l=1 2n X = m i=1 l=1 [L/2] m(1−γ) 2n X X m [L/2] X k=1 n X j=n(1−γ)+1 j=n(1−γ)+1 n X n X 2 ′ (i),z ′ (j) ) (Fz2l (i),z2l (j) − Fz2l 2l 2 ′ (j) ) (Fk,z2l (j) − Fk,z2l [L/2] nα2 X ′ (j) k ≥ kF∗,z2l (j) − F∗,z2l kC(2l) − C′(2l) kH , 8 2 l=1 j=n(1−γ)+1 l=1 so that by (S.20), (S.22) kΛ − Λ′ k2 ≥ (L − 1)nn0 α2 /1280. Again, similarly to the previous case, if α ≤ 1/4, then by Lemma 7, obtain that the Kullback divergence is bounded above (S.23) K(PΛ , PΛ′ ) ≤ 8 kΛ − Λ′ k2 ≤ 8Lnn0 α2 . Set α2 = Cα n−1 log(nem/n0 ) where Cα is an absolute constant and apply Theorem 2.5 of Tsybakov (2009). Observe that if Cα is small enough, then, due to (S.21) and (S.23), conditions of this theorem are satisfied, hence, (S.24) (  ) b − Λ∗ k2 nem kΛ n0 PΛ sup inf ≥ C(γ) 2 log ≥ 1/4. n2 L n n0 c G∈Gm,L,s Λ C∈S(m,n,n0 ,γ,L) The nonparametric estimation error. Consider uniform sequential clustering with n/m nodes in each group and group memberships remaining the same for all l = 1, · · · , L. Let Q ∈ RM ×L be the matrix with columns q(l) , l = 1, · · · , L, defined in Section 2.3. Denote V = QHT ∈ RM ×L and recall that for G ∈ Gm,L,s , by (11) and (12), matrix V should have at most s nonzero entries. Let k0 = min(s/2, M ). Choose k0 rows among M rows of matrix V and denote this set by X . If k0 = M , set X = {1, · · · , M }. For k ∈ X , set Vk,1 6= 0. We have already distributed k0 non-zero entries and have s − k0 entries left. We distribute those entries into the k0 rows Vk,∗ where k ∈ X . Let (S.25) s0 = [(s − k0 )/k0 ] = [s/k0 ] − 1 9 with s/2 ≤ k0 s0 < s, where [s/k0 ] is the largest integer no larger than s/k0 . Consider a set of binary vectors ω ∈ {0, 1}L with exactly s0 ones in each vector. By Lemma 4.10 of Massart (2007), there exists a subset T of those vectors such that for any ω, ω ′ ∈ T , one has kω − ω ′ kH ≥ s0 /2 and log |T | ≥ 0.233 s0 log(L/s0 ). N Denote T̃ = k∈X Tk , where Tk is a copy of the set T corresponding to row k of matrix V. For ω (k) ∈ Tk , set √ (S.26) Vk,∗ = ( L/2, · · · , 0) + αm/n ω (k) , if k ∈ X , Vk,∗ = 0 if k ∈ / X. It is easy to see that matrix V has at most s nonzero entries as required. Let V and V′ be matrices corresponding to sequences ω (k) and ω ′(k) in Tk , k ∈ X . Let Λ and Λ′ be the tensors corresponding to V and V′ . Then, due to (S.25) and the uniform sequential clustering, (S.26) implies that kΛ − Λ′ k2 ≥  n 2 kΛ − Λ′ k2 ≤ 4 kV − V′ k2 ≥ m  m 2 n α2  n 2 m  n 2 X m k∈X ′ kVk,∗ − Vk,∗ k2 ≥ α2 s α2 k0 s0 ≥ ; 2 4 k0 s0 ≤ 4α2 s. Set α2 = Cα log(L/s0 ). It is easy to check that, due to assumptions (33) and (34), one has Qij ∈ [1/4, 3/4] for any i and j. Hence, by Lemma 7, obtain K(PΛ , PΛ′ ) ≤ 8 kΛ − Λ′ k2 ≤ 32α2 s. If Cα ≤ 2−8 · 0.233, then 32α2 s < (1/8) log(T̃ ) and conditions of Theorem 2.5 of Tsybakov (2009) hold. Finally, in order to obtain the last term in (35), examine L/s0 . If s < 2M , then k0 = s/2, s0 = 1 and L/s0 = L = Lm2 /m2 ≥ γLm2 /s. If s ≥ 2M , then k0 = M , s0 ≤ s/M and L/s0 ≥ LM/s ≥ Lm2 /(2s) ≥ γLm2 /s. Since for some constant C(γ) > 0 independent of L and m, one has log(γLm2 /s) ≥ C(γ) log(Lm2 /s), obtain (  ) b − Λ∗ k2 Lm2 s kΛ ≥ 1/4. PΛ ≥ Cγ 2 log sup (S.27) inf n2 L n L s c G∈Gm,L,s Λ C∈S(m,n,n0 ,γ,L) Finally, in order to obtain the lower bound in (35) observe that, for any a, b, c ≥ 0, one has max(a, b, c) ≤ a + b + c ≤ 3 max(a, b, c) and then combine (S.17), (S.24) and (S.27). 10 Proof of Theorem 4. Note that for Theorem 3 we proved the lower bounds for the clustering error in the most restrictive case when C ∈ Zbal (m, n, n0 , L, 1, 1). Moreover, in this proof, the connection probabilities are set to be constant over time, hence due to condition (33), D∗k,l = 0 for l ≥ 2 in assumption (31), so (31) holds for any K0 and ν0 . Therefore, the lower bounds for the risk due to clustering errors hold in this case and coincide with the lower bounds in Theorem 3. For this reason, we only need to prove the lower bounds that are due to the nonparametric estimation error. The nonparametric estimation error. Consider a set up where the nodes are grouped into m classes, n/m nodes in each class, so the model is fully balanced. Let Gk,k,l = 0 for any k = 1, · · · , m and l = 1, · · · , L. Consider an even number L0 such that 1 ≤ L0 ≤ L/2 and a set of vectors ω ∈ {0, 1}L0 with exactly L1 = L0 /2 nonzero entries. By Lemma 4.10 of Massart (2007), there exists a subset T of those vectors such that for any ω, ω ′ ∈ T one has (S.28) kω − ω ′ kH ≥ L0 /4, log |T | ≥ 0.233(L0 /2) log 2 ≥ 0.08L0 . Denote K = {(k1 , k2 ) : 1 ≤ kN 1 < k2 ≤ m} and let Tk1 ,k2 be the copies of T for (k1 , k2 ) ∈ K. Denote T̃ = (k1 ,k2 )∈K Tk1 ,k2 and observe that log |T̃ | = 0.5 m(m − 1) log |T | ≥ 0.02m2 L0 . (k ,k ) Then, ω̃ ∈ T̃ are binary tensors with elements ω l 1 2 , l = 1, · · · , L0 , and (k1 , k2 ) ∈ K. Consider a set of matrices D(ω̃ ) indexed by ω̃ such that for the index k = 1, · · · , M, corresponding to (k1 , k2 ) ∈ K, one has √ (ω̃ ) Dk,1 = L/2; (ω̃ ) (k1 ,k2 ) Dk,l = α ω l−L , l = L0 + 1, · · · , 2L0 , k = (k1 , k2 ) ∈ K. 0 In order condition (31) is satisfied, we set (S.29) −(2ν0 +1) α2 ≤ C1 L0 with C1 ≤ min(K2 21−2ν0 , 1/8). Denote by Λ and Λ′ the probability tensors corresponding, respectively, to ω̃ and ω̃ ′ in T̃ . Then, due to (S.28) and the symmetry, kΛ − Λ′ k2 ≥ α2 m X m X k1 =1 k2 =k1 +1 kω (k1 ,k2 ) − ω ′(k1 ,k2 ) kH kΛ − Λ′ k2 ≤ α2 m(m − 1)(n/m)2 L0 ≤ α2 n2 L0 . 11  n 2 m ≥ α2 n2 L0 ; 8 Note that one has 1/4 ≤ Qk,l ≤ 3/4 provided kHT ω (k1 ,k2 ) k∞ ≤ 1/4 for (k1 , k2 ) ∈ K. By Assumption (33), the latter is guaranteed by α2 L20 /L ≤ 1/4, so that, due to L ≥ 2L0 and ν0 ≥ 1/2, it is ensured by (S.29). Then, by Lemma 7, one has K(PΛ , PΛ′ ) ≤ 8 kΛ − Λ′ k2 ≤ 8α2 n2 L0 ≤ log |T̃ |/8 provided α2 ≤ C2 (m/n)2 , where C2 is an absolute constant. Therefore, application of Theorem 2.5 of Tsybakov (2009) yields that ( ) b − Λk2 kΛ 1 inf sup PΛ ≥ ∆(n, L) ≥ 2 n L 4 c G∈Gm,L,s Λ C∈Z bal with ∆(n, m, L) = C α2 L0 /L where C is an absolute constant. Now, we denote C32 = (C2 /C1 )2−(2ν0 +1) and consider two cases. If n ≤ C3 mLν0 +1/2 , choose L0 = [(C1 /C2 )(n/m)2 ]1/(2ν0 +1) which leads to α2 = −(2ν +1) C1 L 0 0 = C2 (m/n)2 . It is easy to check that L0 ≥ 2 and that L0 ≤ L/2, so that  2ν0  C  m 2 2ν0 +1 ∆(n, m, L) = . L n If n > C3 mLν0+1/2 , choose α2 = C2 (m/n)2 and set L0 = L/2. Then, (S.29) holds and ∆(n, m, L) = C(m/n)2 which completes the proof of the lower bound in this case. 9.4. Proof of Theorem 5 . Denote WT = V and recall that S2 = CT C (l) where S2 is the diagonal matrix with entries Nk , the number of nodes in the pair of classes k = (k1 , k2 ) at time tl . Note that (CWT )J = CVJ , so that ΠC,J = CVJ [VJT CT CVj ]−1 VJT CT can be written as ΠC,J = CS−1 ΠS,J (CS−1 )T with ΠS,J = SVJ (VJT S2 VJ )−1 VJT S. Here, ΠS,J is the projection matrix on the column space of matrix SVJ . b C, b m, Since (d, b Jb) are solutions of optimization problem (38), for any J ∗ and d = vec(D∗ ), one has (S.30) b b k2 + 2ρn Pen(|J|, bW cT d b m) ka − C b (J) ≤ ka − C∗ W∗T d∗ (J) k2 + 2ρn Pen(|J|, m∗ ), 12 It follows from (18) that for any m, J, d and C ka − CWT d(J) k2 = k(a − C∗ W∗T d∗ ) + (C∗ W∗T d∗ − CWT d(J) )k2 = kξk2 + kCWT d(J) − C∗ W∗T d∗ k2 + 2ξ T (C∗ W∗T d∗ − CWT d(J) ). Hence, plugging the last identity into the inequality (S.30), derive that b b − C∗ W∗T d∗ k2 ≤ kC∗ W∗T d∗ (J) − C∗ W∗T d∗ k2 bW cT d (S.31) kC (J) + ∆ + ρn Pen(|J|, m∗ ) − ρn Pen(|Jb|, m), b b b − C∗ W∗T d∗ (J) )|. Note that, due to (22) and bW cT d where, ∆ = 2|ξ T (C (J) T b b c b b b a with a is given by (18), C∗ W∗T d∗ (J) = (23), one has CW d b = Π (J) C,J ΠC∗ ,J θ ∗ and C∗ W∗ T d∗ = θ ∗ . Therefore, (S.32) ∆ ≤ ∆1 + ∆2 + ∆3 , ⊥ ∗ T b ∗ ∆1 = 2|ξ T Π⊥ b Jbθ |, C∗ ,J θ |, ∆2 = 2|ξ ΠC, b b b ξ. ∆3 = 2ξ T Π C,J In order to obtain an upper bound for ∆1 and ∆2 , note that by Bernstein inequality, for any C, m, θ, J and for any x > 0 with probability at least 1 − 2e−x , one has q ⊥ 2 2xρn kΠ⊥ θ| ≤ 2 2|ξ T Π⊥ C,J C,J θk + 4/3 kΠ C,J θk∞ x. Due to 2ab ≤ a2 + b2 , obtain that with probability at least 1 − 2e−x   ⊥ 2 ⊥ (S.33) 2|ξ T Π⊥ θ| ≤ 0.5 kΠ θk + 4 ρ + kΠ θk /3 x n ∞ C,J C,J C,J Applying (S.33) to ∆1 with θ = θ ∗ and x = t > 0, using (39) and keeping in mind that kΛ∗ k∞ = kθ ∗ k∞ ≤ ρ∗n ≤ ρn , obtain (S.34) o n P ∆1 − 0.5 kC∗ W∗ T d∗ − C∗ W∗ T d∗ (J) k2 − 4 ρn (1 + B0 /3)t ≤ 0 ≥ 1−2e−t . In order to obtain an upper bound for ∆2 , note that, similarly to the proof of Theorem 1, one has b ⊥b bC∗ W∗ T d∗ k2 . bW cT d b b −C∗ W∗ T d∗ k2 ≥ k(IN L −Π b b b)C∗ W∗ T d∗ k2 = kΠ kC C,J C,J (J) Hence, due to condition (39), since kθ ∗ k∞ ≤ ρ∗n ≤ ρn , obtain  o  n ∗ b b − C∗ W∗T d∗ k2 ≤ 4 ρn + 1/3 kΠ b⊥ bW cT d θ k P ∆2 − 0.5 kC b b ∞ x ≥ C,J (J ) o n ∗ ∗T ∗ 2 b⊥ P ∆2 − 0.5 kΠ b JbC W d k − 4 ρn (1 + B0 /3)x ≤ 0 C, 13 b L) where R(m, J, L) is defined in (S.5). Applying inequalSet x = t+R(m, b J, ity (S.33) with θ = θ ∗ together with the union bound over m = 1, · · · , n, C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ) and J with |J| = 1, · · · , M L, we derive b b − C∗ W∗ T d∗ k2 bW cT d P {∆2 − 0.5 kC (J) (S.35) o −4 ρn (1 + B0 /3)(t + R(m, b Jb, L)) ≤ 0 ≥ 1 − 6e−t . For an upper bound for ∆3 , write bS b −1 Π bS b −1 )T ξ = 2η T Π b b b(C b b bη. ∆3 = 2ξ T C S,J S,J b = C, due to Corollary 5, vector η = (CS−1 )T ξ Here, for any fixed C has independent sub-Gaussian components such that, for any index i corresponding to a pair of nodes k = (k1 , k2 ) at time tl , one has (l) kη i k2ψ2 ≤ 1.5 e2 max(kθ ∗ k∞ , [Nk ]−1 ). Observe that, due to (10) and (27), (l) (l) (l) Nk1 ,k2 ≥ 0.5 nk1 nk2 ≥ 0.5 ℵ21 (n/m)2 . Therefore, kη i k2ψ2 ≤ ρm,n where ρm,n  2 3e2 ∗ 2 m max ρn , 2 2 . = 2 ℵ1 n Therefore, by Lemma 5.5 of Vershynin (2012), obtain that there exists an absolute constant C0 such that for any vector t one has E[exp(η T t)] ≤ exp(C0 ρm,n ktk2 ). Applying Lemma 3 with σ 2 = 2C0 ρm,n , derive that for any fixed C and J, one has P {2ηΠS,J η − 4C0 ρm,n (2|J| + 3t) ≤ 0} ≥ 1 − e−t . Again, taking a union bound over m = 1, · · · , n, C ∈ Zbal (m, n, n0 , L, ℵ1 , ℵ2 ) and J with |J| = 1, · · · , M L, we derive that, due to ρ∗n ≤ ρn , for some absolute constant C̃0 one has     m b2 b (S.36) b J , L) + t] ≤ 0 ≥ 1 − e−t . P ∆3 − C̃0 max ρn , 2 [R(m, n where R(m, J, L) is defined in (S.5). The rest of the proof of (40) is very similar to the proof of Theorem 1. In order to establish (41), follow the arguments of the proof of Corollary 2. 14 9.5. Proof of Theorem 6, Corollary 3 and Theorem 7 . This section contains proofs for the upper and the lower bounds for the risks in the case of graphon estimation. Proof of Theorem 6. To prove (45), we approximate the graphon by the DSBM and use inequality (21) in Theorem 1. In order to find an upper bound for the bias term, we need to cluster the nodes and create an approximate connectivity tensor Q. For this purpose, let h ≥ 1 be a positive integer and denote κj = 1 + [(βj − βj−1 )h] where [x] is the largest integer no larger than x. For k = 1, · · · , κj and j = 1, · · · , r, consider a set of intervals (1) (2) Uj,k = (Uj,k , Uj,k ] with (1) Uj,k = βj−1 +(k−1)/h, (2) Uj,k = min{βj−1 +k/h, βj }. Intervals Uj,k subdivide every interval (βj−1 , βj ] into κj sub-intervals of length at most 1/h and the total number of intervals is equal to m= r X κj . j=1 Re-number the intervals consecutively as U1 , · · · , Um and observe that since (βj − βj−1 )h ≤ κj ≤ 1 + (βj − βj−1 )h, one has (S.37) h ≤ m ≤ h + r. The value m in (S.37) acts as a number of classes. Indeed, if ζi ∈ Uk , we place node i into class Ωk and set Zi,j = I(j = k). Let Θ∗ be the true tensor of connection probabilities. Set Φ∗ = Θ∗ HT , Q = (ZT Z)−1 ZT Θ∗ and V = QHT . Since H is an orthogonal matrix, the bias term kCWT d(J) − θ ∗ k2 in the oracle inequality (21) is equal to kCWT d(J) − θ ∗ k2 = kZV(ρ) H − Θ∗ k2 = kZV(ρ) − ΘHT k2 (S.38) = kZV(ρ) − Φ∗ k2 = kZV(ρ) − Φ∗ (ρ) k2 + kΦ∗ − (Φ∗ )(ρ) k2 . The first term in the right-hand side of (S.38) describes how well the first Lρ columns of matrix V(ρ) represent the first Lρ columns (Φ∗ )(ρ) of matrix Φ∗ . The second term kΦ∗ − (Φ∗ )(ρ) k2 = kΘ∗ − (Φ∗ )(ρ) Hk2 evaluates how well Θ∗ is represented by Lρ columns of its coefficients in the transform H. The upper bound for kZV(ρ) − Φ∗ (ρ) k2 can be found by repeating the calculations in Lemma 2.1 of Gao et al. (2015) with the only difference that f is replaced by vl and there is an additional sum over l = 1, · · · Lρ . Then, we obtain (S.39) kZV(ρ) − Φ∗(ρ) k2 ≤ K1 22ν1 n2 Lρ h−2ν1 . 15 On the other hand, if ρ < 1, then by Assumption A, (S.40) kΦ∗ − (Φ∗ )(ρ) k2 ≤ n X n X L X i1 =1 i2 =1 l=Lρ +1 vl2 (ζi1 , ζi2 ) ≤ K2 n2 L−2ν2 ρ and kΦ∗ − (Φ∗ )(ρ) k2 = 0 if ρ = 1. Now, note that for given m and ρ, one has |J| ≤ m2 Lρ , so that   (S.41) Pen(|J|, m) ≤ C n log m + m2 Lρ log(25 L1−ρ ) . Therefore, (S.37)–(S.41) yield (45). Proof of Corollary 3. Note that if ν1 = ∞, one can set h = 2, so that the first term in (45) is equal to zero, h + r ≤ 3r and b − Λ∗ k2 EkΛ ≤C n2 L   I(ρ < 1)  r 2 1 + (1 − ρ) log L log r + + . L2ρν2 +1 n L1−ρ nL Minimizing this expression with respect to ρ ∈ [0, 1] obtain the result in (46) for r = rn,L . If r = r0 , then (S.42) b − Λ∗ k2 EkΛ ≤C n2 L  Lρ−1 I(ρ < 1) h2 log L log h + 2ρν2 +1 + 2 1−ρ + h2ν1 L n L nL  . Minimizing (S.42) with respect to h and ρ, obtain that the values h∗ and ∗ L∗ = Lρ delivering the minimum in (S.42) are such that h∗ ≍ (n2 / log L)1/(2(ν1 +1) . Hence, for some absolute constants C, one has log(h∗ ) ≤ C log n and n o ν1  ∗ L∗ = Lρ = min L, C n2 / log L (ν1 +1)(2ν2 +1) . Therefore, (46) holds for r = r0 . Proof of Theorem 7. We consider the cases when r = rn,L and r = r0 , corresponding to piecewise constant and piecewise smooth graphon, separately. Piecewise constant graphon. Assume, without loss of generality, that j = n/r is an integer. Consider a set up where the nodes are grouped into r classes and values of ζj ’s are fixed: ζkj+i = βk + (i − 1/2)(βk+1 − βk )/j, 16 k = 0, · · · , r − 1, i = 1, · · · , j. Then, there are j nodes in each class. Let Gk,k,l = 0 for any k = 1, · · · , r and l = 1, · · · , L. Consider an even number L0 such that 1 ≤ L0 ≤ L/2 and a set of vectors ω ∈ {0, 1}L0 with exactly L1 = L0 /2 nonzero entries. By Lemma 4.10 of Massart (2007), there exists a subset T of those vectors such that for any ω, ω ′ ∈ T one has (S.43) kω − ω ′ kH ≥ L0 /4, log |T | ≥ 0.233(L0 /2) log 2 ≥ 0.08L0 . Denote K = {(k1 , k2 ) : 1 ≤ kN 1 < k2 ≤ r} and let Tk1 ,k2 be the copies of T for (k1 , k2 ) ∈ K. Denote T̃ = (k1 ,k2 )∈K Tk1 ,k2 and observe that log |T̃ | = r(r − 1)/2 log |T | ≥ 0.02r 2 L0 . (k ,k ) Then, ω̃ ∈ T̃ are binary tensors with elements ω l 1 2 ,l = 1, · · · , L0 and (k1 , k2 ) ∈ K. Consider a set of functions f (ω̃ ) indexed by ω̃ such that, for βk1 −1 < x ≤ βk1 and βk2 −1 < y ≤ βk2 , their coefficients in the transform H are given by √ (ω̃ ) v1 (x, y) = L/2; (ω̃ ) vl (k ,k ) 1 2 (x, y) = αω l−L , l = L0 +1, · · · , 2L0 , (k1 , k2 ) ∈ K. 0 Then, Assumption (42) holds. In order condition (43) is satisfied, we set (S.44) −(2ν2 +1) α2 ≤ C1 L0 with C1 ≤ min(K2 21−2ν2 , 1/8). Denote by Λ and Λ′ the probability tensors corresponding, respectively, to ω̃ and ω̃ ′ in T̃ . Then, due to (S.43) and the symmetry, kΛ − Λ′ k2 ≥ 2α2 r X r X k1 =1 k2 =k1 +1 kω (k1 ,k2 ) − ω ′(k1 ,k2 ) kH kΛ − Λ′ k2 ≤ α2 r(r − 1)(n/r)2 L0 ≤ α2 n2 L0 .  n 2 r ≥ α2 n2 L0 ; 8 Note that one has 1/4 ≤ f (x, y, t) ≤ 3/4 provided kHT ω (k1 ,k2 ) k∞ ≤ 1/4 for for (k1 , k2 ) ∈ K. By Assumption (33), the latter is guaranteed by α2 L20 /L ≤ 1/4, so that, due to L ≥ 2L0 and ν2 ≥ 1/2, it is ensured by (S.44). Then, by Lemma 7, one has K(PΛ , PΛ′ ) ≤ 8 kΛ − Λ′ k2 ≤ 8α2 n2 L0 ≤ log |T̃ |/8 provided (S.45) α2 ≤ C2 (r/n)2 17 where C2 is an absolute constant. Therefore, application of Theorem 2.5 of Tsybakov (2009) yields (47) with ∆(n, L) = C α2 L0 /L where C is an absolute constant. Now, we denote C32 = (C2 /C1 )2−(2ν2 +1) and consider two cases. If n ≤ C3 rLν2+1/2 , choose L0 = [(C1 /C2 )(n/r)2 ]1/(2ν2 +1) which leads to α2 = −(2ν +1) C1 L 0 2 = C2 (r/n)2 . It is easy to check that L0 ≥ 2 and that L0 ≤ L/2, so that  2ν2  C  r 2 2ν2 +1 ∆(n, L) = . L n If n > C3 rLν2 +1/2 , choose α2 = C2 (r/n)2 and set L0 = L/2. Then, (S.44) holds and ∆(n, L) = C(r/n)2 which completes the proof of the lower bound when r = rn,L . Piecewise smooth graphon. Since r = r0 is a fixed quantity, without loss of generality, we set r = 1. Let ζj = j/n, j = 1, · · · , n, be fixed. Let h be a positive integer, 1 ≤ h ≤ n, and denote δ = 1/h. Consider a kernel function F (x) such that F (x) is n1 > ν1 times continuously differentiable and for any x, x′ ∈ R and some CF > 0 (S.46) supp(F ) = (−1/2; 1/2), |F (x) − F (x′ )| ≤ CF |x − x′ |ν1 . It follows from (S.46) that |F (x)| ≤ CF for any x. Denote Ψk1 ,k2 (x, y) = h−ν1 F (h(x − uk1 ))F (h(y − uk2 )) (S.47) where uk = (k − 1/2)δ, k = 1, · · · , h. It is easy to see that Ψk1 ,k2 (x, y) = Ψk2 ,k1 (y, x) and, for different pairs (k1 , k2 ), functions Ψk1 ,k2 (x, y) have disjoint supports. Similar to the case of the piecewise constant graphon, consider an even L0 ≤ L/2 and a set of vectors ω ∈ {0, 1}L0 with exactly L0 /2 nonzero entries. By Lemma 4.10 of Massart (2007), there exists a subset T of those vectors such that (S.43) holds for any ω, ω ′Q∈ T . Let again Tk1 ,k2 be the copies of T for (k1 , k2 ) ∈ K and denote T̃ = (k1 ,k2)∈K Tk1 ,k2 where K = {(k1 , k2 ) : 1 ≤ k1 < k2 ≤ h}. Then, log |T˜ | = h(h + 1)/2 log |T | ≥ 0.04 L0 h2 . (S.48) For any ω̃ ∈ T̃ and l = L0 + 1, · · · , 2L0 , define √ (ω̃ ) (S.49) v1 (x, y) = L/2; (ω̃ ) vl (x, y) = α h X h X (k ,k ) 1 2 ω l−L [Ψk1 ,k2 (x, y) + Ψk2 ,k1 (x, y)]. 0 k1 =1 k2 =k1 +1 18 It is easy to see that v(ω̃ ) (x, y) = v(ω̃ ) (y, x) for any x, y ∈ [0, 1]. Now we need to check that conditions (42) and (43) hold. Note that for any x, y, x′ , y ′ , due to (S.46), obtain  |Ψk1 ,k2 (x, y) − Ψk1 ,k2 (x′ , y ′ )| ≤ h−ν1 |F (h(x − uk1 ) − F (h(x′ − uk1 )||F (h(y − uk2 )| (S.50)  ν  +|F (h(y − uk2 ) − F (h(y ′ − uk2 )||F (h(x′ − uk1 )| ≤ Cψ |x − x′ | + |y − y ′ | 1 , where constant Cψ depends only on CF and ν1 . Since functions Ψk1 ,k2 (x, y) have disjoint supports for different pairs of indices (k1 , k2 ), the sums below have at most four nonzero terms. Then, (S.50) implies that (ω̃ ) vl (ω̃ ) (x, y) − vl ≤ 4α Cψ  (x′ , y ′ ) ≤ α k1 ,k2 =1 ν |x − x | + |y − y | 1 , ′ ′ h X |Ψk1 ,k2 (x, y) − Ψk1 ,k2 (x′ , y ′ )| so that (42) holds if α ≤ K1 /(4Cψ ). Also, it is easy to check that, by (S.46), (ω̃ ) one has [vl (x, y)]2 ≤ Cv2 α2 h−2ν1 where Cv depends only on CF and ν1 . Therefore, 2L0 X (ω̃ ) (l − 1)2ν2 [vl l=L0 +1 2 +1 (x, y)]2 ≤ Cv2 α2 h−2ν1 L2ν . 0 Hence, both assumptions, (42) and (43) are valid provided   p −(ν +1/2) K2 /Cv hν1 L0 2 . (S.51) α ≤ min K1 /(4Cψ ), Denote by Λ and Λ′ the probability tensors corresponding to ω̃ and ω̃ ′ in T̃ , respectively. Let ṽ(x, y) be a vector with ṽ1 (x, y) = 0 and ṽl (x, y) = vl (x, y) for l ≥ 2. By (33) and (S.49), since Ψk1 ,k2 (x, y) have disjoint supports, we derive that for any ω̃ ∈ T̃ one has √ √ |Λi,j,l − 1/2| ≤ kHṽ(x, y)k∞ ≤ kṽ(x, y)k1 / L ≤ Cv αL0 h−ν1 / L. Hence, Λi,j,l , Λ′i,j,l ∈ [1/4; 3/4] provided (S.52) α≤ √ L hν1 /(4Cv L0 ). 19 Then, by Lemma 7, since each ω ∈ T has exactly L0 /2 nonzero entries K(PΛ , PΛ′ ) ≤ 8kΛ − Λ′ k2 ≤ 8α2 L0 /2 = 16α2 h−2ν1 L0 n X h X i,j k1 ,k2 = 16α2 h−2ν1 L0 " n h XX i=1 k=1    i j 2 , 4 Ψk1 ,k2 n n n X h X i,j k1 ,k2 F 2 (h(i/n − uk1 ))F 2 (h(j/n − uk2 )) #2 F 2 (h(i/n − uk )) . Here, (S.53) h n X X i=1 k=1 ≈n F 2 (h(i/n − uk )) = h Z uk +δ/2 X k=1 uk −δ/2 h X k=1 X uk −δ/2<i/n≤uk +δ/2 F 2 (h(i/n − uk ))dx = n Z 1/2 F 2 (h(i/n − uk )) F 2 (z)dz, −1/2 so that (S.54) K(PΛ , PΛ′ ) ≤ 16 kF k42 α2 h−2ν1 n2 L0 where kF k2 is the L2 -norm of F . On the other hand, due to the first inequality in (S.43) and (S.53), obtain 2L n n r r kΛ − Λ′ k2 2α2 X0 X X X X (k1 ,k2 ) (k ,k ) − ω ′l 1 2 ]2 [Ψk1 ,k2 (i/n, j/n)]2 [ω l ≥ 2 n2 L n L l=L0 +1 k1 =1 k2 =k1 +1 i=1 j=1 " n h #2 α2 h−2ν1 L0 X X 2 α2 h−2ν1 L0 ≥ F (h(i/n − u )) kF k42 . ≥ k 4 n2 L 8L i=1 k=1 Application of Theorem 2.5 of Tsybakov (2009) yields that (47) holds with ∆(n, L) = C α2 h−2ν1 L0 /L provided K(PΛ , PΛ′ ) ≤ 1/8 log |T̃ |, which, due to (S.48) and (S.54), is guaranteed by 4kF k42 α2 h−2ν1 n2 L0 ≤ (1/8) (0.04L0 h2 )/2 and leads to the following restriction on α: √ (S.55) α ≤ hν1 +1 n−1 /(40 2kF k22 ). 20 Set (S.56) h=n 1 ν1 +1  , L0 = min n 2ν1 (ν1 +1)(2ν2 +1) L , 2    (ν1 +1)(2ν2 +1) 2ν1 L , nL = 2 and consider two cases. If n ≤ nL , then L0 is given by the first expression in (S.56) and inequalities (S.51), (S.52) and (S.55) hold if α2 is a small enough absolute constant that depends on ν1 , ν2 , K1 and K2 only. In this case, ∆(n, L) = − 4ν1 ν2 C L−1 n (ν1 +1)(2ν2 +1) and (48) is valid. If n > nL , then L0 = L/2 and again all inequalities (S.51), (S.52) and (S.55) hold if α2 is a small enough absolute constant that depends on ν1 , ν2 , K1 and K2 only. In this case, ∆(n, L) = C n the proof. 2ν1 1 +1 −ν which completes 9.6. Proofs of supplementary statements. In this section, we formulate and prove supplementary lemmas used in the proofs of other statements. Lemma 2. Let ai be independent Bernoulli(θi ) variables and consider vectors a and θ with components ai and θi , respectively. Then, for any vector z and any positive t and α one has (S.57)    P 2|zT (a − θ)| > αkzk2 + 2t/α ≤ 2e−t , E exp(zT (a − θ) ≤ exp(kzk2 /8). Proof. Validity of the Lemma follows from Hoeffding inequality (see, e.g., Massart (2007)). Lemma 3. Let ξ be a vector with independent components, Eξ = 0 and such that for any vector z and some σ > 0 one has   (S.58) E exp(zT ξ) ≤ exp(kzk2 σ 2 /2). Then, for any matrix A and any positive t one has   (S.59) P kAξk2 > σ 2 2kAk2 + 3 kAk2op t ≤ e−t . Proof. Denote Σ = AT A and use Theorem 2.1 of Hsu et al. (2012). Obtain, for any t > 0,    q 2 2 2 ≤ e−t . P kAξk > σ Tr(Σ) + 2 t Tr(Σ ) + 2t kΣkop 21 √ Note that Tr(Σ2 ) ≤ kΣkop Tr(Σ) and 2 xy ≤ x + y for any positive x and y. In order to complete the proof, recall that kΣkop = kAk2op and Tr(Σ) = kAk2 . Corollary 4. Let ai be independent Bernoulli(θi ) variables and consider vectors a and θ with components ai and θi , respectively. Then, for any matrix A and any positive t one has ! 2 2 3t kAk kAk op (S.60) P kA(a − θ)k2 > ≤ e−t . + 2 4 Proof. Denote ξ = a − θ and note that, due to (S.57), condition (S.58) holds with σ = 1/2. Lemma 4. (The packing lemma). Let Z(m, n) ⊆ M(m, n) be a collection of clustering matrices. Then, there exists a subset Sn,m (r) ⊂ Z(m, n) such that for C1 , C2 ∈ Z(m, n) one has kC1 − C2 kH = kC1 − C2 k2 ≥ r and log |Sn,m (r)| ≥ log |Z(m, n)| − r log(nem/r). Proof. For any clustering matrix C define the r-neighborhood of C as n o B(C, r) = C̃ ∈ Z(m, n) : kC̃ − CkH ≤ r . Let S̃n,m (r) be the covering set of Z(m, n) and |S̃n,m (r)| be the covering number, the smallest number of closed balls of radius r whose union covers Z(m, n). Let |Sn,m (r)| be the packing number of Z(m, n), the largest number of points with the distance at least r between them. It is known (see Pollard (1990), page 10) that (S.61) |S̃n,m (r)| ≤ |Sn,m (r)| ≤ |S̃n,m (r/2)| P Note that |Z(m, n)| ≤ C∈S̃n,m (r) |B(C, r)| ≤ |S̃n,m (r)| maxC∈S̃n,m (r) |B(C, r)|, so that , (S.62) |S̃n,m (r)| ≥ |Z(m, n)| max C∈S̃n,m (r) |B(C, r)| and, also, (S.63)    ne r  nem r n |B(C, r)| ≤ mr ≤ mr = . r r r 22 Now, combining (S.61) – (S.63), obtain log |Sn,m (r)| ≥ log |S̃n,m (r)| ≥ log |Z(m, n)|− r log(nem/r) which completes the proof. Lemma 5. Let γm and n/m be positive integers. Then, for n0 ≥ 1 and γm ≥ 2, one has (S.64) (S.65) (S.66) γn log(γm); log {(γn)!} − γm log {(n/m)!} ≥ 4        n  γn n0 mγ n n0 0 (n0 − 1)! ≥ n0 log ; log + log m n0 2 2 n0 6γn log(γm) − γn log(32 mγ e) ≥ 0. Proof. Note that due to (S.12), one has γm log A1 = log {(γn)!}−γm log {(n/m)!} ≈ γn log(γm)− 2 Consider a function 3γn x F (x) = log x − log 4 2  2πγn x  +   2πn 1 + log(2πγn). m 2 1 log(2πγn). 2 It is easy to check that F (1) = 0 and that F ′ (x) = 0.75 γn/x−0.5 log(2πγn/(xe)). Replacing 2πγn/(xe) in F ′ (x) by z and noting that the inequality 3e/(4π)z > log z is true for any z > 0, we confirm that F ′ (x) > 0. so that F (x) > 0 for any x ≥ 1. Finally, in order to prove (S.64), observe that A1 = F (γm) + γn log(γm)/4. For the sake of proving (S.65), note that for every n0 ≥ 1 one has log[(n0 − 1)!] ≥ 0.5 n0 log(n0 /2) and apply the first inequality in (S.12). The validity of inequality (S.66) follows from γm ≥ 2 and the fact that log(64e) < 6. Lemma 6. Let ai be independent Bernoulli(θi ) variables with 0 ≤ θi ≤ ρ < 1/2, i = 1, · · · , n. Denote ξi = ai − θi and (S.67) n 1 X ξi . ζ=√ n i=1 Then, ζ is a sub-Gaussian random variable with sub-Gaussian norm   1/p 3e2  1 −1/2 p E|ζ| ≤ (S.68) kζkψ2 = sup p max ρ, . 2 n p≥1 23 Proof. First, observe that we need to check inequality of the type (S.68) p ≤ only for an even integer p = 2m. Recall that kζkψ2 ≤ K0 provided √ E|ζ| √ p p/2 2m 2 2m (K0 p) = (K0 p) for every p ≥ 1. Suppose that E|ζ| ≤ (K1 2m) = (2K12 m)m for every integer m ≥ 1 and some some K1 > 0. For any p ≥ 1 choose m such that 2m − 2 < p ≤ 2m which implies 2m < p + 2. Then, p p p E|ζ|p ≤ Eζ 2m 2m ≤ (2K12 m)m 2m ≤ K12 (p + 2) 2 √ Observing that p + 2 ≤ 3p for p ≥ 1, obtain that E|ζ|p ≤ [( 3K1 )2 p]p/2 . Hence, (S.68) is valid provided that for any m ≥ 1 !2m n X 1 (S.69) E(ζ)2m = E √ ξi ≤ (e2 mρn )m , ρn = max(ρ, 1/n). n i=1 Note that E(ζ)2m = X E(ξim1 . . . ξiml ) 1 l nm where the sum is taken over all positive integers l, m1 , . . . , ml , i1 , . . . , il such that 2m = m1 + m2 + ml and i1 , . . . , il are distinct. Note that Eξi = 0 for every i, hence, in the sum the terms with ml = 1 are equal to zero. Therefore, (S.70) E(ζ)2m ≤ X S(m, l)P (n, l) l E(ξim1 1 . . . ξiml l ) nm where S(m, l) is the number of partitions of 2m unlabeled objects into l distinct subparts of size at least two, and P (m, l) is the number of ways of choosing l variables out of n (order matters since powers can be different):   2m − l − 1 n! S(m, l) = , P (n, l) = ≤ nl . l−1 (n − l)! Here, 2m − l − 1 ≥ l − 1, so that l ≤ m. Observe that due to Eξik = θi (1 − θi )[(−θi )k−1 + (1 − θi )k−1 ] ≤ ρ, (S.70) yields E(ζ)2m ≤ min(m,n)  X l=1  l 2m − l − 1 ρ . nm−l l−1 By considering the cases ρ ≥ 1/n and ρ < 1/n separately, it is easy to show that ρl ≤ [max(ρ, n−1 )]m = ρm n, nm−l 24 so that 2m E(ζ) ≤ ρm n min(m,n)  X l=0 2m − l l  ≤ ρm n ∞ X (2m)l l=0 l! 2m ≤ ρm = (e2 ρn )m n e which implies (S.69) and, hence, (S.68). Corollary 5. Let a ∈ [0, 1]n be a random vector with independent Bernoulli(θi ) components. Let ξ = a − θ and Z ∈ M(M, N ) be a clustering matrix with S2 = ZT Z = diag(N1 , · · · , NM ). Define η = S−1 ZT ξ. Then, vector η has independent sub-Gaussian components with kη k k2ψ2 ≤ 3e2 max(kθk∞ , Nk−1 ). 2 Proof. Validity of the Lemma follows from the fact that each η k is of the form (S.67) and is evaluated using a distinct set of components of vector ξ. Lemma 7. (Proposition 4.2 of Gao, Lu and Zhou (2015)) Let θ = {θi,j } ∈ [0, 1]n×n . Let Pθi,j denote the probability of Bernoulli (θi,j ) and the probability Pθ stands for the product measure Pθ = ⊗i,j Pθi,j . Then, for any θ, θ ′ ∈ [1/4, 3/4]n×n one has X ′ 2 (θi,j − θi,j ) . K(Pθ , Pθ ′ ) ≤ 8 i,j Marianna Pensky Department of Mathematics University of Central Florida Orlando FL 32816-1354, USA E-mail: [email protected] 25
10math.ST
Low Rank Approximation with Entrywise `1-Norm Error arXiv:1611.00898v1 [cs.DS] 3 Nov 2016 Zhao Song∗ [email protected] UT-Austin David P. Woodruff [email protected] IBM Almaden Peilin Zhong [email protected] Columbia University Abstract We study the `1 -low rank approximation problem, where for a given n × d matrix A and b for which approximation factor α ≥ 1, the goal is to output a rank-k matrix A b 1 ≤α· kA − Ak min rank-k matrices A0 kA − A0 k1 , Pn Pd where for an n × d matrix C, we let kCk1 = i=1 j=1 |Ci,j |. This error measure is known to be more robust than the Frobenius norm in the presence of outliers and is indicated in models where Gaussian assumptions on the noise may not apply. The problem was shown to be NP-hard by Gillis and Vavasis and a number of heuristics have been proposed. It was asked in multiple places if there are any approximation algorithms. We give the first provable approximation algorithms for `1 -low rank approximation, showing that it is possible to achieve approximation factor α = (log d)·poly(k) in nnz(A)+(n+d) poly(k) time, where nnz(A) denotes the number of non-zero entries of A. If k is constant, we further improve the approximation ratio to O(1) with a poly(nd)-time algorithm. Under the Exponential 1 Time Hypothesis, we show there is no poly(nd)-time algorithm achieving a (1 + log1+γ )(nd) approximation, for γ > 0 an arbitrarily small constant, even when k = 1. We give a number of additional results for `1 -low rank approximation: nearly tight upper and lower bounds for column subset selection, CUR decompositions, extensions to low rank approximation with respect to `p -norms for 1 ≤ p < 2 and earthmover distance, low-communication distributed protocols and low-memory streaming algorithms, algorithms with limited randomness, and bicriteria algorithms. We also give a preliminary empirical evaluation. ∗ Work done while visiting IBM Almaden. 1 Introduction Two well-studied problems in numerical linear algebra are regression and low rank approximation. In regression, one is given an n × d matrix A, and an n × 1 vector b, and one seeks an x ∈ Rd which minimizes kAx − bk under some norm. For example, for least squares regression one minimizes kAx − bk2 . In low rank approximation, one is given an n × d matrix A, and one seeks a rank-k b which minimizes kA − Ak b under some norm. For example, in Frobenius norm low rank matrix A  1/2 b F = P (Ai,j − A bi,j )2 approximation, one minimizes kA − Ak . Algorithms for regression are i,j often used as subroutines for low rank approximation. Indeed, one of the main insights of [DMM06b, DMM06a, Sar06, DMM08, CW09] was to use results for generalized least squares regression for Frobenius norm P low rank approximation. Algorithms for `1 -regression, in which one minimizes kAx − bk1 = i |(Ax)i − bi |, were also used [BD13, SW11] to fit a set of points to a hyperplane, which is a special case of entrywise P `1 -low rank approximation, the more general problem being to b bi,j |. find a rank-k matrix A minimizing i,j |Ai,j − A Randomization and approximation were introduced to significantly speed up algorithms for these problems, resulting in algorithms achieving relative error approximation with high probability. Such algorithms are based on sketching and sampling techniques; we refer to [Woo14b] for a survey. For least squares regression, a sequence of work [Sar06, CW13, MM13, NN13, LMP13, BDN15, Coh16] shows how to achieve algorithms running in nnz(A) + poly(d) time. For Frobenius norm low rank approximation, using the advances for regression this resulted in nnz(A) + (n + d) poly(k) time algorithms. For `1 -regression, sketching and sampling-based methods [Cla05, SW11, CDMI+ 13, CW13, MM13, LMP13, WZ13, CW15b, CP15] led to an nnz(A) + poly(d) time algorithm. Just like Frobenius norm low rank approximation is the analogue of least squares regression, entrywise `1 -low rank approximation is the analogue of `1 -regression. Despite this analogy, no non-trivial upper bounds with provable guarantees are known for `1 -low rank approximation. Unlike Frobenius norm low rank approximation, which can be solved exactly using the singular value decomposition, no such algorithm or closed-form solution is known for `1 -low rank approximation. Moreover, the problem was recently shown to be NP-hard [GV15]. A major open question is whether there exist approximation algorithms, sketching-based or otherwise, for `1 -low rank approximation. Indeed, the question of obtaining betters algorithms was posed in section 6 of [GV15], in [Exc13], and as the second part of open question 2 in [Woo14b], among other places. The earlier question of NP-hardness was posed in Section 1.4 of [KV09], for which the question of obtaining approximation algorithms is a natural followup. The goal of our work is to answer this question. We now formally define the `1 -low rank approximation problem: we are given an n × d matrix A and approximation factor α ≥ 1, and we would like, with large constant probability, to output a b for which rank-k matrix A b 1 ≤α· kA − Ak min rank-k matrices A0 kA − A0 k1 , (1) P P where for an n × d matrix C, we let kCk1 = ni=1 dj=1 |Ci,j |. This notion of low rank approximation has been proposed as a more robust alternative to Frobenius norm low rank approximation [KK03, KK05, KLC+ 15, Kwa08, ZLS+ 12, BJ12, BD13, BDB13, MXZZ13, MKP13, MKP14, MKCP16, PK16], and is sometimes referred to as `1 -matrix factorization or robust PCA. `1 -low rank approximation gives improved results over Frobenius norm low rank approximation since outliers are less exaggerated, as one does not square their contribution in the objective. The outlier values are often erroneous values that are far away from the nominal data, appear only a few times in the data matrix, and would not appear again under normal system operation. These works also argue `1 -low rank approximation can better handle missing data, is appropriate in noise models for which 1 the noise is not Gaussian, e.g., it produces the maximum likelihood estimator for Laplacian noise [Gao08, KAC+ 08, VT01], and can be used in image processing to prevent image occlusion [YZD12]. To see that `1 -low rank approximation and Frobenius  norm  low rank approximation can give very different results, consider the n × n matrix A = n0 B0 , where B is any (n − 1) × (n − 1) matrix with kBkF < n. The best rank-1 approximation with Frobenius norm error is given by b = n · e1 e> , where e1 is the first standard unit vector. Here A b ignores all but the first row and A 1 column of A, which may be undesirable in the case that this row and column represent an outlier. b 1 = kBk1 . If, for example, B is the all 1s matrix, then A b = [0, 0; 0, B] is a rank-1 Note kA − Ak b 1 = n, and therefore this solution is a much better solution to the approximation for which kA − Ak > 2 `1 -low rank approximation problem than n · e1 e> 1 , for which kA − n · e1 e1 k1 = (n − 1) . Despite the advantages of `1 -low rank approximation, its main disadvantage is its computationally intractability. It is not rotationally invariant and most tools for Frobenius low rank approximation do not apply. To the best of our knowledge, all previous works only provide heuristics. We provide hard instances for previous work in Section L, showing these algorithms at best give a poly(nd)-approximation (though even this is not shown in these works). We also mention why a related objective function, robust PCA [WGR+ 09, CLMW11, NNS+ 14, NYH14, CHD16, ZZL15], does not give a provable approximation factor for `1 -low rank approximation. Using that for√ an √ n × d matrix C, kCkF ≤ kCk1 ≤ ndkCkF , a Frobenius norm low rank approximation gives a nd approximation for `1 -low rank approximation. A bit better is to use algorithms for low rank approxb b imation with respect to the sum of distances, Pn i.e., to find a rank-k matrix A minimizing kA − Ak1,2 , where for an n × d matrix C, kCk1,2 = i=1 kCi k2 , where Ci is the i-th row of C. A sequence of work [DV07, FMSW10, FL11, SV12, CW15a] shows how to obtain an O(1)-approximation √ to this problem in nnz(A) √ + (n + d) poly(k) + exp(k) time, and using that kCk1,2 ≤ kCk1 ≤ dkCk1,2 results in an O( d)-approximation. There are also many variants of Frobenius norm low rank approximation for which nothing is known for `1 -low rank approximation, such as column subset selection and CUR decompositions, distributed and streaming algorithms, algorithms with limited randomness, and bicriteria algorithms. Other interesting questions include low rank approximation for related norms, such as `p -low rank bi,j )p . Note for b minimizing Pn Pd (Ai,j − A approximation in which one seeks a rank-k matrix A i=1 j=1 1 ≤ p < 2 these are also more robust than the SVD. 1.1 Our Results We give the first efficient algorithms for `1 -low rank approximation with provable approximation guarantees. By symmetry of the problem, we can assume d ≤ n. We first give an algorithm which runs in O(nnz(A)) + n · poly(k) time and solves the `1 -low rank approximation problem with approximation factor (log √ d) · poly(k). This is an exponential improvement over the previous approximation factor of O( d), provided k is not too large, and is polynomial time for every k. Moreover, provided nnz(A) ≥ n · poly(k), our time is optimal up to a constant factor as any relative error algorithm must spend nnz(A) time. We also give a hard instance for our algorithm ruling out log d 1/2−γ approximation for arbitrarily small constant γ > 0, and hard instances for a general k log k + k class of algorithms based on linear sketches, ruling out k 1/2−γ approximation. e Via a different algorithm, we show how to achieve an O(k)-approximation factor in e e 2) O(k) O(k poly(n)d 2 time. This is useful for constant k, for which it gives an O(1)-approximation in poly(n) time, improving the O(log d)-approximation for constant k of our earlier algorithm. The approximation ratio of this algorithm, although O(1) for constant k, depends on k. We also b in poly(n) time for constant k for which kA − Ak b 1 ≤ show one can find a rank-2k matrix A 2 C minrank-k matrices A0 kA − A0 k1 , where C > 1 is an absolute constant independent of k. We refer b instead of a rankto this as a bicriteria algorithm. Finally, one can output a rank-k matrix A, b 2k matrix A, in poly(n) time with the same absolute constant C approximation factor, under an b are integers in the range {−b, −b+1, . . . , b} for an integer additional assumption that the entries of A b ≤ poly(n). Unlike our previous algorithms, this last algorithm has a bit complexity assumption. Under the Exponential Time Hypothesis (ETH), we show there is no poly(n)-time algorithm 1 achieving a (1 + log1+γ )-approximation, for γ > 0 an arbitrarily small constant, even when k = 1. (n) The latter strengthens the NP-hardness result of [GV15]. We also give a number of results for variants of `1 -low rank approximation which are studied for Frobenius norm low rank approxiation; prior to our work nothing was known about these problems. Column Subset Selection and CUR Decomposition: In the column subset selection problem, one seeks a small subset C of columns of A for which there is a matrix X for which kCX − Ak is small, under some norm. The matrix CX provides a low rank approximation to A which is often more interpretable, since it stores actual columns of A, preserves sparsity, etc. These have been extensively studied when the norm is the Frobenius or operator norm (see, e.g., [BMD09, DR10, BDM11] and the references therein). We initiate the study of this problem with respect to the `1 -norm. We first prove an existence result, namely, that there exist matrices A for which any subset C of poly(k) columns satisfies minX kCX − Ak1 ≥ k 1/2−γ · minrank-k matrices A0 kA − A0 k1 , where γ > 0 is an arbitrarily small constant. This result is in stark contrast to the Frobenius norm for which for every matrix there exist O( k ) columns for which the approximation factor is 1 + . We also show that our bound is nearly optimal in this √ regime, by showing for every matrix there exists a subset of O(k log k) columns providing an O( k log k)-approximation. One can find such columns in poly(n)dO(k log k) time by enumerating and evaluating the cost of each subset. Although this is exponential in k, we show it is possible to find O(k log k) columns providing an √ O( k log k log d)-approximation in polynomial time for every k. We extend these results to the CUR decomposition problem (see, e.g., [DMM08, BW14]), in which one seeks a factorization CU R for which C is a subset of columns of A, R is a subset of rows of A, and kCU R − Ak is as small as possible. In the case of Frobenius norm, one can choose O(k/) columns and rows, have rank(U ) = k, have kCU R − AkF be at most (1 + ) times the optimal cost, and find the factorization in nnz(A) log n + n · poly(k/) time [BW14]. Using our column subset selection results, we give an nnz(A) + n · poly(k) time algorithm choosing O(k log k) columns and rows, for which rank(U ) = k, and for which kCU R − Ak1 is poly(k) log d times the cost of any rank-k approximation to A. `p -Low Rank Approximation and EMD-Low Rank Approximation: We also give the first algorithms with provable approximation guarantees for the `p -low rank approximation problem, 1 ≤ p < 2, in which we are given an n × d matrix A and approximation factor α ≥ 1, and would b for which like, with large constant probability, to output a rank-k matrix A b pp ≤ α · kA − Ak min rank-k matrices A0 kA − A0 kpp , (2) P P where for an n × d matrix C, kCkpp = ni=1 dj=1 |Ci,j |p . We obtain similar algorithms for this problem as for `1 -low rank approximation. For instance, we obtain an nnz(A) + n · poly(k) time algorithm with approximation ratio (log d) · poly(k). We also provide the first low rank approximab with a (log2 d) poly(k) tion with respect to sum of earthmover distances (of the n rows of A and A) approximation factor. This low rank error measure was used, e.g., in [SL09]. Sometimes such applications also require a non-negative factorization, which we do not provide. Distributed/Streaming Algorithms, and Algorithms with Limited Randomness: There is a growing body of work on low rank approximation in the distributed (see, e.g., [TD99, QOSG02, 3 BCL05, BRB08, MBZ10, FEGK13, PMvdG+ 13, KVW14, BKLW14, BLS+ 16, BWZ16, WZ16]) and streaming models (see, e.g., [McG06, CW09, KL11, GP13, Lib13, KLM+ 14, Woo14a]), though almost exclusively for the Frobenius norm. One distributed model is the arbitrary partition model [KVW14] in which there are s servers, each holding an n×d matrix Ai , and they would like to output a k × d matrix V > for which minU kU V > − Ak is as small as possible (or, a centralized coordinator e may want to output this). We give O(snk)-communication algorithms achieving a poly(k, log(n))approximation for `1 -low rank approximation in the arbitrary partition model, which is optimal for this approximation factor (see [BW14] where lower bounds for Frobenius norm approximation with poly(n) multiplicative approximation were shown - such lower bounds apply to `1 low rank approximation). We also consider the turnstile streaming model [Mut05] in which we receive positive or negative updates to its entries and wish to output a rank-k factorization at the end of the stream. e We give an algorithm using O(nk)+poly(k) space to achieve a poly(k, log(n))-approximation, which is space-optimal for this approximation factor, up to the degree of the poly(k) factor. To obtain e these results, we show our algorithms can be implemented using O(dk) random bits. We stress for all of our results, we do not make assumptions on A such as low coherence or condition number; our results hold for any n × d input matrix A. We report a promising preliminary empirical evaluation of our algorithms in Section L. Remark 1.1. We were just informed of the concurrent and independent work [CGK+ 16], which also obtains approximation algorithms for `1 -low rank approximation. That paper obtains a 2O(k) log de approximation in (log d)k poly(nd) time. Their algorithm is not polynomial time once k = Ω(log d), whereas we obtain a polynomial time algorithm for every k (in fact nnz(A) + (n + d) poly(k) time). Our approximation factor is also poly(k) log d, which is an exponential improvement over theirs in terms of k. In [CGK+ 16] they also obtain a 2k -approximation in poly(nd)dO(k) time. In contrast, e e 2 e we obtain an O(k)-approximation in poly(nd)dO(k) 2O(k ) time. The dependence in [CGK+ 16] on k in the approximation ratio is exponential, whereas ours is polynomial. 1.2 Technical Overview Initial Algorithm and Optimizations: Let A∗ be a rank-k matrix for which kA − A∗ k1 = minrank-k matrices A0 kA − A0 k1 . Let A∗ = U ∗ V ∗ be a factorization for which U ∗ is n × k and V ∗ is k × d. Suppose we somehow knew U ∗ and consider the multi-response `1 -regression problem P minV kU ∗ V − Ak1 = minV di=1 kU ∗ Vi − Ai k1 , where Vi , Ai denote the i-th columns of V and A, respectively. We could solve this with linear programming though this is not helpful for our argument here. Instead, inspired by recent advances in sketching for linear algebra (see, e.g., [Woo14b] for a surP vey), we could choose a random matrix S and solve minV kSU ∗ V − SAk1 = minV di=1 k(SU ∗ )Vi − SAi k1 . If V is an approximate minimizer of the latter problem, we could hope V is an approximate minimizer of former problem. If also S has a small number t of rows, then we could instead Pthe d solve minV i=1 k(SU ∗ )Vi − SAi k2 , that is, minimize the sum of Euclidean norms rather than the sum of `1√ -norms. Since t−1/2 k(SU ∗ )Vi − SAi k1 ≤ k(SU ∗ )Vi − SAi k2 ≤ k(SU ∗ )Vi − SAi k1 , we would obtain a t-approximation to the problem minV kSU ∗ V − SAk1 . A crucial observation is that the Pd solution to minV i=1 k(SU ∗ )Vi − SAi k2 is given by V = (SU ∗ )† SA, which implies that V is in the row span of SA. If also S were oblivious to U ∗ , then we could compute SA without ever knowing U ∗ . Having a low-dimensional space containing a good solution in its span is our starting point. For this to work, we need a distribution on oblivious matrices S with a small number of rows, for which an approximate minimizer V to minV kSU ∗ V − SAk1 is also an approximate minimizer to minV kU ∗ V − Ak1 . It is unknown if there exists a distribution on S with this property. What 4 is known is that if S has O(d log d) rows, then the Lewis weights (see, e.g., [CP15] and references therein) of the concatenated matrix [U ∗ , A] give a distribution for which the optimal V for the latter problem is a (1 + )-approximation to the former problem; see also earlier work on `1 -leverage scores [Cla05, DDH+ 09] which have poly(d) rows and the same (1 + )-approximation guarantee. Such distributions are √ not helpful here as (1) they are not oblivious, and (2) the number O(d log d) of rows gives an O( d log d) approximation factor, which is much larger than what we want. There are a few oblivious distributions S which are useful for single-response `1 -regression min kU ∗ v − ak1 for column vectors v, a ∈ Rk [SW11, CDMI+ 13, WZ13]. In particular, if S is an O(k log k) × n matrix of i.i.d. Cauchy random variables, then the solution v to min kSU ∗ v − Sak1 is an O(k log k)-approximation to min kU ∗ v − ak1 [SW11]. The important property of Cauchy random variables is that if X and Y are independent Cauchy random variables, then αX + βY is distributed as a Cauchy random variable times |α| + |β|, for any scalars α, β ∈ R. The O(k log k) approximation arises because all possible regression solutions are in the column span of [U ∗ , a] which is (k + 1)dimensional, and the sketch S gives an approximation factor of O(k log k) to preserve every vector norm in this subspace. If we instead had a multi-response regression problem min kSU ∗ V ∗ − SAk1 the dimension of the column span of [U ∗ , A] would be d + k, and this approach would give an O(d log d)-approximation. Unlike Frobenius norm multi-response regression min kSU ∗ V ∗ − SAkF , which can be bounded if S is a subspace embedding for U ∗ and satisfies an approximate matrix product theorem [Sar06], there is no convenient linear-algebraic analogue for the `1 -norm. We first note that since regression is a minimization problem, to obtain an O(α)-approximation by solving the sketched version of the problem, it suffices that (1) for the optimal V ∗ , we have kSU ∗ V ∗ −SAk1 ≤ O(α)kU ∗ V ∗ −Ak1 , and (2) for all V , we have kSU ∗ V −SAk1 ≥ Ω(1)·kU ∗ V −Ak1 . We show (1) holds for α = O(log d) and any number of rows of S. Our analysis follows by truncating the Cauchy random variables (SU ∗ Vj∗ − SAj )i for i ∈ [O(k log k)] and j ∈ [d], so that their expectation exists, and applying linearity of expectation across the d columns. This is inspired from an argument of Indyk [Ind06] for embedding a vector into a lower-dimensional vector while preserving its `1 -norm; for single-response regression this is the statement that kSU ∗ v ∗ − Sak1 = Θ(1)kU ∗ v − ak1 , implied by [Ind06]. However, for multi-response regression we have to work entirely with expectations, rather than the tail bounds in [Ind06], since the Cauchy random variables (SU ∗ Vj − SAj )i , while independent across i, are dependent across j. Moreover, our O(log d)-approximation factor is not an artifact of our analysis - we show in Section G that there is an n × d input matrix A for which  with probability  1 − 1/ poly(k), there is no k-dimensional log d 1/2−γ space in the span of SA achieving a t log t + k -approximation, for S a Cauchy matrix with t rows, where γ > 0 is an arbitrarily small constant. This shows (k log d)Ω(1) -inapproximability. Thus, the fact that we achieve O(log d)-approximation instead of O(1) is fundamental for a matrix S of Cauchy random variables or any scaling of it. While we cannot show (2), we instead show for all V , kSU ∗ V − SAk1 ≥ kU ∗ V − Ak1 /2 − O(log d)kU ∗ V ∗ − Ak1 if S has O(k log k) rows. This suffices for regression, since the only matrices V for which the cost is much smaller in the sketch space are those providing an O(log d) approximation in the original space. The guarantee follows from the triangle inequality: kSU ∗ V −SAk1 ≥ kSU ∗ V − SU ∗ V ∗ k1 − kSU ∗ V ∗ − SAk1 and the fact that S is known to not contract any vector in the column span of U ∗ if S has O(k log k) rows [SW11]. Because of this, we have kSU ∗ V − SU ∗ V ∗ k1 = Ω(1)kU ∗ V −U ∗ V ∗ k1 = Ω(1)(kU ∗ V −Ak1 −kU ∗ V ∗ −Ak1 ), where we again use the triangle inequality. We also bound the additive term kSU ∗ V ∗ − SAk1 by O(log d)kU ∗ V ∗ − Ak1 using (1) above. Given that SA contains a good rank-k approximation in its row span, our algorithm with a slightly worse poly(n) time and poly(k log(n))-approximation can be completely described here. Let S and T1 be independent O(k log k) × n matrices of i.i.d. Cauchy random variables, and let R 5 and T2 be independent d × O(k log k) matrices of i.i.d. Cauchy random variables. Let X = (T1 AR)† ((T1 AR)(T1 AR)† (T1 AT2 )(SAT2 )(SAT2 )† )k (SAT2 )† , which is the rank-k matrix minimizing kT1 ARXSAT2 − T1 AT2 kF , where for a matrix C, Ck is its b = ARXSA as the solution to `1 -low rank best rank-k approximation in Frobenius norm. Output A b is a poly(k log(n))-approximation. approximation of A. We show with constant probability that A To improve the approximation factor, after computing SA, we `1 -project each of the rows of A onto SA using linear programming or fast algorithms for `1 -regression [CW13, MM13], obtaining an n × d matrix B of rank O(k log k). We then apply the algorithm in the previous paragraph with A replaced by B. This ultimately leads to a log d · poly(k)-approximation. To improve the running time from poly(n) to nnz(A) + n · poly(k), we show a similar analysis holds for the sparse Cauchy matrices of [MM13]; see also the matrices in [WZ13]. CUR Decompositions: To obtain a CUR decomposition, we first find a log d·poly(k)-approximate b as above. Let B1 be an n × k matrix whose columns span those of A, b and rank-k approximation A ∗ consider the regression minV kB1 V − Ak1 . Unlike the problem minV kU V − Ak1 where U ∗ was unknown, we know B1 so can compute its Lewis weights efficiently, sample by them, and obtain a regression problem minV kD1 (B1 V − A)k1 where D1 is a sampling and rescaling matrix. Since kD1 (B1 V − A)k1 ≤ kD1 (B1 V − B1 V ∗ )k1 + kD1 (B1 V ∗ − A)k1 , where V ∗ = argminV kB1 V − Ak1 , we can bound the first term by O(kB1 V − B1 V ∗ k1 ) using that D1 is a subspace embedding if it has O(k log k) rows, while the second term is O(1)kB1 V ∗ − Ak1 by a Markov bound. Note that kB1 V ∗ − Ak1 ≤ (log d) · poly(k) minrank-k matrices A0 kA − A0 k1 . By switching to `2 as before, we see that Vb = (D1 B1 )† D1 A contains a (log d) poly(k)-approximation in its span. Here D1 A is an actual subset of rows of A, as required in a CUR decomposition. Moreover the subset size is O(k log k). We can sample by the Lewis weights of Vb to obtain a subset C of O(k log k) rescaled columns of A, together with a rank-k matrix U for which kCU R − Ak1 ≤ (log d) poly(k) minrank-k matrices A0 kA − A0 k1 . Algorithm for Small k: Our CUR decomposition shows how we might obtain an O(1)-approximation for constant k in poly(n) time. If we knew the Lewis weights of U ∗ , an α-approximate solution to the problem minV kD1 (U ∗ V − A)k1 would be an O(α)-approximate solution to the problem minV kU ∗ V √− Ak1 , where D1 is a sampling and rescaling matrix of O(k log k) rows of A. Moreover, an O( k log k)-approximate solution to minV kD1 (U√∗ V − A)k1 is given by V = (D1 U ∗ )† D1 A, which implies the O(k log k) rows of D1 A contain an O( k log k)-approximation. For small k, we can guess every subset of O(k log k) rows of A in nO(k log k) time (if d  n, by taking transposes at the beginning one can replace this with dO(k log k) time). For each guess, we set up the problem minrank-k U kU (D1 A)−Ak1 . If D2 is a sampling and rescaling matrix according to the Lewis weights of D1 A, then by a similar triangle√inequality argument as for our CUR decomposition, minimizing kU (D1 A)D2 − AD2 k1 gives an O( k log k) approximation. By switching to `2 , this implies there is an O(k log k)-approximation of the form AD2 W D1 A, where W is an O(k log2 k) × O(k log k) matrix of rank k. By setting up the problem minrank-k W kAD2 W D1 A − Ak1 , one can sample from Lewis weights on the left and right to reduce this to a problem independent of n and d, after which one can use polynomial optimization to solve it in exp(poly(k)) time. One of our guesses D1 A will be e correct, and for this guess we obtain an O(k)-approximation. For each guess we can compute its cost and take the best one found. This gives an O(1)-approximation for constant k, removing the O(log d)-factor from the approximation of our earlier algorithm. 6 Existential Results for Subset Selection: In our algorithm for small k, the first√step was to show there exist O(k log k) rows of A which contain a rank-k space which is an O( k log k)approximation. While for Frobenius norm one can find O(k) rows with an O(1)-approximation in their span, one of our main negative results for `1 -low rank approximation is that this is impossible, showing that the best approximation one can obtain with poly(k) rows is k 1/2−γ for an arbitrarily small constant γ > 0. Our hard instance is an r × (r + k) matrix A in which the first k columns are i.i.d. Gaussian, and the remaining r columns are an identity matrix. Here, r can be twice the number of rows one is choosing. The optimal `1 -low rank approximation has cost at most r, obtained by choosing the first k columns. Let R ∈ Rr/2×k denote the first k entries of the r/2 chosen rows, and let y denote the first k entries of an unchosen row. For r/2 > k, there exist many solutions x ∈ Rr/2 for which x> R = y. However, we can show the following tradeoff: whenever kx> R − yk1 < √ k poly(log k) , √ then kxk1 > k poly(log k) . Then no matter which√linear combination x> of the rows of R one chooses to approximate y by, k either one incurs a poly(log k) cost on the first k coordinates, or since A contains an identity matrix, √ one incurs cost kxk1 > k poly(log k) on the last r coordinates of x> R. P To show the tradeoff, consider an x ∈ Rr/2 . We decompose x = x0 + j≥1 xj , where xj agrees 1 with x on coordinates which have absolute value in the range √k log · [2−j , 2−j+1 ], and is zero c k otherwise. Here, c > 0 is a constant, and x0 denotes the restriction of x to all coordinates of √ 1 k absolute value at least √k logc k . Then kxk1 < logc k , as otherwise we are done. Hence, x0 has small support. Thus, one can build a small net for all x0 vectors by choosing the support, then placing a net on it. For xj for j > 0, the support sizes are increasing so the net size needed for all xj vectors is larger. However, since xj has all coordinates of roughly the same magnitude on its support, its `2 -norm is decreasing in j. Since (xj )> R ∼ N (0, kxj k22 Ik ), this makes it much less likely that individual coordinates of (xj )> R can be large. Since this probability goes down rapidly, we can over the larger net size. What we show is that for any sum of the Paffordj to union bound k form j≥1 x , at most 10 of its coordinates are at least log1 k in magnitude. √ For kx> R − yk1 to be at most logckk , for at least k2 coordinates i, we must have |(x> R − 1 2 y)i | < √k log With probability 1 − 2−Ω(k) , |yi | ≥ 100 on at least 2k c . 3 coordinates. From the k k previous paragraph, it follows there are at least k2 − 10 − k3 = Ω(k) coordinates i of x for which (1) P j 2 1 1 > |(x R − y)i | < √k logc k , (2) | j≥1 xi | < log k , and (3) |yi | ≥ 100 . On these i, (x0 )> Ri must be in 1 an interval of width log1 k at distance at least 100 from the origin. Since (x0 )> R ∼ N (0, kx0 k22 Ik ), for any value of kx0 k22 the probability this happens on Ω(k) coordinates is at most 2−Θ(k) . Since the net size for x0 is small, we can union bound over every sequence x0 , x1 , . . . , coming from our nets. Some care is needed to union bound over all possible subsets R of rows which can be chosen. We handle this by conditioning on a few events of A itself, which imply corresponding events for every subset of rows. These events are such that if R is the chosen set of half the rows, and S the remaining set of rows of A, then the event that a constant fraction of rows in S are close to the row span of R is 2−Θ(kr) , which is small enough to union bound over all choices of R. Curiously, we also show there are some matrices A ∈ Rn×d for which any `1 rank-k approximation in the entire row span of A cannot achieve better than a (2 − Θ(1/d))-approximation. 7 Bicriteria Algorithm: Our algorithm for small k gives an O(1)-approximation in poly(n) time for constant k, but the approximation factor depends on k. We show how one can find a rankb for which kA − Ak b 1 ≤ C · OPT, where C is an absolute constant, and OPT = 2k matrix A 0 minrank-k matrices A0 kA − A k1 . We first find a rank-k matrix B 1 for which kA − B 1 k1 ≤ p · OPT for a factor 1 ≤ p ≤ poly(n). We can use any of our algorithms above for this. Next consider the problem minV ∈Rk×d kU ∗ V − (A − B 1 )k1 , and let U ∗ V ∗ be a best `1 -low rank approximation to A − B 1 ; we later explain why we look at this problem. We can assume V ∗ is an `1 well-conditioned basis [Cla05, DDH+ 09], since we can replace U ∗ with U ∗ R−1 and V ∗ with RV ∗ 1 > ∗ for any invertible linear transformation R. For any vector x we then have kxk f ≤ kx V k1 ≤ ekxk1 , where 1 ≤ e, f ≤ poly(k). This implies all entries of U ∗ are at most 2f kA − Bk1 , as otherwise 1 one could replace U ∗ with 0n×k and reduce the cost. Also, any entry of U ∗ smaller than kA−Bk 100enkp ∗ can be replaced with 0 as this incurs additive error OPT 100 . If we round the entries of U to integer 1 ∗ multiples of kA−Bk 100enkp , then we only have O(enkpf ) possibilities for each entry of U , and still obtain an O(1)-approximation. We refer to the rounded U ∗ as U ∗ , abusing notation. Let D be a sampling and rescaling matrix with O(k log k) non-zero diagonal entries, corresponding to sampling by the Lewis weights of U ∗ . We do not know D, but handle this below. By the triangle inequality, for any V , kD(U ∗ V − (A − B 1 ))k1 = kD(U ∗ V − U ∗ V ∗ )k1 ± kD(U ∗ V ∗ − (A − B 1 ))k1 = Θ(1)kU ∗ V − U ∗ V ∗ k1 ± O(1)kU ∗ V ∗ − (A − B 1 )k1 , where the Lewis weights give kD(U ∗ V −U ∗ V ∗ )k1 = Θ(1)kU ∗ V −U ∗ V ∗ k1 and a Markov bound gives kD(U ∗ V ∗ − (A − B 1 ))k1 = O(1)kU ∗ V ∗ − (A − B 1 )k1 . Thus, minimizing kDU ∗ V − D(A − B 1 )k1 gives a fixed constant factor approximation to the problem minV ∈Rk×d kU ∗ V − (A − B 1 )k1 . The non-zero diagonal entries of D can be assumed to be integers between 1 and n2 . We guess the entries of DU ∗ and note for each entry there are only O(enkpf log(n2 )) possibilities. One of our guesses corresponds to Lewis weight sampling by U ∗ . We solve for V and by the guarantees of Lewis weights, the row span of this V provides an O(1)-approximation. We can find the corresponding U via linear programming. As mentioned above, we do not know D, but can enumerate over all D and all possible DU ∗ . The total time is npoly(k) . After finding U , which has k columns, we output the rank-2k space formed by the column span of [U, B 1 ]. By including the column span of B 1 , we ensure our original transformation of the problem minV ∈Rk×d kU ∗ · V − Ak1 to the problem minV ∈Rk×d kU ∗ · V − (A − B 1 )k1 is valid, since we can first use the column span of B 1 to replace A with A − B 1 . Replacing A with A − B 1 ultimately results in a rank-2k output. Had we used A instead of A − B 1 our output would have been rank kAk1 k but would have additive error poly(k/) . If we assume the entries of A are in {−b, −b + 1, . . . , b}, then we can lower bound the cost kU ∗ V − Ak1 , given that it is non-zero, by (ndb)−O(k) (if it is zero then we output A) using Lemma 4.1 in [CW09] and relating entrywise `1 -norm to Frobenius norm. We can go through the same arguments above with A − B replaced by A and our running time will now be (ndb)poly(k) . Hard Instances for Cauchy Matrices and More General Sketches: We consider a d × d matrix A = Id + (log d)e> 1 e, where e1 = (1, 0, . . . , 0) and e = (1, 1, . . . , 1) and Id is the d × d identity. For an O(k log k) × d matrix S of i.i.d. Cauchy random variables, SA = S + (log d)S1> e, where S1 is the first column of S. For a typical column of SA, all entries are at most poly(k) log d in magnitude. Thus, in order to approximate the first row of A, which is (log d)e, by x> SA for an x ∈ Rk log k , we 8 1 need kxk1 ≥ poly(k) . Also kx> Sk1 = Ω(kxk1 d log d) with 1 − exp(−k log k) probability, for d large enough, so by a net argument kxk1 ≤ poly(k) for all x. However, there are entries of SA that are very large, i.e., about one which is r = Θ(dk log k) in magnitude, and in general about 2i entries about r2−i in magnitude. These entries typically occur in columns Cj of SA for which all other entries in the column are bounded by poly(k) in magnitude. Thus, |x> Cj | ≈ r2−i for about 2i columns j. For each such column, if r2−i  log d, then we incur r log r d log d r2−i cost poly(k) in approximating the first row of A. In total the cost is poly(k) = poly(k) , but the optimal cost is at most d, giving a log d poly(k) log d lower bound. k log2 k 1/2−γ k lower bound for arbitrarily lower bound. We optimize this to a When k is large this bound deteriorates, but we also show a small constant γ > 0. This bound applies to any oblivious sketching matrix. The idea is similar to our row subset selection lower bound. Let A be as in our row subset selection lower bound, consider SA, and write S = U ΣV > in its full SVD. Then SA is in the row span of the top O(k log k) rows of V > A, since Σ only has O(k log k) non-zero singular values. Since the first k columns of A are rotationally invariant, V > A has first k columns i.i.d. Gaussian and remaining columns equal to V > . Call the first O(k log k) rows of V > A the matrix B. We now try to approximate a row of A by a vector in the row span of B. There are two issues that make this setting different from row subset selection: (1) B no longer contains an identity submatrix, and (2) the rows of B depend on the rows of A. We handle the first issue by building nets for subsets of coordinates of x> V > rather than x as before; since kx> V > k2 = kxk2 similar arguments can be applied. We handle the second issue by observing that if the number of rows of B is considerably smaller than that of A, then the distribution of B had we replaced a random row of A with zeros would be statistically close to i.i.d. Gaussian. Hence, typical rows of A can be regarded as being independent of B. Limited Independence, Distributed, and Streaming Algorithms: We show for an n × d matrix A, if we left-multiply by an O(k log k) × n matrix S in which each row is an independent vece tor of O(d)-wise independent Cauchy random variables, SA contains a poly(k) log d-approximation e in its span. This allows players in a distributed model to share a common S by exchanging O(kd) bits, independent of n. We use Lemma 2.2 of [KNW10] which shows for a reasonably smoothP approxP imation f to an indicator function, E[f (X)] = E[f (Y )] + O(), where X = i ai Xi , Y = i ai Yi , e a ∈ Rn is fixed, X is a vector of i.i.d. Cauchy random variables, and Y is a vector of O(1/)-wise independent random variables. To show the row span of SA contains a good rank-k approximation, we argue kSyk1 = Ω(kyk1 ) for a fixed y ∈ Rn with 1−exp(−k log k) probability. We apply the above lemma with  = Θ(1). We e also need for an n × d matrix A with unit-`1 columns, that kSAk1 = O(kd). We fool the expectation of a truncated Cauchy by taking a weighted sum of O(log(dk)) indicator functions and applying the e above lemma with  = Θ(1/d). An issue is there are Θ(kd) Cauchy random variables corresponding e to the entries of SA, some of which can be as large as Θ(kd), so to fool their expectation (after 2 e e e truncation) we need  = Θ(1/(dk)), resulting in O(dk ) seed length and ruining our optimal O(dk) communication. We show we can instead pay a factor of k in our approximation and maintain e O(dk)-wise independence. The distributed and streaming algorithms, given this, follow algorithms for Frobenius norm low rank approximation in [KVW14, BWZ16]. Hardness Assuming Exponential Time Hypothesis: By inspecting the proof of NP-hardness of [GV15], it at best gives a (1 + n1γ )-inapproximability for an arbitrarily small constant γ > 0. We 1 considerably strengthen this to (1 + log1+γ )-inapproximability by taking a modified version of the n n × n hard instance of [GV15] and planting it in a 2o(n) × 2o(n) matrix padded with tiny values. 9 Under the ETH, the maximum cut problem that [GV15] and that we rely on cannot be solved in 2o(n) time, so our transformation is efficient. Although we use the maximum cut problem as in [GV15] for our n × n hard instance, in order to achieve our inapproximability we need to use that under the ETH this problem is hard to approximate even if the input graph is sparse and even up to a constant factor; such additional conditions were not needed in [GV15]. `p -Low Rank Approximation and EMD-Low Rank Approximation: Our algorithms for entrywise `p -Norm Error are similar to our algorithms for `1 . We use p-stable random variables in place of Cauchy random variables, and note that the p-th power of a p-stable random variable has similar tails to that of a Cauchy, so many of the same arguments apply. Our algorithm for EMD low rank approximation immediately follows by embedding EMD into `1 . Counterexamples to Heuristics: Let A = diag(n2+γ , n1.5+ , B, B) ∈ R(2n+2)×(2n+2) where  ∈ (0, .5), γ > 0, and B is the n × n all 1s matrix. For this A we show the four heuristic algorithms [KK05, DZHZ06, Kwa08, BDB13] cannot achieve an nmin(γ,0.5−) approximation ratio when the rank parameter k = 3. 1.3 Several Theorem Statements, an Algorithm, and a Roadmap Algorithm 1 Main Meta-Algorithm 1: 2: 3: 4: 5: 6: 7: procedure L1LowRankApprox(A, n, d, k) . Theorem 1.2 Choose sketching matrix S (a Cauchy matrix or a sparse Cauchy matrix.) Compute SA, form C by C i ← arg minx kxSA − Ai k1 . Form B = C · SA. Choose sketching matrices T1 , R, D, T2 (Cauchy matrices or sparse Cauchy matrices.) Solve minX,Y kT1 BRXY DBT2 − T1 BT2 kF . return BRX,Y DB. end procedure Theorem 1.2 (Informal Version of Theorem C.6). Given A ∈ Rn×d , there is an algorithm which in nnz(A) + (n + d) · poly(k) time, outputs a (factorization of a) rank-k matrix A0 such that with kU V − Ak1 . probability 9/10, kA0 − Ak1 ≤ (log d) poly(k) min U ∈Rn×k ,V ∈Rk×d Theorem 1.3 (Informal Version of Theorem C.7). Given A ∈ Rn×d , there is an algorithm that e e 2 takes poly(n)dO(k) 2O(k ) time and outputs a rank-k matrix A0 such that, with probability 9/10, e kA0 − Ak1 ≤ O(k) min kU V − Ak1 . In addition, A0 is a CUR decomposition. U ∈Rn×k ,V ∈Rk×d Theorem 1.4 (Informal Version of Theorem G.28). For any k ≥ 1, and any constant c ≥ 1, let n = k c . There exists a matrix A such that for any matrix A0 in the span of n/2 rows of A, kA0 − Ak1 = Ω(k 0.5−α ) min kU V − Ak1 , where α > 0 is an arbitrarily small constant. U ∈Rn×k ,V ∈Rk×d Road map Section A introduces some notation and definitions. Section B includes several useful tools. We provide several `1 -low rank approximation algorithms in Section C. Section D contains the no contraction and no dilation analysis for our main algorithm. The results for `p and earth mover distance are presented in Section E and F. We provide our existential hardness results for Cauchy matrices, row subset selection and oblivious subspace embeddings in Section G. We provide our computational hardness results in Section H. We analyze limited independent random Cauchy variables in Section I. Section K presents the results for the distributed setting. Section J presents the results for the streaming setting. Section L contains the experimental results of our algorithm and several heuristic algorithms, as well as counterexamples to heuristic algorithms. 10 References [AB09] Sanjeev Arora and Boaz Barak. Computational complexity: a modern approach. Cambridge University Press, 2009. [ABIW09] Alexandr Andoni, Khanh Do Ba, Piotr Indyk, and David P Woodruff. Efficient sketches for earth-mover distance, with applications. In 50th Annual IEEE Symposium on Foundations of Computer Science, pages 324–330, 2009. [AGKM12] Sanjeev Arora, Rong Ge, Ravindran Kannan, and Ankur Moitra. Computing a nonnegative matrix factorization - provably. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012, pages 145–162, 2012. [AIK08] Alexandr Andoni, Piotr Indyk, and Robert Krauthgamer. Earth mover distance over high-dimensional spaces. In Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 343–352. Society for Industrial and Applied Mathematics, 2008. [Bas14] Saugata Basu. Algorithms in real algebraic geometry: a survey. arXiv preprint arXiv:1409.1534, 2014. [BCL05] Zheng-Jian Bai, Raymond H Chan, and Franklin T Luk. Principal component analysis for distributed data sets with updating. In Advanced Parallel Processing Technologies, pages 471–483. Springer, 2005. [BD13] J. Paul Brooks and José H. Dulá. The `1 -norm best-fit hyperplane problem. Appl. Math. Lett., 26(1):51–55, 2013. [BDB13] J. Paul Brooks, José H. Dulá, and Edward L Boone. A pure `1 -norm principal component analysis. Computational statistics & data analysis, 61:83–98, 2013. [BDL16] Amitabh Basu, Michael Dinitz, and Xin Li. Computing approximate PSD factorizations. CoRR, abs/1602.07351, 2016. [BDM11] Christos Boutsidis, Petros Drineas, and Malik Magdon-Ismail. Near optimal columnbased matrix reconstruction. In IEEE 52nd Annual Symposium on Foundations of Computer Science, FOCS 2011, Palm Springs, CA, USA, October 22-25, 2011, pages 305–314, 2011. [BDN15] Jean Bourgain, Sjoerd Dirksen, and Jelani Nelson. Toward a unified theory of sparse dimensionality reduction in euclidean space. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages 499–508, 2015. [BGS98] Mihir Bellare, Oded Goldreich, and Madhu Sudan. Free bits, pcps, and nonapproximability—towards tight results. SIAM Journal on Computing, 27(3):804– 915, 1998. [BIRW16] Arturs Backurs, Piotr Indyk, Ilya Razenshteyn, and David P Woodruff. Nearlyoptimal bounds for sparse recovery in generic norms, with applications to k-median sketching. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, pages 318–337. SIAM, 2016. 11 [BJ12] J. Paul Brooks and Sapan Jot. Pcal1: An implementation in r of three methods for `1 -norm principal component analysis. Optimization Online preprint, 2012. [BKLW14] Maria-Florina Balcan, Vandana Kanchanapally, Yingyu Liang, and David Woodruff. Improved distributed principal component analysis. NIPS, 2014. [BLS+ 16] Maria-Florina Balcan, Yingyu Liang, Le Song, David Woodruff, and Bo Xie. Distributed kernel principal component analysis. KDD, 2016. [BMD09] Christos Boutsidis, Michael W Mahoney, and Petros Drineas. An improved approximation algorithm for the column subset selection problem. In Proceedings of the twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 968–977. Society for Industrial and Applied Mathematics, 2009. [BPR96] Saugata Basu, Richard Pollack, and Marie-Françoise Roy. On the combinatorial and algebraic complexity of quantifier elimination. J. ACM, 43(6):1002–1045, 1996. [BPR05] Saugata Basu, Richard Pollack, and Marie-Francoise Roy. Algorithms in real algebraic geometry, volume 20033. Springer, 2005. [BRB08] Yann-Ael Le Borgne, Sylvain Raybaud, and Gianluca Bontempi. Distributed principal component analysis for wireless sensor networks. Sensors, 2008. [BW14] Christos Boutsidis and David P Woodruff. Optimal cur matrix decompositions. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 353–362. ACM, 2014. [BWZ16] Christos Boutsidis, David P Woodruff, and Peilin Zhong. Optimal principal component analysis in distributed and streaming models. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, pages 236–249. ACM, 2016. [CDMI+ 13] Kenneth L Clarkson, Petros Drineas, Malik Magdon-Ismail, Michael W Mahoney, Xiangrui Meng, and David P Woodruff. The fast cauchy transform and faster robust linear regression. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 466–477. Society for Industrial and Applied Mathematics, 2013. [CGK+ 16] Flavio Chierichetti, Sreenivas Gollapudi, Ravi Kumar, Silvio Lattanzi, and Rina Panigrahy. On robust low-rank approximation. ArXiv e-prints, 2016. [CHD16] Kai-Yang Chiang, Cho-Jui Hsieh, and Inderjit S Dhillon. Robust principal component analysis with side information. In Proceedings of The 33rd International Conference on Machine Learning, pages 2291–2299, 2016. [CK11] Imre Csiszar and János Körner. Information theory: coding theorems for discrete memoryless systems. Cambridge University Press, 2011. [Cla05] Kenneth L Clarkson. Subgradient and sampling algorithms for `1 regression. In Proceedings of the sixteenth annual ACM-SIAM symposium on Discrete algorithms, pages 257–266, 2005. 12 [CLM+ 15] Michael B Cohen, Yin Tat Lee, Cameron Musco, Christopher Musco, Richard Peng, and Aaron Sidford. Uniform sampling for matrix approximation. In Proceedings of the 2015 Conference on Innovations in Theoretical Computer Science, pages 181–190. ACM, 2015. [CLMW11] Emmanuel J Candès, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? Journal of the ACM (JACM), 58(3):11, 2011. [Coh16] Michael B. Cohen. Nearly tight oblivious subspace embeddings by trace inequalities. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016, pages 278–287, 2016. [CP15] Michael B. Cohen and Richard Peng. `p row sampling by lewis weights. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC ’15, pages 183–192, New York, NY, USA, 2015. ACM. [CW87] Don Coppersmith and Shmuel Winograd. Matrix multiplication via arithmetic progressions. In Proceedings of the nineteenth annual ACM symposium on Theory of computing, pages 1–6. ACM, 1987. [CW09] Kenneth L. Clarkson and David P. Woodruff. Numerical linear algebra in the streaming model. In Proceedings of the 41st Annual ACM Symposium on Theory of Computing, STOC 2009, Bethesda, MD, USA, May 31 - June 2, 2009, pages 205–214, 2009. [CW13] Kenneth L. Clarkson and David P. Woodruff. Low rank approximation and regression in input sparsity time. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 81–90, 2013. [CW15a] Kenneth L Clarkson and David P Woodruff. Input sparsity and hardness for robust subspace approximation. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on, pages 310–329. IEEE, 2015. [CW15b] Kenneth L Clarkson and David P Woodruff. Sketching for m-estimators: A unified approach to robust regression. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 921–939. SIAM, 2015. [DDH+ 09] Anirban Dasgupta, Petros Drineas, Boulos Harb, Ravi Kumar, and Michael W Mahoney. Sampling algorithms and coresets for `p regression. SIAM Journal on Computing, 38(5):2060–2078, 2009. [DMM06a] Petros Drineas, Michael W. Mahoney, and S. Muthukrishnan. Subspace sampling and relative-error matrix approximation: Column-based methods. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, 9th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems, APPROX 2006 and 10th International Workshop on Randomization and Computation, RANDOM 2006, Barcelona, Spain, August 28-30 2006, Proceedings, pages 316–326, 2006. [DMM06b] Petros Drineas, Michael W. Mahoney, and S. Muthukrishnan. Subspace sampling and relative-error matrix approximation: Column-row-based methods. In Algorithms 13 - ESA 2006, 14th Annual European Symposium, Zurich, Switzerland, September 1113, 2006, Proceedings, pages 304–314, 2006. [DMM08] Petros Drineas, Michael W. Mahoney, and S. Muthukrishnan. Relative-error CUR matrix decompositions. SIAM J. Matrix Analysis Applications, 30(2):844–881, 2008. [DR10] Amit Deshpande and Luis Rademacher. Efficient volume sampling for row/column subset selection. In Foundations of Computer Science (FOCS), 2010 51st Annual IEEE Symposium on, pages 329–338. IEEE, 2010. [DV07] Amit Deshpande and Kasturi R. Varadarajan. Sampling-based dimension reduction for subspace approximation. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing, San Diego, California, USA, June 11-13, 2007, pages 641–650, 2007. [DZHZ06] Chris Ding, Ding Zhou, Xiaofeng He, and Hongyuan Zha. R1-pca: rotational invariant `1 -norm principal component analysis for robust subspace factorization. In Proceedings of the 23rd international conference on Machine learning, pages 281–288. ACM, 2006. [Exc13] Stack Exchange. Low-rank matrix approximation in terms of entry-wise `1 norm, 2013. [FEGK13] Ahmed K Farahat, Ahmed Elgohary, Ali Ghodsi, and Mohamed S Kamel. Distributed column subset selection on mapreduce. In Data Mining (ICDM), 2013 IEEE 13th International Conference on, pages 171–180. IEEE, 2013. [FL11] Dan Feldman and Michael Langberg. A unified framework for approximating and clustering data. In Proceedings of the 43rd ACM Symposium on Theory of Computing, STOC 2011, San Jose, CA, USA, 6-8 June 2011, pages 569–578, 2011. [FLP15] Dimitris Fotakis, Michael Lampis, and Vangelis Th Paschos. Sub-exponential approximation schemes for csps: From dense to almost sparse. arXiv preprint arXiv:1507.04391, 2015. [FMSW10] Dan Feldman, Morteza Monemizadeh, Christian Sohler, and David P. Woodruff. Coresets and sketches for high dimensional subspace approximation problems. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, Austin, Texas, USA, January 17-19, 2010, pages 630–649, 2010. [FT07] Shmuel Friedland and Anatoli Torokhti. Generalized rank-constrained matrix approximations. SIAM Journal on Matrix Analysis and Applications, 29(2):656–659, 2007. [Gao08] Junbin Gao. Robust `1 principal component analysis and its bayesian variational inference. Neural computation, 20(2):555–572, 2008. [GP13] M. Ghashami and J.M. Phillips. Relative errors for deterministic low-rank matrix approximations. In SODA, 2013. [GV15] Nicolas Gillis and Stephen A Vavasis. On the complexity of robust pca and ell_1norm low-rank matrix approximation. arXiv preprint arXiv:1509.09236, 2015. 14 [GW95] Michel X Goemans and David P Williamson. Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. Journal of the ACM (JACM), 42(6):1115–1145, 1995. [Hås01] Johan Håstad. Some optimal inapproximability results. Journal of the ACM (JACM), 48(4):798–859, 2001. [Ind06] Piotr Indyk. Stable distributions, pseudorandom generators, embeddings, and data stream computation. Journal of the ACM (JACM), 53(3):307–323, 2006. [IP11] Piotr Indyk and Eric Price. K-median clustering, model-based compressive sensing, and sparse recovery for earth mover distance. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 627–636. ACM, 2011. [IPZ98] Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? In Foundations of Computer Science, 1998. Proceedings. 39th Annual Symposium on, pages 653–662. IEEE, 1998. [IT03] Piotr Indyk and Nitin Thaper. Fast image retrieval via embeddings. In Workshop on Statistical and Computational Theories of Vision (at ICCV), 2003. [KAC+ 08] Fredrik Kahl, Sameer Agarwal, Manmohan Krishna Chandraker, David Kriegman, and Serge Belongie. Practical global optimization for multiview geometry. International Journal of Computer Vision, 79(3):271–284, 2008. [KK03] Qifa Ke and Takeo Kanade. Robust subspace computation using `1 norm. Technical Report CMU-CS-03-172, Carnegie Mellon University, Pittsburgh, PA., 2003. [KK05] Qifa Ke and Takeo Kanade. Robust `1 norm factorization in the presence of outliers and missing data by alternative convex programming. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), volume 1, pages 739–746. IEEE, 2005. [KKMO07] Subhash Khot, Guy Kindler, Elchanan Mossel, and Ryan O’Donnell. Optimal inapproximability results for max-cut and other 2-variable csps? SIAM Journal on Computing, 37(1):319–357, 2007. [KL11] J. Kelner and A. Levin. Spectral sparsification in the semi-streaming setting. In Symposium on Theoretical Aspects of Computer Science (STACS), 2011. [KLC+ 15] Eunwoo Kim, Minsik Lee, Chong-Ho Choi, Nojun Kwak, and Songhwai Oh. Efficientnorm-based low-rank matrix approximations for large-scale problems using alternating rectified gradient method. IEEE transactions on neural networks and learning systems, 26(2):237–251, 2015. [KLM+ 14] Michael Kapralov, Yin Tat Lee, Cameron Musco, Christopher Musco, and Aaron Sidford. Single pass spectral sparsification in dynamic streams. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 561–570. IEEE, 2014. [KNW10] Daniel M Kane, Jelani Nelson, and David P Woodruff. On the exact space complexity of sketching and streaming small norms. In Proceedings of the twenty-first 15 annual ACM-SIAM symposium on Discrete Algorithms, pages 1161–1178. Society for Industrial and Applied Mathematics, 2010. [KV09] Ravi Kannan and Santosh Vempala. Spectral algorithms. Foundations and Trends in Theoretical Computer Science, 4(3-4):157–288, 2009. [KVW14] Ravindran Kannan, Santosh S Vempala, and David P Woodruff. Principal component analysis and higher correlations for distributed data. In Proceedings of The 27th Conference on Learning Theory, pages 1040–1057, 2014. [Kwa08] Nojun Kwak. Principal component analysis based on `1 -norm maximization. IEEE transactions on pattern analysis and machine intelligence, 30(9):1672–1680, 2008. [Lib13] Edo Liberty. Simple and deterministic matrix sketching. In KDD, pages 581–588. ACM, 2013. [LMP13] Mu Li, Gary L. Miller, and Richard Peng. Iterative row sampling. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 127–136, 2013. [LOG16] Wuchen Li, Stanley Osher, and Wilfrid Gangbo. Fast algorithm for earth mover’s distance based on optimal transport and `1 type regularization i. arXiv preprint arXiv:1609.07092, 2016. [LPW09] David Asher Levin, Yuval Peres, and Elizabeth Lee Wilmer. Markov chains and mixing times. American Mathematical Soc., 2009. [MBZ10] Sergio V Macua, Pavle Belanovic, and Santiago Zazo. Consensus-based distributed principal component analysis in wireless sensor networks. In Signal Processing Advances in Wireless Communications (SPAWC), 2010 IEEE Eleventh International Workshop on, pages 1–5. IEEE, 2010. [McG06] Andrew McGregor. Open problems in data streams and related topics. In IITK Workshop on Algorithms For Data Streams, 2006. [MKCP16] P. P. Markopoulos, S. Kundu, S. Chamadia, and D. A. Pados. Efficient `1 -Norm Principal-Component Analysis via Bit Flipping. ArXiv e-prints, 2016. [MKP13] Panos P. Markopoulos, George N. Karystinos, and Dimitrios A. Pados. Some options for `1 -subspace signal processing. In ISWCS 2013, The Tenth International Symposium on Wireless Communication Systems, Ilmenau, TU Ilmenau, Germany, August 27-30, 2013, pages 1–5, 2013. [MKP14] Panos P. Markopoulos, George N. Karystinos, and Dimitrios A. Pados. Optimal algorithms for `1 -subspace signal processing. IEEE Trans. Signal Processing, 62(19):5046– 5058, 2014. [MM13] Xiangrui Meng and Michael W Mahoney. Low-distortion subspace embeddings in input-sparsity time and applications to robust linear regression. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 91–100. ACM, 2013. 16 [Moi13] Ankur Moitra. An almost optimal algorithm for computing nonnegative rank. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6-8, 2013, pages 1454– 1464, 2013. [Mut05] S. Muthukrishnan. Data Streams: Algorithms and Applications. Foundations and Trends in Theoretical Computer Science, 1(2):117–236, 2005. [MXZZ13] Deyu Meng, Zongben Xu, Lei Zhang, and Ji Zhao. A cyclic weighted median method for `1 low-rank matrix factorization with missing entries. In AAAI, volume 4, page 6, 2013. [NN13] Jelani Nelson and Huy L Nguyên. Osnap: Faster numerical linear algebra algorithms via sparser subspace embeddings. In Foundations of Computer Science (FOCS), 2013 IEEE 54th Annual Symposium on, pages 117–126. IEEE, 2013. [NN14] Jelani Nelson and Huy L Nguyên. Lower bounds for oblivious subspace embeddings. In International Colloquium on Automata, Languages, and Programming, pages 883– 894. Springer, 2014. [NNS+ 14] Praneeth Netrapalli, UN Niranjan, Sujay Sanghavi, Animashree Anandkumar, and Prateek Jain. Non-convex robust pca. In Advances in Neural Information Processing Systems, pages 1107–1115, 2014. [NYH14] Feiping Nie, Jianjun Yuan, and Heng Huang. Optimal mean robust principal component analysis. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1062–1070, 2014. [Pin60] Mark S Pinsker. Information and information stability of random variables and processes. San Francisco: Holden-Day, 1964, originally published in Russian in 1960, 1960. [PK16] Young Woong Park and Diego Klabjan. Iteratively reweighted least squares algorithms for `1 -norm principal component analysis. arXiv preprint arXiv:1609.02997, 2016. [PMvdG+ 13] Jack Poulson, Bryan Marker, Robert A van de Geijn, Jeff R Hammond, and Nichols A Romero. Elemental: A new framework for distributed memory dense matrix computations. ACM Transactions on Mathematical Software (TOMS), 39(2):13, 2013. [PP+ 08] Kaare Brandt Petersen, Michael Syskind Pedersen, et al. The matrix cookbook. Technical University of Denmark, 7:15, 2008. [PSW16] Eric Price, Zhao Song, and David P. Woodruff. Fast regression with an `∞ guarantee. 2016. manuscript. [QOSG02] Yongming Qu, George Ostrouchov, Nagiza Samatova, and Al Geist. Principal component analysis for dimension reduction in massive distributed data sets. In Proceedings of IEEE International Conference on Data Mining (ICDM), 2002. [Ren92a] James Renegar. On the computational complexity and geometry of the first-order theory of the reals, part I: introduction. preliminaries. the geometry of semi-algebraic 17 sets. the decision problem for the existential theory of the reals. J. Symb. Comput., 13(3):255–300, 1992. [Ren92b] James Renegar. On the computational complexity and geometry of the first-order theory of the reals, part II: the general decision problem. preliminaries for quantifier elimination. J. Symb. Comput., 13(3):301–328, 1992. [RSW16] Ilya Razenshteyn, Zhao Song, and David P Woodruff. Weighted low rank approximations with provable guarantees. In Proceedings of the 48th Annual Symposium on the Theory of Computing, 2016. [RV10] Mark Rudelson and Roman Vershynin. Non-asymptotic theory of random matrices: extreme singular values. arXiv preprint arXiv:1003.2990, 2010. [Sar06] Tamás Sarlós. Improved approximation algorithms for large matrices via random projections. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Proceedings, pages 143–152, 2006. [SL09] Roman Sandler and Michael Lindenbaum. Nonnegative matrix factorization with earth mover’s distance metric. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 1873–1880. IEEE, 2009. [Str69] Volker Strassen. Gaussian elimination is not optimal. 13(4):354–356, 1969. [SV12] Nariankadu D. Shyamalkumar and Kasturi R. Varadarajan. Efficient subspace approximation algorithms. Discrete & Computational Geometry, 47(1):44–63, 2012. [SW11] Christian Sohler and David P Woodruff. Subspace embeddings for the `1 -norm with applications. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 755–764. ACM, 2011. [TD99] Françoise Tisseur and Jack Dongarra. A parallel divide and conquer algorithm for the symmetric eigenvalue problem on distributed memory architectures. SIAM Journal on Scientific Computing, 20(6):2223–2236, 1999. [TSSW00] Luca Trevisan, Gregory B Sorkin, Madhu Sudan, and David P Williamson. Gadgets, approximation, and linear programming. SIAM Journal on Computing, 29(6):2074– 2097, 2000. [Tsy09] Alexandre B Tsybakov. Introduction to nonparametric estimation. revised and extended from the 2004 french original. translated by vladimir zaiats, 2009. [Ver14] Sergio Verdú. Total variation distance and the distribution of relative information. In ITA, pages 1–3. Citeseer, 2014. [VT01] H. L. Van Trees. Detection, estimation, and modulation theory. Wiley, 1 edition, September 2001. [WGR+ 09] John Wright, Arvind Ganesh, Shankar Rao, Yigang Peng, and Yi Ma. Robust principal component analysis: Exact recovery of corrupted low-rank matrices via convex optimization. In Advances in neural information processing systems, pages 2080–2088, 2009. 18 Numerische Mathematik, [Wil12] Virginia Vassilevska Williams. Multiplying matrices faster than coppersmithwinograd. In Proceedings of the forty-fourth annual ACM symposium on Theory of computing, pages 887–898. ACM, 2012. [Woo14a] David P Woodruff. Low rank approximation lower bounds in row-update streams. In Advances in Neural Information Processing Systems, pages 1781–1789, 2014. [Woo14b] David P. Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends in Theoretical Computer Science, 10(1-2):1–157, 2014. [WZ13] David P. Woodruff and Qin Zhang. Subspace embeddings and `p -regression using exponential random variables. In COLT 2013 - The 26th Annual Conference on Learning Theory, June 12-14, 2013, Princeton University, NJ, USA, pages 546–567, 2013. [WZ16] David P Woodruff and Peilin Zhong. Distributed low rank approximation of implicit functions of a matrix. In ICDE, 2016. [Yao77] Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In Foundations of Computer Science, 1977., 18th Annual Symposium on, pages 222–227. IEEE, 1977. [YZD12] Linbin Yu, Miao Zhang, and Chris Ding. An efficient algorithm for `1 -norm principal component analysis. In 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1377–1380. IEEE, 2012. [ZLS+ 12] Yinqiang Zheng, Guangcan Liu, Shigeki Sugimoto, Shuicheng Yan, and Masatoshi Okutomi. Practical low-rank matrix approximation under robust `1 -norm. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, June 16-21, 2012, pages 1410–1417, 2012. [ZZL15] Huishuai Zhang, Yi Zhou, and Yingbin Liang. Analysis of robust pca via local incoherence. In Advances in Neural Information Processing Systems, pages 1819–1827, 2015. 19 Contents 1 Introduction 1.1 Our Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Technical Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Several Theorem Statements, an Algorithm, and a Roadmap . . . . . . . . . . . . . . 1 2 4 10 A Notation 22 B Preliminaries B.1 Polynomial system verifier . . . . . . . . . . . . . . . . . . . . . . . . B.2 Cauchy and p-stable transform . . . . . . . . . . . . . . . . . . . . . B.3 Lewis weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.4 Frobenious norm and `2 relaxation . . . . . . . . . . . . . . . . . . . B.5 Converting entry-wise `1 and `p objective functions into polynomials B.6 Converting entry-wise `1 objective function into a linear program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 22 23 23 24 25 25 C `1 -Low Rank Approximation C.1 Existence results via dense Cauchy transforms, sparse Cauchy transforms, Lewis weights C.2 Input sparsity time, poly(k, log n, log d)-approximation for an arbitrary matrix A . . C.3 poly(k, log d)-approximation for an arbitrary matrix A . . . . . . . . . . . . . . . . . e C.4 O(k)-approximation for an arbitrary matrix A . . . . . . . . . . . . . . . . . . . . . . C.5 Rank-2k and O(1)-approximation algorithm for an arbitrary matrix A . . . . . . . . C.6 CUR decomposition for an arbitrary matrix A . . . . . . . . . . . . . . . . . . . . . . C.7 Rank-r matrix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.7.1 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.7.2 poly(k, r)-approximation for rank-r matrix B . . . . . . . . . . . . . . . . . . 26 26 28 31 32 35 37 39 39 41 D Contraction and Dilation Bound for `1 D.1 Definitions . . . . . . . . . . . . . . . . . . . D.2 Properties . . . . . . . . . . . . . . . . . . . D.3 Cauchy embeddings, no dilation . . . . . . . D.4 Cauchy embeddings, no contraction . . . . . D.5 Cauchy embeddings, k-dimensional subspace D.6 Sparse Cauchy transform . . . . . . . . . . . D.7 `1 -Lewis weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 44 45 48 50 51 53 55 E `p -Low Rank Approximation E.1 Definitions . . . . . . . . . . E.2 Properties . . . . . . . . . . E.3 Tools and inequalities . . . E.4 Dense p-stable transform . . E.5 Sparse p-stable transform . E.6 `p -Lewis weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 57 58 62 63 64 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F EMD-Low Rank Approximation 66 F.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 F.2 Analysis of no contraction and no dilation bound . . . . . . . . . . . . . . . . . . . . 67 20 G Hardness results for Cauchy matrices, row subset selection, OSE G.1 Hard instance for Cauchy matrices . . . . . . . . . . . . . . . . . . . G.2 Hard instance for row subset selection . . . . . . . . . . . . . . . . . G.3 Hard instance for oblivious subspace embedding and more row subset G.3.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . G.3.2 Main results . . . . . . . . . . . . . . . . . . . . . . . . . . . . H Hardness H.1 Previous results . . . . . . . . . . . . . . . . . . . . . . . . . H.2 Extension to multiplicative error `1 -low rank approximation H.3 Usin the ETH assumption . . . . . . . . . . . . . . . . . . . H.4 Extension to the rank-k case . . . . . . . . . . . . . . . . . . I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 68 72 77 77 79 . . . . 91 92 92 94 97 Limited independent Cauchy random variables 101 I.1 Notations and Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 I.2 Analysis of limited independent random Cauchy variables . . . . . . . . . . . . . . . 101 J Streaming Setting 104 J.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 J.2 Turnstile model, poly(k, log(d), log(n)) approximation . . . . . . . . . . . . . . . . . 105 J.3 Row-update model, poly(k) log d approximation . . . . . . . . . . . . . . . . . . . . . 106 K Distributed Setting K.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K.2 Arbitrary-partition model, subspace, poly(k, log(d), log(n)) approximation . . . K.3 Arbitrary-partition model, decomposition, poly(k, log(d), log(n)) approximation K.4 Row-partition model, subspace, poly(k) log d approximation . . . . . . . . . . . K.5 Row-partition model, decomposition, poly(k) log d approximation . . . . . . . . . . . . . . . . . . . . . . . 108 110 110 112 112 114 L Experiments and Discussions L.1 Setup . . . . . . . . . . . . . . . . . . L.2 Counterexample for [DZHZ06] . . . . . L.3 Counterexample for [BDB13] . . . . . L.4 Counterexample for [Kwa08] . . . . . . L.5 Counterexample for [KK05] . . . . . . L.6 Counterexample for all . . . . . . . . . L.7 Discussion for Robust PCA [CLMW11] . . . . . . . . . . . . . . . . . . . . . 115 115 115 116 118 119 121 121 . . . . . . . M Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 21 A Notation Let N+ denote the set of positive integers. For any n ∈ N+ , let [n] denote the set {1, 2, · · · , n}. For any p ∈ [1, 2], the `p -norm of a vector x ∈ Rd is defined as kxkp = d X |xi |p 1/p . i=1 For any p ∈ [1, 2), the `p -norm of a matrix A ∈ Rn×d is defined as kAkp = n X d X |Aij |p 1/p . i=1 j=1 Let kAkF denote the Frobenius norm of matrix A. Let nnz(A) denote the number of nonzero entries of A. Let det(A) denote the determinant of a square matrix A. Let A> denote the transpose of A. Let A† denote the Moore-Penrose pseudoinverse of A. Let A−1 denote the inverse of a full rank square matrix. We use Aj to denote the j th column of A, and Ai to denote the ith row of A. For an n × d matrix A, for S a subset of [n] and T a subset of [d], we let AS denote the |S| × d submatrix of A with rows indexed by S, while AT denotes the n × |T | submatrix of A with columns indexed by T , and AST denote the |S| × |T | submatrix A with rows in S and columns in T . e ) to be f · logO(1) (f ). In addition to O(·) notation, for two For any function f , we define O(f functions f, g, we use the shorthand f . g (resp. &) to indicate that f ≤ Cg (resp. ≥) for an absolute constant C. We use f h g to mean cf ≤ g ≤ Cf for constants c, C. We use OPT to denote minrank −k Ak kAk − Ak1 , unless otherwise specified. B B.1 Preliminaries Polynomial system verifier Renegar [Ren92a, Ren92b] and Basu et al. [BPR96] independently provided an algorithm for the decision problem for the existential theory of the reals, which is to decide the truth or falsity of a sentence (x1 , · · · , xv )F (f1 , · · · , fm ) where F is a quantifier-free Boolean formula with atoms of the form sign(fi ) = σ with σ ∈ {0, 1, −1}. Note that this problem is equivalent to deciding if a given semi-algebraic set is empty or not. Here we formally state that theorem. For a full discussion of algorithms in real algebraic geometry, we refer the reader to [BPR05] and [Bas14]. Theorem B.1 (Decision Problem [Ren92a, Ren92b, BPR96]). Given a real polynomial system P (x1 , x2 , · · · , xv ) having v variables and m polynomial constraints fi (x1 , x2 , · · · , xv )∆i 0, ∀i ∈ [m], where ∆i is any of the “standard relations”: {>, ≥, =, 6=, ≤, <}, let d denote the maximum degree of all the polynomial constraints and let H denote the maximum bitsize of the coefficients of all the polynomial constraints. Then in (md)O(v) poly(H), time one can determine if there exists a solution to the polynomial system P . Recently, this technique has been used to solve a number of low-rank approximation and matrix factorization problems [AGKM12, Moi13, CW15a, BDL16, RSW16]. 22 B.2 Cauchy and p-stable transform Definition B.2 (Dense Cauchy transform). Let S = σ · C ∈ Rm×n where σ is a scalar, and each entry of C ∈ Rm×n is chosen independently from the standard Cauchy distribution. For any matrix A ∈ Rn×d , SA can be computed in O(m · nnz(A)) time. Definition B.3 (Sparse Cauchy transform). Let Π = σ·SC ∈ Rm×n , where σ is a scalar, S ∈ Rm×n has each column chosen independently and uniformly from the m standard basis vectors of Rm , and C ∈ Rn×n is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution. For any matrix A ∈ Rn×d , ΠA can be computed in O(nnz(A)) time. Definition B.4 (Dense p-stable transform). Let p ∈ (1, 2). Let S = σ · C ∈ Rm×n where σ is a scalar, and each entry of C ∈ Rm×n is chosen independently from the standard p-stable distribution. For any matrix A ∈ Rn×d , SA can be computed in O(m nnz(A)) time. Definition B.5 (Sparse p-stable transform). Let p ∈ (1, 2). Let Π = σ · SC ∈ Rm×n , where σ is a scalar, S ∈ Rm×n has each column chosen independently and uniformly from the m standard basis vectors of Rm , and C ∈ Rn×n is a diagonal matrix with diagonals chosen independently from the standard p-stable distribution. For any matrix A ∈ Rn×d , ΠA can be computed in O(nnz(A)) time. B.3 Lewis weights We follow the exposition of Lewis weights from [CP15]. Definition B.6. For a matrix A, let ai denote ith row of A, and ai (= (Ai )> ) is a column vector. The statistical leverage score of a row ai is def > −1 > −1/2 τi (A) = a> ai k22 . i (A A) ai = k(A A) For a matrix A and norm p, the `p Lewis weights w are the unique weights such that for each row i we have wi = τi (W 1/2−1/p A). or equivalently 2/p > 1−2/p a> A)−1 ai = wi . i (A W Lemma B.7 (Lemma 2.4 of [CP15] and Lemma 7 of [CLM+ 15]). Given a matrix A ∈ Rn×d , n ≥ d, for any constant C > 0, 4 > p ≥ 1, there is an algorithm which can compute C-approximate `p Lewis weights for every row i of A in O((nnz(A) + dω log d) log n) time, where ω < 2.373 is the matrix multiplication exponent[Str69, CW87, Wil12]. n×d (n ≥ d) with ` (4 > p ≥ 1) Lewis Lemma B.8 (Theorem 7.1 of [CP15]). Given matrix p P A∈R weights w, for any set of sampling probabilities pi , i pi = N , pi ≥ f (d, p)wi , 1/p if S ∈ RN ×n has each row chosen independently as the ith standard basis vector, times 1/pi , with probability pi /N , then with probability at least 0.999, 1 ∀x ∈ Rd , kAxk1 ≤ kSAxk1 ≤ 2kAxk1 2 Furthermore, if p = 1, N = O(d log d). If 1 < p < 2, N = O(d log d log log d). If 2 ≤ p < 4, N = O(dp/2 log d). 23 B.4 Frobenious norm and `2 relaxation Theorem B.9 (Generalized rank-constrained matrix approximations, Theorem 2 in [FT07]). Given matrices A ∈ Rn×d , B ∈ Rn×p , and C ∈ Rq×d , let the SVD of B be B = UB ΣB VB> and the SVD of C be C = UC ΣC VC> . Then, B † (UB UB> AVC CC> )k C † = kA − BXCkF , arg min rank −k X∈Rp×q where (UB UB> AVC VC> )k ∈ Rp×q is of rank at most k and denotes the best rank-k approximation to UB UB> AVC VC> ∈ Rp×d in Frobenious norm. Claim B.10 (`2 relaxation of `p -regression). Let p ∈ [1, 2). For any A ∈ Rn×d and b ∈ Rn , define x∗ = arg minkAx − bkp and x0 = arg minkAx − bk2 . Then, x∈Rd x∈Rd kAx∗ − bkp ≤ kAx0 − bkp ≤ n1/p−1/2 · kAx∗ − bkp . Proof. The lower bound trivially holds by definition; we will focus on proving the upper bound. Because Ax − b is an n-dimensional vector, ∀x, 1 n1/p−1/2 kAx − bkp ≤ kAx − bk2 ≤ kAx − bkp . (3) Then, kAx0 − bkp √ ≤ nkAx0 − bk2 √ ≤ nkAx∗ − bk2 √ ≤ nkAx∗ − bkp by LHS of Equation (3) by x0 = arg minkAx − bk2 x by RHS of Equation (3) This completes the proof. Claim B.11 (Frobenius norm relaxation of `p -low rank approximation). Let p ∈ [1, 2) and for any matrix A ∈ Rn×d , define A∗ = arg min kB − Akp and A0 = arg min kB − AkF . Then rank −k B∈Rn×d rank −k B∈Rn×d kA∗ − Akp ≤ kA0 − Akp ≤ (nd)1/p−1/2 kA∗ − Akp . (4) Proof. The lower bound of kA0 − Akp trivially holds by definition. We show an upper bound of kA0 − Akp in the rest of the proof. For any A0 − A ∈ Rn×d , we have 1 (nd)1/p−1/2 kA0 − Akp ≤ kA0 − AkF ≤ kA0 − Akp . Then, kA0 − Akp ≤ (nd)1/p−1/2 kA0 − AkF 1/p−1/2 ≤ (nd) by LHS of Equation (5) ∗ by A0 = arg min kB − Akp kA − AkF rank −k B 1/p−1/2 ≤ (nd) ∗ kA − Akp . by RHS of Equation (5) 24 (5) B.5 Converting entry-wise `1 and `p objective functions into polynomials Claim B.12 (Converting absolute value constraints into variables). Given m polynomials f1 (x), f2 (x), · · · , fm (x) where x ∈ Rv , solving the problem minv m X x∈R |fi (x)|, (6) i=1 is equivalent to solving another minimization problem with O(m) extra constraints and m extra variables, m X min v x∈R ,σ∈Rm σi fi (x) i=1 s.t. σi2 = 1, ∀i ∈ [m] fi (x)σi ≥ 0, ∀i ∈ [m]. Claim B.13. (Handling `p ) Given m polynomials f1 (x), f2 (x), · · · , fm (x) where x ∈ Rv and p = a/b for positive integers a and b, solving the problem minv x∈R m X |fi (x)|p , (7) i=1 is equivalent to solving another minimization problem with O(m) extra constraints and O(m) extra variables, min v m X x∈R ,σ∈Rm yi i=1 s.t. σi2 = 1, ∀i ∈ [m] fi (x)σi ≥ 0, ∀i ∈ [m] (σi fi (x))a = yib , ∀i ∈ [m] yi ≥ 0, ∀i ∈ [m]. B.6 Converting entry-wise `1 objective function into a linear program Claim B.14. Given any matrix A ∈ Rn×d and matrix B ∈ Rk×d , the problem minU ∈Rn×k kU B−Ak1 can be solved by solving the following linear program, min U ∈Rn×k ,x∈Rn×d n X m X xi,j i=1 j=1 Ui B j − Ai,j ≤ xi,j , ∀i ∈ [n], j ∈ [d] Ui B j − Ai,j ≥ −xi,j , ∀i ∈ [n], j ∈ [d] xi,j ≥ 0, ∀i ∈ [n], j ∈ [d], where the number of constraints is O(nd) and the number of variables is O(nd). 25 C `1 -Low Rank Approximation This section presents our main `1 -low rank approximation algorithms. Section C.1 provides our three existence results. Section C.2 shows an input sparsity algorithm with poly(k) log2 d log napproximation ratio. Section C.3 improves the approximation ratio to poly(k) log d. Section C.4 e explains how to obtain O(k) approximation ratio. Section C.5 improves the approximation ratio to O(1) by outputting a rank-2k solution. Section C.6 presents our algorithm for CUR decomposition. Section C.7 includes some useful properties. Our `1 -low rank approximation algorithm for a rank-r (where k ≤ r ≤ (n, d) ) matrix is used as a black box (by setting r = poly(k)) in several other algorithms. C.1 Existence results via dense Cauchy transforms, sparse Cauchy transforms, Lewis weights The goal of this section is to present the existence results in Corollary C.2. We first provide some bicriteria algorithms in Theorem C.1 which can be viewed as a “warmup”. Then the proof of our bicriteria algorithm actually implies the existence results. Theorem C.1. Given matrix A ∈ Rn×d , for any k ≥ 1, there exist bicriteria algorithms with running time T (specified below), which output two matrices U ∈ Rn×m , V ∈ Rm×d such that, with probability 9/10, kU V − Ak1 ≤ α min kAk − Ak1 . rank −k Ak (I). Using a dense Cauchy transform, √ T = poly(n, d, k), m = O(k log k), α = O( k log k log d). (II). Using a sparse Cauchy transform, T = poly(n, d, k),m = O(k 5 log5 k), α = O(k 4.5 log4.5 k log d). (III). Sampling by Lewis weights, √ e T = (nd)O(k) , m = O(k log k), α = O( k log k). The matrices in (I), (II), (III) here, are the same as those in (I), (II), (III), (IV) of Lemma D.11. Thus, they have the properties shown in Section D.2. Proof. We define OPT := min rank −k Ak kAk − Ak1 . We define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution such that kU ∗ V ∗ − Ak1 = OPT . Part (I). Apply the dense Cauchy transform S ∈ Rm×n with m = O(k log k) rows, and β = O(log d). Part (II). Apply the sparse Cauchy transform S(= Π ∈ Rm×n ) with m = O(k 5 log5 k) rows, and β = O(σ log d) = O(k 2 log2 k log d). Part (III). Use S (= D ∈ Rn×k ) to denote an n × n matrix which is a sampling and rescaling diagonal matrix according to the Lewis weights of matrix U ∗ . It has m = O(k log k) rows, and β = O(1). Sometimes we abuse notation, and should regard D as a matrix which has size m × n, where m = O(k log k). We can just replace M in Lemma D.11 with U ∗ V ∗ − A, replace U in Lemma D.11 with U ∗ , and replace c1 c2 with O(β). So, we can apply Lemma D.11 for S. Then we can plug it in Lemma D.8, 26 we have: with constant probability, for any c ≥ 1, for any V 0 ∈ Rk×d which satisfies kSU ∗ V 0 − SAk1 ≤ c · min kSU ∗ V − SAk1 , (8) kU ∗ V 0 − Ak1 ≤ c · O(β)kU ∗ V ∗ − Ak1 . (9) V ∈Rk×d it has Define Vbi = arg minkSU ∗ Vi − SAi k2 for each i ∈ [d]. By using Claim B.10 with n = m and Vi ∈Rk d = k, it shows kSU ∗ Vb − SAk1 = d X kSU ∗ Vbi − SAi k1 ≤ i=1 d X √ mkSU ∗ Vei − SAi k1 = √ m min kSU ∗ V − SAk1 . i=1 V ∈Rk×d √ which means Vb is a m-approximation solution to problem, min kSU ∗ V − SAk1 . V ∈Rk×d Now, let us look into Equation (8) and Equation (9), we can obtain that √ kU ∗ Vb − Ak1 ≤ mO(β) OPT . Because Vbi is the optimal solution of the `2 regression problem, we have Vbi = (SU ∗ )† SAi ∈ Rk , ∀i ∈ [d], which means Vb = (SU ∗ )† SA ∈ Rk×d . Plugging Vb into original problem, we obtain kU ∗ (SU ∗ )† · SA − Ak1 ≤ √ mO(β) OPT . It means min rank −k X∈Rn×m kXSA − Ak1 ≤ √ mO(β) OPT . (10) If we ignore the constraint on the rank of X, we can get a bicriteria solution: For part (I), notice that X is an n × m matrix which can be found by using a linear program, because matrices SA ∈ Rm×d and A ∈ Rn×d are known. For part (II), notice that X is an n × m matrix which can be found by using a linear program, because matrices SA ∈ Rm×d and A ∈ Rn×d are known. For part (III), notice that X is an n × m matrix which can be found by using a linear program, when the span of rows of DA ∈ Rm×d is known. We assume that D is known in all the above discussions. But D is actually unknown. So we need to try all the possible choices of the row span of DA. Since D samples at most m log k) rows of A, then the total number of choices of  = O(k n selecting m rows from n rows is m = nO(k log k) . This completes the proof. Equation (10) in the proof of our bicriteria solution implies the following result, Corollary C.2. Given A ∈ Rn×d , there exists a rank-k matrix A0 ∈ Rn×d such that A0 ∈ rowspan(S 0 A) ⊆ rowspan(A) and kA0 − Ak1 ≤ α · min kA − Ak k1 , where S 0 ∈ Rm×n is a rank −k Ak sketching matrix. If S 0 √ (I). indicates the dense Cauchy transform, then α = O( k log k log d). 4.5 4.5 (II). indicates the sparse Cauchy transform, then α = O(k √ log k log d). (III). indicates sampling by Lewis weights, then α = O( k log k). 27 Proof. Define OPT = min U ∈Rn×k ,V ∈Rk×d kU V − Ak1 . Proof of (I). Choose S to be a dense Cauchy transform matrix with m rows, then √ min kU ZSA − Ak1 ≤ O( m log d) OPT, U ∈Rn×k ,Z∈Rk×m where m = O(k log k). Choosing A0 = U ZSA completes the proof. Proof of (II). Choose Π = SD ∈ Rm×n where S ∈ Rm×n has each column chosen independently and uniformly from the m standard basis vectors of Rm , and where D is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution, then √ min kU ZΠA − Ak1 ≤ O( mσ log d) OPT, U ∈Rn×k ,Z∈Rk×m where m = O(k 5 log5 k) and σ = O(k 2 log2 k). Choosing A0 = U ZΠA completes the proof. Proof of (III). Choose D to be the sampling and rescaling matrix corresponding to the Lewis weights of U ∗ , and let it have m = O(k log k) nonzero entries on the diagonal, then √ kU ZDA − Ak1 ≤ O( m) OPT . min U ∈Rn×k ,Z∈Rk×m Choosing A0 = U ZDA completes the proof. C.2 Input sparsity time, poly(k, log n, log d)-approximation for an arbitrary matrix A The algorithm described in this section is actually worse than the algorithm described in the next section. But this algorithm is easy to extend to the distributed and streaming settings (See Section K and Section J). Algorithm 2 Input Sparsity Time Algorithm 1: 2: 3: 4: 5: 6: 7: 8: procedure L1LowRankApproxInputSparsity(A, n, d, k) e 5 ), t2 ← O(k). e Set s ← r ← t1 ← O(k Choose sparse Cauchy matrices S ∈ Rs×n , R ∈ Rd×r , T1 ∈ Rt1 ×n . Choose dense Cauchy matrices T2 ∈ Rd×t2 . Compute S · A, A · R and T1 · A · T2 . Compute XY = arg minX,Y kT1 ARXY SAT2 − T1 AT2 kF . return ARX, Y SA. end procedure . Theorem C.3 Theorem C.3. Given matrix A ∈ Rn×d , for any k ≥ 1, there exists an algorithm which takes O(nnz(A)) + (n + d) · poly(k) time and outputs two matrices U ∈ Rn×k , V ∈ Rk×d such that kU V − Ak1 ≤ O(poly(k) log n log2 d) holds with probability 9/10. 28 min rank −k Ak kAk − Ak1 Proof. Choose a Cauchy matrix S ∈ Rs×n (notice that S can be either a dense Cauchy transform matrix or a sparse Cauchy transform matrix). Using Corollary C.2, we have min U ∈Rn×k ,Z∈Rk×s kU ZSA − Ak1 ≤ αs OPT, where αs is the approximation by using matrix S. If S is a dense Cauchy transform matrix, then √ due to Part (I) of Corollary C.2, αs = O( k log k log d), s = O(k log k), and computing SA takes O(s nnz(A)) time. If S is a sparse Cauchy transform matrix, then due to Part II of Corollary C.2, e 4.5 log d), s = O(k e 5 ), and computing SA takes nnz(A) time. αs = O(k We define U ∗ , Z ∗ = arg minU,Z kU ZSA − Ak1 . For the fixed Z ∗ ∈ Rk×s , choose a Cauchy matrix R ∈ Rd×r (note that R can be either a dense Cauchy transform matrix or a sparse Cauchy transform matrix) and sketch on the right of (U ZSA − A). If R is a dense Cauchy transform matrix, then αr = O(log n), r = O(k log k), computing AR takes O(r · nnz(A)) time. If R is a sparse Cauchy e 2 ) log n, r = O(k e 5 ), computing AR takes O(nnz(A)) time. transform matrix, then αr = O(k j j ∗ † b = A R((Z SA)R) ∈ Rk . Then Define a row vector U b j Z ∗ SAR − Aj Rk2 = min kx> Z ∗ SAR − Aj Rk2 . ∀j ∈ [n], kU x∈Rk Recall that r is the number of columns of R. Due to Claim B.10, n X n √ X kAj R((Z ∗ SA)R)† Z ∗ SAR − Aj Rk1 ≤ O( r) min kU j Z ∗ SAR − Aj Rk1 , j=1 j=1 U j ∈Rk which is equivalent to √ kAR((Z ∗ SA)R)† Z ∗ SAR − ARk1 ≤ O( r) min kU Z ∗ SAR − ARk1 , U ∈Rn×k where AR is an n × r matrix and SA is an s × d matrix. Using Lemma D.8, we obtain, √ kAR((Z ∗ SA)R)† Z ∗ SA − Ak1 ≤ O( rαr ) min kU Z ∗ SA − Ak1 . U ∈Rn×k We define X ∗ ∈ Rr×k , Y ∗ ∈ Rk×s , X ∗, Y ∗ = arg min kARXY SA − Ak1 . X∈Rr×k ,Y ∈Rk×s Then, kARX ∗ Y ∗ SA − Ak1 ≤ kAR((Z ∗ SA)R)† Z ∗ SA − Ak1 √ ≤ O( rαr ) min kU Z ∗ SA − Ak1 U ∈Rn×k √ = O( rαr ) min kU ZSA − Ak1 U ∈Rn×k ,Z∈Rk×s √ ≤ O( rαr αs ) OPT . √ It means that ARX ∗ , Y ∗ SA gives an O(αr αs r)-approximation to the original problem. Thus it suffices to use Lemma C.4 to solve min X∈Rr×k ,Y ∈Rk×s kARXY SA − Ak1 , 29 by losing an extra poly(k) log d factor in the approximation ratio. By using a sparse Cauchy transform (for the place discussing the two options), combining the approximation ratios and running times all together, we can get poly(k) log(n) log2 (d)-approximation ratio with O(nnz(A)) + (n + d) poly(k) running time. This completes the proof. Lemma C.4. Given matrices A ∈ Rn×d , SA ∈ Rs×n ,RA ∈ Rr×d where S ∈ Rs×n , R ∈ Rd×r with min(n, d) ≥ max(r, s). For any 1 ≤ k ≤ min(r, s), there exists an algorithm that takes O(nnz(A)) + (n + d) poly(s, r, k) time to output two matrices X 0 ∈ Rr×k , Y 0 ∈ Rk×s such that kARX 0 · Y 0 SA − Ak1 ≤ poly(r, s) log(d) min X∈Rr×k ,Y ∈Rk×s kARXY SA − Ak1 holds with probability at least .999. Proof. Choose sketching matrices T1 ∈ Rt1 ×n to sketch on the left of (ARXY SA − A) (note that S can be either a dense Cauchy transform matrix or a sparse Cauchy transform matrix). If T1 is a dense Cauchy transform matrix, then t1 = O(r log r), αt1 = O(log d), and computing T1 A takes e 2 ) log d, e 5 ), αt = O(r O(t1 · nnz(A)) time. If T1 is a sparse Cauchy transform matrix, then t1 = O(r 1 and computing T1 A takes nnz(A) time. Choose dense Cauchy matrices T2> ∈ Rt2 ×d to sketch on the right of T1 (ARXY SA − A) with t2 = O((t1 + s) log(t1 + s)). We get the following minimization problem, min X∈Rr×k ,Y ∈Rk×s kT1 ARXY SAT2 − T1 AT2 k1 . (11) Define X 0 , Y 0 to be the optimal solution of min X∈Rr×k ,Y ∈Rk×s kT1 ARXY SAT2 − T1 AT2 kF . Due to Claim B.11, kT1 ARX 0 Y 0 SAT2 − T1 AT2 k1 ≤ √ t1 t2 min X∈Rr×k ,Y ∈Rk×s kT1 ARXY SAT2 − T1 AT2 k1 . Due to Lemma D.10 kARX 0 Y 0 SA − Ak1 ≤ √ t1 t2 αt1 log t1 min X∈Rr×k ,Y ∈Rk×s kARXY SA − Ak1 . It remains to solve min X∈Rr×k ,Y ∈Rk×s kT1 ARXY SAT2 − T1 AT2 kF . By using Theorem B.9 and choosing T1 to be a sparse Cauchy transform matrix, we have that the optimal rank-k solution X 0 Y 0 is (T1 AR)† (UB UB> (T1 AT2 )VC VC> )k (SAT2 ) which can be computed in O(nnz(A)) + (n + d) poly(s, r, k) time. Here, UB are the left singular vectors of T1 AR. VC are the right singular vectors of SAT2 . An alternative way of solving Equation (11) is using a polynomial system verifier. Note that a polynomial system verifier does not allow absolute value constraints. Using Claim B.12, we are able to remove these absolute value constraints by introducing new constraints and variables. Thus, we can get a better approximation ratio but by spending exponential running time in k. In the previous step, we should always use a dense Cauchy transform to optimize the approximation ratio. 30 Corollary C.5. Given A ∈ Rn×d , there exists an algorithm which takes nd · poly(k) + (n + d) · 2O(k time and outputs two matrices U ∈ Rn×k , V ∈ Rk×d such that e kU V − Ak1 ≤ O(poly(k) log n log2 d) min rank −k Ak 2) kAk − Ak1 holds with probability 9/10. The poly(k) factor in the above corollary is much smaller than that in Theorem C.3. C.3 poly(k, log d)-approximation for an arbitrary matrix A In this section, we explain how to get an O(log d) · poly(k) approximation. Algorithm 3 poly(k) log d-approximation Algorithm 1: 2: 3: 4: 5: 6: 7: procedure L1LowRankApproxPolykLogd(A, n, d, k) . Theorem C.6 e 5 ). Set s ← O(k Choose sparse Cauchy matrices S ∈ Rs×n and compute S · A. Implicitly obtain B = UB VB by finding VB = SA ∈ Rs×d and UB ∈ Rn×s where ∀i ∈ [n], row vector (UB )i gives an O(1) approximation to minx∈R1×s kxSA − Ai k1 . U, V ←L1LowRankApproxB(UB , VB , n, d, k, s). . Theorem C.19 return U, V . end procedure Intuitively, our algorithm has two stages. In the first stage, we just want to find a low rank matrix B which is a good approximation to A. Then, we can try to find a rank-k approximation to B. Since now B is a low rank matrix, it is much easier to find a rank-k approximation to B. The procedure L1LowRankApproxB(UB , VB , n, d, k, s) corresponds to Theorem C.19. Theorem C.6. Given matrix A ∈ Rn×d , for any k ≥ 1, there exists an algorithm which takes nnz(A) + (n + d) · poly(k) time to output two matrices U ∈ Rn×k , V ∈ Rk×d such that kU V − Ak1 ≤ poly(k) log d min rank −k Ak kAk − Ak1 holds with probability 9/10. Proof. We define OPT := min rank −k Ak kAk − Ak1 . The main idea is to replace the given n × d matrix A with another low rank matrix B which also has size n × d. Choose S ∈ Rs×n to be a Cauchy matrix, where s ≤ poly(k) (note that, if S is a dense Cauchy transform matrix, computing SA takes O(s nnz(A)) time, while if S is a sparse Cauchy transform matrix, computing SA takes O(nnz(A)) time). Then B is obtained by taking each row of A and replacing it with its closest point (in `1 -distance) in the row span of SA. By using Part II of Corollary C.2, we have, √ min kU ZSA − Ak1 ≤ O( s poly(k) log d) OPT . U ∈Rn×k ,Z∈Rk×s We define B to be the product of two matrices UB ∈ Rn×s and VB ∈ Rs×d . We define VB to be SA and UB to be such that for any i ∈ [n], (UB )i gives an O(1)-approximation to problem 31 min kxSA − Ai k1 . This can be solved using an `1 -regression solver in nnz(A) + (n + d) poly(s) x∈R1×s time. By the definition of B, it is an n × d matrix. Naïvely we can write down B after finding UB and VB . The time for writing down B is O(nd). To avoid this, we can just keep a factorization UB and VB . We are still able to run algorithm L1LowRankApproxB. Because s = poly(k), the running time of algorithm L1LowRankApproxB is still O(nnz(A)) + (n + d) poly(k). By the definition of B, we have that B has rank at most s. Suppose we then solve `1 -low rank approximation problem for rank-s matrix B, finding a rank-k g-approximation matrix U V . Due to Lemma C.15, we have that if B is an f -approximation solution to A, then U V is also an O(f g)-approximation solution to A, kU V − Ak1 ≤ O(log d) · poly(k) · g OPT . Using Theorem C.19 we have that g = poly(s), which completes the proof. C.4 e O(k)-approximation for an arbitrary matrix A e Algorithm 4 O(k)-approximation Algorithm 1: 2: 3: 4: 5: 6: 7: 8: 9: procedure L1LowRankApproxK(A, n, d, k) . Theorem C.7 r ← O(k log k), m ← t1 ← O(r log r), t2 ← O(m log m). Guess a diagonal matrix R ∈ Rd×d with only r 1s. . R selects r columns of A ∈ Rn×d . n×n Compute a sampling and rescaling matrix D ∈ R , T1 ∈ Rn×n corresponding to the Lewis weights of AR, and let them have m, t1 nonzero entries on the diagonals, respectively. Compute a sampling and rescaling matrix T2> ∈ Rd×d according to the Lewis weights of (DA)> , and let it have t2 nonzero entries on the diagonal. Solve minX,Y kT1 ARXY DAT2 − T1 AT2 k1 . Take the best solution X, Y over all guesses of R. return ARX, Y DA. end procedure Theorem C.7. Given matrix A ∈ Rn×d , there exists an algorithm that takes poly(n) · dO(k) · 2O(k time and outputs two matrices U ∈ Rn×k , V ∈ Rk×d such that e e |U V − Ak1 ≤ O(k) min rank −k Ak e 2) kAk − Ak1 holds with probability 9/10. Proof. We define OPT := min rank −k Ak kAk − Ak1 . Let U ∗ ∈ Rn×k , V ∗ ∈ Rk×d satisfy kU ∗ V ∗ − Ak1 = OPT . Let S > ∈ Rd×d denote the sampling and rescaling matrix corresponding to the Lewis weights of (V ∗ )> , where the number of nonzero entries on the diagonal of S is s = r = O(k log k). Let 32 R> ∈ Rd×d denote a diagonal matrix such that ∀i ∈ [d], if Si,i 6= 0, then Ri,i = 1, and if Si,i = 0, then Ri,i = 0. Since rowspan(R> A> ) = rowspan(S > A> ), min Z∈Rm×k ,V ∈Rk×d kASZV − Ak1 = min Z∈Rm×k ,V ∈Rk×d kARZV − Ak1 . Combining with Part III of Corollay C.2, there exists a rank-k solution in the column span of AR, which means, √ min kARZV − Ak1 ≤ O( r) OPT . (12) Z∈Rm×k ,V ∈Rk×d  e Because the number of 1s of R is r, and the size of the matrix is d × d, there are dr = dO(k) different choices for locations of 1s on the diagonal of R. We cannot compute R directly, but we can guess e all the choices of locations of 1s. Regarding R as selecting r columns of A, then there are dO(k) choices. There must exist a “correct” way of selecting a subset of columns over all all choices. After trying all of them, we will have chosen the right one. For a fixed guess R, we can compute D ∈ Rn×n , which is a sampling and rescaling matrix corresponding to the Lewis weights of AR, and let m = O(k log2 k) be the number of nonzero entries on the diagonal of D. By Equation (12), there exists a W ∈ Rr×k such that, √ min kARW V − Ak1 ≤ O( r) OPT . (13) V ∈Rk×d We define Vbi = arg minkDARW Vi − DAi k2 , ∀i ∈ [d], which means Vbi = (DARW )† DAi ∈ Rk . Then Vb = Vi ∈Rk×d † (DARW ) DA ∈ Rk×d . We define V ∗ = arg minkARW V − Ak1 . Then, by Claim B.10, it has V ∈Rk×d √ kDARW Vb − DAk1 ≤ O( m) min kDARW V − DAk1 . V ∈Rk×d By applying Lemma D.11, Lemma D.8 and Equation (13), we can show √ √ e kARW Vb − Ak1 ≤ O( m)kARW V ∗ − Ak1 ≤ O( mr) OPT ≤ O(k) OPT . Plugging Vb = (DARW )† DA into kARW Vb − Ak1 , we obtain that e kARW (DARW )† DA − Ak1 ≤ O(k) OPT . and it is clear that, min X∈Rr×k ,Y ∈Rk×m e kARXY DA − Ak1 ≤ kARW (DARW )† DA − Ak1 ≤ O(k) OPT . Recall that we guessed R, so it is known. We can compute T1 ∈ Rn×n , which is a sampling and rescaling diagonal matrix corresponding to the Lewis weights of AR, and t1 = O(r log r) is the number of nonzero entries on the diagonal of T1 . Also, DA is known, and the number of nonzero entries in D is m = O(k log2 k). We can compute > T2 ∈ Rd×d , which is a sampling and rescaling matrix corresponding to the Lewis weights of (DA)> , and t2 = O(m log m) is the number of nonzero entries on the diagonal of T2 . 33 Define X ∗ , Y ∗ = arg min kT1 (AR)XY (DA)T2 − T1 AT2 k1 . Thus, using Lemma D.10, we X∈Rr×k ,Y ∈Rk×m have e k(AR)X ∗ Y ∗ (DA) − Ak1 ≤ O(k) OPT . To find X ∗ , Y ∗ , we need to solve this minimization problem min X∈Rr×k ,Y ∈Rk×m kT1 (AR)XY (DA)T2 − T1 AT2 k1 , which can be solved by a polynomial system verifier (see more discussion in Section B.1 and B.5). In the next paragraphs, we explain how to solve the above problem by using a polynomial system verifier. Notice that T1 (AR) is known and (DA)T2 is also known. First, we create r × k variables for the matrix X, i.e., one variable for each entry of X. Second, we create k × m variables for matrix Y , i.e., one variable for each entry of Y . Putting it all together and creating t1 × t2 variables σi,j , ∀i ∈ [t1 ], j ∈ [t2 ] for handling the unknown signs, we write down the following optimization poblem min X,Y s.t t1 X t2 X σi,j (T1 (AR)XY (DA)T2 )i,j i=1 j=1 2 σi,j = 1, ∀i ∈ [t1 ], j ∈ [t2 ] σi,j · (T1 (AR)XY (DA)T2 )i,j ≥ 0, ∀i ∈ [t1 ], j ∈ [t2 ]. e 2 ), the maximum degree is O(1), and the Notice that the number of constraints is O(t1 t2 ) = O(k 2 e ). Thus the running time is, number of variables O(t1 t2 + km + rk) = O(k 2 (# constraints ·# degree)O(# variables) = 2O(k ) . e To use a polynomial system verifier, we need to discuss the bit complexity. Suppose that all entries are multiples of δ, and the maximum is ∆, i.e., each entry ∈ {−∆, · · · , −2δ, −δ, 0, δ, 2δ, · · · , ∆}, and e 2 e 2 ∆/δ = 2poly(nd) . Then the running time is O(poly(∆/δ)) · 2O(k ) = poly(nd)2O(k ) . Also, a polynomial system verifier is able to tell us whether there exists a solution in a semialgebraic set. In order to find the solution, we need to do a binary search over the cost C. In each step of the binary search we use a polynomial system verifier to determine if there exists a solution in, t1 X t2 X σi,j (T1 (AR)XY (DA)T2 )i,j i=1 j=1 2 σi,j = 1, ∀i ∈ [t1 ], j ∈ [t2 ] ≤C σi,j · (T1 (AR)XY (DA)T2 )i,j ≥ 0, ∀i ∈ [t1 ], j ∈ [t2 ]. In order to do binary search over the cost, we need to know an upper bound on the cost and also a lower bound on the minimum nonzero cost. The upper bound on the cost is Cmax = O(nd∆), and the minimum nonzero cost is Cmin = 2−Ω(poly(nd)) . Thus, the total number of steps for binary search is O(log(Cmax /Cmin )). Overall, the running time is 2 2 ndO(k) · 2O(k ) · log(∆/δ) · log(Cmax /Cmin ) = poly(n)dO(k) 2O(k ) . e e e This completes the proof. 34 e Instead of solving an `1 problem at the last step of L1LowRankApproxK by using a polyonomial system verifier, we can just solve a Frobenious norm minimization problem. This slighly improves the running time and pays an extra poly(k) factor in the approximation ratio. Thus, we obtain the following corollary, Corollary C.8. Given matrix A ∈ Rn×d , there exists an algorithm that takes poly(n) · dO(k) time which outputs two matrices U ∈ Rn×k , V ∈ Rk×d such that e |U V − Ak1 ≤ poly(k) min rank −k Ak kAk − Ak1 holds with probability 9/10. C.5 Rank-2k and O(1)-approximation algorithm for an arbitrary matrix A In this section, we show how to output a rank-2k solution that is able to achieve an O(1)-approximation. Algorithm 5 Bicriteria O(1)-approximation Algorithm 1: 2: procedure L1LowRankApproxBicriteria(A, n, d, k) UB , VB ← min kU V − AkF . . Theorem C.9 U ∈Rn×k ,V ∈Rk×d 3: 4: 5: 6: 7: 8: 9: 10: r ← O(k log k). Guess a diagonal matrix D ∈ Rn×n with r nonzero entries. Guess matrix DU ∈ Rr×k . Find VA by solving minV kDU V − D(A − B)k1 . Find UA by solving minU kU VA − (A  −B)k1 .   VA Take the best solution UA UB , over all guesses. VB     V return UA UB , A . VB end procedure Theorem C.9. Given matrix A ∈ Rn×d , for any k ≥ 1, there exists an algorithm which takes e 2 (nd)O(k ) time to output two matrices U ∈ Rn×2k , V ∈ R2k×d , kU V − Ak1 . min rank −k Ak kAk − Ak1 , holds with probability 9/10. Proof. We define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution, i.e., U ∗V ∗ = kU V − Ak1 , arg min U ∈Rn×k ,V ∈Rk×d and define OPT = kU ∗ V ∗ − Ak1 . Solving the Frobenious norm problem, we can find a factorization of a rank-k matrix B = UB V B √ n×k k×d where UB ∈ R , VB ∈ R , and B satisfies kA − Bk1 ≤ αB OPT for an αB = nd. Let D be a sampling and rescaling diagonal matrix corresponding to the Lewis weights of U ∗ , and let the number of nonzero entries on the diagonal be t = O(k log k). By Lemma D.11 and Lemma D.8, the solution of min kDU ∗ V − D(A − B)k1 together with U∗ V ∈Rk×d gives an O(1)-approximation to A − B. In order to compute D we need to know U ∗ . Although 35 we do not know U ∗ , there still exists a way to figure out the Lewis weights. The idea is the same as in the previous discussion Lemma C.10 “Guessing Lewis weights”. By Claim C.11 and Claim C.12, the total number of possible D is nO(t) . Lemma C.10 tries to find a rank-k solution when all the entries in A are integers at most poly(nd). Here we focus on a bicriteria algorithm that outputs a rank-2k matrix without such a strong bit complexity assumption. We can show a better claim C.13, which is that the total numer e 2 of possible DU ∗ is N O(k ) where N = poly(n) is the number of choices for a single entry in U ∗ . We explain how to obtain an upper bound on N . Consider the optimum kU ∗ V ∗ − (A − B)k1 . We can always change the basis so assume V ∗ is an Auerbach basis (i.e., an `1 -well-conditioned basis discussed in Section 1), so ekxk1 ≥ kxV ∗ k1 ≥ kxk1 /f , where e, f = poly(k). Then no entry of U ∗ is larger than 2f kA − Bk1 , otherwise we could replace U ∗ with 0 and get a better solution. Also any entry smaller than kA − Bk1 /(enkαB 100) can be replaced with 0 as this will incur additive error at most OPT /100. So if we round to integer multiples of kA − Bk1 /(enkαB 100) we only have O(enkαB f ) possibilities for each entry of U ∗ and still have an O(1)-approximation. We will just refer to this rounded U ∗ as U ∗ , abusing notation. Let U denote the set of all the matrices U that we guess. From the above discussion, we conclude that, there exists a U ∈ U such that kU V ∗ − (A − B)k1 ≤ O(OPT). For each guess of DU ∗ and D, we find VA , UA in the following way. We find VA by using a linear program to solve, min kDU ∗ V − D(A − B)k1 . V ∈Rk×d Given VA and A, we write down a linear program to solve this problem, min kU VA − (A − B)k1 , U ∈Rn×k which takes poly(ndk) time. Then we obtain UA . Recall that VB , UB are the two factors of B and it is a rank-k, αB -approximation solution to minkU V − Ak1 . Then we have U,V     VA UA UB −A VB = UA VA − (A − UB VB ) 1 = UA VA − (A − B) . 1 1 Because there must exist a pair UA, VAsatifying kUA VA − (A − B)k1 ≤ O(OPT), it follows that by   VA taking the best solution UA UB over all guesses, we obtain an O(1)-approximation solution. VB 2 Overall, the running time is (nd)O(k ) . e Lemma C.10. Given an n × d matrix A with integers bounded by poly(n), for any k ≥ 1, there e 3 exists an algorithm which takes (nd)O(k ) time to output two matrices U ∈ Rn×k , V ∈ Rk×d , such that kU V − Ak1 . min rank −k Ak kAk − Ak1 , Proof. We define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution, i.e., U ∗, V ∗ = arg min U ∈Rn×k ,V ∈Rk×d 36 kU V − Ak1 , and define OPT = kU ∗ V ∗ − Ak1 . Let D denote a sampling and rescaling diagonal matrix corresponding to the Lewis weights of U ∗ , and let the number of nonzero entries on the diagonal be t = O(k log k). By Lemma D.11 and Lemma D.8, the solution to min kDU ∗ V − DAk1 together with U ∗ gives V ∈Rk×d an O(1)-approximation to A. In order to compute D, we need to know U ∗ . Although we do not know U ∗ , there still exists a way to figure out the Lewis weights. We call the idea “Guessing Lewis weights”. We will explain this idea in the next few paragraphs. First, we can guess the nonzero entries on the diagonal, because the number of choices is small. Claim C.11. The number of possibile choice of supp(D) is at most nO(t) . Proof. The matrix has dimension P n ×n and the number of nonzero entries is t. Thus the number of possible choices is at most ti=1 nt = nO(t) . Second, we can guess the value of each probability. For each probability, it is trivially at most 1. If the probability is less than 1/(poly(n)k log k), then we will never sample that row with high probability. It means that we can truncate the probability if it is below that threshold. We can also round each probability to 2−i which only loses another constant factor in the approximation ratio. Thus, we have: Claim C.12. The total number of possible D is nO(t) = nO(k) . e Since ∆/δ ≤ poly(n) and the entries of A are in {−∆, −∆+δ, . . . , −2δ, −δ, 0, δ, 2δ, · · · , ∆−δ, ∆}, we can lower bound the cost of kU ∗ V − Ak1 given that it is non-zero by (nd∆/δ)−O(k) (if it is zero then A has rank at most k and we output A) using Lemma 4.1 in [CW09] and relating entrywise `1 -norm to Frobenius norm. We can assume V is an `1 well-conditioned basis, since we can replace U ∗ with U ∗ R−1 and V with RV for any invertible linear transformation R. By properties of such −O(k) while preserving basis, we can discretize the entries of U ∗ to integer multiples of (nd∆/δ)  relative error. Hence we can correctly guess each entry of DU ∗ in nO(k) time. 3 Claim C.13. The total numer of possible DU ∗ is nO(k ) . e In the following, let DU denote a guess of DU ∗ . Now the problem remaining is to solve min kDU V − DAk1 . Since we already know DA can be computed, and we know DU , we can V ∈Rk×d solve this multiple regression problem by running linear programming. Thus the running time of this step is in poly(nd). After we get such a solution V , we use a linear program to solve min kDU V − DAk1 . Then we can get U . U ∈Rn×k After we guess all the choices of D and DU ∗ , we must find a solution U, V which gives an O(1) e e 3 e 3 approximation. The total running time is nO(k) · nO(k ) · poly(nd) = (nd)O(k ) . C.6 CUR decomposition for an arbitrary matrix A Theorem C.14. Given matrix A ∈ Rn×d , for any k ≥ 1, there exists an algorithm which takes O(nnz(A))+(n+d) poly(k) time to output three matrices C ∈ Rn×c with columns from A, U ∈ Rc×r , and R ∈ Rr×d with rows from A, such that rank(CU R) = k, c = O(k log k), r = O(k log k), and kCU R − Ak1 ≤ poly(k) log d min rank −k Ak holds with probability 9/10. 37 kAk − Ak1 , Algorithm 6 CUR Decomposition Algorithm 1: 2: 3: 4: 5: 6: 7: procedure L1LowRankApproxCUR(A, n, d, k) . Theorem C.14 UB , VB ←L1LowRankApproxPolykLogd(A, n, d, k). Let D1 ∈ Rn×n be the sampling and rescaling diagonal matrix coresponding to the Lewis weights of B1 = UB ∈ Rn×k , and let D1 have d1 = O(k log k) nonzero entries. Let D2> ∈ Rd×d be the sampling and rescaling diagonal matrix coresponding to the Lewis > weights of B2> = (D1 B1 )† D1 A ∈ Rd×k , and let D2 have d2 = O(k log k) nonzero entries. C ← AD2 , U ← (B2 D2 )† (D1 B1 )† , and R ← D1 A. return C, U, R. end procedure Proof. We define OPT := min rank −k Ak kAk − Ak1 . Due to Theorem C.6, we can output two matrices UB ∈ Rn×k , VB ∈ Rk×d such that UB VB gives a rank-k, and poly(k) log d-approximation solution to A, i.e., kUB VB − Ak1 ≤ poly(k) log d OPT . (14) By Section B.3, we can compute D1 ∈ Rn×n which is a sampling and rescaling matrix corresponding to the Lewis weights of B1 = UB in O(n poly(k)) time, and there are d1 = O(k log k) nonzero entries on the diagonal of D1 . Define V ∗ ∈ Rk×d to be the optimal solution of min kB1 V − Ak1 , Vb = (D1 B1 )† D1 A ∈ Rk×d , V ∈Rk×d U1 ∈ Rn×k to be the optimal solution of min kU Vb − Ak1 , and V 0 to be the optimal solution of U ∈Rn×k min kD1 A − D1 B1 V k1 . V ∈Rk×d By Claim B.10, we have kD1 B1 Vb − D1 Ak1 ≤ p d1 kD1 B1 V 0 − D1 Ak1 . Due to Lemma D.11 and Lemma D.8, with constant probability, we have p kB1 Vb − Ak1 ≤ d1 αD1 kB1 V ∗ − Ak1 , where αD1 = O(1). Now, we can show, kU1 Vb − Ak1 ≤ kB1 Vb − Ak1 by U1 = arg minkU Vb − Ak1 U ∈Rn×k p . d1 kB1 V ∗ − Ak1 p ≤ d1 kUB VB − Ak1 ≤ poly(k) log d OPT . by Equation (14) We define B2 = Vb , then we replace Vb by B2 ∈ Rk×d and look at this objective function, min kU B2 − Ak1 , U ∈Rn×k 38 (15) where U ∗ denotes the optimal solution. We use a sketching matrix to sketch the RHS of matrix U B2 − A ∈ Rn×d . Let D2> ∈ Rd×d denote a sampling and rescaling diagonal matrix corresponding to the Lewis weights of B2> ∈ Rd×k , and let the number of nonzero entries on the diagonal of D2 b = AD2 (B2 D2 )† ∈ Rn×k , U 0 ∈ Rn×k to be the optimal solution of be d2 = O(k log k). We define U min k(U B2 − A)D2 k1 . Recall that U1 ∈ Rn×k is the optimal of min kU B2 − Ak1 . U ∈Rn×k U ∈Rn×k By Claim B.10, we have b B2 D2 − AD2 k1 ≤ kU p d2 kU 0 B2 D2 − AD2 k1 . According to Lemma D.8 and Lemma D.11, with constant probability, p b B2 − Ak1 ≤ αD d2 kU1 B2 − Ak1 , kU 2 where αB2 = O(1). We have b B2 − Ak1 kU p ≤ d2 αD2 kU1 B2 − Ak1 p d2 αD2 kU1 Vb − Ak1 = by B2 = Vb ≤ poly(k) log(d) OPT . by Equation (15) b B2 = AD2 (B2 D2 )† (D1 B1 )† D1 A. Setting Notice that U C = AD2 ∈ Rn×d2 , U = (B2 D2 )† (D1 B1 )† ∈ Rd2 ×d1 , and R = D1 A ∈ Rd1 ×d , we get the desired CUR decomposition, k AD2 · (B2 D2 )† (D1 B1 )† · D1 A −Ak1 ≤ poly(k) log(d) OPT . | {z } | {z } | {z } C U R with rank(CU R) = k. Overall, the running time is O(nnz(A)) + (n + d) poly(k). C.7 C.7.1 Rank-r matrix B Properties Lemma C.15. Given matrix A ∈ Rn×d , let OPT = min rank −k Ak kA − Ak k1 . For any r ≥ k, if rank-r matrix B ∈ Rn×d is an f -approximation to A, i.e., kB − Ak1 ≤ f · OPT, and U ∈ Rn×k , V ∈ Rk×d is a g-approximation to B, i.e., kU V − Bk1 ≤ g · min rank −k Bk kBk − Bk1 , then, kU V − Ak1 . gf · OPT . 39 e ∈ Rn×k , Ve ∈ Rk×d to be two matrices, such that Proof. We define U e Ve − Bk1 ≤ g kU min rank −k Bk kBk − Bk1 , and also define, b , Vb = U kU V − Bk1 and U ∗ , V ∗ = arg min U ∈Rn×k ,V ∈Rk×d kU V − Ak1 , arg min U ∈Rn×k ,V ∈Rk×d Then, e Ve − Ak1 ≤ kU e Ve − Bk1 + kB − Ak1 kU b Vb − Bk1 + kB − Ak1 ≤ gkU by triangle inequality by definition ≤ gkU ∗ V ∗ − Bk1 + kB − Ak1 b Vb − Bk1 ≤ kU ∗ V ∗ − Bk1 by kU ≤ gkU ∗ V ∗ − Ak1 + gkB − Ak1 + kB − Ak1 by triangle inequality = g OPT +(g + 1)kB − Ak1 by definition of OPT ≤ g OPT +(g + 1)f · OPT by B is f -approximation to A . gf OPT . This completes the proof. Lemma C.16. Given a matrix B ∈ Rn×d with rank r, for any 1 ≤ k < r, for any fixed U ∗ ∈ Rn×k , choose a Cauchy matrix S with m = O(r log r) rows and rescaled by Θ(1/m). With probability .999 for all V ∈ Rk×d , we have kSU ∗ V − SBk1 ≥ kU ∗ V − Bk1 . Proof. This follows by definitions in Section D and Lemma D.23. Lemma C.17. Given a matrix B ∈ Rn×d with rank r, for any 1 ≤ k < r, for any fixed U ∗ ∈ Rn×k , V ∗ ∈ Rk×d , choose a Cauchy matrix S with m rows and rescaled by Θ(1/m). We have kSU ∗ V ∗ − SBk1 ≤ O(r log r)kU ∗ V ∗ − Bk1 , with probabiliaty .999. Proof. Let U denote a well-conditioned basis of [U ∗ V ∗ , B], then U has de = O(r) columns. We have kSU k1 = de X m X |(SUi )j | i=1 j=1 de X m n X 1 X = | Sj,l Ul,i | m i=1 j=1 = 1 m by Sj,l ∼ C(0, 1) l=1 de X m X |ci,j | by ci,j ∼ C(0, kUi k1 ) i=1 j=1 de m 1 XX = kUi k1 · wi+(j−1)d , m i=1 j=1 40 by wi,j ∼ |C(0, 1)| where the last step follows since each wi can be thought of as a clipped half-Cauchy random variable. e Define event ξi to be the situation when wi < D (we will choose D later), and Define d0 = md. define event ξ = ξ1 ∩ ξ2 ∩ · · · ∩ ξd0 . Using a similar proof as Lemma D.12, which is also similar to previous work [Ind06, SW11, CDMI+ 13], we obtain that X  m m X d0 log d0 Pr + . kSUi k1 ≥ kUi k1 t . t D i=1 i=1 Choosing t = Θ(log d0 ) and D = Θ(d0 ), we have X  m m X 1 Pr kSUi k1 ≥ kUi k1 O(log d0 ) ≤ , C i=1 i=1 for a constant C. Condition on the above event. Let y = U x, for some x ∈ Rd . Then for any y, kSyk1 = kSU xk1 0 ≤ d X kSUj xj k1 by triangle inequality j=1 0 = d X |xj | · kSUj k1 j=1 0 0 . kxk∞ log(d ) d X kUj k1 j=1 . r log rkyk1 , where the last step follows by completes the proof. Pd0 j=1 kUj k1 ≤ d0 and kxk∞ ≤ kU xk1 = kyk1 . Chossing C = 1000 Lemma C.18. Given a matrix M ∈ Rn×d with rank O(r), choose a random matrix S ∈ Rm×n with each entry drawn from a standard Cauchy distribution and scaled by Θ(1/m). We have that kSM k1 ≤ O(r log r)kM k1 , holds with probability .999. Proof. Let U ∈ RO(r) be the well-condtioned basis of M . Then each column of M can be expressed by U x for some x. We then follow the same proof as that of Lemma C.17. C.7.2 poly(k, r)-approximation for rank-r matrix B Theorem C.19. Given a factorization of a rank-r matrix B = UB VB ∈ Rn×d , where UB ∈ Rn×r , VB ∈ Rr×d , for any 1 ≤ k ≤ r there exists an algorithm which takes (n + d) · poly(k) time to output two matrices U ∈ Rn×k , V ∈ Rk×d such that kU V − Bk1 ≤ poly(r) min rank −k Bk holds with probability 9/10. 41 kBk − Bk1 , Algorithm 7 poly(r, k)-approximation Algorithm for Rank-r matrix B 1: 2: 3: 4: 5: 6: 7: procedure L1LowRankApproxB(UB , VB , n, d, k, r) . Theorem C.19 e e e e Set s ← O(r), r0 ← O(r), t1 ← O(r), t2 ← O(r). 0 Choose dense Cauchy matrices S ∈ Rs×n , R ∈ Rd×r , T1 ∈ Rt1 ×n , T2 ∈ Rd×t2 . Compute S · UB · VB , UB · VB · R and T1 · UB · VB · T2 . Compute XY = arg minX,Y kT1 UB VB RXY SUB VB T2 − T1 UB VB T2 kF . return UB VB RX, Y SUB VB . end procedure Proof. We define OPT = min rank −k Bk kBk − Bk1 . Choose S ∈ Rs×n to be a dense Cauchy transform matrix with s = O(r log r). Using Lemma C.18, Lemma D.23, and combining with Equation (10), we have √ kU ZSB − Bk1 ≤ sO(r log r) OPT = O(r1.5 log1.5 r) OPT . min U ∈Rn×k ,Z∈Rk×s Let αs = O(r1.5 log1.5 r). We define U ∗ , Z ∗ = kU ZSB − Bk1 . For the fixed Z ∗ ∈ Rk×s , choose a dense arg min U ∈Rn×k ,Z∈Rk×d 0 Cauchy transform matrix R ∈ Rd×r with r0 = O(r log r) and sketch on the right of (U ZSB − B). We obtain the minimization problem, min kU Z ∗ SBR − BRk1 . U ∈Rn×k b j = B j R((Z ∗ SB)R)† ∈ Rk , ∀j ∈ [n]. Then U b = BR((Z ∗ SB)R)† ∈ Rn×k . Due to Define U Claim B.10, n X n √ X kB j R((Z ∗ SB)R)† Z ∗ SBR − B j Rk1 ≤ O( r0 ) min kU j Z ∗ SBR − B j Rk1 , j=1 j=1 U j ∈Rk which is equivalent to √ kBR((Z ∗ SB)R)† Z ∗ SBR − BRk1 ≤ O( r0 ) min kU Z ∗ SBR − BRk1 , U ∈Rn×k where BR is an n × r0 matrix and SB is an s × d matrix. Both of them can be computed in (n + d) poly(r) time. Using Lemma D.8, Lemma D.23, Lemma C.18, we obtain, √ kBR((Z ∗ SB)R)† Z ∗ SB − Bk1 ≤ O( r0 αr0 ) min kU Z ∗ SB − Bk1 U ∈Rn×k e where αr0 = O(r). We define X ∗ ∈ Rr×k , Y ∗ ∈ Rk×s , X ∗, Y ∗ = arg min X∈Rr0 ×k ,Y ∈Rk×s 42 kBRXY SB − Bk1 . Then, kBRX ∗ Y ∗ SB − Bk1 ≤ kBR((Z ∗ SB)R)† Z ∗ SB − Bk1 √ ≤ O( r0 αr0 ) min kU Z ∗ SB − Bk1 U ∈Rn×k √ 0 = O( r αr0 ) kU ZSB − Bk1 min U ∈Rn×k ,Z∈Rk×s √ ≤ O( r0 αr0 αs ) OPT . √ It means that BRX, Y SB gives an O(αr0 αs r0 )-approximation to the original problem. Thus it suffices to use Lemma C.20 to solve min X∈Rr×k ,Y ∈Rk×s kBRXY SB − Bk1 , by losing an extra poly(r) approximation ratio. Therefore, we finish the proof. 0 Lemma C.20. Suppose we are given S ∈ Rs×n , R ∈ Rd×r , and a factorization of a rank-r matrix B = UB VB ∈ Rn×d , where UB ∈ Rn×r , VB ∈ Rr×d . Then for any 1 ≤ k ≤ r, there exists an 0 algorithm which takes (n + d) poly(r, r0 , s) time to output two matrices X 0 ∈ Rr ×k , Y 0 ∈ Rk×s such that kBRX 0 · Y 0 SB − Bk1 ≤ poly(r) min X∈Rr0 ×k ,Y ∈Rk×s kBRXY SB − Bk1 holds with probability at least .999. Proof. Choosing dense Cauchy matrices T1 ∈ Rt1 ×n , T2> ∈ Rt2 ×d to sketch on both sides, we get the problem min kT1 BRXY SBT2 − T1 BT2 k1 , (16) 0 X∈Rr ×k ,Y ∈Rk×s e e where t1 = O(r) and t2 = O(r). 0 0 Define X , Y to be the optimal solution of min X∈Rr0 ×k ,Y ∈Rk×s kT1 BRXY SBT2 − T1 BT2 kF . e Ye to the be the optimal solution of Define X, min X∈Rr0 ×k ,Y ∈Rk×s kBRXY SB − Bk1 . By Claim B.11, kT1 BRX 0 Y 0 SBT2 − T1 BT2 k1 ≤ √ t1 t2 min X∈Rr 0 ×k ,Y ∈Rk×s kT1 BRXY SBT2 − T1 BT2 k1 . By Lemma D.10, Lemma C.18 and Lemma D.23, we have √ e 2 )kBRX e · Ye SB − Bk1 . kBRX 0 · Y 0 SB − Bk1 ≤ t1 t2 · O(r This completes the proof. 43 D Contraction and Dilation Bound for `1 This section presents the essential lemmas for `1 -low rank approximation. Section D.1 gives some basic definitions. Section D.2 shows some properties implied by contraction and dilation bounds. Section D.3 presents the no dilation lemma for a dense Cauchy transform. Section D.4 and D.5 presents the no contraction lemma for dense Cauchy transforms. Section D.6 and D.7 contains the results for sparse Cauchy transforms and Lewis weights. D.1 Definitions Definition D.1. Given a matrix M ∈ Rn×d , if matrix S ∈ Rm×n satisfies kSM k1 ≤ c1 kM k1 , then S has at most c1 -dilation on M . Definition D.2. Given a matrix U ∈ Rn×k , if matrix S ∈ Rm×n satisfies 1 ∀x ∈ Rk , kSU xk1 ≥ kU xk1 , c2 then S has at most c2 -contraction on U . Definition D.3. Given matrices U ∈ Rn×k , A ∈ Rn×d , let V ∗ = arg minV ∈Rk×d kU V − Ak1 . If matrix S ∈ Rm×n satisfies 1 ∀V ∈ Rk×d , kSU V − SAk1 ≥ kU V − Ak1 − c4 kU V ∗ − Ak1 , c3 then S has at most (c3 , c4 )-contraction on (U, A). Definition D.4. A (c5 , c6 ) `1 -subspace embedding for the column space of an n × k matrix U is a matrix S ∈ Rm×n for which all x ∈ Rk 1 kU xk1 ≤ kSU xk1 ≤ c6 kU xk1 . c5 Definition D.5. Given matrices U ∈ Rn×k , A ∈ Rn×d , let V ∗ = arg minV ∈Rk×d kU V − Ak1 . Let S ∈ Rm×n . If for all c ≥ 1, and if for any Vb ∈ Rk×d which satisfies kSU Vb − SAk1 ≤ c · min kSU V − SAk1 , V ∈Rk×d it holds that kU Vb − Ak1 ≤ c · c7 · kU V ∗ − Ak1 , then S provides a c7 -multiple-regression-cost preserving sketch of (U, A). Definition D.6. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Ak1 . b ∈ Rm1 ×m2 which satisfies Let S ∈ Rm×n . If for all c ≥ 1, and if for any rank −k X b − SAk1 ≤ c · kSLXN min rank −k X kSLXN − SAk1 , it holds that b − Ak1 ≤ c · c8 · kLX ∗ N − Ak1 , kLXN then S provides a c8 -restricted-multiple-regression-cost preserving sketch of (L, N, A, k). 44 D.2 Properties Lemma D.7. Given matrices A ∈ Rn×d , U ∈ Rn×k , let V ∗ = arg minV ∈Rk×d kU V − Ak1 . If S ∈ Rm×n has at most c1 -dilation on U V ∗ − A, i.e., kS(U V ∗ − A)k1 ≤ c1 kU V ∗ − Ak1 , and it has at most c2 -contraction on U , i.e., ∀x ∈ Rk , kSU xk1 ≥ then S has at most (c2 , c1 + 1 c2 )-contraction ∀V ∈ Rk×d , kSU V − SAk1 ≥ 1 kU xk1 , c2 on (U, A), i.e., 1 1 kU V − Ak1 − (c1 + )kU V ∗ − Ak1 , c2 c2 Proof. Let A ∈ Rn×d , U ∈ Rn×k , S ∈ Rm×n be the same as that described in the lemma. Then ∀V ∈ Rk×d kSU V − SAk1 ≥ kSU V − SU V ∗ k1 − kSU V ∗ − SAk1 ≥ kSU V − SU V ∗ k1 − c1 kU V ∗ − Ak1 = kSU (V − V ∗ )k1 − c1 kU V ∗ − Ak1 = d X kSU (V − V ∗ )j k1 − c1 kU V ∗ − Ak1 j=1 ≥ d X 1 kU (V − V ∗ )j k1 − c1 kU V ∗ − Ak1 c2 j=1 1 kU V − U V ∗ k1 − c1 kU V ∗ − Ak1 c2 1 1 ≥ kU V − Ak1 − kU V ∗ − Ak1 − c1 kU V ∗ − Ak1 c2 c2   1 1 ∗ = kU V − Ak1 − ( + c1 )kU V − Ak1 . c2 c2 = The first inequality follows by the triangle inequality. The second inequality follows since S has at most c1 dilation on U V ∗ − A. The third inequality follows since S has at most c2 contraction on U . The fourth inequality follows by the triangle inequality. Lemma D.8. Given matrices A ∈ Rn×d , U ∈ Rn×k , let V ∗ = arg minV ∈Rk×d kU V − Ak1 . If S ∈ Rm×n has at most c1 -dilation on U V ∗ − A, i.e., kS(U V ∗ − A)k1 ≤ c1 kU V ∗ − Ak1 , and has at most c2 -contraction on U , i.e., ∀x ∈ Rk , kSU xk1 ≥ 45 1 kU xk1 , c2 then S provides a (2c1 c2 + 1)-multiple-regression-cost preserving sketch of (U, A), i.e., for all c ≥ 1, for any Vb ∈ Rk×d which satisfies kSU Vb − SAk1 ≤ c · min kSU V − SAk1 , V ∈Rk×d it has kU Vb − Ak1 ≤ c · (2c1 c2 + 1) · kU V ∗ − Ak1 , Proof. Let S ∈ Rm×n , A ∈ Rn×d , U ∈ Rn×k , V ∗ , Vb ∈ Rk×d , and c be the same as stated in the lemma. kU Vb − Ak1 ≤ c2 kSU Vb − SAk1 + (1 + c1 c2 )kU V ∗ − Ak1 ≤ c2 c min kSU V − SAk1 + (1 + c1 c2 )kU V ∗ − Ak1 V ∈Rk×d ∗ ≤ c2 ckSU V − SAk1 + (1 + c1 c2 )kU V ∗ − Ak1 ≤ c1 c2 ckU V ∗ − Ak1 + (1 + c1 c2 )kU V ∗ − Ak1 ≤ c · (1 + 2c1 c2 )kU V ∗ − Ak1 . The first inequality follows by Lemma D.7. The second inequality follows by the guarantee of Vb . The fourth inequality follows since S has at most c1 -dilation on U V ∗ − A. The fifth inequality follows since c ≥ 1. Lemma D.9. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Ak1 . If S ∈ Rm×n has at most c1 -dilation on LX ∗ N − A, i.e., kS(LX ∗ N − A)k1 ≤ c1 kLX ∗ N − Ak1 , and has at most c2 -contraction on L, i.e., ∀x ∈ Rm1 kSLxk1 ≥ kLxk1 , then S provides a (2c1 c2 + 1)-restricted-multiple-regression-cost preserving sketch of (L, N, A, k), b ∈ Rm1 ×m2 which satisfies i.e., for all c ≥ 1, for any rank −k X b − SAk1 ≤ c · kSLXN min rank −k X kSLXN − SAk1 , it holds that b − Ak1 ≤ c · (2c1 c2 + 1) · kLX ∗ N − Ak1 . kLXN b ∈ Rm1 ×m2 , X ∗ ∈ Rm1 ×m2 , N ∈ Rm2 ×d , A ∈ Rn×d , and c ≥ 1 Proof. Let S ∈ Rm×n , L ∈ Rn×m1 , X be the same as stated in the lemma. b − SAk1 ≥ kSLXN b − SLX ∗ N k1 − kSLX ∗ N − SAk1 kSLXN 1 b − X ∗ N )k1 − c1 kLX ∗ N − Ak1 ≥ kL(XN c2 1 b − Ak1 − 1 kLX ∗ N − Ak1 − c1 kLX ∗ N − Ak1 ≥ kLXN c2 c2 1 b − Ak1 − ( 1 + c1 )kLX ∗ N − Ak1 . = kLXN c2 c2 46 The inequality follows by the triangle inequality. The second inequality follows since S has at most c2 -contraction on L, and it has at most c1 -dilation on LX ∗ N − A. The third inequality follows by the triangle inequality. It follows that b − Ak1 ≤ c2 kSLXN b − SAk1 + (1 + c1 c2 )kLX ∗ N − Ak1 kLXN ≤ c2 c · kSLXN − SAk1 + (1 + c1 c2 )kLX ∗ N − Ak1 min rank −k X ∗ ≤ c2 c · kSLX N − SAk1 + (1 + c1 c2 )kLX ∗ N − Ak1 ≤ cc1 c2 · kLX ∗ N − Ak1 + (1 + c1 c2 )kLX ∗ N − Ak1 ≤ c · (1 + 2c1 c2 )kLX ∗ N − Ak1 . The first inequality directly follows from the previous one. The second inequality follows from the b The fourth inequality follows since S has at most c1 dilation on LX ∗ N − A. The guarantee of X. fifth inequality follows since c ≥ 1. Lemma D.10. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Ak1 . Let T1 ∈ Rt1 ×n have at most c1 -dilation on LX ∗ N − A, and at most c2 -contraction on L. Let e = arg X min rank −k X kT1 LXN − T1 Ak1 . e − T1 A)> , and at most c0 -contraction on N > . Let T2> ∈ Rt2 ×d have at most c01 -dilation on (T1 LXN 2 m ×m b ∈ R 1 2 which satisfies Then, for all c ≥ 1, for any rank −k X b − SA)T2 k1 ≤ c · kT1 (LXN min rank −k X kT1 (LXN − A)T2 k1 , it has b − Ak1 ≤ c · (2c1 c2 + 1)(2c01 c02 + 1) · kLX ∗ N − Ak1 . kLXN b ∈ Rm1 ×m2 Proof. Apply Lemma D.9 for sketch matrix T2 . Then for any c ≥ 1, any rank −k X which satisfies b − A)T2 k1 ≤ c · kT1 (LXN min rank −k X kT1 (LXN − A)T2 k1 , has b − A)k1 ≤ c · (2c01 c02 + 1) · kT1 (LXN e − A)k1 . kT1 (LXN b ∈ Rm1 ×m2 which Apply Lemma D.9 for sketch matrix T1 . Then for any c ≥ 1, any rank −k X satisfies b − A)k1 ≤ c(2c01 c02 + 1) · kT1 (LXN min rank −k X e − A)k1 , kT1 (LXN has b − Ak1 ≤ c · (2c1 c2 + 1)(2c0 c0 + 1) · kLX ∗ N − Ak1 . kLXN 1 2 47 Lemma D.11. Given matrices M ∈ Rn×d , U ∈ Rn×t , d ≥ t = rank(U ), n ≥ d ≥ r = rank(M ), if sketching matrix S ∈ Rm×n is drawn from any of the following probability distributions of matrices, with .99 probability S has at most c1 -dilation on M , i.e., kSM k1 ≤ c1 kM k1 , and S has at most c2 -contraction on U , i.e., ∀x ∈ Rt , kSU xk1 ≥ 1 kU xk1 , c2 where c1 , c2 are parameters depend on the distribution over S. (I) S ∈ Rm×n is a dense Cauchy matrix: a matrix with i.i.d. entries from the standard Cauchy distribution. If m = O(t log t), then c1 c2 = O(log d). If m = O((t + r) log(t + r)), then c1 c2 = O(min(log d, r log r)). (II) S ∈ Rm×n is a sparse Cauchy matrix: S = T D, where T ∈ Rm×n has each column i.i.d. from the uniform distribution on standard basis vectors of Rm , and D ∈ Rn×n is a diagonal matrix with i.i.d. diagonal entries following a standard Cauchy distribution. If m = O(t5 log5 t), then c1 c2 = O(t2 log2 t log d). If m = O((t + r)5 log5 (t + r)), then c1 c2 = O(min(t2 log2 t log d, r3 log3 r)). (III) S ∈ Rm×n is a sampling and rescaling matrix (notation S ∈ Rn×n denotes a diagonal sampling and rescaling matrix with m non-zero entries): If S samples and reweights m = O(t log t) rows of U , selecting each with probability proportional to the ith row’s `1 Lewis weight and reweighting by the inverse probability, then c1 c2 = O(1). (IV) S ∈ Rm×n is a dense Cauchy matrix with limited independence: S is a matrix with each entry drawn from a standard Cauchy distribution. Entries from different rows of S are fully independent, and entries from the same row of S are W -wise independent. If m = O(t log t), e e and W = O(d), then c1 c2 = O(t log d). If m = O(t log t), and W = O(td), then c1 c2 = O(log d). In the above, if we replace S with σ · S where σ ∈ R\{0} is any scalar, then the relation between m and c1 c2 can be preserved. For (I), if m = O(t log t), then c1 c2 = O(log d) is implied by Lemma D.23 and Lemma D.13. If m = O((t + r) log(t + r)), c1 c2 = O(r log r) is implied by [SW11]. For (II), if m = O(t5 log5 t), then c1 c2 = O(t2 log2 t log d) is implied by Corollary D.27 and Lemma D.25. If m = O((t + r)5 log5 (t + r)), c1 c2 = O(r3 log3 r) is implied by [MM13]. For (III), it is implied by [CP15] and Lemma D.29. For (IV), it is implied by Lemma I.4, Corollary I.5. D.3 Cauchy embeddings, no dilation Lemma D.12. Define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution of min U ∈Rn×k ,V ∈Rk×d Ak1 . Choose a Cauchy matrix S with m rows and rescaled by Θ(1/m). We have that kSU ∗ V ∗ − SAk1 ≤ O(log d)kU ∗ V ∗ − Ak1 holds with probability at least 99/100. 48 kU V − Proof. The proof technique has been used in [Ind06] and [CDMI+ 13]. Fix the optimal U ∗ and V ∗ , then kSU ∗ V ∗ − SAk1 = d X kS(U ∗ Vi∗ − Ai )k1 i=1 d X m X n X 1 Sj,l · (U ∗ Vi∗ − Ai )l | = | m i=1 j=1 where Sj,l ∼ C(0, 1) l=1 d X m X 1 = |ci,j | m where ci,j ∼ C(0, kU ∗ Vi∗ − Ai k1 ) i=1 j=1 d m 1 XX ∗ ∗ = kU Vi − Ai k1 · wi+d(j−1) . m where wi+d(j−1) ∼ |C(0, 1)| (17) i=1 j=1 where the last step follows since each wi can be thought of as a clipped half-Cauchy random variable. Define d0 = md. Define event ξi to be the situation in which wi < D (we will decide upon D later), and define event ξ = ξ1 ∩ ξ2 ∩ · · · ∩ ξd0 . Then it is clear that ξ ∩ ξi = ξ, ∀i ∈ [d0 ]. Using the probability density function (pdf) of a Cauchy and because tan−1 x ≤ x, we can lower bound Pr[event ξi holds] in the following sense, Pr[ξi ] = 2 2 2 tan−1 (D) = 1 − tan−1 (1/D) ≥ 1 − . π π πD By a union bound over all i ∈ [d0 ], we can lower bound Pr[event ξ holds], 0 Pr[ξ] ≥ 1 − d X Pr[ξ i ] ≥ 1 − i=1 2d0 . πD (18) By Bayes rule and ξ = ξ ∩ ξi , Pr[ξ|ξi ] Pr[ξi ] = Pr[ξ ∩ ξi ] = Pr[ξ], which implies that Pr[ξ|ξi ] = Pr[ξ]/ Pr[ξi ]. First, we can lower bound E[wi |ξi ], E[wi |ξi ] = E[wi |ξi ∩ ξ] Pr[ξ|ξi ] + E[wi |ξ ∩ ξ] Pr[ξ|ξi ] ≥ E[wi |ξi ∩ ξ] Pr[ξ|ξi ] by wi ≥ 0 and Pr[] ≥ 0 = E[wi |ξ] Pr[ξ|ξi ] by ξ = ξ ∩ ξi . The above equation implies that E[wi |ξi ] Pr[ξ|ξi ] E[wi |ξi ] Pr[ξi ] = Pr[ξ ∩ ξi ] E[wi |ξi ] Pr[ξi ] = Pr[ξ] E[wi |ξ] ≤ Using the pdf of a Cauchy, E[wi |ξi ] = of E[wi |ξ], E[wi |ξ] ≤ E[wi |ξi ] Pr[ξi ] = Pr[ξ] by Bayes rule Pr[ξ|ξi ] Pr[ξi ] = Pr[ξ ∩ ξi ] by ξ = ξ ∩ ξi . 1 π log(1 + D2 )/ Pr[ξi ] and plugging it into the lower bound 1 π log(1 + D2 ) ≤ Pr[ξ] 49 1 π log(1 + D2 ) 1− 2d πD . log(D), where the third step follows since Pr[ξ] ≥ 1 − We can conclude d 2d0 πD and the last step follows by choosing D = Θ(d0 ). m 1 XX ∗ ∗ E[kSU V − SAk1 |ξ] = kU Vi − Ai k1 · E[wi+d(j−1) |ξ] . (log d0 ) · kU ∗ V ∗ − Ak1 . (19) m ∗ ∗ i=1 j=1 For simplicity, define X = kSU ∗ V ∗ − SAk1 and γ = kU ∗ V ∗ − Ak1 . By Markov’s inequality and because Pr[X ≥ γt|ξ] ≤ 1, we have Pr[X ≥ γt] = Pr[X ≥ γt|ξ] Pr[ξ] + Pr[X ≥ γt|ξ] Pr[ξ] ≤ Pr[X ≥ γt|ξ] + Pr[ξ] E[X|ξ] ≤ + Pr[ξ] γt E[X|ξ] 2d0 ≤ + γt πD 0 log d 2d0 . + t πD ≤ .01, by Markov’s inequality by Equation (18) by Equation (19) where choosing t = Θ(log d0 ) and D = Θ(d0 ). Since k ≤ d and m = poly(k), we have t = Θ(log d), which completes the proof. Lemma D.13. Given any matrix M ∈ Rn×d , if matrix S ∈ Rm×n has each entry drawn from an i.i.d. standard Cauchy distribution and is rescalsed by Θ(1/m), then kSM k1 ≤ O(log d)kM k1 holds with probability at least 99/100. Proof. Just replace the matrix U ∗ V ∗ − A in the proof of Lemma D.12 with M . Then we can get the result directly. D.4 Cauchy embeddings, no contraction We prove that if we choose a Cauchy matrix S, then for a fixed optimal solution U ∗ of minU,V kU V − Ak1 , and for all V , we have that with high probability kSU ∗ V −SAk1 is lower bouned by kU ∗ V −Ak1 up to some constant. Lemma D.14. Define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution of min U ∈Rn×k V ∈Rk×d kU V −Ak1 , where A ∈ Rn×d . Let m = O(k log k), S ∈ Rm×n be a random matrix with each entry an i.i.d. standard Cauchy random variable, scaled by Θ(1/m). Then with probability at least 0.95, ∀V ∈ Rk×d , kU ∗ V − Ak1 . kSU ∗ V − SAk1 + O(log(d))kU ∗ V ∗ − Ak1 . Proof. This follows by Lemmas D.12, D.23, D.7. 50 D.5 Cauchy embeddings, k-dimensional subspace The goal of this section is to prove Lemma D.23. Before getting into the details, we first give the formal definition of an (α, β) `1 well-conditioned basis and -net. Definition D.15 (`1 Well-conditioned basis). [DDH+ 09] A basis U for the range of A is (α, β)condtioned if kU k1 ≤ α and for all x ∈ Rk , kxk∞ ≤ βkU xk1 . We will say U is well-conditioned if α and β are low-degree polynomials in k, independent of n. Note that a well-conditoned basis implies the following result. Fact D.16. There exist α, β ≥ 1 such that, ∀x ∈ Rk , 1 kxk1 ≤ kU xk1 ≤ αkxk1 . kβ Proof. The lower bound can be proved in the following sense, kU xk1 ≥ 1 11 kxk∞ ≥ kxk1 , β βk where the first step follows by the properties of a well-conditioned basis, and the second step follows since kkxk∞ ≥ kxk1 . Then we can show an upper bound, kU xk1 ≤ kU k1 · kxk1 ≤ αkxk1 , where the first step follows by kU xk1 ≤ kU k1 kxk1 , and the second step follows using kU k1 ≤ α. Definition D.17 (-net). Define N to an -net where, for all the x ∈ Rk that kxk1 = 1, for any vectors two x, x0 ∈ N , kx − x0 k1 ≥ , for any vector y ∈ / N , there exists an x ∈ N such that kx − yk1 ≤ . Then the size of N is ( 1 )O(k) = 2O(k log(1/)) . Lemma D.18 (Lemma 6 in [SW11]). There is a constant c0 > 0 such that for any t ≥ 1 and any constant c > c0 , if S is a t × n matrix whose entries are i.i.d. standard Cauchy random variables scaled by c/t, then, for any fixed y ∈ Rn , Pr[kSyk1 < kyk1 ] ≤ 1/2t Lemma D.19. Suppose we are given a well-conditioned basis U ∈ Rn×k . If S is a t × n matrix whose entries are i.i.d. standard Cauchy random variables scaled by Θ(1/t), then with probability 1 − 2−Ω(t) , for all vectors x ∈ N we have that kSU xk1 ≥ kU xk1 . Proof. First, using Lemma D.18, we have for any fixed vector y ∈ Rn , Pr[kSyk < kyk1 ] ≤ 1/2t . Second, we can rewrite y = U x. Then for any fixed x ∈ N , Pr[kSU xk < kU xk1 ] ≤ 1/2t . Third, choosing t & k log(1/) and taking a union bound over all the vectors in the -net N completes the proof. Lemma D.20 (Lemma 7 in [SW11]). Let S be a t×n matrix whose entries are i.i.d standard Cauchy random variables, scaled by c/t for a constant c, and t ≥ 1. Then there is a constant c0 = c0 (c) > 0 such that for any fixed set of {y1 , y2 , · · · , yk } of d vectors in {y ∈ Rn : x ∈ Rk , U x = y}, k k X X Pr[ kSyi k1 ≥ c0 log(tk) kyi k1 ] ≤ i=1 i=1 51 1 . 1000 Using Lemma D.20 and the definition of an (α, β) well-conditioned basis, we can show the following corollary. Corollary D.21. Suppose we are given an (α, β) `1 well-conditioned basis U ∈ Rn×k . Choose S to be an i.i.d. Cauchy matrix with t = O(k log k) rows, and rescale each entry by Θ(1/t). Then with probability 99/100, for all vectors x ∈ Rk , kSU xk1 ≤ O(αβ log(k)) · kU xk1 , Proof. Define event E to be the situation when k X 0 kSUi k1 < c log(tk) i=1 k X kUi k1 i=1 holds, and U is a well-conditioned basis. Using Lemma D.20, we can show that event E holds with probability 999/1000. We condition on Event E holding. Then for any y = U x for an x ∈ Rk , we have kSyk1 = kSU xk1 ≤ k X kSUj xj k1 by triangle inequality j=1 = k X |xj | · kSUj k1 j=1 0 ≤ kxk∞ c log(tk) k X kUj k1 by Lemma D.20 j=1 0 = kxk∞ c log(tk)α by kU k1 = k X kUj k1 ≤ α j=1 ≤ βkU xk1 c0 log(tk)α by kxk∞ ≤ βkU xk1 0 ≤ βkyk1 c log(tk)α by U x = y. This completes the proof. Lemma D.22. Given an (α, β) `1 well-conditioned basis, condition on the following two events, 1. For all x ∈ N , kSU xk1 ≥ kU xk1 . (Lemma D.18) 2. For all x ∈ Rk , kSU xk1 ≤ O(αβ log k)kU xk1 . (Corollary D.21) Then, for all w ∈ Rk , kSU wk1 & kU wk1 . Proof. For any w ∈ Rk we can write it as w = ` · z where ` is some scalar and z has kzk1 = 1. Define y = arg minky 0 − zk1 . y 0 ∈N We first show that if U is an (α, β) well-conditioned basis for `1 , then kU (y −z)k1 ≤ αβkkU yk1 , kU (y − z)k1 ≤ αky − zk1 by kU (y − z)k1 ≤ αky − zk1 ≤ α by ky − zk1 ≤  by kyk1 = 1 1 kyk1 . by kU yk1 ≥ βk = αkyk1 ≤ αkU yk1 βk 52 Because  < 1/(αβk c+1 ), we have kU (y − z)k1 ≤ 1 kU yk1 . kc (20) Using the triangle inequality, we can lower bound kU yk1 by kU zk1 up to some constant, kU yk1 ≥ kU zk1 − kU (y − z)k1 ≥ kU zk1 − 1 kU yk1 , kc (21) which implies kU yk1 ≥ .99kU zk1 . (22) Thus, kSU zk1 ≥ kSU yk1 − kSU (z − y)k1 by triangle inequality ≥ kU yk1 − kSU (z − y)k1 by Lemma D.18 ≥ kU yk1 − αβ log(k) · kU (z − y)k1 1 ≥ kU yk1 − αβ log(k) · c kU yk1 k & kU yk1 & kU zk1 , by Corollary D.21 by Equation (20) by k c & αβ log(k) by Equation (22) by rescaling z to w, we complete the proof. Lemma D.23. Given matrix U ∈ Rn×k , let t = O(k log k), and let S ∈ Rt×n be a random matrix with entries drawn i.i.d. from a standard Cauchy distribution, where each entry is rescaled by Θ(1/t). With probability .99, ∀x ∈ Rk , kSU xk1 & kU xk1 . Proof. We can compute a well-conditioned basis for U , and denote it U 0 . Then, ∀x ∈ Rk , there exists y ∈ Rk such that U x = U 0 y. Due to Lemma D.22, with probability .99, we have ∀y ∈ Rk , kSU 0 yk1 & kU 0 yk1 . D.6 Sparse Cauchy transform This section presents the proof of two lemmas related to the sparse Cauchy transform. We first prove the no dilation result in Lemma D.24. Then we show how to get the no contraction result in Lemma D.26. Lemma D.24. Given matrix A ∈ Rn×d , let U ∗ , V ∗ be the optimal solutions of minU,V kU V − Ak1 . Let Π = σ · SC ∈ Rm×n , where S ∈ Rm×n has each column vector chosen independently and uniformly from the m standard basis vectors of Rm , where C is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution, and σ is a scalar. Then kΠU ∗ V ∗ − ΠAk1 . σ · log(md) · kU ∗ V ∗ − Ak1 holds with probability at least .999. 53 Proof. We define Π = σ · SC ∈ Rm×n , as in the statement of the lemma. Then, kΠ(U ∗ V ∗ − A)k1 = d X kSD(U ∗ Vi∗ − Ai )k1 i=1  S11 S12 · · · d X  S21 S22 · · ·  = ··· ··· ··· i=1 Sm1 Sm2 · · ·  c1 S11 c2 S12 d X  c1 S21 c2 S22  =  ··· ··· i=1 c1 Sm1 c2 Sm2 = d X n X cl S1l · (U ∗ Vi∗    S1n c1 0 0 0  S2n  0  ·  0 c2 0  · (U ∗ Vi∗ − Ai )   ··· 0 0 ··· 0  Smn 0 0 0 cn  · · · cn S1n · · · cn S2n   · (U ∗ Vi∗ − Ai ) ··· ···  1 · · · cn Smn − Ai )l , i=1 = = l=1 d m XX n X i=1 j=1 l=1 | d X m X cl S2l · (U ∗ Vi∗ − Ai )l , · · · , l=1 d X m X n X n X cl Sml · (U ∗ Vi∗ − Ai )l 1 l=1 cl Sjl · (U ∗ Vi∗ − Ai )l | |w eij · i=1 j=1 = n X 1 n X |Sjl (U ∗ Vi∗ − Ai )l || where w eij ∼ C(0, 1) l=1 |Sjl (U ∗ Vi∗ − Ai )l | · |w eij | i=1 j=1 l=1 = d X m X n X |Sjl (U ∗ Vi∗ − Ai )l | · wi+(j−1)d where wi+(j−1)d ∼ |C(0, 1)|, i=1 j=1 l=1 where the last step follows since each wi can be thought of as a clipped half-Cauchy random variable. Define d0 = md. Define event ξi to be the situation when wi < D (we will decide upon D later). Define event ξ = ξ1 ∩ ξ2 ∩ · · · ∩ ξd0 . By choosing D = Θ(d0 ), we can conclude that, E[kΠU ∗ V ∗ − ΠAk1 |ξ] = d X m X n X |Sjl (U ∗ Vi∗ − Ai )l | · E[wi+(j−1)d |ξ] i=1 j=1 l=1 . d X m X n X |Sjl (U ∗ Vi∗ − Ai )l | · log(d0 ) i=1 j=1 l=1 = d X n X |(U ∗ Vi∗ − Ai )l |1 · log(d0 ) by i=1 l=1 0 m X j=1 = log(d ) · kU ∗ V ∗ − Ak1 . Thus, we can show that Pr[kΠU ∗ V ∗ − ΠAk1 . log(d0 )kU ∗ V ∗ − Ak1 ] ≥ 0.999. 54 |Sjl | = 1, ∀l ∈ [n] Lemma D.25. Given any matrix M ∈ Rn×d . Let Π = σ · SC ∈ Rm×n , where S ∈ Rm×n has each column vector chosen independently and uniformly from the m standard basis vectors of Rm , where C is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution, and σ is a scalar. Then kΠM k1 . σ · log(md) · kM k1 holds with probability at least .999. Proof. Just replace the matrix U ∗ V ∗ − A in the proof of Lemma D.24 with M . Then we can get the result directly. We already provided the proof of Lemma D.24. It remains to prove Lemma D.26. Lemma D.26. Given matrix A ∈ Rn×d , let U ∗ , V ∗ be the optimal solution of minU,V kU V −Ak1 . Let Π = σ · SC ∈ Rm×n , where S ∈ Rm×n has each column vector chosen independently and uniformly from the m standard basis vectors of Rm , and where C is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution. Then with probability at least .999, for all V ∈ Rk×d , kΠU ∗ V − ΠAk1 ≥ kU ∗ V − Ak1 − O(σ · log(md))kU ∗ V ∗ − Ak1 . Notice that m = O(k 5 log5 k) and σ = O(k 2 log2 k) according to Theorem 2 in [MM13]. We start by using Theorem 2 in [MM13] to generate the following Corollary. Corollary D.27. Given U ∈ Rn×k with full column rank, let Π = σ · SC ∈ Rm×n where S ∈ Rm×n has each column chosen independently and uniformly from the m standard basis vectors of Rm , and where C ∈ Rn×n is a diagonal matrix with diagonals chosen independently from the standard Cauchy distribution. Then with probability .999, for all x ∈ Rk , we have kΠU xk1 ≥ kU xk1 . Notice that m = O(k 5 log5 k) and σ = O(k 2 log2 k) according to Theorem 2 in [MM13]. We give the proof of Lemma D.26. Proof. Follows by Corollary D.27, Lemma D.24, Lemma D.7. D.7 `1 -Lewis weights In this section we show how to use Lewis weights to get a better dilation bound. The goal of this section is to prove Lemma D.32 and Lemma D.31. Notice that our algorithms in Section C use Lewis weights in several different ways. The first way is using Lewis weights to show an existence result, which means we only need an existential result for Lewis weights. The second way is only guessing the nonzero locations on the diagonal of a sampling and rescaling matrix according to the Lewis weights. The third way is guessing the values on the diagonal of a sampling and rescaling matrix according to the Lewis weights. The fourth way is computing the Lewis weights for a known low dimensional matrix(n×poly(k) or poly(k)×d). We usually do not need to optimize the running time of computing Lewis weights for a low-rank matrix to have input-sparsity time. 55 Claim D.28. Given matrix A ∈ Rn×d , let B = U ∗ V ∗ − A. For any distribution p = (p1 , p2 , . . . , pn ) define random variable X such that XP= kBi k1 /pi with probability pi . Then take any m independent m 1 j samples X 1 , X 2 , . . . , X m , let Y = m j=1 X . We have Pr[Y ≤ 1000kBk1 ] ≥ .999 Proof. We can compute the expectation of X j , for any j ∈ [m] E[X j ] = n X kBi k1 i=1 Then, E[Y ] = 1 m Pm j=1 E[X j] pi · pi = kBk1 . = kBk1 . Using Markov’s inequality, we have Pr[Y ≥ 1000kBk1 ] ≤ .001 Lemma D.29. Given matrix M ∈ Rn×d , let S ∈ Rn×n be any sampling and rescaling diagonal matrix. Then with probability at least .999, kSM k1 . kM k1 . Proof. Just replace the matrix B in the proof of Claim D.28 with M . Then we can get the result directly. Using Theorem 1.1 of [CP15], we have the following result, Claim D.30. Given matrix A ∈ Rn×d , for any fixed U ∗ ∈ Rn×k and V ∗ ∈ Rk×d , choose D ∈ Rn×n to be the sampling and rescaling diagonal matrix with m = O(k log k) nonzeros according to the Lewis weights of U ∗ . Then with probability .999, for all V , kU ∗ V ∗ − U ∗ V k1 ≤ kDU ∗ V ∗ − DU ∗ V k1 . kU ∗ V ∗ − U ∗ V k1 . Lemma D.31. Given matrix A ∈ Rn×d , U ∗ ∈ Rn×k , define V ∗ ∈ Rk×d to be the optimal solution of min kU ∗ V −Ak1 . Choose a sampling and rescaling diagonal matrix D ∈ Rn×n with m = O(k log k) V ∈Rk×d non-zero entries according to the Lewis weights of U ∗ . Then with probability at least .99, we have: for all V ∈ Rk×d , kDU ∗ V − DAk1 . kU ∗ V ∗ − U ∗ V k1 + O(1)kU ∗ V ∗ − Ak1 . kU ∗ V − Ak1 , holds with probability at least .99. Proof. Using the above two claims, we have with probability at least .99, for all V ∈ Rk×d , kDU ∗ V − DAk1 ≤ kDU ∗ V − DU ∗ V ∗ k1 + kDU ∗ V ∗ − DAk1 ∗ ∗ ∗ ∗ by triangle inequality ∗ . kDU V − DU V k1 + O(1)kU V − Ak1 ∗ ∗ ∗ ∗ by Claim D.28 ∗ . kU V − U V k1 + O(1)kU V − Ak1 ∗ ∗ ∗ by Claim D.30 ∗ ∗ ≤ kU V − Ak1 + kU V − Ak1 + O(1)kU V − Ak1 ∗ . kU V − Ak1 . 56 by triangle inequality Lemma D.32. Given matrix A ∈ Rn×d , define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be the optimal solution of min kU V − Ak1 . Choose a sampling and rescaling diagonal matrix D ∈ Rn×n with U ∈Rn×k ,V ∈Rk×d m = O(k log k) non-zero entries according to the Lewis weights of U ∗ . For all V ∈ Rk×d we have kU ∗ V − Ak1 . kDU ∗ V − DAk1 + O(1)kU ∗ V ∗ − Ak1 , holds with probability at least .99. Proof. Follows by Claim D.28, Lemma D.31, Lemma D.7. E `p -Low Rank Approximation This section presents some fundamental lemmas for `p -low rank approximation problems. Using these lemmas, all the algorithms described for `1 -low rank approximation problems can be extended to `p -low rank approximation directly. We only state the important Lemmas in this section, due to most of the proofs in this section being identical to the proofs in Section D. E.1 Definitions This section is just a generalization of Section D.1 to the `p setting when 1 < p < 2. Definition E.1. Given a matrix M ∈ Rn×d , if matrix S ∈ Rm×n satisfies kSM kpp ≤ c1 kM kpp , then S has at most c1 -dilation on M . Definition E.2. Given a matrix U ∈ Rn×k , if matrix S ∈ Rm×n satisfies ∀x ∈ Rk , kSU xkpp ≥ 1 kU xkpp , c2 then S has at most c2 -contraction on U . Definition E.3. Given matrices U ∈ Rn×k , A ∈ Rn×d , denote V ∗ = arg minV ∈Rk×d kU V − Akpp . If matrix S ∈ Rm×n satisfies ∀V ∈ Rk×d , kSU V − SAkpp ≥ 1 kU V − Akpp − c4 kU V ∗ − Akpp , c3 then S has at most (c3 , c4 )-contraction on (U, A). Definition E.4. A (c5 , c6 ) `p -subspace embedding for the column space of an n × k matrix U is a matrix S ∈ Rm×n for which all x ∈ Rk 1 kU xkpp ≤ kSU xkpp ≤ c6 kU xkpp . c5 57 Definition E.5. Given matrices U ∈ Rn×k , A ∈ Rn×d , denote V ∗ = arg minV ∈Rk×d kU V − Akpp . Let S ∈ Rm×n . If for all c ≥ 1, and if for any Vb ∈ Rk×d which satisfies kSU Vb − SAkpp ≤ c · min kSU V − SAkpp , V ∈Rk×d it holds that kU Vb − Akpp ≤ c · c7 · kU V ∗ − Akpp , then S provides a c7 -multiple-regression-cost preserving sketch of (U, A). Definition E.6. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Akpp . b ∈ Rm1 ×m2 which satisfies Let S ∈ Rm×n . If for all c ≥ 1, and if for any rank −k X b − SAkpp ≤ c · kSLXN min rank −k X kSLXN − SAkpp , it holds that b − Akp ≤ c · c8 · kLX ∗ N − Akp , kLXN p p then S provides a c8 -restricted-multiple-regression-cost preserving sketch of (L, N, A, k). E.2 Properties Lemma E.7. Given matrices A ∈ Rn×d , U ∈ Rn×k , let V ∗ = arg minV ∈Rk×d kU V − Akpp . If S ∈ Rm×n has at most c1 -dilation on U V ∗ − A, i.e., kS(U V ∗ − A)kpp ≤ c1 kU V ∗ − Akpp , and it has at most c2 -contraction on U , i.e., ∀x ∈ Rk , kSU xkpp ≥ 1 kU xkpp , c2 then S has at most (22p−2 c2 , c1 + 21−p c12 )-contraction on (U, A), i.e., ∀V ∈ Rk×d , kSU V − SAkpp ≥ 1 1 kU V − Akpp − (c1 + )kU V ∗ − Akpp , c2 c2 Proof. Let A ∈ Rn×d , U ∈ Rn×k , and S ∈ Rm×n be the same as that described in the lemma. Then 58 ∀V ∈ Rk×d kSU V − SAkpp ≥ 21−p kSU V − SU V ∗ kpp − kSU V ∗ − SAkpp ≥ 21−p kSU V − SU V ∗ kpp − c1 kU V ∗ − Akpp = 21−p kSU (V − V ∗ )kpp − c1 kU V ∗ − Akpp = 21−p d X kSU (V − V ∗ )j kpp − c1 kU V ∗ − Akpp j=1 ≥ 21−p d X 1 kU (V − V ∗ )j kpp − c1 kU V ∗ − Akpp c2 j=1 1 kU V − U V ∗ kpp − c1 kU V ∗ − Akpp c2 1 1 ≥ 22−2p kU V − Akpp − 21−p kU V ∗ − Akpp − c1 kU V ∗ − Akpp c2 c2   2−2p 1 p 1−p 1 ∗ p =2 kU V − Akp − (2 + c1 )kU V − Akp . c2 c2 = 21−p The first inequality follows by Fact E.14. The second inequality follows since S has at most c1 dilation on U V ∗ − A. The third inequality follows since S has at most c2 contraction on U . The fourth inequality follows by Fact E.14. Lemma E.8. Given matrices A ∈ Rn×d , U ∈ Rn×k , let V ∗ = arg minV ∈Rk×d kU V − Akpp . If S ∈ Rm×n has at most c1 -dilation on U V ∗ − A, i.e., kS(U V ∗ − A)kpp ≤ c1 kU V ∗ − Akpp , and has at most c2 -contraction on U , i.e., ∀x ∈ Rk , kSU xkpp ≥ 1 kU xkpp , c2 then S provides a 2p−1 (2c1 c2 + 1)-multiple-regression-cost preserving sketch of (U, A), i.e., for all c ≥ 1, for any Vb ∈ Rk×d which satisfies kSU Vb − SAkpp ≤ c · min kSU V − SAkpp , V ∈Rk×d it has kU Vb − Akpp ≤ c · 2p−1 (2c1 c2 + 1) · kU V ∗ − Akpp , Proof. Let S ∈ Rm×n , A ∈ Rn×d , U ∈ Rn×k , V ∗ , Vb ∈ Rk×d , and c be the same as stated in the lemma. kU Vb − Akpp ≤ 22p−2 c2 kSU Vb − SAkpp + (2p−1 + 22p−2 c1 c2 )kU V ∗ − Akpp ≤ 22p−2 c2 c min kSU V − SAkpp + (2p−1 + 22p−2 c1 c2 )kU V ∗ − Akpp 2p−2 ≤2 V ∈Rk×d ∗ c2 ckSU V − SAkpp + (2p−1 + 22p−2 c1 c2 )kU V ∗ − Akpp ≤ 22p−2 c1 c2 ckU V ∗ − Akpp + (2p−1 + 22p−2 c1 c2 )kU V ∗ − Akpp ≤ c · 2p−1 (1 + 2c1 c2 )kU V ∗ − Akpp . 59 The first inequality follows by Lemma E.7. The second inequality follows by the guarantee of Vb . The fourth inequality follows since S has at most c1 -dilation on U V ∗ − A. The fifth inequality follows since c ≥ 1. Lemma E.9. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Akpp . If S ∈ Rm×n has at most c1 -dilation on LX ∗ N − A, i.e., kS(LX ∗ N − A)kpp ≤ c1 kLX ∗ N − Akpp , and has at most c2 -contraction on L, i.e., ∀x ∈ Rm1 kSLxkpp ≥ kLxkpp , then S provides a 2p−1 (2c1 c2 +1)-restricted-multiple-regression-cost preserving sketch of (L, N, A, k), b ∈ Rm1 ×m2 which satisfies i.e., for all c ≥ 1, for any rank −k X b − SAkp ≤ c · kSLXN p min rank −k X kSLXN − SAkpp , it has b − Akp ≤ c · 2p−1 (2c1 c2 + 1) · kLX ∗ N − Akp . kLXN p p b ∈ Rm1 ×m2 , X ∗ ∈ Rm1 ×m2 , N ∈ Rm2 ×d , A ∈ Rn×d and c ≥ 1 Proof. Let S ∈ Rm×n , L ∈ Rn×m1 , X be the same as stated in the lemma. b − SAkpp ≥ 21−p kSLXN b − SLX ∗ N kpp − kSLX ∗ N − SAkpp kSLXN 1 b − X ∗ N )kpp − c1 kLX ∗ N − Akpp ≥ 21−p kL(XN c2 1 b − Akpp − 21−p 1 kLX ∗ N − Ak1 − c1 kLX ∗ N − Akpp ≥ 22−2p kLXN c2 c2 1 b − Akp − (21−p 1 + c1 )kLX ∗ N − Akp . = 22−2p kLXN p p c2 c2 The inequality follows from the Fact E.14. The second inequality follows since S has at most c2 contraction on L, and it has at most c1 -dilation on LX ∗ N − A. The third inequality follows by Fact E.14. It follows that b − Akp ≤ 22p−2 c2 kSLXN b − SAkp + (2p−1 + 22p−2 c1 c2 )kLX ∗ N − Akp kLXN p p p ≤ 22p−2 c2 c · min rank −k X ∗ kSLXN − SAkpp + (2p−1 + 22p−2 c1 c2 )kLX ∗ N − Akpp ≤ 22p−2 c2 c · kSLX N − SAkpp + (2p−1 + 22p−2 c1 c2 )kLX ∗ N − Akpp ≤ 22p−2 cc1 c2 · kLX ∗ N − Akpp + (2p−1 + 22p−2 c1 c2 )kLX ∗ N − Akpp ≤ c · 2p−1 (1 + 2c1 c2 )kLX ∗ N − Akpp . The first inequality directly follows from the previous one. The second inequality follows from the b The fourth inequality follows since S has at most c1 dilation on LX ∗ N − A. The guarantee of X. fifth inequality follows since c ≥ 1. 60 Lemma E.10. Given matrices L ∈ Rn×m1 , N ∈ Rm2 ×d , A ∈ Rn×d , k ≥ 1, let X ∗ = arg min rank −k X kLXN − Akpp . Let T1 ∈ Rt1 ×n have at most c1 -dilation on LX ∗ N − A, and have at most c2 -contraction on L. Let e = arg X min rank −k X kT1 LXN − T1 Akpp . e − T1 A)> , and at most c0 -contraction on N > . Let T2> ∈ Rt2 ×d have at most c01 -dilation on (T1 LXN 2 b ∈ Rm1 ×m2 which satisfies Then, for all c ≥ 1, for any rank −k X b − SA)T2 kp ≤ c · kT1 (LXN p min rank −k X kT1 (LXN − A)T2 kpp , it holds that b − Akp ≤ c · 22p−2 (2c1 c2 + 1)(2c0 c0 + 1) · kLX ∗ N − Akp . kLXN p 1 2 p b ∈ Rm1 ×m2 Proof. Apply Lemma D.9 for sketching matrix T2 . Then for any c ≥ 1, any rank −k X which satisfies b − A)T2 kpp ≤ c · kT1 (LXN min rank −k X kT1 (LXN − A)T2 kpp , it has b − A)kpp ≤ c · 2p−1 (2c01 c02 + 1) · kT1 (LXN e − A)kpp . kT1 (LXN b ∈ Rm1 ×m2 which Apply Lemma D.9 for sketch matrix T1 . Then for any c ≥ 1, any rank −k X satisfies b − A)kp ≤ c2p−1 (2c0 c0 + 1) · kT1 (LXN p 1 2 min rank −k X e − A)kp , kT1 (LXN p it has b − Akp ≤ c · 22p−2 (2c1 c2 + 1)(2c0 c0 + 1) · kLX ∗ N − Akp . kLXN p 1 2 p Lemma E.11. Given matrices M ∈ Rn×d , U ∈ Rn×t , d ≥ t = rank(U ), n ≥ d ≥ r = rank(M ). If sketching matrix S ∈ Rm×n is drawn from any of the following probability distributions on matrices, with .99 probability, S has at most c1 -dilation on M , i.e., kSM kpp ≤ c1 kM kpp , and S has at most c2 -contraction on U , i.e., ∀x ∈ Rt , kSU xkpp ≥ 1 kU xkpp , c2 where c1 , c2 are parameters depend on the distribution over S. (I) S ∈ Rm×n is a dense matrix with entries drawn from a p-stable distribution: a matrix with i.i.d. standard p-stable random variables. If m = O(t log t), then c1 c2 = O(log d). 61 (II) S ∈ Rm×n is a sparse matrix with some entries drawn from a p-stable distribution: S = T D, where T ∈ Rm×n has each column drawn i.i.d. from the uniform distribution over standard basis vectors of Rm , and D ∈ Rn×n is a diagonal matrix with each diagonal entry drawn from i.i.d. from the standard p-stable distribution. If m = O(t5 log5 t), then c1 c2 = O(t2/p log2/p t log d). If m = O((t + r)5 log5 (t + r)), then c1 c2 = O(min(t2/p log2/p t log d, r3/p log3/p r)). (III) S ∈ Rm×n is a sampling and rescaling matrix (notation S ∈ Rn×n denotes a diagonal sampling and rescaling matrix with m non-zero entries): If S samples and reweights m = O(t log t log log t) rows of U , selecting each with probability proportional to the ith row’s `p Lewis weight and reweighting by the inverse probability, then c1 c2 = O(1). In the above, if we replace S with σ · S where σ ∈ R\{0} is any scalar, then the relation between m and c1 c2 can be preserved. For (I), it is implied by Lemma E.17, Lemma E.19. Also see from [SW11]1 . For (II), if m = O(t5 log5 t), then c1 c2 = O(t2/p log2/p t log d) is implied by Corollary D.27 and Lemma E.20 and Theorem 4 in [MM13]. If m = O((t + r)5 log5 (t + r)), c1 c2 = O(r3/p log3/p r) is implied by [MM13]. For (III), it is implied by [CP15] and Lemma D.29. E.3 Tools and inequalities Lemma E.12 (Lemma 9 in [MM13], Upper Tail Inequality for p-stable Distributions). Let p ∈ (1, 2) and m ≥ 3. ∀i ∈ [m], letPXi be m(not necessarily random variables sampled from Dp , Pm independent) p . Then for any t ≥ 1, γ |X | γ . Let X = and let γi > 0 with γ = m i i=1 i i=1 i Pr[X ≥ tαp γ] ≤ 2 log(mt) . t We first review some facts about the p-norm and q-norm, Fact E.13. For any p ≥ q > 0 and any x ∈ Rk , 1 kxkp ≤ kxkq ≤ k q − p1 kxkp . We provide the triangle inequality for the p-norm, Fact E.14. For any p ∈ (1, 2), for any x, y ∈ Rk , kx + ykp ≤ kxkp + kykp , and kx + ykpp ≤ 2p−1 (kxkpp + kykpp ). Fact E.15 (Hölder’s inequality). For any x, y ∈ Rk , if 1 p + 1 q = 1, then |x> y| ≤ kxkp kykq . We give the definition of a well-conditioned basis for `p , Definition E.16. Let p ∈ (1, 2). A basis U for the range of A is (α, β, p)-conditioned if kU kp ≤ α and for all x ∈ Rk , kxkq ≤ βkU xkp . We will say U is well-conditioned if α and β are low-degree polynomials in k, independent of n. 1 Full version. 62 Proof. We first show an upper bound, kU xkp ≤ kU kp · kxkp ≤ αkxkp Then we show a lower bound, kU xkp ≥ 1 kxkq β For any p and q with 1/p + 1/q = 1, by Hölder’s inequality we have |x> y| ≤ kxkp · kykq choosing y to be the vector that has 1 everywhere, kxk1 ≤ kxkp k 1/q E.4 Dense p-stable transform This section states the main tools for the dense p-stable transform. The proof is identical to that for the dense Cauchy transform. Lemma E.17. Given matrix A ∈ Rn×d and p ∈ (1, 2), define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be an kU V − Akp . Choose a p-stable distribution matrix S ∈ Rm×n , optimal solution of min rescaled by U ∈Rn×k ,V ∈Rk×d 1/p Θ(1/m ). Then we have kSU ∗ V ∗ − SAkpp . log(md)kU ∗ V ∗ − Akpp with probability at least 99/100. Proof. Let P (0, 1) denote the p-stable distribution. Then, kSU ∗ V ∗ − SAkpp ≤ = d X kS(U ∗ Vi∗ − Ai )kpp i=1 d X m X i=1 j=1 n X 1 | Sj,l (U ∗ Vi∗ − Ai )l |p m d m n X 1 XX = |w eij ( |(U ∗ Vi∗ − Ai )l |p )1/p |p m i=1 j=1 d where Sj,l ∼ P (0, 1) l=1 m where w eij ∼ P (0, 1) l=1 n 1 XXX |(U ∗ Vi∗ − Ai )l |p · |w eij |p = m i=1 j=1 l=1 d m 1 XX ∗ ∗ p = kU Vi − Ai kpp · wi+(j−1)d , m where wi+(j−1)d ∼ |P (0, 1)| i=1 j=1 where the last step wi can be thought of as a clipped random variable. Pdfollows Pm since∗ each Pdhalf-p-stable Pm p p ∗ ∗ Define X to be i=1 j=1 kU Vi − Ai kp · wi+(j−1)d and γ to be i=1 j=1 kU Vi∗ − Ai kpp . Then applying Lemma E.12, Pr[X ≥ tαp γ] ≤ 63 2 log(mdt) . t Choosing t = Θ(log(md)), we have with probability .999, X . log(md)αp γ = log(md)αp d X kU ∗ Vi∗ − Ai kpp , i=1 where the last steps follows by definition of γ. Thus, we can conclude that with probability .999, kΠ(U ∗ V ∗ − A)kpp . log(md)kU ∗ V ∗ − Akpp . Lemma E.18. Given matrix A ∈ Rn×d and p ∈ (1, 2), define U ∗ ∈ Rn×k to be the optimal solution of min kU V − Akp . Choose a matrix of i.i.d. p-stable random variables S ∈ Rm×n . Then U ∈Rn×k ,V ∈Rk×d for all V ∈ Rk×n , we have kSU ∗ V − SAkpp & kU ∗ V − Akpp − O(log(md))kU ∗ V ∗ − Akpp . Lemma E.19. Let p ∈ (1, 2). Given an (α, β) `p well-conditioned basis, condition on the following two events, 1. For all x ∈ N , kSU xkp & kU xkp . 2. For all x ∈ Rk , kSU xkp ≤ poly(k)kU xkp . Then for all x ∈ Rk , kSU xkp & kU xkp . Proof. The proof is identical to Lemma D.22 in Section D. E.5 Sparse p-stable transform This section states the main tools for the sparse p-stable transform. The proof is identical to that of the sparse Cauchy transform. Lemma E.20. Let p ∈ (1, 2). Given matrix A ∈ Rn×d with U ∗ , V ∗ an optimal solution of minU,V kU V − Akp , let Π = σ · SC ∈ Rm×n , where S ∈ Rm×n has each column vector chosen independently and uniformly from the m standard basis vectors of Rm , where C is a diagonal matrix with diagonals chosen independently from the standard p-stable distribution, and σ is a scalar. Then kΠU ∗ V ∗ − ΠAkpp . σ · log(md) · kU ∗ V ∗ − Akpp holds with probability at least .999. Proof. We define Π = σ · SC ∈ Rm×n as in the statement of the lemma. Then by the definition of 64 Π, we have, kΠ(U ∗ V ∗ − A)kpp = d X kSC(U ∗ Vi∗ − Ai )kpp i=1  S11 S12 · · · d X  S21 S22 · · ·  = ··· ··· ··· i=1 Sm1 Sm2 · · ·  c1 S11 c2 S12 d X  c1 S21 c2 S22  =  ··· ··· i=1 c1 Sm1 c2 Sm2 = d X n X    c1 0 0 0 S1n  0 S2n   · (U ∗ Vi∗ − Ai )  ·  0 c2 0 ···  0 0 ··· 0  0 0 0 cn Smn  · · · cn S1n p · · · cn S2n   · (U ∗ Vi∗ − Ai ) ··· ···  p · · · cn Smn cl S1l · (U ∗ Vi∗ − Ai )l , i=1 = l=1 d X m X n X n X cl S2l · (U ∗ Vi∗ − Ai )l , · · · , l=1 n X p p p cl Sml · (U ∗ Vi∗ − Ai )l p l=1 p cl Sjl · (U ∗ Vi∗ − Ai )l by aX + bY and (|a|p + |b|p )1/p Z are indentically distributed i=1 j=1 l=1 = d X m X n X |Sjl (U ∗ Vi∗ − Ai )l |p )1/p w eij · ( i=1 j=1 = d X m X n X p where w eij ∼ P (0, 1) l=1 |Sjl (U ∗ Vi∗ − Ai )l |p · |w eij |p i=1 j=1 l=1 = d X m X n X p |Sjl (U ∗ Vi∗ − Ai )l |p · wi+(j−1)d , where wi+(j−1)d ∼ |P (0, 1)| i=1 j=1 l=1 where the last step be thought of as a clipped half-p-stable P follows P since Pn each wi∗can Pd Pm random Pn variable. ∗ −A ) |p ·w p ∗ ∗ |S (U V Define X to be di=1 m and γ to be i jl l i j=1 l=1 i=1 j=1 l=1 |Sjl (U Vi − i+(j−1)d Ai )l |p . Then applying Lemma E.12, Pr[X ≥ tαp γ] ≤ 2 log(mdt) . t Choosing t = Θ(log(md)), we have with probability .999, X . log(md)αp γ = log(md)αp d X n X |(U ∗ Vi∗ − Ai )l |p , i=1 l=1 where the last steps follows by γ= d X m X n X i=1 j=1 l=1 |Sjl (U ∗ Vi∗ − Ai )l |p = d X m X n X |Sjl |p |(U ∗ Vi∗ − Ai )l |p = i=1 j=1 l=1 d X n X |(U ∗ Vi∗ − Ai )l |p . i=1 l=1 Thus, we can conclude that with probability .999, kΠ(U ∗ V ∗ − A)kpp . log(md)kU ∗ V ∗ − Akpp . 65 Lemma E.21. Given matrix A ∈ Rn×d with U ∗ , V ∗ an optimal solution of minU,V kU V − Akp , let Π = σ · SC ∈ Rm×n , where S ∈ Rm×n has each column vector chosen independently and uniformly from the m standard basis vectors of Rm , and where C is a diagonal matrix with diagonals chosen independently from the standard p-stable distribution. Then with probability at least .999, for all V ∈ Rk×d , kΠU ∗ V − ΠAkpp ≥ kU ∗ V − Akpp − O(σ log(md))kU ∗ V ∗ − Akpp . Notice that m = O(k 5 log5 k) and σ = O((k log k)2/p ) according to Theorem 4 in [MM13]. E.6 `p -Lewis weights This section states the main tools for `p -Lewis weights. The proof is identical to `1 -Lewis weights. Lemma E.22. For any p ∈ (1, 2). Given matrix A ∈ Rn×d , define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be an optimal solution of min kU V − Akp . Choose a diagonal matrix D ∈ Rn×n according to the Lewis weights of U ∈Rn×k ,V ∈Rk×d U ∗ . We have that kDU ∗ V ∗ − DAkpp . kU ∗ V ∗ − Akpp , holds with probability at least .99. Lemma E.23. Let p ∈ (1, 2). Given matrix A ∈ Rn×d , define U ∗ ∈ Rn×k , V ∗ ∈ Rk×d to be an optimal solution of min kU V − Akp . Choose a sampling and rescaling matrix D ∈ Rn×n U ∈Rn×k ,V ∈Rk×d according to the Lewis weights of U ∗ . For all V ∈ Rk×d we have kDU ∗ V − DAkpp & kU ∗ V − Akpp − O(1)kU ∗ V ∗ − Akpp , holds with probability at least .99. F EMD-Low Rank Approximation In this section we explain how to embed EMD to `1 . For more detailed background on the EarthMover Distance(EMD) problem, we refer the reader to [IT03, AIK08, ABIW09, IP11, BIRW16] and [SL09, LOG16]. Section F.1 introduces some necessary notation and definitions for Earth-Mover Distance. Section F.2 presents the main result for the Earth-Mover distance low rank approximation problem. F.1 Definitions [∆]2 Consider any two non-negative vectors x, y ∈ R+ such that kxk1 = kyk1 . P Let Γ(x, y) be the 2 2 2 set of functions γ : [∆] × [∆] → R+ , such that for any i, j ∈ [∆] we have l γ(i, l) = xi and P l γ(l, j) = yj ; that is, Γ is the set of possible “flows” from x to y. Then we define X EMD(x, y) = min γ(i, j)ki − jk1 γ∈Γ i,j∈[∆]2 to be the min cost flow from x to y, where the cost of an edge is its `1 distance. 66 Using the EMD(·, ·) metric, for general vectors w, we define k · kEEMD distance (which is the same as [SL09]), kwkEEMD = min EMD(x, y) + 2∆kzk1 . x−y+z=w kxk1 =kyk1 x,y≥0 Using k · kEEMD distance, for general matrices X ∈ Rn×d , we define the k · k1,EEMD distance, kXk1,EEMD = d X kXi kEEMD , i=1 where Xi denotes the j-th column of matrix X. F.2 Analysis of no contraction and no dilation bound Lemma F.1. Given matrix A ∈ Rn×d and U ∗ , V ∗ = arg min kU V − Ak1,EEMD , there exist U ∈Rn×k ,V ∈Rk×d sketching matrices S ∈ Rm×n such that, with probability .999, for all V ∈ Rk×d , kS(U ∗ V − A)k1 ≥ kU ∗ V − Ak1,EEMD holds. Proof. Using Lemma 1 in [IT03], there exists a constant C > 0 such that for all i ∈ [d], CkSU ∗ Vi − SAi k1 ≥ kU ∗ Vi − Ai kEEMD . (23) Then taking a summation over all d terms and rescaling the matrix S, we obtain, d X kS(U ∗ Vi − Ai )k1 ≥ kU ∗ Vi − Ai kEEMD i=1 which completes the proof. Lemma F.2. Given matrix A ∈ Rn×d and U ∗ , V ∗ = arg min kU V − Ak1,EEMD , there exist U ∈Rn×k ,V ∈Rk×d sketching matrices S ∈ Rm×n such that kS(U ∗ V ∗ − A)k1 ≤ O(log n)kU ∗ V ∗ − Ak1,EEMD holds with probability at least .999. Proof. Using Lemma 2 in [IT03], we have for any i ∈ [d], E[kSU ∗ Vi∗ − SAi k1 ] ≤ O(log n)kU ∗ Vi∗ − Ai kEEMD . Then using that the expectation is linear, we have d X E[kSU V − SAk1 ] = E[ kSU ∗ Vi∗ − SAi k1 ] ∗ ∗ = i=1 d X E[kSU ∗ Vi∗ − SAi k1 ] i=1 ≤ d X O(log n)kU ∗ Vi∗ − Ai kEEMD i=1 = O(log n)kU ∗ V ∗ − Ak1,EEMD . Using Markov’s inequality, we can complete the proof. 67 by Equation (24) (24) Theorem F.3. Given a matrix A ∈ Rn×d , there exists an algorithm running in poly(k, n, d) time that is able to output U ∈ Rn×k and V ∈ Rk×d such that kU V − Ak1,EEMD ≤ poly(k) · log d · log n min rank −k Ak kAk − Ak1,EEMD holds with probability .99. Proof. First using Lemma F.1 and Lemma F.2, we can reduce the original problem into an `1 low rank approximation problem by choosing m = poly(n). Second, we can use our `1 -low rank approximation algorithm to solve it. Notice that all of our `1 -low rank approximation algorithms can be applied here. If we apply Theorem C.6, we complete the proof. Our current k · k1,EEMD is column-based. We can also define it to be row-based. Then we get a slightly better result by applying the `1 -low rank algorithm. Corollary F.4. Given a matrix A ∈ Rn×d , there exists an algorithm running in poly(k, n, d) time that is able to output U ∈ Rn×k and V ∈ Rk×d such that kU V − Ak1,EEMD ≤ poly(k) · log2 d min rank −k Ak kAk − Ak1,EEMD holds with probability .99. G Hardness results for Cauchy matrices, row subset selection, OSE Section G.1 presents some inapproximability results by using random Cauchy matrices. Section G.2 is a warmup for inapproximability results for row subset selection problems. Section G.3 shows the inapproximability results by using any linear oblivious subspace embedding(OSE), and also shows inapproximability results for row subset selection. G.1 Hard instance for Cauchy matrices The goal of this section is to prove Theorem G.2. Before stating the result, we first introduce some useful tools in our analysis. Lemma G.1 (Cauchy Upper Tail Inequality, Lemma 3 of [CDMI+ 13]). For i ∈ [m], letPCi be m random Cauchy variables from C(0, 1) (not necessarily independent), and γi > 0 with γ = i∈[m] γi . P Let X = i∈[m] γi |Ci |. Then, for any t ≥ 1, Pr[X > γt] ≤ O(log(mt)/t). Theorem G.2. Let k ≥ 1. There exist matrices A ∈ Rd×d such that for any o(log d) ≥ t ≥ 1, where c can be any constant smaller than 1/3, for random Cauchy matrices S ∈ Rt×d where each entry is sampled from an i.i.d. Cauchy distribution C(0, γ) where γ is an arbitrary real number, with probability .99 we have min kU SA − Ak1 ≥ Ω(log d/(t log t)) min rank −k A0 U ∈Rd×t 68 kA0 − Ak1 . Proof. We define matrix A ∈ Rd×d  1 1  0 0  0 0 A=B+I =α·  · · · · · · 0 0 1 0 0 ··· 0   1 1  0 0    0 + 0  · · · ··· 0 0 ··· ··· ··· ··· ··· 0 1 0 ··· 0 0 0 1 ··· 0 ··· ··· ··· ··· ···  0 0  0 , · · · 1 where α = Θ(log d).So, if we only fit the first row of A, we can get approximation cost at most O(d). For t > 0, let S ∈ Rt×d denote a random Cauchy matrix where Si,j denotes the entry in the ith row and jth column. Then SA is     S1,1 S1,1 S1,1 · · · S1,1 S1,1 S1,2 S1,3 · · · S1,d S2,1 S2,1 S2,1 · · · S2,1  S2,1 S2,2 S2,3 · · · S2,d         SA = SB + SI = α ·  S3,1 S3,1 S3,1 · · · S3,1  + S3,1 S3,2 S3,3 · · · S3,d  . ··· ··· ··· ··· ···  ··· ··· ··· ··· ···  St,1 St,1 St,1 · · · St,1 St,1 St,2 St,3 · · · St,d Since ∀γ, min kU SA − Ak1 = min kγU SA − Ak1 , U ∈Rd×t U ∈Rd×t without loss of generality, we can let Si,j ∼ C(0, 1). Then we want to argue that, if we want to use SA to fit the first row of A, with high probability, the cost will be Ω(d log d). Let b ∈ Rd denote the first row of A. Then, we want to use SA to fit the first row of A, which is a d-dimensional vector that has entry Θ(log d) on each position. The problem is equiavlent to min k(SA)> x − bk1 . x∈Rt First, we want to show that for any x in Rt , if x> SA fits the first row of A very well, then the `1 and `2 norm of vector x must have reasonable size. Claim G.3. Define A1 to be the first row of matrix A. With probability .999, for any column vector x ∈ Rt×1 , if kx> SA − A1 k1 ≤ o(d log d), then Property (I) : kxk2 ≥ Ω(1/t log t); Property (II) : kxk1 ≤ O(log d). Proof. Consider the absolute value of the i-th coordinate of x> SA. We can rewrite |h(SA)i , xi| in the following sense, |h(SA)i , xi| = |h(SB)i , xi + h(SI)i , xi| = |h(SB)1 , xi + h(SI)i , xi| = |h(SB)1 , xi + hSi , xi|, (25) where the second step follows because (SB)i = (SB)1 , ∀i ∈ [n], and the last step follows because (SI)i = Si , ∀i ∈ [n]. We start by proving Property I. Using the triangle inequality and Equation (25), |h(SA)i , xi| ≤ |h(SB)1 , xi| + |hSi , xi| ≤ k(SB)1 k2 kxk2 + kSi k2 kxk2 by Cauchy-Schwarz inequality ≤ k(SB)1 k1 kxk2 + kSi k1 kxk2 . by k · k2 ≤ k · k1 69 Then, according to Lemma G.1, with probability .99999, we have k(SB)1 k1 ≤ O(t log t log d) and for a fixed i ∈ [d], kSi k1 ≤ O(t log t). Applying the Chernoff bound, with probability 1 − 2−Ω(d) , there are a constant fraction of i such that kSi k1 = O(t log t). Taking the union bound, with probability .9999, there exists a constant fraction of i such that |h(SA)i , xi| ≤ O(t log t log d)kxk2 . Because A1,i ≥ α, ∀i ∈ [d] where α = Θ(log d), we need kxk2 ≥ Ω(1/t log t). Otherwise, the total cost on this constant fraction of coordinates will be at least Ω(d log d). For Property II, for a fixed x ∈ Rt , we have |h(SA)i , xi| =|h(SB)1 , xi + hSi , xi| by Equation (25) = Θ(log d)kxk1 w10 (x) + kxk1 wi0 (x) . where wi0 (x) ∼ C(0, 1), and for different x, wi0 (x) are different. Then for a fixed x ∈ Rt with probability at least 0.9, |wi0 (x)| = Ω(1), and with probability 0.5, w10 (x) and wi0 (x) have the same sign. Since these two events are independent, with probability at least 0.45, we have |h(SA)i , xi| ≥ kxk1 · Ω(1). Applying the Chernoff bound, with probability at least 1 − 2Θ(d) , there exists a 3/10 fraction of i such that |h(SA)i , xi| ≥ kxk1 Ω(1). We build an -net N for x ∈ Rt on an `1 -norm unit ball, where  = 1/(t2 log2 d). Thus the size e of the net is |N | = 2Θ(t) . Consider y to be an arbitrary vector, let y/kyk1 = x + δ, where x is the closest point to y/kyk1 and x ∈ N . For any δ ∈ Rt , |h(SA)i , δi| = |h(SB)1 , δi + h(SI)i , δi| ≤ |h(SB)1 , δi| + |h(SI)i , δi| by triangle inequality ≤ k(SB)1 k2 kδk2 + kSi k2 kδk2 by Cauchy-Schwarz inequality ≤ k(SB)1 k2 kδk1 + kSi k2 kδk1 . by k · k2 ≤ k · k1 As we argued before, With probability .99999, we have k(SB)1 k2 ≤ k(SB)1 k1 ≤ O(t log t log d), (26) and with probability 1 − 2−Θ(d) , there is a 9/10 fraction of i ∈ [d], kSi k2 ≤ kSi k1 = O(t log t). Therefore, with probability .999, for any δ ∈ Rt , there exists a 9/10 fraction of i such that |h(SA)i , δi| ≤ Θ(t log t log d)kδk1 . Therefore, with probability .99, ∀y ∈ Rt , due to the pigeonhole principle, there is a 3/10 + 9/10 − 1 = 1/5 fraction of i such that |h(SA)i , yi| = kyk1 · |h(SA)i , y/kyk1 i| = kyk1 · |h(SA)i , x + δi| by y/kyk1 = x + δ  ≥ kyk1 · |h(SB)i , xi + h(SI)i , xi| − |h(SB)1 , δi + h(SI)i , δi|  ≥ kyk1 Ω(1) − O(t log t log d) by triangle inequality ≥ kyk1 Ω(1). So kyk1 should be O(log d). Otherwise, the total cost on this 1/5 fraction of coordinates is at least Ω(d log d). Combining Property (I) and (II) completes the proof. 70 Next, we need to show the following claim is true, Claim G.4. For any d independent Cauchy random variables x1 , x2 , · · · , xd from C(0, 1), with probability 1 − 1/ poly(t log d), for any j ∈ [1, 2, · · · , log d − Θ(log log(t log d))], there are Ω(d/2j ) variables belonging to (2j , 2j+1 ]. Proof. For each Cauchy random variable xi , we have for any j ∈ [1, 2, · · · , Θ(log d)],   j j+1 Pr |xi | ∈ (2 , 2 ] = Θ(1/2j ). We define the indicator random variable zi,j ( 1 if |xi | ∈ (2j , 2j+1 ], zi,j = 0 otherwise. We define zj = Pd i=1 zi,j . It is clear that E[zi,j ] = Θ(1/2j ). We use a Chernoff bound, µ  e−δ , Pr[X < (1 − δ)µ] < (1 − δ)1−δ and set X = zj , δ = 1/2, µ = E[zj ]. Then, this probability is at most 2−Ω(µ) = 2−Ω(E[zj ]) . For any j ∈ [1, log d − Θ(log log(t log d))], we have E[zj ] = d E[zij ] = Ω(d/2j ) = Ω(log(t log d)). Thus, this probability is at most 1/ poly(t log d). Overall, we have   j Pr zj & d/2 ≥ 1 − 1/ poly(t log d). Taking a union bound over Θ(log d) such j, we complete the proof. Claim G.5. Let 1 > c1 > c2 > 1/3 > 0 be three arbitrary constants. We fix the first column of (SI)> ∈ Rd×t . All the rows are grouped together according to the value in the first column. Let Rj be the set of rows for which the entry in the first column is ∈ (2j , 2j+1 ]. With probability at least 1 − O(1/ poly(t log(d))), for any j ∈ [c2 log d, c1 log d], the following event holds. There exist Ω(d/2j ) rows such that the first coordinate ∈ (2j , 2j+1 ] and all the other coordinates are at most O(d1/3 ). Proof. Let Rj be a subset of rows of S > , such that for any row in Rj , the first coordinate is ∈ (2j , 2j+1 ]. By Claim G.4, we have that with probability 1 − 1/ poly(t log d), for any j ∈ [c2 log d, c1 log d], |Rj | ≥ Ω(d/2j ). We want to show that for any j ∈ [c2 log d, c1 log d], there exists a constant fraction of rows in Rj such that, the remaining coordinates are at most O(d1/3 ). For a fixed row in Rj and a fixed coordinate in that row, the probability that the absolute value of this entry is at least Ω(d1/3 ) is at most O(1/d1/3 ). By taking a union bound, with probability at least 1 − O(t/d1/3 ), the row has every coordinate of absolute value at most O(d1/3 ). By applying a Chernoff bound, for a fixed subset Rj of rows, the probability that there is a constant fraction of these rows for which every coordinate except the first one in absolute value is 1−c at most O(d1/3 ), is at least 1 − 2−Θ(|Rj |) ≥ 1 − 2−Θ(d 1 ) ≥ 1 − O(1/ poly(t log(d))). After taking a union over all the j, we complete the proof. Claim G.6. With probability at least 1 − O(1/t), the absolute value of any coordinate in column vector (SB)1 ∈ Rt×1 is at most O(t2 log d). 71 Proof. Because each entry is sampled from a Cauchy distribution C(0, 1) scaled by O(log d), then with probability at most O(1/t2 ), the absolute value of one coordinate is at least Ω(t2 log d). Taking a union over all the coordinates, we complete the proof. Because kxk1 ≤ O(log d), kxk2 ≥ Ω(1/t log t), there exists one coordinate i such that the absolute value of it is at least Ω(1/t log t) and all the other coordinates are most O(log d). We can assume that i = 1 for now. (To remove this assumption, we can take a union bound over all the possibilities bj denote a subset of Rj , which is a “good” for i ∈ [t].) According to Claim G.5 and G.6, let R bj ⊂ Rj ⊂ [d], we have constant fraction of Rj . Considering the `1 -norm of all coordinates l ∈ R X |((SA)> x)l − O(log d)| bj l∈R ≥ X |h(SA)l , xi − O(log d)| bj l∈R  ≥ X |(SI)1,l · x1 | − t X  |(SI)j,l · xj | − |h(SB)l , xi| − O(log d) j=2 bj l∈R  X 2j 1/3 ≥ Ω( ) − O(td log d) − |h(SB)1 , xi| − O(log d) t log t bj l∈R  X 2j 1/3 ) − O(td log d) − k(SB)1 k1 kxk1 − O(log d) ≥ Ω( t log t bj l∈R  X 2j 1/3 2 ≥ Ω( ) − O(td log d) − O(t log t log d) − O(log d) t log t bj l∈R & X 2j /(t log t) bj l∈R &d/2j · 2j /(t log t) &d/(t log t). The second inequality follows by the triangle inequality. The third inequality follows by (SB)1 = (SB)l , |x1 | = Ω(1/t log t), (SI)1,l ∈ [2j , 2j+1 ), and ∀j 6= 1, |xj | < O(log d), (SI)j,l ≤ O(d1/3 ). The fourth inequality follows by Cauchy-Schwarz and k · k2 ≤ k · k1 . The fifth inequality follows by Equation (26) and Claim G.3. The sixth inequality follows by t = o(log d) where c is a constant bj | ≥ Ω(d/2j ). smaller than 1/3 and 2j ≥ dc2 > poly(t). The seventh inequality follows from |R Since there are c1 − c2 different j, the total cost is Ω(d log d/(t log t)). The gap then is Ω(log d/(t log t)). This completes the proof of Theorem G.2. G.2 Hard instance for row subset selection Theorem G.7. Let  ∈ (0, 1). There exists a value k ≥ 1 and matrix A ∈ R(d−1)×d such that, for any subset R of rows of A, letting B be the `1 -projection of each row of A onto R, we have kA − Bk1 > (2 − ) min rank −k A0 unless |R| & d. 72 kA0 − Ak1 , Proof. We construct the (d − 1) × d matrix A in the following way. The first column is all 1s, and then the remaining (d − 1) × (d − 1) matrix is the identity matrix.  1  1  A=  1 · · · 1 Note that min rank −1 A0 1 0 0 ··· 0 0 1 0 ··· 0 0 0 1 ··· 0 ··· ··· ··· ··· ···  0 0  0 . · · · 1 kA − A0 k1 = OPT ≤ d − 1, since one could choose A0 to have the first column all 1s and remaining entries 0. On the other hand, consider any subset of r rows. We can permute the columns and preserve the entrywise `1 -norm so w.l.o.g., we can take the first r rows for R. Because we are taking the first r rows, we do not pay any cost on the first rows. To minimize the cost on the i-th row, where i ∈ {r + 1, r + 2, . . . , d}, let vi denote the row vector we use for the i-th row. Then vi can be written as a linear combination of the first r rows {A1 , A2 , . . . , Ar }, vi = r X αi,j Aj . j=1 Then the cost of using vi to approximate the i-th row of A is: kvi − Ai k1 = (cost in 1st col) + ( cost in 2nd,3rd, . . . , r + 1th cols) + ( cost in i + 1th col) r r X X = | αi,j − 1| + |αi,j | + 1 ≥ | j=1 r X j=1 r X j=1 j=1 αi,j − 1 − αi,j | + 1 by triangle inequality = 2. Hence, the cost of using vi to approximate the i-th row of A is at least 2. So in total, across these (d − 1 − r) rows, the algorithm pays at least 2(d − 1 − r) cost, which needs to be at most C(d − 1), and therefore r ≥ (d − 1)(1 − C/2) = Ω(d). Choosing C = 2 −  completes the proof. Theorem G.8. There exists a value k ≥ 1 and matrix A ∈ R(d−1)×d such that, there is no algorithm that is able to output a rank −k matrix B in the row span of A satisfying 1 kA − Bk1 < 2(1 − Θ( )) min 0 kA0 − Ak1 . d rank −k A Proof. We use the same matrix A as in the previous theorem.  1 1 0 0 ···  1 0 1 0 ···   0 0 1 ··· A= 1 · · · · · · · · · · · · · · · 1 0 0 0 ··· 73  0 0  0 . · · · 1 P Let vector v be ( d−1 i=1 βi , β1 , . . . , βd−1 ). For the i-th row of A, we use αj · v to cancel the cost of that row, where αj is a scalar. Then for any β1 , . . . , βd−1 , α1 , . . . , αd−1 , we can compute the entire residual cost, f (α, β) = d−1 X j kA − vαj k1 = d−1 X j=1 d−1 X X  |1 − αj ( βi )| + |1 − αj βj | + |αj βi | . j=1 i=1 i6=j In the next few paragraphs, we will show that optimizing f (α, β) over some extra constraints for P β = 1. α, β does not change the optimality. Without loss of generality, we can assume that d−1 i i=1 If not we can just rescale all the αi . Consider a fixed index j. All the terms related to αj and βj are, |1 − αj ( d−1 X βi )| + |1 − αj βj | + i=1 X |αj βi | + |αi βj |. i6=j We first show a simple proof by assuming βj ≥ 0. Later, we will prove the general version which does not have any assumptions. Handling a special case We can optimize f (α, β) in the following sense, min f (α, β) s.t. d−1 X βj = 1 j=1 αj ≥ 0, βj ≥ 0, ∀j ∈ [d − 1]. For each j, we consider three cases. Case I, if αj ≥ |1 − αj | + |1 − αj βj | + X 1 βj , αj βi = αj − 1 + αj βj − 1 + i6=j then X αj βi = 2αj − 2 ≥ 2(1/βj − 1) ≥ 2(1 − βj ), i6=j where the last step follows by βj + 1/βj ≥ 2. Case II, if 1 ≤ αj < 1/βj , then X X |1 − αj | + |1 − αj βj | + αj βi = αj − 1 + 1 − αj βj + αj βi = 2αj (1 − βj ) ≥ 2(1 − βj ). i6=j i6=j Case III, if αj < 1, then |1 − αj | + |1 − αj βj | + X αj βi = 1 − αj + 1 − αj βj + i6=j X αj βi = 2(1 − αj βj ) ≥ 2(1 − βj ). i6=j Putting it all together, we have f (α, β) ≥ d−1 X 2(1 − βj ) = 2(d − 1) − 2 j=1 d−1 X j=1 74 βj = 2(d − 2). To handle the case where βi can be negative Without loss of generality, we can assume that Pd−1 i=1 βi = 1. Notice that we can also assume βi 6= 0, otherwise it means we do not choose that row. We split all βi into two disjoint sets S and S. For any i ∈ S, βi > 0 and for any P i ∈ S, βi < 0. As a first step, we discuss the case when all the j are in set S. Case I, if 1 − αj d−1 i=1 βi < 0 and 1 1 1 − αj βj < 0, then it means αj ≥ max( Pd−1 , β ). The cost of that row is, i=1 = αj d−1 X βi j βi − 1 + αj βj − 1 + i=1 X |αj βi | i6=j = 2αj βj + 2αj X βi − 2. i∈S\j P If βj ≥ 1, then αj ≥ 1. The cost is at least 2 i∈S\j βi . If βj < 1, then αj ≥ 1/βj , and the cost is P at least 2 β1j i∈S\j βi . If there are C such j in Case I, then the total cost of Case I is at least 0 if C = 1, and 2(C − 1) P if C ≥ 2. Case II, if 1 − αj d−1 i=1 βi < 0 and 1 − αj βj > 0, then it means 1 < αj < 1/βj . The cost of that row is, = αj d−1 X βi − 1 + 1 − αj βj + |αj | i=1 = 2αj X |βj | i6=j X βi i∈S\j ≥2 X βi . i∈S\j Similarly to before, if there are C such j in Case II, then the total cost of Case II is at least 0 if C = 1, and 2(C − 1) ifPC ≥ 2. 1 Case III, if 1 − αj d−1 i=1 βi > 0 and 1 − αj βj < 0, then it means 1/βj < αj < Pd−1 . The cost i=1 of the row is, = 1 − αj d−1 X βi + αj βj − 1 + |αj | i=1 = 2|αj | X X βi |βj | i6=j |βi | i∈S X = 2|αj |( |βi | − 1) i∈S 1 X ≥2 βi . βj i∈S\j If there are C such j in Case III, then the total cost of Case III is at least 0 if C = 1, and 2(C ·(C −1)) if C ≥ 2. P 1 Case IV, if 1 − αj d−1 i=1 βi > 0 and 1 − αj βj > 0, then it means αj ≤ min(1/βj , Pd−1 ). The i=1 βi cost for the case αj < 0 is larger than the cost for case α > 0. Thus we can ignore the case αj < 0. 75 The cost of the row is, = 1 − αj d−1 X βi + 1 − αj βj + |αj | i=1 X |βj | i6=j X = 2 − 2αj βj + 2αj |βi |. i∈S P If βj < i∈S |βi |, wePknow that the cost is at least 2. Otherwise, using αP j ≤ 1, we have the cost is at least 2 − 2βj + i∈S |βi |. Let T denote the set of those j with βj ≥ i∈S |βi |. If |T | = 1, we know that cost is at least 0. If |T | ≥ 2, then the cost is at least X X = (2 − 2βj + 2 |βi |) j∈T i∈S ≥ 2|T | − 2 X βj + 2|T | j∈S ≥ 2|T | − 2 + 2(|T | − 1) X |βi | i∈S X |βi | i∈S ≥ 2(C − 1). Now we discuss the case where j ∈ S, which means βj < 0. P P Case V if 1 − αj d−1 0, then it means αj > 1/ d−1 i=1 βi and αj < 1/βj . i=1 βi < 0 and 1 − αj βj < P d−1 Notice that this case will never happen, because i=1 βi = 1 and αj < 0. Pd−1 P Case VI if 1 − αj d−1 i=1 βi , 1/βj ). i=1 βi < 0 and 1 − αj βj < 0, then it means αj ≥ max(1/ Because of βj < 0, then αj ≥ 1. The cost of that is, = αj d−1 X βi − 1 + 1 − αj βj + |αj | i=1 = 2αj X X |βi | i6=j |βi | i∈S ≥ 2. by αj ≥ 1 and X |βi | ≥ 1. i∈S P Pd−1 Case VII if 1 − αj d−1 βi > 0 and 1 − αj βj < 0, then it means αj < min(1/βj , 1/ i=1 βi ). i=1 Pd−1 Because βj < 0 and i=1 βi = 1, thus αj < 1/βj . The cost of that row is, = 1 − αj d−1 X βi + αj βj − 1 + |αj | i=1 = 2|αj | X X |βi | i6=j |βi | i∈S\j ≥2 1 X |βi |. |βj | i∈S\j If there are C such j in Case VII, then the total cost of Case VII is at least 0 if C = 1, and 2(C · (C − 1)) if C ≥ 2. 76 Case VIII if 1 − αj cost of that row, Pd−1 i=1 βi > 0 and 1 − αj βj > 0, then it means 1/βj < αj < 1/ = 1 − αj d−1 X βi + 1 − αj βj + |αj | i=1 X Pd−1 i=1 βi . The |βi | i6=j = 2 − 2αj βj + 2|αj | X |βi |. i∈S\j If αj > 0, then the cost is always at least 2. If αj < 0, the cost is at least, X 2 − 2|αj βj | + 2|αj | |βi |. i∈S\j If P i∈S\j |βi | > |βj |, we also have cost at least 2. Otherwise, we have 2 − 2|αj |(|βj | − X i∈S\j ( P 2 − 2|βj | + 2 i∈S\j |βi | |βi |) = P 2 |β1j | i∈S\j |βi | if 1/|βj | ≤ 1, if 1/|βj | > 1. Let C denote the number of such j with 1/|βj | ≤ 1. If C = 1, the cost is at least 0. If C ≥ 2, the cost is at least 2C. Let C 0 denote the number of such j with 1/|βj | > 1. If C 0 = 1, the cost is at least 0, if C 0 ≥ 2, the cost is at least 2(C 0 (C 0 − 1)). Overall, putting all the eight cases together, we complete the proof. G.3 Hard instance for oblivious subspace embedding and more row subset selection The goal in this section is to prove Theorem G.31. By applying Yao’s minmax principle, it suffices to prove Theorem G.27. G.3.1 Definitions We first give the definition of total variation distance and Kullback-Leibler divergence. Definition G.9. [LPW09, Ver14] The total variation distance between two probability measures P and Q on the measurable space (X , F) is defined as, DTV (P, Q) = sup |P (A) − Q(A)|. A∈F The Kullback-Leibler( KL) divergence of P and Q is defined as,  Z    dP dP DKL (P ||Q) = E log = log dP. P dQ dQ X Lemma G.10. [Pin60, Tsy09, CK11] Pinsker’s inequality states that, if P and Q are two probability distributions on a measurable (X , F), then r 1 DTV (P, Q) ≤ DKL (P ||Q). 2 77 Lemma G.11. For any Gaussian random variable x ∼ N (0, σ 2 ), we have, for any a > 0 Pr[|x| < a] . a . σ Proof. a Pr[|x| < a] = erf( √ ) σ 2 −4a2 1 ≤ (1 − e− 2σ2 π ) 2 by 1 − exp(−4x2 /π) ≥ erf(x)2 4a2 1 ≤ ( 2 )2 2σ π a . . σ by 1 − e−x ≤ x Lemma G.12. Let V ∈ Rn×m be a matrix with orthonormal columns. Let H0 be a distribution over V > A, where A ∈ Rn×k is a random matrix with each entry i.i.d. Gaussian N (0, 1). Denote H as a distribution over H ∈ Rm×k , where each entry of H is drawn from i.i.d. Gaussian N (0, 1). Then, H and H0 are the same distribution. Proof. It is clear that each entry of V > A is a random Gaussian variable from N (0, 1), so our goal is to prove the entries of V > A are fully independent. Since the the j th column of V > A only depends on Aj , the variables from different columns are fully independent. Now, we look at one column of x = V > Aj . The density function is     1 1 > > 1 1 > p p f (x) = exp − x V V x = exp − x x , 2 2 (2π)m (2π)m |V > V | which is exactly the density function of N (0, Im ). Thus x ∈ N (0, Im ). Therefore, all the entries of V > A are fully independent. Lemma G.13 (Matrix Determinant Lemma). Suppose A ∈ Rn×n is an invertible matrix, and u, v ∈ Rn . Then, |A + uv > | = (1 + v > A−1 u)|A|. Lemma G.14 (KL divergence between two multivariate Gaussians [PP+ 08]2 ). Given two d-dimensional multivariate Gaussian distribution N (µ1 , Σ1 ) and N (µ2 , Σ2 ), then   1 |Σ2 | −1 > −1 DKL (N (µ1 ||Σ1 ), N (µ2 , Σ2 )) = log − d + tr(Σ2 Σ1 ) + (µ2 − µ1 ) Σ2 (µ2 − µ1 ) . 2 |Σ1 | Lemma G.15 (Sherman-Morrison formula). Suppose A ∈ Rn×n is an invertible matrix and u, v ∈ Rn . Suppose furthermore that 1 + v > A−1 u 6= 0. Then the Sherman-Morrison formula states that (A + uv > )−1 = A−1 − 2 A−1 uv > A−1 . 1 + v > A−1 u (27) http://stats.stackexchange.com/questions/60680/kl-divergence-between-two-multivariate-gaussians 78 G.3.2 Main results Lemma G.16. Let V ∈ Rn×m be a matrix with orthonormal columns, and let A ∈ Rn×k be a random matrix with each entry drawn from i.i.d. Gaussian N (0, 1). We denote the distribution Di over Di ∈ R(m+1)×k where  >  V A Di = . Ai If k(V > )i k22 < 12 , then DTV (Di , G) ≤ O(kkV i k2 ) + 2−Θ(k) , where G is a distribution over G ∈ R(m+1)×k , where each entry of G is drawn from the i.i.d. Gaussian N (0, 1). Proof. Let H be a distribution over H ∈ Rm×k , where each entry of H is an i.i.d. Gaussian N (0, 1). Let H0 be a distribution over V > A. According to Lemma G.12, H and H0 are the same distribution. We define matrix V ¬i ∈ Rn×m as  > V ¬i = (V 1 )> (V 2 )> · · · (V i−1 )> 0 (V i+1 )> · · · (V n )> , where V i denotes the ith row of V ∈ Rn×m , ∀i ∈ [n]. Let G be a distribution over G ∈ R(m+1)×k , where each entry of G is an i.i.d. Gaussian N (0, 1). Let Pi be a distribution over Pi ∈ R(m+1)×k , where  ¬i >  (V ) A Pi = . Ai bi be a distribution over Pbi ∈ Rm×k , where Pbi = (V ¬i )> A. Then we have: Let P bi , H0 ) = DTV (P bi , H). DTV (Pi , G) = DTV (P (28) The first equality is because (V ¬i )> A is independent from Ai . The second equality follows the Lemma G.12. Claim G.17. If kV i k22 ≤ 21 ,  bi ||H) = − k log(1 − kV i k2 ) + kV i k2 ≤ kkV i k2 . DKL (P 2 2 2 2 bi , H ∼ H. Notice that different columns of Pbi are i.i.d, and all entries of H are Proof. Let Pbi ∼ P fully independent. We can look at one column of Pbi and H. Since Pbi = (V ¬i )> A, it is easy to see that its column is drawn from N (0, Σ1 ) where Σ1 = Im − (V i )> V i . Since H is fully independent, each column of H is drawn from N (0, Σ2 ) where Σ2 = Im . Let p(x) be the pdf of the column of Pbi , 79 and let q(x) be the pdf of the column of H. We have the following calculation [PP+ 08]3 ,   k |Σ2 | −1 b DKL (Pi ||H) = log − m + tr(Σ2 Σ1 ) 2 |Σ1 |   |Im | k i > i log − m + tr(I − (V ) V ) = m 2 |Im − (V i )> V i |  k − log |Im − (V i )> V i | − m + m − kV i k22 = 2  k = − log(1 − kV i k22 ) − m + m − kV i k22 2  k = − log(1 − kV i k22 ) + kV i k22 2 k ≤ − · 2kV i k22 2 = kkV i k22 . The first equality is due to Lemma G.14. The sixth equality follows by Σ2 = Im and Σ1 = Im − (V i )> V i . The eighth equality follows by Lemma G.13. The first inequality follows by log(1−x)+x ≥ −2x, when 0 < x < 1/2. According to Lemma G.10, we have r bi , H) ≤ DTV (P √ 1 bi ||H) ≤ kkV i k2 . DKL (P 2 (29) Now, we want to argue that DTV (Di , Pi ) is small, where Di is a distribution over Di ∈ R(m+1)×k that  >  V A Di = . Ai bi (x) be a distribution over D b i (x) ∈ Rm×k , where D b i (x) = (V ¬i )> A+(V i )> x. For a fixed x ∈ Rk , let D Let p(x) be the pdf of (Ai )> , then Z   bi (x), P bi p(x)dx. DTV (Di , Pi ) = DTV D (30) b i (x) and the j th column of Pbi . The distribution of the Now we look at the j th column of D i > previous one is over N ((V ) xj , Σ2 ), and the latter distribution as we said before is N (0, Σ2 ), 3 http://stats.stackexchange.com/questions/60680/kl-divergence-between-two-multivariate-gaussians 80 where Σ2 = Im − (V i )> V i . Now we can argue that the KL divergence between them is bounded: DKL (N ((V i )> xj , Σ2 )||N (0, Σ2 ))   |Σ2 | 1 −1 2 i −1 i > log = − m + tr(Σ2 Σ2 ) + xj V Σ2 (V ) 2 |Σ2 |  1 i > = −m + tr(Im ) + x2j V i Σ−1 (V ) 2 2 1 i > = x2j V i Σ−1 2 (V ) 2 1 = x2j V i (Im − (V i )> V i )−1 (V i )> 2   1 2 i (V i )> V i = xj V Im + (V i )> 2 1 − V i (V i )>   1 2 kV i k22 i 2 = xj kV k2 + 2 1 − kV i k22 1 kV i k22 = x2j . 2 1 − kV i k22 The first equality is due to Lemma G.14. The fourth equality follows by Σ2 = Im − (V i )> V i . The fifth equality follows by Lemma G.15. By summing the KL divergence on all the columns up, i 2 bi (x)||P bi ) = 1 kxk2 kV k2 . DKL (D 2 2 1 − kV i k22 Applying Lemma G.10 again, we get r kxk2 kV i k2 bi (x)||P bi ) = p bi (x), P bi ) ≤ 1 DKL (D DTV (D . 2 2 1 − kV i k22 Plugging it into Equation (30), we get Z   bi (x), P bi p(x)dx DTV (Di , Pi ) = DTV D Z Z     b b bi (x), P bi p(x)dx = DTV Di (x), Pi p(x)dx + DTV D kxk ≤10k kxk >10k Z 2 Z 2   bi (x), P bi p(x)dx + ≤ DTV D p(x)dx kxk2 ≤10k kxk2 >10k ik kxk kV 2 p 2 p(x)dx + 2 kxk2 ≤10k 2 1 − kV i k2 Z 10kkV i k2 ≤ p + p(x)dx 2 1 − kV i k22 kxk2 >10k Z ≤ Z p(x)dx kxk2 >10k 10kkV i k2 ≤ p + 2−Θ(k) . 2 1 − kV i k22 The first inequality just follows from the fact that total variation distance is smaller than 1. The second inequality is what we plugged in. The last inequality follows from the fact that x ∼ N (0, Ik ) and from the tail bounds of a Gaussian. 81 Together with Equation (28) and Equation (29), we can get DTV (Di , G) ≤ DTV (Di , Pi ) + DTV (G, Pi ) bi , H) = DTV (Di , Pi ) + DTV (P √ 10kkV i k2 −Θ(k) kkV i k2 + 2 + ≤ p 2 1 − kV i k22 √ ≤ 10kkV i k2 + 2−Θ(k) + kkV i k2 . The last inequality follows by kV i k22 ≤ 21 . Then, we have completed the proof. Lemma G.18. A ∈ Rr×k (r ≥ k) is a random matrix for which each entry is i.i.d. N (0, 1). With √ probability at least 1 − e−Θ(r) , the maximum singular value kAk2 is at most O( r). Proof. Since A ∈ Rk×r is a random matrix with each entry i.i.d. N (0, 1), this follows by standard arguments (Proposition 2.4 in [RV10]). Since r ≥ k, with probability at least 1 − e−Θ(r) , kAk2 is at √ most O( r). Definition G.19. Let V ∈ Rn×r be a matrix with orthonormal columns, and let each entry of b A ∈ Rk×r be a random variable drawn from an i.i.d. Gaussian N (0, 1). Define event E(A, V, β, γ) to n γ β be: ∀y ∈ R , kyk1 ≤ O(k ) and each coordinate of y has absolute value at most 1/k , and also AV > y √ has at most O(k/ log k) coordinates with absolute value at least Ω(1/ log k), and kAk2 ≤ O( r). Lemma G.20. For any k ≥ 1, and any constants c2 ≥ c1 ≥ 1, let k ≤ r = O(k c1 ), r ≤ n = O(k c2 ), let V ∈ Rn×r be a matrix with orthonormal columns, and let each entry of A ∈ Rk×r be a random variable drawn from i.i.d. Gaussian N (0, 1). Furthermore, if β and γ are two constants which satisfy β > γ > 0 and β + γ < 1,   b Pr E(A, V, β, γ) ≥ 1 − 2−Θ(k) . √ Proof. Due to Lemma G.18, with probability at least 1 − 2−Θ(r) , kAk2 ≤ O( r), so we can restrict √ attention to kAk2 ≤ O( r) in the following proof. Take any y P ∈ Rn which has each non-zero coordinate with absolute value at most 1/k β , and j j −j−1 , 2−j ), write it as y = +∞ j=j0 y , where the coordinates in y have absolute value in the range [2 and the supports of different y j are disjoint. Since each coordinate of y is at most 1/k β , 2−j0 = 1/k β . Since kyk1 ≤ O(k γ ), the support size of y j ∈ Rn is at most sj ≤ O(2j+1 k γ ), so it follows that q √ j ky k2 ≤ sj · 2−2j ≤ 2−j+1 k γ . p √ We also know ky j k2 ≥ sj · 2−2j−2 . Then we can conclude that y j has 2-norm Θ(2−j sj ). Now we state an ε-net for all the possible y j : let ε = O(1/(nrk 3 )) = O(1/(k c1 +c2 +3 )). Let Nj ⊂ Rn be the following:  Nj = p ∈ Rn | ∃q ∈ Zn , s.t. p = εq, kpk1 ≤ O(k γ ), ∀i ∈ [n], either |pi | ∈ [2−j−1 , 2−j ) or pi = 0 . Obviously, for any y j , there exists p ∈ Nj such that ky j − pk∞ ≤ ε = O(1/(k c1 +c2 +3 )), since n ≤ O(k c2 ), ky j − pk2 ≤ ky j − pk1 ≤ nky j − pk∞ ≤ O(1/k c1 +3 ). Now let us consider the size of Nj . If p ∈ Nj , the choice of one coordinate of p is at most 2/ε + 1. And since kpk1 ≤ O(k γ ) and each 82 coordinate of p has absolute value at least 2−j−1 , the number of supports of p is at most O(2j+1 k γ ). Therefore, j+1 k γ ) |Nj | ≤ (n + 1)O(2 · (2/ε + 1)O(2 j+1 k γ ) j+1 k γ (log n+log(2/ε+1)) ≤ 2O(2 j+1 k γ ≤ 2O(2 log k) . The last inequality follows from n ≤ O(k c2 ), r ≤ O(k c1 ), ε = O(1/(rnk 3 )). We define an event E(y j ) to be: AV > y j has k/ log2 k coordinates which are each at least 2/ log2 k in absolute value. Now, we want to show, Claim G.21. For any j ≥ j0 , for a fixed y j ∈ Rn ,   6 6 j−1 1−γ j 2 j Pr E(y ) happens ≤ 2k e−Θ(k/(ky k2 log k)) ≤ e−Θ(2 k / log k) . Proof. We let p be the probability that the absolute value of a single coordinate of AV > y j is at least 1/ log2 k. Notice that each coordinate of AV > y j is i.i.d. Gaussian N (0, kV > y j k22 ) and because for any Gaussian random variable g, Pr[|g| ≥ t] ≤ exp(−Θ(t2 /σ 2 )), then p ≤ exp(−1/(kV > y j k22 log4 k)), by plugging σ 2 = kV > y j k22 and t = 1/ log2 k. So the probability AV > y j has k/ log2 k coordinates which are each at least 1/ log2 k in absolute value is, k X i k−i p (1 − p) i=k/ log2 k   k ≤ i k X i  k k/2 p i=k/ log2 k 2 /(σ 2 ≤ e−Θ(kt ≤ e−Θ(k/(kV ≤ e 2 ≤ 2pk/ log k 2k log2 k)) k by p ≤ exp(−Θ(t2 /σ 2 )) 2 > y j k2 2 −Θ(k/(ky j k22 −2j s ≤ e−Θ(k/(2  log6 k)) k 2 6 by kV > y j k22 ≤ kV k22 ky j k22 ≤ ky j k22 log k)) k j 2 log6 k)) k −j+1 k γ log6 k)) k −j+1 k γ log6 k)) ≤ e−Θ(k/(2 = e−Θ(k/(2 by sj ≤ O(2j+1 k γ ) 2 j−1 k 1−γ / log6 ≤ e−Θ(2 by ky j k22 ≤ 2−2j sj 2 k) . The first equality follows from 2−j+1 k γ log6 k ≤ 2−j0 +1 k γ log6 k ≤ 2k γ−β log6 k = o(1). P j For j1 = d100(c1 + c2 + 1) log ke = Θ(log k), consider j ∈ [j1 , ∞). We have k ∞ j=j1 y k2 is at √ most Θ(2−j1 n) ≤ 1/k 100(1+c1 ) , and so kAV > ∞ X j=j1 j y k1 ≤ √ kkAV > ∞ X j y k2 ≤ √ kkAk2 kV k2 k j=j1 ∞ X y j k2 ≤ √ k· √ r · 1/k 100(1+c1 ) ≤ 1/k 50 . j=j1 The last inequality follows from r = O(k c1 ). So the contribution of y j to kAV > y j k1 for all j ≥ j1 is at most 1/k 50 . Thus, if we only consider those j which contribute, i.e., j0 ≤ j ≤ j1 , we have 83 O(log k) values of j. Then we can only construct O(log k) nets Nj0 , Nj0 +1 , · · · , Nj1 . Since the size j+1 γ of net Nj is 2Θ(2 k log k) , by combining Claim G.21 and taking a union bound, we have   j1 j1 [ X 6 j+1 γ j−1 1−γ Pr ∃y j ∈ Nj , E(y j ) happens  ≤ 2Θ(2 k log k) · e−Θ(2 k / log k) j=j0 j=j0 j0 −1 k 1−γ / log6 ≤ e−Θ(2 ≤ e−Θ(k 1+β−γ / log6 k) k) ≤ 2−Θ(k) . The second inequality follows since k γ = o(k 1−γ ). The third inequality follows since 2j0 ≥ k β . The fourth inequality follows since 1 + β − γ > 1. Then, ∀j0 ≤ j ≤ j1 , ∀e y j 6∈ Nj , there exists a vector ybj in Nj , such that kb y j − yej k2 ≤ 1/k 3+c1 . We can upper bound the `∞ norm of AV > ybj − AV > yej in the following sense, kAV > ybj − AV > yej k∞ ≤ kAV > ybj − AV > yej k2 j by k · k∞ ≤ k · k2 j ≤ kAk2 · kb y − ye k2 √ ≤ r/k 3+c1 by Claim G.18 and kb y j − yej k2 ≤ 1/k 3+c1 = 1/k 2 by r ≤ O(k c1 ). We let Y = {y ∈ Rn | kyk1 ≤ O(k γ ) and each coordinate of y ≤ 1/k β }. Since 1/k 2 < 1/ log2 k we can conclude that,   j Pr ∃y ∈ Y, j ≥ j0 , E(y ) happens ≤ 2−Θ(k) . (31) P Recalling y = j y j , by Equation (31), for any y, with probability at most 2−Θ(k) , there are P1 at most O(log k) · k/ log2 k ≤ O(k/ log k) coordinates for which AV > jj=j y j (the same statement 0 P j > also holds for AV > ∞ j=j0 y = AV y since we argued that there is negligible “contribution” for those j > j1 ) is at least O(log k)/ log2 k = O(1/ log k) on that coordinate. Summarizing,   b Pr E(A, V, β, γ) ≥ 1 − 2−Θ(k) . Lemma G.22. For any t, k ≥ 1, and any constants c2 ≥ c1 ≥ 1, let k ≤ r = O(k c1 ), r ≤ n = O(k c2 ), let V ∈ Rn×r be a matrix with orthonormal columns, and let each entry of A ∈ Rk×r , v1 , v2 , · · · , vt ∈ Rk be an i.i.d. Gaussian N (0, 1) random variable. For a constant α ∈ (0, 0.5) which can be b arbitrarily small, if E(A, V, 0.5+α/2, 0.5−α) happens, then with probability at least 1−2−Θ(tk) , there are at least dt/10e such j ∈ [t] that ∀x ∈ Rr either kAx − vj k1 ≥ Ω(k 0.5−α ) or kV xk1 ≥ Ω(k 0.5−α ) holds. Proof. For convenience, we define γ = 0.5 − α which can be an arbitrary constant in (0, 0.5). We let constant β = 0.5 + α/2. Then we have β + γ < 1 and β > γ. Let v ∈ Rk be a random vector b with each entry drawn from i.i.d. Gaussian N (0, 1). Suppose E(A, V, β, γ) happens. 84 For any x ∈ Rr , we can find a y ∈ Rn such that y = V x. Since V ∈ Rn×r has orthonormal columns, x = V > V x = V > y. Then our goal is to argue that with high probability if kAV > y −vk1 ≤ O(k γ ), then kyk1 > Ω(k γ ). Take any y ∈ Rn which can be expressed as V x, and decompose it as y = y0 +y1 , where y0 ∈ Rn and y1 ∈ Rn have disjoint supports, y0 has each coordinate with absolute value greater than 1/k β , and y1 has each coordinate with absolute value at most 1/k β . Now we create an ε-net for y0 : let ε = O(1/(rnk 3 )) = O(1/k c1 +c2 +3 ), we denote N ⊂ Rn as follows: n o N = p ∈ Rn | ∃q ∈ Zn , s.t. p = εq, kpk1 ≤ O(k γ ), ∀i ∈ [n], either |pi | > 1/k β or pi = 0 . Obviously, for any y0 , there exists p ∈ N such that ky0 − pk∞ ≤ ε = O(1/(k c1 +c2 +3 )), since n ≤ O(k c2 ), ky0 − pk2 ≤ ky0 − pk1 ≤ nky0 − pk∞ ≤ O(1/k c1 +3 ). Now let us consider the size of N . If p ∈ N , the number of choices of one coordinate of p is at most O(k γ /ε). And since kpk1 ≤ O(k γ ) and each coordinate of p has absolute value at least 1/k β , the number of supports of p is at most O(k γ+β ). Therefore, |N | ≤ (n + 1)O(k ≤ 2O(k γ+β γ+β ) log k) · O(k γ /ε)O(k γ+β ) . The last inequality follows from n ≤ O(k c2 ), r ≤ O(k c1 ), ε = O(1/(rnk 3 )). For y0 ∈ Rn , we define event E1 (y0 ) as: ∃ valid y1 ∈ Rn , kAV > y−vk1 ≤ O(k γ ), where y = y0 +y1 is the decomposition of a possible y ∈ Rn . Here y1 is valid means that there exists y ∈ Rn such that kyk1 ≤ O(k γ ) and the decomposition of y is y = y0 + y1 . We define event E2 (y0 ) as: ∃ valid y1 , the absolute value of AV > y − v is at most O(1/k γ ) for at least k − O(k 2γ ) coordinates i in [k] . We define event E3 (y0 ) as: at least k − O(k 2γ ) − O(k/ log k) coordinates of Ay0 − v have absolute value at most O(1/ log k). Claim G.23. For y0 ∈ Rn , Pr[E3 (y0 ) happens ] ≥ Pr[E2 (y0 ) happens ] ≥ Pr[E1 (y0 ) happens ]. Proof. If E1 (y0 ) happens, then there exists a valid y1 ∈ Rn such that y = y0 +y1 and kAV > y −vk1 ≤ O(k γ ). For this y, there are at least k − O(1/k 2γ ) coordinates of AV > y − v with absolute value at most O(1/k γ ). Otherwise, kAV > y − vk1 > Ω(k γ ). Thus, E1 (y0 ) implies E2 (y0 ). Now we want to show E2 (y0 ) implies E3 (y0 ). We suppose E2 (y0 ) happens. Then there is a valid y1 such that there are at least k − O(1/k 2γ ) coordinates of AV > y − v with absolute value at most b O(1/k γ ), where y = y0 + y1 . Recall that the event E(A, V, β, γ) happens, for any valid y1 there are > at most O(k/ log k) coordinates of AV y1 are at least Ω(1/ log k). Therefore, AV > y0 − v = AV > y − v | {z } ≥k−O(k2γ ) coordinates each ≤O(1/kγ ) − AV > y | {z }1 . ≤O(k/ log k) coordinates each≥Ω(1/ log k) Therefore, at least k − O(k 2γ ) − O(k/ log k) coordinates of Ay0 − v in absolute value is at most O(1/ log k) + O(1/k γ ) = O(1/ log k) Claim G.24. Define event F1 to be the situation for which there exists 1/2 of the coordinates of v ∈ Rk that are at least 1/100. The probability this event F1 holds is at least 1 − 2−Θ(k) . 85 Proof. Note that F 1 means there exist k/2 of the coordinates of v ∈ Rk which are at most 1/100. Using Lemma G.11, for each single coordinate the probability it is smaller than 1/100 is 1/200. Then the probability more than half the coordinates are no more than 1/100 is k X i=k/2 pi (1 − p)k−i     k X k k ≤ pi ≤ 2pk/2 2k ≤ (1/200)Θ(k) = 2−Θ(k) . i k/2 i=k/2 Conditioned on F1 happening, if E3 (y0 ) happens, then due to the pigeonhole principle, there are at least k2 − O(k 2γ ) − O(k/ log k) coordinates of AV > y0 − v that are at most O(1/ log k) and the corresponding coordinate of v is larger than 1/100. Now, let us look at the probability on a single coordinate of AV > y0 − v. Claim G.25. If the ith coordinate of v ∈ Rk is at least 1/100. Then Pr[|(AV > y0 )i − (v)i | ≤ O(1/ log k)] ≤ O(1/ log k). Proof. Since |(v)i | > 1/100 and v is independent from A ∈ Rk×r , for 0 < η < 1/100, Pr[|(AV > y0 )i − (v)i | ≤ η] is always upper bounded by Pr[(Ax0 )i ∈ [1/100 − η, 1/100 + η]. Thus, it suffices to prove an upper bound for Pr[(AV > x0 )i ∈ [1/100 − η, 1/100 + η]. Let f (x) be the pdf of N (0, σ 2 ), where σ 2 = kV > y0 k22 , V ∈ Rn×r , y0 ∈ Rn . Then Pr[(AV > y0 )i ∈ [1/100 − η, 1/100 + η]] Z 1/100+η = f (x)dx 1/100−η Z 1/100+η ≤ f (1/200) dx 1/100−η ≤O(η). where the last step follows since f (1/200) ≤ 200. We set η = O(1/ log k), then we get the statement. Claim G.26. Conditioned on F1 , for a fixed y0 ∈ Rn , with probability at most 2−Θ(k) , there are k at least 10 coordinates of AV > y0 − v ∈ Rk which are at most O(1/ log k) and the corresponding coordinate of v is larger than 1/100. Proof. We look at the coordinate i ∈ [k] which has |(v)i | > 1/100. The probability k(AV > y0 )i − (v)i k ≤ O(1/ log k) is at most O(1/ log k). Due to the independence between different coordinates of v, since there are at least k/2 coordinates of v satisfying that they have absolute value greater than 1/100, with probability at most 2−Θ(k) , there are at least 15 · k2 = k/10 coordinates of AV > y0 − v which are at most O(1/ log k). Because E3 (y0 ) implies the event described in the above claim when conditioning on F1 , for a o(1) fixed y0 , the probability that E3 (y0 ) holds is at most 2−Θ(k) . Since γ + β < 1, the |N | ≤ 2k , we can take a union bound over the N : Pr[∃y0 ∈ N , E1 (y0 ) happens ] ≤ 2−Θ(k) . 86 It means that with probability at least 1 − 2−Θ(k) , for any y = y0 + y1 with y0 ∈ N , kAV > y − vk1 > P j Ω(k γ ). Let P yej = ye0 + ye , where ye0 6∈ N . We can find yb0 ∈ N which is the closest to ye0 . Denote yb = yb + ye . Then, kAV > yb − vk1 ≤ kAV > ye − vk1 + kAV > ye − AV > ybk1 √ ≤ kAV > ye − vk1 + kkAV > ye − AV > ybk2 √ ≤ kAV > ye − vk1 + kkAk2 ke y − ybk2 √ √ ≤ kAV > ye − vk1 + k · r · ke y0 − yb0 k2 √ √ ≤ kAV > ye − vk1 + k · r · ε √ √ = kAV > ye − vk1 + k · r · 1/k c1 +3 by triangle inequality √ by k · k1 ≤ dimk · k2 = kAV > ye − vk1 + 1/k. by kAk2 ≤ √ r by ke y0 − yb0 k2 ≤ ε by ε0 = 1/k c1 +3 by r = O(k c1 ) and so if kAV > ye − vk1 is at most O(k γ ) then kAb y − vk1 is at most O(k γ ). For j ∈ [t], we now use notation E4 (vj ) to denote the event: ∃y0 ∈ Rn with ky0 k1 ≤ O(k γ ) and each non-zero coordinate of y0 is greater than 1/k β , at least k − O(k 2γ ) − O(k/ log k) coordinates of AV > y0 − vj in absolute value are at most O(1/ log k). Based on the previous argument, conditioned b on E(A, V, β, γ), Pr[E4 (vj )] ≤ 2−Θ(k) . b Also notice that, conditioned on E(A, V, β, γ), ∀j ∈ [t], E4 (vj ) are independent. Thus, conditioned b on E(A, V, β, γ), due to the Chernoff bound, the probability that there are dt/10e such j that E4 (vj ) happens is at most 2−Θ(kt) . We define E5 (vj ) to be the event: ∃y ∈ Rn , kAV > y − vj k ≤ O(k γ ) b with kyk1 ≤ O(k γ ). Similar to the proof of Claim G.23, conditioned on E(A, V, β, γ), E5 (vj ) implies b E4 (vj ). Thus, conditioned on E(A, V, β, γ), the probability that there are dt/10e such j that E5 (vj ) happens is at most 2−Θ(tk) . Then, we complete the proof. Theorem G.27. For any k ≥ 1, and any constants c1 , c2 which satisfy c2 − 2 > c1 > 1, let r = Θ(k c1 ), n = Θ(k c2 ), and let A(k, n) denote a distribution over n × (k + n) matrices where each entry of the first n × k matrix is i.i.d. Gaussian N (0, 1) and the next n × n matrix is an identity b ∼ A(k, n), with probability at least matrix. For any fixed r × n matrix S and a random matrix A c −c 1+ 1 2 2 −Θ(k) 1 − O(k )−2 , there is no algorithm that is able to output a matrix B ∈ Rn×r such that b − Ak b 1 ≤ O(k 0.5−ε ) kBS A min rank −k A0 b 1, kA0 − Ak where ε > 0 is a constant which can be arbitrarily small. Proof. For convenience, we let γ = 0.5 − ε be a constant which can be arbitrarily close to 0.5. Since b is an identity matrix, we can fit the first k columns of A, b so we have the last n columns of A min rank −k A0 b 1 ≤ n. kA0 − Ak Now, we want to argue that, for a fixed S, with high probability, for any rank-k n × r matrix B, the cost b − Ak b 1 ≥ Ω(n · k γ ). kBS A 87 Thus, the approximation gap will be at least Ω(k γ ). We denote the SVD of S = US ΣS VS> where US ∈ Rr×r , ΣS ∈ Rr×r , VS ∈ Rn×r . Then, we can rewrite b − Ak b 1 = kBUS ΣS V > A b − Ak b 1 kBS A S n X b −A bl k1 = k(BUS ΣS )l (V > A) S l=1 ≥ X b −A bl k1 . k(BUS ΣS )l (VS> A) (32) l:kVSl k22 ≤2r/n The first equality follows from the SVD of S. The second equality follows from the fact that the `1 -norm of a matrix is the sum of `1 -norms of rows. The third inequality follows since we just look at the cost on a part of the rows. We use βl to denote (BUS ΣS )l . We look at a fixed row l, then the cost on this row is: b −A bl k1 kβl (VS> A) b [1:k] − (A bl )[1:k] k1 + kβl (V > A) b [k+1:k+n] − (A bl )[k+1:n+k] k1 =kβl (V > A) S b [1:k] ≥kβl (VS> A) b [1:k] ≥kβl (VS> A) bl − (A )[1:k] k1 + bl )[1:k] k1 + − (A S b [k+1:k+n] k1 kβl (VS> A) b [k+1:k+n] k1 kβl (VS> A) bl )[k+1:n+k] k1 − k(A −1 b [1:k] − (A bl )[1:k] k1 + kβl V > k1 − 1. ≥kβl (VS> A) S (33) b [1:k] denotes the first k columns of (V > A), b and similarly, (V > A) b [k+1:k+n] denotes the where (VS> A) S S > b The first equality is because we can compute the sum of `1 norms on last n columns of (VS A). the first k coordinates and `1 norm on the last n coordinates. The first inequality follows from the triangle inequality. The second inequality follows since the last n columns of  form an identity, so there is exactly one 1 on the last n columns in each row. The third inequality follows since the last n columns of  form an identity. Let Dl be a distribution over Dl ∈ R(r+1)×k , where # " b [1:k] (VS> A) Dl = bl )[1:k] . (A Let G be a distribution over G ∈ R(r+1)×k where each entry of G is drawn from i.i.d. N (0, 1). According to Lemma G.16, we have DTV (Dl , G) ≤ O(kk(VS )l k2 ) + 2−Θ(k) . (34) b > , VS , 0.75− Let A = G[1:r] , v = Gr+1 . Due to Lemma G.20, with probability at least 1−2−Θ(k) , E(A > b γ/2, γ) happens. Then conditioned on E(A , VS , 0.75−γ/2, γ), due to Lemma G.22, with probability at most 2−Θ(k) , there exists βl such that kβl A − vk1 + kβl VS> k1 = o(k γ ). Combined with Equation (34), we can get that for a fixed l, with probability at most O(kk(VS )l k2 )+ 2−Θ(k) , there exists βl such that b [1:k] − (A bl )[1:k] k1 + kβl VS> k1 = o(k γ ). kβl (VS> A) 88 l 2 c1 −c2 ), this probability is at most Θ(k 1+(c1 −c2 )/2 ) + 2−Θ(k) . Since When Pn k(VSl) k2 2 ≤ 2r/n = Θ(k l 2 l=1 k(VS ) k2 = r, there are at most n/2 such l that k(VS ) k2 > 2r/n which means that there are l 2 at least n/2 such l that k(VS ) k2 ≤ 2r/n. Let s be the number of l such that k(VS )l k22 ≤ 2r/n, then s > n/2. Let t be a random variable which denotes that the number of l which satisfies k(VS )l k22 ≤ 2r/n and achieve b [1:k] − (A bl )[1:k] k1 + kβl VS> k1 = o(k γ ), kβl (VS> A) at the same time. Then, E[t] ≤ (O(kk(VS )l k2 ) + 2−Θ(k) )s = (O(k p 2r/n) + 2−Θ(k) )s. Due to a Markov inequality, Pr[t > s/2 > n/4] ≤ O(k p 2r/n) + 2−Θ(k) = O(k 1+(c1 −c2 )/2 ) + 2−Θ(k) . The equality follows since r = Θ(k c1 ), n = Θ(k c2 ). Plugging it into Equation (32), now we can conclude, with probability at least 1 − O(k 1+(c1 −c2 )/2 ) − 2−Θ(k) , ∀B ∈ Rn×r X b −A bl k1 ≥ n/4 · Ω(k γ ) = Ω(n · k γ ). b − Ak b 1≥ kBS A k(BUS ΣS )l (VS> A) l:kVSl k22 ≤2r/n Theorem G.28 (Hardness for row subset selection). For any k ≥ 1, any constant c ≥ 1, let n = O(k c ), and let A(k, n) denote the same distribution stated in Theorem G.27. For matrix b ∼ A(k, n), with positive probability, there is no algorithm that is able to output B ∈ Rn×(n+k) in A b such that the row span of any r = n/2 rows of A b − Bk1 ≤ O(k 0.5−α ) kA min rank −k A0 b 1, kA0 − Ak where α ∈ (0, 0.5) is a constant which can be arbitrarily small. Proof. For convenience, we define γ = 0.5 − α which can be an arbitrary constant in (0, 0.5). Since b is an identity matrix, we can fit the first k columns of A, b so we have the last n columns of A min rank −k A0 b 1 ≤ n. kA0 − Ak b We want to argue that ∀B ∈ Rn×(k+n) in the row span of any r = n/2 rows of A, b − Bk1 ≥ Ω(n · k γ ). kA b and let S ⊂ [n] be a set of indices of chosen rows of A b Let A> ∈ Rn×k be the first k columns of A, S k×n th S S with k ≤ |S| ≤ r. Let M ∈ R with the i column Mi = Ai if i ∈ S and Mi = 0 otherwise. S k×r S c We use M ∈ R to be M without those columns of zeros, so it is a random matrix with each b entry i.i.d. Gaussian N (0, 1). Then the minimum cost of using a matrix in the span of rows of A b is at least: with index in S to fit A X  minn kM S xl − Al k1 + kxl k1 − 1 . l6∈S xl ∈R b and the part The part of kM S xl − Al k1 is just the cost on the lth row of the first k columns of A, b of kxl k1 − 1 is just the lower bound of the cost on the lth row of the last n columns of A. 89 cS ∈ Rk×n , γ ∈ (0, 0.5), Claim G.29. A, M  bM cS , Ir , 0.75 − γ/2, γ) Pr E(  b E(A, In , 0.75 − γ/2, γ) = 1. b Proof. Suppose E(A, I , 0.75 − γ/2, γ) happens. Since M S has just a subset of columns of A, √ n S kM k2 ≤ kAk2 ≤ n. Notice that ∀x ∈ Rn with kxk1 ≤ O(k γ ) and each non-zero coordinate of x is at most O(1/k 0.75−γ/2 ), M S x ≡ M S xS ≡ AxS , where xS ∈ Rn has xS i = xi if i ∈ S and xS i = 0 otherwise. Because kxS k1 ≤ O(k γ ) and xS has each coordinate in absolute value at most O(1/k 0.75−γ/2 ), AxS has at most O(k/ log k) coordinates in absolute value at least Ω(1/ log k). So, M S x = AxS has at most O(k/ log k) coordinates in absolute value at least Ω(1/ log k).  We denote cost(S, l) = minxl ∈Rn kM S xl − Al k1 + kxl k1 − 1 . Since ∀l 6∈ S, Al are independent, and they are independent from M S , due to Lemma G.22,   X bM cS , Ir , 0.75 − γ/2, γ) ≤ 2−Θ(rk) . Pr  cost(S, l) ≤ O(n · k γ ) E( (35) l6∈S Now we just want to upper bound the following:   X Pr ∃S ⊂ [n], |S| ≤ r, cost(S, l) ≤ O(n · k γ ) l6∈S   ≤ Pr ∃S ⊂ [n], |S| ≤ r, X b cost(S, l) ≤ O(n · k γ ) E(A, In , 0.75 − γ/2, γ) l6∈S h i b + Pr ¬E(A, In , 0.75 − γ/2, γ)   X X b ≤ Pr  cost(S, l) ≤ O(n · k γ ) E(A, In , 0.75 − γ/2, γ) S⊂[n],|S|≤r l6∈S h i b + Pr ¬E(A, In , 0.75 − γ/2, γ)   X X b ≤ Pr  cost(S, l) ≤ O(n · k γ ) E(A, In , 0.75 − γ/2, γ) + 2−Θ(k) S⊂[n],|S|≤r ≤ l6∈S   X bM cS , Ir , 0.75 − γ/2, γ) + 2−Θ(k) Pr  cost(S, l) ≤ O(n · k γ ) E( X S⊂[n],|S|≤r l6∈S r −Θ(rk) ≤ (n + 1) 2 + 2−Θ(k) ≤ 2−Θ(rk) + 2−Θ(k) ≤ 2−Θ(k) . The second inequality follows by a union bound. The third inequality follows by Lemma G.20. The fourth inequality follows by Claim G.29. The fifth inequality is due to Equation (35). The sixth inequality follows by n ≤ O(k c ), r = n/2. Thus, with probability at least 1 − 2−Θ(k) , ∀B ∈ Rn×(n+k) b which is in the span of any r ≤ n/2 rows of A, b 1 ≥ Ω(n · k γ ). kB − Ak 90 Then, we have completed the proof. Definition G.30. Given a matrix A ∈ Rn×d , a matrix S ∈ Rr×n , k ≥ 1 and γ ∈ (0, 21 ), we say that an algorithm M(A, S, k, γ) which outputs a matrix B ∈ Rn×r “succeeds”, if kBSA − Ak1 ≤ k γ · min rank −k A0 kA0 − Ak1 , holds. Theorem G.31 (Hardness for oblivious embedding). Let Π denote a distribution over matrices S ∈ Rr×n . For any k ≥ 1, any constant γ ∈ (0, 12 ), arbitrary constants c1 , c2 > 0 and min(n, d) ≥ Ω(k c2 ), if for all A ∈ Rn×d , it holds that Pr [M(A, S, k, γ) succeeds ] ≥ Ω(1/k c1 ). S∼Π Then r must be at least Ω(k c2 −2c1 −2 ). Proof. We borrow the idea from [NN14, PSW16]. We use Yao’s minimax principle [Yao77] here. Let D be an arbitrary distribution over Rn×d , then Pr A∼D,S∼Π [M(A, S, k, γ)] ≥ 1 − δ. It means that there is a fixed S0 such that Pr [M(A, S0 , k, γ)] ≥ 1 − δ. A∼D Therefore, we want to find a hard distribution Dhard that if Pr A∼Dhard [M(A, S0 , k, γ)] ≥ 1 − δ, S0 must have at least some larger poly(k) rows. Here, we just use the distribution A(k, Ω(k c2 )) described in Theorem G.27 as our hard distribution. We can just fill zeros to expand the size of matrix to n × d. We can complete the proof by using Theorem G.27. Remark G.32. Actually, in Lemma G.20 and Lemma G.22, the reason we need β > γ > 0 is that we want k β−γ = ω(poly(log k)), and the reason we need β +γ < 1√is that we want k β+γ poly(log k) = √ γ k/ log20 k, and replace all the k β o(k). √ Thus we can replace all the k by k/ poly(log √ k), e.g., by k poly(log k) with a smaller poly(log k), e.g., k log10 k. Our proofs still work. Therefore, if the approximation ratio in Theorem G.27, Theorem G.28, and Theorem G.31 to be √ we replace c k/ log k where c is a sufficiently large constant, the statements are still correct. H Hardness This section presents our hardness results. Section H.1 states several useful tools from literature. Section H.2 shows that, it is NP-hard to get some multiplicative error. Assuming ETH is true, we provide a stronger hardness result in Section H.3. Section H.4 extends the result from the rank-1 case to the rank-k case. 91 H.1 Previous results Definition H.1 (kAk∞→1 ,[GV15]). Given matrix A ∈ Rn×d , kAk∞→1 = min x∈{−1,+1}n ,y∈{−1,+1}d x> Ay. The following lemma says that computing kAk∞→1 for matrix A with entries in {−1, +1} is equivalent to computing a best {−1, +1} matrix which is an `1 norm rank-1 approximation to A. Lemma H.2 (Lemma 3 of [GV15]). Given matrix A ∈ {−1, +1}n×d , kAk∞→1 + min x∈{−1,+1}n ,y∈{−1,+1}d kA − xy > k1 = nd. Lemma H.3 (Theorem 2 of [GV15]). Given A ∈ {−1, +1}n×d , we have min x∈{−1,+1}n ,y∈{−1,+1}d kA − xy > k1 = min x∈Rn ,y∈Rd kA − xy > k1 . Combining with Lemma H.2 and Lemma H.3, it implies that computing kAk∞→1 for A ∈ {−1, +1}n×d is equivalent to computing the best `1 norm rank-1 approximation to the matrix A: kAk∞→1 + min x∈Rn ,y∈Rd kA − xy > k1 = nd. Theorem H.4 (NP-hard result, Theorem 1 of [GV15]). Computing kAk∞→1 for matrix A ∈ {−1, +1}n×d is NP-hard. The proof of the above theorem in [GV15] is based on the reduction from MAX-CUT problem. The above theorem implies that computing minx∈Rn ,y∈Rd kA − xy > k1 is also NP-hard. H.2 Extension to multiplicative error `1 -low rank approximation The previous result only shows that solving the exact problem is NP-hard. This section presents a stronger hardness result, which says that, it is still NP-hard even if the goal is to find a solution that is able to achieve some multiplicative error. The proof in this section and the next section are based on the reduction from the MAX-CUT problem. For recent progress on MAX-CUT problem, we refer the readers to [GW95, BGS98, TSSW00, Hås01, KKMO07, FLP15]. Theorem H.5. Given A ∈ {−1, +1}n×d , computing an x b ∈ Rn , yb ∈ Rd s.t. kA − x b> ybk1 ≤ (1 + 1 ) min kA − x> yk1 nd x∈Rn ,y∈Rd is NP-hard. MAX-CUT decision problem: Given a positive integer c∗ and an unweighted graph G = (V, E) where V is the set of vertices of G and E is the set of edges of G, the goal is to determine whether there is a cut of G has at least c∗ edges. Lemma H.6. MAX-CUT decision problem is NP-hard. We give the definition for the Hadamard matrix, 92  Definition H.7. The Hadamard matrix Hp of size p × p is defined recursively :   +1 +1 with H2 = . +1 −1 Hp/2 Hp/2 Hp/2 −Hp/2  For simplicity, we use H to denote Hp in the rest of the proof. Recall the reduction shown in [GV15] which is from MAX-CUT to computing k · k∞→1 for {−1, +1} matrices. We do the same thing: for a given graph G = (V, E), we construct a matrix A ∈ {−1, +1}n×d where n = p|E| and d = p|V |. Notice that p = poly(|E|, |V |) is a parameter which will be determined later, and also p is a power of 2. We divide the matrix A into |E| × |V | blocks, and each block has size p × p. For e ∈ [|E|], if the eth edge has endpoints i ∈ [|V |], j ∈ [|V |] and i < j, let all the p × p elements of (e, i) block of A be 1, all the p × p elements of (e, j) block of A be −1, and all the (e, l) block of A be p × p Hadamard matrix H for l 6= i, j. Claim H.8 (Lower bound of kAk∞→1 , proof of Theorem 1 of [GV15]). If there is a cut of G with cut size at least c, kAk∞→1 ≥ 2p2 c − |E||V |p3/2 . Claim H.9 (Upper bound of kAk∞→1 , proof of Theorem 1 of [GV15]). If the max cut of G has fewer than c edges, kAk∞→1 ≤ 2p2 (c − 1) + |E||V |p3/2 . Remark H.10. In [GV15], they set p as a power of 2 and p > |E|2 |V |2 . This implies ∀c ∈ [|E|], 2p2 (c − 1) + |E||V |p3/2 < 2p2 c − |E||V |p3/2 . Therefore, according to Claim H.8 and Claim H.9, if we can know the precise value of kAk∞→1 , we can decide whether G has a cut with cut size at least c∗ . For convenience, we use T ∗ to denote kAk∞→1 and use L∗ to denote min x∈Rn ,y∈Rd Also, we use L to denote a (1 + 1 nd ) kA − x> yk1 . relative error approximation to L∗ , which means: L∗ ≤ L ≤ (1 + 1 ∗ )L . nd We denote T as nd − L. Proof of Theorem H.5. Because L∗ ≤ L ≤ (1 + 1 ∗ nd )L , we have: nd − L∗ ≥ nd − L ≥ nd − (1 + Due to Lemma H.2 and the definition of T , it has: T∗ ≥ T ≥ T∗ − 93 1 ∗ L . nd 1 ∗ )L . nd Notice that A is a {−1, +1} matrix, we have L∗ ≤ kAk1 ≤ 2nd. Thus, T ∗ ≥ T ≥ T ∗ − 2. It means T + 2 ≥ T ∗ ≥ T. According to Claim H.16, if G has a cut with cut size at least c, we have: T + 2 ≥ T ∗ ≥ 2p2 c − |E||V |p3/2 . That is T ≥ 2p2 c − |E||V |p3/2 − 2. According to Claim H.17, if the max cut of G has fewer than c edges, T ≤ T ∗ ≤ 2p2 (c − 1) + |E||V |p3/2 . Let p be a power of 2 and p > |E|3 |V |3 , we have 2p2 (c − 1) + |E||V |p3/2 < 2p2 c − |E||V |p3/2 − 2. Therefore, we can decide whether G has a cut with size at least c based on the value of T . Thus, if we can compute x b ∈ Rn , yb ∈ Rd s.t. kA − x b> ybk1 ≤ (1 + 1 ) min kA − x> yk1 , nd x∈Rn ,y∈Rd in polynomial time, it means we can compute L and T in polynomial time, and we can solve MAX-CUT decision problem via the value of T , which leads to a contradiction. H.3 Usin the ETH assumption The goal of this section is to prove Theorem H.13. We first introduce the definition of 3-SAT and Exponential Time Hypothesis(ETH). For the details and background of 3-SAT problem, we refer the readers to [AB09]. Definition H.11 (3-SAT problem). Given an r variables and m clauses conjunctive normal form CNF formula with size of each clause at most 3, the goal is to decide whether there exists an assignment for the r boolean variables to make the CNF formula be satisfied. Hypothesis H.12 (Exponential Time Hypothesis (ETH) [IPZ98]). There is a δ > 0 such that 3-SAT problem defined in Definition H.11 cannot be solved in O(2δr ) running time. The main lower bound is stated as follows: 94 Theorem H.13. Unless ETH(see Hypothesis H.12) fails, for arbitrarily small constant γ > 0, given some matrix A ∈ {−1, +1}n×d , there is no algorithm can compute x b ∈ Rn , yb ∈ Rd s.t. kA − x b> ybk1 ≤ (1 + 1 log 1+γ nd ) min x∈Rn ,y∈Rd kA − x> yk1 , in (nd)O(1) running time. Before we prove our lower bound, we introduce the following theorem which is used in our proof. Definition H.14 (MAX-CUT decision problem). Given a positive integer c∗ and an unweighted graph G = (V, E) where V is the set of vertices of G and E is the set of edges of G, the goal is to determine whether there is a cut of G has at least c∗ edges. Theorem H.15 (Theorem 6.1 in [FLP15]). There exist constants a, b ∈ (0, 1) and a > b, such that, for a given MAX-CUT (see Definition H.14) instance graph G = (E, V ) which is an n-vertices 5-regular graph, if there is an algorithm in time 2o(n) which can distinguish the following two cases: 1. At least one cut of the instance has at least a|E| edges, 2. All cuts of the instance have at most b|E| edges, then ETH(see Hypothesis H.12) fails. Proof of Theorem H.13. We prove it by contradiction. We assume, for any given A ∈ {−1, +1}n×d , there is an algorithm can compute x b ∈ Rn , yb ∈ Rd s.t. kA − x b> ybk1 ≤ (1 + 1 ) min kA − x> yk1 , W x∈Rn ,y∈Rd in time poly(nd), where W = log1+γ d for arbitrarily small constant γ > 0. Then, we show the following. There exist constants a, b ∈ [0, 1], a > b, for a given MAX-CUT instance G = (V, E) with |E| = O(|V |), such that we can distinguish whether G has a cut with size at least a|E| or all the cuts of G have size at most b|E| in 2o(|V |) time, which leads to a contradiction to Theorem H.15. Recall the reduction shown in [GV15] which is from MAX-CUT to computing k · k∞→1 for {−1, +1} matrices. We do similar things here: for a given graph G = (V, E) where |E| = O(|V |), we construct a matrix A ∈ {−1, +1}n×d where n = p|E| and d = p|V |. Notice that p is a parameter which will be determined later, and also p is a power of 2. We divide the matrix A into |E| × |V | blocks, and each block has size p × p. For e ∈ [|E|], if the eth edge has endpoints i ∈ [|V |], j ∈ [|V |] and i < j, let all the p × p elements of (e, i) block of A be 1, all the p × p elements of (e, j) block of A be −1, and all the (e, l) block of A be p × p Hadamard matrix H for l 6= i, j. We can construct the matrix in nd time, which is p2 |E||V |. We choose p to be the smallest 2 number of power of 2 which is larger than 2 a−b |V | γ 1− 10 γ for some γ > 0. Thus, the time for construction 1− 2O(|V | 10 ) . of the matrix A is O(nd) = We will show, if we can compute a (1 + 1/W )-approximation to A, we can decide whether G has a cut with size at least a|E| or has no cut with size larger than b|E|. For convenience, we use T ∗ to denote kAk∞→1 and use L∗ to denote min x∈Rn ,y∈Rd kA − x> yk1 . 95 Also, we use L to denote a (1 + 1 W) relative error approximation to L∗ , which means: L∗ ≤ L ≤ (1 + We denote T as nd − L. Because L∗ ≤ L ≤ (1 + 1 ∗ W )L , 1 ∗ )L . W we have: nd − L∗ ≥ nd − L ≥ nd − (1 + 1 ∗ )L . W Due to Lemma H.2 and the definition of T , it has: T∗ ≥ T ≥ T∗ − 1 ∗ L . W Notice that A is a {−1, +1} matrix, we have L∗ ≤ kAk1 ≤ 2nd. Thus, T ∗ ≥ T ≥ T ∗ − 2nd/W. It means T + 2nd/W ≥ T ∗ ≥ T. Claim H.16 (Lower bound of kAk∞→1 , proof of Theorem 1 of [GV15]). If there is a cut of G with cut size at least c, kAk∞→1 ≥ 2p2 c − |E||V |p3/2 . Claim H.17 (Upper bound of kAk∞→1 , proof of Theorem 1 of [GV15]). If the max cut of G has fewer than c edges, kAk∞→1 ≤ 2p2 (c − 1) + |E||V |p3/2 . According to Claim H.16, if G has a cut with cut size at least a|E|, we have: T + 2nd/W ≥ T ∗ ≥ 2p2 a|E| − |E||V |p3/2 . That is T ≥ 2p2 a|E| − |E||V |p3/2 − 2nd/W. (36) According to Claim H.17, if the max cut of G has fewer than b|E| edges, T ≤ T ∗ ≤ 2p2 b|E| + |E||V |p3/2 . 2 Using these conditions p ≥ 2 a−b |V | up to some constant, γ 1− 10 (37) , d = p|V |, W ≥ log1+γ d, we can lower bound |W | by |V | W ≥ log1+γ d by W ≥ log1+γ d = log1+γ (p|V |) by d = p|V | 1+γ = (log |V | + log p) γ 2 |V |1− 10 )1+γ ≥ (log |V | + a−b 2 ≥ |V |. a−b 2 by p ≥ 2 a−b |V | γ 1− 10 by (1 − γ/10)(1 + γ) > 1 for γ small enough 96 (38) Thus, we can upper bound 1/W in the following sense, 1 1 a−b a−b ≤ ≤ − p− 2 , W 2|V | |V | (39) where the first inequality follows by Equation (38) and the second inequality follows by p ≥ 2 γ 1− 10 2 a−b |V | , γ is sufficient small, and |V | is large enough. Now, we can conclude, 1 1 a−b ≤ − p− 2 W |V | 3 ⇐⇒ p2 |E||V |/W ≤ (a − b)p2 |E| − |E||V |p 2 by multiplying p2 |E||V | on both sides 3 ⇐⇒ 2nd/W ≤ 2(a − b)p2 |E| − 2|E||V |p 2 by multiplying 2 on both sides and p2 |E||V | = nd ⇐⇒ 2p2 b|E| + |E||V |p3/2 < 2p2 a|E| − |E||V |p3/2 − 2nd/W, (40) by adding 2p2 b|E| + |E||V |p3/2 − 2nd/W on both sides which implies that Equation (40) is equivalent to Equation (39). Notice that the LHS of (40) is exactly the RHS of (37) and the RHS of (40) is exactly the RHS of (36). Therefore, we can decide whether G has a cut with size larger than a|E| or has no cut with size larger than b|E|. Thus, if we can compute x b ∈ Rn , yb ∈ Rd s.t. kA − x b> ybk1 ≤ (1 + 1 log 1+γ d ) min x∈Rn ,y∈Rd kA − x> yk1 , in poly(nd) time, which means we can compute L and T in poly(nd) time. Notice that nd = γ 1− 10 2 1− γ p2 |E||V |, |E| = O(|V |), p ≥ 2 a−b |V | , it means poly(nd) = 2O(|V | 10 ) . Because we decide whether G has a cut with size larger than a|E| or has no cut with size larger than b|E| via the value of T , we can solve it in 2O(|V | H.4 γ 1− 10 ) time which leads to a contradiction to Theorem H.15. Extension to the rank-k case This section presents a way of reducing the rank-k case to the rank-1 case. Thus, we can obtain a lower bound for general k ≥ 1 under ETH. Theorem H.18. For any constants c1 > 0, c2 > 0 and c3 > 0, and any constant c4 ≥ 10(c1 + c2 + c3 + 1), given any matrix A ∈ Rn×n with absolute value of each entry bounded by nc1 , we define a e ∈ R(n+k−1)×(n+k−1) as block diagonal matrix A   A 0 0 ··· 0  0 B 0 ··· 0    e= 0 0 B ··· 0  A  , · · · · · · · · · · · · · · · 0 0 0 ··· B b is an `1 -norm rank-k C-approximation solution to A, e i.e., where B = nc4 . If A b − Ak e 1≤C· kA min rank −k 97 b0 A b0 − Ak e 1, kA where C ∈ [1, nc3 ], then there must exist j ∗ ∈ [n] such that > > c2 b[1:n] minn kA j ∗ v − Ak1 ≤ C · minn kuv − Ak1 + 1/n , u,v∈R v∈R b can give an `1 -norm rank-1 C-approximation to i.e., the first n coordinates of the column j ∗ of A A. Proof. The first observation is that because we can use a rank-1 matrix to fit A and use a rank-(k−1) matrix to fit other Bs, we have min b0 rank −k A b0 − Ak e 1 ≤ min kuv > − Ak1 ≤ kAk1 . kA n u,v∈R (41) b denote the rank-k C-approximate solution to A. e Let Z ∈ R(n+k−1)×(k−1) denote Claim H.19. Let A b the rightmost k − 1 columns of A, then, rank(Z) = k − 1. Proof. Consider the (k − 1) × (k − 1) submatrix Z [n+1:n+k−1] of Z. Each element on the diagonal of this submatrix should be at least B − CkAk1 , and each element not on the diagonal of b − Ak e 1 > CkAk1 which will lead to a the submatrix should be at most CkAk1 . Otherwise kA c [n+1:n+k−1] 4 contradiction. Since B = n is sufficiently large, Z is diagonally dominant. Thus rank(Z) ≥ rank(Z [n+1:n+k−1] ) = k − 1. Because Z only has k − 1 columns, rank(Z) = k − 1. Claim H.20. ∀x ∈ Rk−1 , i ∈ [n], ∃j ∈ {n + 1, n + 2, · · · , n + k − 1} such that, |(Zx)j | B ≥ . |(Zx)i | 2(k − 1)CkAk1 Proof. Without loss of generality, we can let kxk1 = 1. Thus, there exists j such that |xj | ≥ So we have |(Zx)n+j | = | k−1 X 1 k−1 . Zn+j,i xi | i=1 ≥ |Zn+j,j xj | − X |Zn+j,i xi | i6=j ≥ (B − CkAk1 )|xj | − X |xi |CkAk1 i6=j ≥ (B − CkAk1 )/(k − 1) − CkAk1 B . ≥ 2(k − 1) The second inequality follows because |Zn+j,j | ≥ B−CkAk1 and ∀i 6= j, |Zn+j,i | ≤ CkAk1 (otherwise b Ak e 1 > CkAk1 which leads to a contradiction.) The third inequality follows from |xj | > 1/(k−1) kA− B 1 and kxk1 = 1. The fourth inequality follows since B is large enough such that 2(k−1) ≥ CkAk k−1 + CkAk1 . Now we consider any q ∈ [n]. We have |(Zx)q | = k−1 X i=1 |Zq,i xi | ≤ max |Zq,i | · i∈[k−1] 98 k−1 X i=1 |xi | ≤ CkAk1 . b − Ak e 1> The last inequality follows that kxk1 = 1 and ∀i ∈ [k − 1], Zq,i ≤ CkAk1 . Otherwise, kA CkAk1 which will lead to a contradiction. B Look at |(Zx)n+j |/|(Zx)q |, it is greater than 2(k−1)CkAk . 1 b[1:n] , we choose i∗ , j ∗ ∈ [n] such that We now look at the submatrix A [1:n] bi∗ ,j ∗ | ≥ 1/nc2 −2 . |A If there is no such (i∗ , j ∗ ), it means that we already found a good rank-1 approximation to A b[1:n] k1 + kA b[1:n] − Ak1 k0 − Ak1 ≤ k0 − A [1:n] [1:n] [1:n] b b e ≤ k0 − A [1:n] k1 + kA − Ak1 b − Ak e 1 ≤ 1/nc2 + kA ≤ 1/nc2 + C min b0 rank −k A b0 − Ak e 1 kA ≤ 1/nc2 + C minn kuv > − Ak1 , u,v∈R [1:n] b where 0 is an n × n all zeros matrix. The second inequality follows since A [1:n] − A is a submatrix [1:n] b − A. e The third inequality follows since each entry of A b of A should be no greater than 1/nc2 −2 [1:n] (otherwise, we can find (i∗ , j ∗ )). The last inequality follows from equation 41. bj ∗ is not in the column span of Z, i.e., Claim H.21. A bj ∗ 6= Zx. ∀x ∈ Rk−1 , A bj ∗ = Zx, it means (Zx)i∗ = A bi∗ ,j ∗ ≥ 1/nc2 −2 . Due to Claim H.20, Proof. If there is an x such that A B there must exist i0 ∈ {n + 1, n + 2, · · · , n + k − 1} such that (Zx)i0 ≥ 2(k−1)CkAk c −2 . Since B is 1n 2 bi0 ,j ∗ = (Zx)i0 > CkAk1 which implies that kA b − Ak e 1 > CkAk1 , and so leads to sufficiently large, A a contradiction. bj ∗ and the Due to Claim H.19 and Claim H.21, the dimension of the subspace spanned by A b b column space of Z is k. Since A has rank at most k, it means that each column of A can be written bj ∗ and the columns of Z. as a linear combination of A th bj of A b for j ∈ [n]. We write it as Now consider the j column A bj = αj · A bj ∗ + Zxj . A Claim H.22. ∀j ∈ [n], αj ≤ 2CkAk1 nc2 +2 . Proof. Otherwise, suppose αj > 2CkAk1 nc2 +2 . We have bi∗ ,j ∗ | − |A bi∗ ,j | |(Zxj )i∗ | ≥ αj · |A 1 bi∗ ,j | ≥ αj · c2 −2 − |A n 1 1 ≥ αj · c2 −2 . 2 n 99 bi∗ ,j ∗ | ≥ 1/nc2−2 . The third inequality follows from |A bi∗ ,j | ≤ The second inequality follows from |A 1 1 kAk1 and 2 αj · nc2 −2 ≥ CkAk1 ≥ kAk1 . B · Due to Claim H.20, there exists i ∈ {n+1, n+2, · · · , n+k −1} such that |(Zxj )i | ≥ 2(k−1)CkAk 1 1 2 αj · 1 . nc2 −2 For sufficiently large B, we can have |(Zxj )i | ≥ αj B 1/2 . Then we look at bi,j | ≥ |(Zxj )i | − αj |A bi,j ∗ | |A ≥ αj (B 1/2 − CkAk1 ) 1 ≥ αj B 1/2 . 2 bi,j ∗ | ≤ CkAk1 , otherwise kA b − Ak e 1 > CkAk1 which will lead to The second inequality follows by |A a contradiction. The third inequality follows that B is sufficient large that 12 B 1/2 > CkAk1 . bi,j | ≥ αj 1 B 1/2 > CkAk1 , it contradicts to the fact kA b − Ak e 1 ≤ CkAk1 . Since |A 2 c +2 Therefore, ∀j ∈ [n], αj ≤ 2CkAk1 n 2 . Claim H.23. ∀j ∈ [n], i ∈ {n + 1, n + 2, · · · , n + k − 1}, |(Zxj )i | ≤ 4C 2 kAk21 nc2 +2 Proof. Consider j ∈ [n], i ∈ {n + 1, n + 2, · · · , n + k − 1}, we have bi,j | + αj |A bi,j ∗ | |(Zxj )i | ≤ |A ≤ CkAk1 + αj · CkAk1 ≤ 4C 2 kAk21 nc2 +2 . bi,j | ≤ CkAk1 and |A bi,j ∗ | ≤ CkAk1 , otherwise the kA b − Ak e 1 will The second inequality follows by |A be too large and leads to a contradiction. The third inequality is due to αj + 1 ≤ 4CkAk1 nc2 +2 via Claim H.22. [1:n] b Claim H.24. ∀j ∈ [n], kA j c2 −2 b1:n − αj · A j ∗ k∞ ≤ 1/n Proof. Due to Claim H.23 and Claim H.20, ∀i, j ∈ [n], we have |(Zxj )i | ≤ 4C 2 kAk21 nc2 +2 ≤ 1/B 1/2 . B/(2(k − 1)CkAk1 ) The second inequality follows for a large enough B. Therefore, ∀i, j ∈ [n], bi,j − αj · A bi,j ∗ | ≤ |(Zxj )i | ≤ 1/B 1/2 ≤ 1/nc2 −2 . |A The last inequality follows since B is large enough. b1:n Now, let us show that A j ∗ can provide a good rank-1 approximation to A: [1:n] [1:n] > b1:n b1:n > b b kA j ∗ α − Ak1 ≤ kAj ∗ α − A[1:n] k1 + kA[1:n] − Ak1 = n X [1:n] bj ∗ − A b kαj A j [1:n] b k1 + kA [1:n] − Ak1 j=1 [1:n] b ≤ n2 · 1/nc2 −2 + kA [1:n] − Ak1 b − Ak e 1 ≤ 1/nc2 + kA ≤ 1/nc2 + C minn kuv > − Ak1 . u,v∈R 100 The first inequality follows by triangle inequality. The first equality is due to the linearity of `1 b[1:n] − A is norm. The second inequality is due to Claim H.24. The third inequality follows since A [1:n] b − A. e The fourth inequality is due to the equation 41. a submatrix of A I Limited independent Cauchy random variables This section presents the fundamental lemmas with limited independent Cauchy variables, which will be used in Section J and K. In Section I.1, we provide some notation, definitions and tools from previous work. Section I.2 includes the main result. I.1 Notations and Tools For a function f : R → R and nonnegative integer `, f (`) denotes the `th derivative of f , with f (0) = f . We also often use x ≈ y to state that |x − y| = O(). We use I[a,b] to denote the indicator function of the interval [a, b]. To optimize the communication complexity of our ditributed algorithm, we show that instead of using fully independent Cauchy variables, poly(k, d)-wise independent Cauchy variables suffice. We start by stating two useful Lemmas from previous work [KNW10]. Lemma I.1 (Lemma 2.2 in [KNW10]). There exists an 0 > 0 such that the following holds. Let n be a positive integer and 0 <  < 0 , 0 < p < 2 be given. Let f : R → R satisfy kf (`) k∞ = O(α` ) for all ` ≥ 0, for some α satisfying αp ≥ log(1/). Let k = αp . Let a ∈ RnPsatisfy kakp = O(1). P Let Xi be a 3Ck-independent family of p-stable random variables. Let X = i ai Xi and Y = i ai Yi . Then E[f (x)] = E[f (Y )] + O(). Lemma I.2 (Lemma 2.5 in [KNW10]). There exist constants c0 , 0 > 0 such that for all c > 0 and c 0 <  < 0 , and for all [a, b] ⊆ R, there exists a function J[a,b] : R → R satisfying: c )(`) k ` i. k(J[a,b] ∞ = O(c ) for all ` ≥ 0. c (x)−I ii. For all x such that a, b ∈ / [x−, x+], and as long as c > c0 −1 log3 (1/), |J[a,b] [a,b] (x)| < . I.2 Analysis of limited independent random Cauchy variables Lemma I.3. Given a vector y ∈ Rn , choose Z to be the t × n random Cauchy matrices with 1/t rescaling and t = O(k log k). The variables from different rows are fully independent, and the variables from the same rows are O(1)-wise independent. Then, we have kZyk1 & kyk1 holds with probability at least 1 − 2−Ω(t) . Proof. Let S denote the original fully independent matrix and Z denote the matrix for which the entries in the same row are w-wise independent, and the entries from different rows are fully independent. Notice we define the random matrices without rescaling by 1/t and it will be added back at the end. (We will decide w later) 101 1 and X = 0 otherwise. We also We define random variable X such that X = 1 if |(Zy)i | ≤ 50 1 define random variable Y such that Y = 1 if |(Sy)i | ≤ 50 and Y = 0 otherwise. Then, we have     1 = E I[− 1 , 1 ] ((Zy)i ) E[X] = Pr |(Zy)i | ≤ 50 50 50     1 E[Y ] = Pr |(Sy)i | ≤ = E I[− 1 , 1 ] ((Sy)i ) 50 50 50 The goal is to show that E[X] ≈ E[Y ]. Following the same idea from [KNW10], we need to argue this chain of inequalities, c c E[I[a,b] (X)] ≈ E[J[a,b] (X)] ≈ E[J[a,b] (Y )] ≈ E[I[a,b] (Y )] Using Lemma 2.2 and Lemma 2.5 from [KNW10], choosing sufficiently small constant (which implies w = O(1)), it follows that for each i ∈ [t], we still have     1 1 Pr |(Zy)i | > kyk1 & Pr |(Sy)i | > kyk1 ≥ 0.9 50 50 Because all rows of Z are fully independent, using the Chernoff bound we can get that   Pr kZyk1 . tkyk1 ≤ exp(−Ω(t)) as we needed for the “no contraction” part of the net argument. For the no dilation, we need to argue that Lemma I.4. Given a set of vectors {y1 , y2 , . . . , yd } where yi ∈ Rn , ∀i ∈ [d], choose Z to be the t × n random Cauchy matrices with 1/t rescaling and t = O(k log k), where the variables from different rows are fully independent, and the variables from the same rows are w-wise independent. e I. If w = O(dk), we have d d X X kZyi k1 ≤ O(log d) kyi k1 i=1 i=1 holds with probability at least .999. e II. If If w = O(d), we have d X kZyi k1 ≤ O(k log d) i=1 d X kyi k1 i=1 holds with probability at least .999. Proof. Let m = t. Let S ∈ Rm×n denote the original fully independent matrix and Z denote the matrix that for each entry in the same row are w-wise independent, where the entries from different rows are fully independent. (We will decide onw later) Applying matrix S to those fixed set of vectors, we have d X i=1 kSyi k1 = d m n d X m X n X 1 1 XX X | Sj,l · (yi )l | = | Sj,l · (yi )l | m m i=1 j=1 i=1 j=1 l=1 102 l=1 Applying matrix Z to those fixed set of vectors, we have a similar thing, d X i=1 d m d X m X n n X 1 XX X 1 kZyi k1 = Zj,l · (yi )l | = | | Zj,l · (yi )l | m m i=1 j=1 i=1 j=1 l=1 l=1 The goal is to argue that, for any i ∈ [d], j ∈ [m],  X   X  n n E | Zj,l · (yi )l | ξ . E | Sj,l · (yi )l | ξ + δ l=1 l=1 As long as δ is small enough, we are in a good P shape. 1 1 Pn Let X = kyi k1 l=1 Zj,l (yi )l , and Y = kyi k1 m l=1 Sj,l (yi )l . Let D be the truncating threshold of each Cauchy random variable. Define T = O(log D). On one hand, we have   T X E[|X||ξ] ≤ 2 Pr[X ∈ [0, 1]|ξ] · 1 + Pr[X ∈ (2j , 2j+1 ]|ξ] · 2j+1  j=0  ≤ 2 1 + T X  Pr[I(2j ,2j+1 ) (X) = 1|ξ] · 2j+1  j=0  = 2 1 + T X  E[I(2j ,2j+1 ) (X)|ξ] · 2j+1  (42) j=0 On the other hand, we can show  E[|Y ||ξ] ≥ 2 Pr[X ∈ [0, 1]|ξ] · 0 + T X  Pr[Y ∈ (2j , 2j+1 ]|ξ] · 2j  j=0 ≥2 T X Pr[I(2j ,2j+1 ] (Y ) = 1|ξ] · 2j j=0 ≥2 T X E[I(2j ,2j+1 ] (Y )|ξ] · 2j (43) j=0 Thus, we need to show that, for each j, E[I(2j ,2j+1 ) (X)|ξ] ≈ E[I(2j ,2j+1 ] (Y )|ξ] (44) Following the same idea from [KNW10], we need to argue this chain of inequalities, c c E[I[a,b] (X)] ≈ E[J[a,b] (X)] ≈ E[J[a,b] (Y )] ≈ E[I[a,b] (Y )] c (X)]. Notice that I We first show E[I[a,b] (X)] ≈ E[J[a,b] [a,b] and J[a,b] are within  everywhere except for two intervals of length O(). Also the Cauchy distribution is anticoncentrated (any length-O() c k interval contains O() probability mass) and kI[a,b] k∞ , kJ[a,b] ∞ = O(1), these intervals contribute O() to the difference. c (X)] ≈ E[J c (Y )]. This directly follows by Lemma I.1 by choosing Second, we show E[J[a,b]  [a,b] 3 −1 α = O( log (1/)). 103 c (Y )] ≈ E[I Third, we show E[J[a,b]  [a,b] (Y )]. The argument is similar as the first step, but we need to show anticoncentration of Y . Suppose for any t ∈ R we had a nonnegative function f,t : R → R symmetric about t satisfying: (`) I. kft, k∞ = O(α` ) for all ` ≥ 0, with α = O(1/) II. E[ft, (z)] = O() for z ∼ D1 III. ft, (t + ) = Ω(1) IV. ft, (x) is strictly decreasing as |x − t| → ∞ By I, II and Lemma I.1 we could have E[f,t (Y )] ≈ E[ft, (z)] = O(). Then, E[ft, (Y )] ≥ ft, (t+)· Pr[Y ∈ [t−, t+]] = Ω(Pr[Y ∈ [t−, t+]]) by III and IV, implying anticoncentration in [t−, t+] as desired. For the details of function ft, , we refer the readers to Section A.4 in [KNW10]. Now, combining Equation (42), (43) and (44) gives  X   X  X n n T E | Zj,l · (yi )l | ξ . E | Sj,l · (yi )l | ξ + 2j ·  · kyi k1 l=1 l=1 j=0  X  n .E | Sj,l · (yi )l | ξ + D ·  · kyi k1 l=1 e Overall, for the fixed j, Sj,l is O(1/)-independent family of Cauchy random variable. Choosing D = O(dk) and  = O(1/D), we can show  X  d m n d X 1 XX E | Sj,l · (yi )l | ξ ≤ O(log d) kyi k1 m i=1 j=1 i=1 l=1 as before. Notice that Dkyi k1 = O(kyi k1 ). Thus, we complete the proof of the first result. Choosing D = O(dk) and  = O(1/d), the dominant term becomes Dkyi k1 = O(kkyi k1 ). Thus, we complete the proof of second result. Corollary I.5. Given U ∈ Rn×k , let Z ∈ Rt×n be the same as the matrix stated in the Lemma I.3, then with probability at least .95, ∀x ∈ Rk , kZU xk1 & kU xk1 . The proof is very similar to the proof of Lemma D.22. Without loss of generality, we can suppose U is a well-conditioned basis. Due to Lemma I.4, with arbitrarily high constant probability kZU k1 is bounded by poly(t, k). By simply applying the net argument and using Lemma I.3 to take a union bound over net points, we can get the above corollary. J Streaming Setting Section J.1 provides some notation and definitions about row-update streaming model and the turnstile streaming model. For some recent developments of row-update streaming and turnstile streaming models, we refer the readers to [CW09, KL11, GP13, Lib13, KLM+ 14, BWZ16] and the references therein. Section J.2 presents our turnstile streaming algorithm. Section J.3 presents our row-update streaming algorithm. 104 J.1 Definitions Definition J.1 (Row-update model). Let matrix A ∈ Rn×d be a set of rows A1 , · · · , An . In the row-update streaming model, each row of A will occur in the stream exactly once. But the rows can be in arbitrary order. An algorithm in this model is only allowed a single pass over these rows. At the end of the stream, the algorithm stores some information of A. The space of the algorithm is the total number of words required to store this information during the stream. Here, each word is O(log(nd)) bits. Definition J.2 (Turnstile model). At the beginning, let matrix A ∈ Rn×d be a zero matrix. In the turnstile streaming model, there is a stream of update operations, and the ith operation has the form (xi , yi , ci ) which means that Axi ,yi should be incremented by ci . An algorithm in this model is only allowed a single pass over the stream. At the end of the stream, the algorithm stores some information of A. The space complexity of the algorithm is the total number of words required to store this information during the stream. Here, each word is O(log(nd)) bits. J.2 Turnstile model, poly(k, log(d), log(n)) approximation Definition J.3 (Turnstile model `1 -low rank approximation - rank-k subspace version). Given matrix A ∈ Rn×d and k ∈ N+ , the goal is to propose an algorithm in the streaming model of Definition J.2 such that 1. Upon termination, the algorithm outputs a matrix V ∗ ∈ Rk×d . 2. V ∗ satisfies that min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The space complexity is as small as possible Theorem J.4. Suppose A ∈ Rn×d is given in the turnstile streaming model (See Definition J.2), there is an algorithm(in Algorithm 8 without decomposition) which solves the problem in Definie tion J.3 with constant probability. Further, the space complexity of the algorithm is poly(k) + O(kd) words. Proof. Correctness. The correctness is implied by (IV) of Lemma D.11, and the proof of Theob ∈ RO(k log k)×O(k log k) minimizes rem C.3. Notice that L = T1 AR, N = SAT2 , M = T1 AT2 , so X min rank −k X kT1 ARXSAT2 − T1 AT2 kF . b According to the proof of Theorem C.3, ARXSA gives a `1 rank-k poly(k, log(d), log(n))-approximation > ∗ > b b b b b b to A. Because X = U ΣV , V = ΣV SA satisfies: min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . e e Space complexity. Generating O(kd)-wise independent random Cauchy variables needs O(kd) 2 3 3 2 2 2 bits. The size of L, N and M are k log k, k log k and k log k words separately. So the space of maintaining them is O(k 2 log3 k) words. The size of D is O(k log k) × d, so maintaining it needs e O(kd log k) words. Therefore, the total space complexity of the algorithm is poly(k) + O(kd) words. 105 It is easy to extend our algorithm to output a decomposition. The formal definition of the decomposition problem is as the following: Definition J.5 (Turnstile model `1 -low rank approximation - rank-k decomposition version). Given matrix A ∈ Rn×d and k ∈ N+ , the goal is to propose an algorithm in the streaming model of Definition J.2 such that 1. Upon termination, the algorithm outputs a matrix U ∗ ∈ Rn×k , V ∗ ∈ Rk×d . 2. U ∗ , V ∗ satisfies kA − U ∗ V ∗ k1 ≤ poly(k, log(d), log(n)) · min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The space complexity is as small as possible Theorem J.6. Suppose A ∈ Rn×d is given by the turnstile streaming model (See Definition J.2). There is an algorithm( in Algorithm 8 with decomposition) which solves the problem in Definition J.5 e with constant probability. Further, the space complexity of the algorithm is poly(k) + O(k(d + n)) words. Proof. Correctness. The only difference from the Algorithm 8 (without decomposition) is that the b . Notice that U ∗ V ∗ = ARXSA, b algorithm maintains C. Thus, finally it can compute U ∗ = ARU according to the proof of Theorem C.3, U ∗ V ∗ gives a `1 rank-k poly(k, log(d), log(n))-approximation to A. e Space complexity. Since the size of C is O(nk log k) words, the total space is poly(k)+ O(k(d+ n)) words. J.3 Row-update model, poly(k) log d approximation Definition J.7 (Row-update model `1 -low rank approximation - rank-k subspace version). Given matrix A ∈ Rn×d and k ∈ N+ , the goal is to propose an algorithm in the streaming model of Definition J.1 such that 1. Upon termination, the algorithm outputs a matrix V ∗ ∈ Rk×d . 2. V ∗ satisfies that min kA − U V ∗ k1 ≤ poly(k) log(d) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The space complexity is as small as possible Theorem J.8. Suppose A ∈ Rn×d is given by the row-update streaming model (See Definition J.1), there is an algorithm( in Algorithm 9 without decomposition ) which solves the problem in Definie tion J.7 with constant probability. Further, the space complexity of the algorithm is poly(k) + O(kd) words. 106 Algorithm 8 Turnstile Streaming Algorithm 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: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: procedure TurnstileStreaming(k,S) Construct sketching matrices S ∈ RO(k log k)×n , R ∈ Rd×O(k log k) , T1 ∈ RO(k log k)×n , T2 ∈ d×O(k log2 k) where R, T are fully independent random Cauchy matrices, and S, T are random R 2 1 e Cauchy matrices with fully independent variables across different rows and O(d)-wise independent variables from the same row. Initialize matrices: 2 L ← {0}O(k log k)×O(k log k) , N ← {0}O(k log k)×O(k log k) . 2 M ← {0}O(k log k)×O(k log k) , D ← {0}O(k log k)×d . if need decomposition then C ← {0}n×O(k log k) . end if for i ∈ [l] do Receive update operation (xi , yi , ci ) from the data stream S. for r = 1 → O(k log k), s = 1 → O(k log k) do Lr,s ← Lr,s + T1r,xi · ci · Ryi ,s . end for for r = 1 → O(k log k), s = 1 → O(k log2 k) do Nr,s ← Nr,s + Sr,xi · ci · T2yi ,s . end for for r = 1 → O(k log k), s = 1 → O(k log2 k) do Mr,s ← Mr,s + T1r,xi · ci · T2yi ,s . end for for r = 1 → O(k log k) do Dr,yi ← Dr,s + Sr,xi · ci . end for if need decomposition then for s = 1 → O(k log k) do Cxi ,s ← Cxi ,s + ci · Ryi ,s . end for end if end for Compute the SVD of L = UL ΣL VL> . Compute the SVD of N = UN ΣN VN> . b = L† (UL U > M VN V > )k N † . Compute X L N b =U bΣ b Vb > . Compute the SVD of X if need decomposition then b Vb > D, U ∗ = C U b. return V ∗ = Σ else b Vb > D. return V ∗ = Σ end if end procedure b ∈ RO(k log k)×O(k log k) Proof. Correctness. Notice that L = T1 BR, N = SBT2 , M = T1 BT2 . Thus, X actually minimizes min kT1 BRXSBT2 − T1 BT2 kF . rank −k X 107 Also notice that B is just taking each row of A and replacing it with its nearest point in the row b span of S 0 A. According to the proof of Theorem C.6 and (IV) of Lemma D.11 BRXSB gives a > ∗ > b b b b b b poly(k) log d `1 norm rank-k approximation to A. Since X = U ΣV , V = ΣV SB satisfies: min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . e Space complexity. Constructing sketching matrices needs O(kd) bits to store random seeds. 3 2 b is also O(k 2 log2 k) words. Maintaining L, N, M needs O(k log k) words. The cost of storing X Maintaining D needs O(kd log k) words. Therefore, the total space cost of the algorithm is poly(k)+ e O(kd) words. It is easy to extend our algorithm to output a decomposition. The formal definition of the decomposition problem is as the following: Definition J.9 (Row-update model `1 -low rank approximation - rank-k decomposition version). Given matrix A ∈ Rn×d and k ∈ N+ , the goal is to propose an algorithm in the streaming model of Definition J.1 such that 1. Upon termination, the algorithm outputs matrices U ∗ ∈ Rn×k , V ∗ ∈ Rk×d . 2. U ∗ , V ∗ satisfies that kA − U ∗ V ∗ k1 ≤ poly(k) log d · min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The space complexity is as small as possible. Theorem J.10. Suppose A ∈ Rn×d is given by the row-update streaming model (See Definition J.1), there is an algorithm(in Algorithm 9 with decomposition ) which solves the problem in Definition J.9 e with constant probability. Further, the space complexity of the algorithm is poly(k) + O(k(n + d)) words. Proof. Correctness. The only difference is that the above algorithm maintains C. Thus, We b in the end. Notice that U ∗ V ∗ = BRXSB, b can compute U ∗ = C U according to the proof of ∗ ∗ Theorem C.6, U V gives a poly(k) log d `1 norm rank-k approximation to A. e Space complexity. Since the size of C is nk log k words, the total space is poly(k)+ O(k(n+d)) words. K Distributed Setting Section K.1 provides some notation and definitions for the Row-partition distributed model and the Arbitrary-partition model. These two models were recently studied in a line of works such as [TD99, QOSG02, BCL05, BRB08, MBZ10, FEGK13, PMvdG+ 13, KVW14, BKLW14, BLS+ 16, BWZ16, WZ16]. Section K.2 and K.3 presents our distributed protocols for the Arbitrary-partition distributed model. Section K.4 and K.5 presents our distributed protocols for the Row-partition distributed model. 108 Algorithm 9 Row Update Streaming Algorithm 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: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: procedure RowUpdateStreaming(k, S) Construct sketching matrices S 0 ∈ RO(k log k)×n , S ∈ RO(k log k)×n , R ∈ Rd×O(k log k) , T1 ∈ 2 O(k R log k)×n , T2 ∈ Rd×O(k log k) where R, T2 are fully independent random Cauchy variables, and S , S 0 , T1 are random Cauchy matrices with fully independent random variables from e different rows and O(d)-wise independent in the same row. Initialize matrices: 2 L ← {0}O(k log k)×O(k log k) , N ← {0}O(k log k)×O(k log k) . 2 M ← {0}O(k log k)×O(k log k) , D ← {0}O(k log k)×d . if need decomposition then C ← {0}n×O(k log k) . end if for i ∈ [n] do Recieve a row update (i, Ai ) from the data stream S. 0 A −A k . Compute Yi∗ ∈ R1×O(k log k) which minimizes minY ∈R1×O(k log k) kY S:,i i i 1 ∗ 0 Compute Bi = Yi S:,i Ai . for r = 1 → O(k log k), s = 1 → O(k log k), j = 1 → d do Lr,s ← Lr,s + T1r,i · Bi,j · Rj,s . end for for r = 1 → O(k log k), s = 1 → O(k log2 k), j = 1 → d do Nr,s ← Nr,s + Sr,i · Bi,j · T2j,s . end for for r = 1 → O(k log k), s = 1 → O(k log2 k), j = 1 → d do Mr,s ← Mr,s + T1r,i · Bi,j · T2j,s . end for for r = 1 → O(k log k), j = 1 → d do Dr,j ← Dr,j + Sr,i · Bi,j . end for if need decomposition then for s = 1 → O(k log k), j = 1 → d do Ci,s := Ci,s + Bi,j · Rj,s . end for end if end for Compute the SVD of L = UL ΣL VL> . Compute the SVD of N = UN ΣN VN> . b = L† (UL U > M VN V > )k N † . Compute X L N b =U bΣ b Vb > . Compute the SVD of X if need decomposition then b Vb > D, U ∗ = C U b. return V ∗ = Σ else b Vb > D. return V ∗ = Σ end if end procedure 109 K.1 Definitions Definition K.1 (Row-partition model [BWZ16]). There are s machines, and the ith machine has a P matrix Ai ∈ Rni ×d as input. Suppose n = si=1 ni , and the global data matrix A ∈ Rn×d is denoted as   A1  A2     ··· , As we say A is row-partitioned into these s matrices distributed in s machines respectively. Furthermore, there is a machine which is a coordinator. The model only allows communication between the machines and the coordinator. The communication cost in this model is the total number of words transferred between machines and the coordinator. Each word is O(log(snd)) bits. Definition K.2 (Arbitrary-partition model [BWZ16]). There are s machines, and the ith machineP has a matrix Ai ∈ Rn×d as input. Suppose the global data matrix A ∈ Rn×d is denoted as A = si=1 Ai . We say A is arbitrarily partitioned into these s matrices distributed in s machines respectively. Furthermore, there is a machine which is a coordinator. The model only allows communication between the machines and the coordinator. The communication cost in this model is the total number of words transferred between machines and the coordinator. Each word is O(log(snd)) bits. K.2 Arbitrary-partition model, subspace, poly(k, log(d), log(n)) approximation Definition K.3 (Arbitrary-partition model `1 -low rank approximation - rank-k subspace version). Given matrix A ∈ Rn×d arbitrarily partitioned into s matrices A1 , A2 , · · · , As distributed in s machines respectively, and k ∈ N+ , the goal is to propose a protocol in the model of Definition K.2 such that 1. Upon termination, the protocol leaves a matrix V ∗ ∈ Rk×d on the coordinator. 2. V ∗ satisfies that min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The communication cost is as small as possible Theorem K.4. Suppose A ∈ Rn×d is partitioned in the arbitrary partition model (See Definition K.2). There is a protocol(in Algorithm 10) which solves the problem in Definition K.3 with e constant probability. Further, the communication complexity of the protocol is s(poly(k) + O(kd)) words. Proof. Correctness. The correctness is shown by the proof of Theorem C.3 and (IV) of Lemma D.11. b ∈ RO(k log k)×O(k log k) minimizes Notice that X min rank −k X kLXN − M kF . which is min rank −k X kT1 ARXSAT2 − T1 AT2 kF . 110 Algorithm 10 Arbitrary Partition Distributed Protocol 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: procedure ArbitraryPartitionDistributedProtocol(k,s,A) A ∈ Rn×d was arbitrarily partitioned into s matrices A1 , · · · , As ∈ Rn×d distributed in s machines. Coordinator Machines i Chooses a random seed. Sends it to all machines. −−−−−−−−−> Agrees on R, T2 which are fully independent random Cauchy matrices. Agrees on S, T1 which are random Cauchy matrices with fully independent entries e from different rows, and O(d)-wise independent variables from the same row. Computes Li = T1 Ai R, Ni = SAi T2 . Computes Mi = T1 Ai T2 . Sends Li , Ni , Mi to the coordinator. <−−−−−−−−− s s P P Computes L = Li , N = Ni . i=1 s P Computes M = i=1 Mi . i=1 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: Computes the SVD of L = UL ΣL VL> . Computes the SVD of N = UN ΣN VN> . b = L† (UL U > M VN V > )k N † . Computes X L N b to machines. Sends X −−−−−−−−−> b =U bΣ b Vb > . Computes the SVD of X b Vb > SAi . Computes Vi∗ = Σ If need decomposition b. Ui∗ = Ai RU ∗ Sends Ui , Vi∗ to the coordinator. Else Sends Vi∗ to the coordinator. Endif <−−−−−−−−− If need decomposition, P P return V ∗ = si=1 Vi∗ , U ∗ = si=1 Ui∗ . Else P return V ∗ = si=1 Vi∗ . Endif end procedure b According to the proof of Theorem C.3, ARXSA gives an `1 rank-k poly(k, log(d), log(n))-approximation > ∗ > b =U bΣ b Vb , V = Σ b Vb SA satisfies: to A. Because X min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k 111 min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . e Communication complexity. Since the random seed generates O(kd)-wise independent rane dom Cauchy variables, the cost of line 5 is O(skd) bits. The size of Li , Ni and Mi are k 2 log2 k, k 2 log3 k b and k 2 log3 k words separately. So the cost of line 15 is O(sk 2 log3 k) words. Because the size of X 2 2 2 2 is O(k log k), the cost of line 22 is O(sk log k) words. line 30 needs skd words of communication. e Therefore, the total communication of the protocol is s(poly(k) + O(kd)) words. K.3 Arbitrary-partition model, decomposition, poly(k, log(d), log(n)) approximation Definition K.5 (Arbitrary-partition model `1 -low rank approximation - rank-k decomposition version). Given matrix A ∈ Rn×d arbitrarily partitioned into s matrices A1 , A2 , · · · , As distributed in s machines respectively, and k ∈ N+ , the goal is to propose a protocol in the model of Definition K.2 such that 1. Upon termination, the protocol leave matrices U ∗ ∈ Rn×k , V ∗ ∈ Rk×d on the coordinator. 2. U ∗ , V ∗ satisfies that kA − U ∗ V ∗ k1 ≤ poly(k, log(d), log(n)) · min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The communication cost is as small as possible. Theorem K.6. Suppose A ∈ Rn×d is partitioned in the arbitrary partition model (See Definition K.2). There is a protocol(in Algorithm 10 with decomposition) which solves the problem in Definition K.5 with constant probability. Further, the communication complexity of the protocol is e s(poly(k) + O(k(d + n))) words. Proof. Correctness. The only difference from the protocol (without decomposition) in Section K.2 b . Notice that U ∗ V ∗ = is that the protocol sends Ui . Thus, the coordinator can compute U ∗ = ARU b ARXSA. According to the proof of Theorem C.3, U ∗ V ∗ gives a `1 rank-k poly(k, log(d), log(n))approximation to A. Communication complexity. Since the size of Ui is kn words, the total communication is e s(poly(k) + O(k(d + n))) words. K.4 Row-partition model, subspace, poly(k) log d approximation Definition K.7 (Row-partition model `1 -low rank approximation - rank-k subspace version). Given matrix A ∈ Rn×d row-partitioned into s matrices A1 , A2 , · · · , As distributed in s machines respectively, and k ∈ N+ , the goal is to propose a protocol in the model of Definition K.1 such that 1. Upon termination, the protocol leaves a matrix V ∗ ∈ Rk×d on the coordinator. 2. V ∗ satisfies that min kA − U V ∗ k1 ≤ poly(k) log d · U ∈Rn×k 3. The communication cost is as small as possible 112 min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . Theorem K.8. Suppose A ∈ Rn×d is partitioned in the row partition model (See Definition K.1). There is a protocol(in Algorithm 11 without decomposition) which solves the problem in Definition K.7 with constant probability. Further, the communication complexity of the protocol is s(poly(k)+ e O(kd)) words. Algorithm 11 Row Partition Distributed Protocol 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: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: procedure RowPartitionDistributedProtocol(k,s,A) A ∈ Rn×d was row partitioned into s matrices A1 ∈ Rn1 ×d , · · · , As ∈ Rns ×d distributed in s machines. Coordinator Machines i Chooses a random seed. Sends it to all machines. −−−−−−−−−> Agrees on R, T2 which are fully independent random Cauchy variables. Generates random Cauchy matrices 2 Si0 ∈ RO(k log k)×ni , Si , T1i ∈ RO(k log k)×ni . Computes Yi∗ = arg min kY Si0 Ai − Ai k1 . Y ∈Rni ×O(k log k) Yi∗ Si0 Ai . Computes Bi = Computes Li = T1i Bi R, Ni = Si Bi T2 . Computes Mi = T1i Bi T2 . Sends Li , Ni , Mi to the coordinator. < − − − − − − − − − P P Computes L = Psi=1 Li , N = si=1 Ni . Computes M = si=1 Mi . Computes the SVD of L = UL ΣL VL> . Computes the SVD of N = UN ΣN VN> . b = L† (UL U > M VN V > )k N † . Computes X L N b to machines. Sends X −−−−−−−−−> b =U bΣ b Vb > . Computes the SVD of X b Vb > Si Bi . Computes Vi∗ = Σ If need decomposition b. Computes Ui∗ = Bi RU ∗ ∗ Sends Ui , Vi to the coordinator. Else Sends Vi∗ to the coordinator. Endif <−−−−−−−−− If need decomposition P P return V ∗ = si=1 Vi∗ , U ∗ = si=1 Ui∗ . Else P return V ∗ = si=1 Vi∗ . Endif end procedure 113 2 Proof. Correctness. For convenience, we denote matrices B ∈ Rn×d , S ∈ RO(k log k)×n and T1 ∈ 2 RO(k log k)×n as   B1  B2     B= T1 = T11 T12 · · · T1s .  · · ·  S = S1 S2 · · · Ss Bs b ∈ RO(k log k)×O(k log k) actually minimizes Notice that L = T1 BR, N = SBT2 , M = T1 BT2 . Thus, X min rank −k X kT1 BRXSBT2 − T1 BT2 kF . Also notice that B is just taking each row of A and replacing it with its nearest point in the row b span of S 0 A. According to the proof of Theorem C.6, BRXSB gives a poly(k) log d `1 norm rank-k > ∗ > b =U bΣ b Vb , V = Σ b Vb SB satisfies: approximation to A. Since X min kA − U V ∗ k1 ≤ poly(k, log(d), log(n)) · U ∈Rn×k min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . e Communication complexity. Since the R and T2 are O(kd)-wise independent, line 6 needs 3 2 O(sW ) bits of communication. Line 16 needs O(sk log k) words. The cost of line 23 is O(sk 2 log2 k) words. Line 32 needs skd words of communication. Therefore, the total communication of the e protocol is s(poly(k) + O(kd)) words. K.5 Row-partition model, decomposition, poly(k) log d approximation Definition K.9 (Row-partition model `1 -low rank approximation - rank-k decomposition version). Given matrix A ∈ Rn×d row partitioned into s matrices A1 , A2 , · · · , As distributed in s machines respectively, and a positive integer k < rank(A), the goal is to propose a protocol in the model of Definition K.1 such that 1. Upon termination, the protocol leaves matrices U ∗ ∈ Rn×k , V ∗ ∈ Rk×d on the coordinator. 2. U ∗ , V ∗ satisfies that kA − U ∗ V ∗ k1 ≤ poly(k) log d · min U ∈Rn×k ,V ∈Rk×d kA − U V k1 . 3. The communication cost is as small as possible. Theorem K.10. Suppose A ∈ Rn×d is partitioned in the row partition model (See Definition K.1). There is a protocol(in Algorithm 11 with decomposition) which solves the problem in Definition K.9 with constant probability. Further, the communication complexity of the protocol is s(poly(k) + e O(k(n + d))) words. Proof. Correctness. The only difference is that the above protocol sends Ui . Thus, the coordinator b . Notice that U ∗ V ∗ = BRXSB, b can compute U ∗ = BRU according to the proof of Theorem C.6, ∗ ∗ U V gives a poly(k) log d `1 norm rank-k approximation to A. Communication complexity. Since the size of Ui is kn words, the total communication is e s(poly(k) + O(k(n + d))) words. 114 4e+04 4e+04 DZHZ06 Ours `1 -norm cost 3e+04 2e+04 2e+04 2e+04 1e+04 5e+03 0e+00 20 40 60 80 100 n 120 140 160 180 200 Figure 1: The x-axis is n where A ∈ Rn×n , and the y-axis is kA0 − Ak1 where rank(A0 ) = k. This figure shows the performance of both our algorithm and [DZHZ06] on input matrix A defined as Equation (45). L Experiments and Discussions In this section, we provide some counterexamples for the other heuristic algorithms such that, for those examples, the heuristic algorithms can output a solution with a very “bad” approximation ratio, i.e., nc , where c > 0 and the input matrix has size n × n. We not only observe that heuristic algorithms sometimes have very bad performance in practice, but also give a proof in theory. L.1 Setup We provide some details of our experimental setup. We obtained the R package of [KK05, Kwa08, BDB13] from https://cran.r-project.org/web/packages/pcaL1/index.html. We also implemented our algorithm and the r1-pca algorithm [DZHZ06] using the R language. The version of the R language is 3.0.2. We ran experiments on a machine with Intel [email protected] CPU and 24G memory. The operating system of that machine is Linux Ubuntu 14.04.5 LTS. All the experiments were done in single-threaded mode. L.2 Counterexample for [DZHZ06] The goal is to find a rank k = 1 approximation for matrix A. For any  ∈ [0, 0.5), we define A ∈ Rn×n as  1.5+    n 0 0 0 A= + , (45) 0 0 0 B where B ∈ R(n−1)×(n−1) is all 1s matrix. It is immediate that the optimal cost is at most n1.5+ . However, using the algorithm in [DZHZ06], the cost is at least Ω(n2 ). Thus, we can conclude, 115 4e+04 4e+04 BDB13 Ours `1 -norm cost 3e+04 2e+04 2e+04 2e+04 1e+04 5e+03 0e+00 20 40 60 80 100 n 120 140 160 180 200 Figure 2: The x-axis is n where A ∈ Rn×n , and the y-axis is kA0 − Ak1 where rank(A0 ) = k. This figure shows the performance of both our algorithm and [BDB13] on input matrix A defined as Equation (46). using algorithm [DZHZ06] to solve `1 low rank approximation problem on A cannot achieve an approximation ratio better than n0.5− . L.3 Counterexample for [BDB13] The goal is to find a rank k = 1 approximation for matrix A. The input matrix A ∈ Rd×d for algorithm [BDB13] is defined to be,  1.5    n 0 0 0 A= + , (46) 0 0 0 B where B ∈ R(n−1)×(n−1) is an all 1s matrix. It is immediate that the optimal cost is at most n1.5 . Now, let us look at the procedure of [BDB13]. Basically, the algorithm described in [BDB13] is that they first find a rank n − 1 approximation via a best `1 -fit hyperplane algorithm, then they rotate it based on the right singular vectors of the rank n − 1 approximation matrix, and next they recursively do the same thing for the rotated matrix which has only n − 1 columns. When running their algorithm on A, they will fit an arbitrary column except the first column of A. Without loss of generality, it just fits the last column of A. After the rotation, the matrix will be an n × (n − 1) matrix:   1.5 n 0 ··· 0 √ 0  0   √n − 2 0 · · · 0   0 n − 2 0 ··· 0  .   ··· · · · · · · · · · · · · √ 0 n − 2 0 ··· 0 116 8e+04 7e+04 Kwak08 Ours `1 -norm cost 6e+04 5e+04 4e+04 3e+04 2e+04 1e+04 0e+00 20 40 60 80 100 120 (n−1)/2 140 160 180 200 Figure 3: The x-axis is n where A ∈ Rn×n , and the y-axis is kA0 − Ak1 where rank(A0 ) = k. This figure shows the performance of both our algorithm and [Kwa08] on input matrix A defined as Equation (47). Algorithm [Kwa08] has two ways of initialization, which have similar performance on matrix A. Then, after the tth iteration for t < (n − 1), they  1.5 n √ 0  0  √n − 2  0 n−2  ··· √· · · n−2 0 This means that their algorithm will run on an  1.5 n  0   0  ··· 0 will get an n × (n − t) matrix:  0 ··· 0 0 ··· 0   0 ··· 0  . · · · · · · · · · 0 ··· 0 n × 2 matrix:  √ 0  √n − 2 n − 2 ,  · · · √ n−2 √ in the last iteration. Notice that n × n − 2 < n1.5 . This means that their algorithm will fit the first column which implies that their algorithm will output a rank-1 approximation to A by just fitting the first column of A. But the cost of this rank-1 solution is (n − 1)2 . Since the optimal cost is at most n1.5 , their algorithm cannot achieve an approximation ratio better than n0.5 . 117 L.4 Counterexample for [Kwa08] We show that the algorithm [Kwa08] cannot achieve an approximation ratio better than Θ(n) on the matrix A ∈ R(2n+1)×(2n+1) defined as,  1.5  n 0 0 A =  0 B 0, (47) 0 0 B where B is an n × n matrix that contains all 1s. We consider the rank-2 approximation problem for this input matrix A. The optimal cost is at most n1.5 . We run their algorithm. Let x0 denote the initial random unit vector. Consider the sign vector s ∈ {±1}2n+1 where each entry is the sign of the inner product between x0 and each column of A. There are only three possibilities,  n n  (1, {1} , {1} ) s = (1, {1}n , {−1}n ) .   (1, {−1}n , {1}n ) P2n+1 1.5 n n b/kuk2 = Case s = (1, {1} b = i=1 si · Ai = (n , n, · · · , n). Let u = u √ I, 1.5 √ , {1} √ ). Define√ u > u b/( 3n ) = (1/ 3, 1/ 3n, · · · , 1/ 3n). Define matrix D to be A−uu A. Then, we can compute D, D = A − uu> A   1/3 3√1 n 1> 3√1 n 1>   1 1 = A −  3√1 n 1 3n B 3n B  A 1 1 1 √ 1 3n B 3n B 3 n √  1.5   n1.5 √n  n > > n 0 0 1 1 3 3 3 1 1  =  0 B 0  −  n3 1 3B 3B n 1 1 0 0 B 31 3B 3B √ √   n > n > 1.5 2n /3 − 3 1 − 3 1 n 2  = −31 − 31 B  . 3B n 1 2 −31 −3B 3B > A. Let w denote another Now we need to take the linear combination of columns D = A − uuP 2n+1 2n+1 sign vector {−1, +1} . Then let v denote the basis vector, v = i=1 Di . There are three n n possibilities, Case I(a), if w = (1, {1} , {1} ), then v is the all 0 vector. Using vector v to interpolate each column of D, the cost we obtain is at least 2n2 . Case I(b), if w = (1, {1}n , {−1}n ), then v = (2n1.5 /3, {2/3}n , {−4/3}n ). We also obtain at least 2n2 cost if we use that v to interpolate each column of D. Case I(c), if w = (1, {−1}n , {−1}n ), then v = (0, {−2/3}n , {−2/3}n ). The cost is also at least 2n2 . Case II, s = (1, {1}n , {−1}n ). Define 1 to be a length vector. Define b = √ √ √u √ n1.5all 1s column P2n+1 n 1.5 n n b/kuk2 = u b/( 3n ) = (1/ 3, {1/ 3n} , {−1/ 3n}n ). i=1 si ·Ai = (n , {n} , {−n} ). Let u = u > Define (2n + 1) × (2n + 1) matrix D to be A − uu A. Then, we can compute D, 118 D = A − uu> A   1 √ 1/3 1> − 3√1 n 1> 3 n  1 1 − 3n B  = A −  3√1 n 1 A 3n B 1 1 − 3√1 n 1 − 3n B B 3n √ √   1.5   n 0 0 n1.5 /3 3n 1> − 3n 1> 1 =  0 B 0  −  n3 1 − 31 B  3B 1 1 n 0 0 B − 3 1 −3B 3B √ √   2n1.5 /3 − 3n 1> 3n 1> 2 1 . =  − n3 1 3B 3B n 1 2 31 3B 3B Similarly to the previous case, we can also discuss three cases. Case III, s = (1, {1}n , {−1}n ). Define 1 to be a length all 1s column vector. u b√= √ √ Define √ n 1.5 P2n+1 n , {−1/ 3n}n ). 1.5 , {−n}n , {−n}n ). Let u = u 3n ) = (1/ 3, {−1/ 3n} s ·A = (n b /kuk = u b /( i i 2 i=1 Define matrix D to be A − uu> A. Then, we can compute D, D = A − uu> A   1/3 − 3√1 n )1> − 3√1 n 1>   1 1 = A − − 3√1 n 1 3n B 3n B  A 1 1 − 3√1 n 1 3n B 3n B √ √  1.5    n 0 0 n1.5 /3 − 3n 1> − 3n 1> 1 1  =  0 B 0  −  − n3 1 3B 3B n 1 1 0 0 B −31 3B 3B √ √   2n1.5 /3 3n 1> 3n 1> 2 1 . =  n3 1 3B 3B n 1 2 31 3B 3B Similarly to the previous case, we can also discuss three cases. L.5 Counterexample for [KK05] We show that there exist matrices such that the algorithm of [KK05] cannot achieve an approximation ratio better than Θ(n). Their algorithm has two different ways of initialization. We provide counterexamples for each of the initialization separately. Random vector initialization We provide a  c n 0  0 0 A= · · · · · · 0 0 counterexample matrix A ∈ Rn×n defined as,  ··· 0 ··· 0   + I, (48) · · · · · · ··· 0 where c ≥ 2. Consider the rank-1 approximation problem for this matrix A. The optimal cost is at most n − 1. 119 2e+09 4e+04 KK05 Ours KK05 Ours 4e+04 2e+09 3e+04 `1 -norm cost `1 -norm cost 2e+04 1e+09 5e+08 2e+04 2e+04 1e+04 5e+03 0e+00 20 40 60 80 100 n 120 140 160 180 0e+00 20 200 40 60 80 100 n 120 140 160 180 200 Figure 4: The x-axis is n where A ∈ Rn×n , and the y-axis is kA0 − Ak1 where rank(A0 ) = k. Algorithm [KK05] has two ways of initialization. The left figure shows the performance of both our algorithm and [KK05] with random vector initialization on input matrix A defined as Equation (48). The right figure shows the performance of both our algorithm and [KK05] with top singular vector initialization on input matrix A defined as Equation (50). Run their algorithm. The starting vectors are u(0) ∼ N (0, I) and v(0) ∼ N (0, 1). We define two properties for a given vector y ∈ Rn . Property I is for all i ∈ [n], |yi | ≤ n/8, and Property II is there exist half of the i such that |yi | ≥ 1/2. We can show that with probability 1 − 2−Ω(n) , both u(0) and v(0) satisfy Property I and II. After 1 iteration, we can show that u(1)1 = v(1)1 = 0 Now let us use column vector u(0) ∈ Rn to interpolate the first column of matrix A. We simplify u(0) to be u. Let ui denote the i-th coordinate of vector u, ∀i ∈ [n]. Let A1 denote the first column of matrix A. We define α = v(1)1 = arg minα kαu(0) − A1 k1 . For any scalar α, the cost we pay on the first column of matrix A is, c |α · u1 − n | + n X |αui | ≥ |α · u1 − nc | + i=2 n 1 n |α · | ≥ |α · u1 − nc | + |α|. 2 2 4 (49) Notice that c ≥ 2. Then |α · u1 − nc | + n4 |α| ≥ |α · n8 − nc | + n4 |α|. If α ≤ 0, then the cost is minimized when α = 0. If α ∈ [0, 8nc−1 ], the cost is minimized when α = 0. If α ≥ 8nc−1 , the cost is minimized when α = 8nc−1 . Putting it all together, to achieve the minimum cost, there is only one choice for α, which is α = 0. The optimal cost is at least nc . Then after T iterations(for any T ≥ 1), u(T )1 = v(T )1 = 0. Thus, we always pay at least nc cost on the first entry. Therefore, their algorithm cannot achieve any approximation ratio better than nc−1 . Because c ≥ 2, we complete the proof. Top singular vector initialization The counterexample input matrix A ∈ Rn×n is defined as,   n 0 A= , (50) 0 B where matrix B ∈ R(n−1)×(n−1) contains all 1s. Consider the rank-1 approximation problem for this matrix A. The optimal cost is at most n. Run their algorithm. The starting vectors u(0) and v(0) will be set to (1, 0, · · · , 0) ∈ Rn . After T iterations(for any T > 0), the support of u(T )(resp. v(T )) 120 is the same as u(0)(resp. v(T )). Thus, the cost is at least kBk1 = (n − 1)2 . Therefore, we can conclude that their algorithm cannot achieve any approximation ratio better than (n−1)2 /n = Θ(n). L.6 Counterexample for all For any  ∈ (0, 0.5) and γ > 0, we construct the input  2+γ n 0 1.5+  0 n A=  0 0 0 0 matrix A ∈ R(2n+2)×(2n+2) as follows  0 0 0 0 , B 0 0 B where B is n × n all 1s matrix. We want to find a rank k = 3 solution for A. Then any of those four heuristic algorithms [KK05, DZHZ06, Kwa08, BDB13] is not able to achieve better than nmin(γ,0.5−) approximation ratio. We present our main experimental results in Figure 5. Both [KK05] and [Kwa08] have two different ways of initialization. In Figure 5 we use KK05r(resp. Kwak08r) to denote the way that uses random vector as initialization, and use KK05s(resp. Kwak08s) to denote the way that uses top singular vector as initialization. Figure 5(a) shows the performance of all the algorithms and Figure 5(b) presents the running time. The `1 residual cost of all the other algorithm is growing much faster than our algorithm. Most of the algorithms (including ours) are pretty efficient, i.e., the running time is always below 3 seconds. The running time of [BDB13, KK05] is increasing very fast when the matrix dimension n is growing. In Figure 5(a), the cost of KK05r at {82, · · · , 142} is in [105 , 106 ], at {162, · · · , 302} is in 6 [10 , 107 ], and at {322, · · · , 402} is in [107 , 108 ]. In Figure 5(b), the time of KK05r at {382, 482} is 64s and 160s. The running time of BDB13 at {82, · · · , 222} is between 1 minute and 1 hour. The running time of BDB13 at {242, · · · , 322} is between 1 hour and 20 hours. The running time of BDB13 at {342, · · · , 402} is more than 20 hours. L.7 Discussion for Robust PCA [CLMW11] A popular method is robust PCA [CLMW11], which given a matrix A, tries to find a matrix L for which λkA − Lk1 + kLk∗ is minimized, where λ > 0 is a tuning parameter and kLk∗ is the nuclear norm of L. This is a convex program, but it need not return a low rank matrix L with relative error. As a simple example, suppose λ = 1, and the n × n matrix A is a block-diagonal matrix of rank k and n = k2 (b + 1). Further, the first k/2 blocks are b × b matrices of all 1s, while the next k/2 blocks are just a single value b on the diagonal. Then the solution to the above problem may return L to be the first k/2 blocks of A. The total cost of λkA − Lk1 + kLk∗ is (k/2)b + (k/2)b = kb. Also, the solution to the above problem may return L to be A, which has cost 0 + kAk∗ = kb. Because this solution has the same cost, it means that their algorithm might output a rank-k solution, and also might output a rank-k/2 solution. Therefore, the relative error of the output matrix may be arbitrarily bad for `1 -low rank approximation. √ We also consider the following example. Suppose λ = 1/ n, and let n × n matrix A denote the Hadamard matrix   Hn . Recall  that the  Hadamard matrix Hp of size p × p is defined recursively : √ Hp/2 Hp/2 +1 +1 with H2 = . Notice that every singular values of A is n. We consider Hp/2 −Hp/2 +1 −1 the objective function λkA − Lk1 + kLk∗ . 121 Then the solution to the above problem may return L to be the first n/2 rows of A. The total √ √ cost of λkA − Lk1 + kLk∗ is (1/ n)n2 /2 + (n/2) n = n1.5 . Also, the solution to the above problem √ may return L to be A, which has cost 0 + kAk∗ = n n = n1.5 . For any i, if the solution takes √ √ i rows of A, the cost is (1/ n)(n − i)n + i n = n1.5 . Because this solution has the same cost, it means that their algorithm might output a rank-n solution, and also might output a rank-n/2 solution. Therefore, the relative error of the output matrix may be arbitrarily bad for `1 -low rank approximation. M Acknowledgments The authors would like to thank Alexandr Andoni, Saugata Basu, Cho-Jui Hsieh, Daniel Hsu, Chi Jin, Fu Li, Ankur Moitra, Cameron Musco, Richard Peng, Eric Price, Govind Ramnarayan, James Renegar, and Clifford Stein for useful discussions. The authors also thank Jiyan Yang, Yinlam Chow, Christopher Ré, and Michael Mahoney for sharing the code. 122 8e+04 Ours BDB13 KK05r KK05s Kwak08r Kwak08s DZHZ06 7e+04 `1 -norm cost 6e+04 5e+04 4e+04 3e+04 2e+04 1e+04 0e+00 0 50 100 150 200 2n +2 250 300 350 400 300 350 400 (a) 50 Ours BDB13 KK05r KK05s Kwak08r Kwak08s DZHZ06 40 Time 30 20 10 0 0 50 100 150 200 2n +2 250 (b) Figure 5: Let A be (2n + 2) × (2n + 2) input matirx. (a) shows the performance of all the algorithms when the matrix dimension is growing. The x-axis is n, and the y-axis is kA0 − Ak1 where A0 is the rank-3 solution output by all the heuristic algorithms and also ours. The `1 residual cost of all the other algorithms is growing much faster than ours, which is consistent with our theoretical results. (b) shows the running time (in seconds) of all the algorithms when the matrix dimension n is growing. The x-axis is n and the y-axis is time (seconds). The running time of some of the algorithms is longer than 3 seconds. For most of the algorithms (including ours), the running time is always less than 3 seconds. 123
8cs.DS
DLPaper2Code: Auto-generation of Code from Deep Learning Research Papers Akshay Sethi ∗ IIIT Delhi Anush Sankaran, Naveen Panwar, Shreya Khare, Senthil Mani arXiv:1711.03543v1 [cs.LG] 9 Nov 2017 IBM Research, India Abstract With an abundance of research papers in deep learning, reproducibility or adoption of the existing works becomes a challenge. This is due to the lack of open source implementations provided by the authors. Further, re-implementing research papers in a different library is a daunting task. To address these challenges, we propose a novel extensible approach, DLPaper2Code, to extract and understand deep learning design flow diagrams and tables available in a research paper and convert them to an abstract computational graph. The extracted computational graph is then converted into execution ready source code in both Keras and Caffe, in realtime. An arXiv-like website is created where the automatically generated designs is made publicly available for 5, 000 research papers. The generated designs could be rated and edited using an intuitive drag-and-drop UI framework in a crowdsourced manner. To evaluate our approach, we create a simulated dataset with over 216, 000 valid design visualizations using a manually defined grammar. Experiments on the simulated dataset show that the proposed framework provide more than 93% accuracy in flow diagram content extraction. Introduction The growth of deep learning (DL) in the field of artificial intelligence has been astounding in the last decade with about 35, 800 research papers being published since 20161 . Keeping up with the growing literature has been a real struggle for researchers and practitioners. In one of the recent AI conferences, NIPS 2016, the maximum number of papers submitted (∼ 685/2500) were in the topic, “Deep Learning or Neural Networks”. However, a majority of these research papers are not accompanied by their corresponding implementations. In NIPS 2016, only 101/567 (∼ 18%) papers made their source implementation available2 . Implementing research papers takes at least a few days of effort for soft∗ Akshay Sethi interened at IBM Research, India during this work. Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. 1 https://scholar.google.co.in/scholar?as_ sdt=1,5\&q=\%22deep+learning\%22\&hl=en\&as_ ylo=2016\&as_vis=1 2 https://www.kaggle.com/benhamner/ nips-papers ware engineers assuming that they have limited knowledge in DL (Sankaran et al. 2011). Another major challenge is the availability of various libraries in multiple programming langauges to implement DL algorithms such as Tensorflow (Abadi et al. 2016), Theano (Bastien et al. 2012), Caffe (Jia et al. 2014), Torch (et al 2011), MXNet (Chen 2015), DL4J (Gibson 2015), CNTK (Seide and Agarwal 2016) and wrappers such as Keras (Chollet and others 2015), Lasagne (Dieleman 2015), and PyTorch (Chintala 2016). The public implementations of the DL research papers are available in various libraries offering very little interoperability or communication among them. Consider a use-case for a researcher working in “image captioning”, where three of the highly referred research papers for the problem of image captioning3 are: 1. Show and Tell (Vinyals et al. 2015): Original implementation available in Theano; https://github.com/ kelvinxu/arctic-captions 2. NeuralTalk2 (Karpathy and Fei-Fei 2015): Original implementation available in Torch; https://github. com/karpathy/neuraltalk2 3. LRCN (Donahue et al. 2015): Original implementation available in Caffe; http://jeffdonahue.com/ lrcn/ As the implementations are available in different libraries, a researcher cannot directly combine the models. Also, for a practitioner having remaining of the code-base in Java (DL4J) directly leveraging either of these public implementations would be daunting. Thus, we highlight two highly overlooked challenges in DL: 1. Lack of public implementation available for existing research works and thus, the time incurred in reproducing their results 2. Existing implementations are confined to a single (or few) libraries limiting portability into other popular libraries for DL implementation. We observed that most of the research paper explains the DL model design either through a figure or a table. Thus, 3 https://competitions.codalab.org/ competitions/3221#results Figure 1: The architecture of the proposed creative system that extracts and understands the flow diagram from a deep learning research paper and generates an execution ready deep learning code in two differcaffent platforms: Keras and Caffe. in this research we propose a novel algorithm that automatically parses a research paper to extract the described DL model design. The design is represented as an abstract computational graph which is independent of the implemenation library or language. Finally, the source code is generated in multiple libraries from this abstract computational graph of the DL design. The results are shown by automatically generating the source code of 5, 000 arXiv papers both in CAFFE (prototxt) and Keras (python). However, evaluating the generated source code is debatable due to the lack of ground truth. To overcome this challenge, we simulated a large image dataset of 216, 000 valid DL model designs in both Caffe and Keras. To generate DL visualizations, we manually defined a grammar for DL models. As these visualizations are highly varying, they are comparable to the figures present in research papers. Thus, the major research contributions are: 1. a technique to automatically understand a DL model design by parsing the figures and tables in a research paper, 2. generate source code both in both Keras and Caffe from the abstract computation graph of a DL design, 3. automatically generate design for 5, 000 arXiv papers and build a UI system for editing them the crowdsourced way, 4. on a simulated dataset of 216, 000 DL model visualizations using a manually defined grammar, evaluate the proposed approach to achieve more than 95% accuracy. The rest of the paper is organized as follows: Section 2 explains the entire proposed approach for auto generation of DL source code from research paper, Section 3 talks about the simulated dataset and its experimental performance of the individual components of the proposed approach, Section 4 discusses the experimental results on 5, 000 arXiv DL papers, and Section 5 concludes this paper with some discussion on our future efforts. Proposed Approach Consider a state-of-art paper DL paper (Szegedy et al. 2017) published in AAAI 2017, which explains the DL design model through figures, as shown in Figure 3(a). Similarly, in the AAAI 2017 paper by (Parkhi et al. 2015), the DL model design was explained using a table. Thus, given the PDF of a research paper in deep learning, the proposed DLPaper2Code architecture consists of five major steps, as shown in Figure 1: (i) Extract all the figures and tables from a research paper. Handling the figure and table content are done independently, although the follow a similar pipeline, (ii) As there could be other descriptive image and results tables in a paper, classify each figure or table whether it contains a DL model design. Also, perform a fine grained classification on the type of figure or table used to describe the DL model, (iii) Extract the flow and the text information from the figures and tables, independently, (iv) Construct an abstract computational graph which is independent of the implementation library, and (v) generate source code in both Caffe and Keras from the computational graph. Characterizing Research Papers We observed that in a research paper the DL design is mostly explained using figures or tables. Thus, it is our assertion that by parsing the figure, as an image, and the table content, the respective novel DL design could be obtained. The primary challenges with the figures in research papers is that the DL design figures typically do not follow any definition and show extreme variations. Similarly, tables can have different structures and can entail different kind of information. We manually observed more than 30, 000 images from research papers and characterized the DL model deisgn images into five broad categories, as shown in Figure 2. The five types are: (i) Neurons plot: the classical representation of a neural network with each layer having circular nodes inside them, (ii) 2D Box: each hidden layer is represented as a 2D rectangular box, (iii) Stacked2D Box: each layer (a) Neurons Plot (b) 2D Box (c) Stacked2D Box (d) 3D Box (e) Pipeline plot Figure 2: Characterizing the DL model designs available in research papers and grouping them into five different categories. is represented as a stack of 2D rectangular boxes, describing the depth of the layer, (iv) 3D Box: each hidden layer is represented as a 3D cuboid structure, and (v) Pipeline plot: along with the DL model design, the entire pipeline and mostly some intermediate results of image/ text is shown as well. Similarly, based on the representation, tables can be classified as, (i) row-major table: where the DL model design flows along the row (Springenberg et al. 2014), and (ii) where the DL model design flows along the column (Parkhi et al. 2015). It is essential to account for these variations in the proposed pipeline, as they indicate the DL design flow represented in the paper. Following this assumption, the proposed approach does not identify a DL design flow that is neither in a table nor in a figure. Extracting Figures and Tables Extracting visual figures from a PDF document, especially a scholarly report is a well studied problem (Choudhury and Giles 2015). Common challenges includes extracting vector images as they are embedded in the PDF document and extracting a large figure as a whole instead of multiple figures of its components. To this end, we have used a publicly existing tool called PDFFigures 2.04 (Clark and Divvala 2016) for extracting a list of figures from a scholarly paper. However, none of the existing open source tools maintain the table structure that is essential for us. Thus, we built a PDF table extraction tool using PDFMiner5 and Poppler-utils6 . Poppler-utils provide high level information about the document such as the text dump, while using PDFMiner, certain low level document details such as vertical line spacing are obtained. The table structure, along with the table caption, is retrived by building the heuristics over the horizontal and vertical line spacing. Figure and Table Classification The aim is to classify and retrive only those figures and tables in a research paper that contains a DL design flow. Futher, a fine-grained classifier is required to classify the figure into one of the identified five broad categories and classify the table as a row-major or column-major flow. In case of figures, the classifier is trained to perform the prediction using the architecture shape and the flow. For example, figures having result graphs and showing sample images from dataset has different shape compared to an architecture flow diagram. All the figures are resized to 224×224 4 https://github.com/allenai/pdffigures2 https://euske.github.io/pdfminer/ 6 https://poppler.freedesktop.org/ 5 and 4, 096 features (fc2) are extracted from a fully connected layer of a popular deep learning model VGG19 (Simonyan and Zisserman 2014) pre-trained on ImageNet dataset. We have two classification levels: (i) Coarse classifier: a binary neural network (NNet) classifier trained on fc2 features to classify if the figure contains a DL model or not, and (ii) Fine-grained classifier: a five class neural network classifier trained on fc2 features to identify the type of DL design, only for those figures classified positive by the coarse classifier. Having a sequence of two classifiers provided better performance as compared to a single classifier with six classes (sixth class being no DL design flow). In case of tables, a bag-of-words model is built using keywords from the caption text as well as the table text. A cosine distance based classifier is used to identify if there is a DL design flow in the given table as compared to tables containing results. Further based on the number of rows and columns in the table, as extracted in the previous section, the table is classified as a row-major or column-major flow. Content Extraction from Figure Content extraction from figures has two major steps: (i) Flow detection to identify the nodes and the edges, and (ii) OCR to extract the flow content. Identifying the flow is the challenges, as there is a huge variation in the type of DL design flow diagrams. In this section, we explain the details of the approach for a 2D Box type, as shown in Figure 3, while similar approach could be extended to other types, as well. Flow detection involves identifying the nodes first, followed by the edges connecting the nodes. As the image is usually of high resolution and quality, they are directly binarized using an adaptive Gaussian thresholding and a Canny edge detection approach is used to identify all the lines. An iterative region grown algorithm is adopted to identify closed countours in the figure, as they represent the nodes as shown in Figure 3(b). All the detected nodes are masked out from the figure and the contour detection algorithm is applied again to detection the edges, as shown in Figure 3(d). The direction of the edge flow is obtained by analyzing the pixel distribution within each edge contour. The node and edge contours are then sorted based on the location and direction to obtain the flow of the entire DL model design. As shown in Figure 3, the proposed approach could also handle branchings and forking in a design flow diagram. Once the flow is extracted, the text in each node/ layer is obtained through OCR using Tesseract7 .Based on our manual observation, we assume that the a layer description 7 https://github.com/tesseract-ocr/ (a) Original Image (b) Detected Layers (c) Layers Masked Out (d) Detected Edges Abstract Computational Graph { "layer_type" : "Pooling2D", "layer_name" : "MaxPool1", "layer_params" : { "function" : "MAX", "trainable" : true, "stride_row" : 2, "kernel_col" : 2, "kernel_row" : 2, "stride_col" : 2, "border_mode" : "valid" } “from_layers”: [“Conv1”] Keras Python Caffe Protobuf layer { name: "MaxPool1" type: "Pooling" bottom: "Conv1" top: "MaxPool1" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } MaxPooling2D( pool_size=(2, 2), strides=(2,2), padding='valid', name=’MaxPool1’ )(Conv1) } Figure 5: An illustration for a Pooling2D layer showing the rule base of the inference engine, converting the abstract JSON format into Caffe protobuf and Keras python code. Figure 3: Illustration of the proposed flow detection approach from complex figures (Szegedy et al. 2017) (AAAI 2017) involving (b) node/ layer detection, and (d) edge detection. Figure 4: An example table showing the DL design flow as explained in tabular format in (Parkhi et al. 2015). would be available within the detected node. A dictionary of possible DL layer names is created to perform spell correction of the extracted OCR text. Content Extraction from Table In a row major table, every row corresponds to a layer in the DL design flow, as shown in Figure 4. Similarly, in a column major table, every column corresponds to a layer along with other parameters of the layer. The layer name is extracted by matching it with a manually created dictionary. Further, the parameters are extracted by mapping the corresponding row or column header with a pre-defined list of parameter names corresponding to the layer. Thus, sequentially the entire DL design flow is extracted from a table. Generating Source Code Overall, after detecting DL design flow, an abstract computational graph is represented in JSON format, as shown in Figure 5. Two rule based converters are written to convert the abstract computational graph extracted in the previous step to either (i) Keras code (Python) or (ii) Caffe protobuf format (prototxt). An inference engine acts as the convertor to map the abstract computational graph to the grammar of the platform. The inference engine consists of a comprehensive list of templates and dictionaries built manually for both Keras and Caffe. Template based structures transfer each component from the abstract representation to a platform specific structure using the dictionary mappings. Further, another set of templates, consisting of a set of assertions, are designed for translating each layer’s parameters. Further, the inference engine is highly flexible allowing easy extension and addition of new layer definitions. An example of the inference engine’s dictionary mapping for a Pooling2D layer is shown in Figure 5. Thus for a given research paper, by processing both the figure and table content, the DL model design flow is obtained which is converted to execution ready code in both Keras and Caffe. Evaluation on Simulated Dataset The aim of this process is to simulate and generate ground truth deep learning designs and their corresponding flow visualizations figures. Thus, the proposed pipeline of DL model design could be quantitatively evaluated. To this end, we observed that both Keras and Caffe have an in-built visualization routine for a DL design model. Further both Keras and Caffe have their internal DL model validator and a visualization can be exported only when the simulated design is deemed valid by the validator. Grammar for DL Design Generation To be able to generate meaningful and valid DL design models, we manually defined a grammar for the model flow as well as for the hyper-parameters. We considered 10 unique layers for our dataset simulation - {Conv2D, MaxPool2D, AvgPool2D} for building convolution neural network like architectures, {Embed, SimpleRNN, LSTM} for building recurrent neural network like architectures, {Dense, Flatten, Dropout, Concat} as the core layers. The use of Concat enables our designed models to be non-sequential as well as with a combination of recurrent and convolution architectures. This allows us to create random, complex, and highly varying DL models. Also, RNN and LSTM layers have an additional binary parameter of return seq, which when set true returns the output of every hidden cell, otherwise, returns the output of only the last hidden cell in the layer. Table 1 explains the proposed grammar for generating DL design models. The grammar defines the set of all possible next layers for a given current layer. This is determined by the shape of the tensor flowing through each of the layer’s operation. For example, a Dense layer strictly expect the input to be a Current Layer Input Dense Conv2D Flatten Dropout MaxPool AvgPool Concat RNN RNN (seq) LSTM LSTM (seq) Dense Conv2D Flatten Dropout MaxPool AvgPool Concat Embed RNN RNN LSTM LSTM (seq) (seq) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Same as previous layer 4 4 4 4 4 4 4 4 4 4 4 4 If input is one dimensional, same as Dense layer; else same as previous layer 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Table 1: The proposed grammar for creating valid deep learning design models defining the list of possible next layers for a given current layer. Layer Dense Dropout Conv2D MaxPool AvgPool Embed SimpleRNN LSTM InputData Hyper-parameters #nodes - {[5:5:500]} probability - {[0:0.1:1]} #filters - {[16:16:256]} filter size - {[1:2:11]} stride - {[2:1:5]} filter size - {[1:2:11]} stride - {[2:1:5]} filter size - {[1:2:11]} embed size - {64, 100, 128, 200} vocab - {[10000, 20000, 50000, 75000]} #units - {[3:1:25]} #nodes - {[3:1:25]} MNIST - {28, 28, 1} CIFAR-10 - {32, 32, 3} ImageNet - {224, 224, 3} IMDB Text Table 2: The set of hyper-parameter options considered for each layer in our simulated dataset generation. The parameter value [a:b:c] means a list of values from a to c in steps of b. vector of shape n × 1. Thus, the Dense cannot appear after a Conv2D layer without the presence of a Flatten layer. The proposed grammar further includes the set of possible values for each hyper-parameter of a layer, as explained in Table 2. While hyper-parameter values beyond the defined bounds are possible, the table values indicate the assumed set of values in the model simulation process. Simulated Dataset A model simulation starts with an Input layer, where there are four possible options - MNIST, CIFAR, ImageNet, IMDBText. From the set of all possible next layers for the given Input layer, a completely random layer is decided. For the given next layer, a random value is picked for every pos- Observation #Points Naive Bayes Decision Tree Logistic Regression RDF SVM (RBF Kernel) Neural Network Train 195, 296 98.29% 100% 100% 100% 100% 100% Validation 48, 824 98.30% 99.57% 99.98% 99.72% 99.89% 99.93% Test 48, 824 98.39% 99.55% 99.99% 99.68% 99.83% 99.94% Table 3: The performance of various binary classifiers to distinguish KerasCaffeVisulizations vs. other often occuring images in research papers. sible hyper-parameter. For example, for MNIST being the input layer, Conv2D could be picked as the random next layer. Then, for Conv2D the hypar-parameters are determined randomly as 32 filters, 5 × 5 filter size with a stride of 2. The model design always ends with a Dense layer with number of nodes equal to the number of classes of the corresponding Input layer. The number of layers in between the Input layer and the final Dense layer denotes the depth of the DL model. For our simulation, we generated 3, 000 DL models for each depth varied between 5 and 40, creating a total dataset of 108, 000 models. Each model contains the Keras JSON representation, Keras image visualization, Caffe protobuf files, and Caffe image visualization, resulting in a total of 216, 000 DL model design visualizations. These models are valid by construct since they follow a well-defined grammar. However, these models need not be the best from an execution perspective, or with respect to their training performance. Figure Type Classification Performance In this experiment, a binary NNet classifier with two hidden layers of size [1024, 256] is trained on fc2 features of VGG19 model to differentiate 216, 000 simulated DL visualizations from a set of 28, 120 other kind of diagrams often available in research papers (scraped from PDF). The whole dataset is split as 60% for training, 20% validation, and 20% for testing, making it a total of 195, 296 images for training and 48, 824 images for testing. The performance of the NNet classifier is compared with six different classifiers as shown in Table 3. As it can be observed most of the classifier provide a classification accuracy of 100%, showing that from a set of figures obtained from a research paper, it would be possible to distinguish only the deep learning design flow diagrams. All the classifiers use the default parameters as provided the scikit-learn package. (a) Performance on Keras Images (ii) Edge Extraction (i) Layer Extraction 100% Computational Graph Extraction Performance (b) Performance on Caffe Images (ii) Edge Extraction (i) Layer Extraction 100% In this experiment, the performance of flow and content extraction from the 216, 000 Keras and Caffe visualizations is evaluated against the ground truth. By performing OCR, on the extracted flow, the unique layer names are obtained and two detection accuracies are reported, 93.9% 93.3% 1. blob (or layer) detection accuracy: evaluates the performance of blob detection and layers identified using OCR and is computed as the ratio of correct blobs detected per model (in percent) 2. edge detection accuracy: evaluates the performance of the detected flow and is computed as the ratio of correct arrows detected per model (in percent) Figure 6 is the box plot showing the performance for the the proposed figure extraction pipeline in both Keras and Caffe. As it can be observed, the proposed pipeline provides 100% accuracy in layer extraction and more than 93% accuracy in extracting the edges. As the edges can be curved and can be of any length, even connecting the first with the last layer, the variations caused a reduction in performance. Further details on extracting flow information Keras and Caffe visuazliation and also for additional results, kindly refer to the supplementary material. Results on Deep Learning Scholarly Papers The first 5, 000 papers were downloaded from arXiv.org using “deep learning” as the input query. 30, 987 figures were extracted from these 5, 000 downloaded papers, out of which 28, 120 figures did not contain a DL design flow while the remaining 2, 867 contained. These represent the usual figures that are found in a deep learning research paper that does not contain a design flow. Figure Type Classification Accuracy To evaluate the coarse level binary classification, a 2 hidden layer NNet was trained on the fc2 features obtained from the 30, 987 images extracted from research papers. The whole dataset is split as 60% for training, 20% validation, and 20% for testing and the results are computed for seven different classifiers as shown in Table 4. Further, to evaluate the fine level, five-class, figure type classification, the 2, 871 DL design flow diagrams were manually labelled. The distribution of figures were as follows: (i) Neurons plot: 587 figures, (ii) 2D box: 1, 204, (iii) Stacked2D box: 408, (iv) 3D box: 562, and (v) Pipeline plot: Figure 6: Box plots showing the performance accuracy of flow detection in Keras and Caffe visualizations. Observation #Points Naive Bayes Decision Tree Logistic Regression RDF SVM (RBF Kernel) Neural Network Train 18, 592 77.29% 99.96% 99.96% 99.96% 99.96% 99.96% Validation 6, 197 64.39% 76.67% 86.17% 83.72% 86.89% 87.93% Test 6, 198 62.56% 74.35% 85.27% 82.94% 85.25% 86.25% Table 4: The performance of coarse level binary classifier to distinguish DL design flow figures from other figures that usually appear in a research paper. 110. A 60 − 20 − 20 train, validation, and test split is performed to train the NNet classifier in comparison with the six other classifier to perform this five class classification. The results are table in Table 5. The results show that even on highly varying DL flow design images, identifying the type of DL flow is more than 70% accurate. For more details on the experimental analysis, please refer to the supplementary material. Crowdsourced Improvement of Extracted Designs Using the proposed DLPaper2Code framework, we extracted the DL design models for all the 5, 000 downlaoded papers. However, quantitatively evaluating the extracted design flow would be challenging due to the lack of a ground truth. Hence, we created an arXiv-like website, as shown in Figure 7, where the papers, the corresponding design, and the generated source code is available. The DL community Observation #Points Naive Bayes Decision Tree Logistic Regression RDF SVM (RBF Kernel) Neural Network Train 1, 720 40.42% 99.65% 99.65% 99.65% 99.65% 100% Validation 573 54.30% 50.57% 69.98% 68.72% 72.94% 74.93% Test 574 52.84% 49.13% 68.47% 66.02% 69.68% 71.60% Table 5: The performance of fine level, five class classifier to identify the type of DL design flow figure obtained from the research paper. Figure 8: An intuitive drag-and-drop UI based framework to edit the extracted designs and make them publicly available. Figure 7: An arXiv-like website where DL papers along with their extracted design, and generated source code in Caffe and Keras is made available. could rate the extracted designs which acts as a feedback or performance measure of our automated approach. Further, an intuitive drag-and-drop based UI framekwork is generated for the community to edit the generated DL flow design, as shown in Figure 8. Ideally the respective papers’ author or the DL community could edit the generated designs, wherever an error was found. The edited design could be further made publicly available for other researcher to reproduce their design. Further our system could generate the source code of the edited design in both Keras and Caffe, in real-time. Thus, we have a two-fold advantange through this UI system: (i) the public system could act as a one-stop repository for any DL paper and it’s corresponding design flow and source code, (ii) the feedback the community provides would enable us to continuously learn and improve the system8 . Conclusion and Discussion Thus, researchers and developers need not struggle any further in reproducing research papers in deep learning. Using this research, the DL design explained in a research paper could be automatedly extracted. Using an intuitive drag-and-drop based UI editor, that we designed as a part of this research, the extracted design could be manually 8 To adhere to the double-blind submission policy of AAAI, the system URL is not provided in this version of the paper edited and perfected. Further for an extracted DL design, the source code could be generated in Keras (Python) and Caffe (prototxt), in real-time. The proposed DLpaper2Code framework extracts both figure and table information from a research paper and converts it into source code. Currently, an arXiv-like website is created that contains the DL design and the source code for 5, 000 research papers. To evaluate our approach, we simulated a dataset of 108, 000 unique deep learning designs validated by a proposed grammar and their corresponding Keras and Caffe visualizations. On a total dataset of 216, 000 deep learning model visualization diagrams and 28, 120 diagrams that appeared in deep learning research papers and did not contains a model visualization, the proposed binary classification using NNet classifier obtained 99.9% accuracy. The performance of extracting the generic computational graph figures using the proposed pipeline is more than 93%. While this research could have a high impact in the reproducibility of DL research, we have planned for plenty of possible extensions for the proposed pipeline: 1. The proposed pipeline detects only the layers (blobs) and the edges from the diagram. It could be extended to detect and extract the hyper-parameter values of each layer, to make the computational graph more content rich. 2. Currently, we have two independent pipelines for generating abstract computational graphs from tables and figures. Combining the information obtained from the multimodal sources could enhance the accuracy of the extracted DL design flow. 3. The entire DLPaper2Code framework could be extended to support additional libraries, apart from Keras and Caffe, such as Torch, Tensorflow etc. 4. The broader aim would be to propose a definition of representating DL model design in research papers, achieving uniformity and better readibility. Further, authors of future papers could also release their design in the created website for easy accessibility to the community. References Abadi, M.; Agarwal, A.; Barham, P.; Brevdo, E.; Chen, Z.; Citro, C.; Corrado, G. S.; Davis, A.; Dean, J.; Devin, M.; et al. 2016. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467. Bastien, F.; Lamblin, P.; Pascanu, R.; Bergstra, J.; and Goodfellow, I. J. e. a. 2012. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop. Chen, T. e. a. 2015. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274. Chintala, S. 2016. Pytorch. https://github.com/ pytorch/pytorch. Chollet, F., et al. 2015. Keras. https://github.com/ fchollet/keras. Choudhury, S. R., and Giles, C. L. 2015. An architecture for information extraction from figures in digital libraries. In WWW (Companion Volume), 667–672. Clark, C., and Divvala, S. 2016. Pdffigures 2.0: Mining figures from research papers. In Digital Libraries (JCDL), 2016 IEEE/ACM Joint Conference on, 143–152. Dieleman, S. 2015. Lasagne: First release. Donahue, J.; Anne Hendricks, L.; Guadarrama, S.; Rohrbach, M.; Venugopalan, S.; Saenko, K.; and Darrell, T. 2015. Long-term recurrent convolutional networks for visual recognition and description. In Computer vision and pattern recognition, 2625–2634. et al, R. C. 2011. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop. Gibson, A. 2015. Dl4j. https://github.com/ deeplearning4j/deeplearning4j. Jia, Y.; Shelhamer, E.; Donahue, J.; Karayev, S.; Long, J.; Girshick, R.; Guadarrama, S.; and Darrell, T. 2014. Caffe: Convolutional architecture for fast feature embedding. In ACM international conference on Multimedia, 675–678. Karpathy, A., and Fei-Fei, L. 2015. Deep visual-semantic alignments for generating image descriptions. In Computer Vision and Pattern Recognition, 3128–3137. Parkhi, O. M.; Vedaldi, A.; Zisserman, A.; et al. 2015. Deep face recognition. In BMVC, volume 1, 6. Sankaran, A.; Aralikatte, R.; Mani, S.; Khare, S.; Panwar, N.; and Gantayat, N. 2011. DARVIZ: Deep abstract representation, visualization, and verification of deep learning models: Nier track. In International Conference on Software Engineering, 804–807. Seide, F., and Agarwal, A. 2016. Cntk: Microsoft’s open-source deep-learning toolkit. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, 2135–2135. New York, NY, USA: ACM. Simonyan, K., and Zisserman, A. 2014. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Springenberg, J. T.; Dosovitskiy, A.; Brox, T.; and Riedmiller, M. 2014. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806. Szegedy, C.; Ioffe, S.; Vanhoucke, V.; and Alemi, A. A. 2017. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, 4278–4284. Vinyals, O.; Toshev, A.; Bengio, S.; and Erhan, D. 2015. Show and tell: A neural image caption generator. In Computer Vision and Pattern Recognition, 3156–3164.
2cs.AI
Language Oriented Modularity: From Theory to Practice Arik Hadasa and David H. Lorenza,b * a Open University of Israel b Technion—Israel Institute of Technology Abstract Language-oriented modularity (LOM) is a methodology that complements language-oriented programming (LOP) in providing on-demand language abstraction solutions during software development. It involves the implementation and immediate utilization of domain-specific languages (DSLs) that are also aspect-oriented (DSALs). However, while DSL development is affordable thanks to modern language workbenches, DSAL development lacks similar tool support. Consequently, LOM is often impractical and underutilized. A challenge for LOM is making the complexity of implementing DSALs comparable to that of DSLs and the effectiveness of programming with DSALs comparable to that of general-purpose aspect languages (GPALs). Today, despite being essentially both domain-specific and aspect-oriented, DSALs seem to be second-class. AspectJ development tools do not work on DSAL code. Language workbenches neither deal with the backend weaving nor handle the composition of DSALs. DSAL composition frameworks do not provide front-end development tools. DSAL code transformation approaches do not preserve the semantics of DSAL programs in the presence of other aspect languages. To address this challenge we extend AspectJ with a small set of annotations and interfaces that allows DSAL designers to define a semantic-preserving transformation to AspectJ. We present a transformation approach that enables the use of a standard language workbench to implement DSALs and the use of standard aspect development tools to program with these DSALs. With our approach, DSALs regain their first-class status with respect to both DSLs and aspect languages. This, on the one hand, lowers the cost of developing DSALs to the level of DSLs and, on the other hand, raises the effectiveness of using a DSAL to the level of a GPAL. Consequently, LOM becomes cost-effective compared to the LOP baseline. As validation, we modified the ajc compiler to support our approach and used it as back-end for two different language workbenches. With Spoofax we implemented Cool to demonstrate that the non-trivial composition of AspectJ and Cool can be accommodated using our approach. With Xtext we applied LOM to crosscutting concerns in two open source projects (oVirt and muCommander), implementing in the process application-specific DSALs, thus providing a sense of the decrease in the cost of developing composable DSALs and the increase in the effectiveness of programming with them. Crosscutting concerns remain a problem in modern real-world projects (e.g., as observed in oVirt). DSALs are often the right tool for addressing these concerns. Our work makes LOM practical, thus facilitating the use of DSAL solutions in the software development process. ACM CCS 2012 Software and its engineering → Software development techniques; Development frameworks and environments; Keywords Domain-specific languages (DSLs), Aspect-oriented programming (AOP), Language-oriented programming (LOP) The Art, Science, and Engineering of Programming Submitted December 1, 2016 Published April 1, 2017 doi 10.22152/programming-journal.org/2017/1/10 © Arik Hadas and David H. Lorenz This work is licensed under a “CC BY 4.0” license. In The Art, Science, and Engineering of Programming, vol. 1, no. 2, 2017, article 10; 37 pages. Language Oriented Modularity: From Theory to Practice 1 Introduction Language Oriented Modularity (LOM) [32], taking after Language Oriented Programming (LOP) [40, 8], is a programming methodology that involves the development and use of Domain Specific Aspect Languages (DSALs) [11] on-demand during the software modularization process. A DSAL is a programming language that is both domain-specific and aspect-oriented. It provides not only domain-specific abstractions and notations like a Domain Specific Language (DSL) does, but also a modularization mechanism for the separation of domain-specific crosscutting concerns. 1.1 LOM in Theory In principle, LOM is a special case of LOP, applied to DSALs rather than DSLs. 1 Like LOP, LOM works middle-out. One starts with defining the DSALs and then works outwards, combining high level programming with these DSALs in parallel to their low level implementation. DSALs, like their DSL counterparts, simplify the definition of (crosscutting) domain logic. Moreover, DSALs also simplify the modularization mechanism programmers need to understand (which often makes general-purpose aspect languages (GPALs) more complex to use than the language they extend). LOM is especially relevant to DSAL-based software development because, in contrast to DSLs, DSALs tend to be tightly coupled with the program for which they were designed. This coupling comes in two forms. First, the weaving specification may rely on the structure of the base code. Second, the crosscutting logic may rely on data retrieved from the base code. This creates a tight coupling between the DSAL code and the representation of the data within the base program. The more coupled the DSAL is with the base code, the less likely it could be reused across applications, thus encouraging ad-hoc application-specific implementation of DSALs [23]. 1.2 LOM in Practice In practice, however, LOM is not cost-effective like LOP due to the lack (or incompatibility) of supportive development tools. In terms of cost, language workbenches [13] for LOP, such as Xtext [9], MPS [4], Spoofax [26], and Cedalion [35], provide the language designer with a development environment for creating with reasonable effort new DSLs. But these workbenches are not used for LOM because of the inability to express a semantics-preserving transformation of DSALs to existing GPALs [28] (Section 3.2). In terms of effectiveness, language workbenches provide the end-programmer with high quality editing tools for up-to-speed programming with the new DSLs [14]. In contrast, DSALs typically lack similar editing tools and GPAL development tools generally break * Work done in part while visiting the Faculty of Computer Science, Technion—Israel Institute of Technology. 1 Unless stated otherwise, we use the term DSL to mean ordinary (non aspect-oriented) domain-specific language rather than its broader meaning which includes DSALs. 10-2 A. Hadas and D. H. Lorenz on DSAL code. Thus the language development and programming experience with DSALs is neither on a par with DSLs nor on a par with GPALs. 1.3 Contribution This work addresses two key challenges that hinder LOM adoption in practice [24, 18, 20]. The first challenge is making DSALs first-class DSLs (in the broader sense). By this we refer to the availability of language workbenches for creating DSALs. The second challenge is making newly created DSALs first-class aspect languages. By this we refer to the availability of development tools for programming with DSALs that are normally available when programming with a GPAL. For instance, when one creates a DSAL for a Java [1] application one may expect it to work “out of the box” not only with Java, AspectJ [27], and other DSALs, but also with Eclipse and the AspectJ Development Tools (AJDT) [6]. Specifically, we contribute an approach in which DSALs can be implemented like DSLs by transformation to a GPAL (annotated with metadata), without needing to change the compiler (weaver) every time a new DSAL is introduced. This provides an alternative to aspect composition frameworks that do require writing compiler code as a part of the DSAL implementation. Making DSAL development more like DSL development allows us to leverage LOP tools for LOM and push down the cost of LOM closer to the LOP baseline. With relatively minor adjustments to GPAL tools, our approach allows us to edit, browse, and compile DSAL code as if it were GPAL code, thus bringing also the effectiveness of LOM closer to LOP [17]. We illustrate our approach concretely with AspectJ. By extending AspectJ with a set of annotations and interfaces, we get a target language for DSALs that brings the costeffectiveness of the LOM process to the level of LOP. We minimize the additional cost needed to develop DSALs, compared to DSLs, by enabling the use of standard language workbenches also for DSALs. We make programming with DSALs more effective by enabling the use of development tools for AspectJ also for DSALs. Consequently, LOM becomes almost as cost-effective as LOP [19]. 1.4 Outline Section 2 motivates by example the need for LOM and the need for defining ondemand DSALs, and explains the difficulty today in applying LOM in practice. Section 3 presents our approach and the key technical idea that enables us to use a GPAL as the target language in ordinary language workbenches. Section 4 describes a concrete implementation of this approach via a set of annotations for AspectJ. The annotations are used for surrendering some obliviousness in return for more control over the visibility of join points and the ordering of advice, and for interfacing with AJDT. In Section 5 we evaluate the improved cost-effectiveness that is achieved by our approach, and apply LOM to crosscutting concerns found in two real-world open source projects. 10-3 Language Oriented Modularity: From Theory to Practice Listing 1 Core methods of the FileJob class 1 public abstract class FileJob implements ,→ Runnable { 2 public FileJob(MainFrame mainFrame, ,→ FileSet files); 3 public void start(); 4 public final void run(); 5 protected abstract boolean ,→ processFile(AbstractFile file, Object ,→ recurseParams); 6 public void interrupt(); 7 public void setPaused(boolean paused); 8 } 2 Figure 1 State diagram for a file operation (job) Motivation To illustrate the LOM process and the need for creating DSALs on-demand, let us consider the task of extending a lightweight, cross-platform, open source file manager written in Java, called muCommander,2 with a mechanism for auditing file operations. 2.1 About muCommander The muCommander file manager supports various operations on files, such as copy, rename and packing, via a dual-pane interface. File operations in muCommander are implemented according to the Command design pattern [15]. Each operation, called job in the terminology of muCommander, is encapsulated within a class that extends the abstract class FileJob. Listing 1 depicts the core methods of the FileJob class. Its constructor receives a set of files on which to operate and the dialog from which the operation was triggered. By calling the start method, the logic in the run method is executed in a separate thread (hence why FileJob implements the Runnable interface). The abstract method processFile is called by the run method for each file, and needs to be implemented by subclasses with operation-specific logic. The interrupt method stops the execution of a job. Lastly, the setPaused method receives a boolean argument paused, and accordingly either pauses or resumes the execution of the job. Figure 1 depicts the permitted state transitions of a job. Initially the state of the job is not_started. This state is changed to running once the job starts executing, and is changed to finished upon completion. If the execution of the job is interrupted (due to an error or by a user request) the state is changed to interrupted. If the user asks to pause a job, its state is changed to paused. A job that is paused can be either resumed and then its state is changed back to running or interrupted and then its state is changed to interrupted. 2 http://www.mucommander.com 10-4 A. Hadas and D. H. Lorenz Listing 2 Aspect with advice per job 1 public privileged aspect Logs { 2 pointcut start() : execution(void start()); 3 after(CopyJob job): start() && this(job) { audit(Messages.COPY_STARTED, /* ...skipped... */ ); } 4 after(MkdirJob job): start() && this(job) { /* ...skipped... */ } 5 //... more advice for all combinations of state transitions and job types ... 6 } 2.2 Implementation Strategies There are several approaches for implementing a mechanism that audits which jobs were executed in muCommander (including their life-cycle and state transitions). Java One way is to implement the audit concern in Java. This can be done by extending FileJob with a method for each transition, which concrete job classes could override in order to generate the appropriate messages, and by adding code that persists these messages to the relevant places in FileJob. The drawback of this approach is that it degrades code modularity as the generation of the messages becomes scattered across the job classes and the persistence of these messages becomes tangled among other concerns in FileJob. Another option is AspectJ. Both the generation and the persistence of the messages can be placed within an aspect, separated from the existing code. Listing 2 presents an aspect with an advice that audits the execution of CopyJob (line 3), which copies files from one directory to another. This advice invokes the audit method with the message type Messages.copy_started and the arguments it needs. The audit method then retrieves a translated string of the message and places the given values in the right locations to produce a message of the form, e.g., “start copying 2 files from /home/ to /tmp/ ([/home/a.pdf, /home/b.pdf])”. The Logs aspect in Listing 2 may seem simple enough, however, there are two issues with using such an aspect in real-world projects. First, it requires all developers in the project to program in AspectJ since new advice needs to be added for every new job. Second, as more jobs are added more pieces of advice are added. That leads to high amount of code duplication and a larger code base that is harder to understand. Note that while putting the common code in an abstract aspect and extending the aspect per job class is an option, it would typically make the process of adding a new job more cumbersome [10]. In order for developers who add jobs not to have to be familiar with AspectJ, one could introduce a single advice per transition instead of having an advice per job class. Inside the body of the advice, the concrete type of the job can be identified and the message type and its values determined accordingly. Developers would only need to modify the body of the advice to change existing audit messages or to add new ones. However, as more jobs are added to the Logs aspect, the attractiveness of this approach decreases. Listing 3 depicts the Logs aspect with auditing for CopyJob and AspectJ 10-5 Language Oriented Modularity: From Theory to Practice Listing 3 Aspect with advice per state transition 1 public privileged aspect Logs { 2 pointcut start() : execution(void start()); 3 after(FileJob job): start() && this(job) { 4 if (job instanceof CopyJob) 5 audit(Message.COPY_STARTED, /* ... skipped ... */ ); 6 else if (job instanceof MkdirJob) 7 if (job.mkfileMode) 8 audit(Message.MKFILE_STARTED, job.files); 9 else 10 audit(Message.MKDIR_STARTED, job.files); 11 //... handle the 'start' transition of other job types ... 12 } 13 //... more advice for other state transitions ... 14 } MkdirJob. The MkdirJob class contains a field named mkfileMode that determines whether a file or a directory should be created. Since different audit messages are defined for these two cases, this field is checked by the Logs aspect (line 7). As more jobs are being audited and as the resolution of the concrete message to be produced gets more complicated, the Logs aspect becomes tangled and harder to maintain. DSAL Reuse One can consider using an off-the-shelf third-party DSAL or reusing a DSAL developed for a similar application, like the one we have implemented for auditing in oVirt,3 called oVirtAudit [22] (Section 5.2.1). The oVirt platform and the muCommander tool differ in many ways. The former is for virtualization management while the latter is a file manager. The former is a distributed client-server application while the latter is standalone. Lastly, the former is intended for enterprise organizations while the latter is intended for home users. Nevertheless, they both are written in Java, following the Command design pattern, and have operations (called commands in the terminology of oVirt) that need to be audited. It is thus tempting to reuse oVirtAudit in muCommander. However, one quickly discovers that oVirtAudit is not suitable for muCommander. First, the syntax of oVirtAudit does not fit. For example, commands in oVirt cannot be paused and thus oVirtAudit does not provide the syntactic constructs to define a message for an operation that is being paused or resumed. Second, the semantics is different. For example, in oVirtAudit the values placed in the audit messages are taken from method return values while in muCommander they need to be taken from instance variables. Third, the weaving location is different. For example, the advice that produces a message for commands in oVirt that start executing is woven into a method that is not called start and is not located within a class named FileJob. 3 http://www.ovirt.org 10-6 A. Hadas and D. H. Lorenz Listing 4 Auditing two file jobs in muCommander using muAudit 1 logs for com.mucommander.job.impl.CopyJob: 2 case start log COPY_STARTED with nbFiles baseSourceFolder baseDestFolder files 3 case finish log COPY_FINISHED with nbFiles baseSourceFolder baseDestFolder 4 case interrupt log COPY_INTERRUPTED with baseSourceFolder baseDestFolder 5 case pause log COPY_PAUSED with baseSourceFolder baseDestFolder nbProcessedFiles 6 case resume log COPY_RESUMED with baseSourceFolder baseDestFolder; 7 8 logs for com.mucommander.job.impl.MkdirJob: 9 case start & mkfileMode log MKFile_STARTED with files 10 case start log MKDIR_STARTED with files 11 case finish & mkfileMode log MKFile_FINISHED with files 12 case finish log MKDIR_FINISHED with files 13 case interrupt & mkfileMode log MKFile_INTERRUPTED with files 14 case interrupt log MKDIR_INTERRUPTED with files 15 case pause & mkfileMode log MKFile_PAUSED with files 16 case pause log MKDIR_PAUSED with files 17 case resume & mkfileMode log MKFile_RESUMED with files 18 case resume log MKDIR_RESUMED with files; New DSAL Listing 4 displays the auditing definitions for CopyJob and MkdirJob in muAudit—a simple DSAL we can introduce to allow one to define audit messages in the form of configuration-like case statements. The case statements are matched top-down, i.e., the order in which they appear is significant. The first part of each case statement specifies which condition to match based on the job state transition (e.g., start) and the values of fields within the job class. The second part defines the message to be produced. This includes the message type (e.g., copy_started) and the values of fields within the job class. Clearly, muAudit is a declarative and concise way to express the auditing concern. The question is how does one go about creating this DSAL? 2.3 Current LOM Solutions Now that we have established the need to create our own DSAL—muAudit—the supportive development tools are put to the test. We review the support that is currently available for the LOM process with respect to five capabilities (Table 1): 1. DSAL interoperability: the ability to define DSALs that can be safely used along with other DSALs; 2. Development process: the ability to develop DSALs without requiring compiler (weaver) modifications; 3. Editing tools: the ability to produce general editing tools for programming with the DSAL; 4. Aspect development tools: the ability to present advice-join-point relationships when browsing the DSAL code; and 5. Compilation: the ability to compile DSAL code from the command line. 10-7 Language Oriented Modularity: From Theory to Practice Language Support CF Domainspecific Ø Aspectoriented DSAL interoperability Development process Editing tools Aspect development tools Compilation LW+ GPAL Ø Ø LW+ CF Practical LOM Ø Ø Ø Ø Ø Ø Ø Table 1 Comparison of tool support for LOM One can implement a DSAL like muAudit with an aspect composition framework such as Awesome [29]. Composition frameworks focus on the implementation of the weaving semantics for DSALs [30]. However, they neither generate general editing tools nor provide the desired browsing and compilation capabilities. Moreover, the need to use compiler development techniques (e.g., bytecode manipulation) results in a highly complex and inefficient development process in terms of LOM. Composition Framework (CF) Language Workbench + General Purpose Aspect Language (LW+GPAL) One may try to implement muAudit using a language workbench. Indeed, the grammar of the DSAL can be defined, and general editing tools can be generated. The natural choice would then be to implement a transformation from that DSAL to a GPAL. This way, we would achieve a DSL-like development process for DSALs. However, a simple transformation of DSALs into a GPAL does not preserve the structure of the code and therefore, in the presence of aspects, does not preserve the meaning of the program. For instance, when the AJAuditor aspect in Listing 5 is used along with the Logs aspect in Listing 7, it will unintentionally expose the executions of the audit method that does not exist in the original muAudit code (Listing 4). Such exposure of internal implementation details may result in incorrect behavior of the generated code, e.g., even deadlock [28].4 Without a transformation, using a language workbench for the development of DSALs is not a viable option. Other than the inability to define the weaving semantics of DSALs, language workbenches also provide neither the desired browsing 5 or debugging capabilities (e.g., lack the original source code location), nor the necessary standalone compilation capabilities. Language Workbench + Composition Framework (LW+CF) In a sense, language workbenches and composition frameworks are complementary tools. One may consider a simple composition of the two. An efficient way to implement the DSAL would then be to parse it with the language workbench and transform it into the form expected by the composition framework. The expected benefits are: (a) general editing tools Preventing all generated methods (like audit) from being advised by modifying all other aspects (like AJAuditor) is impractical, and sometimes impossible in real-world projects. 5 Browsing capabilities are provided only for the generated GPAL code. 4 10-8 A. Hadas and D. H. Lorenz Listing 5 Aspect for auditing method executions 1 public aspect AJAuditor { 2 before(): call(* *(..)) && !cflow(within(AJAuditor)) { log("ENTER", thisJoinPoint); } 3 //... skipped ... 4 } are generated by the language workbench; and (b) the DSAL weaving semantics are implemented with a composition framework. Yet, this approach leaves much to be desired [18]. First, it provides browsing capabilities for neither the DSAL code nor the generated code. Second, the need to transform DSAL code before passing it to the composition framework hinders standalone compilation. Third, the development process is highly complex and inefficient due to the need to write compiler code. 2.4 Practical LOM In order to improve the cost-effectiveness of LOM, we seek a solution that supports all the capabilities listed in Table 1. With a first-class development process and DSAL interoperability, the cost of developing DSALs in the context of LOM would become comparable to that of DSLs in LOP. With first-class tools for editing, for aspect development, and for compilation of DSALs, the effectiveness of these DSALs relative to GPALs would become comparable to that of DSLs relative to general-purpose languages in LOP. Ideally, the best practical solution would be to use, when possible, standard language workbenches available for LOP (e.g., Spoofax or Xtext) and standard development tools available for GPALs (e.g., AJDT). 3 Approach In pursuing LOM practicality, LOP is our baseline for comparing cost-effectiveness. In LOP, the cost of DSLs is low thanks to language workbenches (sometimes considered the killer-app for DSLs [13]). Language workbenches enable efficient implementation of DSLs via transformation. Developing a new DSL with a language workbench amounts to writing a transformer (generator) from that DSL to a GPL, and writing a transformer is much easier than writing a compiler or an interpreter. A language workbench also provides tool support for implementing the transformation and for effective editing of DSL code. Once the DSL code is transformed, it is compiled with the GPL’s compiler into an executable form, allowing all development tools that are available for the GPL to be used effectively. To make LOM more practical we facilitate a similar approach to the implementation of DSALs by transforming DSAL code to annotated GPAL code. 10-9 Language Oriented Modularity: From Theory to Practice 3.1 Rationale Implementing DSALs by defining transformations rather than coding their weaving semantics is key to making DSAL creation first-class. First, writing a transformer is much easier than writing a weaver. It eliminates the need to implement a weaver plugin per DSAL, a task that imposes a significant complexity in composition frameworks. Second, when a (semantic-preserving) transformation is possible, the LOM software development process becomes similar to that of LOP and can be completed using existing language workbenches. Indeed, with the Spoofax [26] language workbench one can create for some DSAL an Eclipse plugin that provides editing capabilities (text-highlighting, auto-completion, error-checking, etc.) for writing aspects in that DSAL. Spoofax can also assist in defining a transformation of aspects written in the DSAL into, e.g., AspectJ. Using a GPAL as the target language is key to also making DSAL development firstclass. The transformation of DSALs into a GPAL allows DSAL programmers to leverage, with a one-time adjustment, development tools that exist for the GPAL. These tools work with the transformed code, and the adjustments required for them to provide browsing, navigation, and compilation capabilities for the DSALs are relatively minor. 3.2 Pitfalls Unfortunately, a naive transformation to a GPAL does not work in general. Consider AspectJ as the target language for multiple DSALs. As shown elsewhere [33] translating aspects from different DSALs into aspects in AspectJ and compiling them with the AspectJ compiler (ajc) may yield incorrect behavior (semantic gap). A DSAL for which the transformation to AspectJ is not semantic-preserving becomes a second-class DSL. Meanwhile, trying to fix this by using a different target language and you may lose the prospects of using AJDT for your DSALs (abstraction gap), thus becoming perhaps first-class DSL but second-class aspect language. Semantic Gap Obliviousness [12] has traditionally been an uncompromising principle in AspectJ. However, in the context of code transformations, complete obliviousness is disadvantageous. In AspectJ the base code cannot refuse advisement (prevent join points from being advised). Consequently, a code transformation that does not preserve the join point “fingerprint” of the original code is not necessarily semantic-preserving in the presence of foreign aspect code (cross-DSAL foreign advising [33]). Another difficulty is weaving pieces of advice written in different DSALs at the same join point shadow (multi-DSAL co-advising [33]). A conflict occurs when the various pieces of advice are woven in the wrong order. AspectJ provides some control over the ordering of advice by declaring precedence between aspects (via the declare precedence statement). However, for programming with multiple DSALs one may need a finer grained ordering mechanism. Abstraction Gap Development tools for aspect languages heavily rely on the representation of advice-join-point relationships in order to annotate the source code 10-10 A. Hadas and D. H. Lorenz with hints on how aspects are to be woven into the base code. However, code that is generated from DSAL code loses track of the location of advice in the original DSAL code. Consequently, development tools cannot annotate the code, thus hindering effective programming with the DSAL. In addition, the ability to compile the software from the command line is of a particular interest in real-world projects because of the use of modern tools for continuous integration and continuous delivery. The fact that ajc cannot take DSAL code as input, requires one to modify the compilation process significantly in order to compile the software from the command line. 3.3 Bridging the Gap With Metadata We use metadata to weaken AspectJ in terms of obliviousness, strengthen it in terms of advice ordering, and enhance it in terms of bridging source code locations. The metadata is in the form of Java annotations and an interface for invoking transformations. Semantic Gap To bridge the semantic gap, a subset of the annotations control the visibility of join points, thus allowing the definition of the transformation to specify where to suppress join point shadows (foreign advising). Another annotation controls the order in which pieces of advice from different DSALs are activated at the same join point shadow (co-advising). Abstraction Gap To bridge the abstraction gap, metadata can be attached within an annotation, enabling AJDT to provide first-class browsing and navigation capabilities for DSALs. Additionally, DSAL code transformation plugins that implement a special interface are invoked automatically by the compiler in order to provide first-class compilation for DSALs. 4 Implementation We have implemented our approach by modifying the AspectJ compiler (ajc). Our modifications to ajc are both: Optional - when not in use, the compiler’s behavior is unaffected, thus preserving the correctness of the weaving in ajc before the change; and Minimal - we do the minimal changes necessary to support our extensions, thus we expect the process of reapplying these changes to a newer version of the compiler to be relatively straightforward. The code changes made to ajc are available at https://github.com/OpenUniversity/ajc and listed in part in Appendix A. 10-11 Language Oriented Modularity: From Theory to Practice Listing 6 @Hide annotations added to AspectJ 1 2 3 4 5 6 7 8 9 10 11 12 @Target(ElementType.FIELD) public @interface HideField { FieldJoinpoint[] joinpoints() default { FieldJoinpoint.SET, FieldJoinpoint.GET }; } @Target(ElementType.METHOD) public @interface HideMethod { MethodJoinpoint[] joinpoints() default { MethodJoinpoint.CALL, MethodJoinpoint.EXECUTION, ,→ MethodJoinpoint.WITHIN }; } @Target(ElementType.TYPE) public @interface HideType { TypeJoinpoint[] joinpoints() default { TypeJoinpoint.PRE_INIT, TypeJoinpoint.INIT, ,→ TypeJoinpoint.STATIC_INIT, TypeJoinpoint.WITHIN_INIT, ,→ TypeJoinpoint.WITHIN_STATIC_INIT }; } 4.1 Forgoing Complete Obliviousness Listing 6 defines a set of @Hide annotations for our target language that can be placed on a code element to suppress join point shadows associated with that element: @HideField conceals join point shadows associated with a specific field. By default shadows of both field-set and field-get are hidden, but this can be overridden to be any subset of them. @HideMethod conceals join point shadows associated with a specific method. This includes ordinary methods and advice. By default shadows of method/advice-execution, method-call and all join points that are declared within the method are hidden, but this can be overridden to be any subset of them. @HideType conceals join point shadows associated with the initialization of a type. By default shadows of instance pre-initialization, instance initialization, class staticinitialization, join points declared within instance initialization, and join points declared within static-initialization are hidden, but this can be overridden to be any subset of them. These @Hide annotations are useful when generating AspectJ from DSAL code in order to hide artificial join point shadows in the generated code that do not exist in the original code. Listing 7 illustrates the use of two such annotations (lines 1 and 11). The support for @Hide annotations is added to ajc by modifying the BcelClassWeaver class, which is responsible for the weaving logic. The decision whether or not to extract a join point is made after inspecting the @Hide annotation, provided that such an annotation exists on the program element with which the join point is associated. For instance, let us consider method- and advice-execution and join points within a method or advice (Listing 14). When inspecting a LazyMethodGen (which represents an ordinary method or advice), we check for a @HideMethod annotation. If one exists, we retrieve the kind of join points to be hidden. In case of MethodJoinpoint.execution, we skip matching against the method/advice shadows. In case of MethodJoinpoint.within, 10-12 A. Hadas and D. H. Lorenz Listing 7 Generated aspect from code written in muAudit 1 @HideType 2 public privileged aspect Logs { 3 @BridgedSourceLocation(line=1, ,→ file="/mucommander/src/main/java/com/mucommander/job/jobs.audit", ,→ module="jobs.audit") 4 after(com.mucommander.job.impl.CopyJob job): execution(void start()) && this(job) { 5 if (true) { 6 audit("start copying {0} files from {1} to {2} ({3})", job.nbFiles, job.baseSourceFolder, ,→ job.baseDestFolder, job.files); 7 return; 8 } 9 } 10 //... skipped ... 11 @HideMethod 12 private void audit(String msg, Object... args) { 13 //... skipped ... 14 } 15 } Listing 8 @Order annotation added to AspectJ 1 public @interface Order { 2 double value(); 3 } we skip matching against the join point shadows within the method/advice body. But if the method/advice is not annotated with @HideMethod, we skip nothing. 4.2 Fine-Grained Advice Ordering Listing 8 defines the @Order annotation for ordering pieces of advice per advice rather than per aspect. The annotation contains a value of type double that represents the precedence of the annotated advice. The lower this value is, the higher the precedence is. The support for @Order annotations is added to ajc by modifying the compareTo method in the BcelAdvice class, which is used to compare pieces of advice (Listing 15). When the advice at hand and the advice with which it is being compared to both have an @Order annotation, the values specified are compared. Otherwise, the comparison defaults to the regular aspect precedence criteria. 4.3 Redirect Advice-Join-Point Relations to DSAL Code In order to leverage the browsing and navigation capabilities of AJDT also for programming with DSALs, the @BridgedSourceLocation annotation is set during the transformation of DSAL code to preserve the source location of advice in the original 10-13 Language Oriented Modularity: From Theory to Practice Listing 9 @BridgedSourceLocation annotation that was added to AspectJ 1 public @interface BridgedSourceLocation { 2 public String file(); 3 public int line(); 4 public String module(); 5 } Listing 10 Advice in an aspect that was generated from code written in muAudit 1 @BridgedSourceLocation(line=9, ,→ file="/mucommander/src/main/java/com/mucommander/job/jobs.audit", ,→ module="jobs.audit") 2 after(com.mucommander.job.impl.MkdirJob job): execution(void start()) && this(job) { 3 //... skipped ... 4 } DSAL code. The @BridgedSourceLocation annotation (Listing 9) cites a path to a DSAL source code file, a line number, and a module name. When the advice-join-point relationship mapping is returned by the weaver, the source location pointed to by the @BridgedSourceLocation annotation is used instead of the actual location of the advice. This way AJDT markers are shown on the DSAL code and the DSAL code is referred to by markers on advised join points. Listing 10 shows an example where @BridgedSourceLocation is used. An aspect generated from code written in muAudit specifies that the original source location of after-execution advice (line 2) is line 9 in the file /mucommander/src/main/java/com/mucommander/job/jobs.audit within the jobs.audit module. AJDT uses this information to present the advises marker at the right location in the DSAL code and the advised-by markers at the locations at which the advice is to be woven (Fig. 2). The support for the @BridgedSourceLocation annotation is added to ajc by modifying the AsmRelationshipProvider class to retrieve the source location of advice from @BridgedSourceLocation. The main change done to this class is modifying the getHandle method to retrieve the @BridgedSourceLocation that annotates the given advice and, if it exists, to return a handle based on the file path and line number it specifies (Listing 16). 4.4 Internal Transformation of DSAL Code In order to compile DSAL code from the command line like ordinary AspectJ code, we require all DSAL-specific transformations to implement an interface called Transformation (Listing 11). This interface declares two methods: the extension method returns the file extension of source files that need to be transformed; and the convert2java method returns a file containing code generated by the transformation of the DSAL code found within the given file. An implementation of the Transformation interface enables the compiler to process DSAL code directly. In particular, DSAL code can be compiled from the command 10-14 A. Hadas and D. H. Lorenz Listing 11 The Transformation interface for DSAL code transformation 1 public interface Transformation { 2 String extension(); 3 File convert2java(File input) throws Exception; 4 } Listing 12 Implementation of the Transformation interface for muAudit 1 public class Main implements Transformation { 2 public static void main(String[] args) { /* ... skipped ... */ } 3 //... skipped ... 4 @Override 5 public File convert2java(File input) throws Exception { 6 Main.main(new String[] { input.getPath() }); 7 return new File("src−gen/com/mucommander/job/Logs.aj"); 8 } 9 @Override 10 public String extension() { return "audit"; } 11 } line. The compiler invokes the transformation of DSAL code internally. Listing 12 demonstrates the implementation for muAudit. The extension method returns audit as the extension of muAudit source code files (line 10), and the convert2java method calls the transformation of muAudit (line 6) and returns the output file (line 7). The support for Transformation plugins is added to ajc by modifying the classes AjBuildConfig, ConfigParser, and AjBuildManager. We implemented a pluggable mechanism that uses concrete implementations of Transformation for internal code transformations. First, AjBuildConfig loads all concrete transformations that are specified in a file called dsals.txt. Then ConfigParser uses the extension method of a loaded transformation in order not to filter out DSAL source files. Just before the compilation process, AjBuildManager transforms the DSAL source files using the loaded transformations (Listing 17). 4.5 Discussion Our approach is based on a transformation of DSALs into a language that extends a GPAL. However, the choice of GPAL is significant. While many of the crosscutting concerns found in real-world projects can be resolved by DSALs whose weaving semantics can be expressed in AspectJ and its join point model, there may be some that are not. Although the join point model of AspectJ could also be extended on-demand, this would likely require much more effort and reduce the cost-effectiveness of the approach. Thus, we intentionally do not consider DSALs that cannot be expressed in AspectJ, but argue that this is a reasonable choice in practice (Section 5). The design of the @Hide and @Order annotations is based on the classification of multi-DSAL conflicts as foreign- and co- advising [30], and mimics the solution 10-15 Language Oriented Modularity: From Theory to Practice provided by the Awesome composition framework. Nevertheless, our approach is not limited to these particular annotations. The specification of the proposed annotations can be enhanced and even completely replaced with alternative metadata that one can use to resolve multi-DSAL conflicts. Our approach will work as long as the conflict resolution can be specified declaratively and generated during the transformation of DSAL code (with reasonable effort), and as long as it does not impose changes that break the compatibility with the GPAL tools and does not require writing compiler code per DSAL. It is up to the language designer to determine which shadows to hide using the @Hide annotations. Generally, one would want to hide shadows of join points that do not appear in the DSAL code (as these may be considered an internal implementation detail). The @BridgedSourceLocation is supposed to be set on every advice in order to present AJDT markers at the right locations for the end-programmer. The more delicate use is that of the @Order annotation since the value assigned in the transformation of one DSAL is affected by values assigned in the transformations of other DSALs. Obviously, the @Order annotation allows a finer-grained ordering than AspectJ and the use of values of type double allows us, theoretically, to introduce right values for newly introduced DSAL without modifying existing DSALs. However, in order to provide a practical way to use the @Order annotation, one would probably want to use a tool like SpecTackle [34] to specify the order of all the pieces of advice from all the DSALs that are used in the project, using a user-friendly UI with default resolution. The tool can also help to validate the correctness of specific transformations with business logic tests. However, the implementation of such a tool is out of the scope of this paper. As we shall see in Section 5, our approach is not coupled with a particular language workbench. One can pick a language workbench that is right for the DSAL task at hand. The only requirement that affects the selection of a language workbench is the need to produce a standalone transformation in order to implement the Transformation interface. However, most mainstream language workbenches provide this capability by default. A natural question to ask in the context of LOM is what is the complexity of implementing and using a large number of DSALs using our approach. On the one hand, the use of @Hide and @BridgedSourceLocation annotations and the Transformation interface for each particular DSAL is not affected by the use of other DSALs. On the other hand, for determining the ordering value in the @Order annotation for a given advice, one needs to consider pieces of advice defined in other DSALs. 5 Evaluation To evaluate our approach we compare the effort required to implement a complex third-party DSAL with our approach to the effort of implementing the same DSAL in the Awesome composition framework. To assess the impact our approach has on the cost-effectivenss of LOM we present two case studies of implementing and using DSALs in open source projects. 10-16 A. Hadas and D. H. Lorenz Figure 2 Tool support for programming with Cool in Eclipse 5.1 Comparative Evaluation: Implementing Cool Cool is a DSAL for thread synchronization [31]. It is a non-trivial language to implement for several reasons. First, a coordinator (aspect in Cool) may include blocks of code in plain Java. Second, a coordinator has direct access to fields and methods of the class that is being advised. Third, features of Cool interact with features of AspectJ [28, 33]. In Cool, join points are not reflected in the syntax, advice comprises distant terms and expressions, and there is no correct translation to plain AspectJ (because the implementation-specific operations in the generated aspect might be ill-advised by other aspects). We compare two complete implementations of Cool defined in the Spoofax language workbench, one following our approach and the other using a composition framework (CF) approach with Awesome as back-end. In both implementations the grammar of the language is defined in the Syntax Definition Formalism (SDF) [38] (Listing 18) and its transformation is implemented in Stratego [39]. In our approach, a transformation to AspectJ is implemented (with @Hide annotations). In the CF approach a transformation to Java is implemented, and a new weaver plugin is also implemented. To test the interaction of Cool with AspectJ we implemented a coordinator in Cool (Listing 20) that synchronizes a bounded stack (Listing 19). Figure 2 shows a screenshot of Eclipse that demonstrates that text-highlighting and AJDT markers are provided in the process. In addition, we implemented an aspect in AspectJ that audits method executions and uses the stack (Listing 21). We then ran a multi-threaded application that reads and writes from and to a bounded stack simultaneously. The deadlock problem reported elsewhere [28] that occurs when the coordinator is translated to plain AspectJ was not observed when the @Hide annotations were placed during the transformation (but reproduced successfully when we removed them). 10-17 Language Oriented Modularity: From Theory to Practice Code Transformation EV Other Weaver Plugin Implementation Grammar Language SDF Stratego (AST) Stratego (AST) Java CF Approach Our Approach 34 34 761 (4168) 0 297 (3001) 382 (3008) 1557 0 Table 2 Number of lines of SDF, Stratego, and Java code in the implementation of Cool Table 2 compares the implementation effort required when using the two approaches based on #LOC written in three languages. First, the grammar definition in SDF (34 LOC) is the same in both implementations, since the language was defined the same way in Spoofax. Second, the code transformations are implemented in Stratego. We distinguish between the part of the transformation that handles the resolution of external variables (EV) in Cool and everything else. For each part we compare the #LOC in Stratego and the size of its Abstract Syntax Tree (AST) representation in Spoofax. The implementation of the code transformation was much shorter in our approach (382 LOC) than in the alternative approach (761+297=1058 LOC). In our approach, the relatively complex part of the implementation that handles external variables in Cool coordinators was eliminated because it is handled entirely by ajc. On the other hand, the need to generate annotations in our approach slightly increased the size of the other part of the implementation. We argue that the LOC in Stratego is highly affected by code style and therefore the size in LOC of its AST is more representative. The AST of that part using our approach is slightly larger but the difference is insignificant (3008-3001=7). Third, the implementation of a weaver plugin in Java (1557 LOC) is only required in the CF approach. This emphasizes that in the CF approach one needs to write a relatively large amount of code that is considered to be complicated for most developers since it requires expertise in low level bytecode manipulation tools. In contrast, this knowledge is not needed in our approach since the weaver is not modified. However, the language designer needs to know not only Java but also AspectJ. 5.2 Experimental Evaluation To evaluate our approach in the context of LOM, we present two case studies. In the first case study our approach is used for handling crosscutting concerns found in legacy code of a real-world software. In the second case study our approach is used for handling new requirements on-demand, which is a more typical scenario for LOM. 5.2.1 Case Study: oVirt oVirt is an open source production-ready enterprise application for providing and managing virtual data centers and private cloud solutions. For example, Red Hat 10-18 A. Hadas and D. H. Lorenz Enterprise Virtualization (RHEV), a commercial competitor to VMware vSphere, is based on oVirt and is deployed in big organizations, such as British Airways. 6 oVirt-Engine is the control center of the oVirt distributed system that manages the different hosts that run virtual machines. Its core design is based on the Command design pattern [15]. Each operation that is supported by oVirt-Engine is modeled by a command class that inherits from a common root called CommandBase. We identified three concerns, namely synchronization, auditing, and permissions, that cross-cut many modules in the oVirt-Engine application. The synchronization concern is about preventing conflicting commands from running simultaneously. The auditing concern is about producing informative messages at different stages of command execution. Lastly, the permissions concern is about ensuring that only users with sufficient permissions on entities are able to execute commands that affect them. These concerns are scattered across most of the command classes (as demonstrated in Figs. 3 and 4). In addition, these concerns are tangled within the CommandBase class. For these crosscutting concerns we implemented in Xtext three DSALs, called oVirtSync, oVirtAudit, and oVirtPermissions, respectively [22]. Their grammars were defined in the language grammar definition format provided by Xtext (Listings 22 to 24). Their transformations into AspectJ with our annotations were implemented in Xtend [3], a language for code transformation provided by Xtext. The transformations of the oVirtSync, oVirtAudit, and oVirtPermissions consisted of 259, 83, and 235 LOC, respectively. 7 With these DSALs, we implemented aspect solutions for three commands named MigrateVmCommand, AddDiskCommand, and ExportVmTemplateCommand (Listings 25 and 26 show aspects written in oVirtSync and oVirtAudit, respectively). Code scattering was eliminated by encapsulating the code that was spread across the command classes (which, for some commands, exceeded 25% of their LOC) in a single module implemented in the corresponding DSAL. Code tangling was resolved by extracting code that was tangled inside the CommandBase class into the DSAL aspects (296 LOC were untangled, which is more than 12% of the overall LOC). This illustrates that DSALs that are reducible to AspectJ using our approach were effective in separating out the crosscutting concerns we identified in oVirt-Engine. Moreover, the fact that these languages were implemented with Xtext using our approach, unlike our implementation of Cool that was done with Spoofax, validates that our approach is agnostic to the selection of the language workbench. Editing tools and aspect development tools support provided for programming in these languages are demonstrated in Fig. 5. 5.2.2 Case Study: muCommander In this case study the LOM process was applied to the muCommander open source project described in Section 2. http://www.redhat.com/en/about/press-releases/british-airways-chooses-rhev-to-improveit-systems-to-build-internal-cloud 7 https://github.com/OpenUniversity/DSALs 6 10-19 Language Oriented Modularity: From Theory to Practice Listing 13 1 2 3 4 5 6 7 8 9 10 Grammar definition of muAudit in Xtext Model: (commands+=Command)*; Command: 'logs for' type=[types::JvmDeclaredType|QualifiedName] ':' (cases+=Case)* ';' ; Case: 'case' state=State ('&' (fields+=[types::JvmField]))* 'log' msg=[types::JvmEnumerationLiteral] ('with' (vars+=[types::JvmField])+)? ; enum State: start | finish | interrupt | pause | resume; QualifiedName: ID ("." ID)*; Using Xtext we implemented a DSAL, named muAudit, for adding a missing auditing feature for job executions in muCommander. We defined the grammar of muAudit in the grammar definition format provided by Xtext (Listing 13). From this grammar definition we generated a plugin for programming with muAudit in Eclipse using Xtext. At this point we were already able to use the IDE plugin and start writing code in muAudit in Eclipse, using general editing capabilities that are typically available when programming with DSLs (Fig. 6). To run muAudit code we implemented a transformation to AspectJ using our approach. This transformation comprised 110 LOC in Xtend. Listing 7 depicts part of the aspect that is generated from the code presented in Listing 4. Note the use of @Hide annotations to hide join point shadows associated with the artificial type Logs and its method audit. With the transformation implemented, we were able to use aspect development tools that are typically available for programming with AspectJ, e.g., when writing the code in Listing 4 (Figs. 6 and 7). Finally, we implemented the Transformation interface for muAudit (Listing 12) and added it to the dsals.txt file. This enabled us to compile the project not only from within Eclipse but also from the command line, with no changes to the build process. The LOM development process of muAudit consists of three parts that can be compared to LOP: the grammar definition, the implementation of code transformation, and the implementation of the Transformation interface. The first two parts were done using Xtext, similar to how this is done for DSLs. The third part is also done using Xtext, similar to how it is done when required for DSLs. Even if the third part is typically not needed for DSLs, the additional effort it requires is negligible. Overall, the cost of implementing muAudit is similar to that of a DSL in LOP. As for the effectiveness of programming with muAudit, not only did we enjoy the benefits of programming with a simplified and more declarative language than AspectJ, but we also enjoyed all the development tools that are usually available for AspectJ. The plugin for Eclipse provided us with general editing tools that are commonly provided by IDEs nowadays. In addition, we were provided with the unique capabilities of aspect development tools by using AJDT and we were able to compile DSAL code the same way we compile AspectJ code. Overall, we were able to program with our DSAL effectively (compared to AspectJ), similar to how one programs with a DSL effectively (compared to Java) in LOP. 10-20 A. Hadas and D. H. Lorenz 5.3 Validity and Threats to Validity The case studies illustrate the effectiveness of our approach in the process of implementing and using DSALs for crosscutting concerns in a real-world project. They demonstrate that with a development effort comparable to that of DSL development (the definition and implementation of the language were done in only a few hours using an existing language workbench) and an effective programming experience comparable to that of a GPAL (existing GPAL tools were used), the cost-effectiveness of the LOM process using our approach is comparable to that of the LOP process. Internal Validity In LOM the language designer and the DSAL end-programmer are usually different people. In the case studies presented we played both roles. Our familiarity with the DSALs, language workbenches, and the implementation of our extensions to AspectJ could have positively influenced the LOM process. However, to factor out this effect we assess the cost-effectiveness of LOM relative to LOP, comparing the process and tools used. External Validity One can argue that the DSALs we implemented may not be representative, e.g., that Cool is more complex than most DSALs and that the applicationspecific DSALs are simpler than most. However, the implementation of Cool is commonly used as a benchmark test case for DSAL frameworks. The fact that the LOM process was cost-effective even for application-specific DSALs is even more impressive than for Cool whose development cost can be amortized across applications. While being a first-class DSL is a direct consequence of implementing the DSALs with a language workbnech, during the case studies we did not test all aspect development tools available for AspectJ, and therefore it is possible that our DSALs are not first-class aspect languages. However, the fact that the browsing capabilities of AJDT (which are typically not available when programming with DSALs) worked in our approach, and that our target language is based on AspectJ, reduces this risk. Yet, it is possible that the @BridgedSourceLocation annotation would need to be enhanced in order to preserve compatibility with future tools. 6 Related Work Various aspect development tools aim at facilitating either the development or the use of DSALs. The Aspect Bench Compiler (abc) [2] is more extensible than the AspectJ compiler (ajc), allowing one to produce extensions to AspectJ and DSALs more easily. However, abc is intended for the development of a particular extension rather than for the composition of extensions. Moreover, abc supports only an old version of AspectJ. Javassist [5] and similar toolkits that simplify bytecode manipulation can potentially simplify the definition of the DSAL weaving semantics, e.g., when using a composition framework. In contrast, our approach avoids completely the need to program a composition framework extension per-DSAL. 10-21 Language Oriented Modularity: From Theory to Practice Interpreter-based frameworks like Pluggable AOP [28], JAMI [25], and POPART [7] also avoid low-level implementation of the weaving semantics. However, they achieve simplicity at the expense of performance, since their conflict resolution is based on interpretation. In our approach, the use of DSALs does not imply performance degradation compared to use of GPALs. The Awesome composition framework [29] generalizes the weaving process of the AspectJ compiler in order to support the definition of DSAL weaving semantics. This approach provides finer-grained constructs for the resolution of foreign advising and co-advising conflicts than the @Hide and @Order annotations we implemented. Our approach, in contrast, provides the ability to define the DSAL weaving semantics without needing low-level bytecode manipulation tools. The idea of transforming DSALs into AspectJ is found in XAspects [36]. However, a transformation to pure AspectJ does not generally preserve the original meaning of the program. Reflex [37] uses a low-level kernel language to which different aspect languages are transformed. In contrast, our approach fully supports AspectJ and the use of its development tools out-of-the-box when programming with DSALs. Elsewhere [16, 21] we presented an improved approach to the composition of a language workbench and a composition framework to produce first-class DSALs. In this paper we present an alternative approach, that not only produces first-class aspect languages like the former approach, but also achieves better first-class equality with DSLs by making DSAL development process much more similar to that of a DSL. SpecTackle [34] is a tool that facilitates the resolution of multi-DSAL co-advising conflicts. It allows one to resolve co-advising conflicts per application, by presenting the conflicts between different aspect languages and allowing programmers to resolve them. This is equivalent to making the values within @Order configurable per application. This topic is left for future research. 7 Conclusion This work addresses the Achilles’ heel of LOM practicality, namely that the DSAL development process is far from being cost-effective. On the one hand, DSALs are more costly to develop than DSLs due to the implementation of their weaving semantics. On the other hand, due to the lack of development tools that work on DSALs, the relative effectiveness of programming with a DSAL (relative to a GPAL) is lower than the relative effectiveness of programming with a DSL (relative to a GPL). Consequently, LOM is often avoided or underutilized in practice. In contrast, LOP is practical thanks to the availability of language workbenches, which provide tools for rapid construction of DSLs as well as for end-programmer productivity in using these DSLs. These tools, however, were generally considered to be inapplicable to DSLs that are aspect-oriented (DSALs). On the one hand, due to the strong coupling between aspects and base code, code transformation may break aspect code or change the meaning of a program as a whole. On the other hand, developing aspect development tools and a weaver for each DSAL is a tedious and complex task. 10-22 A. Hadas and D. H. Lorenz Our work shows that DSALs can be produced with LOP tools (like language workbenches) and used with GPAL development tools (like AJDT). We present a transformation approach that improves the cost-effectiveness of DSAL development and brings it to the level of DSL development. In our approach, code written in DSALs that are reducible to a GPAL can be translated to annotated GPAL code in a semanticpreserving manner and interface with development tools intended for the GPAL. With our approach one can implement DSALs using a standard language workbench, such as Spoofax and Xtext. We present a concrete implementation of the approach with AspectJ as the target language. In a sense, our work strives to be for DSAL development what the introduction of language workbenches was for DSL development. With our approach, LOM becomes practical for real-world software development process, enabling the on-demand creation and use of DSALs for handling crosscutting concerns, thereby minimizing code scattering and tangling that still prevail in modern software projects. This research was supported in part by the Israel Science Foundation (ISF) under grant No. 1440/14. Acknowledgment References [1] Ken Arnold and James Gosling. The Java Programming Language. The Java Series. Addison-Wesley, 1996. [2] Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondr̆ej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: an extensible AspectJ compiler. In Proceedings of the 4th International Conference on Aspect-Oriented Software Development (AOSD’05), pages 87–98, Chicago, Illinois, USA, March 2005. ACM Press. doi:10.1145/1052898.1052906. [3] Lorenzo Bettini. Implementing Domain-Specific Languages with Xtext and Xtend. Packt Publishing, 2013. [4] Fabien Campagne. The MPS Language Workbench: Volume I. Fabien Campagne, 2014. [5] Shigeru Chiba. Javassist– a reflection-based programming wizard for Java. In Jean-Charles Fabre and Shigeru Chiba, editors, Proceedings of the OOPSLA 1998 Workshop on Reflective Programming in C++ and Java, Vancouver, BC, Canada, October 1998. UTCCP Report 98-4, Center for Computational Physics, University of Tsukuba, Japan. [6] Andy Clement, Adrian Colyer, and Mik Kersten. Aspect-oriented programming with AJDT. In Proceedings of the ECOOP 2003 Workshop on Analysis of AspectOriented Software, Darmstadt, Germany, July 2003. [7] Tom Dinkelaker, Mira Mezini, and Christoph Bockisch. The art of the meta-aspect protocol. In Proceedings of the 8th International Conference on Aspect-Oriented 10-23 Language Oriented Modularity: From Theory to Practice [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] Software Development (AOSD’09), pages 51–62, Charlottesville, Virginia, USA, March 2009. ACM Press. Sergey Dmitriev. Language oriented programming: The next programming paradigm. JetBrains onBoard, 1(2), 2004. Sven Efftinge and Markus Völter. oAW xText: A framework for textual DSLs. In Eclipse Modeling Symposium, Eclipse Summit Europe 2006, Esslingen, Germany, October 2006. Erik Ernst and David H. Lorenz. Aspects and polymorphism in AspectJ. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD’03), pages 150–157, Boston, Massachusetts, March 17-21 2003. ACM Press. Johan Fabry, Tom Dinkelaker, Jacques Noyé, and Éric Tanter. A taxonomy of domain-specific aspect languages. ACM Computing Surveys (CSUR), 47(3), April 2015. doi:10.1145/2685028. Robert E. Filman and Daniel P. Friedman. Aspect-oriented programming is quantification and obliviousness. In Peri Tarr, Lodewijk Bergmans, Martin Griss, and Harold Ossher, editors, Proceedings of the OOPSLA 2000 Workshop on Advanced Separation of Concerns. Department of Computer Science, University of Twente, The Netherlands, 2000. Martin Fowler. Language workbenches: The killer-app for domain specific languages, 2005. Martin Fowler. Domain-Specific Languages. Addison-Wesley Signature Series. Pearson Education, 2010. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing. AddisonWesley, 1995. Arik Hadas. A language workbench for creating production-ready extensions to AspectJ. In The 14th International Conference on Modularity (Modularity’15), Fort Collins, CO, USA, March 2015. ACM Student Research Competition Silver Medal Award (Graduate category). Arik Hadas. Language oriented modularity: From theory to practice. In The 15th International Conference on Modularity (Modularity’16), Málaga, Spain, March 2016. ACM Student Research Competition Gold Medal Award (Graduate category). Arik Hadas and David H. Lorenz. Demanding first-class equality for domain specific aspect languages. In Companion to the 14th International Conference on Modularity (Modularity’15 Comp.), pages 35–38, Fort Collins, CO, USA, March 2015. ACM Press. Position paper. Arik Hadas and David H. Lorenz. Experiencing with langauge oriented modularity (poster). In Proceedings of the 1st International Conference on the Art, Science, and Engineering of Programming, Brussels, Belgium, 2017. Arik Hadas and David H. Lorenz. First class domain specific aspect languages. In Companion to the 14th International Conference on Modularity (Modularity’15 10-24 A. Hadas and D. H. Lorenz [21] [22] [23] [24] [25] [26] [27] [28] [29] Comp.), pages 29–30, Fort Collins, CO, USA, March 2015. ACM Press. Poster Session. Arik Hadas and David H. Lorenz. A language workbench for implementing your favorite extension to AspectJ. In Companion to the 14th International Conference on Modularity (Modularity’15 Comp.), pages 19–20, Fort Collins, CO, USA, March 2015. ACM Press. Demo Session. Arik Hadas and David H. Lorenz. Application-specific language-oriented modularity: A case study of the oVirt project. In Proceedings of the Modularity’16 Workshop on Modularity Across the System Stack (MASS’16), pages 178–183, Málaga, Spain, March 2016. ACM Press. Arik Hadas and David H. Lorenz. Toward disposable domain-specific aspect languages. In Proceedings of the Modularity’16 Workshop on Foundations of AspectOriented Languages (FOAL’16), pages 83–85, Málaga, Spain, March 2016. ACM Press. Arik Hadas and David H. Lorenz. Toward practical language oriented modularity. In Proceedings of the Modularity’16 Workshop on Language Modularity À La Mode (LaMOD’16), pages 94–98, Málaga, Spain, March 2016. ACM Press. Wilke Havinga, Lodewijk Bergmans, and Mehmet Ak¸sit. Prototyping and composing aspect languages: using an aspect interpreter framework. In Proceedings of the 22nd European Conference on Object-Oriented Programming (ECOOP’08), number 5142 in Lecture Notes in Computer Science, pages 180–206, Paphos, Cyprus, July 2008. Springer-Verlag. Lennart C.L. Kats and Eelco Visser. The Spoofax language workbench: Rules for declarative specification of languages and IDEs. In Proceedings of the ACM International Conference on Systems, Programming, and Applications: Software for Humanity (SPLASH’10), pages 444–463, Reno/Tahoe, Nevada, USA, October 2010. ACM Press. Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William Griswold. An overview of AspectJ. In Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP’01), number 2072 in Lecture Notes in Computer Science, pages 327–353, Budapest, Hungary, June 2001. Springer-Verlag. Sergei Kojarski and David H. Lorenz. Pluggable AOP: Designing aspect mechanisms for third-party composition. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’05), pages 247–263, San Diego, CA, USA, October 2005. ACM Press. Sergei Kojarski and David H. Lorenz. Awesome: An aspect co-weaving system for composing multiple aspect-oriented extensions. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’07), pages 515–534, Montreal, Canada, October 2007. ACM Press. 10-25 Language Oriented Modularity: From Theory to Practice [30] Sergei Kojarski and David H. Lorenz. Identifying feature interaction in aspectoriented frameworks. In Proceedings of the 29th International Conference on Software Engineering (ICSE’07), pages 147–157, Minneapolis, MN, May 2007. IEEE Computer Society. [31] Cristina Videira Lopes. D: A Language Framework for Distributed Programming. PhD thesis, Northeastern University, 1997. [32] David H. Lorenz. Language-oriented modularity through Awesome DSALs: summary of invited talk. In Proceedings of the 7th AOSD Workshop on DomainSpecific Aspects Languages (DSAL’12), pages 1–2, Potsdam, Germany, March 2012. ACM Press. [33] David H. Lorenz and Sergei Kojarski. Understanding aspect interactions, coadvising and foreign advising. In Proceedings of ECOOP’07 Second International Workshop on Aspects, Dependencies and Interactions, pages 23–28, Berlin, Germany, July 2007. [34] David H. Lorenz and Oren Mishali. SpecTackle: Toward a specification-based DSAL composition process. In Proceedings of the 7th AOSD Workshop on DomainSpecific Aspects Languages (DSAL’12), Potsdam, Germany, March 2012. ACM Press. [35] David H. Lorenz and Boaz Rosenan. Cedalion: A language for language oriented programming. In Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’11), pages 733–752, Portland, Oregon, USA, October 2011. ACM Press. doi:10.1145/ 2048066.2048123. [36] Macneil Shonle, Karl Lieberherr, and Ankit Shah. XAspects: An extensible system for domain specific aspect languages. In Companion to the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 28–37, Anaheim, California, 2003. ACM Press. [37] Éric Tanter. Aspects of composition in the Reflex AOP kernel. In Proceedings of the 5th International Symposium on Software Composition (SC’06), number 4089 in Lecture Notes in Computer Science, pages 98–113, Vienna, Austria, March 2006. Springer-Verlag. [38] Eelco Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997. [39] Eelco Visser. Stratego: A language for program transformation based on rewriting strategies: system description of Stratego 0.5. In Aart Middeldorp, editor, Proceedings of the 12th International Conference on Rewriting Techniques and Applications (RTA 2001), number 2051 in Lecture Notes in Computer Science, pages 357–362, Utrecht, The Netherlands, May 2001. Springer-Verlag. doi:10.1007/3-540-45127-7_27. [40] Martin P. Ward. Language-oriented programming. Software-Concepts and Tools, 15(4):147–161, 1994. 10-26 A. Hadas and D. H. Lorenz A Changes to the AspectJ Compiler Listing 14 Advice-join-point matching with @Hide annotations in BcelClassWeaver 1 private boolean match(LazyMethodGen mg) { 2 //... skipped ... 3 boolean hide = false, hideWithin = false; 4 //... skipped ... 5 AnnotationAJ hideAnn = getHideMethodAnnotation(mg); 6 if (hideAnn != null) { 7 String hideStr = hideAnn.getStringFormOfValue("joinpoints"); 8 hide = hideStr == null || ,→ hideStr.contains("Lorg/aspectj/lang/annotation/MethodJoinpoint;EXECUTION"); 9 hideWithin = hideStr == null || ,→ hideStr.contains("Lorg/aspectj/lang/annotation/MethodJoinpoint;WITHIN"); 10 } 11 //... skipped ... 12 if (canMatchBodyShadows && !hideWithin) { 13 for (InstructionHandle h = mg.getBody().getStart(); h != null; h = h.getNext()) { 14 match(mg, h, enclosingShadow, shadowAccumulator); 15 } 16 } 17 if (canMatch(enclosingShadow.getKind()) && !hide && /** ...skipped ... */ ) { 18 if (match(enclosingShadow, shadowAccumulator)) { 19 enclosingShadow.init(); 20 } 21 } 22 //... skipped ... 23 } Listing 15 Advice comparison with @Order annotations in BcelAdvice 1 public int compareTo(Object other) { 2 //... skipped ... 3 BcelAdvice o = (BcelAdvice) other; 4 5 try { 6 double diff = getOrder(this) − getOrder(o); 7 if (diff != 0) 8 return diff < 0 ? −1 : 1; 9 } catch (Exception e) {} 10 11 if (kind.getPrecedence() != o.kind.getPrecedence()) { 12 if (kind.getPrecedence() > o.kind.getPrecedence()) { 13 //... skipped ... 14 } 10-27 Language Oriented Modularity: From Theory to Practice Listing 16 Retrieving source code location with @BridgedSourceLocation annotations in AsmRelationshipProvider 1 public static String getHandle(AsmManager asm, Advice advice) { 2 if (null == advice.handle) { 3 AnnotationAJ ann = getSourceLocation(advice); 4 if (ann != null) 5 advice.handle = ann.getStringFormOfValue("file") + ann.getStringFormOfValue("line"); 6 else { 7 ISourceLocation sl = advice.getSourceLocation(); 8 if (sl != null) { 9 IProgramElement ipe = asm.getHierarchy().findElementForSourceLine(sl); 10 advice.handle = ipe.getHandleIdentifier(); 11 } 12 } 13 } 14 return advice.handle; 15 } Listing 17 Invoking DSAL code transformations in AjBuildManager 1 public void performCompilation(Collection<File> files) { 2 //... skipped ... 3 for (Iterator<File> fIterator = files.iterator(); fIterator.hasNext();) { 4 File f = fIterator.next(); 5 for (Transformation t : AjBuildConfig.transformations) 6 if (f.getName().endsWith(t.extension())) { 7 try { 8 f = t.convert2java(f); 9 } 10 catch (Exception e) { 11 e.printStackTrace(); 12 } 13 break; 14 } 15 filenames[idx++] = f.getPath(); 16 } 17 //... skipped ... 18 } 10-28 A. Hadas and D. H. Lorenz B Grammar Definition for Cool Listing 18 Grammar definition for Cool in the SDF format 1 module languages/cool/Main 2 imports 3 languages/java−15/Main 4 languages/cool/AspectjExtension 5 6 exports 7 sorts 8 ConditionDec CoordinatorBodyDec CoordinatorDec CoordinatorBody MethodAdditionsDec ,→ MethodSignature MutexDec SelfexDec 9 10 context−free syntax 11 CoordinatorDec −> TypeDec 12 CoordinatorDecHead CoordinatorBody −> CoordinatorDec {cons("CoordinatorDec")} 13 "coordinator" TypeName −> CoordinatorDecHead {cons("CoordinatorDecHead")} 14 "{" CoordinatorBodyDec* "}" −> CoordinatorBody {cons("CoordinatorBody")} 15 16 SelfexDec −> CoordinatorBodyDec 17 "selfex" "{" {MethodSignature ","}* "}" ";" −> SelfexDec {cons("Selfex")} 18 19 MutexDec −> CoordinatorBodyDec 20 "mutex" "{" {MethodSignature ","}* "}" ";" −> MutexDec {cons("Mutex")} 21 22 ConditionDec −> CoordinatorBodyDec 23 "condition" {Expr ","}* ";" −> ConditionDec {cons("ConditionDec")} 24 25 MethodAdditionsDec −> CoordinatorBodyDec 26 MethodSignature ":" Requires? OnEntry? OnExit? −> MethodAdditionsDec ,→ {cons("MethodAdditions")} 27 Id "(" {Type ","}* ")" −> MethodSignature {cons("MethodSignature")} 28 "requires" Expr ";" −> Requires {cons("Requires")} 29 "on_entry" Block −> OnEntry {cons("OnEntry")} 30 "on_exit" Block −> OnExit {cons("OnExit")} 31 32 FieldDec −> CoordinatorBodyDec 33 34 lexical syntax 35 "condition" −> Keyword 10-29 Language Oriented Modularity: From Theory to Practice C The Bounded Stack Example Listing 19 Implementation of a non-thread-safe bounded stack 1 public class BoundedStack implements Stack { 2 protected Object[] buffer; 3 private int usedSlots = 0; 4 private static BoundedStack instance= null; 5 public BoundedStack(int capacity) { this.buffer = new Object[capacity]; instance=this; } 6 public static BoundedStack getInstance() { return instance; } 7 public Object pop() { 8 Object result = buffer[usedSlots − 1]; 9 usedSlots−−; 10 buffer[usedSlots] = null; 11 return result; 12 } 13 public void push(Object obj) { 14 buffer[usedSlots++] = obj; 15 } 16 } Listing 20 Aspect in Cool that synchronizes the bounded stack 1 coordinator base.BoundedStack { 2 selfex {push(java.lang.Object), pop()}; 3 mutex {push(java.lang.Object), pop()}; 4 condition full = false, empty = true; 5 int top = 0; 6 push(java.lang.Object): 7 requires (!full); 8 on_entry {top = top + 1;} 9 on_exit { 10 empty = false; 11 if (top == buffer.length) full = true; 12 } 13 pop(): 14 requires (!empty); 15 on_entry {top = top − 1;} 16 on_exit { 17 full = false; 18 if (top == 0) empty = true; 19 } 20 } Listing 21 Aspect in AspectJ that audits method calls using the bounded stack 1 public aspect AJAuditor { 2 pointcut toLog(): call(* *.*(..)) && !cflow(within(org.openu.demo.AJAuditor)); 3 before(): toLog() { log(thisJoinPoint); } 4 protected void log(JoinPoint jp) { 5 BoundedStack buf = BoundedStack.getInstance(); 6 try { if (buf != null) buf.add(jp); } catch(Exception e) { System.out.println(e.getMessage()); } 7 } 8 } 10-30 A. Hadas and D. H. Lorenz D Code Scattering in oVirt Figures 3 and 4 illustrate scattering of synchronization, auditing, and permissions related code in oVirt, marked in yellow, green, and red, respectively. Figure 3 Code scattering in the MigrateVmCommand class 10-31 Language Oriented Modularity: From Theory to Practice Figure 4 Code scattering in the AddDiskCommand class 10-32 A. Hadas and D. H. Lorenz E Grammar Definition for oVirtAudit, oVirtSync, and oVirtPermissions Listing 22 Grammar definition for oVirtAudit in Xtext 1 2 3 4 5 6 7 8 Model: (commands+=Command)* ; Command: 'logs for' type=[types::JvmDeclaredType|QualifiedName] (overrides?='(overrides)')? ':' (cases+=Case(',' cases+=Case)* (',' 'otherwise' 'log' default=[types::JvmEnumerationLiteral])?)? ';' ; Case: 'case' (actionState=[types::JvmEnumerationLiteral] '&')? result=Result ('&' internal?='internal')? ,→ ('&' 'state='(fields+=[types::JvmField]))* ('&' (methods+=[types::JvmOperation]))* 'log' ,→ msg=[types::JvmEnumerationLiteral] ; 9 enum Result: success|failure; 10 QualifiedName: ID ("." ID)*; Listing 23 Grammar definition for oVirtSync in Xtext 1 Model: (commands+=Command)* ; 2 Command: 3 'locks for' type=[types::JvmDeclaredType|QualifiedName] '(' scope=Scope (wait?=('& wait'))? ')' ,→ ':' 4 (exclusiveLocks=Exclusive)? (sharedLocks=Inclusive)? (message=Message)? 5 ';' 6 ; 7 enum Scope: sync|async; 8 Exclusive: 9 {Exclusive} 'exclusively' (override?='(overrides)')? '{' (locks+=Lock(',' locks+=Lock)*)? '}' ; 10 Inclusive: 11 {Inclusive} 'inclusively' (override?='(overrides)')? '{' (locks+=Lock(',' locks+=Lock)*)? '}' ; 12 Lock: 'group: ' group=[types::JvmEnumerationLiteral] 'instance: ' id=[types::JvmOperation] ,→ (conditional?='if' condition=[types::JvmOperation])?; 13 Message: 'message: ' type=[types::JvmEnumerationLiteral] (vars+=Var)*; 14 Var: '<' key=STRING ',' value=[types::JvmOperation] '>'; 15 QualifiedName: ID ("." ID)*; Listing 24 Grammar definition for oVirtPermissions in Xtext 1 2 3 4 5 6 7 8 9 Model: commands+=Command* ; Command: 'permissions for' type=[types::JvmDeclaredType|QualifiedName] (extends=Extends)? ':' (permissions+=Permission (',' permissions+=Permission)*)? ';' ; Extends: {Extends} '(extends)' | '(extends if' cond=Condition ')' ; Permission: 'object type = ' objectType=[types::JvmEnumerationLiteral] 'object id = ' ,→ objectId=[types::JvmOperation] 'action group = ' ,→ actionGroup=[types::JvmEnumerationLiteral] (conditional?='if' conditions+=Condition ,→ ('and' conditions+=Condition)*)? ; 10 Condition: (not?='not')? operation=[types::JvmOperation] ; 11 QualifiedName: ID ("." ID)*; 10-33 Language Oriented Modularity: From Theory to Practice F Aspects for Synchronization and for Auditing in oVirt Listing 25 Synchronizing commands for oVirt expressed in oVirtSync 1 locks for org.ovirt.engine.core.bll.ExportVmTemplateCommand (sync): 2 exclusively (overrides) { group: REMOTE_TEMPLATE instance: getVmTemplateId } 3 inclusively (overrides) { group: TEMPLATE instance: getVmTemplateId } 4 message: ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_EXPORTED <"TemplateName", ,→ getVmTemplateName>; 5 6 locks for org.ovirt.engine.core.bll.MigrateVmCommand (async): 7 exclusively (overrides) { group: VM instance: getVmId } 8 message: ACTION_TYPE_FAILED_VM_IS_BEING_MIGRATED <"VmName", getVmName>; 9 10 locks for org.ovirt.engine.core.bll.AddDiskCommand (sync): 11 exclusively (overrides) { group: VM_DISK_BOOT instance: getVmId if isBootableDisk } 12 inclusively (overrides) { group: VM instance: getVmId }; Listing 26 Auditing commands for oVirt expressed in oVirtAudit 1 logs for org.ovirt.engine.core.bll.MigrateVmCommand (overrides): 2 case success & isReturnValueUp log VM_MIGRATION_DONE, 3 case success & internal log VM_MIGRATION_START_SYSTEM_INITIATED, 4 case success log VM_MIGRATION_START, 5 case failure & isHostInPrepareForMaintenance log ,→ VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE, 6 case failure log VM_MIGRATION_FAILED; 7 8 logs for org.ovirt.engine.core.bll.storage.export.ExportVmTemplateCommand: 9 case EXECUTE & success log IMPORTEXPORT_STARTING_EXPORT_TEMPLATE, 10 case EXECUTE & failure log IMPORTEXPORT_EXPORT_TEMPLATE_FAILED, 11 case END_SUCCESS & success log IMPORTEXPORT_EXPORT_TEMPLATE, 12 case END_SUCCESS & failure log IMPORTEXPORT_EXPORT_TEMPLATE_FAILED; 13 14 logs for org.ovirt.engine.core.bll.storage.disk.AddDiskCommand : 15 case EXECUTE & success & internal & isDiskStorageTypeRequiresExecuteState log ,→ ADD_DISK_INTERNAL, 16 case EXECUTE & success & isDiskStorageTypeRequiresExecuteState & isVmNameExists log ,→ USER_ADD_DISK_TO_VM, 17 case EXECUTE & success & isDiskStorageTypeRequiresExecuteState log USER_ADD_DISK, 18 case EXECUTE & failure & internal & isDiskStorageTypeRequiresExecuteState log ,→ ADD_DISK_INTERNAL_FAILURE, 19 case EXECUTE & failure & isDiskStorageTypeRequiresExecuteState & isVmNameExists log ,→ USER_FAILED_ADD_DISK_TO_VM, 20 case EXECUTE & failure & isDiskStorageTypeRequiresExecuteState log USER_FAILED_ADD_DISK, 21 case success & isVmNameExists log USER_ADD_DISK_TO_VM_FINISHED_SUCCESS, 22 case success log USER_ADD_DISK_FINISHED_SUCCESS, 23 case failure & isVmNameExists log USER_ADD_DISK_TO_VM_FINISHED_FAILURE, 24 otherwise log USER_ADD_DISK_FINISHED_FAILURE; 10-34 A. Hadas and D. H. Lorenz G Tool Support for Programming with oVirtSync Figure 5 illustrates the general editing tools and aspect development tools that are available while programming with oVirtSync in Eclipse using our approach. An IDE plugin that is generated by Xtext provides one with general editing tools such as texthighlighting, auto-completion (line 17) and syntax-error checking (line 17). In addition, the transformation of the DSAL into AspectJ and the use of the @BridgedSourceLocation annotation enable one to leverage aspect development tools provided by AJDT such as advises markers (lines 1 and 8). Figure 5 Aspect in oVirtSync that synchronizes commands in oVirt, edited in Eclipse 10-35 Language Oriented Modularity: From Theory to Practice H Tool Support for Programming with muAudit Figure 6 Aspect in muAudit that audits jobs in muCommander, editted in Eclipse Figure 7 Code in muCommander being advised by aspect in muAudit 10-36 A. Hadas and D. H. Lorenz About the authors Arik Hadas is a software engineer at Red Hat and a graduate student at the Open University of Israel, under the supervision of Prof. David H. Lorenz. His research interests include different aspects of programming and particularly large and distributed software development and modularization techniques. He received his BSc in computer science from the Ben-Gurion University in the Negev, Israel. He is a member of the ACM. Contact him at the Dept. of Mathematics and Computer Science, Open University of Israel, Raanana 4310701, Israel; [email protected]. David H. Lorenz is an Associate Professor in the Department of Mathematics and Computer Science at the Open University of Israel. He is currently a Visiting Professor at the Faculty of Computer Science, Technion—Israel Institute of Technology. His research interests include language-oriented software engineering, modularity, and programming, particularly involving domain specific languages. Prof. Lorenz received his PhD in computer science from the Technion—Israel Institute of Technology. He is a member of the ACM and a member of the IEEE. Contact him at the Dept. of Mathematics and Computer Science, Open University of Israel, Raanana 4310701, Israel; [email protected]. 10-37
6cs.PL
Under consideration for publication in Theory and Practice of Logic Programming 1 Stepwise Debugging of Answer-Set Programs arXiv:1705.06564v1 [cs.AI] 18 May 2017 JOHANNES OETSCH Technische Universität Wien, Institut für Informationssysteme 184/3, Favoritenstrasse 9-11, A-1040 Vienna, Austria, (e-mail: [email protected]) JÖRG PÜHRER Universität Leipzig, Institut für Informatik, Augustusplatz 10, D-04109 Leipzig, Germany, (e-mail: [email protected]) HANS TOMPITS Technische Universität Wien, Institut für Informationssysteme 184/3, Favoritenstrasse 9-11, A-1040 Vienna, Austria, (e-mail: [email protected]) Abstract We introduce a stepping methodology for answer-set programming (ASP) that allows for debugging answer-set programs and is based on the stepwise application of rules. Similar to debugging in imperative languages, where the behaviour of a program is observed during a step-by-step execution, stepping for ASP allows for observing the effects that rule applications have in the computation of an answer set. While the approach is inspired from debugging in imperative programming, it is conceptually different to stepping in other paradigms due to non-determinism and declarativity that are inherent to ASP. In particular, unlike statements in an imperative program that are executed following a strict control flow, there is no predetermined order in which to consider rules in ASP during a computation. In our approach, the user is free to decide which rule to consider active in the next step following his or her intuition. This way, one can focus on interesting parts of the debugging search space. Bugs are detected during stepping by revealing differences between the actual semantics of the program and the expectations of the user. As a solid formal basis for stepping, we develop a framework of computations for answer-set programs. For fully supporting different solver languages, we build our framework on an abstract ASP language that is sufficiently general to capture different solver languages. To this end, we make use of abstract constraints as an established abstraction for popular language constructs such as aggregates. Stepping has been implemented in SeaLion, an integrated development environment for ASP. We illustrate stepping using an example scenario and discuss the stepping plugin of SeaLion. Moreover, we elaborate on methodological aspects and the embedding of stepping in the ASP development process. Under consideration in Theory and Practice of Logic Programming (TPLP). 2 J. Oetsch, J. Pührer, and H. Tompits 1 Introduction Answer-set programming (ASP) (Niemelä 1999; Marek and Truszczyński 1999) is a paradigm for declarative problem solving that is popular amongst researchers in artificial intelligence and knowledge representation. Yet it is rarely used by software engineers outside academia so far. Arguably, one obstacle preventing developers from using ASP is a lack of support tools for developing answer-set programs. One particular problem in the context of programming support is debugging of answerset programs. Due to the fully declarative semantics of ASP, it can be quite tedious to detect an error in an answer-set program. In recent years, debugging in ASP has received some attention (Brain and De Vos 2005; Syrjänen 2006; Brain et al. 2007; Pührer 2007; Gebser et al. 2008; Gebser et al. 2009; Pontelli et al. 2009; Oetsch et al. 2010; Oetsch et al. 2010; Oetsch et al. 2011; Oetsch et al. 2012b; Polleres et al. 2013; Frühstück et al. 2013; Shchekotykhin 2015). These previous works are important contributions towards ASP development support, however current approaches come with limitations to their practical applicability. First, existing techniques and tools only capture a basic ASP language fragment that does not include many language constructs that are available and frequently used in modern ASP solver languages, e.g.,, aggregates or choice rules are not covered by current debugging strategies (with the exception of the work by Polleres et al. (2013), where cardinality constraints are dealt with by translation). Second, usability aspects are often not considered in current approaches, in particular, the programmer is required to either provide a lot of data to a debugging system or he or she is confronted with a huge amount of information from the system (tackling this problem in query-based debugging has been addressed by Shchekotykhin (2015)). This paper introduces a stepping methodology for ASP, which is a novel technique for debugging answer-set programs that is general enough to deal with current ASP solver languages and is intuitive and easy to use. Our method is similar in spirit to the widespread and effective debugging strategy in imperative programming, where the idea is to gain insight into the behaviour of a program by executing statement by statement following the program’s control flow. In our approach, we allow for stepwise constructing interpretations by considering rules of an answer-set program at hand in a successive manner. This method guarantees that either an answer set will be reached, or some error will occur that provides hints why the semantics of the program differs from the user’s expectations. A major difference to the imperative setting is that, due to its declarativity, ASP lacks any control flow. Instead, we allow the user to follow his or her intuition on which rule instances to become active. This way, one can focus on interesting parts of the debugging search space from the beginning. For illustration, the following answer-set program has {a} as its only answer set. a :- not b. b :- not a. a :- b. Let’s step through the program to obtain explanations why this is the case. In Stepwise Debugging of Answer-Set Programs 3 the beginning of a stepping session, no atom is considered to be true. Under this premise, the first two rules are active. The user decides which of these rules to apply. Choosing a rule to be applied in this manner is considered a step in our approach. In case the user chooses the first rule, the atom a is derived. Then, no further rule is active and one of the answer sets, {a} has been reached. If, on the other hand, the user chooses the second rule in the first step, atom b is derived and a is considered false. Then, the third rule becomes active. However, this rule would derive a that is already considered false when choosing the second rule. In this case, the user sees that no answer set can be reached based on the initial choice. Besides single steps that allow the user to consider one rule instance at a time, we also lay the ground for so-called jumps. The intuition is that in a jump multiple rule instances and even multiple non-ground rules can be considered at once. Jumping significantly speeds up the stepping process which makes our technique a usable tool for debugging in practice. Consider the following encoding of an instance of the three-colouring problem in the Gringo language (Gebser et al. 2011): 1{color(X,red;green;blue)}1 :- node(X). :- edge(X,Y), color(X,C), color(X,C). node(X):-edge(X,Y). node(Y):-edge(X,Y). edge(1,2). edge(1,3). edge(1,4). edge(2,4). edge(2,5). edge(2,6). edge(3,4). edge(3,5). edge(3,6). edge(4,5). edge(5,6). The user expects the program to have answer sets but it does not. Following our approach, the reason for that can be found after two actions. First, trusting the “instance” part of the program, the user applies a jump on all rules of this part, and, intuitively, gets all atoms implied by these rules as an intermediate result. Second, the user applies an arbitrary instance of the rule 1{color(X,red;green;blue)}1 :- node(X). that is active under the atoms derived during the jump. Suppose, the user chooses the instance 1 {color(1, red), color(1, green), color(1, blue)} 1 :- node(1). and selects color(1, red) to be true. Then, the debugging system reveals that the instance :- edge(1, 2), color(1, red), color(1, red). of the “check” constraint becomes unexpectedly active. Now, the users sees that the second occurrence of color(X,C) in the constraint has to be replaced by color(Y,C). Generally, bugs can be detected whenever stepping reveals differences between the actual semantics of the program and the expectations of the user. 4 J. Oetsch, J. Pührer, and H. Tompits In order to establish a solid formal basis for our stepping technique, we developed a framework of computations for answer-set programs. For fully supporting current solver languages, we were faced with several challenges. For one, the languages of answer-set solvers differ from each other and from formal ASP languages in various ways. In order to develop a method that works for different solvers, we need an abstract ASP language that is sufficiently general to capture actual solver languages. To this end, we make use of abstract constraints (Marek and Remmel 2004; Marek and Truszczyński 2004) as an established abstraction for language constructs such as aggregates, weight constraints, and external atoms. We rely on a semantics for arbitrary abstract-constraint programs with disjunctions that we introduced for this purpose in previous work (Oetsch et al. 2012a). In contrast to other semantics for this type of programs, it is compatible with the semantics of all the ASP solvers we want to support, namely, Clasp (Gebser et al. 2012), DLV (Leone et al. 2006), and DLVHEX (Redl 2016). Note that our framework for computations for abstractconstraint programs differs from the one by Liu et al. (2010). We did not build on this existing notion for three reasons. First, it does not cover rules with disjunctive heads which we want to support. Second, steps in this framework correspond to the application of multiple rules. Since our method is rooted in the analogy to stepping in procedural languages, where an ASP rule corresponds to a statement in an imperative language, we focus on steps corresponding to application of a single rule. Finally, the semantics of non-convex literals differs from that of DLVHEX in the existing approach. A thorough discussion on the relation of the two notions of computations is given in Section 5. Another basic problem deals with the grounding step in which variables are removed from answer-set programs before solving. In formal ASP languages, the grounding of a program consists of all rules resulting from substitutions of variables by ground terms. In contrast, actual grounding tools apply many different types of simplifications and pre-evaluations for creating a variable-free program. In order to close this gap between formal and practical ASP, Pührer developed abstractions of the grounding step together with an abstract notion of non-ground answer-set program as the base language for the stepping methodology in his PhD thesis (Pührer 2014). Based on that, stepping can easily be applied to existing solver languages and it becomes robust to changes to these languages. As we focus on the methodological aspects of stepping in this article, we do not present these abstractions and implicitly use grounding as carried out by actual grounding tools. The stepping technique has been implemented in SeaLion (Oetsch et al. 2013), an integrated development environment for ASP. We discuss how SeaLion can be used for stepping answer-set programs written in the Gringo or the DLV language.1 1 The framework introduced in this paper subsumes and significantly extends previous versions of the stepping technique for normal logic programs (Oetsch et al. 2010; Oetsch et al. 2011) and DL-programs (Oetsch et al. 2012b). Stepwise Debugging of Answer-Set Programs 5 Outline Next, we provide the formal background that is necessary for our approach. We recall the syntax of disjunctive abstract-constraint programs and the semantics on which we base our framework (Oetsch et al. 2012a). Section 3 introduces a framework of computations that allows for breaking the semantics down to the level of individual rules. After defining states and computations, we show several properties of the framework, most importantly soundness and completeness in the sense that the result of a successful computation is an answer set and that every answer set can be constructed with a computation. Moreover, we study language fragments for which a simpler form of computation suffices. In Section 4, we present the stepping technique for debugging answer-set programs based on our computation framework. We explain steps and jumps as a means to progress in a computation using an example scenario. Moreover, we discuss methodological aspects of stepping on the application level (how stepping is used for debugging and program analysis) and the top level (how stepping is embedded in the ASP development process). We illustrate the approach with several use cases and describe the stepping interface of SeaLion. Related work is discussed in Section 5. We compare stepping to other debugging approaches for ASP and discuss the relation of our computation framework to that of Liu et al. (2010) and transition systems for ASP (Lierler 2011; Lierler and Truszczyński 2016; Brochenin et al. 2014). We conclude the paper in Section 6. In Appendix A we compile guidelines for stepping and give general recommendations for ASP development. Selected and short proofs are included in the main text and all remaining proofs are provided in Appendix B. 2 Background As motivated in the introduction, we represent grounded answer-set programs by abstract-constraint programs (Marek and Remmel 2004; Marek and Truszczyński 2004; Oetsch et al. 2012a). Non-ground programs will be denoted by programs in the input language of Gringo. Thus, we implicitly assume that grounding translates (non-ground) Gringo rules to rules of abstract-constraint programs. For a detailed formal account of our framework in the non-ground setting we refer the interested reader to the dissertation of Pührer (2014). We assume a fixed set A of ground atoms. Definition 1 An interpretation is a set I ⊆ A of ground atoms. A ground atom a is true under interpretation I , symbolically I |= a, if a ∈ I , otherwise it is false under I . We will use the symbol 6|= to denote the complement of a relation denoted with the symbol |= in different contexts. For better readability, we sometimes make use of the following notation when the reader may interpret the intersection of two sets I and X of ground atoms as a projection from I to X . Definition 2 For two sets I and X of ground atoms, I |X = I ∩ X is the projection of I to X . 6 J. Oetsch, J. Pührer, and H. Tompits 2.1 Syntax of Abstract-Constraint Programs Rule heads and bodies of abstract-constraint programs are formed by so-called abstract-constraint atoms. Definition 3 (Marek and Remmel 2004; Marek and Truszczyński 2004) An abstract constraint, abstract-constraint atom, or C-atom, is a pair A = hD, C i, where D ⊆ A is a finite set called the domain of A, denoted by DA , and C ⊆ 2D is a collection of sets of ground atoms, called the satisfiers of A, denoted by CA . We can express atoms also as C-atoms. In particular, for a ground atom a, we identify the C-atom h{a}, {{a}}i with a. We call such C-atoms elementary. We will also make use of default negation in abstract-constraint programs. An abstract-constraint literal, or C-literal, is a C-atom A or a default negated C-atom notA. Unlike the original definition, we introduce abstract-constraint programs with disjunctive rule heads. Definition 4 An abstract-constraint rule, or simply C-rule, is an expression of the form A1 ∨ · · · ∨ Ak ← Ak +1 , . . . , Am , not Am+1 , . . . , not An , (1) where 0 ≤ k ≤ m ≤ n and any Ai , for 1 ≤ i ≤ n, is a C-atom. Note that if all disjuncts share the same domain they can be expressed by a single C-atom (see Pührer 2014) but in general disjunction adds expressivity. We identify different parts of a C-rule and introduce some syntactic properties. Definition 5 For a C-rule r of form (1), • • • • B(r ) = {Ak +1 , . . . , Am , not Am+1 , . . . , not An } is the body of r , B+ (r ) = {Ak +1 , . . . , Am } is the positive body of r , B− (r ) = {Am+1 , . . . , An } is the negative body of r , and H(r ) = {A1 , . . . , Ak } is the head of r . If B(r ) = ∅ and H(r ) 6= ∅, then r is a C-fact. For C-facts, we usually omit the symbol “←”. A C-rule r of form (1) is normal if k = 1 and positive if m = n. We define the domain of a default negated C-atom notA as Dnot A = DA . Then, the domain DS of a set S of C-literals is given by [ DS = DL · L∈S Finally, the domain of a C-rule r is [ Dr = DX · X ∈H(r )∪B(r ) Stepwise Debugging of Answer-Set Programs 7 Definition 6 An abstract-constraint program, or simply C-program, is a finite set of C-rules. A C-program is normal, respectively positive, if it contains only normal, respectively positive, C-rules. A C-program is elementary if it contains only elementary Catoms. 2.2 Satisfaction Relation Intuitively, a C-atom hD, C i is a literal whose truth depends on the truth of all atoms in D under a given interpretation. The satisfiers in C explicitly list which combinations of true atoms in D make the C-atom true. Definition 7 An interpretation I satisfies a C-atom hD, C i, symbolically I |= hD, C i, if I |D ∈ C . Moreover, I |= not hD, C i iff I 6|= hD, C i. Important criteria for distinguishing classes of C-atoms are concerned with their semantic behaviour with respect to growing (or shrinking) interpretations. In this respect, we identify monotonicity properties in the following. Definition 8 A C-literal L is monotone if, for all interpretations I and I 0 , if I ⊆ I 0 and I |= L, then also I 0 |= L. L is convex if, for all interpretations I , I 0 , and I 00 , if I ⊆ I 0 ⊆ I 00 , I |= L, and I 00 |= L, then also I 0 |= L. Moreover, a C-program P is monotone (respectively, convex) if for all r ∈ P all C-literals L ∈ H(r ) ∪ B(r ) are monotone (respectively, convex). Next, the notion of satisfaction is extended to C-rules and C-programs in the obvious way. Definition 9 An interpretation I satisfies a set S of C-literals, symbolically I |= S , if I |= L for all L ∈ S . For brevity, we will use the notation I |=∃ S to denote that I |= L for some L ∈ S . Moreover, I satisfies a C-rule r , symbolically I |= r , if I |= B(r ) implies I |=∃ H(r ). A C-rule r such that I |= B(r ) is called active under I . As well, I satisfies a set P of C-rules, symbolically I |= P , if I |= r for every r ∈ P . If I |= P , we say that I is a model of P . 2.3 Viewing ASP Constructs as Abstract Constraints We want to use abstract constraints as a uniform means to represent common constructs in ASP solver languages. As an example, we recall how weight constraints (Simons et al. 2002) can be expressed as C-atoms. In a similar fashion, we can use them as abstractions of e.g., aggregates (Faber et al. 2004; Faber et al. 2011) or external atoms (Eiter et al. 2005). Note that the relation between abstract constraints and ASP constructs is well known and motivated abstract constraints in the first place (cf. Marek and Remmel 2004; Marek and Truszczyński 2004). 8 J. Oetsch, J. Pührer, and H. Tompits Definition 10 (Simons et al. 2002) A weight constraint is an expression of form l [a1 = w1 , . . . , ak = wk , not ak +1 = wk +1 , . . . , not an = wn ] u , (2) where each ai is a ground atom and each weight wi is a real number, for 1 ≤ i ≤ n. The lower bound l and the upper bound u are either a real number, ∞, or −∞. For a weight constraint to be true, the sum of weights wi of those atoms ai , 1 ≤ i ≤ k , that are true and the weights of the atoms ai , k < i ≤ n, that are false must lie within the lower and the upper bound. Thus, a weight constraint of form (2) corresponds to the C-atom hD, C i, where the domain D = {a1 , . . . , an } consists of the atoms appearing in the weight constraint and X X C = {X ⊆ D | l ≤ ( wi + wi ) ≤ u} · 1≤i≤k ,ai ∈X k <i≤n,ai 6∈X 2.4 Semantics and Characterisations based on External Support and Unfounded Sets The semantics we use (Oetsch et al. 2012a) extends the FLP-semantics (Faber et al. 2004; 2011) and coincides with the original notion of answer sets by Gelfond and Lifschitz (1991) on many important classes of logic programs, including elementary C-programs. Similar to the original definition of answer sets, Faber et al. make use of a program reduct depending on a candidate interpretation I for determining whether I satisfies a stability criterion and thus is considered an answer set. However, the reduct of Faber, Leone, and Pfeifer differs in spirit from that of Gelfond and Lifschitz as it does not reduce the program to another syntactic class (the Gelfond-Lifschitz reduct of an elementary C-program is always positive). Instead, the so-called FLP-reduct, defined next, keeps the individual rules intact and just ignores all rules that are not active under the candidate interpretation. Definition 11 Let I be an interpretation, and let P be a C-program. The FLP-reduct of P with respect to I is given by P I = {r ∈ P | r is active under I }. The notion of answer sets for abstract-constraint programs defined next provides the semantic foundation for the computation model we use for debugging. Definition 12 (Oetsch et al. 2012a) Let P be a C-program, and let I be an interpretation. I is an answer set of P if I |= P and there is no I 0 ⊂ I such that P , I , and I 0 satisfy the following condition: (?) for every r ∈ P I with I 0 |= B(r ), there is some A ∈ H(r ) with I 0 |= A and I 0 |DA = I |DA . The set of all answer sets of P is denoted by AS(P ). Stepwise Debugging of Answer-Set Programs 9 The purpose of Condition (?) is to prevent minimisation within C-atoms: the requirement I 0 |DA = I |DA ensures that a satisfier {a, b} can enforce b to be true in an answer set even if the same C-atom has a satisfier {a}. As a consequence answer sets need not be subset minimal (see Pührer 2014 for details). Our choice of semantics has high solver compatibility as its objective as we want to support Gringo, DLV, and DLVHEX. We need an FLP-style treatment of nonconvex literals for being compatible with DLVHEX, disjunctions to support DLV and DLVHEX, and we must allow for weight constraints in rule heads for compatibility with Gringo. Note that Gringo/Clasp treats aggregates in the way suggested by Ferraris (2011). As a consequence, its semantics differs from our semantics in some cases, when recursion is used through negated c-atoms, as ours is an extension of the FLP semantics. For an in-depth comparison of FLP-semantics and Ferraris semantics we refer to work by Truszczyński (2010). An example where the semantics differ is given by the single rule Gringo program a :- not 0{a}0 that has only the empty set as answer set under our semantics, whereas Clasp also admits {a} as an answer set. In practice, this difference only hardly influences the compatibility with Gringo, as aggregates are seldom used in this way. We examined all Gringo encodings send to the second ASP competition and could not find any such usage. Our framework of computations for stepping is based on a characterisation of the semantics of Definition 12 in terms of external supports. Often, answer sets are computed following a two-step strategy: First, a model of the program is built, and second, it is checked whether this model obeys a foundedness condition ensuring that it is an answer set. Intuitively, every set of atoms in an answer set must be “supported” by some active rule that derives one of the atoms. Here, it is important that the reason for this rule to be active does not depend on the atom it derives. Such rules are referred to as external support (Lee 2005). The extension of this notion to our setting is the following. Definition 13 (Oetsch et al. 2012a) Let r be a C-rule, X a set of atoms, and I an interpretation. Then, r is an external support for X with respect to I if (i) (ii) (iii) (iv) I |= B(r ), I \ X |= B(r ), there is some A ∈ H(r ) with X |DA 6= ∅ and I |DA ⊆ S , for some S ∈ CA , and for all A ∈ H(r ) with I |= A, (X ∩ I )|DA 6= ∅ holds. Condition (i) ensures that r is active. Condition (ii) prevents self-support by guaranteeing the support to be “external” of X , i.e., r is also be active without the atoms in X . In case I is a model, Items (iii) and (iv) jointly ensure that there is some C-atom A in the head of r that is satisfied by I and derives some atom of X . We can express the absence of an external support in an interpretation by the concept of an unfounded set. Definition 14 (Oetsch et al. 2012a) Let P be a C-program, X a set of atoms, and I an interpretation. Then, X is unfounded in P with respect to I if there is no C-rule r ∈ P that is an external support for X with respect to I . 10 J. Oetsch, J. Pührer, and H. Tompits Corollary 1 (Oetsch et al. 2012a) Let P be a C-program and I an interpretation. Then, I is an answer set of P iff I is a model of P and there is no set X with ∅ ⊂ X ⊆ I that is unfounded in P with respect to I . 3 Computation Framework In this section, we want to break the conceptual complexity of the semantics down to artefacts the programmer is familiar with: the rules the user has written or, more precisely, their ground instances. To this end, we introduce a framework of computations that captures the semantics described in the previous section. In this computation model, on top of which we will introduce stepping in Section 4, an interpretation is built up step-by-step by considering an increasing number of rule instances to be active. A computation in our framework is a sequence of states which are structures that keep information which rules and atoms have already been considered and what truth values were assigned to those atoms. Utilising the framework, only one rule and the atoms it contains have to be considered at once while building up an interpretation until an answer set is reached or a source for the unexpected behaviour becomes apparent. In the next two subsections, we introduce states and computations. In Section 3.3, we define and show some properties of computations that we need later on when we describe stepping. Section 3.4 is concerned with the existence of a stable computation which is a simpler form of computation that suffices for many popular classes of answer-set programs. We discuss existing work related to our computation framework later in Section 5. 3.1 States Our framework is based on sequences of states, reassembling computations, in which an increasing number of ground rules are considered that build up a monotonically growing interpretation. Besides that interpretation, states also capture literals which cannot become true in subsequent steps and sets that currently lack external support in the state’s interpretation. Definition 15 A state structure S is a tuple hP , I , I − , Υi, where P is a set of C-rules, I is an interpretation, I − a set of atoms such that I and I − are disjoint, and Υ is a collection of sets of atoms. We call DS = I ∪ I − the domain of S and define PS = P , IS = I , I − S = I − , and ΥS = Υ. A state structure hP , I , I − , Υi is a state if (i) I |= B(r ) and I |=∃ H(r ) for every r ∈ P , (ii) Dr ⊆ DS for every r ∈ P , and (iii) Υ = {X ⊆ I | X is unfounded in P with respect to I }. We call h∅, ∅, ∅, {∅}i the empty state. Stepwise Debugging of Answer-Set Programs 11 Intuitively, we use the first component P of a state to collect C-rules that the user has considered to be active and satisfied. The interpretation I collects atoms that have been considered true. Condition (i) ensures that P and I are compatible in the sense that every C-rule that is considered active and satisfied is active and satisfied with respect to I . Dual to I , the interpretation I − collects atoms that the user has considered to be false. We require that all atoms appearing in a C-rule in P is either in I or in I − which is expressed in Condition (ii). Finally, the set Υ keeps track of unfounded subsets of I , as stated in Condition (iii). Intuitively, as we will see later, when building a computation, the aim is to get rid of all unfounded sets (except for the empty set) in order to compute an answer set of a C-program. If a state does not contain such unfounded sets then we call it stable: Definition 16 A state S is stable if IS ∈ AS(PS ). The intuition is that when a state S is stable, no more C-rules need to be added to PS to provide missing external support for the atoms in the current interpretation IS . Note that a state S is stable exactly when ΥS = {∅}. For example, the empty state is a stable state. Example 1 Consider the C-rules r1 : h{a, b}, {∅, {a}, {b}, {a, b}i ← not a r2 : b←a and the state structures S1 =h{r1 }, ∅, {a, b}, {∅}i, S3 =h{r1 }, {a, b}, ∅, {∅}i, S5 =h{r2 }, {a, b}, ∅, {{b}, {a, b}}i· S2 =h{r1 }, {b}, {a}, {∅}i, S4 =h{r2 }, {a, b}, ∅, {∅}i, S1 and S2 are stable states. S3 is not a state as IS3 6|= B(r1 ). S4 is not a state as the sets {b} and {a, b} are unfounded in PS4 with respect to IS4 but {b} 6∈ ΥS4 and {a, b} 6∈ ΥS4 . S5 is a state but not stable. 3.2 Computations Next, we show how we can proceed forward in a computation, i.e., which states might follow a given state using a successor relation for state structures. Definition 17 − For a state S = hP , I , I − , Υi and a state structure S 0 = hP 0 , I 0 , I 0 , Υ0 i, S 0 is a 0 − successor of S if there is a C-rule r ∈ P \ P and sets ∆, ∆ ⊆ Dr such that (i) (ii) (iii) (iv) (v) P 0 = P ∪ {r }, − I 0 = I ∪ ∆, I 0 = I − ∪ ∆− , and DS ∩ (∆ ∪ ∆− ) = ∅, Dr ⊆ DS 0 , I |= B(r ), I 0 |= B(r ) and I 0 |=∃ H(r ), and 12 J. Oetsch, J. Pührer, and H. Tompits (vi) X 0 ∈ Υ0 iff X 0 = X ∪ ∆0 , where X ∈ Υ, ∆0 ⊆ ∆, and r is not an external support for X 0 with respect to I 0 . We denote r by rnew (S , S 0 ). Condition (i) ensures that a successor state considers exactly one rule more to be active. Conditions (ii) and (iii) express that the interpretations I and I − are extended by the so far unconsidered literals in ∆ and ∆− appearing in the new C-rule rnew (S , S 0 ). Note that from S 0 being a state structure we get that ∆ and ∆− are distinct. A requirement for considering rnew (S , S 0 ) as next C-rule is that it is active under the current interpretation I , expressed by Condition (iv). Moreover, rnew (S , S 0 ) must be satisfied and still be active under the succeeding interpretation, as required by Condition (v). The final condition ensures that the unfounded sets of the successor are extensions of the previously unfounded sets that are not externally supported by the new rule. Here, it is interesting that only extended previous unfounded sets can be unfounded sets in the extended C-program P 0 and that rnew (S , S 0 ) is the only C-rule which could provide external support for them in P 0 with respect to the new interpretation I 0 as seen next. Theorem 1 Let S be a state and S 0 a successor of S , where ∆ = IS 0 \ IS . Moreover, let X 0 be a set of literals with ∅ ⊂ X 0 ⊆ IS 0 . Then, the following statements are equivalent: (i) X 0 is unfounded in PS 0 with respect to IS 0 . (ii) X 0 = ∆0 ∪ X , where ∆0 ⊆ ∆, X ∈ ΥS , and rnew (S , S 0 ) is not an external support for X 0 with respect to IS 0 . The result shows that determining the unfounded sets in a computation after adding a further C-rule r can be done locally, i.e., only supersets of previously unfounded sets can be unfounded sets, and if such a superset has some external support then it is externally supported by r . The result also implies that the successor relation suffices to “step” from one state to another. Corollary 2 Let S be a state and S 0 a successor of S . Then, S 0 is a state. Proof We show that the Conditions (i), (ii), and (iii) of Definition 15 hold for S 0 . Consider some rule r ∈ PS 0 . In case r = rnew (S , S 0 ), IS 0 |= B(r ) and IS 0 |=∃ H(r ) hold because of Item (v) of Definition 17 and Dr ⊆ DS 0 because of Item (iii) of the same definition. Moreover, in case r 6= rnew (S , S 0 ), we have r ∈ PS . As S is a state, we have Dr ⊆ DS . Hence, since DS ⊆ DS 0 also Dr ⊆ DS 0 . Note that IS 0 |Dr = IS |Dr because of Item (ii) of Definition 17. Therefore, as IS |= B(r ) and IS |=∃ H(r ), also IS 0 |= B(r ) and IS 0 |=∃ H(r ). From these two cases, we see that Conditions (i) and (ii) of Definition 15 hold for S 0 . Finally, Condition (iii) follows from Item (vi) of Definition 17 and Theorem 1. Next, we define computations based on the notion of a state. Stepwise Debugging of Answer-Set Programs 13 Definition 18 A computation is a sequence C = S0 , . . . , Sn of states such that Si+1 is a successor of Si , for all 0 ≤ i < n. We call C rooted if S0 is the empty state and stable if each Si is stable, for 0 ≤ i ≤ n. 3.3 Properties We next define when a computation has failed, gets stuck, is complete, or has succeeded. Intuitively, failure means that the computation reached a point where no answer set of the C-program can be reached. A computation is stuck when the last state activated rules deriving literals that are inconsistent with previously chosen active rules. It is considered complete when there are no more unconsidered active rules. Finally, a computation has succeeded if an answer set has been reached. Definition 19 Let P be a C-program and C = S0 , . . . , Sn a computation such that PSn ⊆ P . Then, C is called a computation for P . Moreover, • C has failed for P at step i if there is no answer set I of P such that ISi ⊆ I , I − Si ∩ I = ∅, and PSi ⊆ P I ; • is complete for P if for every rule r ∈ P ISn , we have r ∈ PSn ; • is stuck in P if it is not complete for P but there is no successor Sn+1 of Sn such that rnew (Sn , Sn+1 ) ∈ P ; • succeeded for P if it is complete and Sn is stable. Example 2 Let PEx 2 be the C-program consisting of the C-rules r1 r2 r3 r4 r5 : a : b : a : h{c}, {∅, {c}}i : ← ← ← ← ← h{a, b}, {∅, {a, b}}i a b c that has {a, b} as its single answer set, and consider the sequences • • • • • • • C1 =h∅, ∅, ∅, {∅}i, h{r4 }, {}, {c}, {∅}i, h{r4 , r1 }, {a, b}, {c}, {{a}, {b}}i, C2 =h∅, ∅, ∅, {∅}i, h{r4 }, {}, {c}, {∅}i, h{r4 , r1 }, {a, b}, {c}, {{a}, {b}}i, h{r4 , r1 , r2 }, {a, b}, {c}, {{a}}i, h{r4 , r1 , r2 , r3 }, {a, b}, {c}, {∅}i, C3 =h{r4 , r1 , r2 , r3 }, {a, b}, {c}, {∅}i, C4 =h∅, ∅, ∅, {∅}i, h{r4 }, {c}, ∅, {∅}i, C5 =h{r4 , r1 , r2 , r3 }, {a, b, c}, ∅, {∅}i, C6 =h{r5 }, ∅, {c}, {∅}i, and C7 =h∅, ∅, ∅, {∅}i, h{r4 , r1 }, {a, b}, {c}, {{a}, {b}}i· 14 J. Oetsch, J. Pührer, and H. Tompits C1 , C2 , C3 , C4 , and C5 are computations for PEx 2 . The sequence C6 is not a computation, as h{r5 }, ∅, {c}, {∅}i is not a state. C7 is not a computation, as the second state in C7 is not a successor of the empty state. C1 , C2 , and C4 are rooted. C3 , C4 , and C5 are stable. C2 and C3 are complete and have succeeded for PEx 2 . C1 is complete for PEx 2 \ {r2 , r3 } but has failed for PEx 2 \ {r2 , r3 } at Step 0 because PEx 2 \ {r2 , r3 } has no answer set. C4 has failed for PEx 2 at Step 1. C5 has failed for PEx 2 at Step 0 and is stuck in PEx 2 . The following result guarantees the soundness of our framework of computations. Theorem 2 Let P be a C-program and C = S0 , . . . , Sn a computation that has succeeded for P . Then, ISn is an answer set of P . Proof As C is complete for P , we have P ISn ⊆ PSn . Conversely, we have PSn ⊆ P ISn because for each r ∈ PSn we have r ∈ P and ISn |= B(r ). By stability of Sn , we get that ISn ∈ AS(PSn ). The conjecture holds since then ISn ∈ AS(P ISn ). The computation model is also complete in the following sense: Theorem 3 Let S0 be a state, P a C-program with PS0 ⊆ P , and I an answer set of P with IS0 ⊆ I and I ∩ I − S0 = ∅. Then, there is a computation S0 , . . . , Sn that has succeeded for P such that PSn = P I and ISn = I . As the empty state, h∅, ∅, ∅, {∅}i, is trivially a state, we can make the completeness aspect of the previous result more apparent in the following corollary: Corollary 3 Let P be a C-program and I ∈ AS(P ). Then, there is a rooted computation S0 , . . . , Sn that has succeeded for P such that PSn = P I and ISn = I . Proof The claim follows immediately from Theorem 3 in case S0 = h∅, ∅, ∅, {∅}i. Note, that there are states that do not result from rooted computations, e.g., the state h{a ← b}, {a, b}, ∅, {∅, {a, b}, {b}}i is not a successor of any other state. However, for stable states, we can guarantee the existence of rooted computations. Corollary 4 Let S be a stable state. Then, there is a rooted computation S0 , . . . , Sn with Sn = S . Proof The result is a direct consequence of Corollary 3 and Definition 16. The next theorem lays the ground for the jumping technique that we introduce in Section 4. It allows for extending a computation by considering multiple rules of a program at once and using ASP solving itself for creating this extension. Stepwise Debugging of Answer-Set Programs 15 Theorem 4 Let P be a C-program, C = S0 , . . . , Sn a computation for P , P 0 a set of C-rules with P 0 ⊆ P , and I an answer set of PSn ∪ P 0 with ISn ⊆ I and I ∩ I − Sn = ∅. Then, there is a computation C 0 = S0 , . . . , Sn , Sn+1 , . . . , Sm for P , such that Sm is stable, I PSm = PSn ∪ P 0 and ISm = I . Proof By Theorem 3, as PSn ⊆ PSn ∪P 0 , ISn ⊆ I , and I ∩I − Sn = ∅, there is a computation I Sn , . . . , Sm that has succeeded for PSn ∪ P 0 such that PSm = (PSn ∪ P 0 ) and I ISm = I . Then, Sm is stable and, as PSn I = PSn , we have PSm = PSn ∪ P 0 . As 0 PSm ⊆ P , we have that C = S0 , . . . , Sn , Sn+1 , . . . , Sm is a computation for P . The following result illustrates that the direction one chooses for building up a certain interpretation, i.e., the order of the rules considered in a computation, is irrelevant in the sense that eventually the same state will be reached. Proposition 1 0 Let P be a C-program and C = S0 , . . . , Sn and C 0 = S00 , . . . , Sm computations 0 0 complete for P such that S0 = S0 . Then, ISn = ISm0 iff Sn = Sm and n = m. Proof The “if” direction is trivial. Let I = ISn = ISm0 . Towards a contradiction, assume PSn 6= PSm0 . Without loss of generality, we focus on the case that there is some r ∈ PSn such that r 6∈ PSm0 . Then, it holds that I |= r , I |= B(r ), and r ∈ P . Consequently, r ∈ P I . By completeness of C 0 , we have r ∈ PSm0 which contradicts our assumption. Hence, we have PSn = PSm0 . By definition of a state, from ISn = ISm0 and PSn = PSm0 , it follows that ΥSn = ΥSm0 . Towards a contradiction, assume I − Sn 6= I − Sm0 . Without loss of generality we focus on the case that there is some a ∈ I − Sn such that a 6∈ I − Sm0 . Consider the integer i where 0 < i ≤ n such that a ∈ I − Si but a 6∈ I − Si−1 . Then, by definition of a successor, for r = rnew (Si−1 , Si ), we have a ∈ ∆− for some ∆− ⊆ Dr . As then a ∈ Dr and, as PSn = PSm0 , we have r ∈ PSm0 , it must hold that a ∈ DSm0 by definition of a state structure. From I ∩ I − Sn = ∅ we know that a 6∈ I . Therefore, since a ∈ I ∪ I − Sm0 , we get that a ∈ I − Sm0 , being a contradiction to our assumption. 0 As then Sn = Sm , PS0 = PS00 , and since in every step in a computation exactly one rule is added it must hold that n = m. For rooted computations, the domain of each state is determined by the atoms in the C-rules it contains. Proposition 2 Let C = S0 , . . . , Sn be a rooted computation. Then, ISi = ISn |DPS and I − Si = i I − Sn |DPS , for all 0 ≤ i ≤ n. i 16 J. Oetsch, J. Pührer, and H. Tompits Proof The proof is by contradiction. Let j be the smallest index with 0 ≤ j ≤ n such that ISj 6= ISn |DPS or I − Sj 6= I − Sn |DPS . Note that 0 < j as IS0 = I − S0 = DPS0 = ∅. As j j Sj is a successor of Sj −1 , we have ISj = ISj −1 ∪ ∆ and I − Sj = I − Sj −1 ∪ ∆− , where ∆, ∆− ⊆ Drnew (Sj −1 ,Sj ) , DSj −1 ∩ (∆ ∪ ∆− ) = ∅, and Drnew (Sj −1 ,Sj ) ⊆ ISj ∪ I − Sj . As we have ISj −1 = ISn |DPS and I − Sj −1 = I − Sn |DPS , it holds that j −1 j −1 ISj −1 ∪ ISn |Dδ = ISn |DPS j −1 ∪ ISn |Dδ = ISn |DPS and j I − Sj −1 ∪ I − Sn |Dδ = I − Sn |DPS j −1 ∪ I − Sn |Dδ = I − Sn |DPS , j where Dδ = DPSj \ DPSj −1 . For establishing the contradiction, it suffices to show that ISn |Dδ = ∆ and I − Sn |Dδ = ∆− . Consider some a ∈ ∆. Then, a ∈ Dδ because a ∈ Drnew (Sj −1 ,Sj ) , DSj −1 ∩ (∆ ∪ ∆− ) = ∅, and DPSj −1 ⊆ DSj −1 . Moreover, a ∈ ISj implies a ∈ ISn and therefore ∆ ⊆ ISn |Dδ . Now, consider some b ∈ ISn |Dδ . As Drnew (Sj −1 ,Sj ) ⊆ ISj ∪ I − Sj , we have b ∈ ISj ∪ I − Sj . Consider the case that b ∈ I − Sj . Then, also b ∈ I − Sn which is a contradiction to b ∈ ISn as Sn is a state structure. Hence, b ∈ ISj = ISj −1 ∪ ∆. First, assume b ∈ ISj −1 . This leads to a contradiction as then b ∈ DPSj −1 since ISj −1 = ISn |DPS . It follows that b ∈ ∆ and therefore j −1 ∆ = ISn |Dδ . One can show that ∆− = I − Sn |Dδ analogously. 3.4 Stable Computations In this section, we are concerned with the existence of stable computations, i.e., computations that do not involve unfounded sets. We single out an important class of C-programs for which one can solely rely on this type of computation and also give examples of C-programs that do not allow for succeeding stable computations. Intuitively, the ΣP 2 -hardness of the semantics (cf. Pührer 2014), demands for unstable computations in the general case. This becomes obvious when considering that for a given C-program one could guess a candidate sequence C for a stable computation in polynomial time. Then, a polynomial number of checks whether each state is a successor of the previous one in the sequence suffices to establish whether C is a computation. Following Definition 17, these checks can be done in polynomial time when we are allowed to omit Condition (vi) for unfounded sets. Hence, answer-set existence for the class of C-programs for which every answer set can be built up with stable computations is in NP. Naturally, it is interesting whether there are syntactic classes of C-programs for which we can rely on stable computations only. It turns out that many syntactically simple C-programs already require the use of unfounded sets. Example 3 Consider C-program PEx 3 consisting of the C-rules r1 : a ← b and r2 : b ← h{a}, {∅, {a}}i· Stepwise Debugging of Answer-Set Programs 17 We have that {a, b} is the only answer set of PEx 3 and C =h∅, ∅, ∅, {∅}i, h{r2 }, {a, b}, ∅, {∅, {a}}i, h{r2 , r1 }, {a, b}, ∅, {∅}i is the only computation that succeeds for PEx 3 : starting at the empty state, only rule r2 is active, thus it must be the new rule in the successor. When, deciding the truth values for the atoms in Dr2 , r2 requires b to be positive, and a must be true as well, as otherwise the computation is stuck due to violation of r1 . The second state of C contains the singleton {a} as unfounded set. As Example 3 shows, unstable computations are already required for a C-program without disjunction and a single monotone C-atom. Hence, also the use of weaker restrictions, like convexity of C-atoms or some notion of head-cycle freeness (BenEliyahu and Dechter 1994), is not sufficient. One can observe, that the C-program from the example has cyclic positive dependencies between atoms a and b. Hence, we next explore whether such dependencies influence the need for computations that are not stable. To this end, we introduce notions of positive dependency in a C-program. Definition 20 Let S be a set of C-literals. Then, the positive normal form of S is given by S + = {A | A ∈ S , A is a C-atom} ∪ {Ā | not A ∈ S }, where Ā = hDA , 2DA \ CDA i is the complement of A. Furthermore, the set of positive S atom occurrences in S is given by posOcc(S ) = A∈S + ,X ∈CA X . Let P be a C-program. The positive dependency graph of P is the directed graph G(P ) = hDP , {ha, bi | r ∈ P , a ∈ posOcc(H(r )), b ∈ posOcc(B(r ))}i· We next introduce the notion of absolute tightness for describing C-programs without cyclic positive dependencies after recalling basic notions of graph theory. For a (directed) graph G = hV , ≺i, the reachability relation of G is the transitive closure of ≺. Let ≺0 be the reachability relation of G. Then, G is acyclic if there is no v ∈ V such that v ≺0 v . Definition 21 Let P be a C-program. P is absolutely tight if G(P ) is acyclic. One could assume that absolute tightness paired with convexity or monotonicity is sufficient to guarantee stable computations because absolute tightness forbids positive dependencies among disjuncts and the absence of such dependencies lowers the complexity of elementary C-programs (Ben-Eliyahu and Dechter 1994). However, as the following example illustrates, this is not the case for general C-programs. Example 4 Consider C-program PEx 4 consisting of the C-rules r1 : a ∨ h{a, b}, {{a}, {a, b}}i ← r2 : b ∨ h{a, b}, {{b}, {a, b}}i ← 18 J. Oetsch, J. Pührer, and H. Tompits We have that {a, b} is the only answer set of PEx 4 and C1 =h∅, ∅, ∅, {∅}i, h{r1 }, {a, b}, ∅, {∅, {b}}i, h{r1 , r2 }, {a, b}, ∅, {∅}i and C2 =h∅, ∅, ∅, {∅}i, h{r2 }, {a, b}, ∅, {∅, {a}}i, h{r1 , r2 }, {a, b}, ∅, {∅}i are the only computations that succeed for PEx 4 . Clearly, PEx 4 is monotone and absolutely tight but C1 and C2 are not stable. Nevertheless, we can assure the existence of stable computations for answer sets of normal C-programs that are absolutely tight and convex. This is good news, as this class corresponds to a large subset of typical answer-set programs written for solvers like Clasp that do not rely on disjunction as their guessing device. Theorem 5 Let C = S0 , . . . , Sn be a computation such that S0 and Sn are stable and P∆ = PSn \ PS0 is a normal, convex, and absolutely tight C-program. Then, there is a stable computation C0 = S00 , . . . , Sn0 such that S0 = S00 and Sn = Sn0 . As a direct consequence of Theorem 5 and Corollary 3, we get an improved completeness result for normal convex C-programs that are absolutely tight, i.e., we can find a computation that consists of stable states only. Corollary 5 Let P be a normal C-program that is convex and absolutely tight, and consider some I ∈ AS(P ). Then, there is a rooted stable computation S0 , . . . , Sn such that PSn = P I and ISn = I . Proof From I ∈ AS(P ), we get by Corollary 3 that there is a rooted computation S0 , . . . , Sn such that PSn = P I and ISn = I . Note that S0 is the empty state. S0 and Sn are stable according to Definition 16. From Theorem 5, we can conclude the existence of another computation C0 = S00 , . . . , Sn0 such that S0 = S00 and Sn = Sn0 that is stable. Clearly, C0 is also rooted. 4 Theory and Practice of Stepping In this section we present our methodology for stepping answer-set programs based on the computation model introduced in the previous section. Step-by-step execution of a program is common practice in procedural programming languages, where developers can debug and investigate the behaviour of their programs in an incremental way. The technique introduced in this work shows how this popular form of debugging can be applied to ASP, despite the genuine declarative semantics of answer-set programs that lacks a control flow. Its main application Stepwise Debugging of Answer-Set Programs 19 is debugging but it is also beneficial in other contexts such as improving the understanding of a given answer-set program or teaching the answer-set semantics to beginners. For stepping to be a practical support technique for answer-set programmers rather than a purely theoretical approach, we assume the availability of a support environment that assists a user in a stepping session. A prototype our stepping framework has been implemented in SeaLion, an integrated development environment (IDE) for ASP (Oetsch et al. 2013). It was developed as one of the major goals of a research project on methods and methodologies for developing answerset programs conducted at Vienna University of Technology (2009-2013). SeaLion supports the ASP languages of Gringo and DLV and comes as a plugin of the Eclipse platform that is popular for Java development. All the features of a stepping support environment described in this section are implemented in SeaLion, if not stated otherwise. To bridge the gap between theory and practical stepping, our examples use solver syntax rather than the abstract language of c-programs. We implicitly identify solver constructs with their abstract counterparts (cf. Section 2.3). While we use c-programs as a formal lingua franca for different solver languages, we do not require the user to know about it. Likewise, we do not expect a user to be aware of the specifics of the computation framework of Section 3 that provides the backbone of stepping. For example, the user does not need to know the properties of Definition 17. The debugging environment automatically restricts the available choices a user has when performing a step to ones that result in valid successor states. In the following subsection, we introduce an example scenario that we use later on. In Section 4.2, we describe the general idea of stepping for ASP. There are two major ways for navigating in a computation in our framework: performing steps, discussed in Section 4.3, and jumps that we describe in Section 4.4. In Section 4.5, we describe the stepping interface of SeaLion. Building on steps and jumps, we discuss methodological aspects of stepping for debugging purposes in Section 4.6 and provide a number of use cases. 4.1 Example Scenario - Maze Generation Next, we introduce the problem of maze generation that serves as a running example in the remainder of the paper. It has been a benchmark problem of the second ASP competition (Denecker et al. 2009) to which it was submitted by Martin Brain. The original problem description is available on the competition’s website.2 As the name of the problem indicates, the task we deal with is to generate a maze, i.e., a labyrinth structure in a grid that satisfies certain conditions. In particular, we deal with two-dimensional grids of cells where each cell can be assigned to be either an empty space or a wall. Moreover, there are two (distinct) empty squares on the edge of the grid, known as the entrance and the exit. A path is a finite sequence of 2 http://dtai.cs.kuleuven.be/events/ASP-competition/Benchmarks/MazeGeneration.shtml 20 J. Oetsch, J. Pührer, and H. Tompits Fig. 1: Left: A grid visualising an instance of the maze generation where white squares represent empty cells, whereas grey squares are yet undefined. Right: A solution for the instance on the left. cells, in which each distinct cell appears at most once and each cell is horizontally or vertically adjacent to the next cell in the sequence. Such a grid is a valid maze if it meets the following criteria: 1. Each cell is a wall or is empty. 2. There must be a path from the entrance to every empty cell (including the exit). 3. If a cell is on any of the edges of the grid, and is not an entrance or an exit, it must contain a wall. 4. There must be no 2x2 blocks of empty cells or walls. 5. No wall can be completely surrounded by empty cells. 6. If two walls are diagonally adjacent then one or other of their common neighbours must be a wall. The maze generation problem is the problem of completing a two-dimensional grid in which some cells are already decided to be empty or walls and the entrance and the exit are pre-defined to a valid maze. An example of a problem instance and a corresponding solution maze is depicted in Fig. 1. Next, we describe the predicate schema that we use for ASP maze generation encodings. The predicates col/1 and row/1 define the columns and rows in the grid, respectively. They are represented by a range of consecutive, ascending integers, starting at 1. The positions of the entrance and the exit are determined by predicates entrance/2 and exit/2, respectively, where the first argument is a column index and the second argument is a row index. In a similar manner, empty/2 and wall/2 determine which cells are empty or contain walls. For example, the instance of Fig. 1 can be encoded by program Π1 consisting of the following facts: col(1..5). row(1..5). entrance(1,2). exit(5,4). wall(3,3). empty(3,4). Moreover, the solution in the figure could be represented by the following interpretation (projected to predicates empty/2 and wall/2): {wall(1,1), empty(1,2), wall(1,3), wall(1,4), wall(1,5), Stepwise Debugging of Answer-Set Programs wall(2,1), wall(3,1), wall(4,1), wall(5,1), 21 empty(2,2), empty(2,3), empty(2,4), wall(2,5), wall(3,2), wall(3,3), empty(3,4), wall(3,5), empty(4,2), empty(4,3), empty(4,4), wall(4,5), wall(5,2), wall(5,3), empty(5,4), wall(5,5)} 4.2 General Idea We introduce stepping for ASP as a strategy to identify mismatches between the intended semantics of an answer-set program under development and its actual semantics. Due to the declarativity of ASP, once one detects unintended semantics, it can be a tough problem to manually detect the reason. Stepping is a method for breaking this problem into smaller parts and structuring the search for an error. The general idea is to monotonically build up an interpretation by, in each step, adding literals derived by a rule that is active with respect to the interpretation obtained in the previous step. The process is interactive in the sense that at each such step the user chooses the active rule to proceed with and decides which literals of the rule should be considered true or false in the target interpretation. Hereby, the user only adds rules he or she thinks are active in an expected or an unintended actual answer set. The interpretation grows monotonically until it is eventually guaranteed to be an answer set of the overall program, otherwise the programmer is informed why and at which step something went wrong. This way, one can in principle without any backtracking direct the computation towards the interpretation one has in mind. In debugging, having the programmer in the role of an oracle is a common scenario as it is reasonable to assume that a programmer has good intuitions on where to guide the search (Shapiro 1982). We use the computation model of Section 3 to ensure that, if the interpretation specified in this way is indeed an answer set, the process of stepping will eventually terminate with the interpretation as its result. Otherwise, the computation will fail at some step where the user gets insight why the interpretation is not an answer set, e.g., when a constraint becomes irrevocably active or no further rule is active that could derive some desired literal. 4.3 Steps By a step we mean the extension of a computation by a further state. We consider a setting, where a programmer has written an answer-set program in a solver language for which C-program P it the abstraction of its grounding. Moreover, we assume that the programmer has obtained some computation for P that is neither stuck in P nor complete for P . For performing a step, one needs to find a successor state Sn+1 for Sn such that C 0 = S0 , . . . , Sn+1 is a computation for P . We propose a sequence of three user actions to perform a step. Intuitively, for quickly finding a successor state (with the help of the debugging environment), we suggest to 1. select a non-ground rule with active ground instances, then 2. choose an active ground rule among the instances of the non-ground rule, and 22 J. Oetsch, J. Pührer, and H. Tompits 3. select for yet undefined atoms in the domain of the ground instance whether they are considered true or false. First, the user selects a non-ground rule ρ. In SeaLion, this can be done by directly selecting ρ in the editor in which the program was written. The debugging system can support this user action by automatically determining the subset of rules in the program that have at least one instance r in their grounding that could lead to a successor state, i.e., r = rnew (Sn , S ) for some successor S of Sn . Then, the user selects an instance r from the grounding of ρ. As the ground instances of ρ are not part of the original program, picking one requires a different approach as for choosing ρ. Here, the debugging environment can display the ground rules in a dedicated area and, as before, restrict the choice of rule groundings of ρ to ones that lead to a successor state. Filtering techniques can be used to restrict the amount of the remaining instances. In SeaLion, the user defines partial assignments for the variables in ρ that determine a subset of the considered instances. In the third user action for performing a step, the programmer chooses the truth values for the atoms in Dr that are neither in ISn nor in I − Sn . This choice must be made in a way such that there is a successor Sn+1 of Sn with PSn+1 = PSn ∪ {r }, ISn+1 = ISn ∪∆, and I − Sn+1 = I − Sn ∪∆− , where ∆ contains the atoms the user chose to be true and ∆− the atoms considered false. That is, Sn , ∆, and ∆− must fulfil the conditions of Definition 17. Here, the user needs only to ensure that Condition (v) of Definition 17 holds, i.e., ISn+1 |= B(r ) and ISn+1 |=∃ H(r ), as the other conditions automatically hold once all unassigned atoms have been assigned to ∆ and ∆− . In particular, the set of unfounded sets, ΥSn+1 can always be automatically computed following Condition (vi) of Definition 17 and does not impose restrictions on the choice of ∆ and ∆− . The support system can check whether Condition (v) holds for the truth assignment specified by the user. Also, atoms are automatically assigning to ∆ or ∆− whenever their truth values are the same for all successor states that are based on adding r . Example 5 As a first step for developing the maze-generation encoding, we want to identify border cells and guess an assignment of walls and empty cells. Our initial program is Π2 , given next. maxCol(X) :- col(X), not col(X+1). maxRow(Y) :- row(Y), not row(Y+1). border(1,Y) :- col(1), row(Y). border(X,1) :- col(X), row(1). border(X,Y) :- row(Y), maxCol(X). border(X,Y) :- col(X), maxRow(Y). wall(X,Y) :- border(X,Y), not entrance(X,Y), not exit(X,Y). { wall(X,Y) : col(X), row(Y), not border(X,Y) }. empty(X,Y) :- col(X), row(Y), not wall(X,Y). The first two rules extract the numbers of columns and rows of the maze from the Stepwise Debugging of Answer-Set Programs 23 input facts of predicates col/1 and row/1. The next four rules derive border/2 atoms that indicate which cells form the border of the grid. The final three rules derive wall/2 atoms for border cells except entrance and exit, guess wall/2 atoms for the remaining cells, and derive empty/2 atoms for non-wall cells, respectively. We use Π2 in conjunction with the facts in program Π1 (defined in Section 4.1) that determine the problem instance. We start a stepping session with the computation C0 = S0 consisting of the empty state S0 = h∅, ∅, ∅, {∅}i. Following the scheme of user actions described above for performing a step, we first look for a non-ground rule with instances that are active under IS0 . As IS0 = ∅, only the facts from Π1 have active instances. We choose the rule entrance(1,2). In this case, the only (active) instance of the rule is identical to the rule, i.e., the fact: entrance(1,2). The only atom in the domain of the rule instance is entrance(1,2). Therefore, when performing the final user action for a step one has to decide the truth value of this atom. In order to fulfil Condition (v) of Definition 17, the rule head, i.e., entrance(1,2), must be true in the successor state. Thus, our first step results in the computation C1 = S0 , S1 where S1 = h{entrance(1,2).}, {entrance(1,2)}, ∅, {∅}i· For the next step, we choose the rule col(1..5). from Π1 . The grounding3 by Gringo consists of the following instances: col(1). col(2). col(3). col(4). col(5). We select the instance col(5). Since the head of the rule must be true under the successor state, as before, atom col(5) must be considered true in the successor state of S1 . The resulting computation after the second step is C2 = S0 , S1 , S2 , where S2 = h{entrance(1,2).col(5).}, {entrance(1,2), col(5)}, ∅, {∅}i· Under IS2 a further rule in Π1 ∪ Π2 has active instances: maxCol(X) :- col(X), not col(X+1). That is, it has the active instance maxCol(5) :- col(5), not col(6). that we choose for the next step. In order to ensure that Condition (v) of Definition 17 is satisfied, we need to ensure that head and body are satisfied under the successor state. Hence, atom maxCol(5) has to be considered true, whereas col(6) must be considered false. We obtain the computation C3 = S0 , S1 , S2 , S3 , where S3 = h{entrance(1,2).col(5).maxCol(5) :- col(5), not col(6).}, {entrance(1,2), col(5), maxCol(5)}, {col(6)}, {∅}i· 3 Remember that grounding refers to the translation performed by the grounding tool rather than mere variable elimination. 24 J. Oetsch, J. Pührer, and H. Tompits 4.4 Jumps If one wants to simulate the computation of an answer set I in a stepping session using steps only, as many steps are necessary as there are active rules in the grounding under I . Although, typically the number of active ground instances is much less than the total number of rules in the grounding, still many rules would have to be considered. In order to focus on the parts of a computation that the user is interested in, we introduce a jumping technique for quickly considering rules that are of minor interest, e.g., for rules that are already considered correct. We say that we jump through these rules. By performing a jump, we mean to find a state that could be reached by a computation for the program at hand that extends the current computation by possibly multiple states. If such a state can be found, one can continue to expand a computation from that while it is ensured that the same states could be reached by using steps only. Jumps can be performed exploiting Theorem 4. In essence, jumping is done as follows. 1. Select rules that you want to jump through (i.e., the rules you want to be considered in the state to jump to), 2. an auxiliary answer-set program is created that contains the selected rules and the active rules of the current computations final state, and 3. a new state is computed from an answer set of the auxiliary program. Next, we describe the items in more detail. We assume that an answer-set program in a solver language for which C-program P it the abstraction of its grounding and a computation S0 , . . . , Sn for P are given. The first user action is to select a subset P 0 of P , the rules to jump through. Hence, an implication for a stepping support environment is the necessity of means to select the ground instances that form P 0 . In case the user wants to consider all instances of some non-ground rules, a very user friendly way of selecting these is to simply select the non-ground rules and the environment implicitly considers P 0 to be their instances. SeaLion implements this feature such that this selection can be done in the editor in which the answer-set program is written. If the user wants to jump through only some instances of a non-ground rule, we need further user-interface features. In order to keep memory resources and the amount of rules that have to be considered by the user low, the system splits the selection of an instance in two phases. First, the user selects a non-ground rule ρ, similar as in the first user action of defining a step. Then, the system provides so far unconsidered rules of P for selection, where similar filtering techniques as sketched for the second user action for performing a step can be applied. The auxiliary program of the second item can be automatically computed. That is a C-program Paux given by Paux = PSn ∪ P 0 ∪ Pcon , where Pcon ={← not a | a ∈ ISn } ∪ {← a | a ∈ I − Sn } is a set of constraints that ensure that for every answer set I of Paux we have ISn ⊆ I and I ∩ I − Sn = ∅. After computing an answer set I of the auxiliary program, Theorem 4 ensures Stepwise Debugging of Answer-Set Programs 25 Choose truth values for atoms in Dr Compute answer set of auxiliary program for jumping through P ′ obtain a new state Initialise Computation set S to the empty state Set P ′ = ∅ if desired. Add a set of ground instances of ρ to P ′ Choose a ground instance r of ρ Current state S jump step Choose a non-ground rule ρ Choose a non-ground rule ρ Fig. 2: Stepping cycle the existence of a computation C 0 = S0 , . . . , Sn , Sn+1 , . . . , Sm for P such that Sm I is stable and ISm = I . Moreover, we have PSm = PSn ∪ P 0 . Then, the user can proceed with further steps or jumps extending the computation S0 , . . . , Sm as if Sm had been reached by steps only. Note that non-existence of answer sets of the auxiliary program does not imply that the overall program has no answer sets as shown next. Example 6 Consider a program P consisting of the C-rules a ← and ← not a that has {a} as its unique answer set. Assume we want to jump through the second rule starting from the computation C = h∅, ∅, ∅, {∅}i consisting of the empty state. Then, Paux = {← not a} has no answer set. The example shows that jumping only makes sense when the user is interested in a computation reaching an answer set of the auxiliary program. In case of multiple answer sets of the auxiliary program, the user could pick any or a stepping environment can choose one at random. For practical reasons, the second option seems more preferable. On the one hand, presenting multiple answer sets to the user can lead to a large amount of information that has to be stored and processed by the user. And on the other hand, if the user is not happy with the truth value of some atoms in an arbitrary answer set of the auxiliary program, he or she can use steps to define the truth of these atoms before performing the jump. In SeaLion only one answer set of the auxiliary program is computed. The iterative extension of a computation using steps and jumps can be described as a stepping cycle that is depicted in Fig. 2. It summarises how a user may advance a computation and thus provides a technical level representation of stepping. Example 7 We continue computation C3 for program Π1 ∪ Π2 from Example 5. As we are interested in the final three rules of Π2 that derive empty/2 and wall/2 atoms but these rules depend on atoms of predicate border/2, entrance/2, and exit/2 that are not yet considered in C3 , we jump through the facts from Π1 and the rules 26 J. Oetsch, J. Pührer, and H. Tompits maxCol(X) :- col(X), not col(X+1). maxRow(Y) :- row(Y), not row(Y+1). border(1,Y) :- col(1), row(Y). border(X,1) :- col(X), row(1). border(X,Y) :- row(Y), maxCol(X). border(X,Y) :- col(X), maxRow(Y). of program Π2 . The resulting auxiliary program Π3 is given by the following rules (for non-ground rules, their unconsidered instances in the grounding of Π1 ∪ Π2 ). entrance(1,2). col(5). maxCol(5) :- col(5), not col(6). col(1..5). row(1..5). exit(5,4). wall(3,3). empty(3,4). maxCol(X) :- col(X), not col(X+1). maxRow(Y) :- row(Y), not row(Y+1). border(1,Y) :- col(1), row(Y). border(X,1) :- col(X), row(1). border(X,Y) :- row(Y), maxCol(X). border(X,Y) :- col(X), maxRow(Y). ::::- not entrance(1,2). not col(5). not maxCol(5). col(6). The program Π3 has the single answer set Iaux consisting of the atoms: col(1), col(2), col(3), col(4), col(5), maxCol(5), row(1), row(2), row(3), row(4), row(5), maxRow(5), empty(3,4), wall(3,3), entrance(1,2), exit(5,4), border(1,1), border(2,1), border(3,1), border(4,1), border(5,1), border(1,2), border(5,2), border(1,3), border(5,3), border(1,4), border(5,4), border(1,5), border(2,5), border(3,5), border(4,5), border(5,5), We obtain the new state S4 = hPS4 , Iaux , DPS4 \ Iaux , {∅}i, where PS4 consists of the following rules: col(1). col(2). col(3). col(4). col(5). row(1). row(2). row(3). row(4). row(5). wall(3,3). empty(3,4). entrance(1,2). exit(5,4). maxCol(5) :- col(5), not col(6). maxRow(5) :- row(5), not row(6). border(1,1) :- col(1), row(1). border(2,1) :- col(2), row(1). Stepwise Debugging of Answer-Set Programs border(3,1) border(4,1) border(5,1) border(1,2) border(5,2) border(1,3) border(5,3) border(1,4) border(5,4) border(1,5) border(5,1) border(5,5) border(1,5) border(2,5) border(3,5) border(4,5) border(5,5) :::::::::::::::::- col(3), col(4), col(5), col(1), row(2), col(1), row(3), col(1), row(4), col(1), row(1), row(5), col(1), col(2), col(3), col(4), col(5), 27 row(1). row(1). row(1). row(2). maxCol(5). row(3). maxCol(5). row(4). maxCol(5). row(5). maxCol(5). maxCol(5). maxRow(5). maxRow(5). maxRow(5). maxRow(5). maxRow(5). Theorem 4 ensures the existence of a computation C4 = S0 , S1 , S2 , S3 , . . . , S4 for program Π1 ∪ Π2 . 4.5 Stepping Interface of SeaLion In the following, we focus on the stepping functionality of SeaLion that was implemented by our former student Peter Skočovský. While it is the first implementation of the stepping technique for ASP and hence still a prototype, it is tailored for intuitive and user-friendly usage and able to cope with real-world answer-set programs. The stepping feature is integrated with the Kara plugin of SeaLion (Kloimüllner et al. 2013) that can create user-defined graphical representations of interpretations. Thus, besides visualising answer sets, it is also possible to visualise intermediate states of a stepping session. Visualisations in Kara are defined using ASP itself, for further information we refer to earlier work (Kloimüllner et al. 2013). A comprehensive discussion of other features of SeaLion is given in a related paper (Busoniu et al. 2013) on the IDE. SeaLion is published under the GNU General Public License and can be obtained from www.sealion.at A stepping session in SeaLion can be started in a similar fashion as debugging Java programs in Eclipse using the launch configuration framework. SeaLion launch configurations that are used for defining which program files should be run with which solvers can be re-used as debug configurations. Like many IDEs, Eclipse comes with a multiple document interface in which inner frames, in particular Eclipse editors and views, can be arranged freely by the user. Such configurations can be persisted as perspectives. Eclipse plugins often come with default perspectives, i.e., arrangements of views and editors that are tailored to a specific user task in the context of the plugin. Also the stepping plugin has a preconfigured perspective that is opened automatically once a stepping session has 28 J. Oetsch, J. Pührer, and H. Tompits Fig. 3: SeaLion’s stepping view is devided into five areas (a-e). been initiated. The next subsection gives an overview of the individual stepping related subframes in this perspective. Fig. 3 shows SeaLion in the stepping perspective. The illustration distinguishes five regions (marked by supplementary dashed frames and labelled by letters) for which we give an overview in what follows. The source code editor (Fig. 3a) is the same as used for writing answer-set programs but extended with additional functionality during stepping mode for the ASP files involved in the stepping session. In particular it indicates rules with ground instances that are active under the interpretation of the current stepping state. Constraints with active instances are highlighted by a red background (cf. Fig. 9), other rules with active instances have a blue background (as, e.g., in Fig. 4). The editor remains functional during stepping, i.e., the program can be modified while debugging. Note, however, that the system does not guarantee that the current computation is still a valid computation in case of a modification of the answerset program after stepping has been initiated. The source code editor is also the starting point for performing a step or a jump as it allows for directly selecting the non-ground rule(s) to be considered in the step or jump in the source code. The choice of non-ground rules corresponds to the initial step in the stepping cycle (see Section 4.4). Selecting a single rule or consecutive rules is done by directly selecting them in the source code editor. If the rules are non-consecutive, the user must collect rules in the jump view located in area c of Fig. 3 as the second tab. Stepwise Debugging of Answer-Set Programs 29 Choosing a ground instance for performing a step is done in the active instances view (Fig. 3b). It contains a list with all active ground instances (with respect to conditional grounding) of the currently selected rule in the source editor. As these are potentially many, the view has a textfield for filtering the list of rules. Filters are given as dot-separated list of variable assignments of the form X=t where X is a variable of the non-ground rule and t is the ground term that the user considers X to be assigned to. Only ground instances are listed that obey all variable substitutions of the entered filters. Once a rule instance is selected in the active instances view the atoms in the rule’s domain are displayed in three lists of the truth assignment view (Fig. 3c). The list in the centre shows atoms whose truth value has not already been determined in the current state. The user can decide whether they should be true, respectively false, in the next step by putting them into the list on the left, respectively, on the right. These atoms can be transferred between the lists by using keyboard cursors or drag-and-drop (Fig. 4). After the truth value has been decided for all the atoms of the rule instance and only in case that the truth assignment leads to a valid successor state (cf. Definition 17), a button labelled “Step” appears. Clicking this button computes the new state. The state view (Fig. 3d) shows the current stepping state of the debugging session. Hence, it is updated after every step or jump. It comprises four areas, corresponding to the components of the state (cf. Definition 15), the list of active rules instances, a tree-shaped representation of the atoms considered true, a tree-shaped representation of the atoms considered false, both in a similar graphical representation as that of interpretations in the interpretation view, and an area displaying the unfounded sets in a similar way. The sets of atoms displayed in this view can also be visualised using Kara (via options in the context menu). Finally, the computation view (Fig. 3e) gives an overview of the steps and jumps performed so far. Importantly, the view implements an undo-redo mechanism. That is, by clicking on one of the nodes displayed in the view, representing a previous step or jump, the computation can be reset to the state after this step or jump has been performed. Moreover, after performing an undo operation, the undone computation is not lost but becomes an inactive branch of the tree-shaped representation of steps and jumps. Thus, one can immediately jump back to any state that has been reached in the stepping session by clicking on a respective node in the tree (Fig. 6). Mismatches between the users intentions (reflected in the current stepping state) and the actual semantics of the program can be detected in different parts of the stepping perspective. If the user thinks a rule instance should be active but it is not, this can already be seen in the source code editor if the non-ground version of the rule does not have any active instance. Then, the rule is not highlighted in the editor. If the non-ground version does have active instances but not the one the user has in mind, this can be detected after clicking on the non-ground rule if they are missing in the active instances view. The computation is stuck if only rules are highlighted in the source editor that are constraints (cf. Fig. 9) or for all of its instances, no truth assignment can be established such that the “Step” button appears. 30 J. Oetsch, J. Pührer, and H. Tompits Finally, if no further rule is highlighted and there is no non-empty unfounded set visible in the state view, the atoms considered positive form an answer set of the overall program. If there are further unfounded sets, the user sees that the constructed interpretation is not stable. The unfounded sets indicate which atoms would need external support. 4.6 Methodology We identify three three conceptual levels of stepping as a methodology. The technical level corresponds to the iterative advancement of a computation covered in Sections 4.3 and 4.4 summarised in the stepping cycle (Fig. 2). Next, we describe stepping on the application level as a method for debugging and program analysis. After that, we highlight how stepping is embedded in the greater context of ASP development from a top level perspective. Finally, we illustrate our approach in different usage scenarios. In Appendix A, we compile practical guidelines for our methodology. Program Analysis and Debugging Level Methodology The main purpose for stepping in the context of this paper is its application for debugging and analysing answer-set programs. Next, we describe how insight into a program is gained using stepping. During stepping, the user follows his or her intuitions on which rule(s) to apply next and which atoms to consider true or false. In this way, an interpretation is built up that either is or is not an answer set of the program. In both cases, stepping can be used to analyse the interplay of rules in the program in the same manner, i.e., one can see which rule instances become active or inactive after each step or jump. In the case that the targeted interpretation is an answer set of the program, the computation will never fail (in the sense of Definition 19) or get stuck and will finally succeed. It can, however, happen that intermediate states in the computation are unstable (cf. Example 3). For debugging, stepping towards an answer set is useful if the answer set is unwanted. In particular, one can see why a constraint (or a group of rules supposed to have a constraining effect) does not become active. For instance, stepping reveals other active rules that derive atoms that make some literal in the constraint false or rules that fail do derive atoms that activate the constraint. Stepping towards an actual answer set of a program is illustrated in Example 8. In the case that there is an answer set that the user expects to be different, i.e., certain atoms are missing or unwanted, it makes sense to follow the approach that we recommend for expected but missing answer sets, i.e., stepping towards the interpretation that the user wants to be an answer set. Then, the computation is guaranteed to fail at some point, i.e., there is some state in the computation from which no more answer set of the program can be reached. In other situations, the computation can already have failed before the bug can be found, e.g., the computation can have failed from the beginning in case the program has no answer sets at all. Nevertheless, the error can be found when stepping towards the intended Stepwise Debugging of Answer-Set Programs 31 interpretation. In most cases, there will be either a rule instance that becomes active that the user considered inactive, or the other way around, i.e., a rule instance never becomes active or is deactivated while the computation progresses. Eventually, due to our completeness results in the previous section, the computation will either get stuck or ends in an unstable state S such that no active external support for a nonempty unfounded set from ΥS is available in the program’s grounding. Stepping towards an interpretation that is not an answer set of the overall program can be seen as a form of hypothetical reasoning: the user can investigate how rules of a part of the program support each other before adding a further rule would cause an inconsistency. Example 9 illustrates stepping towards an intended but non-existing answer set for finding a bug. Another illustration of hypothetical reasoning is given in Example 10 where a user tries to understand why an interpretation that is not supposed to be an answer set is indeed no answer set. Note that stepping does not provide explanation artefacts, analogous to stepping in imperative languages, where insight in a problem is gained by simply following the control flow and watching variable assignments. In our setting, the user only sees which remaining rule instances are active and the current state of the computation which in principle suffices to notice differences to his or her expectations. Nevertheless, it can be useful to combine this approach with query based debugging methods that provide explicit explanations as will be discussed in Section 5. As mentioned in Section 4.2, if one has a clear idea on the interpretation one expects to be an answer set, stepping allows for building up a computation for this interpretation without backtracking. In practice, one often lacks a clear vision on the truth value of each and every atom with respect to a desired answer set. As a consequence, the user may require revising the decisions he or she has taken on the truth values of atoms as well as on which rules to add to the computation. For this reason, SeaLion allows for retracting a computation to a previous state, i.e., let the user select one of the states in the computation and continue stepping from there. This way a tree of states can be built up (as in Fig. 9), where every path from the root node to a leaf node is a rooted computation. Top-Level Methodology Stepping must be understood as embedded in the programming and modelling process, i.e., the technique has to be recognised in the context of developing answerset programs. A practical consequence of viewing stepping in the big picture are several possibilities for exploiting information obtained during the development of a program for doing stepping faster and more accurate. While an answer-set program evolves, the programmer will in many cases compute answer sets of preliminary versions of the program for testing purposes. If this answer sets are persisted, they can often be used as a starting point for stepping sessions for later versions of the program. For instance, in case the grounding P of a previous version of a program is a subset of the current grounding P 0 it is obvious that a successful computation C for P is also a computation for P 0 . Hence, the user can initiate a stepping session starting from C . Also in case that P 6⊂ P 0 , a 32 J. Oetsch, J. Pührer, and H. Tompits stepping support system could often automatically build a computation that uses an answer set of P (or parts of it) as guidance for deciding on the rules to add and the truth values to assign in consecutive states. Likewise, (parts of) computations of stepping sessions for previous versions of a program can be stored and re-used either as a computation of the current program if applicable or for computing such a computation. The idea is that previous versions of a program often constitute a part of the current version that one is already familiar with and “trusts” in. By starting from a computation that already considers a well-known part of the program, the user can concentrate on new and often more suspicious parts of the program. Currently, there is no such feature implemented in SeaLion. Use Cases Next, we show application scenarios of stepping using our running example. The first scenario illustrates stepping towards an interpretation that is an answer set of the program under consideration. Example 8 We want to step towards an answer set of our partial encoding of the maze generation problem, i.e., of the program Π1 ∪ Π2 . Therefore, we continue our stepping session with computation C4 , i.e., we start stepping from state S4 that we obtained in Example 7. In particular, we want to reach an answer set that is compatible with the maze generation solution depicted in Fig. 1. To this end, we start with stepping through the active instances of the rule {wall(X,Y) : col(X), row(Y), not border(X,Y)}. The only active instance of the rule is {wall(2,2), wall(3,2), wall(4,2), wall(2,3), wall(3,3), wall(4,3), wall(2,4), wall(3,4), wall(4,4)}. Thus, we next choose a truth assignment for the atoms appearing in the instance’s choice atom. Note that we do not need to decide for the truth value of wall(3,3) as it is already contained in IS4 and therefore already considered true. As can be observed in Fig. 1, among the remaining cells the rule deals with, only the one at position (3, 2) is a wall in our example. Hence, we obtain a new state S5 from S4 by extending PS4 by our rule instance, IS4 by wall(3,2), and I − S4 by wall(2,2), wall(4,2), wall(2,3), wall(4,3), wall(2,4), wall(3,4), wall(4,4). As in S4 , the empty set is the only unfounded set in state S5 . It remains to jump through the rules wall(X,Y) :- border(X,Y), not entrance(X,Y), not exit(X,Y). and empty(X,Y) :- col(X), row(Y), not wall(X,Y). that leads to the addition of instances 33 Stepwise Debugging of Answer-Set Programs Fig. 4: Deciding to consider atom wall(3,2) to be true by dragging it from the middle list of atoms in the truth assignment view and dropping it in the left list. The current state of the stepping session is S4 from Example 8 and the step prepared is that to state S5 . Note that atom wall(3,3) is greyed in the list of positive atoms. Greyed atoms in the positive or negative list cannot be be dragged away from there again because their truth value is already considered positive, respectively negative, in the current state (here S4 ). A step can only be completed once the truth value has been decided for all atoms in the rule instance. wall(1, wall(2, wall(3, wall(4, wall(5, wall(5, wall(1, wall(5, wall(1, wall(1, wall(2, wall(3, wall(4, wall(5, 1) 1) 1) 1) 1) 2) 3) 3) 4) 5) 5) 5) 5) 5) ::::::::::::::- border(1, border(2, border(3, border(4, border(5, border(5, border(1, border(5, border(1, border(1, border(2, border(3, border(4, border(5, 1), 1), 1), 1), 1), 2), 3), 3), 4), 5), 5), 5), 5), 5), not not not not not not not not not not not not not not entrance(1, entrance(2, entrance(3, entrance(4, entrance(5, entrance(5, entrance(1, entrance(5, entrance(1, entrance(1, entrance(2, entrance(3, entrance(4, entrance(5, 1), 1), 1), 1), 1), 2), 3), 3), 4), 5), 5), 5), 5), 5), not not not not not not not not not not not not not not exit(1, exit(2, exit(3, exit(4, exit(5, exit(5, exit(1, exit(5, exit(1, exit(1, exit(2, exit(3, exit(4, exit(5, 1). 1). 1). 1). 1). 2). 3). 3). 4). 5). 5). 5). 5). 5). 34 J. Oetsch, J. Pührer, and H. Tompits empty(1, empty(2, empty(4, empty(2, empty(4, empty(2, empty(3, empty(4, empty(5, 2) 2) 2) 3) 3) 4) 4) 4) 4) :::::::::- col(1), col(2), col(4), col(2), col(4), col(2), col(3), col(4), col(5), row(2), row(2), row(2), row(3), row(3), row(4), row(4), row(4), row(4), not not not not not not not not not wall(1, wall(2, wall(4, wall(2, wall(4, wall(2, wall(3, wall(4, wall(5, 2). 2). 2). 3). 3). 4). 4). 4). 4). to a new state S6 . IS6 extends IS5 by the head atoms of these rules that are not yet in IS5 . Likewise, I − S6 extends I − S5 by the default negated atoms appearing in the rules that are not yet in I − S5 . As ΥS6 = {∅} and no rule in Π1 ∪ Π2 has further active instances under IS6 , the computation S0 , . . . , S6 has succeeded and hence IS6 is an answer set of the program. In the next example, a bug is revealed by stepping towards an intended answer set. Example 9 As a next feature, we (incorrectly) implement rules in program Π4 that should express that there has to be a path from the entrance to every empty cell and that 2 × 2 blocks of empty cells are forbidden: adjacent(X,Y,X,Y+1) :- col(X), row(Y), row(Y+1). adjacent(X,Y,X,Y-1) :- col(X), row(Y), row(Y-1). adjacent(X,Y,X+1,Y) :- col(X), row(Y), col(X+1). adjacent(X,Y,X-1,Y) :- col(X), row(Y), col(X-1). reach(X,Y) :- entrance(X,Y), not wall(X,Y). reach(XX,YY) :- adjacent(X,Y,XX,YY), reach(X,Y), not wall(XX,YY). :- empty(X,Y), not reach(X,Y). :- empty(X,Y), empty(X+1,Y), empty(X,X+1), empty(X+1,Y+1). The first six rules formalise when an empty cell is reached from the entrance, and the two constraints should ensure that every empty cell is reached and that no 2 × 2 blocks of empty cells exist, respectively. Assume that we did not spot the bug in the second constraint—in the third body literal the term Y+1 was mistaken for X+1. This could be the result of a typical copypaste error. It turns out that Π1 ∪ Π2 ∪ Π4 has no answer set. In order to find a reason, one can start stepping towards an intended answer set. We assume that the user already trusts the program Π1 ∪ Π2 from Example 8. Hence, he or she can reuse the computation S0 , . . . , S6 for Π1 ∪ Π2 as starting point for a stepping session because all rules in PS6 are also ground instances of rules in the extended program Π1 ∪ Π2 ∪ Π4 . Then, when the user asks for rules with active ground instances a stepping support environment would present the following rules: adjacent(X,Y,X,Y+1) :- col(X), row(Y), row(Y+1). adjacent(X,Y,X,Y-1) :- col(X), row(Y), row(Y-1). Stepwise Debugging of Answer-Set Programs col(1..5). row(1..5). entrance(1,2). exit(5,4). wall(3,3). empty(3,4). maxCol(X) :- col(X), not col(X+1). maxRow(Y) :- row(Y), not row(Y+1). border(1,Y) :- col(1), row(Y). border(X,1) :- col(X), row(1). border(X,Y) :- row(Y), maxCol(X). border(X,Y) :- col(X), maxRow(Y). wall(X,Y) :- border(X,Y), not entrance(X,Y), not exit(X,Y). { wall(X,Y) : col(X), row(Y), not border(X,Y) }. empty(X,Y) :- col(X), row(Y), not wall(X,Y). adjacent(X,Y,X,Y+1) :- col(X), row(Y), row(Y+1). adjacent(X,Y,X,Y-1) :- col(X), row(Y), row(Y-1). adjacent(X,Y,X+1,Y) :- col(X), row(Y), 35 col(X+1). adjacent(X,Y,X-1,Y) :- col(X), row(Y), col(X-1). reach(X,Y) :- entrance(X,Y), not wall(X,Y). reach(XX,YY) :- adjacent(X,Y,XX,YY), reach(X,Y), not wall(XX,YY). :- empty(X,Y), not reach(X,Y). :- empty(X,Y), empty(X+1,Y), empty(X,Y+1), empty(X+1,Y+1). :- exit(X,Y), wall(X,Y). :- wall(X,Y), wall(X+1,Y), wall(X,Y+1), wall(X+1,Y+1). :- wall(X,Y), empty(X+1;X-1,Y), empty(X,Y+1;Y-1), col(X+1;X-1), row(Y+1;Y-1). :- wall(X,Y), wall(X+1,Y+1), not wall(X+1,Y), not wall(X,Y+1). :- wall(X+1,Y), wall(X,Y+1), not wall(X,Y), not wall(X+1,Y+1). Fig. 5: Program Π1 ∪ Π2 ∪ Π5 ∪ Π6 used in Example 10. adjacent(X,Y,X+1,Y) :- col(X), row(Y), col(X+1). adjacent(X,Y,X-1,Y) :- col(X), row(Y), col(X-1). reach(X,Y) :- entrance(X,Y), not wall(X,Y). :- empty(X,Y), not reach(X,Y). :- empty(X,Y), empty(X+1,Y), empty(X,X+1), empty(X+1,Y+1). The attentive observer will immediately notice that two constraints are currently active. There is no reason to be deeply concerned about :- empty(X,Y), not reach(X,Y). being active because the rule defining the reach/2 predicate—that can potentially deactivate the constraint—has not been considered yet. However, the constraint :- empty(X,Y), empty(X+1,Y), empty(X,X+1), empty(X+1,Y+1). contains only atoms of predicate empty/2 that has already been fully evaluated. Even if empty/2 was only partially evaluated, an active instance of the constraint could not become inactive in a subsequent computation for the sole ground that it only contains monotonic literals. When the user inspects the single ground instance :- empty(1,2), empty(2,2), empty(1,2), empty(2,3). of the constraint the bug becomes obvious. A less attentive observer would maybe not immediately realise that the constraint will not become inactive again. In this case, he or she would in the worst case step through all the other rules before the constraint above remains as the last rule with active instances. Then, at the latest, 36 J. Oetsch, J. Pührer, and H. Tompits one comes to the same conclusion that X+1 has to be replaced by Y+1. Moreover, a stepping environment could give a warning when there is a constraint instance that is guaranteed to stay active in subsequent states. This feature is not implemented in SeaLion. We refer to the corrected version of program Π4 by Π5 . Compared to traditional software, programs in ASP are typically very succinct and often authored by a single person. Nevertheless, people are sometimes confronted with ASP code written by another person, e.g., in case of joint program development, software quality inspection, legacy code maintenance, or evaluation of student assignments in a logic-programming course. As answer-set programs can model complex problems within a few lines of code, it can be pretty puzzling to understand someone else’s ASP code, even if the program is short. Here, stepping can be very helpful to get insight into how a program works that was written by another programmer, as illustrated by the following example. Example 10 Assume that the full encoding of the maze generation encoding is composed by the programs Π2 ∪ Π5 and that the constraints in Π6 , given next, has been written by another author. :- exit(X,Y), wall(X,Y). :- wall(X,Y), wall(X+1,Y), wall(X,Y+1), wall(X+1,Y+1). :- wall(X,Y), empty(X+1;X-1,Y), empty(X,Y+1;Y-1), col(X+1;X-1), row(Y+1;Y-1). :- wall(X,Y), wall(X+1,Y+1), not wall(X+1,Y), not wall(X,Y+1). :- wall(X+1,Y), wall(X,Y+1), not wall(X,Y), not wall(X+1,Y+1). Note that the guess whether a cell is a wall or empty in the program Π2 ∪Π5 ∪Π6 is realised by guessing for each non-border cell whether it is a wall or not and deriving that a cell is empty in case we do not know that it is a wall. Moreover, observe that facts of predicate empty/2 may be part of a valid encoding of a maze generation problem instance, i.e., they are a potential input of the program. As a consequence, it seems plausible that the encoding could guess the existence of a wall for a cell that is already defined to be empty by a respective fact in the program input. In particular, there is no constraint that explicitly forbids that a single cell can be empty and contain a wall. The encoding would be incorrect if it would allow for answer sets with cells that are empty and a wall according to the maze generation problem specification. However, it turns out that the answer sets of the program are exactly the intended ones. Let us find out why by means of stepping. Reconsider the problem instance depicted in Fig. 1 that is encoded in the program Π1 . It requires that cell (3, 4) is empty. If it did not, the maze shown in Fig. 7 that contains a wall at cell (3, 4) would be a valid solution. We start a stepping session for program Π1 ∪ Π2 ∪ Π5 ∪ Π6 , whose code is summarised in Fig. 5, and step towards an interpretation encoding the maze of Fig. 7 to see what is happening if we consider (3, 4) to be a wall despite the presence of fact empty(3,4). We can reuse the computation C4 obtained in Example 7 whose final state S4 considers already the facts describing the input instance and the rules needed for deriving Stepwise Debugging of Answer-Set Programs 37 Fig. 6: In SeaLion, we can retract the computation to a previous state by clicking on the node in the computation view representing the step or jump that created the target state. The screenshot shows reverting the last two states in Example 10, where we reused a part of the computation S1 , . . . , S6 for exploring an alternative setting starting from S4 . The final state of the alternative computation presented in the example is depicted in Fig. 9. border/2 atoms. As in Example 8, we continue with a step for considering the ground instance of the rule {wall(X,Y) : col(X), row(Y), not border(X,Y)}. that guesses whether non-border cells are walls. This time, instead of choosing wall(3,2) to be true, we only add wall(3,4) to the atoms considered true. Then, for the resulting state S50 , both empty(3,4) and wall(3,4) are contained in IS50 . A visualisation of IS50 if given in the centre of Fig. 8. In order to derive the remaining atoms of predicates empty/2 and wall/2 we then jump through the rules wall(X,Y) :- border(X,Y), not entrance(X,Y), not exit(X,Y). empty(X,Y) :- col(X), row(Y), not wall(X,Y). to obtain state S60 , where IS60 is illustrated in the right subfigure of Fig. 8. Now, the user sees that constraint :- empty(X,Y), not reach(X,Y). 38 J. Oetsch, J. Pührer, and H. Tompits Fig. 7: A valid maze—but not a solution for the instance depicted in Fig. 1 as that requires (3, 4) to be an empty cell. has active instances. This comes as no surprise as the rules defining reachability between empty cells have not been considered yet. We decide to do so now and initiate a jump through the rules adjacent(X,Y,X,Y+1) :- col(X), row(Y), row(Y+1). adjacent(X,Y,X,Y-1) :- col(X), row(Y), row(Y-1). adjacent(X,Y,X+1,Y) :- col(X), row(Y), col(X+1). adjacent(X,Y,X-1,Y) :- col(X), row(Y), col(X-1). reach(X,Y) :- entrance(X,Y), not wall(X,Y). reach(XX,YY) :- adjacent(X,Y,XX,YY), reach(X,Y), not wall(XX,YY). We obtain the new state S70 and observe that under interpretation IS70 the constraint still has an active instance, namely :- empty(3,4), not reach(3,4). Obviously, the atom reach(3,4) has not been derived in the computation. When inspecting the rules defining reach/2 it becomes clear why the answer sets of the encoding are correct: the atom reach(X,Y) is only derived for cells that do not contain walls. Consequently, whenever there is an empty cell which was guessed to contain a wall it will be considered as not reachable from the entrance. As every empty cell has to be reachable, a respective answer-set candidate will be eliminated by an instance of the constraint :- empty(X,Y), not reach(X,Y). Although the encoding of the maze generation problem is correct one could consider it to be not very well designed. Conceptually, the purpose of the constraint above is forbidding empty cells to be unreachable from the entrance and not forbidding them to be walls. Moreover, if one would replace the rules reach(X,Y) :- entrance(X,Y), not wall(X,Y). reach(XX,YY) :- adjacent(X,Y,XX,YY), reach(X,Y), not wall(XX,YY). by reach(X,Y) :- entrance(X,Y), empty(X,Y). reach(XX,YY) :- adjacent(X,Y,XX,YY), reach(X,Y), empty(XX,YY). Stepwise Debugging of Answer-Set Programs 39 Fig. 8: The stepping session described in Example 10: Starting from the maze generation instance we step towards an interpretation encoding the wrong solution of Fig. 7. After stepping through the guessing rule the resulting interpretation contains atoms empty(3,4) and wall(3,4) stating that cell (3, 4) is both a wall and empty. which seem to be equivalent in the terms of the problem specification, the program would not work. A more natural encoding would be to explicitly forbid empty cells to contain walls either by an explicit constraint or a modified guess where nonborder cell is guessed to be either empty or contain a wall but not both. 5 Related Work First, we describe existing approaches for debugging answer-set programs and how they are related to the method proposed in this paper. The first work devoted to debugging of answer-set programs is a paper by Brain and De Vos (2005) in which they provide general considerations on the subject, such as the discussion of error classes in the context of ASP or implications of declarativity on debugging mentioned in the previous section. They also formulated important debugging questions in ASP, namely, why is a set of atoms subset of a specific answer set and why is a set of atoms not subset of any answer set. The authors provided pseudocode for two imperative ad-hoc algorithms for answering these questions for propositional normal answer-set programs. The algorithm addressing the first question returns answers in terms of active rules that derive atoms from the given set. The algorithm for explaining why a set of atoms is not subset of any answer set identifies different sorts of answers such as atoms with no deriving rules, inactive deriving rules, or supersets of the given set in which adding further literals would lead to some inconsistency. The goal of the work by Pontelli et al. (2009) is to explain the truth values of literals with respect to a given actual answer set of a program. Explanations are provided in terms of justifications which are labelled graphs whose nodes are truth assignments of possibly default-negated ground atoms. The edges represent positive and negative support relations between these truth assignments such that every path ends in an assignment which is either assumed or known to hold. The authors have also introduced justifications for partial answer sets that emerge during the 40 J. Oetsch, J. Pührer, and H. Tompits Fig. 9: The computation is stuck is state S70 from Example 10 as only a constraint has active instances (highlighted in red in the editor). The “No entry” symbol in the truth assignment view indicates an unsatisfied instance under the current state. Note that the tree in the computation view has an inactive branch. The current computation (nodes with yellow background) is an alternative branch for the computation in Fig. 6. Clicking on the final greyed branch would set S1 , . . . , S6 to be the active computation again. solving process (online justifications), being represented by three-valued interpretations. Pontelli et al. (2009) use sequences of three-valued interpretations (called computations) in which monotonously more atoms are considered true, respectively, false. The information carried in these interpretations corresponds to that of the second and third component of a state in a computation in our framework. The purpose of using computations in the two approaches differs however. While computations in stepping are used for structuring debugging process in a natural way, where the choices how to proceed remains with the user, the computations of Pontelli et al. are abstractions of the solving procedure. Their goal is to allow a solver that is compatible with their computation model to compute justifications for its intermediate results. Thus, similar to their offline versions, online justifications are non-interactive, i.e., they are computed automatically and used for post-mortem debugging. As our computation model is compatible with that for online justifications, it seems very promising to combine the two approaches in practice. While debugging information in stepping focuses on violation of rules and unfounded sets, Stepwise Debugging of Answer-Set Programs 41 our method leaves the reasons for an atom being true or false as implicit consequences of a user’s decision. Here, online justifications could keep track of the reasons for truth values at each state of a stepping session and presented to the user during debugging on demand. Syrjänen (2006) aimed at finding explanations why a program has no answer sets. His approach is based on finding minimal sets of constraints such that their removal yields consistency. Hereby, it is assumed that a program does not involve circular dependencies between literals through an odd number of negations which might also cause inconsistency. The author considers only a basic ASP language and hence does not take further sources of inconsistency into account, caused by program constructs of richer ASP languages, such as cardinality constraints. Another early approach (Brain et al. 2007; Pührer 2007) is based on program rewritings using some additional control atoms, called tags, that allow, e.g., for switching individual rules on or off and for analysing the resulting answer sets. Debugging requests can be posed by adding further rules that can employ tags as well. That is, ASP is used itself for debugging answer-set programs. The translations needed were implemented in the command-line tool Spock (Brain et al. 2007; Gebser et al. 2009) which also incorporates the translations of another approach in which also ASP is used for debugging purposes (Gebser et al. 2008; Pührer 2007). The technique is based on ASP meta-programming, i.e., a program over a metalanguage is used to manipulate a program over an object language (in this case, both the meta-language and the object language are instances of ASP). It addresses the question why some interpretation is not an answer set of the given program. Answers are given in terms of unsatisfied rules and unfounded loops. The approach has later been extended from propositional to disjunctive logic programs with constraints, integer arithmetic, comparison predicates, and strong negation (Oetsch et al. 2010) and also to programs with cardinality constraints (Polleres et al. 2013). It has been implemented in the Ouroboros plugin of SeaLion (Frühstück et al. 2013). Moreover, Shchekotykhin (2015) developed a method on top of the meta-programming approaches (Gebser et al. 2008; Oetsch et al. 2010) that poses questions to the user in order to find a desired problem diagnosis while keeping the amount of required interaction low. In a related approach, Dodaro et al. (2015) use control atoms quite similar to that of the tagging approach (Brain et al. 2007; Pührer 2007) to identify sets of rules that lead to inconsistency of a program under the requirement that a given set of atoms is true in some intended answer set. An implementation is provided that profits from a tight integration with the ASP solver WASP (Alviano et al. 2015). In order to reduce the possible outcomes, the debugger asks the user about the intended truth of further atoms in an interactive session. In another paper, Li et al. (2015) use inductive logic programming to repair answer-set programs. The idea is that the user provides examples of desired and undesired properties of answer sets such that the debugger can semi-automatically revise a faulty program. The method requires a difference metric between logic programs in order to restrict repairs to programs that have the desired properties that minimally differ from the original program. The authors propose such a measure 42 J. Oetsch, J. Pührer, and H. Tompits in terms of number of operations required for revision. These operations are rule removal and creation as well as addition or removal of individual body literals. Caballero et al. (2008) developed a declarative debugging approach for datalog using a classification of error explanations similar to that of the aforementioned meta-programming technique (Gebser et al. 2008; Oetsch et al. 2010). Their approach is tailored towards query answering and the language is restricted to stratified datalog. However, the authors provide an implementation that is based on computing a graph that reflects the execution of a query. Wittocx et al. (2009) show how a calculus can be used for debugging first-order theories with inductive definitions (Denecker 2000; Denecker and Ternovska 2008) in the context of model expansion problems, i.e., problems of finding models of a given theory that expand some given interpretation. The idea is to trace the proof of inconsistency of such an unsatisfiable model expansion problem. The authors provide a system that allows for interactively exploring the proof tree. Besides the mentioned approaches which rely on the semantical behaviour of programs, Mikitiuk et al. (2007) use a translation from logic-program rules to natural language in order to detect program errors more easily. This seems to be a potentially useful feature for an IDE as well, especially for non-expert ASP programmers. We can categorise the different methods by their setting of their debugging tasks. Here, one aspect is whether a technique works with factual or desired answer sets. Approaches that focus on actual answer sets of the program to be debugged include the algorithm by Brain and De Vos (2005) that aims at explaining the presence of atoms in an answer set. Also, justifications (Pontelli et al. 2009) are targeted towards explanations in a given actual answer set, with the difference that they focus on a single atom but can not only explain their presence but also their absence. The approach by Caballero et al. (2008) can also be seen to target a single actual answer set. Due to their focus on actual answer sets of the debugged program, these methods cannot be applied on (erroneous) programs without any answer set. The previous meta-programming based debugging technique (Gebser et al. 2008; Pührer 2007) and follow-up works (Oetsch et al. 2010; Polleres et al. 2013) deal with a single intended but non-actual answer set of the debugged program. In the approach of Wittocx et al. (2009), the user can specify a class of intended semantic structures which are not preferred models of the theory at hand (corresponding to actual answer sets of the program to be debugged in ASP terminology). Syrjänen’s diagnosis technique (Syrjänen 2006) is limited to the setting when a program has no answer set at all. The same holds for the work of Dodaro et al. (2015), however the authors demonstrate how other debugging problems can be reduced to that of inconsistency. The method requires an intended answer set but offers the means to generate that in an interactive way, building on the technique by Shchekotykhin (2015). Stepping does not require actual or intended answer sets as a prerequisite, as the user can explore the behaviour of his or her program under different interpretations that may or may not be extended to answer sets by choosing different rules instances. In the interactive setting summarised in Fig. 2, where one can retract a computation to a previous state and continue stepping from there that is also implemented in SeaLion, a stepping session can thus be seen as an inspection across Stepwise Debugging of Answer-Set Programs 43 arbitrary interpretations rather than an inquiry about a concrete set of actual or non-existent answer sets. Nevertheless, if one has a concrete interpretation in mind, the user is free to focus on that. The ability to explore rule applications for partial interpretations that cannot become answer sets amounts to a form of hypothetical reasoning. A related form of this type of debugging is also available in one feature of the tagging approach (Brain et al. 2007) that aims at extrapolating non-existent answer sets by switching off rules and guessing further atoms. Here, the stepping technique can be considered more focused, as the interpretation under investigation is determined by the choices of the user in stepping but is essentially arbitrary in the tagging approach if the user does not employ explicit restrictions. Next, we compare the ASP languages supported by different approaches. First, the language of theories with inductive definitions used in one of the debugging approaches (Wittocx et al. 2009) differs from the remaining approaches that are based on logic-programming rules. Many of these works deal only with the basic ASP setting of debugging ground answer-set programs, supporting only normal rules (Brain and De Vos 2005; Pontelli et al. 2009), disjunctive rules (Gebser et al. 2008), or simple choice rules (Syrjänen 2006). The work on tagging-based debugging (Brain et al. 2007) sketches how to apply the approach to programs with variables by means of function symbols. The approach by Caballero et al. (2008) deals with non-ground normal programs which have to be stratified. Explicit support for variables is also given in an extension (Oetsch et al. 2010) of the meta-programming approach for disjunctive programs. It was later extended to allow for weight constraints (Polleres et al. 2013) by compiling them away to normal rules. A commonality of the previous approaches is that they target ASP languages that can be considered idealised proper subsets of current solver languages. In this respect, stepping is the first debugging approach that overcomes these limitations as the use of C-programs and abstract grounding (cf. Pührer 2014) make the framework generic enough to be applied to ASP solver languages. While this does not mean that other approaches cannot be adapted to fit a solver language, it is no always immediately clear how. For our approach, instantiating our abstractions to the language constructs and the grounding method of a solver is sufficient to have a ready-to-use debugging method. Most existing debugging approaches for ASP can be seen as declarative in the sense that a user can pose a debugging query, and receives answers in terms of different declarative definitions of the semantics of answer-set programs, e.g., in terms of active or inactive rules with respect to some interpretation. In particular, the approaches do not take the execution strategy of solvers into account. This also holds for our approach, however stepping and online justifications (Pontelli et al. 2009) are exceptional as both involve a generic notion of computation which adds a procedural flavour to debugging. Nonetheless, the computation model we use can be seen as a declarative characterisation of the answer-set semantics itself as it does not apply a fix order in which to apply rules to build up an answer set. Besides stepping, also the approaches by Wittocx et al. (2009) and Dodaro et al. (2015) as well as Shchekotykhin (2015) can be considered interactive. While in the approach of Wittocx et al. a fixed proof is explored interactively, the interaction in our method has influence on the direction of the computation. The other 44 J. Oetsch, J. Pührer, and H. Tompits works (Dodaro et al. 2015; Shchekotykhin 2015) use interaction for filtering the resulting debugging information. Also in further works (Brain et al. 2007; Gebser et al. 2008) which do not explicitely cover interleaved communication between user and system, user information can be used for filtering. The approaches mentioned in this paragraph realise declarative debugging in the sense of Shapiro (1982), where the user serves as an oracle for guiding the search for errors. It is worth highlighting that stepping can be seen as orthogonal to the basic ideas of all the other approaches we discussed. That is, it is reasonable to have a development kit that supports stepping and other debugging methods simultaneously. While debugging is the main focus of this paper, we also consider the computation framework for disjunctive abstract constraint programs introduced in Section 3 an interesting theoretical contribution by itself. Here, an important related work is that of Liu et al. (2010), who also use a notion of computation to characterise a semantics for normal C-programs. These computations are sequences of evolving interpretations. Unlike the three-valued ones used for online justifications (Pontelli et al. 2009), these carry only information about atoms considered true. Thus, conceptionally, they correspond to sequences IS0 , IS1 , . . . where S0 , S1 , . . . is a computation in our sense. The authors formulate principles for characterising different variants of computations. We will highlight differences and commonalities between the approaches along the lines of some of these properties. One main structural difference between their and our notion of computation is the granularity of steps: In the approach by Liu et al. it might be the case that multiple rules must be considered at once, as required by their revision property (R’), while in our case computation proceeds rule instance by rule instance. The purpose of property (R’) is to assure that every successive interpretation must be supported by the rules active with respect to the previous interpretation. But it also requires that every active rule in the overall program is satisfied after each step, whereas we allow rule instances that were not considered yet in the computation to be unsatisfied. For the purpose of debugging, rule-based computation granularity seems favourable as rules are our primary source code artifacts. Moreover, ignoring parts of the program that were not considered yet in a computation is essential in the stepping method, as this breaks down the amount of information that has to be considered by the user at once and allows for getting stuck and thereby detect discrepancies between his or her understanding of the program and its actual semantics. Our computations (when translated as above) meet the persistence principle (P’) of Liu et al. that ensures that a successor’s interpretation is a superset of the current one. Their convergence principle (C’), requiring that a computation stabilises to a supported model, is not met by our computations, as we do not enforce support in general. However, when a computation has succeeded (cf. Definition 19), it meets this property. A further difference is that Liu et al. do not allow for non-stable computations as required by the founded persistence of reasons principle (FPr). This explains why the semantics they characterise treats non-convex atoms not in the FLP-way. Besides that, the use of non-stable computations allow us to handle disjunction. Interestingly, Liu et al. mention the support for disjunction in computations as an open challenging problem and suspect the necessity of a global minimality re- Stepwise Debugging of Answer-Set Programs 45 quirement on computations for this purpose. Our framework demonstrates that we can do without such a condition: As shown in Theorem 1, unfounded sets in our semantics can be computed incrementally “on-the-fly” by considering only the rule instance added in a step as potential new external support. Finally, the principle of persistence of reasons (Pr’) suggests that the “reason” for the truth value of an atom must not change in the course of a computation. Liu et al. identify such reasons by sets of rules that keep providing support in an ongoing computation. We have a similar principle of persistence of reasons that is however stricter as it is operates on the atom level rather than the rule level: Once a rule instance is considered in a computation in our sense, the truth value of the atoms in the rule’s domain is frozen, i.e., it cannot be changed or forgotten in subsequent steps. Persistence of reasons is also reflected in our definition of answer sets: The requirement I 0 |DA = I |DA in Definition 12 that the stability of interpretation I is only spoiled by I 0 if the reason for I 0 |= A is the same satisfier of C-atom A as for I |= A. As argued above and in the introduction, our notion of computation is better suited for stepping than that of Liu et al., yet we see potential for using the latter orthogonal to our method for debugging (for the class of programs for which the different semantics coincide). While our jumping technique allows to consider several rules, selected by the user, at once, a debugging system could provide proposals for jumping, where each proposal corresponds to a set of rules that result in a next step in the sense of Liu et al. Then, the system could present the atom assignments for each proposal such that the user has an alternative to choose a jump based on truth of atoms rather than rules. Moreover, this can be the basis for automated progression in a stepping session until a certain atom is assigned, analogous to watchpoints in imperative debugging. We believe that these ideas for (semi-)automated jumping deserve further investigation. Another branch of research, that is related to our notion of computation, focuses on transition systems for analysing answer-set computation (Lierler 2011; Lierler and Truszczyński 2016; Brochenin et al. 2014). These works build on the ideas of a transition system for the DPLL procedure for SAT solving (Nieuwenhuis et al. 2006). Transition systems are graphs whose nodes represent the state of a computation whereas the edges represent possible state transitions during solving. Typically, a set of transition rules, depending on the answer-set program, determines the possible transitions. In ASP transition systems, nodes are represented by (ordered) sets of literals with annotations whether a literal is a decision literal. Moreover, there is a distinguished state F ailState for representing when a branch of computation cannot succeed in producing an answer set. Different sets of transition rules have been proposed that correspond to different models of computations. Typical transition rules include a unit propagation rule that derives one further literal based on a rule of the program for which all other literals are defined in the previous state, a decision rule that adds one further literal (annotated as decision literal), and a transition rule for backtracking that retracts a decision literal from an inconsistent state and replace it by its negation. Existing transition systems for ASP are intended to reflect ASP solving algorithms, including failed branches of search space traversal. For instance, transition systems have been defined with transition rules 46 J. Oetsch, J. Pührer, and H. Tompits for backjumping and learning as used in modern solvers (Lierler 2011). In contrast, our framework generates ideal (possibly failed) computations without backtracking. Another main difference is that all proposed transition systems have a transition rule for arbitrary assignment of decision literals whereas in our framework truth assignments are restricted to the domain of the C-rule added in the current step. Regarding supported language constructs, to the best of our knowledge, existing transition systems for ASP focus on elementary atoms, i.e., they do not cover aggregates. However, Lierler and Truszczyński (2016) also proposed transition systems for multi-logic systems including ASP. There has been work on transition systems for disjunctive programs (Brochenin et al. 2014). These are based on integrating two sets of transition rules, one for guessing and one for checking of answer set candidates. Similarly, as in the work by Liu et al. (2010), states in transition systems do not keep track of ASP rules as our states do. Note that our computation framework can be turned into to a transition system for disjunctive C-programs with only two transition rules, one for propagation that is derived from the successor relation (cf. Definition 17) and another for defining the transition of unstable final states or states with remaining active rules but no successor to F ailState. 6 Conclusion In this paper, we introduced the stepping technique for ASP that can be used for debugging and analysis of answer-set programs. Like stepping in imperative programming, where the effects of consecutive statements are watched by the user, our stepping technique allows for monitoring the effect of rules added in a step-bystep session. In contrast to the imperative setting, stepping in our sense is interactive as a user decides in which direction to branch, by choosing which rule to consider next and which truth values its atoms should be assigned. On the one hand, this breaks a general problem of debugging in ASP, namely how to find the cause for an error, into small pieces. On the other hand, user interaction allows for focusing on interesting parts of the debugging search space from the beginning. This is in contrast to the imperative setting, where the order in which statements are considered in a debugging session is fixed. Nevertheless, also in our setting, the choice of the next rule is not entirely arbitrary, as we require the rule body to be active first. Debuggers for procedural languages often tackle the problem that many statements need to be considered before coming to an interesting step by ignoring several steps until pre-defined breakpoints are reached. We developed an analogous technique in our approach that we refer to as jumping which allows to consider multiple rules at once. Besides developing the technical framework for stepping, we also discussed the implementation of stepping in the SeaLion system and methodological aspects, thereby giving guidelines for the usage of the technique, and for setting the latter in the big picture of ASP development. While unstable computations are often not needed, they offer great opportunities for further work. For one, the use of unfounded sets for distinguishing states in unstable computations is a natural first choice for expressing the lack of stability. Arguably, when a user arrives in a state with a non-empty unfounded set, he or she Stepwise Debugging of Answer-Set Programs 47 only knows that some external support has to be found for this set but there is no information which atoms of the unfounded sets are the crucial ones. It might be worthwhile to explore alternative representations for unstability such as elementary loops (Gebser et al. 2011) that possibly provide more pinpoint information. This would require lifting a respective notion to the full language of C-programs first. Another issue regarding unstable computations that would deserve further attention is that in the current approach jumps can only result in stable states. Thus, unstable states in a computation can only be reached by individual steps at present. Here, it would be interesting to study methods and properties for computations that allow for jumping to states that are not stable. We next discuss functionality that could be helpful for stepping which are not yet implemented in SeaLion. One such feature is semi-automatic stepping, i.e., the user can push a button and then the system searches for potential steps for which no further user interaction is required and applies them automatically until an answer set is reached, the computation is stuck, or user interaction is required. It would also be convenient to automatically check whether the computation of a debugging session is still a computation for the debugged program after a program update. In this respect, when the computation for the old version became incompatible, a feature would be advantageous that builds up a computation for the new version that resembles the old one as much as possible. Unlike semi-automatic stepping and compatibility checks for computations which could be implemented without further studies, the latter point still requires theoretical research. Further convenient features would be functionality that highlights the truth values of atoms that cause a rule not to be active for a given substitution and methods for predicting whether a rule can become active in the future, i.e., in some continuation of the computation. Acknowledgements We thank the reviewers for their useful comments. This work was partially supported by the Austrian Science Fund (FWF) under project P21698, the German Research Foundation (DFG) under grants BR-1817/7-1 and BR 1817/7-2, and the European Commission under project IST-2009-231875 (OntoRule). Appendix A Guidelines for Stepping In what follows, we give advice on how users can exploit stepping for analysing and debugging their code. Fig. A 1 synthesises practical guidelines for stepping from the methodological aspects of stepping described in Section 4.6. It can be seen as a useroriented view on the stepping technique. Depending on the goals and the knowledge of the user, this guide gives concise yet high-level suggestions on how to proceed in a stepping session. The upper area of the figure is concerned with clarifying the best strategy for a stepping session and for choosing the computation to start from. The lower area, on the other hand, guides the user through the stepping process. The diagram differentiates between four tasks a user may want to perform. 48 J. Oetsch, J. Pührer, and H. Tompits (i) Debugging a program lacking a particular answer set: we suggest to step and jump through rules that one thinks build up this answer set. Eventually, the computation will get stuck when adding a rule that prevents the answer set. (ii) Debugging a program that lacks any answer set: if an intended answer set is known, we advise using the strategy of Item (i). Otherwise, the user should choose rules and truth values during stepping that he or she thinks should be consistent, i.e., lead to a successful computation. Also here, the computation is guaranteed to fail and get stuck, indicating a reason for the inconsistency. (iii) Debugging a program with an unintended answer set I : In case that I is similar to an intended but missing answer set I 0 , thus if I is intuitively a wrong version of I 0 , we recommend stepping towards I 0 , following the strategy of Item (i). Otherwise, the user can step towards I . Unlike in the previous cases, the computation is guaranteed to eventually succeed. Here, stepping acts as a disciplined way to inspect how the atoms of I can be derived and why no rule prevents I from being an answer set. If I is intended to be a model but not stable, then the stepping process will reveal which rules provide external support for sets of atoms that are supposed to be unfounded. (iv) Analysing a program: In case that the user is interested in the behaviour of the program under a particular interpretation, it is reasonable to step towards this interpretation. Otherwise, rules and truth assignments should be chosen that drive the computation towards states that the user is interested in. The procedures suggested above and in Fig. A 1 are meant as rough guidelines for the inexperienced user. Presumably, knowledge about the own source code and some practice in stepping gives the user a good intuition on how to find bugs efficiently. It is natural to ask how big a program can get such that it is still suitable for stepping. Due to the vague nature of the question, answers cannot be clearly established. From a complexity theoretic point of view, the problems that need to be solved in a stepping support environment for and after performing a step or a jump, e.g., computing a new state from a jump, determining rules with active instances, or checking whether a computation has failed, are not harder than computing an answer set of the program under development. Under this observation, our technique is certainly an appropriate approach for debugging ASP. In some applications, however, solving times of multiple minutes or even hours are acceptable. Certainly, having waiting times of these lengths for individual debugging steps is undesirable. On the positive side, often, following a few guidelines during the development of an answer-set program can significantly reduce the likelihood of introducing bugs, the amount of information the user has to deal with, and also the computational resources required for stepping. Among these measures are best practices for ASP development that have been discussed in a paper by Brain et al. (2009). For working with the stepping method in particular, we give the following recommendations. Use scalable encodings and start with small examples. Using small problem instances, also the resulting grounding as well as answer sets are typically small. This limits the amount of information to be considered during debugging. Chances 49 Stepwise Debugging of Answer-Set Programs STEPPING GUIDE What is your goal? an unintended answer set find a bug What type of bug? analyse the program no answer sets exist although some should Do you want to inspect the behaviour of your program under a particular interpretation? Do you know any particular expected answer set? yes no Always choose truth values to match the interpretation when performing a step in this session no Is the unintended answer set a wrong version of a missing expected answer set? a missing answer set no yes yes Always choose truth values to match the intended answer set when performing a step in this session Follow your intuitions to create an interesting situation when choosing truth values in this session Always choose truth values to match the unintended answer set when performing a step in this session Which is the computation you can obtain that reflects your intended setting the most? a (part of a) stored computation for a trusted part of the program, a computation generated from an answer set of a trusted part of the program, a computation generated from an answer set of a previous version of the program, or a computation generated from an interpretation from an external source Start stepping from the empty state. Then, jump through the program’s facts Start stepping from the obtained computation Store computation for later use. Retract the final states from the computation until the new final state matches your intentions Select rules for step or jump yes Step Jump Can you already gain satisfactory insight into the program’s semantics? yes Store computation for later use DONE Fig. A 1: Stepping guide no Do you want to continue stepping from the current state of the computation? no 50 J. Oetsch, J. Pührer, and H. Tompits that bugs are detected early, using small programs is suggested by an evaluation of the small-scope hypothesis for ASP (Oetsch et al. 2012). Visualise answer sets and stepping states. Tools like Kara (Kloimüllner et al. 2013) (that is implemented in SeaLion), ASPVIZ (Cliffe et al. 2008), IDPDraw (Wittocx 2009), or Lonsdaleite (Smith 2011) allow for visualising interpretations. With their help, one can quickly spot when an answer set differs from what is expected and they allow to monitor the evolvement of the interpretation that is build up during stepping. The illustrations of the maze generation problem in this section were created using Kara. For use with stepping, we advise to specify visualisations also for interpretations that are not supposed to be answer sets. For example, in Fig. 8, we have visualisations for cells that are not assigned to be empty or a wall and for cells that are assigned to be a wall and empty, despite in an expected answer set, every cell has to be either a wall or empty. Test often. Frequent tests allow the user to trust in large parts of the program, hence these parts can be jumped over in a stepping session. Appendix B Remaining Proofs Theorem 1 Let S be a state and S 0 a successor of S , where ∆ = IS 0 \ IS . Moreover, let X 0 be a set of literals with ∅ ⊂ X 0 ⊆ IS 0 . Then, the following statements are equivalent: (i) X 0 is unfounded in PS 0 with respect to IS 0 . (ii) X 0 = ∆0 ∪ X , where ∆0 ⊆ ∆, X ∈ ΥS , and rnew (S , S 0 ) is not an external support for X 0 with respect to IS 0 . Proof ((i)⇒(ii)) It is obvious that rnew (S , S 0 ) is not an external support for X 0 with respect to IS 0 as otherwise X 0 cannot be unfounded in PS 0 with respect to IS 0 . It remains to be shown that X 0 = ∆0 ∪ X for some ∆0 ⊆ ∆ and some X ∈ ΥS . Towards a contradiction, assume X 0 6= ∆00 ∪ X 00 for all X 00 ∈ ΥS and all ∆00 ⊆ ∆. We define X = X 0 ∩ IS . Consider the case that X ∈ ΥS . As X 0 \ IS ⊆ ∆, and X 0 = (X 0 \ IS ) ∪ X , we have a contradiction to our assumption. Therefore, it holds that X 6∈ ΥS . Hence, as X ⊆ IS , by definition of a state, X is not unfounded in PS with respect to IS . Therefore, there is some external support r ∈ PS for X with respect to IS . In the following, we show that r is also an external support for X 0 with respect to IS 0 . Since S 0 is a successor of S and S is a state, we get that IS and IS 0 coincide on Dr . Consequently, from IS |= B(r ) we get that also IS 0 |= B(r ). Moreover, because of IS \ X |= B(r ) it is also true that IS 0 \ X 0 |= B(r ). Furthermore, we know that there is some A ∈ H(r ) with X |DA 6= ∅ and IS |DA ⊆ C , for some C ∈ CA . As X |DA = X 0 |DA and IS |DA = IS 0 |DA we also have X 0 |DA 6= ∅ and IS 0 |DA ⊆ C . Finally, note that for all A ∈ H(r ) with IS |= A, we have (X ∩ IS )|DA 6= ∅. Consider some Stepwise Debugging of Answer-Set Programs 51 A ∈ H(r ) such that IS 0 |= A. From the latter we get that IS |= A and therefore (X ∩ IS )|DA 6= ∅. As X ∩ IS ⊆ X 0 ∩ IS 0 , we also have (X 0 ∩ IS 0 )|DA 6= ∅. Hence, r fulfils all conditions for being an external support for X 0 with respect to IS 0 , which is a contradiction to X 0 being unfounded in PS 0 with respect to IS 0 . ((ii)⇒(i)) Towards a contradiction, assume X 0 has some external support r ∈ PS 0 with respect to IS 0 . From (ii) we know that r 6= rnew (S , S 0 ) and X 0 = ∆0 ∪ X for some ∆0 ⊆ ∆ and some X ∈ ΥS . As r 6= rnew (S , S 0 ), we have that IS and IS 0 coincide on Dr . Therefore, from IS 0 |= B(r ) and IS 0 \ X 0 |= B(r ), it follows that IS |= B(r ) and IS \ X 0 |= B(r ). Note that X = X 0 ∩ IS and hence IS \ X |= B(r ). We know that there is some A ∈ H(r ) with X 0 |DA 6= ∅ and IS 0 |DA ⊆ C , for some C ∈ CA . As X 0 |DA = X |DA we have X |DA 6= ∅. Moreover, as IS 0 |DA = IS |DA , it holds that IS |DA ⊆ C . Finally, notice that for all A ∈ H(r ) with IS 0 |= A, we have (X 0 ∩ IS 0 )|DA 6= ∅. Consider some A ∈ H(r ) with IS |= A. As IS 0 |DA = IS |DA , we also have IS 0 |= A and hence (X 0 ∩ IS 0 )|DA 6= ∅. As DA ∩ ∆ = ∅, we have (X 0 ∩ IS 0 )|DA = (X ∩ IS )|DA . Consequently, it holds that (X ∩ IS )|DA 6= ∅. We showed that r is an external support of X in PS with respect to IS . Therefore, we have a contradiction to X ∈ ΥS because S is a state. Theorem 3 Let S0 be a state, P a C-program with PS0 ⊆ P , and I an answer set of P with IS0 ⊆ I and I ∩ I − S0 = ∅. Then, there is a computation S0 , . . . , Sn that has succeeded for P such that PSn = P I and ISn = I . Proof The proof is by induction on the size of the set P I \ PS0 . Observe that from IS0 ⊆ I , I ∩ I − S0 = ∅, and IS0 |= B(r ) and Dr ⊆ IS0 ∪ I − S0 , for all r ∈ PS0 , we get that I |= B(r ) for all r ∈ PS0 . Hence, as PS0 ⊆ P , we have PS0 ⊆ P I . Consider the base case that |P I \ PS0 | = 0. From PS0 ⊆ P I we get PS0 = P I . Consider the sequence C = hPS0 , IS0 , I − S0 , ΥS0 i. Towards a contradiction, assume IS0 6= I . As IS0 ⊆ I this means IS0 ⊂ I . Hence, there is some a ∈ I \ IS0 . As for all r ∈ PS0 it holds that Dr ⊆ IS0 ∪ I − S0 , and I ∩ I − S0 = ∅, we get a 6∈ DPS0 . We have a contradiction to I ∈ AS(PS0 ) by Corollary 1, as {a} is unfounded in PS0 with respect to I . Consequently, IS0 = I must hold. As IS0 is an answer set of PS0 and S0 is a state, we have that ΥS0 = {∅} by definition of state. It follows that C meets the criteria of the conjectured computation. We proceed with the step case. As induction hypothesis, assume that the claim holds whenever |P I \ PS0 | ≤ i for an arbitrary but fixed i ≥ 0. Consider some state S0 and some I ∈ AS(PS0 ) for which the conditions in the premise hold such that |P I \ PS0 | = i + 1. Towards a contradiction, assume there is no C-rule r ∈ P I \PS0 such that IS0 |= B(r ). Note that there is at least one C-rule r 0 ∈ P I \PS0 because |P I \ PS0 | = i + 1. It cannot hold that I = IS0 since from r 0 ∈ P IS0 follows IS0 |= B(r 0 ). Consequently, we have IS0 ⊂ I . Consider some r 00 ∈ P I with IS0 |= B(r 00 ). By our assumption, we get that r 00 ∈ PS0 . It follows that IS0 |= r 00 , and consequently there is some C-atom A ∈ H(r 00 ) with IS0 |= A. As Dr 00 ⊆ DS0 , we have 52 J. Oetsch, J. Pührer, and H. Tompits DA ⊆ IS0 ∪ I − S0 . From that, since IS0 ⊂ I and I ∩ I − S0 = ∅, we get I |DA = IS0 |DA . We have a contradiction to I being an answer set of P by Definition 12. So, there must be some C-rule r ∈ P I \ PS0 such that IS0 |= B(r ). From r ∈ P I we get I |= B(r ) and I |= r . Consider the state structure S1 = hP1 , I1 , I1 − , Υ1 i, where P1 = PS0 ∪ {r }, I1 = IS0 ∪ (I ∩ Dr ), I1 − = I − S0 ∪ (Dr \ I ), and Υ1 = {X |X = ∆0 ∪ X 0 , where ∆0 ⊆ (I1 \ IS0 ), X 0 ∈ ΥS0 , and r is not an external support of X with respect to I1 }· S1 is a successor of state S0 , therefore S1 is also a state by Corollary 2. As P1 ⊆ P , I1 ⊆ I , I ∩ I1 − = ∅, and |P I \ P1 | = i , by the induction hypothesis, S1 , . . . , Sn is a computation, where Sn is a stable state, PSn = P I , and ISn = I . Since S1 is a successor of state S0 , also S0 , S1 , . . . , Sn is a computation. For establishing Theorem 5 we make use of the following notion which reflects positive dependency on the rule level. Definition 22 The positive rule dependency graph of P is given by GR (P ) = hP , {hr1 , r2 i | r1 , r2 ∈ P , posOcc(B(r1 )) ∩ posOcc(H(r2 )) 6= ∅}i· We can relate the two notions of dependency graph as follows. Lemma 1 Let P be a C-program. GR (P ) is acyclic iff G(P ) is acyclic. Proof Let ≺D denote the edge relation of G(P ) and ≺R that of GR (P ). (⇒) Assume G(P ) is not acyclic. There must be some path a1 , . . . , an of atoms ai such that for 1 ≤ i < n, we have ai ∈ DP , ai ≺D ai+1 , and a1 = an . Hence, by the definition of G(P ), there must be a sequence r1 , . . . , rn−1 such that for each 1 ≤ i ≤ n − 1, ri ∈ P , ai ∈ posOcc(H(ri )), and ai+1 ∈ posOcc(B(ri )). Therefore, for each 1 ≤ i < n − 1, we have ri+1 ≺R ri . Note that a1 ∈ posOcc(H(r1 )) and a1 ∈ posOcc(B(rn−1 )). Consequently, we have rn−1 ≺R r1 and thus r1 , rn−1 , . . . , r1 forms a cycle in GR (P ). It follows that GR (P ) is not acyclic. (⇐) Assume now that GR (P ) is not acyclic. There must be some path r1 , . . . , rn of C-rules ri such that for 1 ≤ i < n we have ri ∈ P , r1 = rn , and ri ≺R ri+1 . Hence, by the definition of GR (P ), there must be a sequence a1 , . . . , an−1 such that for each 1 ≤ i ≤ n − 1, ai ∈ posOcc(H(ri+1 )), and ai ∈ posOcc(B(ri )). Therefore, for each 1 ≤ i < n − 1 we have ai+1 ≺D ai . Note that an−1 ∈ posOcc(H(r1 )) and a1 ∈ posOcc(B(r1 )). Consequently, we have an−1 ≺D a1 and thus a1 , an−1 , . . . , a1 forms a cycle in G(P ). We have that GR (P ) is not acyclic. Lemma 2 Let P be an absolutely tight C-program. There is a strict total order ≺ on P that extends the reachability relation of GR (P ). Stepwise Debugging of Answer-Set Programs 53 Proof By Definition 21, G(P ) is acyclic. Hence, by Lemma 1, GR (P ) is also acyclic. The conjecture holds, since every directed acyclic tree has a topological ordering. We now have the means to show Theorem 5, guaranteeing the existence of stable computations. Theorem 5 Let C = S0 , . . . , Sn be a computation such that S0 and Sn are stable and P∆ = PSn \ PS0 is a normal, convex, and absolutely tight C-program. Then, there is a stable computation C0 = S00 , . . . , Sn0 such that S0 = S00 and Sn = Sn0 . Proof Let ≺ be the strict total order extending the reachability relation of GR (P∆ ) that is guaranteed to exist by Lemma 2. Let r (·) : {1, . . . , n} 7→ P∆ denote the one-to-one mapping from the integer interval {1, . . . , n} to the C-rules from P∆ such that for all i , j in the range of r (·), we have that i < j implies r (j ) ≺ r (i ). Consider the sequence C0 = S00 , . . . , Sn0 , where S00 = S0 , and for all 0 ≤ i < n, 0 Pi+1 = Pi0 ∪ {r (i + 1)}, 0 ISi+1 = ISi0 ∪ (ISn ∩ Dr (i+1) ), 0 I − Si+1 = I − Si0 ∪ (I − Sn ∩ Dr (i+1) ), and 0 ΥSi+1 = {∅}· 0 |DP Notice that Sn0 = Sn and ISi+1 S0 i = ISi0 |DP 0 , for all 0 ≤ i < n. We show that C0 S i is a computation by induction on the length of a subsequence of C0 . As base case consider the sequence C00 = S00 . As S00 = S0 and S0 is a state, C00 is a computation. For the induction hypothesis, assume that for some arbitrary but fixed i with 0 ≤ i < n, the sequence S00 , . . . , Si0 is a computation. 0 In the induction step it remains to be shown that Si+1 is a successor of Si0 . Clearly, 0 0 Si+1 is a state structure, and by definition of C , since C is a computation and 0 ISi+1 |DPS i+1 = ISn |DPS i+1 , Conditions (i), (ii), (iii), and (v) of Definition 17 for being a successor of Si0 are 0 0 fulfilled by Si+1 . Let ∆ denote ISi+1 \ ISi0 . Next we show that Condition (iv) holds, i.e., ISi0 |= B(r (i + 1)). Note that since 0 Condition (v) holds, we have ISi+1 |= B(r (i + 1)) and hence (iv) holds in the case ∆ = ∅. Towards a contradiction assume ∆ 6= ∅ and ISi0 6|= B(r (i + 1)). We define ∆B + = ∆ ∩ posOcc(B(r (i + 1))). First, consider the case that ∆B + = ∅. As ISi0 6|= B(r (i + 1)), there must be some 0 C-literal L ∈ B(r (i + 1)) such that ISi0 6|= L. We know that ISi+1 |= L. Consequently, 0 0 ISi0 |DL ⊂ ISi+1 |DL and therefore ∆|DL 6= ∅. Moreover, from ISi+1 |= L we have 0 ISi+1 |DL ⊆ posOcc(B(r (i + 1)))· It follows that ∆|DL ∩posOcc(B(r (i + 1))) 6= ∅, indicating a contradiction to ∆B + = 54 J. Oetsch, J. Pührer, and H. Tompits ∅. It holds that ∆B + 6= ∅. Note that X ⊆ ISn . From that, since Sn is a state, there must be some C-rule r∆B + ∈ PSn such that r∆B + is an external support for ∆B + with respect to ISn . It cannot be the case that r ∈ PS0 , since ∆B + ∩ ISi0 = ∅, therefore, r∆B + ∈ P∆ . As r∆B + is an external support for ∆B + with respect to ISn , for {A} = H(r∆B + ), we have ISn |= A and ∆B + |DA 6= ∅. Consider the case that r∆B + = r (i + 1). From that we get posOcc(H(r (i + 1))) ∩ ∆B + 6= ∅. This, in turn, implies posOcc(H(r (i + 1))) ∩ posOcc(B(r (i + 1))) 6= ∅ which is a contradiction to GR (P∆ ) being acyclic. The latter is guaranteed by absolute tightness of P∆ and Lemma 1. Consider the case that r (i + 1) ≺ r∆B + . Then, by definition of C0 we have that r∆B + ∈ PSi0 . Hence, from ∆B + |DA 6= ∅ follows ∆B + |DP S0 i 6= ∅ and thus 0 ISi+1 \ ISi0 |DP S0 i 0 The latter is a contradiction to ISi+1 |DP S0 i 6= ∅· = ISi0 |DP 0 . S i Consider the remaining case that r∆B + ≺ r (i + 1). As ∆B + |DA 6= ∅, ∆B + ⊆ ISn , and ISn |DA ∈ CA , it holds that posOcc(H(r∆B + )) ∩ ∆B + 6= ∅. Therefore, we have posOcc(H(r∆B + )) ∩ posOcc(B(r (i + 1))) 6= ∅. This implies r (i + 1) ≺ r∆B + , being a contradiction to ≺ being a strict order as we also have r∆B + ≺ r (i + 1). Thus, 0 . Condition (iv) of Definition 17 for being a successor of Si0 holds for Si+1 Towards a contradiction assume Condition (vi) does not hold. Hence, it must hold that there is some ∆0 ⊆ ∆ such that ∆0 6= ∅ and r (i + 1) is not an external support 0 0 for ∆0 with respect to ISi+1 . We have ISi+1 |= B(r (i + 1)) and since we already know 0 0 0 that ISi |= B(r (i + 1)), also ISi+1 \ ∆ |= B(r (i + 1)) holds by convexity of P∆ . 0 0 |= A for H(r (i + 1)) = {A}. |= r (i + 1), it must hold that ISi+1 Moreover, as ISi+1 Consequently, for r (i + 1) not to be an external support for ∆0 with respect to 0 ISi+1 , we have ∆0 |DA = ∅. As then ∆0 |DH(r (i+1)) = ∅ but ∆0 |Dr (i+1) 6= ∅ it must hold that ∆0 |DB(r (i+1)) 6= ∅. Consider ∆00 = ∆0 ∩ posOcc(B(r (i + 1))) and assume that ∆00 6= ∅. Then, as ∆00 ⊆ ISn , there must be some C-rule r∆00 that is an external support for ∆00 with respect to ISn . Hence, posOcc(H(r∆00 )) ∩ ∆00 6= ∅ and therefore posOcc(H(r∆00 )) ∩ posOcc(B(r (i + 1))) 6= ∅. It follows that r (i + 1) ≺ r∆00 . From that we get r∆00 ∈ PSi0 . This is a contradiction as we know that 0 posOcc(H(r∆00 )) ∩ ∆00 6= ∅, posOcc(H(r∆00 )) ∩ ∆00 ⊆ ISi0 , and ∆00 ⊆ ISi+1 \ ISi0 . 0 0 Consequently, ∆ ∩ posOcc(B(r (i + 1))) = ∅ must hold. From ∆ |DB(r (i+1)) 6= ∅ we 0 get that there is some L ∈ B(r (i + 1)) with ∆0 |DL 6= ∅. As ISi+1 |= L, we have that 0 0 ISi+1 |DL ∈ C in the case L is a C-atom L = hDL , C i, and ISi+1 |DL ∈ 2D L \ C in the 0 case L is a default negated C-atom L = not hDL , C i. In both cases, as ∆0 ⊆ ISi+1 and ∆0 |DL 6= ∅, we get a contradiction to ∆0 ∩ posOcc(B(r (i + 1))) = ∅. References Alviano, M., Dodaro, C., Leone, N., and Ricca, F. 2015. Advances in WASP. In Logic Programming and Nonmonotonic Reasoning - 13th International Conference, LPNMR 2015, Lexington, KY, USA, Sept. 27-30, 2015. Proceedings, F. Calimeri, G. Ianni, and M. Truszczyński, Eds. LNCS, vol. 9345. Springer, 40–54. Ben-Eliyahu, R. and Dechter, R. 1994. Propositional semantics for disjunctive logic programs. Annals of Mathematics and Artificial Intelligence 12, 1-2, 53–87. Stepwise Debugging of Answer-Set Programs 55 Brain, M., Cliffe, O., and De Vos, M. 2009. A pragmatic programmer’s guide to answer set programming. In Proceedings of the 2nd International Workshop on Software Engineering for Answer-Set Programming (SEA’09), Potsdam, Germany, M. De Vos and T. Schaub, Eds. 49–63. Brain, M. and De Vos, M. 2005. Debugging logic programs under the answer set semantics. In Proceedings of the 3rd International Workshop on Answer Set Programming (ASP’05), Advances in Theory and Implementation, Bath, UK, Sept. 27-29, 2005, M. De Vos and A. Provetti, Eds. CEUR Workshop Proceedings, vol. 142. CEUR-WS.org. Brain, M., Gebser, M., Puehrer, J., Schaub, T., Tompits, H., and Woltran, S. 2007. That is illogical Captain! The debugging support tool spock for answer-set programs – System description. In Proceeding of the 1st International Workshop on Software Engineering for Answer Set Programming (SEA’07), Tempe, AZ, USA, May 14, 2007, M. De Vos and T. Schaub, Eds. 71–85. Brain, M., Gebser, M., Pührer, J., Schaub, T., Tompits, H., and Woltran, S. 2007. Debugging ASP programs by means of ASP. In Proceedings of the 9th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’07), Tempe, AZ, USA, May 15-17, 2007, C. Baral, G. Brewka, and J. S. Schlipf, Eds. LNCS, vol. 4483. Springer, 31–43. Brochenin, R., Lierler, Y., and Maratea, M. 2014. Abstract disjunctive answer set solvers. In Proceedings of the 21st European Conference on Artificial Intelligence (ECAI’14), Prague, Czech Republic, Aug. 18-22, 2014, T. Schaub, G. Friedrich, and B. O’Sullivan, Eds. Frontiers in Artificial Intelligence and Applications, vol. 263. IOS Press, 165–170. Busoniu, P.-A., Oetsch, J., Pührer, J., Skočovský, P., and Tompits, H. 2013. Sealion: An eclipse-based IDE for answer-set programming with advanced debugging support. Theory and Practice of Logic Programming 13, 4-5, 657–673. Caballero, R., Garcı́a-Ruiz, Y., and Sáenz-Pérez, F. 2008. A theoretical framework for the declarative debugging of datalog programs. In Revised Selected Papers of the 3rd International Workshop on Semantics in Data and Knowledge Bases (SDKB’08), Nantes, France, Mar. 29, 2008, K.-D. Schewe and B. Thalheim, Eds. LNCS, vol. 4925. Springer, 143–159. Cliffe, O., De Vos, M., Brain, M., and Padget, J. A. 2008. ASPVIZ: Declarative visualisation and animation using answer set programming. In Proceedings of the 24th International Conference on Logic Programming (ICLP’08), Udine, Italy, Dec. 9-13, 2008, M. G. de la Banda and E. Pontelli, Eds. LNCS, vol. 5366. Springer, 724–728. Denecker, M. 2000. Extending classical logic with inductive definitions. In Proceedings of the 1st International Conference on Computational Logic (CL’10), London, UK, July 24-28, 2000, J. W. Lloyd, V. Dahl, U. Furbach, M. Kerber, K. Lau, C. Palamidessi, L. M. Pereira, Y. Sagiv, and P. J. Stuckey, Eds. LNCS, vol. 1861. Springer, 703–717. Denecker, M. and Ternovska, E. 2008. A logic of nonmonotone inductive definitions. ACM Transactions on Computational Logic 9, 2. Denecker, M., Vennekens, J., Bond, S., Gebser, M., and Truszczyński, M. 2009. The second answer set programming competition. In Proceedings of the 10th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’09), Potsdam, Germany, Sept. 14-18, 2009, E. Erdem, F. Lin, and T. Schaub, Eds. LNCS, vol. 5753. Springer, 637–654. Dodaro, C., Gasteiger, P., Musitsch, B., Ricca, F., and Shchekotykhin, K. M. 2015. Interactive debugging of non-ground ASP programs. In Logic Programming and Nonmonotonic Reasoning - 13th International Conference, LPNMR 2015, Lexington, KY, USA, Sept. 27-30, 2015. Proceedings, F. Calimeri, G. Ianni, and M. Truszczyński, Eds. LNCS, vol. 9345. Springer, 279–293. 56 J. Oetsch, J. Pührer, and H. Tompits Eiter, T., Ianni, G., Schindlauer, R., and Tompits, H. 2005. A uniform integration of higher-order reasoning and external evaluations in answer-set programming. In Proceedings of the 19th International Joint Conference on Artificial Intelligence (IJCAI’05), Edinburgh, Scotland, UK, July 30-Aug. 5, 2005, L. P. Kaelbling and A. Saffiotti, Eds. Professional Book Center, 90–96. Faber, W., Leone, N., and Pfeifer, G. 2004. Recursive aggregates in disjunctive logic programs: Semantics and complexity. In Proceedings of the 9th European Conference on Logics in Artificial Intelligence (JELIA’04). LNCS, vol. 3229. Springer, 200–212. Faber, W., Pfeifer, G., and Leone, N. 2011. Semantics and complexity of recursive aggregates in answer set programming. Artificial Intelligence 175, 1, 278–298. Ferraris, P. 2011. Logic programs with propositional connectives and aggregates. ACM Transactions on Computational Logic 12, 4, 25. Frühstück, M., Pührer, J., and Friedrich, G. 2013. Debugging answer-set programs with Ouroboros – Extending the SeaLion plugin. In Proceedings of the 12th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’13), Corunna, Spain, Sept. 15-19, 2013, P. Cabalar and T. C. Son, Eds. LNCS, vol. 8148. Springer, 323–328. Gebser, M., Kaminski, R., König, A., and Schaub, T. 2011. Advances in gringo series 3. In Proceedings of the 11th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’11), Vancouver, Canada, May 16-19, 2011, J. P. Delgrande and W. Faber, Eds. LNCS, vol. 6645. Springer, 345–351. Gebser, M., Kaufmann, B., and Schaub, T. 2012. Conflict-driven answer set solving: From theory to practice. Artificial Intelligence 187-188, 52–89. Gebser, M., Lee, J., and Lierler, Y. 2011. On elementary loops of logic programs. Theory and Practice of Logic Programming 11, 6, 953–988. Gebser, M., Pührer, J., Schaub, T., and Tompits, H. 2008. A meta-programming technique for debugging answer-set programs. In Proceedings of the 23rd AAAI Conference on Artificial Intelligence (AAAI’08), Chicago, IL, USA, July 13-17, 2008, D. Fox and C. P. Gomes, Eds. AAAI Press, 448–453. Gebser, M., Pührer, J., Schaub, T., Tompits, H., and Woltran, S. 2009. spock: A debugging support tool for logic programs under the answer-set semantics. In Revised Selected Papers of the 17th International Conference on Applications of Declarative Programming and Knowledge Management (INAP’07) and 21st Workshop on (Constraint) Logic Programming (WLP’07), D. Seipel, M. Hanus, and A. Wolf, Eds. LNCS, vol. 5437. Springer, 247–252. Gelfond, M. and Lifschitz, V. 1991. Classical negation in logic programs and disjunctive databases. New Generation Computing 9, 3/4, 365–386. Kloimüllner, C., Oetsch, J., Pührer, J., and Tompits, H. 2013. Kara: A system for visualising and visual editing of interpretations for answer-set programs. In Revised Selected Papers of the 19th International Conference on Applications of Declarative Programming and Knowledge Management (INAP’11) and the 25th Workshop on Logic Programming (WLP’11), Vienna, Austria, Sept. 28-30, 2011. LNCS, vol. 7773. Springer, 325–344. Lee, J. 2005. A model-theoretic counterpart of loop formulas. In Proceedings of the 19th International Joint Conference on Artificial Intelligence (IJCAI’05), Edinburgh, Scotland, UK, July 30-Aug 5, 2005, L. P. Kaelbling and A. Saffiotti, Eds. Professional Book Center, 503–508. Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., and Scarcello, F. 2006. The DLV system for knowledge representation and reasoning. ACM Transactions on Computational Logic 7, 3, 499–562. Stepwise Debugging of Answer-Set Programs 57 Li, T., Vos, M. D., Padget, J., Satoh, K., and Balke, T. 2015. Debugging ASP using ILP. In Technical Communications of the 31st International Conference on Logic Programming (ICLP 2015), Cork, Ireland, Aug. 31 - Sept. 4, 2015., M. D. Vos, T. Eiter, Y. Lierler, and F. Toni, Eds. CEUR Workshop Proceedings, vol. 1433. CEUR-WS.org. Lierler, Y. 2011. Abstract answer set solvers with backjumping and learning. Theory and Practice of Logic Programming 11, 2-3, 135–169. Lierler, Y. and Truszczyński, M. 2016. On abstract modular inference systems and solvers. Artificial Intelligence 236, 65–89. Liu, L., Pontelli, E., Son, T. C., and Truszczyński, M. 2010. Logic programs with abstract constraint atoms: The role of computations. Artificial Intelligence 174, 3-4, 295–315. Marek, V. W. and Remmel, J. B. 2004. Set constraints in logic programming. In Proceedings of the 7th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’04), Fort Lauderdale, FL, USA, Jan 6-8, 2004, V. Lifschitz and I. Niemelä, Eds. LNCS, vol. 2923. Springer, 167–179. Marek, V. W. and Truszczyński, M. 1999. Stable models and an alternative logic programming paradigm. In In The Logic Programming Paradigm: a 25-Year Perspective, K. R. Apt, V. W. Marek, M. Truszczyński, and D. S. Warren, Eds. Springer, 375–398. Marek, V. W. and Truszczyński, M. 2004. Logic programs with abstract constraint atoms. In In Proceedings of the 19th National Conference on Artificial Intelligence (AAAI’04), San Jose, CA, USA, July 25-29, 2004, G. Ferguson and D. McGuinness, Eds. AAAI Press, 86–91. Mikitiuk, A., Moseley, E., and Truszczyński, M. 2007. Towards debugging of answerset programs in the language PSpb. In Proceedings of the 2007 International Conference on Artificial Intelligence (ICAI’07), Volume II, Las Vegas, NV, USA, June 25-28, 2007, H. R. Arabnia, M. Q. Yang, and J. Y. Yang, Eds. CSREA Press, 635–640. Niemelä, I. 1999. Logic programs with stable model semantics as a constraint programming paradigm. Annals of Mathematics and Artificial Intelligence 25, 3-4, 241–273. Nieuwenhuis, R., Oliveras, A., and Tinelli, C. 2006. Solving SAT and SAT modulo theories: From an abstract davis–putnam–logemann–loveland procedure to dpll(T). Journal of the ACM 53, 6, 937–977. Oetsch, J., Prischink, M., Pührer, J., Schwengerer, M., and Tompits, H. 2012. On the small-scope hypothesis for testing answer-set programs. In Proceedings of the 13th International Conference on Principles of Knowledge Representation and Reasoning (KR’12), Rome, Italy, June 10-14, 2012, G. Brewka, T. Eiter, and S. A. McIlraith, Eds. AAAI Press. Oetsch, J., Pührer, J., and Tompits, H. 2010. Catching the Ouroboros: On debugging non-ground answer-set programs. Theory and Practice of Logic Programming 10, 4-6 (July), 513–529. Oetsch, J., Pührer, J., and Tompits, H. 2010. Let’s break the rules: Interactive procedural-style debugging of answer-set programs. In Proceedings of the 24th Workshop on (Constraint) Logic Programming (WLP’10), Cairo, Egypt, Sept. 14-16, 2010, S. Abdennadher, Ed. Technical Report, Faculty of Media Engineering and Technology, German University in Cairo. 77–87. Oetsch, J., Pührer, J., and Tompits, H. 2011. Stepping through an answer-set program. In Proceedings of the 11th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’11), Vancouver, Canada, May 16-19, 2011. LNCS, vol. 6645. Springer, 134–147. Oetsch, J., Pührer, J., and Tompits, H. 2012a. An FLP-style answer-set semantics for abstract-constraint programs with disjunctions. In Technical Communications of the 58 J. Oetsch, J. Pührer, and H. Tompits 28th International Conference on Logic Programming (ICLP’12), Budapest, Hungary, A. Dovier and V. S. Costa, Eds. LIPIcs, vol. 17. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 222–234. Oetsch, J., Pührer, J., and Tompits, H. 2012b. Stepwise debugging of descriptionlogic programs. In Correct Reasoning - Essays on Logic-Based AI in Honour of Vladimir Lifschitz, E. Erdem, J. Lee, Y. Lierler, and D. Pearce, Eds. LNCS, vol. 7265. Springer, 492–508. Oetsch, J., Pührer, J., and Tompits, H. 2013. The SeaLion has landed: An IDE for answer-set programming—Preliminary report. In Revised Selected Papers of the 19th International Conference on Applications of Declarative Programming and Knowledge Management (INAP’11) and the 25th Workshop on Logic Programming (WLP’11), Vienna, Austria, Sept. 28-30, 2011. LNCS, vol. 7773. Springer, 305–324. Polleres, A., Frühstück, M., Schenner, G., and Friedrich, G. 2013. Debugging non-ground ASP programs with choice rules, cardinality constraints and weight constraints. In Proceedings of the 12th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’13), Corunna, Spain, Sept. 15-19, 2013, P. Cabalar and T. C. Son, Eds. LNCS, vol. 8148. Springer, 452–464. Pontelli, E., Son, T. C., and El-Khatib, O. 2009. Justifications for logic programs under answer set semantics. Theory and Practice of Logic Programming 9, 1, 1–56. Pührer, J. 2007. Master’s thesis, Vienna University of Technology, Vienna, Austria. Pührer, J. 2014. Stepwise debugging in answer-set programming: Theoretical foundations and practical realisation. Ph.D. thesis, Vienna University of Technology, Vienna, Austria. http://repositum.tuwien.ac.at/urn:nbn:at:at-ubtuw:1-75281 [Online; accessed Dec. 14, 2016]. Redl, C. 2016. The dlvhex system for knowledge representation: recent advances (system description). Theory and Practice of Logic Programming 16, 5-6, 866–883. Shapiro, E. Y. 1982. Algorithmic program debugging. Ph.D. thesis, Yale University, New Haven, CT, USA. Shchekotykhin, K. M. 2015. Interactive query-based debugging of ASP programs. In Proceedings of the 29th AAAI Conference on Artificial Intelligence (AAAI’15), Austin, TX, USA, Jan. 25-30, 2015, B. Bonet and S. Koenig, Eds. AAAI Press, 1597–1603. Simons, P., Niemelä, I., and Soininen, T. 2002. Extending and implementing the stable model semantics. Artificial Intelligence 138, 181–234. Smith, A. 2011. Lonsdaleite. https://github.com/rndmcnlly/Lonsdaleite. [Online; accessed Dec. 14, 2016]. Syrjänen, T. 2006. Debugging inconsistent answer set programs. In Proceedings of the 11th International Workshop on Non-Monotonic Reasoning (NMR’06), Lake District, UK, May 30-June 1, 2006, J. Dix and A. Hunter, Eds. Institut für Informatik, Technische Universität Clausthal, Technical Report, 77–83. Truszczyński, M. 2010. Reducts of propositional theories, satisfiability relations, and generalizations of semantics of logic programs. Artificial Intelligence 174, 16-17, 1285– 1306. Wittocx, J. 2009. IDPDraw, a tool used for visualizing answer sets. https://dtai.cs. kuleuven.be/software/idpdraw. [Online; accessed Dec. 14, 2016]. Wittocx, J., Vlaeminck, H., and Denecker, M. 2009. Debugging for model expansion. In Proceedings of the 25th International Conference on Logic Programming (ICLP’09), Pasadena, CA, USA, July 14-17, 2009, P. M. Hill and D. S. Warren, Eds. LNCS, vol. 5649. Springer, 296–311.
6cs.PL
ISEC: Iterative over-Segmentation via Edge Clustering arXiv:1802.05816v1 [cs.CV] 16 Feb 2018 Marcelo Mendonça, Luciano Oliveira Intelligent Vision Research Lab, Federal University of Bahia, Salvador-BA, Brazil Abstract Several image pattern recognition tasks rely on superpixel generation as a fundamental step. Image analysis based on superpixels facilitates domain-specific applications, also speeding up the overall processing time of the task. Recent superpixel methods have been designed to fit boundary adherence, usually regulating the size and shape of each superpixel in order to mitigate the occurrence of undersegmentation failures. Superpixel regularity and compactness sometimes imposes an excessive number of segments in the image, which ultimately decreases the efficiency of the final segmentation, specially in video segmentation. We propose here a novel method to generate superpixels, called iterative oversegmentation via edge clustering (ISEC), which addresses the over-segmentation problem from a different perspective in contrast to recent state-of-the-art approaches. ISEC iteratively clusters edges extracted from the image objects, providing adaptive superpixels in size, shape and quantity, while preserving suitable adherence to the real object boundaries. All this is achieved at a very low computational cost. Experiments show that ISEC stands out from existing methods, meeting a favorable balance between segmentation stability and accurate representation of motion discontinuities, which are features specially suitable to video segmentation. Keywords: Superpixels, Video object segmentation ∗ Corresponding author Email address: [email protected] (Luciano Oliveira) 1 1. Introduction The result of an image over-segmentation lies in somewhere between the pixel and the object segmentation itself. The term “superpixel” has been used to refer to the information in such intermediate level. Indeed, many tasks that involves image segmentation take advantage of working with superpixels rather than pixels. Examples range from tracking [1] through 3D reconstruction [2] to semantic image segmentation [3]. Superpixels are also applied in many domainspecific applications, such as in traffic analysis [4], and in biological [5] and medical [6] image segmentation, just to name a few. In view of this wide applicability, many superpixel methods have been proposed in recent years (see recent surveys in [7, 8]). Research on superpixel started with image segmentation methods running on over-segmentation mode. Earlier methods were not explicitly conceived to generate image superpixels. For instance, segmentation methods such as watershed (WS) [9] and normalized cuts (NC) [10] are able to produce the oversegmentation effect by adjusting the number of seeds, in the case of the former, or the number of graph partitions, in the latter. Later methods such as edge augmented mean shift (EAMS) [11], Felzenszwalb-Huttenlocher (FH) [12] and quick shift (QS) [13] were specifically designed to produce image over-segmentation by pursuing adherence to real object contours. In these latter methods, the rationale consists in automatically regulating the amount of generated superpixels according to internal parameters, although without providing direct control over the number of generated segments. More recently, several methods have been groundly developed towards generating superpixels by directly providing control over the number of segments [14, 15, 16, 17, 18, 19]; the goal is to divide the image into a generally user-defined fixed number of segments, also trying to match the segment boundaries as accurate as possible to the real object contours. The advantages of these methods are (i) the larger the chosen number of superpixels, the lower the probability of occurring undersegmentation errors, i.e., when 2 Figure 1: Examples of superpixel segmentation. From left to right column: SLIC [15] segmentation, with k = 200, LSC [19] segmentation, with k = 200, and ISEC segmentation, with k = 158, where k is the number of generated superpixels; for SLIC and LSC, k is user-defined, while for ISEC, k is image-based adaptive. Bottom images highlight the parachute man segmentation for each method: SLIC and LSC present undersegmentation failures, while ISEC correctly segments the image object. the same segment overlaps different objects, (ii) approaches based on a fixed number of segments usually provide more regular superpixels regarding shape and size, which can be useful for some applications, e.g., object recognition [20] and labeling [21], and (iii), since superpixel methods are commonly used as a preprocessing stage for other computer vision tasks, by keeping control over the number of segments, one can make the computational effort in the further steps be more predictable. Deciding about the better strategy to generate superpixels – if the number of segments is automatically or externally provided – gives rise to a straightforward question: “How many superpixels should an over-segmentation method 3 generate for a given image?” We could intuitively say that the answer depends on the image. In words, if there are many objects, more segments will be necessary; otherwise, just a small number would be enough. Despite this immediate conclusion, more recent superpixel methods have not actually addressed the over-segmentation problem from such an adaptive perspective. Specially because of the undersegmentation problem, most of the recent methods goes towards generating a fixed and externally provided number of superpixels. To illustrate that situation, Fig. 1 shows the results of superpixel generation by two state-of-the-art methods: simple linear iterative clustering (SLIC) [15] (left column), and linear spectral clustering (LSC) [19] (middle column). In the figure, both SLIC and LSC were set to yield 200 superpixels. With this number, both methods provide superpixels that correctly adhere to the contours of the big mountain in the figure, although the parachute man is not accurately segmented, causing an undersegmentation failure. Errors, like in the parachute man segmentation, mainly take place when the generated superpixels are much bigger than the object being segmented. An alternative to tackle this problem could be to increase the number of superpixels, making them smaller. However, an excessive over-segmentation implies to segment other objects in the image into much more parts than necessary, reducing efficiency1 . Also, the grid-like segmentation provided by methods such as SLIC and LSC does not allow to distinguish homogeneous areas from object-filled regions in the image (e.g., the blue sky in the background), resulting in unnecessary over-segmentation of these areas. 1.1. Contributions A method called iterative over-segmentation via edge clustering (ISEC) is proposed in this paper. ISEC is a novel superpixel method that addresses the over-segmentation problem from a different perspective in contrast to recent 1 In this context, efficiency means capturing the maximum number of real object contours with the minimum number of superpixels. 4 state-of-the-art approaches. The proposed method iteratively clusters edges extracted from the image objects, providing superpixels that are, at the same time, adaptive in size, shape and quantity, while preserving efficient adherence to the real object boundaries. All this is achieved at a very low computational cost. The right column of Fig. 1 illustrates the result of ISEC over-segmentation on the same image segmented by SLIC and LSC. It is noteworthy that ISEC is able to self-adapting to correctly segment both the big mountain and the small parachute man, avoiding unnecessarily segmenting most of the background comprised of the homogeneous blue sky. Thanks to the adaptiveness of the proposed method, the resulting over-segmentation in Fig. 1 was accomplished with comparatively fewer (158) superpixels than SLIC and LSC, turning ISEC to be more efficient in this case. On the other hand, superpixels generated by SLIC and LSC are much more regular in shape and size, while ISEC prioritizes superpixels more adjusted to the real object contours. For some applications, such as that one to segment magnetic resonance images [22], adherence to real object contour is a crucial characteristic rather than superpixel regularity or compactness, since superpixels with compact structure are less able to cover complete objects in that type of image. The proposed method iteratively groups image edges in order to form clusters. The rationale is that the borders that delimit these clusters are to be superpixels presenting real object contour adherence efficiently (see Section 3 for details). Results from video-based evaluation metrics [23] indicate that the superpixels generated by ISEC demonstrate promising performance regarding video segmentation. This assessment is corroborated by the results found in a video object segmentation experiment (see Section 4). Indeed, previous comparisons [24] have demonstrated that superpixels with characteristics similar to ISEC perform better than grid-like, regular-shaped superpixels in video object segmentation. In [23], Neubert and Protzel make a thorough evaluation on superpixel methods focused on video segmentation; they point out a lack of superpixel methods able to produce segmentations that are consistent in two criteria: segmentation stability and accurate representation of motion discon5 tinuities. Our experiments show that ISEC stands out from existing methods, meeting a favorable balance between the aforementioned criteria. 2. Related works Some of the existing superpixel methods are reviewed here. The presented methods are further compared to ISEC in our experimental evaluation (results on evaluation performance are reported in Section 4). WS (1992) [9] – Watershed is an well-known, very fast over-segmentation algorithm. It works by iteratively growing user-defined seeds until they reach the borders of other adjacent growing seeds. The number of superpixels is determined by the number of seeds. There is an open source C/C++ implementation available at OpenCV2 . NC (2000) [10] – The Normalized Cuts is a widely used graph-based algorithm, and maybe the first applied to generate superpixels [7]. As such, NC recursively produces a graph, in which the vertices correspond to the image pixels, while the weights account for similarities among the pixels. Superpixels are obtained by partitioning this graph in a user-defined number of segments. This process takes a lot of time when compared to other methods. Our experiments using NC have been done with resized images (160 pixels on the longer side, while keeping the aspect ratio) to save time. An open source implementation for Matlab and C++ is available3 . EAMS (2001) [11] – Edge Augmented Mean Shift is a density-based algorithm that performs an iterative mode-seeking procedure in a computed density image. This procedure consists in finding modes in color or intensity feature space so that each pixel is assigned to the corresponding mode where it falls into. The superpixels are composed by the pixels that converge to the same mode. This 2 http://opencv.willowgarage.com/wiki/ 3 http://www.timotheecour.com/software/ncut/ncut.html 6 method mainly differs from the k-means algorithm since it does not require a user-defined number of clusters. Source codes in C and Matlab are available4 . FH (2004) [12] – Felzenszwalb-Huttenlocher is a graph-based superpixel approach. The algorithm measures the evidence of a boundary between two regions by computing a graph-based representation of the image. FH tries to preserve details when a region presents low variability, while details in image regions with high variability are ignored. This is done by using a greedy algorithm that also satisfies global properties. FH automatically controls the number of superpixels, and it is among the fastest superpixel methods. An open source C++ implementation is available5 . QS (2008) [13] – Quick Shift is also a mode-seeking segmentation method. Instead of relying on a gradient ascent approach such as EAMS, QS uses a medoid shift. The medoid is faster than the mean shift in Euclidean space. The algorithm builds a tree of paths by moving each point in the feature space to the nearest neighbor that increases the density estimative. Superpixels are obtained by splitting the branches of the tree using a threshold. The number of segments is automatically controlled, and the method is not fast. Implementation in C and Matlab is available as part of the VLFeat library6. VEK (2010) [14] – Veksler Superpixels. This method is also a graph-based approach, but based on regular partition. The segmentation is assumed as an energy minimization problem that explicitly encourages constant intensity inside the superpixels. Segmentations are generated by gluing overlapping image patches until each pixel remains only inside of an individual patch. There are two available implementations of VEK, one for compact and other for constantintensity superpixels. In our experiments, we evaluated only the latter7 . VEK is among the slowest algorithms, and the number of superpixels is user-defined. 4 http://www.wisdom.weizmann.ac.il/ ~ bagon/matlab.html ~ pff/segment/ 6 http://www.vlfeat.org/overview/quickshift.html 7 http://www.csd.uwo.ca/faculty/olga/code.html 5 http://www.cs.brown.edu/ 7 SLIC (2010) [15] – Simple Linear Iterative Clustering is inspired by the k-means algorithm. However, the strategy is modified to limit the region in which the algorithm searches for similarities among the pixels. SLIC considers only the pixels within a defined spatial neighborhood. The process begins by dividing the image into a regular grid where the number of cells is defined by the user. Color and spatial distances among the pixels are measured in order to iteratively adjust the cells to form superpixels. SLIC is among the fastest algorithms. An implementation in C++ and Matlab is available8 . ERS (2011) [16] – Entropy Rate Superpixel Segmentation is formulated as a maximization problem on a graph-based image representation. The method relies on an objective function for superpixel segmentation that accounts for the entropy among the graph edges and the size of the segments. ERS generates superpixels by selecting the edges that yield the largest gain of the objective function. ERS iterates until the user-defined number of clusters is reached, which usually takes over a second. An implementation in C/C++ is available9 . SEEDS (2012) [17] – Superpixels Extracted via Energy-Driven Sampling. This method iteratively optimizes an energy function, starting from a grid-like image segmentation and then modifying the boundaries according to the function. In each step, pixels are exchanged between neighboring segments so that if the new composition produces a gain of the energy function, it is retained, otherwise it is rejected. The number of generated superpixels is user-defined, and the method is among the fastest ones. An implementation in C and Matlab is available10 . CWS (2014) [18] – Compact Watershed is a modified version of the original WS method, aiming at providing control over the superpixel compactness. The modification encompasses two aspects: grid arrangement of the seeds and incorporation of a controllable compactness constraint. This is done by means of a single parameter that controls the level of compactness regardless the num8 http://ivrl.epfl.ch/supplementary_material/RK_SLICSuperpixels/index.html 9 https://github.com/mingyuliutw/EntropyRateSuperpixel 10 http://www.mvdblive.org/seeds/ 8 ber of segments or the image size. CWS is so fast as the original WS. An implementation in C/C++ is available11 . LSC (2015) [19] – Linear Spectral Clustering uses kernel functions to construct a ten-dimensional representation of the image. This high dimensionality is given by a set of features extracted for each pixel. After initializing clusters from seeds distributed along the image, an iterative process measures the distances between pixels and clusters in the feature space, assigning the pixels to the cluster with the closest distance. This process ends when the clusters become stable, which is accomplished in a few reasonable time. The number of clusters (superpixels) is user-defined. An implementation in C++ with Matlab interface is available12 . 3. Superpixel generation via edge clustering Superpixels are generated from image edges, which are iteratively selected and grouped to form clusters. Clustered pixels represent image locations where the spatial neighborhood is densely filled by edges. Since the edges are strongly related to the objects contours and texture, the clusters resemble the object shapes. Superpixels are ultimately obtained by extracting the borders that separate these clusters from image regions where there are no edges. By adjusting the edge selection procedure so that a group of edges are selected at the beginning of the process, and edges are progressively removed at each new iteration, the input image is over-segmented from the outer contours of the objects to their small internal parts. Figure 2 depicts the top-down view of ISEC. Next, each part of the proposed method is described. 3.1. Gradient extraction Given an input image (Fig. 2.a), the first step is to compute, for each pixel, the gradient magnitude (Fig. 2.b) and orientation along the x and y axes (Fig. 2.c). Canny edge detector is used to calculate the image gradients. The 11 https://www.tu-chemnitz.de/etit/proaut/forschung/cv/segmentation.html.en 12 https://jschenthu.weebly.com/projects.html 9 Figure 2: Top-down view of ISEC. Gradient extraction: An input image (a) is used to compute gradient magnitudes (b) and orientations (c) in the x and y axes. Cumulative contour extraction: For each iteration, an edge set (d) is selected from the gradient; the edges are stretched (e) by edge density filtering, being binarized to form clusters (f); a thinning operation is performed on the clusters to readjust their shapes (g); the borders of the clusters are extracted (h) and stored. Superpixel refinement: The accumulated segments (i) are refined to produce the final result (j). The generated superpixels are showed over the input image (k); some parts are zoomed to highlight segmentation details. gradients are individually computed over each RGB channel. The final gradient magnitude is given by the highest magnitude presented by the pixel among the channels. By doing that, color information is also encoded in the edge detection process. 10 3.2. Cumulative contour extraction Once the image gradients are computed, a set of edges (Fig. 2.d) is initially selected from the gradient map. Edge selection is iteratively performed by combining non-maximum suppression and double thresholding, just as in Canny detection13 . Initially, small thresholds are used so that a great amount of edges are selected. As the process iterates, the thresholds become more restrictive, yielding progressively fewer edges. The idea consists in extracting the object contours in an outside-in manner, i.e., starting from the silhouette to inward subparts. This strategy is accomplished by handling the edge detection thresholds. For small thresholds, many edges are selected, including those ones related to strong contours (high gradient magnitude), or even edges originated from smooth contours and textures (low gradient magnitude). This initial great amount of edges tend to compose clusters with the same shape as the object that originated the edges. As the process iterates, the thresholds are incremented, becoming increasingly restrictive. These higher thresholds prevent many edges to be selected from smooth contours and texture, remaining only the edges related to stronger contours. These stronger edges tend to resemble smaller internal subparts of bigger objects. In principle, directly using edges to construct superpixel is tempting, since edges are strongly related to the real object contours. However, this is not practical because edges generally present discontinuities, resulting in unclosed segments. To tackle this problem we perform a spatial linear filtering on the edge image, given by 2 S 1 X pi , ED = 2 S i=1 (1) where ED denotes edge density, which is calculated by an arithmetic mean over the neighborhood SxS of the pixel pi . 13 Different edge detection strategies could be used instead, and Canny was chosen because of the best results at the experiments. 11 Figure 3: Edge reconstruction. The ED filter computes the edge density in the neighborhood SxS of each pixel pi ; the effect is to blur the edge pixels through the filter area, forming a cluster where the gaps are filled. Next, binarization is applied to separate the edge cluster from the empty surroundings. A thinning operation is performed (S − 1)/2 times in order to readjust the cluster shape; the most outer pixels are removed without causing new gaps. Although many pixels in the resulting image represent edge discontinuities, the local ED in these pixels is not null. The effect of the filtering process is to blur the edges through the filter area (Fig. 2.e), causing many gaps to be filled. 12 Image areas massively occupied by edges become clusters that contrasts with the empty surroundings. After binarizing the image (Fig. 2.f), clusters are precisely distinguished from the empty regions. ISEC follows the idea that the boundaries that separate these two regions are convenient to compose superpixels contours. The ED filter also causes a dilation on the clusters. That edge dilation has the side effect of driving the edges to lose their intrinsic adherence to the real object contours. This issue is coped by applying a thinning operation on the edge clusters in order to readjust their shape (Fig. 2.g). The thinning is a morphological operation that removes the most external pixels in a segment of a binary image towards a line with the thickness of a single pixel – not allowing for new discontinuities. Since the ED filter expands the clusters by S − 1 pixels, the thinning operation needs to be performed (S−1)/2 times in order to readjust the cluster borders to correctly match the real object contours (considering that this operation performs symmetrically in both sides of the segments). Figure 3 illustrates, at the pixel level, how this filtering-binarizing-thinning process accomplishes the edge reconstruction. After reshaping the edge clusters, the next step is to extract the cluster borders (Fig. 2.h). In order to save processing time, this step is done by using look-up tables (LUT). These LUT’s allow for fast pixel-level operations in a binary image, by replacing more expensive run-time calculations with simple searches for precomputed values in memory. To extract the cluster borders, we search for 1’s pixels that have at least one 0 in their 3×3 neighborhood. Before the searching, the look-up table has been fetched with all the 512 possible patterns that can be found in the 3×3 neighborhood of the pixel in the binary image. At the end of each iteration, the set of extracted borders is stored. Additionally, the edge detection thresholds are incremented and the order, S, of the ED filter is reduced. The goal is to make the filter to better fit into the smaller parts of the objects at the next iteration. 13 3.3. Superpixel refinement When the segments provided by each previous iteration are assembled together, some borders eventually end up being adjacent, resulting in thick lines (Fig. 2.i). Also, some segments can be too small or even individual pixels. The purpose of this superpixel refinement stage is to use morphological operations to remove such irregularities, improving the final result (Fig. 2.j). Figure 2.k shows the generated superpixels overlapped with the input image; some parts are zoomed to highlight segmentation details. The proposed superpixel segmentation method is summarized in Algorithm 1. Algorithm 1 Iterative over-Segmentation via Edge Clustering Input: Image I; size S of the filter; lower and higher thresholds [t, T ] Output: Labeled image containing superpixels SP X 1: for each pixel pi in I do 2: G ← argmax(gradient(pi{R} , pi{G} , pi{B} )) 3: end for 4: SP X ← 0 5: for k = t to T do 6: E ← edgeSelection(G,k) 7: for each pixel pi in a region S×S of E do 8: 9: ED ← 1 S2 end for PS 2 i=1 pi ⊲ Edge Density 10: Binarize ED 11: Perform thinning of ED, ((S − 1)/2) times 12: C ← clusterContourExtraction(ED) 13: SP X ← OR(SP X,C) 14: if S >minimum filter order then 15: 16: S ← S −2 end if 17: end for 18: Merge adjacent contours and remove isolated pixels in SP X 19: Label SP X 14 4. Experimental analysis 4.1. Methodology Most of the recent methods for superpixel generation rely on user-defined number of superpixels. That fact drove to performance metrics, which are computed as function of the number of superpixels, such as: video-based metrics – motion undersegmentation error (MUSE) and motion discontinuity error (MDE) (see Section 4.2), and image-based metrics – undersegmentation error (UE) and boundary recall (BR) (see Section 4.3). For a given dataset, the usual evaluation methodology consists in running the methods on all the images repeatedly, each time generating a segmentation set with a different number of superpixels. The evaluation metrics are computed for all the images in each segmentation set, and averaged by the total of images. The results are usually plotted in a graph, putting the number of superpixels against the value of the respective metric. This methodology imposes constraints to evaluate methods such as ISEC, whose the number of superpixels depends on the image. In order to make ISEC be comparable to the other methods, the evaluations were run by varying the step in which the ISEC’s edge detection thresholds are incremented. By setting a small step, the thresholds are increased more slowly, resulting in more edges being selected and, consequently, more superpixels. Conversely, the bigger the steps, the fewer the superpixels. It is noteworthy that such procedure only affects the number of superpixels indirectly. This procedure achieves an average number of superpixels on a given data set, although this number can considerably vary for each individual image. Experimental evaluation also includes assessing performance of the evaluated methods based on an existing application on video object segmentation (see Section 4.4). The methods are evaluated according to the overall performance achieved by the application to segment a video data set. For that video segmentation task, superpixel generation works as an independent module, allowing for the evaluation of different superpixel methods compared in the experiment. 15 4.2. Video-based evaluation metrics In [23], a benchmark on video segmentation is proposed to evaluate superpixel methods. Primarily, the benchmark provides completely data-driven metrics, based on optical flow. The motivation is to avoid the ground truth biasing due to eventual semantic knowledge inserted by human-made annotations. To better understand, suppose evaluating an object segmentation provided by a given method. Although separating the object from the background and surroundings is an obvious requirement, it is not always clear which subparts of the object itself need to be segmented apart. As humans intrinsically rely on contextual information when doing that task, metrics based on manually annotated data may be imprecise. Using optical flow as ground truth guarantees that only information contained in the image itself is used in the evaluation process. The benchmark provides two metrics, based on the following criteria: • Stability - Evaluates the capability of the segmentation method to find the same regions or object boundaries regardless of image changes. The metric to assess this criterion is called MUSE, which measures the stability of a segmentation between two frames, I1 and I2 , and is given as   1 X  M U SE = N F a∈L1 X b∈L2 :a∩b6=0  min(bin , bout ) , (2) where N is the total number of pixels, LF 1 is a segmentation of I1 in which the labels were transformed by using optical flow into the pixels of I2 ; L2 is the segmentation of I2 . Individual superpixels belonging to these segmentations are, respectively, a and b; bout is the number of pixels of b that are outside a, while bin is the number of pixels that are in a ∩ b. The rationale is to segment subsequent frames, and then use the ground-truth optical flow to transform the first segmentation into the view of the second image, making the segmentations comparable. MUSE measures how well one segmentation can be reconstructed from the other. 16 • Discontinuity - Evaluates how well the generated superpixels can represent motion discontinuities in the image sequence. For instance, motion differences between moving foreground objects and the background, or among parts of the same object. The metric, called MDE, is defined as XX 1 k∇F (i, j)k2 .D(B(i, j)) , j k∇F (i, j)k2 i j M DE = P P i (3) where F is the ground-truth optical flow between two frames, B is the superpixel segmentation of one of these frames, and D(B) is the distance transform of B which contains, for each pixel, the distance to the nearest segment boundary. MDE accumulates a penalty over all image pixels, which is the product of the magnitude of motion discontinuity at this pixel and its distance to the next segment border (normalized by the total amount of motion in the image). Please, refer to [23] for more details on the metric. The benchmark uses the Sintel data set [25], which has 23 computer rendered scenes, each one with 20 to 50 color images of size 1024 × 436. The ground-truth optical flow has been directly extracted from the data used for rendering. The usage of computer rendered images allows for the presence of denser optical flow data in Sintel compared to data sets based on natural images. This denser optical flow data supplies ground truth information for basically all image pixels, even when some pixels are occluded among a sequence of frames. We compare ISEC performance on Sintel data set with the methods: ERS [16], QS [13], EAMS [11], FH [12], SEEDS [17], VEK [14], WS [9], NC [10], CWS [18], SLIC [15] and LSC [19]. Also, a simple regular grid segmentation (BOX) has been included for baseline comparison. For all the compared methods, the implementations are based on publicly available code. The results are illustrated in Fig. 4. MUSE penalizes segments for which counterparts are not found in subsequent frames. Therefore an increase of the error with respect to the number of superpixels is expected, since by raising this number, homogeneous image 17 Figure 4: Video-based evaluation results on Sintel data set. (a) MUSE measures the segmentation stability among the frames; methods that over-segment homogeneous regions in the image perform worse in this metric. (b) MDE evaluates how well the motion discontinuities present in the video sequence are represented by the generated superpixels; methods that provide segmentations where the superpixels are distributed by the whole image area can better represent motion discontinuities. ISEC is the only method to perform better than the baseline (BOX) in both MUSE and MDE, indicating that the proposed method has suitable features for video segmentation. regions are further segmented. Such homogeneous regions do not offer gradient support for the segmentation process, entailing a lot of variations in the segments among the frames, which contributes for instability. That is the reason why methods like EAMS, FH and ISEC, which do not rely on a grid-like segmentation, perform best on this stability criterion. In turn, the other methods present results that are next or even worse than the baseline BOX, as showed in Fig. 4.a. For MDE, an opposite behavior is expected, that is, the greater the number of superpixels, the lower the error. This is because by increasing the image partitioning, more boundaries are produced. Hence it is more likely that some of these boundaries lie on motion discontinuities regions in the image. According to [23], MDE is complementary to MUSE. This becomes evident in the plots of Fig. 4.b, where the methods appear in an inverted order compared to the previous MUSE evaluation. In MDE evaluation, methods such as SLIC, ERS, 18 SEEDS, LSC, VEK, NC, CWS and QS, which provide grid-like segmentations (and consequently more distributed boundaries along the image area), present the best results. EAMS and FH, on the other hand, perform poorly on this metric. It is remarkable that on the Sintel data set, ISEC is the only method to perform better than the BOX in both MUSE and MDE. This result tackles the problem pointed out by [23]: methods that perform well on one criterion often show problems with the other, that is, stability or motion discontinuity representation. In words, the results indicate that our method provides a balance between segmentation stability and accuracy for video segmentation, filling the gap emphasized by the benchmark. Figure 5 shows a visual comparison of Sintel segmentations generated by ISEC and four other methods: SLIC and LSC, in which the number of superpixels is user-defined; and EAMS and FH, in which the number of superpixels is adaptive. 4.3. Image-based metrics Berkeley Segmentation Database (BSD) [26] is by far the most used to evaluate superpixel methods over image-based metrics. This data set provides 500 color images split into 200 for training, 100 for validation and 200 for test, as well as the respective human annotated ground-truth. Usually segmentation performance on BSD is assessed from the widely known metrics BR and UE. Although our method is geared towards video segmentation, for the sake of completeness we have included experiments on BSD. The evaluations were run on the 200 test images, comparing the same algorithms as the previous Sintel test. The results are presented in Fig. 6. Figure 6.a illustrates results using BR, which reveals that all the methods far outperform the BOX in respect to adherence to real image boundaries. Besides, the evaluated methods appear to form two main groups according to their performance: the best performance group, where the methods reach about 70% of BR using a maximum of 200 superpixels; and the second best performance group, where the algorithms need more than twice that number of superpixels 19 Figure 5: Visual comparison of superpixels generated on Sintel images. The first row depicts the ground-truth optical flow, according to the gradient map , where the color and intensity represent, respectively, the orientation and magnitude. For each method named on the left board, the rows show the generated superpixels (top row) and the MUSE (bottom row), which is represented in heat map, according to the scale showed at the bottom of the Figure. 20 Figure 6: Image-based evaluation results on BSD data set. (a) BR measures the matching between superpixel boundaries and the ground-truth, which is comprised of human-annotated object contours. The plot shows that ISEC is in line with the group formed by the methods with better performance regarding BR, only being considerably surpassed after the other methods get an excessive number of superpixels. (b) UE penalizes superpixels that overlaps more than one object in the image; methods that try to avoid the over-segmentation of homogeneous regions in the image, such as ISEC and FH, are prone to be further penalized by this metric. to reach the same performance. ISEC is in line with the former group, only being considerably surpassed after the other methods get an excessive number of superpixels. A visual comparison of superpixel segmentations on BSD data set is showed in Fig. 7. Besides ISEC, the the visual comparison includes segmentations provided by SLIC and LSC, whose the number of superpixels is user-defined, and FH and EAMS, whose that number is automatically controlled. Regarding the UE (see Fig. 6.b), although ISEC performance is always better than the BOX, it is not as good as most of the other methods, except for FH. That is the drawback of trying to produce a segmentation that is fully supported by the image content. Despite the proposed method presents strategies to deal with eventual lacks of information (see ISEC edge reconstruction in Section 3), eventually an object with a too long and smooth contour can lead to issues. That is why recent superpixel methods rely on grid-like segmentation strate- 21 Figure 7: Visual comparison of superpixels generated on BSD images. For SLIC and LSC, whose the number k of superpixel is user-defined, the presented examples were generated with k = 500. For FH, EAMS and ISEC, whose k is adaptive, the examples were generated by adjusting the internal parameters of these methods in order to provide k ≈ 500 (in average, considering the entire BSD data set). gies. However, in the case of video segmentation, sometimes it is worth dealing with a higher UE in favor of avoiding to segment image regions unnecessarily, as well as to obtain more stable superpixels. Finally, results of computational time on BSD are illustrated in Fig. 8. The plots show that our method is one of the fastest. By order: WS and CWS come first, taking around 10 ms per image; followed by FH and SLIC (≈ 100 22 Figure 8: Computational time. WS and CWS are the fastest methods, taking less than 10 ms per image; FH, SLIC, SEEDS, ISEC and LSC come next, spending around a few hundred milliseconds; ERS, EAMS, QS, VEK spend more than a second; and NC is not linear, taking several minutes to generate the superpixels even for resized images. Among the fastest methods, ISEC is the only one implemented in Matlab, while the other methods are implemented in C/C++. ms), SEEDS and ISEC (≈200 ms), and LSC (≈500 ms). The remaining methods spend over a second per image, drawing attention the scalable time consumption of NC (hundreds of seconds), even for resized images. Also note that, while all the fastest methods were implemented in C/C++, ISEC was coded in Matlab, taking room for speed-ups. 4.4. Application on video object segmentation This evaluation is based on a framework for video object segmentation proposed in [27]. This framework is divided into two main steps: (i) optical flow is used to estimate an initial foreground segmentation based on motion, and (ii) appearance cues are extracted from the segments, relying on superpixels to obtain refined object contours. Since the superpixel generation is an independent module in this video object segmentation framework, it is possible to evaluate the impact of using different methods for superpixel generation. Tests were run on the SegTrack data set [28]. This data set provides 6 video sequences (monkeydog, girl, birdfall, parachute, cheetah and penguin), along 23 SegTrack Videos Method Monkey Average Total Parachute error # Superp. Time (s) Birdfall Cheetah FH - 1462 - - 764 1113 49 12.6 EAMS - 915 2536 328 19062 5710 324 274.9 345 902 2954 402 452 1011 1500 20.7 SLIC Girl Average ERS 288 873 1802 1439 305 941 700 196.0 LSC 217 913 1861 350 273 723 500 62.2 ISEC 268 973 2324 390 407 872 324 32.9 Table 1: Results on the video object segmentation experiment. The columns show: (1) the evaluated methods; (2-6) the average number of mislabeled pixels for each SegTrack video; (7) the average error, given by the total of mislabeling divided by the number of frames; (8) the average number of superpixels generated for each frame; and (9) the total time spend to segment the entire dataset. The missing data (columns 2, 4, 5 for FH, and column 2 for EAMS) are cases where the video object segmentation failed to converge due to degenerate superpixels. The results indicate LSC and ISEC as the most efficient methods: low error rate with a small number of superpixels. Regarding the processing time, ISEC is twice as fast as LSC. with the object annotation for each frame. Following [27], the penguin video has been discarded due to inconsistencies in the ground-truth, remaining a total of 202 frames. Table 1 presents the results of using ISEC, as well as other five representative methods selected from experiments on Sintel and BSD. Table columns summarizes: (1) the evaluated methods; (2-6) the average number of mislabeled pixels for each SegTrack video; (7) the average error, given by the total of mislabeling divided by the number of frames; (8) the average number of superpixels generated for each frame; and (9) the total time spend to segment the entire dataset. The missing data (columns 2, 4, 5 for FH, and column 2 for EAMS) are cases where the video object segmentation failed to converge due to degenerate superpixels. In the case of methods based on a user-defined number of superpixels (SLIC, ERS and LSC), the tests were started with a small number of superpixels, being this number increased until achieving convergence. Results 24 Figure 9: Visual comparison of object segmentation on SegTrack sequences. From the top to the bottom, the rows show, for each method, three distinct shots of the video sequences named birdfall, cheetah, girl, monkey and parachute. In green, is the object segmentation achieved by [27] when using the different superpixel methods, SLIC, LSC and ISEC. show that despite FH is very fast and generates a small number of segments, this method is not able to support video segmentation in most of the cases. In the cases where FH was successful, this method presented the second worst average error. EAMS, in turn, besides the highest error rate, is by far the slowest method, spending 274 seconds to segment all the videos. Intermediate results were reached by SLIC and ERS. While SLIC needs more than twice the number of superpixels than the other methods to converge, ERS is also too slow (the second in computational time). The best results were achieved by LSC and ISEC. The former presents low error rate (only 723 pixels in average) with few generated superpixels (500 per frame), being moderate in terms of speed. ISEC gets low error (872 pixels in average, the second best), generating fewer superpixels per image (324) in average, being twice as fast as LSC (around 33 against 62 seconds). Figure 9 compares some examples of object segmentation provided by the video segmentation framework when using SLIC, LSC and ISEC. 25 5. Conclusions We introduced this paper with a discussion about whether is convenient or not, for a superpixel method, to rely on a fixed number of superpixels. Our hypothesis was pointed in the direction that automatically controlling this number could be suitable for some tasks, specially regarding video segmentation. To test that hypothesis, we compared the proposed method with several state-of-the-art methods through a set of experiments designed to evaluate different aspects of superpixel segmentation. The evaluation using video-based metrics reinforced the idea that ISEC approach is suitable for video segmentation; the proposed method was the best in providing accurate representation of motion discontinuities, while preserving segmentation stability in video sequences. Indeed, these results were corroborated by another experiment, this time involving an application for video object segmentation. By this latter experiment, ISEC proved to be one of the most efficient methods, leading the application to accomplish the second best segmentation performance, with the smallest number of superpixels and spending half of the time of the superpixel method that presented the best performance in this experiment. On the other hand, the experiment using image-based metrics indicated that approaches based on a fixed number of superpixels are the better choice for static image segmentation, since these types of methods are able to provide high boundary adherence, while preventing undersegmentation failures. References [1] F. ing, Yang, IEEE H. Lu, M. H. Yang, Robust superpixel Transactions on Image Processing (2014) track1639– 1651doi:10.1109/TIP.2014.2300823. [2] A. Bdis-Szomor, H. Riemenschneider, L. V. Gool, Superpixel meshes for fast edge-preserving surface reconstruction, in: IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 2011–2020. doi:10.1109/CVPR.2015.7298812. 26 [3] R. Gadde, V. Jampani, M. Kiefel, D. Kappler, P. Gehler, Superpixel convolutional networks using bilateral inceptions, in: European Conference on Computer Vision (ECCV), 2016. doi:10.1007/978-3-319-46448-0_36. [4] M. Santos, M. Linder, L. Schnitman, U. Nunes, L. Oliveira, Learning to segment roads for traffic analysis in urban images, in: IEEE Intelligent Vehicles Symposium (IV), 2013, pp. 527–532. doi:10.1109/IVS.2013.6629521. [5] B. P. Nguyen, H. Heemskerk, P. T. C. So, L. Tucker-Kellogg, Superpixelbased segmentation of muscle fibers in multi-channel microscopy, BMC Systems Biology (2016) 124doi:10.1186/s12918-016-0372-2. [6] Z. Tian, L. Liu, Z. Zhang, B. Fei, Superpixel-based segmentation for 3d prostate mr images, IEEE Transactions on Medical Imaging (T-MI) (2016) 791–801doi:10.1109/TMI.2015.2496296. [7] D. Stutz, A. Hermans, B. Leibe, Superpixels: An evaluation of the state-of-the-art, Computing Research Repository (CoRR) abs/1612.01601. doi:10.1016/j.cviu.2017.03.007. [8] M. Wang, X. Liu, Y. Gao, X. Ma, N. Q. Soomro, Superpixel segmentation: A benchmark, Signal Processing: Image Communication (2017) 28 – 39doi:10.1016/j.image.2017.04.007. [9] F. Meyer, Color image segmentation, in: International Conference on Image Processing and its Applications, 1992, pp. 303–306. [10] J. Shi, J. Malik, Normalized cuts and image segmentation, IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) (2000) 888– 905doi:10.1109/34.868688. [11] P. Meer, B. Georgescu, Edge detection with embedded confidence, IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) 23 (2001) 1351–1365. doi:10.1109/34.977560. 27 [12] P. F. Felzenszwalb, D. P. Huttenlocher, Efficient graph-based image segmentation, International Journal of Computer Vision (IJCV) 59 (2) (2004) 167–181. doi:10.1023/B:VISI.0000022288.19776.77. [13] A. Vedaldi, S. Soatto, Quick Shift and Kernel Methods for Mode Seeking, 2008, pp. 705–718. doi:10.1007/978-3-540-88693-8_52. [14] O. Veksler, Y. Boykov, P. Mehrani, Superpixels and supervoxels in an energy optimization framework, in: Proceedings of the Euro- pean Conference on Computer Vision (ECCV), 2010, pp. 211–224. doi:10.1007/978-3-642-15555-0_16. [15] R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, S. Ssstrunk, Slic superpixels compared to state-of-the-art superpixel methods, IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) 34 (11) (2012) 2274– 2282. doi:10.1109/TPAMI.2012.120. [16] M. Y. Liu, O. Tuzel, S. Ramalingam, R. Chellappa, Entropy rate superpixel segmentation, in: Conference on Computer Vision and Pattern Recognition (CVPR), 2011, pp. 2097–2104. doi:10.1109/CVPR.2011.5995323. [17] M. Van den Bergh, X. Boix, G. Roig, B. de Capitani, L. Van Gool, Seeds: Superpixels extracted via energy-driven sampling, in: Proceedings of the European Conference on Computer Vision (ECCV), 2012, pp. 13–26. doi:10.1007/978-3-642-33786-4_2. [18] P. Neubert, P. Protzel, Compact watershed and preemptive slic: On improving trade-offs of superpixel segmentation algorithms, in: International Conference on Pattern Recognition (ICPR), 2014, pp. 996–1001. doi:10.1109/ICPR.2014.181. [19] Z. Li, J. Chen, Superpixel segmentation using linear spectral clustering, in: IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 1356–1363. doi:10.1109/CVPR.2015.7298741. 28 [20] S. Gould, J. Zhao, X. He, Y. Zhang, Superpixel Graph La- bel Transfer with Learned Distance Metric, 2014, pp. 632–647. doi:10.1007/978-3-319-10590-1_41. [21] R. Giraud, V. T. Ta, A. Bugeau, P. Coup, N. Papadakis, Superpatchmatch: An algorithm for robust correspondences using super- pixel patches, IEEE Transactions on Image Processing (2017) 4068– 4078doi:10.1109/TIP.2017.2708504. [22] S. Ji, B. Wei, Z. Yu, G. Yang, Y. Yin, A new multistage medical segmentation method based on superpixel and fuzzy clustering, Computational and Mathematical Methods in Medicine (CMMM)doi:10.1155/2014/747549. [23] P. Neubert, P. Protzel, Evaluating superpixels in video: Metrics beyond figure-ground segmentation, in: British Machine Vision Conference (BMVC), 2013. doi:10.5244/C.27.54. [24] A. Khoreva, R. Benenson, F. Galasso, M. Hein, B. Schiele, Improved Image Boundaries for Better Video Segmentation, 2016, pp. 773–788. doi:10.1007/978-3-319-49409-8_64. [25] D. J. Butler, J. Wulff, G. B. Stanley, M. J. Black, A natu- ralistic open source movie for optical flow evaluation, in: Euro- pean Conference on Computer Vision (ECCV), 2012, pp. 611–625. doi:10.1007/978-3-642-33783-3_44. [26] D. Martin, C. Fowlkes, D. Tal, J. Malik, A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics, in: Proceedings of the IEEE International Conference on Computer Vision (ICCV), Vol. 2, 2001, pp. 416–423. doi:10.1109/ICCV.2001.937655. [27] A. Papazoglou, V. Ferrari, Fast object segmentation in unconstrained video, in: Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2013, pp. 1777–1784. doi:10.1109/ICCV.2013.223. 29 [28] D. Tsai, M. Flagg, J. Rehg, Motion coherent tracking with multi-label mrf optimization, in: Proceedings of the British Machine Vision Conference (BMVC), 2010, pp. 56.1–56.11. doi:10.5244/C.24.56. 30
1cs.CV
A Generalization of Permanent Inequalities and Applications in Counting and Optimization Nima Anari1 and Shayan Oveis Gharan∗2 arXiv:1702.02937v1 [cs.DS] 9 Feb 2017 1 2 Stanford University, [email protected] University of Washington, [email protected] Abstract A polynomial p ∈ R[z1 , . . . , zn ] is real stable if it has no roots in the upper-half complex plane. Gurvits’s permanent inequality gives a lower bound on the coefficient of the z1 z2 . . . zn monomial of a real stable polynomial p with nonnegative coefficients. This fundamental inequality has been used to attack several counting and optimization problems. Here, we study a more general question: Given a stable multilinear polynomial p with nonnegative coefficients and a set of monomials S, we show that if the polynomial obtained by summing up all monomials in S is real stable, then we can lowerbound the sum of coefficients of monomials of p that are in S. We also prove generalizations of this theorem to (real stable) polynomials that are not multilinear. We use our theorem to give a new proof of Schrijver’s inequality on the number of perfect matchings of a regular bipartite graph, generalize a recent result of Nikolov and Singh [NS16], and give deterministic polynomial time approximation algorithms for several counting problems. ∗ This material is based on work supported by the National Science Foundation Career award. 1 Introduction Suppose we are given a polynomial p ∈ R[z1 , . . . , zn ] with nonnegative For a vector Qn coefficients. κ n κ ∈ Z+ we write Cp (κ) to denote the coefficient of the monomial i=1 z in p. Given a set S of κ’s, we want to estimate X Cp (κ). κ∈S Let ∂zi be the operator that performs partial differentiation in zi , i.e., ∂/∂zi . We can rewrite the above quantity using a differential operator. Let q(∂z) = n XY ∂zκii κ∈S i=1 Then, X κ!Cp (κ) = q(∂z)p(z)|z=0 . κ∈S More generally, given two polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients we analytically and algorithmically study the quantity X q(∂z)p(z)|z=0 = p(∂z)q(z)|z=0 = κ!Cp (κ)Cq (κ). (1) κ∈Zn + for a large class of polynomials known as real stable polynomials. Before stating our results, let us motivate this question. Permanent: n×n recall that the permanent of A is For a matrix A ∈ R+ per(A) = n XY Ai,σ(i) . σ∈Sn i=1 Then, per(A) is Cp (1) of the polynomial p, p(z1 , . . . , zn ) = n n X Y Ai,j zj . i=1 j=1 Matroid Intersection: Let M1 ([n], I1 ) and M2 ([n], I2 ) be two matroids on elements [n] = {1, 2, . . . , n} with set of bases B1 , B2 respectively. Let X Y zi , p(z) = B∈B1 i∈B q(∂z) = X Y ∂zi . B∈B2 i∈B Then, p(z)q(∂z)|z=0 is the number of bases in the intersection of M1 and M2 . We say a polynomial p(z1 , . . . , zn ) ∈ R[z1 , . . . , zn ] is real stable if it has no roots in the upper half complex plane. Theory of stable polynomials recently had many applications in multiple 1 areas of mathematics and computer science [Gur06, MSS13, AO15a, AO15b]. Gurvits used this theory to give a new proof of the van der Waerden conjecture [Gur06]. Most notably he proved that for any n-homogeneous real stable polynomial p(z1 , . . . , zn ) with nonnegative coefficients and q = ∂z1 . . . ∂zn , p(z1 , . . . , zn ) p(z1 , . . . , zn ) ≤ q(∂z)p(z)|z=0 ≤ inf . (2) e−n inf z>0 z>0 z1 . . . zn z1 . . . zn n) In other words, the coefficient of the monomial z1 . . . zn is at least e−n inf z>0 p(zz11,...,z ...zn . One can use this inequality to give a deterministic e−n approximation algorithm for the permanent of a nonnegative matrix. In this paper we prove bounds analogous to (2) for the quantity p(z)q(∂z) when p, q are real stable polynomials. We discuss several applications in counting and optimization. We expect to see many more applications in the future. 1.1 Our Contributions For two vectors x, y ∈ Rn we write xy to denoteQ the n dimensional vector where the i-th coordinate is xi yi . For vectors x, y ∈ Rn we write xy := di=1 xyi i . We say a polynomial p ∈ R[z1 , . . . , zn ] is multilinear if Cp (κ) = 0 for κ ∈ / {0, 1}n . For a vector α ∈ Rn , we write α ≥ 0 to denote α ∈ Rn+ . Theorem 1.1. For any two real stable polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients, sup inf e−α α≥0 y,z>0 p(y)q(z) p(y)q(z) ≤ q(∂z)p(z)|z=0 ≤ sup inf . α α (yz/α) α≥0 y,z>0 (yz/α) (3) Furthermore, if p, q are multilinear then sup inf (1 − α)1−α α≥0 y,z>0 p(y)q(z) ≤ q(∂z)p(z)|z=0 . (yz/α)α (4) Note that when kαk∞ > 1, the term (1 − α)1−α is ill-defined in the above theorem. However in that case we can replace it by any number, since by Fact 2.18, the LHS will be zero. Before describing our main applications of the above theorem let us derive Gurvits’s inequality (2). Let q(z) = z1 z2 . . . zn . Then, it follows that the supremum is obtained by α = 1. For that α we have p(y) p(y)q(z) = inf . inf y>0 y1 . . . yn y,z>0 (yz/α)α In Section 3 we discuss several applications of the above theorem. The following two theorems are the main consequences that we prove. Firstly, we give an algorithm to approximate q(∂z)p(z)|z=0 for two given stable polynomials p, q with nonnegative coefficients. We use this to give deterministic approximate counting algorithms. In our results, we use convex programs involving certain polynomials. We make sure these convex programs can be approximately solved in time polynomial in the complexity of the involved polynomials. For a polynomial p ∈ R[z1 , . . . , zn ] with nonnegative coefficients, we define its complexity as n + deg p + | log minκ:Cp (κ)6=0 Cp (κ)| + | log maxκ:Cp (κ)6=0 Cp (κ)|, and we denote this by hpi. Theorem 1.2. Given two real stable polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients and an oracle that for any z ∈ Rn , returns p(z), q(z), there is a polynomial time algorithm that returns an emin{deg p,deg q}+ǫ approximation of q(∂z)p(z)|z=0 that runs in time poly(hpi + hqi + log(1/ǫ)). 2 Our next theorem gives a polynomial time algorithm to approximate maxκ∈{0,1}n Cp (κ)Cq (κ) for two given multilinear stable polynomials p, q with nonnegative coefficients. We use this to generalize a recent results of Nikolov and Singh [NS16]. Theorem 1.3. Given two real stable multilinear D-homogeneous polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients and an oracle that for any z ∈ Rn returns p(z), q(z), there is a polynomial time algorithm that outputs an e2D+ǫ approximation to max Cp (κ)Cq (κ). κ∈{0,1}n that runs in time poly(hpi + hqi + log(1/ǫ)). Independent of our work, Straszak and Vishnoi [SV16] studied several variants of our problem. They show that if p, q ∈ R[z1 , . . . , zn ] are multilinear real stable polynomials with nonnegative coefficients, there is a convex relaxation to the quantity q(∂z)p(z) with an integrality gap at most en . In contrast, our approximation factor depends only on min{deg p, deg q} which can be significantly smaller than n. Structure of the paper. In Section 2 we describe many properties of real stable polynomials that we use throughout the paper. In Section 3 we describe several applications of Theorem 1.1 in counting and optimization. Finally, in sections 4 and 5 we prove Theorem 1.1. In particular, in Section 4 we lower bound q(∂z)p(z)|z=0 , i.e., we prove the (4) and the LHS of (3). And, in Section 5 we prove upper bound this quantity, i.e., the RHS of (3). 2 Preliminaries Throughout the paper, we use bold letters to denote vectors. For a vector y, we write y ≤ 1 to denote that all coordinates of y are at most 1. For two vectors x, y ∈ Rn we define xy = (x1 y1 , . . . , xn yn ). Similarly, we define x/y = (x1 /y1 , . . . , xn /yn ). For a vector y ∈ Rn , we define exp(x) := (ex1 , . . . , exn ). For vectors x, y ∈ Rn we write d Y y xyi i . x := i=1 Q As a special case, for a real number c ∈ R we write cx to denote ni=1 cxi . We use R++ = {x : x > 0} to denote the set of positive real numbers. For  an integer n ≥ 1 we use [n] to denote the set of numbers {1, 2, . . . , n}. For any m, n, we let [m] denote the collection n of subsets of [m] of size n. Throughout the paper all logs are in base e. For a vector x ∈ Rn and an integer 1 ≤ i ≤ n we use x−i to denote the m − 1 dimensional vector obtained from x by dropping the i-th coordinate of x. We use Z+ to denote the set of nonnegative integers. We say a matrix A ∈ Rn×n is doubly stochastic if all entries of A are nonnegative and all row sums and columns sums are equal to 1, X Ai,j = 1 ∀i, j X Ai,j = 1 ∀j. i 3 2.1 Stable Polynomials Stable polynomials are natural multivariate generalizations of real-rooted univariate polynomials. For a complex number z, let Im(z) denote the imaginary part of z. We say a polynomial p(z1 , . . . , zn ) ∈ C[z1 , . . . , zn ] is stable if whenever Im(zi ) > 0 for all 1 ≤ i ≤ m, p(z1 , . . . , zn ) 6= 0. As the only exception, we also call the zero polynomial stable. We say p(.) is real stable, if it is stable and all of its coefficients are real. It is easy to see that any univariate polynomial is real stable if and only if it is real rooted. We say a polynomial p(z1 , . . . , zn ) is degree k-homogeneous, or k-homogeneous, if every monomial of p has total degree exactly k. Equivalently, p is k-homogeneous if for all a ∈ R, we have p(a · z1 , . . . , a · zn ) = ak p(z1 , . . . , zn ). We say a monomial z1α1 . . . znαn is square-free if α1 , . . . , αn ∈ {0, 1}. We say a polynomial is multilinear if all of its monomials are square-free. For a polynomial p, we write deg p to denote the maximum degree of all monomials of p. One of the famous examples of real stable polynomials is the set of elementary symmetric polynomials. For an integer k ≥ 0, the k-th elementary symmetric polynomial in z1 , . . . , zn , ek (z1 , . . . , zn ) is defined as X Y ek (z1 , . . . , zn ) := zi . ℓ∈S S∈([n] k ) Note that the above polynomial is k-homogeneous and multilinear. Let µ be a probability distribution on subsets of [n]. The generating polynomial of µ is defined as follows: Y X zi . µ(S) gµ (z1 , . . . , zn ) = S i∈S We say µ is a strongly Rayleigh (SR) distribution if gµ is a real stable polynomial. Borcea, Brändén, and Liggett [BBL09] defined (SR) distributions and proved numerous properties of them. Many interesting family of probability distributions are special cases of SR including product distributions, random spanning trees, and determinantal point processes. Note that µ(S) ≥ 0 for all S ⊆ [n]; so gµ (S) has nonnegative coefficients. Many of theorems that we prove here have natural probabilistic interpretations if the underlying real stable polynomial is a generating polynomial of a SR distribution. We say a polynomial p(y1 , . . . , yn , z1 , . . . , zn ) is bistable if p(y1 , . . . , yn , −z1 , . . . , −zn ) is a real stable polynomial. Fact 2.1. For any set of PSD matrices A1 , A2 , . . . , An ∈ Rd×d and a symmetric matrix B ∈ Rd×d p(z1 , . . . , zn ) det(B + z1 A1 + · · · + zn An ) is real stable. Fact 2.2. If p(z) and q(z) are real stable, then p(z)q(z) is real stable. Fact 2.3. If p(y) and q(z) are real stable, then p(y)q(z) is bistable. Fact 2.4. For any stable polynomial p(z1 , . . . , zn ), an integer 1 ≤ i ≤ n, and any number c with nonnegative imaginary part, Im(c) ≥ 0, p(z1 , . . . , zi−1 , c, zi+1 , . . . , zn ) is stable. 4 Fact 2.5. If p(y) is real stable, then for any nonnegative vector λ ∈ Rn+ , p(λy) is real stable. Lemma 2.6. For any real stable polynomial p(z1 , z2 , . . . , zn ) and any 1 ≤ i, j ≤ n, (1 − ∂zi ∂zj )p is stable. Proof. We say an operator T is stability preserver if for any real stable polynomial p(z), T p is real stable. So, to prove the lemma we need to show that 1 − ∂zi ∂zj is a stability operator. P preserver κ Borcea and Brändén [BB10] showed that for any differential operator T = κ cκ ∂z , T is stability preserver if the polynomial X cκ (−z)κ κ∈Zn + is real stable. So, to prove the lemma it is enough to show that 1 − zi zj is real stable. Obviously, if Im(zi ), Im(zj ) > 0, then zi zj 6= 1. So, 1 − zi zj is real stable. Brändén [Brä07] proved the following characterization of multilinear stable polynomials. Theorem 2.7 (Brändén [Brä07, Theorem 5.6]). For any multilinear polynomial p(y1 , . . . , ym ), p is stable if and only if for all 1 ≤ i < j ≤ m, ∂yi p|y=x · ∂yj p|y=x ≥ p(x) · ∂yi ∂yj p|y=x , for all x ∈ Rm . 2.2 Polarization Let p ∈ C[z1 , . . . , zn ] be a stable polynomial of degree di in zi , 1 ≤ i ≤ n. The polarization is an operator that turns p into a multilinear “symmetric” polynomial. For any m ≥ maxi di , The polarization πm (p) of p is a polynomial in m · n variables zi,j for 1 ≤ i ≤ n, 1 ≤ j ≤ m defined as follows: For all 1 ≤ i ≤ n, and 1 ≤ j ≤ di substitute any occurrence of zik in p with m1 ek (zi,1 , . . . , zi,m ). (k) For example, if p(z1 , z2 ) = z12 + z1 z2 , then 1 1 π2 (p) = z1,1 z1,2 + (z1,1 + z1,2 ) · (z2,1 + z2,2 ). 2 2 Note that for any m and any polynomial p, πm (p) has the following properties: • πm (p) is multilinear; • πm (p) is symmetric in the variables zi,1 , . . . , zi,m for all 1 ≤ i ≤ n; • if we substitute zi,j = zi for all i, j in πm (p) we recover p. Borcea, Brändén, and Liggett used Grace-Walsh-Szego’s coincidence theorem [Gra02, Sze22, Wal22] to prove that stability is preserved under polarization [BBL09, Thm 4.7]. Theorem 2.8 (Borcea, Brändén, Liggett [BBL09]). If p ∈ C[z1 , . . . , zn ] is stable then πm (p) is stable for all m. 5 2.3 Stability and Convexity Polynomial optimization problems involving real stable polynomials with nonnegative coefficients can often be turned into concave/convex programs. Such polynomials are log-concave in the positive orthant: Theorem 2.9 ([Gül97]). For any real stable homogeneous polynomial p ∈ R[z1 , . . . , zn ] such that p(z) > 0 for all z ∈ Rn++ , log p(z) is concave in the positive orthant. Proof. Firstly, note that log p(z) is well-defined for any z ∈ Rn++ . It is enough to show that the function is concave along any interval in the positive orthant. Let a ∈ Rn++ , b ∈ Rn , and consider the line a + tb where for any t ∈ [0, 1], a + tb ∈ Rn++ . We show that log p(a + tb) is concave. Say p is k-homogeneous, then p(a + tb) = p(t(a/t + b)) = tk p(a/t + b). We claim that p(a/t + b) is real rooted. Firstly, since a ∈ Rn++ , and p(.) is stable, p(at + b) is real rooted. But for any root λ of p(at + b), 1/λ is a root of p(a/t + b). Note that p(at + b) has no roots at 0, because at + b ∈ Rn++ for t ∈ [0, 1]. So, p(a/t + b) is real rooted. Let λ1 , . . . , λk be the roots of p(a/t + b). We have k k Y Y p(a + tb) = t p(a/t + b) = t p(a) (1/t − λi ) = p(a) (1 − tλi ). k k i=1 i=1 We claim that for all 1 ≤ i ≤ k, λi < 1. Otherwise, for some t ∈ [0, 1], p(a + tb) = 0, but since a + tb ∈ Rn++ , p(a + tb) > 0 which is a contradiction. Therefore, log p(a + tb) = log p(a) + k X log(1 − tλi ). i=1 The theorem follows by the fact that log(1 − tλ) is a concave function of t for t ∈ [0, 1] when λ < 1. Corollary 2.10. For any real stable polynomial p ∈ R[z1 , . . . , zn ] with nonnegative coefficients, log p(z) is concave in positive orthant. Proof. The homogenization of a polynomial p ∈ R[z1 , . . . , zn ] is defined as the polynomial pH ∈ R[z1 , . . . , zn , zn+1 ] given by deg p pH (z1 , . . . , zn+1 ) = zn+1 p(z1 /zn+1 , . . . , zn /zn+1 ). Borcea, Brändén and Liggett [BBL09, Thm 4.5] show that for a polynomial p with nonnegative coefficients, p is real stable if and only pH is real stable. Since pH is real stable, by Theorem 2.9, log pH (z1 , . . . , zn+1 ) is concave in the positive orthant. It follows that pH (z1 , . . . , zn , 1) is also concave in the positive orthant. But, p(z1 , . . . , zn ) = pH (z1 , . . . , zn , 1). So, p(z) is concave in the positive orthant. It is also an immediate corollary of Hölder’s inequality that a polynomial with nonnegative coefficients is log-convex in terms of the log of its variables (for more details on log-convex functions see [BV06]). 6 Fact 2.11. For any polynomial p(y1 , . . . , yn ) with nonnegative coefficients, the expression log p(exp(y)) = log p(ey1 , . . . , eyn ) is convex as a function of y. Lemma 2.12. For any polynomial p with nonnegative coefficients, and any α ≥ 0, inf z>0 p(z) p(αz) = inf . z>0 zα (z/α)α Proof. If α > 0, the two sides become equal by a change of variable z ↔ αz. If αi = 0 for some i, since p has nonnegative coefficients, it is obvious that one should let zi → 0 on the LHS, since the numerator decreases monotonically as zi → 0, and the denominator does not change. In the limit the LHS is the same as what we have on the RHS. 2.4 Jump Systems and Newton Polytope Definition 2.13. For a polynomial p(y1 , . . . , yn ), we define supp(p) as supp(p) := {κ ∈ Zn+ : Cp (κ) 6= 0}. Brändén [Brä07] proved that if p is a real stable polynomial then supp(p) forms what is known as a jump system. Definition 2.14. For two points x, y ∈ Zn define an (x, y)-step to be any δ ∈ Zn such that kδk1 = 1 and ky − (x + δ)k1 = ky − xk1 − 1. A set F ⊆ Zn is called a jump system iff for every x, y ∈ F and (x, y)-step δ, either x + δ ∈ F or there exists an (x + δ, y)-step δ′ such that x + δ + δ′ ∈ F. Brändén [Brä07] proved that for any real stable polynomial p, supp(p) is a jump system. We use the following immediate corollary which follows from the fact that for any polynomial p ∈ R[y1 , . . . , yn , z1 , . . . , zn ], supp(p(y, z)) = supp(p(y, −z)). Fact 2.15. If the polynomial p(y, z) is bistable, then supp(p) is a jump system. Lovász showed that the natural generalization of the greedy algorithm for maximizing linear functions over matroids, also works for jump systems [Lov97]. Given a finite jump system F ⊆ Zn , and w ∈ Rn , the following algorithm finds maxx∈F hw, xi: Sort the coordinates in such a way that |w1 | ≥ |w2 | ≥ · · · ≥ |wn |. Fix the coordinates of x, one by one; for i = 1, . . . , n, we will fix xi as follows: among all members of F whose first i − 1 coordinates match x1 , . . . , xi−1 , let xi be largest i-th coordinate if wi > 0 and let xi be the smallest otherwise. Theorem 2.16 ([Lov97]). For any finite jump system F ⊆ Zn and w ∈ Rn , the above greedy algorithm correctly finds a point x maximizing hw, xi. We will be working with the convex hull of supp(p), often known as the Newton polytope. Definition 2.17. For a polynomial p(y1 , . . . , yn ), define the Newton polytope of p as newt(p) := conv(supp(p)) = conv{κ ∈ Zn+ : Cp (κ) 6= 0}, where conv denotes convex hull. 7 We use the following fact in multiple places in the proofs. Fact 2.18. For a polynomial p(y) ∈ R[y1 , . . . , yn ] with nonnegative coefficients, and α ∈ Rn+ we have p(y) > 0 ⇐⇒ α ∈ newt(p). inf y>0 yα P Proof. Let α ∈ newt(p); then we can write α as a convex combination of the vertices: α = i λi κi , where λi ’s are nonnegative and sum up to 1, and for all i, Cp (κi ) > 0. Therefore, p(y) ≥ X i Cp (κi )y κi = X i Y Cp (κi )yκi ≥ λi λi i  Cp (κi )yκi λi λi =y α Y  Cp (κi ) λi i λi , where for the last inequality we used weighted AM-GM. This implies that p(y) Y inf α ≥ y>0 y i  Cp (κi ) λi λi > 0. Conversely, suppose α ∈ / newt(p); we show that inf y>0 p(y)/yα = 0. Since newt(p) is convex, by separating hyperplane theorem, there exists c ∈ Rn , such that hc, αi > hc, κi for every κ ∈ newt(p). Now let y = exp(tc) = (etc1 , . . . , etcn ), where t > 0 will be fixed later. Then we have P    X Cp (κ)yκ κ∈Zn p(y) + = ≤ exp −t hc, αi − max hc, κi · Cp (κ). yα yα κ∈newt(p)) n κ∈Z+ It is easy to see that as t → ∞, the RHS of the above inequality becomes zero. The convex hull of jump systems has been shown to be bisubmodular polyhedra in [BC95]. The following is a restatement of this result. Theorem 2.19 (Restatement of [BC95]). For a finite jump system F ⊆ Zn , define the function f : {−1, 0, +1}n → R as f (c) := maxhc, αi. α∈F Then conv(F) = \ {x ∈ Rn : hc, xi ≤ f (c)}. c∈{−1,0,+1}n Furthermore, f is a bisubmodular function. For the definition of bisubmodular functions, see [BC95]. We will only use the following wellknown fact about bisubmodular functions. For more details see [MF08]. Fact 2.20. Suppose that F is a jump system and f is the bisubmodular function associated with conv(F). Given an oracle that returns f (c) for any c ∈ {−1, 0, +1}n , we can construct a separation oracle for conv(F). Each call to the separation oracle uses at most poly(n) evaluations of f . 8 Proof. To construct a separation oracle, it is enough to design a procedure that given a point x ∈ Rn , finds a c ∈ {−1, 0, +1}n such that hc, xi > f (c) or declares that there is no such c. The function c 7→ f (c) − hc, xi is bisubmodular, since f is bisubmodular and c 7→ hc, xi is modular. Bisubmodular functions can be minimized in strongly polynomial time, see e.g. [MF08]. Therefore one can solve the following optimization problem using polynomially many evaluations of f . min f (c) − hc, xi. c∈{−1,0,+1}n If the answer is nonnegative, then x ∈ conv(F). Otherwise, the optimizing c produces the separating hyperplane. 3 Applications 3.1 Applications in Counting In this section we prove Theorem 1.2 and we discuss several applications of our results for counting problems. We start with Schrijver’s inequality. The following theorem is the main technical result of [Sch98]. Theorem 3.1 (Schrijver [Sch98]). Let A ∈ Rn×n be a doubly stochastic matrix, and let à be defined as follows: Ãi,j = Ai,j (1 − Ai,j ) Then, per(Ã) ≥ Y (1 − Ai,j ). i,j Schrijver [Sch98] used the above inequality to prove that any d-regular bipartite graph with 2n d−1 n matchings. Gurvits and [Gur11, GS14] used the above theorem to design vertices has (d−1) dd−2 n a deterministic 2 -approximation algorithm for the permanent. We note that Gurvits used the machinery of stable polynomials to prove several lower bounds on permanent, but to the best of our knowledge his machinery could not capture Schrijver’s theorem. Very recently, Lelarge [Lel17] used the machinery developed by Csikvári [Csi14] to reprove Schrijver’s theorem. Here, we give a simple proof of this theorem using Theorem 1.1. Proof. Let z = {zi,j }1≤i,j≤n be a vector of n2 variables. Define, p(z) = q(z) = n X n Y i=1 j=1 n n X Y Ai,j zi,j , (1 − Ai,j )zi,j . j=1 i=1 Then, it is not hard to see that q(∂z)p(z) = per(Ã). 9 Qn This follows because each monomial of p is a product i=1 zi,σ(i) for some mapping σ : [n] → [n] Qn and each monomial of q is a product j=1 zσ(j),j for some σ : [n] → [n]. Let αi,j = Ai,j for all 1 ≤ i, j ≤ n. Since p, q are multilinear, by Theorem 1.1, p(y)q(z) . y,z>0 (yz/α)α per(Ã) ≥ (1 − α)1−α inf (5) Firstly, observe that by weighted AM-GM inequality p(y) = n n X Y Ai,j yi,j ≥ i=1 j=1 Y A yi,ji,j = yα , i,j where in the inequality we used that A is doubly stochastic. Secondly, by another application of AM-GM inequality we have n n X Y Y  (1 − Ai,j )zi,j Ai,j (1 − Ai,j )zi,j Ai,j q(z) = = ((1 − α)z/α)α , ≥ Ai,j Ai,j j=1 i=1 i,j where in the inequality we used that A is doubly stochastic. Plugging the above two inequalities in (5) we get Y per(Ã) ≥ (1 − α)1−α (1 − α)α = (1 − Ai,j ) i,j as desired. Theorem 1.2. Given two real stable polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients and an oracle that for any z ∈ Rn , returns p(z), q(z), there is a polynomial time algorithm that returns an emin{deg p,deg q}+ǫ approximation of q(∂z)p(z)|z=0 that runs in time poly(hpi + hqi + log(1/ǫ)). Proof. Firstly, we show that p(y)q(z) p(y)q(z) ≤ q(∂z)p(z)|z=0 ≤ sup inf α α α≥0 y,z>0 (yz/α) α≥0 y,z>0 (yz/α) e− min{deg p,deg q} sup inf (6) Without loss of generality assume that deg p ≤ deg q. By Theorem 1.1, it is enough to show that for any α ≥ 0, p(y)q(z) p(y)q(z) e− deg p inf ≤ inf e−α . α y,z>0 (yz/α) y,z>0 (yz/α)α P To prove the above, it is enough to show that if i αi > deg p, then both sides of the above equal 0. Suppose hα, 1i > deg p. Let z = 1 and y = t1 for some parameter t. Then, as t → ∞, p(y)/yα → 0. This is because the degree of every monomial of p(y) is less than yα . This was a special case of Fact 2.18. In general if α ∈ / newt(p) ∩ newt(q), then both sides of the above are zero. Using (6), to prove the theorem it is enough to design a polynomial time algorithm that computes p(y)q(αz) p(y)q(z) supα≥0 inf y,z>0 (yz/α) α . Firstly, by Lemma 2.12 it is enough to solve supα≥0 inf y,z>0 (yz)α . Now, let us do a change of variable y ↔ exp(y) and z ↔ exp(z). By Fact 2.11 and Corollary 2.10, log p(exp(y))q(α exp(z)) (exp(y) exp(z))α 10 is concave in α and convex in y, z. Since the infimum of concave functions is also concave, exp(z)) inf y,z log p(exp(y))q(α is a concave function of α. Therefore, (exp(y) exp(z))α p(exp(y))q(exp(z)) . α α≥0 y,z>0 (exp(y) exp(z)) sup inf is a convex program, or more precisely a concave-convex saddle point problem. In Subsection 3.3 we show how this convex program can be approximately solved in polynomial time. This gives an edeg p approximation of q(∂z)p(z)|z=0 as desired. Let us state some applications of the above result. Our first application is in the context of recent results on Nash welfare maximization (NWM) problems. Recently the authors together with Saberi and Singh proved a generalization of Gurvits’s inequality (2) to design an en approximation for NWM problem [AOSS17]. Given a real stable polynomial p ∈ R[z1 , . . . , zn ] with nonnegative coefficients and an integer 1 ≤ D ≤ n, the main technical contribution of [AOSS17] is a polynomial time algorithm that gives an eD approximation to  X Y  ∂zi p(z)|z=0 . i∈S S∈([n] D) This result immediately followsP from Theorem 1.2. Let q be the D-th elementary symmetric polynoQ mial on z1 , . . . , zn , i.e., q(z) = S∈([n]) i∈S ∂zi . Recall that all elementary symmetric polynomials D are real stable. Since deg q = D, we can approximate the above quantity up to an eD factor by Theorem 1.2. Our second application is a partial answer to an open problem of Kulesza and Taskar about determinantal point processes [KT12]. A determinantal point process (DPP) is a probability distribution µ on subsets of [n] identified by a positive semidefinite ensemble matrix L ∈ Rn×n where for any S ⊆ [n] we have P [S] ∝ det(LS,S ), where LS,S is the square submatrix of L corresponding to rows and columns indexed by S. We refer interested readers to [KT12] for applications of DPPs in machine learning. For an integer 0 ≤ k ≤ n, and a DPP µ, the truncation of µ to k, µk is called a k-DPP, i.e., ( µ(S) if |S| = k µk (S) ∝ 0 otherwise. Kulesza and Taskar left an open problem to estimate the quantity X det(LS,S )p S⊆[n] for some p > 1. Their motivation is to study the Hellinger distance between two DPPs. Borcea, Brändén and Liggett [BBL09] showed that DPPs and k-DPPs are strongly Rayleigh, i.e., if µ is a DPP, then gµ (z1 , . . . , zn ) and gµk (z1 , . . . , zn ) are real stable polynomials (see Subsection 2.1). Let L, L′ be ensemble matrices of two k-DPPs µ, µ′ . Let p = gµk and q = gµ′k . Note that p, q are 11 k-homogeneous, multilinear, and have nonnegative coefficients. Therefore, by the above theorem we can estimate X q(∂z)p(z)|z=0 = det(LS ) det(L′S ) S⊆[n] up to a factor of ek . To the best of our knowledge, to this date no approximation algorithm for the above quantity was known. 3.2 Applications in Optimization In this section we prove Theorem 1.3. Let us restate the theorem. Theorem 1.3. Given two real stable multilinear D-homogeneous polynomials p, q ∈ R[z1 , . . . , zn ] with nonnegative coefficients and an oracle that for any z ∈ Rn returns p(z), q(z), there is a polynomial time algorithm that outputs an e2D+ǫ approximation to max Cp (κ)Cq (κ). κ∈{0,1}n that runs in time poly(hpi + hqi + log(1/ǫ)). Proof. We solve the following mathematical program and we show that its optimum solution gives an e2D -approximation of the optimum. p(λy)q(z) α α,λ≥0 y,z>0 (yz/α) X s.t. λi = D. sup inf (7) i Firstly, we show that we can solve the above mathematical program. The idea is very similar to the proof Theorem 1.2. We do a change of variable y ↔ exp(y), z ↔ exp(z) and we push the α in the denominator to q. So, instead we solve the following program: sup inf log α,λ≥0 y,z>0 p(λ exp(y)q(α exp(z)) (exp(y) exp(z))α exp(y))q(α exp(z)) is convex in y, z and concave in α, λ. So, we can solve the above As before, log p(λ(exp(y) exp(z))α program in polynomial time; for more details see Subsection 3.3. Secondly, we show that the above program is a relaxation of the problem. Let κ∗ = argmaxκ∈{0,1}n Cp (κ)Cq (κ). P Since every monomial of p has degree exactly D, i κ∗i = D, so λ = κ∗ is a feasible solution. Let α = κ∗ . Then, ∗ Cp (κ∗ )yκ p(λy) ≥ inf = Cp (κ∗ ) inf y>0 y>0 yα yκ∗ Similarly, q(αz) q(κ∗ z) q(z) = inf = inf = Cq (κ∗ ), ∗ z>0 zα z>0 zκ z>0 (z/α)α inf 12 The first equality follows by Lemma 2.12. Using the above two equations it follows that the optimum of (7) is at least Cp (κ∗ )Cq (κ∗ ). Next, we show that the optimum of (7) is within e2D factor of Cp (κ∗ )Cq (κ∗ ). Let λ∗ , α∗ be the arguments achieving optimum value in the sup in (7)1 . Consider the following probability distribution on κ ∈ {0, 1}n . We sample D numbers X1 , X2 , . . . , XD independently (with replacement) where for each 1 ≤ i ≤ D we let Xi = j with probability and κi = 0 otherwise. We claim that λ∗j D. We let κi = 1, if Xj = i for some i E [Cp (κ)Cq (κ)] ≥ e−2D OPT . (8) Define p̃(z) = p(λ∗ z). Then, by Fact 2.5, p̃ is real stable. Therefore, by Theorem 1.1, X Cp̃ (κ)Cq (κ) ≥ e−α κ∈{0,1}n ∗ p̃(y)q(z) p(λ∗ y)q(z) −D sup inf ≥ e−D OPT . ∗ ≥ e ∗ α α y,z>0 (yz/α ) (yz/α) α≥0 y,z>0 inf The second to last inequality follows by (6) and the last inequality follows by the fact that (7) is a relaxation of OPT. So, to prove (8) it is enough to show that X E [Cp (κ)Cq (κ)] ≥ e−D Cp̃ (κ)Cq (κ). (9) κ∈{0,1}n Fix any monomial κ such that Cp (κ), Cq (κ) > 0. Then, Y Cp̃ (κ) = Cp (κ) λ∗i . i:κi =1 On the other hand, P [κ] = D! Y Y λ∗ i λ∗i , ≥ e−D D i:κi =1 i:κi =1 The D! factor comes from the fact that we can sample each such κ in D! possible ways. Plugging these two equations in (9) proves it. This completes the proof of Theorem 1.3. One of the consequences of the above theorem is a recent result of Nikolov and Singh [NS16]. Given a PSD matrix L and a partitioning P1 , . . . , Pm of [n], among all sets S ⊆ [n] where for each 1 ≤ i ≤ m, |S ∩ Pi | = bi we want to choose one that maximizes det(LS,S ) where LS,S is the square submatrix of L with rows and columns indexed by S. We refer interested readers to [NS16] for applicationsP of this problem. Let k = i bi . Let v1 , . . . , vn be the vectors of the Cholesky decomposition of L, i.e., for all i, j, Li,j = hvi , vj i. Let p(y1 , . . . , yn ) = ∂xn−k det(xI + y1 v1 v1T + · · · + yn vn vnT )|x=0 . 1 Note that since we can assume the domain of α, λ is compact, the supremum is attained at some point of the domain 13 By Fact 2.1 and Fact 2.4 the above polynomial is real-stable. Furthermore, it is not hard to see that it is k-homogeneous and has nonnegative coefficients. In fact for any set S ⊆ [n] of size k, the coefficient of the monomial z1S is det(LS,S ), where 1S is the indicator vector of the set S. Now, let q(z1 , . . . , zn ) = m Y ebi ({zj }j∈Pi ) i=1 be the generating polynomial corresponding to the partition matroid P1 , . . . , Pk . Again, by closure of stable polynomials under product, the above polynomial is real stable, multilinear, khomogeneous, and has nonnegative coefficients. It follows by the above theorem that we can approximate max det(LS,S ) S:|S∩Pi |=bi ∀i within an e2k factor. Note that our approximation factor is slightly worse but our theorem is significantly more general. In particular, we can replace p, q in the above argument with any real stable multilinear polynomial. For example, suppose we are given a graph G = (V, E) and we have assigned a vector ve to any edge e. We can let q be the generating polynomial of the uniform spanning tree distribution of G. Then, using the above theorem we can approximate  X ve veT max det T e∈T within an e2n factor. 3.3 Solving the Convex Program In this section we show how the convex programs from the previous two sections can be approximately solved in polynomial time. We measure the complexity of our algorithm in terms of the complexity of the involved polynomials. Recall the following definition. Definition 3.2. For a polynomial p ∈ R[z1 , . . . , zn ] with nonnegative coefficients, we define its complexity as n + deg p + | log minκ:Cp (κ)6=0 Cp (κ)| + | log maxκ:Cp (κ)6=0 Cp (κ)|, and we denote this by hpi. The main result of this section is the following. Theorem 3.3. Given a bistable polynomial p ∈ R[y1 , . . . , yn , z1 , . . . , zn ] with nonnegative coefficients and an oracle that evaluates p at any requested point (y, z) ∈ R2n + , one can find a 1 + ǫ approximation of p(y, z) , (10) sup inf α α≥0 y,z>0 (yz/α) in time poly(hpi + log(1/ǫ)). In the rest of this section, we prove this theorem. We will use the ellipsoid method to compute the inner inf and also the outer sup. The main difficulty for computing the inf is that the variables y, z are unbounded. In other words, we do not have a bounded outer ellipse for the ellipsoid method. In the first step, we use the fact that supp(p) is a jump system (Fact 2.15) to show that we can 14 work with bounded y, z and only lose a small amount in the objective. The rest of the argument consists of constructing separation oracles and lower bounding the volume of inner ellipses for the ellipsoid methods. Lemma 3.4. Given a polynomial p ∈ R[z1 , . . . , zn ] with nonnegative coefficients with the guarantee that supp(p) is a jump system and α ∈ newt(p) and ǫ > 0, we have inf z:klog(z)k∞ <M p(z) p(z) ≤ (1 + ǫ) inf α , z>0 z zα for M = poly(hpi + log(1/ǫ)). Proof. It is enough to prove that for any z > 0, we can find z∗ with klog(z∗ )k∞ < M such that p(z) p(z∗ ) < (1 + ǫ) α . ∗ α (z ) z For the convenience of notation, assume that zn+1 = 1. Without loss of generality, after renaming coordinates, assume that | log(z1 )| ≥ | log(z2 )| ≥ . . . | log(zn )| ≥ | log(zn+1 )| = 0. Let ∆ be a value bounded by poly(hpi+log(1/ǫ)) that will be fixed later. Let i be the coordinate for which | log(zi )|−| log(zi+1 )| is maximized. If this maximum value is bounded by ∆, we are done. Otherwise we change z by subtracting a constant from | log(z1 )|, . . . , | log(zi )| to make sure that | log(zi )| − | log(zi+1 )| is reduced to ∆ and p(z)/zα does not grow by more than a 1 + ǫ/2n factor. We obtain z∗ by repeating this “gap-closing” procedure for no more than n times. Define the vector c ∈ {−1, 0, +1}n in the following way:   +1 if j ≤ i and zj > 1, ci := −1 if j ≤ i and zj < 1,   0 otherwise. Let s = | log(zi )| − | log(zi+1 )| − ∆. Let z̃ = exp(−sc)z (i.e., z̃i = e−sci zi ) be the result of the “gap-closing” operation. We just need to set ∆ in such a way that p(z) p(z̃) ≤ (1 + ǫ/2n) α . α z̃ z (11) Let us partition F = supp(p) into F1 ∪ F2 ; let F1 := {κ ∈ F : hc, κi ≥ hc, αi}, and let F2 be the rest. Note that F1 6= ∅ because α ∈ newt(p) = conv(F). We can decompose p = p1 + p2 : X X Cp (κ)zκ + p(z) = Cp (κ)zκ . κ∈F1 | κ∈F2 {z p1 (z) } 15 | {z p2 (z) } To prove (11), it is enough to show the following two inequalities p1 (z̃) ≤ z̃α p2 (z̃) ≤ p1 (z) , zα ǫ p1 (z̃). 2n (12) (13) First we prove (12). For any κ ∈ F1 , we have zκ zκ z̃κ κ−α κ−α = z̃ = (exp(−sc)z) = exp(−shc, κ − αi) ≤ , z̃α zα zα where in the inequality we used κ ∈ F1 and s ≥ 0. Multiplying the above inequality with Cp (κ) and summing over all κ ∈ F1 we get (12). It remains to prove (13). We will use the following claim to prove (13). Claim 3.5. For any κ ∈ F2 , there exists κ′ ∈ F1 such that ′ z̃κ ≤ e−∆ z̃κ . Proof. Let κ′ be the output of the greedy algorithm (with the ordering of coordinates being 1, . . . , n) from Theorem 2.16 for the jump system F and linear function x 7→ hc, xi. We start from κ and move towards κ′ , ensuring that κ remains in F and that z̃κ never decreases and in at least one step it increases by a factor of e∆ . While κ 6= κ′ , choose the smallest j for which κj 6= κ′j . If j > i, stop. Otherwise, by the greedy construction of κ′ , we know that cj (κ′j − κj ) > 0. Let δ ∈ Zn be such that δj = cj and δk = 0 for k 6= j. Note that δ is a (κ, κ′ )-step, see Definition 2.14. Therefore either κ + δ ∈ F or there exists a (κ + δ, κ′ )-step δ′ such that κ + δ + δ′ ∈ F. In the former case, we set κ to κ + δ and in the latter case we set κ to κ + δ + δ′ . We show that after the move, z̃κ does not decrease. Case 1 (κ + δ ∈ F). Since cj log(z̃j ) ≥ ci log(z̃i ) ≥ ∆ > 0, we get c z̃κ+δ = zj j z̃κ ≥ e∆ z̃κ ≥ z̃κ . Case 2 (κ + δ + δ′ ∈ F). Recall that δ′ has only one nonzero coordinate and that coordinate is ±1. Let that be the k-th coordinate. Since the first j − 1 coordinates of κ and κ′ are the same, it must be that k ≥ j. Therefore c δ′ c z̃κ+δ+δ = zj j zkk z̃κ ≥ zj j zk−ck z̃κ ≥ z̃κ . ′ It remains to show that in one of the steps, z̃κ grows by at least e∆ . Look at the quantity hc, κi and how it changes over the course of the above algorithm. At the beginning, since κ ∈ F2 hc, κi < hc, αi. When the algorithm finishes hc, κi = hc, κ′ i; this is because κj = κ′j for j ≤ i and cj = 0 for j > i. Note that hc, κ′ i ≥ hc, αi because κ′ ∈ F1 . Therefore, at one point the quantity hc, κi must increase. It is easy to see that when hc, κi increases, z̃κ grows by at least a factor of e∆ . In case 1, z̃κ always increases by a factor of e∆ . In case 2, hc, κi increases exactly when either δk′ = ck or k > i, and in both situations z̃κ also increases by a factor of e∆ . 16 Now let us finish the proof of (13). We have X Cp (κ)z̃κ ≤ (deg p + 1)n · max Cp (κ) · max z̃κ , p2 (z̃) = κ∈F2 κ∈F2 κ∈F2 where we used the fact that the number of terms in p is bounded by (deg p + 1)n . Similarly for p1 , we have X Cp (κ)z̃κ ≥ min Cp (κ) · max z̃κ . p1 (z̃) = κ∈F1 κ∈F1 κ∈F1 Putting the above two inequalities and using Claim 3.5, we get p2 (z̃) (deg p + 1)n · maxκ∈F2 Cp (κ) maxκ∈F2 z̃κ ≤ · ≤ epoly(hpi)−∆ . p1 (z̃) minκ∈F1 Cp (κ) maxκ∈F1 z̃κ It is easy to see that by making ∆ = poly(hpi)+ log(2n/ǫ) = poly(hpi+ log(1/ǫ)), we get the desired inequality (13). In the remaining part of this section, we first show that we can construct separation oracles, and then we bound the volume of the inner ellipses for the two ellipsoid methods. Let us construct the separation oracles for the two ellipsoid methods. For the ellipsoid computing inf y,z>0 p(y, z)/(yz/α)α , the separation oracle just needs to compute the gradient of the (log of the) objective with respect to log(y), log(z). It is easy to see that this gradient can be computed from the partial derivatives of p with respect to y, z. The latter can be computed using the following lemma. Lemma 3.6. Given oracle access to a polynomial p ∈ R[y1 , . . . , yn ], for any i, the quantity ∂yi p can be computed at any given point using O(deg p) oracle calls. Proof. Given a point y, consider the polynomial q(t) = p(y1 , . . . , yi−1 , yi + t, yi+1 , . . . , yn ). This is a univariate polynomial of degree at most deg p. Therefore we can compute all of its coefficients by evaluating p at deg p + 1 many points. Then we can simply output the coefficient of t. Now we construct the separation oracle for the ellipsoid method computing p(y, z) . α α≥0 y,z>0 (yz/α) sup inf p(y,z) Recall that if α ∈ / newt(p), then inf y,z>0 (yz/α) α = 0, see Fact 2.18. Given some α ≥ 0, we first check whether α ∈ newt(p) using Fact 2.20, and in case it is not, we return the promised separating hyperplane. So let us assume that α ∈ newt(p). p(y,z) In its current form, the expression (yz/α) α is not concave in α. So we need to use the same trick as in Lemma 2.12 to transform it into a concave form. We do this transformation after finding p(y,z) an approximate optimum for the inf. We compute an approximate optimum of inf y,z>0 (yz/α) α by restricting the domain of the variables y, z using Lemma 3.4 and running the inner ellipsoid method to desired accuracy. 17 Next, we find a separating hyperplane at α, by calculating the gradient of p(β(y/α), z) (yz/α)β with respect to β evaluated at β = α. This can again be done using Lemma 3.6. It remains to lower bound the volume of the inner ellipses in the ellipsoid methods. First consider the ellipsoid method computing the inf. It is enough to lower bound the volume of the following set for any given ǫ > 0, y∗ , z∗ > 0   p(y∗ , z∗ ) p(y, z) ≤ (1 + ǫ) ∗ ∗ . (log(y), log(z)) | (yz/α)α (y z /α)α p(y,z) To see this, it is enough to note that log( (yz/α) α ) is Lipschitz with respect to log(y), log(z) with Lipschitz constant bounded by poly(deg p, n) = poly(hpi). Now consider the ellipsoid method for computing the sup. To bound the volume of the inner ellipse we are going to use a similar idea as before, except we prove a slightly weaker form of smoothness compared to being Lipschitz. We only consider the set of α’s in newt(p). We are going to assume newt(p) is full-dimensional. If newt(p) is lower-dimensional we can use subspaceidentification methods to restrict the ellipsoid method to the affine subspace spanned by newt(p), and proceed similarly to the full-dimensional case. Let us start by considering the function gy,z (α) = log( p(y, z) ). (yz)α It is easy to see that for any y, z > 0, gy,z is Lipschitz with respect to α with Lipschitz constant bounded by poly(log(y), log(z), n). So the function gM (α) = inf y,z:kyk∞ ,kzk∞ <M gy,z (α) is also Lipschitz with respect to α with Lipschitz constant bounded by poly(log(M ), n). Now consider the function h(α) = gM (α) + α log(α). This function is not Lipschitz in α, but it satisfies a weaker form of smoothness. In particular if α is perturbed by ǫ2 , one can show that h(α) changes by at most Lǫ for some L = poly(log(M ), n). The function h provides a uniform approximation of p(y,z) inf y,z>0 log( (yz/α) α ) over newt(p). Using this fact and that newt(p) has only integral vertices of bounded norm, one can construct the desired inner ellipse. 4 The Lower Bound In this section we prove the LHS of (3) and (4). However, instead of lower bounding the quantity P Cp (κ)Cq (κ) for two real stable polynomials p(y), q(z), we treat p(y) · q(z) as a new bistable κ∈Zn + polynomial on 2n variables y, z. Recall that by Fact 2.3 the product of any two stable polynomials is a bistable polynomial. This allows us to prove the lower bound using an inductive argument with a stronger statement. The following theorem implies the LHS of (3). 18 Theorem 4.1. For any bistable polynomial p(y1 , . . . , yn , z1 , . . . , zn ) with nonnegative coefficients and any vector α ∈ Rn+ , X p(y, z) . (14) κ! · Cp (κ, κ) ≥ e−α inf y,z>0 (yz/α)α n κ∈Z+ Instead of directly proving the above theorem, we reduce the general case to the multilinear case. This reduction allows us to exploit Brändén characterization of real stable multilinear polynomials (see Theorem 2.7). Theorem 4.2. For any bistable multilinear polynomial p(y1 , . . . , yn , z1 , . . . , zn ) with nonnegative coefficients and any vector α ∈ Rn+ , X p(y, z) y,z>0 (yz/α)α Cp (κ, κ) ≥ (1 − α)1−α inf κ∈{0,1}n Note that not only do we use the above theorem to prove Theorem 4.1, but we also use it to prove (4). In the rest of this section, we prove Theorem 4.1 using the above theorem; then in Subsection 4.1 we prove the above theorem. Observe that if p is a multilinear bistable polynomial, then Theorem 4.1 follows from the above theorem (this is because e−x ≤ (1 − x)1−x for any 0 ≤ x ≤ 1). So, we just need to reduce the case of a general p to the multilinear case. Let m be a very large integer that we fix later in the proof. For now, we assume m is larger than the degree of all variables in p. Throughout the proof we use y, z to denote n-dimensional (positive) vectors and we use ỹ, z̃ ∈ Rn×m to denote the variables of the polarization of p. Let q(ỹ, z̃) := πm (p) n×m where for all 1 ≤ i ≤ n and 1 ≤ j ≤ m, and r(ỹ, z̃) := q(ỹ, mz̃). Also, let α̃ ∈ R+ α̃i,j = 1 αi . m By applying Theorem 4.2 to r(ỹ, z̃) and α̃ we get X r(ỹ, z̃) . ỹ,z̃>0 (ỹz̃/α̃)α̃ Cr (κ, κ) ≥ (1 − α̃)1−α̃ inf κ∈{0,1}n×m (15) First, we show that the RHS of the above is at least the RHS of (14) for any m. Then, we show that as m → ∞ the LHS of the above converges to the LHS of (14). Lemma 4.3. (1 − α̃)1−α̃ inf ỹ,z̃>0 p(y, z) r(ỹ, z̃) ≥ e−α inf . α̃ y,z>0 (ỹz̃/α̃) (yz/α)α Proof. Firstly, note that by the definition of α̃, α̃α̃ = (α/m)α . Also, using the inequality (1 − x)1−x ≥ e−x , we have (1 − α̃)1−α̃ ≥ e−α̃ = e−α . Therefore, to prove the lemma it is enough to show that r(ỹ, z̃) p(y, z) ≥ inf . α̃ y,z>0 (yz)α ỹ,z̃>0 (mỹz̃) inf 19 (16) It follows by the change of variable z̃ ↔ z̃/m that r(ỹ, z̃) r(ỹ, z̃/m) q(ỹ, z̃) = inf = inf , α̃ α̃ ỹ,z̃>0 (mỹz̃) ỹ,z̃>0 ỹ,z̃>0 (ỹz̃)α̃ (ỹz̃) inf where in the last identity we used r(ỹ, z̃/m) = q(ỹ, mz̃/m) = q(ỹ, z̃). So, to prove (16), it is enough to show that p(y, z) q(ỹ, z̃) ≥ inf . (17) inf α̃ y,z>0 (yz)α ỹ,z̃>0 (ỹz̃) Q We use the AM-GM inequality to prove this. Fix an arbitrary ỹ, z̃ ∈ Rn×m , let yi = ( j ỹi,j )1/m Q p(y,z) and zi = ( j z̃i,j )1/m for all i. We show that q(ỹ,z̃) (ỹz̃)α ≥ (yz)α which proves (17). Firstly, ỹα̃ = yα and similarly z̃α̃ = zα . Therefore, all we need to show is that p(y, z) ≤ q(ỹ, z̃). Recall that q = πm (p); this means that we have substituted each term yik in p with 1 e (y , . . . , yi,m ). Since all coefficients of p are nonnegative, to show p(y, z) ≤ q(ỹ, z̃) it is (mk) k i,1 enough to show that for all i, k, m 1 m ek (ỹi,1 , . . . , ỹi,m ) k or equivalently, X S∈([m] k ) ≤ yik ,  1/m m Y Y 1  ỹi,j  ỹi,j ≥  . m k j=1 j∈S The above inequality is just an application of AM-GM. This proves (17) and completes the proof of Lemma 4.3. To finish the proof of Theorem 4.1 it remains to show that the LHS of (15) converges to the LHS of (14) as m → ∞. We prove this statement termQby term. Fix κ ∈ Zn+ and consider the monomial Cp (κ, κ) ni=1 yiκi ziκi of p. The contribution of this monomial to the LHS of (14) is κ! · Cp (κ, κ). This monomial is substituted with Cp (κ, κ) = n Y eκi (yi,1 , . . . , yi,m )eκi (mzi,1 , . . . , mzi,m ) m 2 i=1 n Y κi κ m i eκi (yi,1 , . . . , yi,m )eκi (zi,1 , . . . , zi,m ) Cp (κ, κ) . m 2 i=1 κi in r. The contribution of this to the LHS of (15) is   n n Y Y mκ i m mκ i Cp (κ, κ) . · = κ! · C (κ, κ) ·  p m 2 m(m − 1) . . . (m − κi + 1) κi i=1 i=1 κi As m → ∞ the ratio in the RHS converges to 1, so we get the same contribution. This completes the proof of Theorem 4.1. 20 4.1 Multilinear Case In this section we prove Theorem 4.2. Our first observation is the following useful identity: X Cp (κ, κ) = n Y (1 + ∂yi ∂zi )p(y, z) i=1 κ∈{0,1}n y=z=0 . To see this identity, note that any monomial of p which is not of the form yκ yκ for some κ is mapped to zero in the RHS. Furthermore, any monomial of the form Cp (κ, κ)yκ zκ is mapped to Qn Cp (κ, κ). So, throughout the proof we lower bound i=1 (1+∂yi ∂zi )p(y, z) y=z=0 . The main reason that we use this reformulation is that it allows us to use induction. In the following lemma we show that for any bistable polynomial p, (1 + ∂yi ∂zi )p is also bistable. So, we can apply the operator Q n i=1 (1 + ∂yi ∂zi ) inductively. Lemma 4.4. For any multilinear bistable polynomial p(y1 , . . . , yn , z1 , . . . , zn ) and any 1 ≤ i ≤ n, (1 + ∂yi ∂zi )p|yi =zi =0 is also bistable. Proof. Let q(y−i , z−i ) = (1 + ∂yi ∂zi )p(y, z)|yi =zi =0 . We need to show that q(y−i , −z−i ) is stable. We will prove that (18) q(y−i , −z−i ) = (1 − ∂yi ∂zi )p(y, −z)|yi =zi =0 . Then, the claim follows from the fact the the polynomial on the RHS is stable. In particular, since p(y, −z) is stable, by Lemma 2.6, (1 − ∂yi ∂zi )p(y, −z) is stable. Furthermore, by Fact 2.4 when we substitute yi = zi = 0 in the latter we still have a stable polynomial. It remains to show (18). We can write p as follows: p(y, z) = yi zi p1 (y−i , z−i ) + yi p2 (y−i , z−i ) + zi p3 (y−i , z−i ) + p4 (y−i , z−i ). So, q(y−i , −z−i ) = (1 + ∂yi ∂zi )p(y, −z1 , . . . , −zi−1 , zi , −zi+1 , . . . , zn )|yi =zi =0 = p1 (y−i , −z−i ) + p4 (y−i , −z−i ) On the other hand, (1 − ∂yi ∂zi )p(y, −z)|yi =zi =0 = (1 − ∂yi ∂zi ) − yi zi p(y−i , −z−i ) + yi p2 (y−i , −z−i )  − zi p3 (y−i , −z−i) + p4 (y−i , −z−i ) |yi =zi =0 = p1 (y−i , −z−i ) + p4 (y−i , −z−i ) This proves (18). We prove Theorem 4.2 by induction. See Lemma 4.5 for the base case of the induction. Suppose the statement of the theorem holds for any bistable multilinear polynomial with nonnegative coefficients and at most 2n − 2 variables. Given p(y1 , . . . , yn , z1 , . . . , zn ) and some ǫ > 0 we show that there exists y, z > 0 such that n Y i=1 (1 + ∂yi ∂zi )p y=z=0 + ǫ ≥ (1 − α)1−α 21 p(y, z) . (yz/α)α (19) Let q(y1 , . . . , yn−1 , z1 , . . . , zn−1 ) = (1 + ∂yn ∂zn )p|yn =zn =0 . Note that by definition, q has nonnegative coefficients and is multilinear. Also, by Lemma 4.4, q is a bistable polynomial. Now, by the induction hypothesis, there exists y∗ , z∗ ∈ Rn−1 such that n−1 Y (1 + ∂yi ∂zi )q i=1 y=z=0 + ǫ/2 ≥ (1 − α−n )1−α−n q(y∗ , z∗ ) . (y∗ z∗ /α−n )α−n Also, observe that by the definition of q, the LHS of the above is equal to the LHS of (19). So to prove (19), it is enough to show that there exist yn , zn such that (1 − α−n )1−α−n p(y∗ , yn , z∗ , zn ) q(y∗ , z∗ ) 1−α . + ǫ/2 ≥ (1 − α) (y∗ z∗ /α−n )α−n (y∗ z∗ /α−n )α−n (yn zn /αn )αn Let f (yn , zn ) = p(y∗ , yn , z∗ , zn ). To prove the above it is enough to show that there exists yn , zn such that f (yn , zn ) . (20) (1 + ∂yn ∂zn )f (yn , zn )|yn =zn =0 + ǫ/2 ≥ (1 − αn )1−αn (yn zn /αn )αn We prove this using Lemma 4.5. All we need to apply this lemma is that f (yn , zn ) is a multilinear bistable polynomial with nonnegative coefficients. Since p is multilinear with nonnegative coefficients, and we substitute y1 , . . . , yn−1 , z1 , . . . , zn−1 with positive numbers, we get that f is multilinear with nonnegative coefficients. Furthermore, since p(y1 , . . . , yn , −z1 , . . . , −zn ) is stable, by Fact 2.4, ∗ ∗ f (yn , −zn ) = p(y1∗ , . . . , yn−1 , yn , z1∗ , . . . , zn−1 , −zn ) is stable. So, f is a bistable polynomial. Therefore, (20) simply follows by Lemma 4.5. This completes the proof of Theorem 4.2. Lemma 4.5. Let p(y, z) be a multilinear bistable bivariate polynomial with nonnegative coefficients. Then, for any α ≥ 0, p(y, z) (1 + ∂y ∂z )p y=z=0 ≥ (1 − α)1−α inf y,z>0 (yz/α)α Proof. Since p is multilinear, if α > 1, then the RHS of the above is zero and we are done. In particular, for a fixed z, as y → ∞, p(y, z)/y α → 0. So, throughout the proof we assume that α ≤ 1. Since p is multilinear we can write it as p(y, z) = ayz + by + cz + d, for a, b, c, d ≥ 0. To prove the lemma’s conclusion, it is enough to show ayz + by + cz + d . y,z>0 (yz/α)α a + d ≥ (1 − α)1−α inf (21) When α = 1, the RHS of (21) is at most a since the ratio converges to a as y, z → ∞. When α = 0, the RHS of (21) is at most d since the ratio converges to d as y, z → 0. In both cases the RHS is at most a + d and we are done. So for the rest of the proof assume that 0 < α < 1. 22 Since p(x, −y) is stable, by Theorem 2.7 we have −b · c = ∂y p(y, −z)|y=z=0 · ∂z p(y, −z)|y=z=0 ≥ p(0, 0) · ∂y ∂z p(y, −z)|y=z=0 = −a · d, or, in other words b · c ≤ a · d. If this inequality is not tight, we can increase b, c for it to become tight. In other words, let b′ ≥ b and c′ ≥ c be such that b′ c′ = ad. It is easy to see that such b′ , c′ can always be found. Then, to prove (21), it is enough to show that ayz + b′ y + c′ z + d , y,z>0 (yz/α)α a + d ≥ (1 − α)1−α inf Consider the following matrix: M :=  a b′ c′ d  . Since det(M ) = ad − b′ c′ = 0, we have rank(M ) ≤ 1, and in particular we can write M as uv ⊺ for u, v ∈ R2 . Since the entries of M are nonnegative we can further assume that u, v ∈ R2+ . Therefore we have       e a b′ = M= · g h , ′ c d f where e, f, g, h ≥ 0. This implies the factorization ayz + b′ y + c′ z + d = (ey + f )(gz + h). So to prove the conclusion of the lemma it is enough to show the following inequality: (ey + f )(gz + h) ey + f gz + h = αα (1 − α)1−α inf · inf . (22) α α y,z>0 y>0 z>0 (yz/α) y zα a + d = eg + f h ≥ (1 − α)1−α inf To prove the above inequality we will use the following claim. Claim 4.6. For any 0 < α < 1 and β, γ ≥ 0, β α γ 1−α βt + γ = . t>0 tα αα (1 − α)1−α inf Before proving the claim, let us use it to prove (22). Because of Claim 4.6, we can write the RHS of (22) as αα (1 − α)1−α · gα h1−α (eg)α (f h)1−α eα f 1−α · = . αα (1 − α)1−α αα (1 − α)1−α αα (1 − α)1−α Applying Claim 4.6 once more, with β = eg, γ = f h, we get   egt + f h egt + f h (eg)α (f h)1−α = inf ≤ t>0 αα (1 − α)1−α tα tα t=1 = eg + f h, which is the LHS of (22). It only remains to prove Claim 4.6. Proof. By the weighted AM-GM inequality we have  α  1−α βt βt γ γ β α γ 1−α βt + γ = α · + (1 − α) · ≥ . · = tα α α 1−α α 1−α α (1 − α)1−α 23 Therefore β α γ 1−α βt + γ ≥ . t>0 tα αα (1 − α)1−α inf αγ Note that we have equality in AM-GM when βt/α = γ/(1 − α). So it is enough to set t = (1−α)β to get equality, which is possible if β, γ > 0. It remains to prove the claim when either β = 0 or γ = 0. In both cases the RHS is 0 so we just need to show that the LHS is 0 as well. When β = 0, it is enough to let t → ∞, and when γ = 0, it is enough to let t → 0 to get βt + γ = 0. t>0 tα inf This completes the proof of Lemma 4.5. 5 The Upper Bound In this section we prove the RHS of (3). This will complete the proof of Theorem 1.1. Theorem 5.1. For any two real stable polynomials p(y1 , . . . , yn ) and q(z1 , . . . , zn ) with nonnegative coefficients, X p(y)q(z) . (23) κκ · Cp (κ)Cq (κ) ≤ sup inf α α≥0 y,z>0 (yz/α) n κ∈Z+ Note that κκ ≥ κ! for any κ, so the above theorem immediately implies the RHS of (3). Note that unlike Theorem 4.1 here we only prove our theorem for product of stable polynomials (as opposed to bistable polynomials). This is because the above statement fails for (multilinear) bistable polynomials. For example, the polynomial p(y, z) = 1 + yz is bistable; however by Claim 4.6, for any fixed 0 < α < 1 we have p(y, z) 1 + yz = inf = (1 − α)−(1−α) . α y,z>0 (yz/α) y,z>0 (yz/α)α inf It is an easy exercise to see that (1 − α)−(1−α) ≤ e1/e . But the quantity P κ∈Zn + κκ · Cp (κ, κ) is 2 which is strictly more than e1/e . In order to prove Theorem 5.1 we will crucially use the following minimax result about the RHS of (23). Lemma 5.2. For any bistable polynomial p(y, z) with nonnegative coefficients, p(y, z) p(y, z) = inf sup inf . α α α≥0 y,z>0 (yz/α) y>0 α≥0 z>0 (yz/α) sup inf Before proving Lemma 5.2, let us show how it can be used to prove Theorem 5.1. 24 Proof of Theorem 5.1. Because of Lemma 5.2, we have p(y)q(z) p(y)q(z) = inf sup inf . α α α≥0 y,z>0 (yz/α) y>0 α≥0 z>0 (yz/α) sup inf So to prove (23), we just need to show that for any fixed y > 0, the following inequality holds: X p(y)q(z) ≥ κκ · Cp (κ) · Cq (κ). α (yz/α) α≥0 z>0 n sup inf κ∈Z+ Note that p(y) is fixed on the LHS. So p(y)q(z) α α≥0 z>0 (yz/α) sup inf q(z) α α≥0 z>0 (yz/α) = p(y) sup inf = X q(z) . α α≥0 z>0 (yz/α) Cp (κ)yκ sup inf κ∈Zn + (24) But for any fixed κ ∈ Zn+ , we have q(z) sup inf α α≥0 z>0 (yz/α) ≥  q(z) inf z>0 (yz/α)α  q(z) z>0 (yz/κ)κ = inf α=κ Cq (κ)zκ Cq (κ) ≥ inf = κκ · . κ z>0 (yz/κ) yκ Plugging back into (24) gives us X Cq (κ) X κ p(y)q(z) ≥ κ · Cp (κ) · Cq (κ). Cp (κ)yκ κκ κ = α y α≥0 z>0 (yz/α) n κ sup inf κ∈Z+ This concludes the proof of Theorem 5.1, assuming Lemma 5.2. 5.1 Duality In this section we prove Lemma 5.2. From basic properties of inf and sup, it is immediate that p(y, z) p(y, z) ≤ inf sup inf . α α α≥0 y,z>0 (yz/α) y>0 α≥0 z>0 (yz/α) sup inf So to prove equality, it is enough to prove that the LHS is greater than or equal to the RHS. We would ideally like to apply one of the classical minimax theorems, such as von Neumann’s minimax theorem, which often require the function inside inf and sup to be convex-concave. However in its current form p(y, z)/(yz/α)α does not satisfy this property. Instead we transform both sides to a form suitable for minimax theorems. Because of Fact 2.18, we can replace supα≥0 by inf α∈[0,deg p]n . This is crucial for applying Theorem 5.3, since the domain of α has to be compact. Additionally, by Lemma 2.12 we can move 25 α from the denominator to the numerator, and inside of p. Finally, we apply the change of variables y ↔ exp(ỹ) and z ↔ exp(z̃). Therefore, to prove the above inequality, it is enough to show that sup inf α∈[0,deg p]n ỹ,z̃∈Rn p(exp(ỹ), α exp(z̃)) p(exp(ỹ), α exp(z̃)) inf sup ≥ inf . α α α α exp(ỹ) exp(z̃) ỹ∈Rn α∈[0,deg p]n z̃∈Rn exp(ỹ) exp(z̃) (25) We use Sion’s minimax theorem. We state a weaker form of this theorem below, which will be enough for our purposes; for the original stronger version, look at [Sio58]. Theorem 5.3 (Immediate corollary of [Sio58]). Let A be a compact convex subset of Rn and B a (not necessarily compact) convex subset of Rm . Suppose that f : A × B → R has the following properties: • For each a ∈ A, the function f (a, ·) : B → R is continuous and quasi-convex. • For each b ∈ B, the function f (·, b) : A → R is continuous and quasi-concave. Then we have sup inf f (a, b) = inf sup f (a, b). a∈A b∈B b∈B a∈A Recall that a real-valued function f is quasi-convex if f −1 (−∞, t] is convex for any t ∈ R and f is quasi-concave if −f is quasi-convex. We will apply Theorem 5.3 to the following function. f (α, (ỹ, z̃)) := p(exp(ỹ), α exp(z̃)) . exp(ỹ)α exp(z̃)α For a fixed α ≥ 0, the function f is log-convex, and therefore quasi-convex, in ỹ, z̃ because of Fact 2.11. For a fixed ỹ, z̃, the function f is log-concave, and therefore quasi-concave, in α because of Corollary 2.10. It is easy to see that f is continuous in each variable as well. Therefore, by Theorem 5.3 we have sup inf α∈[0,deg p]n ỹ,z̃∈Rn p(exp(ỹ), α exp(z̃)) exp(ỹ)α exp(z̃)α = inf sup ỹ,z̃∈Rn α∈[0,deg p]n ≥ inf sup p(exp(ỹ), α exp(z̃)) exp(ỹ)α exp(z̃)α inf ỹ∈Rn α∈[0,deg p]n z̃∈Rn p(exp(ỹ), α exp(z̃)) . exp(ỹ)α exp(z̃)α This proves (25) and finishes the proof of Lemma 5.2. References [AO15a] Nima Anari and Shayan Oveis Gharan. Effective-Resistance-Reducing Flows, Spectrally Thin Trees, and Asymmetric TSP. In FOCS, pages 20–39, 2015. 2 [AO15b] Nima Anari and Shayan Oveis Gharan. The kadison-singer problem for strongly rayleigh measures and applications to asymmetric tsp. 2015. 2 [AOSS17] Nima Anari, Shayan Oveis Gharan, Amin Saberi, and Mohit Singh. Nash social welfare, matrix permanent, and stable polynomials. In ITCS, 2017. to appear. 11 26 [BB10] J. Borcea and P. Brädén. Multivariate Pólya-Schur classification problems in the Weyl algebra. Proceedings of the London Mathematical Society, 101(3):73–104, 2010. 5 [BBL09] Julius Borcea, Petter Branden, and Thomas M. Liggett. Negative dependence and the geometry of polynomials. Journal of American Mathematical Society, 22:521–567, 2009. 4, 5, 6, 11 [BC95] André Bouchet and William H. Cunningham. Delta-matroids, jump systems, and bisubmodular polyhedra. SIAM J. Discrete Math., 8(1):17–32, 1995. 8 [Brä07] Petter Brändén. Polynomials with the half-plane property and matroid theory. Advances in Mathematics, 216(1):302–320, 2007. 5, 7 [BV06] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2006. 6 [Csi14] Péter Csikvári. Lower matching conjecture, and a new proof of schrijver’s and gurvits’s theorems. arXiv preprint arXiv:1406.0766, 2014. 9 [Gra02] JH Grace. The zeros of a polynomial. In Proc. Cambridge Philos. Soc, volume 11, pages 352–357, 1902. 5 [GS14] Leonid Gurvits and Alex Samorodnitsky. Bounds on the permanent and some applications. In FOCS, pages 90–99. IEEE Computer Society, 2014. 9 [Gül97] Osman Güler. Hyperbolic polynomials and interior point methods for convex programming. MOR, 22(2):350–77, 1997. 6 [Gur06] Leonid Gurvits. Hyperbolic polynomials approach to van der waerden/schrijver-valiant like conjectures: Sharper bounds, simpler proofs and algorithmic applications. In STOC, STOC ’06, pages 417–426, 2006. 2 [Gur11] L. Gurvits. Unleashing the power of schrijvers permanental inequality with the help of the bethe approximation. arXiv:1106.2844, 2011. 9 [KT12] Alex Kulesza and Ben Taskar. Determinantal point processes for machine learning. arXiv preprint arXiv:1207.6083, 2012. 11 [Lel17] Marc Lelarge. Counting matchings in irregular bipartite graphs. In SODA, 2017. to appear. 9 [Lov97] László Lovász. The membership problem in jump systems. J. Combin. Theory Ser. B, 70(1):45–66, 1997. 7 [MF08] S. Thomas McCormick and Satoru Fujishige. Strongly polynomial and fully combinatorial algorithms for bisubmodular function minimization. In Proceedings of the Nineteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 44–53. ACM, New York, 2008. 8, 9 [MSS13] Adam Marcus, Daniel A Spielman, and Nikhil Srivastava. Interlacing Families II: Mixed Characteristic Polynomials and the Kadison-Singer Problem. 2013. 2 27 [NS16] Aleksandar Nikolov and Mohit Singh. Maximizing determinants under partition constraints. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016, pages 192–201, 2016. 1, 3, 13 [Sch98] Alexander Schrijver. Counting 1-factors in regular bipartite graphs. Journal of Combinatorial Theory, Series B, 72(1):122–135, 1998. 9 [Sio58] Maurice Sion. On general minimax theorems. Pacific J. Math., 8:171–176, 1958. 26 [SV16] Damian Straszak and Nisheeth K. Vishnoi. Real stable polynomials and matroids: Optimization and counting. 2016. 3 [Sze22] G Szegö. Bemerkungen zu einem satz von jh grace über die wurzeln algebraischer gleichungen. Mathematische Zeitschrift, 13(1):28–55, 1922. 5 [Wal22] JL Walsh. On the location of the roots of certain types of polynomials. Transactions of the American Mathematical Society, 24(3):163–180, 1922. 5 28
8cs.DS
arXiv:1604.01757v1 [math.GR] 6 Apr 2016 ON SEMIGROUPS WITH PSPACE-COMPLETE SUBPOWER MEMBERSHIP PROBLEM MARKUS STEINDL Abstract. Fix a finite semigroup S and let a1 , . . . , ak , b be tuples in a direct power S n . The subpower membership problem (SMP) for S asks whether b can be generated by a1 , . . . , ak . For combinatorial Rees matrix semigroups we establish a dichotomy result: if the corresponding matrix is of a certain form, then the SMP is in P; otherwise it is NP-complete. For combinatorial Rees matrix semigroups with adjoined identity, we obtain a trichotomy: the SMP is either in P, NP-complete, or PSPACE-complete. This result yields various semigroups with PSPACE-complete SMP including the 6-element Brandt monoid, the full transformation semigroup on 3 or more letters, and semigroups of all n by n matrices over a field for n ≥ 2. 1. Introduction In this paper we continue the investigation of the subpower membership problem (SMP) for semigroups started in [1] and [10]. At the Conference on Order, Algebra, and Logics in Nashville, 2007, Ross Willard proposed the SMP as follows [12]: Fix a finite algebraic structure S with finitely many basic operations. Then the subpower membership problem for S is the following decision problem: SMP(S ) Input: {a1 , . . . , ak } ⊆ S n , b ∈ S n Problem: Is b in the subalgebra of S n generated by a1 , . . . , ak ? The SMP occurs in connection with the constraint satisfaction problem (CSP) [4]. In the algebraic approach to the CSP, each constraint relation is considered to be a subalgebra of a power (subpower) of a certain finite algebra whose operations are the polymorphisms of the constraint language. Checking whether a given tuple belongs to a constraint relation represented by its generators is precisely the SMP for the polymorphism algebra. The input size of SMP(S) is essentially (k + 1)n. We can always decide the problem using a straightforward closure algorithm in time exponential in n. Thus SMP(S) is in EXPTIME for every algebra S. However, the following questions arise: • How does the algebra S affect the computational complexity of SMP(S)? • For which algebras S can SMP(S) be solved in time polynomial in k and n? Date: March 19, 2018. 2000 Mathematics Subject Classification. Primary: 20M99; Secondary: 68Q25. Key words and phrases. subalgebras of powers, membership test, computational complexity, PSPACE-complete, NP-complete. Supported by the Austrian Science Fund (FWF): P24285. 1 2 MARKUS STEINDL • When is the problem complete in NP, PSPACE, or EXPTIME? Can it also be complete in a class other than these? Mayr [6] proved that the SMP for Mal’cev algebras is in NP. He also showed that for certain generalizations of groups and quasigroups the SMP is in P. Kozik [5] constructed a finite algebra with EXPTIME-complete SMP. For semigroups the SMP is in PSPACE. This was shown in [1] by Bulatov, Mayr, and the author of the present paper. We also proved that the SMP of the full transformation semigroup on five letters is PSPACE-complete. It was the first algebra known to have a PSPACE-complete SMP. In the same paper a dichotomy result for commutative semigroups was established: if a commutative semigroup S embeds into a direct product of a Clifford semigroup and a nilpotent semigroup, then SMP(S) is in P; otherwise it is NP-complete. Another dichotomy for idempotent semigroups was established in [10]: if an idempotent semigroup S satisfies a certain pair of quasiidentities, then SMP(S) is in P; otherwise it is NP-complete. The first result of the current work is a condition for a semigroup S under which SMP(S) is NP-hard: Theorem 1.1. Let r, s, t be elements of a finite semigroup S such that s does not generate a group and rs = st = s. Then SMP(S) is NP-hard. We will prove this result in Section 2 by reducing the Boolean satisfiability problem SAT to SMP(S). A semigroup is called combinatorial if every subgroup has one element. Combinatorial Rees matrix semigroups are of the form M0 ({1}, I, Λ, P ) (see [3, Theorem 3.2.3]). We give the following alternative notation: For nonempty sets I, Λ and a matrix P ∈ {0, 1}Λ×I we let SP := (I × Λ) ∪ {0} and define a multiplication on SP by ( [i, µ] if P (λ, j) = 1, [i, λ] · [j, µ] := 0 if P (λ, j) = 0, 0 · [i, λ] := [i, λ] · 0 := 0 · 0 := 0. It is easy to see that SP is indeed a combinatorial semigroup. We say the matrix P ∈ {0, 1}Λ×I has one block if there exist J ⊆ I, ∆ ⊆ Λ such that for i ∈ I, λ ∈ Λ, P (λ, i) = 1 if and only if (λ, i) ∈ ∆ × J. ( 10 01 ) For P = we call B2 := SP the Brandt semigroup, and for P = ( 11 10 ) we denote SP by A2 . In Section 3 we establish the following two results: Theorem 1.2. Let SP be a finite combinatorial Rees matrix semigroup. If the matrix P has one block, then SMP(SP ) is in P. Otherwise SMP(SP ) is NP-complete. Corollary 1.3. The SMP for the Brandt semigroup B2 and for the semigroup A2 is NP-complete. In Section 4 we state a condition for semigroups S under which SMP(S) is PSPACEcomplete: Theorem 1.4. Let S be a finite semigroup and s, t, 1 ∈ S such that (a) sts = s, ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 3 (b) s does not generate a group, (c) s1 = s and t1 = t. Then SMP(S) is PSPACE-complete. In the proof we will reduce quantified 3SAT to SMP(S). It follows that adjoining an identity to B2 or A2 already results in a PSPACE-complete SMP: Theorem 1.5. The SMP for the Brandt monoid B21 and for the monoid A12 is PSPACE-complete. This result is part of Corollary 4.9. Both B21 and A12 embed into T3 , the full transformation semigroup on three letters. Thus SMP(T3 ) is also PSPACE-complete. So Theorem 1.5 generalizes the result from [1] that SMP(T5 ) is PSPACE-complete. In addition, B2 and A2 are the first groupoids known to have an NP-complete SMP where adjoining an identity yields a groupoid with PSPACE-complete SMP. Further examples of semigroups with PSPACE-complete SMP are listed in Section 4. In Section 5 we will consider Rees matrix semigroups with adjoined identity and prove the following trichotomy result: Theorem 1.6. Let SP be a finite combinatorial Rees matrix semigroup. (a) If all entries of the matrix P are 1, then SMP(SP1 ) is in P. (b) If P has one block and some entries are 0, then SMP(SP1 ) is NP-complete. (c) Otherwise SMP(SP1 ) is PSPACE-complete. 2. Semigroups with NP-hard SMP In this section we will prove Theorem 1.1 by reducing the Boolean satisfiability problem SAT to SMP(S). It follows that the SMP for a semigroup S is already NP-hard if S has a D-class that contains both group and non-group H-classes. We denote Green’s equivalences by L, R, J , H, D [3, p. 45]. For the definition of the related preorders ≤L , ≤R , ≤J see [3, p. 47]. We write [n] := {1, . . . , n} for n ∈ N and set [0] := ∅. We consider a tuple a in a direct power S n to be a function a : [n] → S. This means the ith coordinate of this tuple is denoted by a(i) rather than ai . The subsemigroup generated by a set A = {a1 , . . . , ak } may be denoted by hAi or ha1 , . . . , ak i. Lemma 2.1. Let s belong to a finite semigroup S. Then s generates a group if and only if s2 J s. Proof. If s generates a group, then sk = s for some k ≥ 2. Thus s2 J s. For the converse let s2 J s. First assume the J -class Js is the minimal ideal of S. Then Js is a finite simple semigroup by [3, Proposition 3.1.4]. By the Rees Theorem for finite simple semigroups s generates a group. Now assume Js is not the minimal ideal of S. Let J(s) := {r ∈ S | r ≤J s}, I(s) := {r ∈ S | r <J s}. By [3, Proposition 3.1.4] the principal factor J(s)/I(s) is either null or 0-simple. Since s2 J s, the second case applies. By the Rees Theorem for finite 0-simple semigroups s generates a group.  Lemma 2.2. Let r, s, t be elements of a finite semigroup S such that s does not generate a group and rs = st = s. Then there are idempotents e, f ∈ S such that es = sf = s and every product a1 · · · ak in s, e, f in which s occurs at least twice does not yield s. 4 MARKUS STEINDL Proof. First assume s is regular, i.e. sus = s for some u ∈ S. Let e and f be the idempotent powers of su and us respectively. Clearly es = sf = s. Let a1 · · · ak be a product in s, e, f , and i < j such that ai = aj = s. Let ℓ ∈ {i + 1, . . . , j} be maximal such that ai+1 = . . . = aℓ−1 = f . Then ai · · · aℓ−1 = s, and thus ai · · · aℓ ∈ {s2 , se}. Note that se = s(su)m for some m ∈ N. Now a factor s2 occurs in the product ai · · · aℓ . Since s does not generate a group, Lemma 2.1 implies that s2 <J s. Thus a1 · · · aℓ <J s, and the result follows. Now assume s is not regular. By [3, Theorem 3.1.6] the principal factor J(s)/I(s) is null. Let e and f be the idempotent powers of r and t respectively. Let a1 · · · ak be a product in s, e, f , and let i < j such that ai = aj = s. Then a1 · · · ai ≤J s and ai+1 · · · ak ≤J s. Since J(s)/I(s) is null, it follows that a1 · · · ak <J s.  Proof of Theorem 1.1. Let S satisfy the assumptions. We reduce the Boolean satisfiability problem SAT to SMP(S). SAT is NP-complete [2], and we give the following definition: SAT Input: Clauses C1 , . . . , Cm ⊆ {x1 , . . . , xk , ¬x1 , . . . , ¬xk }. Problem: Do truth values for W x1 , . . . , xk exist W for which the Boolean formula Φ(x1 , . . . , xk ) := ( C1 ) ∧ . . . ∧ ( Cm ) is true? For all j ∈ [k] we may assume that xj or ¬xj occurs in some clause Ci . We define an SMP(S) instance A := {a01 , . . . , a0k , a11 , . . . , a1k } ⊆ S k+m , b ∈ S k+m . Let e, f ∈ S be idempotents with the properties from Lemma 2.2. Let g be the idempotent power of se. Observe that e and g form a two-element semilattice with g < e. Let j ∈ [k] and z ∈ {0, 1}. For i ∈ [k] let   f if i < j, azj (i) := s if i = j,   e if i > j, and for i ∈ [m] let a0j (k a1j (k + i) := ( g e if ¬xj ∈ Ci , otherwise, + i) := ( g e if xj ∈ Ci , otherwise. Let b(i) := s b(k + i) := g for i ∈ [k], for i ∈ [m]. We claim that (1) the Boolean formula Φ is satisfiable if and only if b ∈ hAi. For the (⇒) direction let z1 , . . . , zk ∈ {0, 1} such that Φ(z1 , . . . , zk ) = 1. We show that (2) b = az11 · · · azkk . ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 5 For i ∈ [k] we have az11 · · · azkk (i) = ei−1 sf k−i = s = b(i). For i ∈ [m] the clause W Ci is satisfied under the assignment x1 7→ z1 , . . . , xk 7→ zk . Thus there is a j ∈ [k] z such that xj ∈ Ci and zj = 1, or ¬xj ∈ Ci and zj = 0. In both cases aj j (k + i) = g, zk z1 and thus a1 · · · ak (k + i) = g = b(k + i). This proves (2) and the (⇒) direction of (1). For the (⇐) direction of (1) assume b = azj11 · · · azjℓℓ for some ℓ ∈ N, j1 , . . . , jℓ ∈ [k], and z1 , . . . , zℓ ∈ {0, 1}. We show that j1 , . . . , jℓ are distinct. Suppose jp = jq for p < q. The factors of the product azj11 · · · azjℓℓ (jp ) are given by s, e, f . The factor s occurs at least twice since ajp (jp ) = ajq (jp ) = s. By Lemma 2.2 this product does not yield s, contradicting our assumption. We define an assignment θ : xj1 7→ z1 , . . . , xjℓ 7→ zℓ , xj 7→ 0 for j ∈ [k] \ {j1 , . . . , jℓ }, and show that θ satisfies the formula Φ. Let i ∈ [m]. Since azj11 . . . azjℓℓ (k + i) is a z product in e, g that yields g, some factor ajpp (k + i) must be g. From the definition zp of ajp we see that either zp = 0 and ¬xjp ∈ Ci , or zp = 1 and xjp ∈ Ci . This means W the formula Ci is satisfied under the assignment θ. Since i was arbitrary, Φ is  also satisfied. The equivalence (1) and the theorem are proved. Corollary 2.3. If a J -class of a finite semigroup S contains both group and nongroup H-classes, then SMP(S) is NP-hard. Proof. Let s ∈ S such that Hs is not a group and Js contains group H-classes. From Green’s Theorem [3, Theorem 2.2.5] we know that s does not generate a group. Since Js contains an idempotent and Js = Ds , the element s is regular by [3, Proposition 2.3.1]. That is, there is a u ∈ S such that sus = s. Now su, s, and us fulfill the hypothesis of Theorem 1.1.  3. Combinatorial Rees matrix semigroups In this section we will establish a P/NP-complete dichotomy for the SMP for combinatorial Rees matrix semigroups by proving Theorem 1.2. After that we apply this result to combinatorial 0-simple semigroups. Combinatorial Rees matrix semigroups have the following property: Lemma 3.1 (cf. [9, Lemma 2.2]). Let k ≥ 2 and a1 , . . . , ak be elements of a combinatorial Rees matrix semigroup SP . (a) We have a1 · · · ak = 0 if and only if aj aj+1 = 0 for some j ∈ [k − 1]. (b) If a1 · · · ak 6= 0, then there are i, j ∈ I and λ, µ ∈ Λ such that a1 = [i, λ], ak = [j, µ], and a1 · · · ak = [i, µ]. Proof. Straightforward.  The next two results will allow us to show that the SMP for a combinatorial Rees matrix semigroup is in NP. Lemma 3.2 (cf. [9, Theorem 4.3]). Let f := y1 · · · yk and g := z1 · · · zℓ be words over an alphabet X such that (a) {yi yi+1 | i ∈ [k − 1]} = {zj zj+1 | j ∈ [ℓ − 1]}, (b) y1 = z1 and yk = zℓ . Then every combinatorial Rees matrix semigroup SP satisfies f ≈ g. 6 MARKUS STEINDL Proof. Let SP be a combinatorial Rees matrix semigroup, and let α : X + → SP be a homomorphism from the free semigroup over X to SP . By item (a) we have {y1 , . . . , yk } = {z1 , . . . , zℓ }. We claim that (3) α(y1 · · · yk ) = 0 if and only if α(z1 · · · zℓ ) = 0. Assume α(y1 · · · yk ) = 0. Then α(yi )α(yi+1 ) = 0 for some i ∈ [k−1] by Lemma 3.1 (a). By item (a) yi yi+1 = zj zj+1 for some j ∈ [ℓ − 1]. Thus α(zj )α(zj+1 ) = 0, and hence α(z1 · · · zℓ ) = 0. This proves (3). If α(y1 · · · yk ) = 0, then α(y1 · · · yk ) = α(z1 · · · zℓ ) by (3). Assume α(y1 · · · yk ) 6= 0. Then also α(z1 · · · zℓ ) 6= 0, and Lemma 3.1 (b) implies α(y1 ) · · · α(yk ) = α(z1 ) · · · α(zℓ ). This proves the lemma.  Lemma 3.3. Let f be a word over x1 , . . . , xk . Then there is a word g such that (a) the length of g is at most k(k 2 + 1), and (b) every combinatorial Rees matrix semigroup satisfies f ≈ g. Proof. Let f = y1 · · · yℓ for y1 , . . . , yℓ ∈ {x1 , . . . , xk }. We show that there is a word g such that item (b) holds and in which each variable xi occurs at most k 2 + 1 times. Fix i ∈ [k]. Let j1 , . . . , jm ∈ [ℓ] be the positions of xi in y1 · · · yℓ . Let v1 := y1 · · · yj1 , vr := yjr−1 +1 · · · yjr for r ∈ {2, . . . , m}, vm+1 := yjm +1 · · · yℓ . Note that f = v1 · · · vm+1 . Now for every word h := z1 · · · zn over x1 , . . . , xk let E(h) := {zj zj+1 | j ∈ [n − 1]}. It is not hard to see that E(v1 · · · vr ) = E(v1 ) ∪ E(xi v2 ) ∪ . . . ∪ E(xi vr ) for r ∈ {2, . . . , m + 1}. We define R := {r ∈ {2, . . . , m} | E(xi vr ) 6⊆ E(v1 · · · vr−1 )} and let Y g := v1 ( vr )vm+1 . r∈R Apparently g is a concatenation of subwords of f , and f and g start with the same letter. We show that (4) f and g also end with the same letter. If vm+1 is nonempty, then (4) is clear. If vm+1 is empty, then yℓ = xi , and g ends with a subword vr for some r ∈ [m]. Since vr and f both end with xi , (4) is proved. We have m [ E(f ) = E(v1 · · · vm+1 ) = E(v1 ) ∪ E(xi vr ) ∪ E(xi vm+1 ) r=2 = E(v1 ) ∪ [ E(xi vr ) ∪ E(xi vm+1 ) = E(g). r∈R Now Lemma 3.2 implies item (b). ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 7 Next observe that |R| ≤ k 2 by the definitions of R and E. This means xi occurs at most k 2 + 1 times in g. Since xi was arbitrary, we can reduce the number of  occurrences of each variable in f to at most k 2 + 1. Item (a) is proved. Lemma 3.4. The SMP for a finite combinatorial Rees matrix semigroup is in NP. Proof. Let S be such a semigroup, and let {a1 , . . . , ak } ⊆ S n , b ∈ S n be an instance of SMP(S). If b ∈ ha1 , . . . , ak i, then there is a term function f such that f (a1 , . . . , ak ) = b. By Lemma 3.3 there is a word g which induces f and whose length is polynomial in k. Now g witnesses the positive answer.  For the following result note that the all-0 matrix has one block. Lemma 3.5. Let SP be a finite combinatorial Rees matrix semigroup such that P ∈ {0, 1}Λ×I has one block. Then Algorithm 1 decides SMP(SP ) in polynomial time. Algorithm 1 Decides SMP(SP ) in polynomial time if P has one block. Input: A ⊆ SP n , b ∈ SP n , m ∈ {0, . . . , n} such that b(i) 6= 0 iff i ∈ [m], J ⊆ I, ∆ ⊆ Λ such that P (λ, i) = 1 iff (λ, i) ∈ ∆ × J for i ∈ I, λ ∈ Λ. Output: true if b ∈ hAi, false otherwise. 1: if b ∈ A then 2: return true 3: end if Q 4: d := {a ∈ A | a([m]) ⊆ J × ∆} (some order) 5: return ∃a1 , a2 ∈ A : a1 da2 = b Proof. Fix an input A ⊆ SP n , b ∈ SP n . We may assume that there is an m ∈ {0, . . . , n} such that b(i) 6= 0 for i ∈ [m], b(i) = 0 for i ∈ {m + 1, . . . , n}. Correctness of Algorithm 1. If Algorithm 1 returns true, then clearly b ∈ hAi. Conversely assume b ∈ hAi. We show that true is returned. Let g1 , . . . , gk ∈ A such that b = g1 · · · gk . If k = 1 then true is returned in line 2. Assume k ≥ 2. We have (5) g1 (i) ∈ I × ∆, gk (i) ∈ J × Λ, and g2 (i), . . . , gk−1 (i) ∈ J × ∆ for all i ∈ [m]; otherwise we obtain the contradiction g1 · · · gk (i) = 0 for some i ∈ [m]. Let d have a value assigned by line 4. We claim that (6) g1 dgk = b. For i ∈ [m] we have d(i) ∈ J × ∆. The multiplication rule and (5) imply b(i) = g1 · · · gk (i) = g1 dgk (i). Now let i ∈ {m + 1, . . . , n}. Since b(i) = 0, there are three cases: g1 (i) ∈ / I × ∆, gk (i) ∈ / J × Λ, or gj (i) ∈ / J × ∆ for some j ∈ {2, . . . , k − 1}. In the first two cases g1 dgk (i) = 0 = b(i) holds. In the third case a := gj occurs as factor in line 4. Thus 8 MARKUS STEINDL d(i) ∈ / J × ∆, and hence g1 dgk (i) = 0. This proves (6). So the algorithm returns true in line 5. Complexity of Algorithm 1. The product in line 4 can be computed in O(|A|n) time. Checking the condition in line 5 requires O(|A|2 n) time. Altogether Algorithm 1 runs in O(|A|2 n) time.  Now we prove Theorem 1.2 and Corollary 1.3. Proof of Theorem 1.2. Assume P ∈ {0, 1}Λ×I . If P has one block, then SMP(SP ) is in P by Lemma 3.5. Assume P does not have one block. Then there are i, j ∈ I and λ, µ ∈ Λ such that P (λ, i) = P (µ, j) = 1 and P (µ, i) = 0. Let r := [i, λ], s := [i, µ], and t := [j, µ]. Then rs = st = s, and s does not generate a group. By Theorem 1.1 SMP(SP ) is NP-hard. NP-easiness follows from Lemma 3.4.  Proof of Corollary 1.3. The result is immediate from Theorem 1.2.  Next we restate the Rees Theorem (see [3, Theorem 3.2.3]) for the case of finite combinatorial 0-simple semigroups: Theorem 3.6 (Rees Theorem). Let P be a finite 0-1 matrix such that each row and each column has at least one 1. Then SP is a finite combinatorial 0-simple semigroup. Conversely, every finite combinatorial 0-simple semigroup is isomorphic to one constructed in this way. Proof. See [3].  Lemma 3.7. Let SP be a finite combinatorial 0-simple semigroup. Then the matrix P has one block if and only if SP has no zero divisors, i.e. for s, t ∈ SP , st = 0 implies that s = 0 or t = 0. Proof. Assume P ∈ {0, 1}Λ×I . If P has one block, then all entries of P are 1. Thus SP has no zero divisors. If P does not have one block, then P (λ, i) = 0 for some λ ∈ Λ, i ∈ I. Now [i, λ] is a zero divisor since [i, λ]2 = 0.  Corollary 3.8. If a finite combinatorial 0-simple semigroup S has no zero divisors, then SMP(S) is in P. Otherwise SMP(S) is NP-complete. Proof. The result is immediate from Theorem 1.2 and Lemma 3.7.  4. Semigroups with PSPACE-complete SMP In [1] an upper bound on the complexity of the SMP for semigroups was established: Theorem 4.1 ([1, Theorem 2.1]). The SMP for a finite semigroup is in PSPACE. Proof. Let S be a finite semigroup. We show that (7) SMP(S) is in nondeterministic linear space. To this end, let A ⊆ S n , b ∈ S n be an instance of SMP(S). If b ∈ hAi, then there exist a1 , . . . , am ∈ A such that b = a1 · · · am . ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 9 Now we pick the first generator a1 ∈ A nondeterministically and start with c := a1 . Pick the next generator a ∈ A nondeterministically, compute c := c · a, and repeat until we obtain c = b. Clearly all computations can be done in space linear in |A|n. This proves (7). By a result of Savitch [8] this implies that SMP(S) is in deterministic quadratic space.  In [1] it was shown that the SMP for the full transformation semigroup on 5 letters is PSPACE-complete by reducing Q3SAT to SMP(T5 ). We adapt the proof of this result and show that under the following conditions the SMP for a semigroup is PSPACE-complete. Lemma 4.2. Let S be a finite semigroup and s, t, 1 ∈ S such that (a) sts = s, tst = t, (b) s2 , t2 <J s, (c) s1 = s and t1 = t. Then SMP(S) is PSPACE-complete. Proof. From item (a) we know that s, t, st, ts are in the same J -class. Observe that s 6= st; otherwise s2 = sts = s, which is impossible. We consider s and st as states and let 1, s, t, st, ts act on these states by multiplication on the right. This yields the partial multiplication table t st ts S 1 s s s ∞ st ∞ s st st s ∞ st ∞ (8) where ∞ means that this entry is <J s. SMP(S) is in PSPACE by Theorem 4.1. For PSPACE-hardness we reduce Q3SAT to SMP(S). Q3SAT is PSPACE-complete [7] and can be defined as follows. Q3SAT Input: triples C1 , . . . , Cm over {x1 , . . . , xn , ¬x1 , . . . , ¬xn , y1 , . . . , yn , ¬y1 , . . . , ¬yn } Problem: Is the Boolean formula W W Φ := ∀x1 ∃y1 . . . ∀xn ∃yn ( C1 ) ∧ . . . ∧ ( Cm ) true? Let C1 , . . . , Cm be a Q3SAT instance and Φ be the corresponding Boolean formula. We refer to x1 , . . . , xn as universal variables, to y1 , . . . , yn as existential variables, and to C1 , . . . , Cm as clauses. We define the corresponding SMP(S) instance G ⊆ S 3n+m+1 , f ∈ S 3n+m+1 where G := {a} ∪ B ∪ C ∪ D ∪ E, B := {b1 , . . . , bn }, C := {ckj | j ∈ [m], k ∈ {+, −, 0}}, D := {djk | j ∈ [m], k ∈ [3]}, E := {e1 , . . . , en }. 10 MARKUS STEINDL The coordinates of these tuples will have the following meaning. The first n positions encode truth values assigned to x1 , . . . , xn , and the second n positions truth values assigned to y1 , . . . , yn . Truth values are represented by 0 := s and 1 := st. The positions 2n + 1 to 3n control the order in which the given tuples are multiplied. The m positions after that indicate the status of W the clauses C1 , . . . , Cm . In particular, for i ∈ [m] position 3n + i encodes whether Ci is satisfied by the assignment given by the first 2n positions. We encode “unsatisfied” by s, and “satisfied” by st. The last position ensures that the first generator of the target tuple f is the tuple a. The generators are explicitly given as follows. For an overview see Figure 1. • We define our target tuple f by f (i) := st for i ∈ [3n + m], f (3n + m + 1) := s. • The tuple a will be the first generator of f . It encodes the all-zero assignment for the variables x1 , . . . , xn , y1 , . . . , yn . Let a(i) := s for i ∈ [3n + m + 1]. The idea is that a is multiplied only on the right by elements of G. The components of this product are the states s and st. Each multiplication on the right modifies the states according to the multiplication table (8). • For j ∈ [n] let bj change the assignment for the universal variables from (x1 , . . . , xj−1 , 0, 1, . . . , 1) to (x1 , . . . , xj−1 , 1, 0, . . . , 0). For j ∈ [n] define   1 bj (i) := t   s ( st bj (2n + i) := s if i ∈ [j − 1] or n + 1 ≤ i ≤ 2n, if i = j, if j < i ≤ n, if i ∈ [j − 1], if j ≤ i ≤ m + n, bj (3n + m + 1) := ts. − • For j ∈ [n] let c+ j and cj change the assignment for the existential variable yj from 0 to 1 and from 1 to 0, respectively. Let c0j leave the variables unchanged. For j ∈ [n] and i ∈ [3n + m + 1] let   t if i = 2n + j, 0 cj (i) := st if i = 3n + m + 1,   1 otherwise. − 0 The tuples c+ j and cj differ from cj only in the following positions: c+ j (n + j) := t, c− j (n + j) := s. ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 11 • For j ∈ [m] and k ∈ [3] the tuple djk evaluates the kth literal Cjk of the jth clause. If this literal is satisfied by the assignment encoded in the first 2n components, then multiplying by djk changes the status of the clause Cj to “satisfied”. This will be more formally stated in Claim 4.3. For i ∈ [n] define   st if Cjk = xi , djk (i) := ts if Cjk = ¬xi ,   1 otherwise,   st if Cjk = yi , djk (n + i) := ts if Cjk = ¬yi ,   1 otherwise, djk (2n + i) := st. For i ∈ [m] let djk (3n + i) := ( t 1 if i = j, otherwise, djk (3n + m + 1) := ts. • Let j ∈ [n]. After each assignment was succesfully evaluated, the tuple ej sets position n + j to st in order to match the target tuple if necessary. We define ej (i) := st, for i ∈ [n], ( t if i = j, ej (n + i) := 1 if i ∈ [2n] \ {j}, ej (3n + i) := st for i ∈ [m], ej (3n + m + 1) := ts. The tuples e1 , . . . , en will only occur as final generators of f . Now we state what we already mentioned in the definition of djk . Claim 4.3. Let h ∈ hGi such that h(i) ∈ {s, st} for all i ∈ [2n], h(2n + i) = st for all i ∈ [n], h(3n + j) = s for some j ∈ [m], h(3n + m + 1) = s. Let ρ : {x1 , . . . , xn , y1 , . . . , yn } → {0, 1} be the assignment encoded by h|[2n] , i.e. ρ(xi ) := h(i) for i ∈ [n], ρ(yi ) := h(n + i) for i ∈ [n]. Let k ∈ [3], Cjk be the kth literal of the jth clause, and h′ := hdjk . (a) If ρ(Cjk ) = 1, then h and h′ differ only in the following position: h′ (3n + j) = st. (b) Otherwise h′ (i) <J s for some i ∈ [2n]. 12 MARKUS STEINDL a = ( s ··· b1 = ( t .. ( . bn = ( s .. . s s ··· s s s t c+ 1 =( .. ( . + cn = ( t c− 1 =( .. ( . − cn = ( s .. e1 = ( .. ( . en = ( s s ··· s s ··· st . . . st st s .. . s ··· .. . . . . s ··· s ts ) .. .. . . ) s ts ) t . .. .. t . .. ∗ ··· .. . . . . ∗ ··· ∗ .. . ∗ st · · · st .. . . . . .. . st · · · st ∗ ··· .. . . . . ∗ ··· t .. .. s ) t ts ) .. . ) ts ) t ts ) .. . ) ts ) t ts ) .. . ) ts ) . s t s . t c01 = ( .. ( . c0n = ( d1k = ( .. ( . dmk = ( s ··· . ∗ st · · · st . .. .. . . . .. . . ∗ st · · · st t .. . t ts ) .. . ) ts ) st · · · st ts ) .. . . . . . .. .. ) . st · · · st ts ) . t f = ( st · · · st st · · · st st · · · st st · · · st s ) | {z } | {z } | {z } | {z } n n n m Figure 1. Generators and target tuple of the SMP(T ) instance for k ∈ [3]. Empty positions encode the element 1, and the symbol “∗” indicates that this entry depends on the Q3SAT instance. Proof. The literal Cjk is of the form z or ¬z for some variable z. Let ℓ ∈ [2n] be the position of z in (x1 , . . . , xn , y1 , . . . , yn ). First assume Cjk is of the form z. Then djk (ℓ) = st. (a) Assume ρ(Cjk ) = 1. This means h(ℓ) = st. Thus h′ (ℓ) = st · st = st = h(ℓ), and h′ (3n + j) = s · t = st. It is easy to see that h(i) = h′ (i) for the remaining positions i ∈ [3n + m + 1] \ {ℓ, 3n + j}. (b) Assume ρ(Cjk ) = 0. This means h(ℓ) = s. Thus h′ (ℓ) = s · st <J s, and (b) is proved.  If Cjk is of the form ¬z, then (a) and (b) are proved in a similar way. Note that if ρ satisfies Cjk , then multiplying h by djk changes the status of the jth clause from “unsatisfied” to “satisfied”. Otherwise the target tuple f cannot be reached by further multiplying hdjk with elements of G. In the remainder of the proof we show the following. ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 13 Claim 4.4. Φ holds if and only if f ∈ hGi. (⇒) direction of Claim 4.4. Assume Φ is true. This means that for every i ∈ [n] there is a function ψi : {0, 1}i → {0, 1} such that for every assignment ϕ : {x1 , . . . , xn } → {0, 1} the assignment ρϕ := ϕ ∪ {yi 7→ ψi (ϕ(x1 ), . . . , ϕ(xi )) | i ∈ [n]} satisfies all the clauses C1 , . . . , Cm . We prove by induction on assignments ϕ in lexicographic order that for each ϕ the following tuple gϕ belongs to hGi: gϕ (i) := ϕ(xi ) for i ∈ [n], gϕ (n + i) := ρϕ (yi ) for i ∈ [n], gϕ (2n + i) := st for i ∈ [n + m], gϕ (3n + m + 1) := s. For the base case let ϕ(xi ) := 0 for all i ∈ [n]. For i ∈ [n] we define ( c+ if ρϕ (yi ) = 1, ′ i ci := 0 ci otherwise. Apparently a · c′1 · · · c′n |[2n] encodes ρϕ . For each j ∈ [m] there is a kj ∈ [3] such that the literal Cjkj is satisfied by ρϕ . By Claim 4.3 (a) it is straightforward to verify that gϕ = a · c′1 · · · c′n · d1k1 · · · dmkm . Now let ϕ be an assignment with successor ϕ′ in lexicographical order such that gϕ ∈ hGi. Let j ∈ [n] be maximal such that ϕ(xj ) = 0. Then ϕ(xi ) = ϕ′ (xi ) for i < j, ′ ϕ(xj ) = 0, ϕ (xj ) = 1, ϕ(xi ) = 1, ϕ′ (xi ) = 0 To adjust the assignment for the  +   ci c′i := c− i   0 ci for j < i ≤ n. existential variables, for j ≤ i ≤ n set if ρϕ (yi ) = 0, ρϕ′ (yi ) = 1, if ρϕ (yi ) = 1, ρϕ′ (yi ) = 0, otherwise. For h := gϕ · bj · c′j · · · c′n we have h(i) = ϕ′ (xi ) for i ∈ [n], h(n + i) = ρ (yi ) for i ∈ [n], ϕ′ h(2n + i) = st for i ∈ [n], h(3n + i) = s for i ∈ [m + 1]. For each j ∈ [m] the clause Cj is satisfied by ρϕ′ . Thus there is a kj ∈ [3] such that ρϕ′ satisfies the literal Cjkj . From Claim 4.3 (a) follows that gϕ′ = h · d1k1 · · · dmkm . This completes the induction argument. 14 MARKUS STEINDL Finally let ϕ be such that ϕ(xi ) = 1 for all i ∈ [n], and gϕ as defined above. Denote the positions i ∈ [n] where gϕ (n + i) = s by i1 , . . . , ip . Then we have f = gϕ · ei1 · · · eip . Thus f ∈ hGi. The (⇒) direction of Claim 4.4 is proved. We give another description of the product that yields f . For each assignment ϕ 6= 0 for x1 , . . . , xn let jϕ := max{j ∈ [n] | ϕ(xj ) = 1}. From our argument above we see that f is of the form Y (9) f = ac∗1 · · · c∗n d1† · · · dm† · ( bjϕ c∗jϕ · · · c∗n d1† · · · dm† ) · ei1 · · · eip , ϕ6=0 where i1 , . . . , ip ∈ [n] are distinct, each ∗ belongs to {+, −, 0}, and each † to [3]. The product is taken over all assignments ϕ 6= 0 to x1 , . . . , xn in lexicographical order. (⇐) direction of Claim 4.4. Assume f ∈ hGi. Let k ∈ N be minimal such that f = u1 · · · uk for some u1 , . . . , uk ∈ G, and let vi := u1 · · · ui for i ∈ [k]. Claim (a) (b) (c) 4.5. Let i ∈ {2, . . . , k} and j ∈ [3n + m + 1]. Then u1 = a and ui 6= a, vi (j) ∈ {s, st}. If ui (j) ∈ {1, st, ts}, then vi (j) = vi−1 (j). Proof. (a) If ui = a, then ui−1 ui (3n + m + 1) ∈ {ts2 , s2 }, which yields the contadiction vk (3n + m + 1) <J s. If u1 6= a, then we obtain the contradiction vk (3n + m + 1) = ts. (b) We use induction on i. By (a) we have v1 = a. Thus v1 (j) ∈ {s, st}. Now assume vi−1 (j) ∈ {s, st}. Since ui (j) ∈ {1, s, st, t, ts}, either vi (j) ∈ {s, st}, or a factor s2 or t2 occurs in vi (j). As s2 , t2 <J f (j), the first case applies. (c) is immediate from item (b) and the multiplication table (8).  The next claim states that the product u1 · · · uk is of a similar form to the one given in (9). Claim 4.6. Let i ∈ [k]. Let either j ∈ [n] and ui = bj , or j = 1 and ui = a. Then for i1 := i + n − j + 1 and i2 := i1 + m the following holds: p (a) {ui+1 , . . . , ui1 } = {cj j , . . . , cpnn } for some p1 , . . . , pm ∈ {+, −, 0}. (b) {ui1 +1 , . . . , ui2 } = {d1k1 , . . . , dmkm } for some k1 , . . . , km ∈ [3]. (c) If there is a greatest j ′ ∈ [n] such that vi (j ′ ) = s, then ui2 +1 = bj ′ ; (d) otherwise ui2 +1 , . . . , uk are distinct and form the set {eℓ | ℓ ∈ [n], vi2 (n + ℓ) = s}. Proof. First let j ∈ [n] and ui = bj . (a) From Claim 4.5 we know that i ≥ 2 and that every coordinate of vi−1 is either s or st. From the definition of bj and the multiplication table (8) we know that ( st for ℓ ∈ [j − 1], vi (2n + ℓ) = s for ℓ ∈ {j, . . . , n}. Thus the only choice for the n − j + 1 generators subsequent to ui is given by p cj j , . . . , cpnn for some pj , . . . , pn ∈ {+, −, 0}, where the order does not matter; otherwise we would obtain a factor s2 or t2 in a position 2n + ℓ for some ℓ ∈ [n + m], which is impossible. ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 15 (b) From (a) we know that vi1 (2n + ℓ) = st for ℓ ∈ [n], vi1 (3n + ℓ) = s for ℓ ∈ [m]. Thus the m generators subsequent to ui1 are given by d1k1 , . . . , dmkm for some k1 , . . . , km ∈ [3] where the order does not matter; otherwise we would obtain a factor t2 in vk (2n + ℓ) for some ℓ ∈ [n], or s2 in vk (3n + ℓ) for some ℓ ∈ [m]. Both cases contradict the fact that vk = f . (c) Let j ′ ∈ [n] be maximal such that vi (j ′ ) = s. From (a) and (b) we know that vi2 (j ′ ) = s and vi2 (2n + ℓ) = st for ℓ ∈ [n + m]. If ui2 +1 ∈ E, then vi2 +1 (j ′ ) = s2 t. If ui2 +1 ∈ C ∪ D, then vi2 +1 (2n + ℓ) = st2 for some ℓ ∈ [n + m]. Thus ui2 +1 = bℓ for some ℓ ∈ [n]. If ℓ < j ′ , then vi2 +1 (j ′ ) = s2 . If ℓ > j ′ , then vi2 +1 (ℓ) = st2 . Therefore ℓ = j ′ . (d) Assume vi (ℓ) = st for all ℓ ∈ [n]. Suppose some generator among ui2 +1 , . . . , uk belongs to B. Let i3 ∈ {i2 + 1, . . . , k} be minimal such that ui3 ∈ B. By (a), (b), and Claim 4.5 (c) we have vi |[n] = . . . = vi3 −1 |[n] . 2 / B. Thus vi3 (ℓ) = st for some ℓ ∈ [n], which is impossible. Hence ui2 +1 , . . . , uk ∈ This together with (a) and (b) implies vi2 (2n + ℓ) = . . . = vk (2n + ℓ) = st for all ℓ ∈ [n + m]. Thus ui2 +1 , . . . , uk ∈ / C ∪ D. Otherwise we would have a factor t2 in vk (n + ℓ). So ui2 +1 , . . . , uk ∈ E. If ui2 +1 , . . . , uk were not distinct, then we had a factor t2 in vk (n + ℓ) for some ℓ ∈ [n]. Finally observe that for each ℓ ∈ [n] with vi2 (n + ℓ) = s we have eℓ ∈ {ui2 +1 , . . . , uk }; otherwise vk (n + ℓ) = s which is impossible. We proved (d). For j = 1 and ui = a, items (a) to (d) are proved in a similar manner.  In the following we define assignments to the variables using the first 2n positions of the tuples v1 , . . . , vk . For i ∈ [k] and j ∈ [n] let ϕi : {x1 , . . . , xn } → {0, 1}, ϕi (xj ) := vi (j), θi : {y1 , . . . , yn } → {0, 1}, θi (yj ) := vi (n + j). These assignments fulfill the following conditions. Claim 4.7. (a) For i ∈ [k − 1] we have ϕi 6= ϕi+1 if and only if ui+1 ∈ B. (b) ϕ1 , . . . , ϕk is a list of all assignments for x1 , . . . , xn (possibly with repetitions) in lexicographic order. (c) Let i ∈ [k − 1] such that ui ∈ D and ui+1 ∈ / D. Then ϕi ∪ θi satisfies all the clauses C1 , . . . , Cm . Proof. (a) follows from the definitions of the generators, Claim 4.5 (c), and Claim 4.6. (b) Let i ∈ [k − 1] such that ϕi 6= ϕi+1 . By (a) and Claim 4.6 ui+1 = bj for the greatest j ∈ [n] for which ϕi (xj ) = 0. It is easy to see that ϕi+1 (xℓ ) = ϕi (xℓ ) for ℓ < j, ϕi+1 (xj ) = 1, and ϕi+1 (xℓ ) = 0 for ℓ > j. Thus ϕi+1 is the successor of ϕi in lexicographic order. By Claim 4.5 (a) ϕ1 is the all-zero assignment for x1 , . . . , xn . 16 MARKUS STEINDL Since vk (i) = st for all i ∈ [n], ϕk is the all-one assignment. Hence ϕ1 , . . . , ϕk is a list of all assignments. (c) By Claim 4.6 {ui−m+1 , . . . , ui } = {d1k1 , . . . , dmkm } for some k1 , . . . , km ∈ [3]. Thus ϕi−m ∪ θi−m = . . . = ϕi ∪ θi . Suppose ϕi ∪ θi does not satisfy some clause Cj for j ∈ [m]. Then its kth literal Cjkj is also unsatisfied. Claim 4.3 (b) implies vi (ℓ) <J s for some ℓ ∈ [2n], which is impossible.  For ϕ : {x1 , . . . , xn } → {0, 1} let iϕ := max{i ∈ [k] | ϕi = ϕ, ui ∈ D}. From Claim 4.7 we know that for every assignment ϕ to x1 , . . . , xn the assignment ϕ ∪ θiϕ satisfies all the clauses of Φ. It only remains to prove that θiϕ (yi ) only depends on ϕ(x1 ), . . . , ϕ(xi ). Claim 4.8. Let i ∈ [n]. For all ϕ, χ : {x1 , . . . , xn } → {0, 1} the equations (10) ϕ(x1 ) = χ(x1 ), . . . , ϕ(xi ) = χ(xi ) imply θiϕ (yi ) = θiχ (yi ). Proof. We consider ϕ as fixed and prove the implication for all χ ≥ ϕ by induction in lexicographical order. The base case χ = ϕ is clear. Now let χ ≥ ϕ be an assignment for which the implication holds, and assume its successor χ′ fulfills (10). Since ϕ ≤ χ < χ′ , the assignment χ also fulfills (10). From Claim 4.6 we know that (11) p {uiχ +1 , . . . , uiχ′ } = {bj , cj j , . . . , cpnn , d1k1 , . . . , dmkm } for some j ∈ [n], pj , . . . , pn ∈ {+, −, 0}, and k1 , . . . , km ∈ [3]. If j ≤ i was true, then χ′ would not fulfill (10). Thus j > i. From (11) follows viχ′ (n+ i) = viχ (n+ i). Thus θiχ′ (yi ) = θiχ (yi ) = θiϕ (yi ), and Claim 4.8 is proved.  We complete the proof of Claim 4.4. By Claims 4.7 and 4.8, for each assignment ϕ for the universal variables there is an assignment θiϕ for the existential variables such that ϕ ∪ θiϕ satisfies the conjunctive normal form in Φ. For all i ∈ [n] the value θiϕ (yi ) depends only on ϕ(x1 ), . . . , ϕ(xi ). Thus Φ is true. Claim 4.4 and Lemma 4.2 are proved.  Proof of Theorem 1.4. Let s′ := (s, tst), t′ := (tst, s), and 1′ := (1, 1) be elements of S 2 := S × S. Apparently s′ t′ s′ = s′ and t′ s′ t′ = t′ . Both s′ and t′ do not generate groups. By Lemma 2.1 s′2 <J s′ and t′2 <J t′ . Since t′ J s′ , we have t′2 <J s′ . Now s′ , t′ , 1′ fulfill the hypothesis of Lemma 4.2. Thus SMP(S 2 ) is PSPACE-complete. As SMP(S 2 ) reduces to SMP(S) and conversely, the result follows.  Now we are able to list several “naturally occuring” semigroups with PSPACEcomplete SMP: Corollary 4.9. The SMP for the following semigroups is PSPACE-complete: (a) the Brandt monoid B21 and the monoid A12 ; (b) for n ≥ 2 and a finite ring R with identity 1 6= 0, the semigroup of all n × n matrices over R; (c) the full transformation semigroup Tn on n ≥ 3 letters; (d) the symmetric inverse semigroup In on n ≥ 2 letters. ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 17 Proof. We apply Theorem 1.4. (a) For B21 let s := [1, 2] and t := [2, 1]. For A12 let s := [2, 2] and t := [1, 1]. (b) Define n × n matrices s, t over R by ( ( 1 if (i, j) = (1, 2), 1 if (i, j) = (2, 1), sij := tij := 0 otherwise, 0 otherwise for i, j ∈ [n]. Let 1 be the identity matrix. (c) Let 1 be the identity mapping on [n], and s, t : [n] → [n], ( ( 2 if x = 1, 1 if x = 2, s(x) := t(x) := 3 otherwise, 3 otherwise. (d) Let 1 be the identity mapping, s : 1 7→ 2, and t : 2 7→ 1.  For monoids we can now generalize Corollary 2.3: Corollary 4.10. If a J -class of a finite monoid S contains both group and nongroup H-classes, then SMP(S) is PSPACE-complete. Proof. Let S be as above. Similar to the proof of Corollary 2.3, there is a t ∈ S such that sts = s. Now s, t, and the identity fulfill the hypothesis of Theorem 1.4.  5. Proof of Theorem 1.6 Lemma 5.1. If the 0-1 matrix P of a finite combinatorial Rees matrix semigroup SP has one block, then SMP(SP1 ) is in NP. Proof. Assume P ∈ {0, 1}Λ×I , and let J ⊆ I and ∆ ⊆ Λ such that P (λ, i) = 1 if and only if (λ, i) ∈ ∆ × J for i ∈ I, λ ∈ Λ. Let T := SP1 and A ⊆ T n , b ∈ T n be an instance of SMP(T ) such that b ∈ hAi. Let a1 , . . . , ak ∈ A such that b = a1 · · · ak . If b = (1, . . . , 1) or k = 1, then clearly b ∈ A. In this case the position of b in the list A is a witness. Assume b 6= (1, . . . , 1) and k ≥ 2. We claim that for i ∈ [n] with b(i) = 0 there are ℓi , ri ∈ [k], ℓi < ri such that (12) aℓi ari (i) = 0 and aℓi +1 (i) = . . . = ari −1 (i) = 1. This follows from Lemma 3.1 (a). For i ∈ [n] with b(i) ∈ I × Λ let ℓi := min{j ∈ [k] | aj (i) 6= 1}, ri := max{j ∈ [k] | aj (i) 6= 1}. Now define an index set N ⊆ [k] by N := {ℓi | i ∈ [n], b(i) 6= 1} ∪ {ri | i ∈ [n], b(i) 6= 1}. Note that N 6= ∅; otherwise b = (1, . . . , 1) which contradicts our assumption. For i ∈ [n] we claim that Y (13) aj (i) = b(i), j∈N where the indexes j of the factors are in ascending order. If b(i) = 1, then aj (i) = 1 for all j ∈ [k], and (13) follows. Assume b(i) = 0. We have ℓi , ri ∈ N . By (12) all factors in (13) between aℓi (i) and ari (i) are equal to 1. This and (12) imply 18 MARKUS STEINDL (13). Finally assume b(i) ∈ I × Λ. For ℓi < j < ri we have aj (i) ∈ {1} ∪ (J × ∆); otherwise we obtain the contradiction b(i) = 0. Thus Y Y aj (i) = aj (i). j∈N ℓi ≤j≤ri ℓi ≤j≤ri Since aj (i) = 1 for j < ℓi and j > ri , (13) follows. The length of the product in (13) is |N | and thus at most 2n. Thus this product is a valid witness for b ∈ hAi, and the lemma is proved.  Proof of Theorem 1.6. Assume P ∈ {0, 1}Λ×I . (a) If P is the all-1 matrix, then SP1 is a band (idempotent semigroup) with J -classes {0}, I × Λ, and {1}. We show that SP1 is a regular band, that is, SP1 satisfies the identity (14) xyxzx = xyzx. SP1 . Let x, y, z ∈ If one of the variables is 0 or 1, then (14) clearly holds. If x, y, z ∈ I × Λ, then xyxzx = x = xyzx by the definition of the multiplication. Thus SP1 is a regular band. By [10, Corollary 1.7] the SMP for every regular band is in P. (b) Assume P has one block and some entries are 0. Let i ∈ I and λ ∈ Λ such that P (λ, i) = 0. Let s := [i, λ] and r := t := 1. Since s does not generate a group, SMP(SP1 ) is NP-hard by Theorem 1.1. NP-easiness follows from Lemma 5.1. (c) In this case P does not have one block. Thus there are i, j ∈ I and λ, µ ∈ Λ such that P (λ, i) = P (µ, j) = 1 and P (λ, j) = 0. Let s := [j, λ] and t := [i, µ]. Then s does not generate a group, sts = s, s1 = s, and t1 = t. By Theorem 1.4 SMP(S) is PSPACE-complete.  6. Conclusion In Section 3 we established a P/NP-complete dichotomy for combinatorial Rees matrix semigroups. The next goal is to investigate the complexity for the more general case of Rees matrix semigroups. For Rees matrix semigroups without 0 a polynomial time algorithm for the SMP is known [11]. However, the following questions are open: Problem 6.1. Is the SMP for finite Rees matrix semigroups (with 0) in NP? In particular, is there a P/NP-complete dichotomy? In Section 4 we saw the first example of a semigroup with NP-complete SMP where adjoining an identity results in a PSPACE-complete SMP. This leads to the following question: Problem 6.2. How hard is the SMP for finite Rees matrix semigroups with adjoined identity? The answer is not even known for the completely regular case. E.g. the complexity for the following 9-element semigroup is open: Problem 6.3. Let 1, c be the elements of the cyclic group Z2 such that c2 = 1, and define a Rees matrix semigroup S := M(Z2 , [2], [2], ( 11 1c )). How hard is SMP(S 1 )? ON SEMIGROUPS WITH PSPACE-COMPLETE SMP 19 References [1] A. Bulatov, P. Mayr, and M. Steindl. The subpower membership problem for semigroups, submitted. Available at http://arxiv.org/pdf/1603.09333v1.pdf. [2] S. A. Cook. Characterizations of pushdown machines in terms of time-bounded computers. J. Assoc. Comput. Mach., 18:4–18, 1971. [3] J. M. Howie. Fundamentals of semigroup theory, volume 12 of London Mathematical Society Monographs. New Series. The Clarendon Press, Oxford University Press, New York, 1995. Oxford Science Publications. [4] P. Idziak, P. Marković, R. McKenzie, M. Valeriote, and R. Willard. Tractability and learnability arising from algebras with few subpowers. SIAM J. Comput., 39(7):3023–3037, 2010. [5] M. Kozik. A finite set of functions with an EXPTIME-complete composition problem. Theoretical Computer Science, 407(1–3):330–341, 2008. [6] P. Mayr. The subpower membership problem for Mal’cev algebras. Internat. J. Algebra Comput., 22(7):1250075, 23, 2012. [7] C. H. Papadimitriou. Computational complexity. Addison-Wesley Publishing Company, Reading, MA, 1994. [8] W. J. Savitch. Relationships between nondeterministic and deterministic tape complexities. J. Comput. System. Sci., 4:177–192, 1970. [9] S. Seif and C. Szabó. Computational complexity of checking identities in 0-simple semigroups and matrix semigroups over finite fields. Semigroup Forum, 72(2):207–222, 2006. [10] M. Steindl. The subpower membership problem for bands, submitted. Available at http://arxiv.org/pdf/1604.01014v1.pdf. [11] M. Steindl. Computational Complexity of the Subpower Membership Problem for Semigroups. PhD thesis, Johannes Kepler University Linz, Austria, 2015. Available at http://epub.jku.at/obvulihs/download/pdf/893649?originalFilename=true. [12] R. Willard. Four unsolved problems in congruence permutable varieties. Talk at International Conference on Order, Algebra, and Logics, Vanderbilt University, Nashville, June 12–16, 2007. Institute for Algebra, Johannes Kepler University Linz, Altenberger St 69, 4040 Linz, Austria Department of Mathematics, University of Colorado Boulder, Campus Box 395, Boulder, Colorado 80309-0395 E-mail address: [email protected]
4math.GR
1 Ultra-Reliable and Low Latency Communication in mmWave-Enabled Massive MIMO Networks Trung Kien Vu, Student Member, IEEE, Chen-Feng Liu, Student Member, IEEE, Mehdi Bennis, Senior Member, IEEE, Mérouane Debbah, Fellow, IEEE, Matti Latva-aho, Senior Member, IEEE, and Choong Seon Hong, Senior Member, IEEE arXiv:1705.06907v1 [cs.IT] 19 May 2017 Abstract—Ultra-reliability and low-latency are two key components in 5G networks. In this letter, we investigate the problem of ultra-reliable and low-latency communication (URLLC) in millimeter wave (mmWave)-enabled massive multiple-input multipleoutput (MIMO) networks. The problem is cast as a network utility maximization subject to probabilistic latency and reliability constraints. To solve this problem, we resort to the Lyapunov technique whereby a utility-delay control approach is proposed, which adapts to channel variations and queue dynamics. Numerical results demonstrate that our proposed approach ensures reliable communication with a guaranteed probability of 99.99%, and reduces latency by 28.41% and 77.11% as compared to baselines with and without probabilistic latency constraints, respectively. Index Terms—5G, massive MIMO, mmWave, ultra-reliable low latency communications (URLLC). I. I NTRODUCTION C URRENTLY, millimeter wave (mmWave) and massive multiple-input multiple-output (MIMO) techniques are investigated to provide reliable communication with an overthe-air latency of few milliseconds and extreme throughput [1]. While massive MIMO with large degrees of freedom provides high energy and spectral efficiency [2], mmWave frequency bands provide large bandwidth [3]. In addition, due to the short wavelength of mmWaves, large antenna array can be packed into highly directional beamforming, which makes massive MIMO practically feasible [4]. Thus far, most of existing works on mmWave-enabled massive MIMO systems focus mainly on providing capacity improvement [4], while latency and reliability are not addressed. Although latency and reliability are applicable to many scenarios (e.g. mission-critical applications), in this work, we are interested in the integration of mmWave communication and massive MIMO techniques, which holds the promise of providing great enhancements of the overall system performance [1], [2], [4]. Specifically, this letter is concerned with addressing the fundamental question in mmWave-enabled massive MIMO systems: “how to simultaneously provide order of magnitude capacity improvements and latency reduction?” Manuscript received March 24, 2017; revised May 05, 2017; accepted May 12, 2017. Date of publication May 17, 2017; This work was supported in part by the Finnish Funding Agency for Technology and Innovation (Tekes), Nokia, Huawei, Anite, in part by the Academy of Finland CARMA project, in part by the Academy of Finland funding through the grant 284704, and in part by the ERC Starting Grant 305123 MORE (Advanced Mathematical Tools for Complex Network Engineering). T. K. Vu, C.-F. Liu, M. Bennis, and M. Latva-aho are with the Centre for Wireless Communications, University of Oulu, Oulu 90014, Finland (e-mail: [email protected]; [email protected]; [email protected]; [email protected]). M. Debbah is with the Large Networks and System Group (LANEAS), CentraleSupélec, Université Paris-Saclay, Gif-sur-Yvette, France and is with the Mathematical and Algorithmic Sciences Laboratory, Huawei France R&D, Paris, France (e-mail: [email protected]). C. S. Hong is with the Department of Computer Engineering, Kyung Hee University, Yongin 446-701, South Korea (email: [email protected]). Citation information: DOI 10.1109/LCOMM.2017.2705148, IEEE Communications Letters By invoking the Lyapunov optimization framework, an utilityoptimal solution is obtained to maximize network throughput subject to queuing stability [5]. This solution establishes a utility-delay tradeoff, which achieves utility-optimality at the price of large queuing delays [5]. To cope with this shortcoming, in this letter the Lyapunov framework is extended to incorporate probabilistic latency and reliability constraints, which takes into account queue length, arrival rate, and channel variations with a guaranteed probability. To do so, the problem is formulated as a network utility maximization (NUM). By applying the drift-plus-penalty technique, the problem is decoupled into a dynamic latency control and rate allocation. Here, the latency control problem is a difference of convex (DC) programming problem, which is solved efficiently by the convex-concave procedure (CCP) [6]. Finally, a performance evaluation is carried out to show the latency reduction and the tradeoff between reliability, traffic intensity, and user density. II. S YSTEM M ODEL Consider the downlink (DL) transmission of a single cell massive MIMO system1 consisting of one macro base station (MBS) equipped with N antennas, and a set, M = {1, . . . , M }, of single-antenna user equipments (UEs). We assume that N ≥ M and N ≫ 1. Further, the co-channel time-division duplexing (TDD) is considered in which the MBS estimates channels via the uplink phase. We denote the propagation chan√ 1/2 nel between the MBS and the mth UE as hm = N Θm h̃m , where Θm ∈ CN ×N depicts the antenna spatial correlation, and the elements of h̃m ∈ CN ×1 are independent and identically distributed (i.i.d.) with zero mean and variance 1/N . In addition, channels experience flat and block fading, and imperfect channel state information (CSI) is assumed. As per [9], the estimated channel can be modeled as ĥm = p √ 1/2 N ×1 2h +τ 1 − τm m m N Θm zm , ∀ m ∈ M. Here, zm ∈ C denotes the estimated noise vector which has i.i.d. elements with zero mean and variance 1/N , and τm ∈ [0, 1] reflects the estimation accuracy; in case of perfect CSI, τm = 0. Given the estimated channel matrix Ĥ = [ĥ1 , · · · , ĥM ] ∈ CN ×M , the MBS utilizes the regularized zero-forcing2 (RZF) precoder with the precoding matrix, V = [v1 , · · · , vM ] ∈ CN ×M , −1 † Ĥ . Note that which is given by V = Ĥ† Ĥ + N αIN vm is the precoding vector for UE m. In V, † denotes the conjugate transpose, and the regularization parameter α > 0 is scaled by N to ensure the matrix Ĥ† Ĥ + N αIN is wellconditioned as N → ∞ [7]. Further, transmit power pm ≥ 0 is allocated to UE m. Denoting all allocated powers in the diagonal matrix P = diag(p1 , · · · , pM ), we have the constraint 1 Our model can be extended to multi-cell massive MIMO systems in which the problem of inter-cell interference can be addressed by designing a hierarchical precoder at the MBS [7], to mitigate both intra-cell and inter-cell interference, or by applying an interference coordination approach [8]. 2 Other hybrid beamforming designs are left for future works. 1089-7798 (c) 2016 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. 2  Tr PV† V ≤ P , with P the maximum transmit power of the MBS. With the aid of the results in [9, Theorem 1], the transmit power allocation constraint can be expressed as 1 N M P m=1 pm Ωm m ≤ P, and pm ≥ 0, ∀ m ∈ M, (1) where the parameter Ωm is the solution to Ωm = PM −1 Θm 1 1 . By designing the prem=1 α+Ωm + IN N Tr Θm N coding matrix V and transmit power P, the ergodic DL rate of UE m ∈ M is i h  p |h† v |2 (2) rm (P) = E log2 1 + 1+PM m m pm|h† v |2 . k=1,k6=m k m k Here, we invoke results from random matrix theory in order to get the deterministic equivalence for (2) [9]. In particular, as N ≥ M and N ≫ 1, for small α, the ergodic DL rate (2) almost surely converges to  a.s. 2 ) , ∀ m ∈ M, (3) rm (P) −−→ log2 1 + pm (1 − τm a.s. where −−→ denotes almost sure convergence [7], [9, Theorem 2]. Moreover, we assume that the MBS has queue buffers to store UE data [5]. In this regard, we first index the coherence time block by slot t ∈ Z+ . At the beginning of each slot t, the queue length for UE m is denoted by Qm (t) which evolves as follows: Qm (t + 1) = [Qm (t) − rm (t)]+ + am (t), ∀ m ∈ M, (4) where [x]+ , max{x, 0}, and am (t) is the data arrival rate of UE m. Further, we assume that am (t) is i.i.d. over time slots with mean arrival rate λm and upper bounded by amax [5]. m III. P ROBLEM F ORMULATION According to Little’s law PT [10], the average delay is proportional to limT →∞ T1 t=1 E[Qm (t)]/λm . Thus, we use Qm (t)/λm as a delay measure and enforce an allowable upper bound dth m . We further note that the delay (or queue length) bound violation is related to reliability. Thus, taking into account the latency and reliability requirements, we characterize the delay bound violation with a tolerable probability. Specifically, we impose a probabilistic constraint on the queue size length for UE m ∈ M as follows: n o Pr Qλmm(t) ≥ dth (5) m ≤ ǫm , ∀ t. In (5), dth m reflects the UE delay requirement. Here, ǫm ≪ 1 is the target probability for reliable communication. In order to reduce latency, the intuitive way is to send as many data as possible. However, this might over-allocate resources to UEs, i.e., rm (t) ≫ Qm (t). To handle this issue, max we enforce a maximum rate constraint rm for each UE m. On the other hand, we enforce the MBS to guarantee for all UEs a certain level of QoS, i.e., the minimum rate requirement min rm , ∀ m ∈ M. PM We define the network utility as m=1 ωm f (r̄m ) where the PT time average expected rate r̄m = limT →∞ T1 t=1 E[rm (t)] and the non-negative weight ωm for each UE m. Additionally, we assume that f (·) is a strictly concave, increasing, and twice continuously-differentiable function. Taking into account these constraints presented above yields the following network utility maximization: M P OP : max ωm f (r̄m ) (6a) P(t) subject to Our main problem involves a probabilistic constraint (5), which cannot be addressed tractably. To overcome this challenge, we apply Markov’s inequality [11] to linearize (5) such that E[Qm (t)] Pr Qλmm(t) ≥ dth m ≤ λm dth . Then, (5) is satisfied if m=1 min rm max ≤ rm (t) ≤ rm , ∀ m ∈ M, ∀ t, (6b) (1) and (5). E[Qm (t)] ≤ λm dth m ǫm , ∀ m ∈ M, ∀ t. (7) Thereafter, we consider (7) to represent the latency and reliability constraint. Assuming that {am (t)|∀ t ≥ 1} is aPPoisson art rival process [11], we have that E[Qm (t)] = tλm − τ =1 rm (τ ) which is plugged into (7). Subsequently, we obtain rm (t) ≥ tλm − λm dth m ǫm − t−1 P τ =1 rm (τ ), ∀ m ∈ M, ∀ t, (8) which represents the minimum rate requirement in slot t for UE m for reliable communication. Here, we transform the probabilistic latency and reliability constraint (5) into one linear constraint (8) of instantaneous rate requirements, which helps to analyse and optimize the URLLC problem. In particular, if the delay requirement/reliability constraint is looser (i.e., larger dth m or ǫm ), the instantaneous rate requirement is reduced. In contrast, if we have a tighter constraint for reliable communication or delay requirement, then the instantaneous rate requirement is higher. Combining (6b) and (8), we rewrite OP as follows: max P(t) subject to M P ωm f (r̄m ) m=1 0 rm (t) (9a) max ≤ rm (t) ≤ rm , ∀ m ∈ M, ∀ t, (9b) and (1), min 0 , tλm − λm dth (t) = max{rm with rm m ǫm − Pt−1 τ =1 rm (τ )}. IV. LYAPUNOV O PTIMIZATION F RAMEWORK To tackle (9), we resort to Lyapunov optimization techniques [5]. Firstly, for each DL rate rm (t), we introduce the auxiliary variable vector ϕ(t) = (ϕm (t)|∀ m ∈ M) that satisfies T   P 1 E ϕm (t) ≤ r̄m , ∀ m T T →∞ t=0 max ϕ0m (t) ≤ ϕm (t) ≤ rm , ∀ m ∈ M, ∀ t, ϕ̄m = lim ∈ M, (10) (11) Pt−1 min with ϕ0m (t) = max{rm , tλm − λm dth m ǫm − τ =1 ϕm (τ )}. Incorporating the auxiliary variables, (9) is equivalent to LP : max P(t),ϕ(t) subject to T P M P 1 ωm E[f (ϕm (t))] T T →∞ t=1 m=1 lim (1), (10), and (11). In order to ensure the inequality constraint (10), a virtual queue vector Y(t) = (Ym (t)|∀ m ∈ M) is introduced, where each element evolves according to Ym (t + 1) = [Ym (t) + ϕm (t) − rm (t)]+ , ∀ m ∈ M. (12) Subsequently, we express the conditional Lyapunov drift-pluspenalty for each time slot t as:  M h P 1 1 2 2 E 2 Ym (t + 1) − 2 Ym (t) m=1 i  − νm (t)wm f (ϕm (t)) Y(t) . (13) In (13), νm (t) is the control parameter which affects the utilityqueue length tradeoff. This control parameter is conventionally chosen to be static and identical for all UEs [5]. However, this setting does not hold for system dynamics (e.g., instantaneous data arrivals) and the diverse system configuration 3 (i.e., different delay and QoS requirements). Thus, we dynamically design these control parameters. From the analysis in the Lyapunov optimization framework [5], we can find with πm being the largest firstYm (t) ≤ νm (t)ωm πm + amax m order derivative of f (x). Letting ωm = 1, ∀ m ∈ M, we have 0 the lower bound πm νm (t) ≥ νm (t), ∀ m ∈ M, for selecting 0 the control parameters, where νm (t) = max{Ym (t) − amax m , 1}. Subsequently, following the straightforward calculations of the Lyapunov drift-plus-penalty technique which are omitted for space, we obtain  M  P (13) ≤ E Ym (t)ϕm (t) − νm (t)ωm f ϕm (t) (14a) m=1 M P m=1 i  Ym (t)rm P(t) + C Y(t) . (14b) Due to space limitation, we omit the details of the constant value C which does not influence the system performance [5]. We note that the solution to LP is acquired by minimizing the right-hand side (RHS) of (14a) and (14b) in every slot t. Further, (14a) is related to the reliability and QoS requirements while (14b) reflects optimal power allocation to UEs. A. Auxiliary Variable and Control Parameter Selection ϕm (t), νm (t) 0 πm νm (t) ≥ νm (t), 0 max rm (t) ≤ ϕm (t) ≤ rm . (15b) (15c) Before proceeding with problem (15), we rewrite −νm (t) log(ϕm (t)) in (15a), for any ϕm (t) > 0 and νm (t) > 0, as    νm (t) νm (t) log − νm (t) log νm (t) , ϕm (t) | {z } | {z } g0 (νm ) h0 (ϕm , νm ) in which both h0 (ϕm , νm ) (i.e., relative entropy function) and g0 (νm ) (i.e., negative entropy function) are convex functions. Since (15a) is the difference of convex functions while constraints (15b) and (15c) are affine functions, problem (15) belongs to DC programming problems [12], which can be efficiently and iteratively addressed by the CCP [6]. The CCP algorithm to obtain the solution to problem (15) is detailed in Algorithm 1. We note that the CCP provably converges to the local optima of DC programming problems [6]. However, due to space limitation, we omit the convergence proof of Algorithm 1 (please refer to [6] for the formal proof). B. Power Allocation The optimal transmit power in (14b) is computed by min P(t) − M P 22 Proposed algorithm Baseline 1 Baseline 2 20 18 16 14 12 10 dth=10 ms, ǫ = 5% 8 6 Considering the logarithmic fairness utility function, i.e., f (x) = log(x), minimizing the RHS of (14a) for each m ∈ M is formulated as:  min Ym (t)ϕm (t) − νm (t) log ϕm (t) (15a) subject to ϕm ,νm subject to (15b) and (15c), (i)⋆ (i)⋆ Find the optimal ϕm and νm . (i)⋆ (i+1) := νm and i := i + 1. Update νm until Convergence end while Average latency [ms] − Algorithm 1 CCP algorithm for solving sub-problem (15). while m ∈ M do (i) Initialize i = 0 and a feasible point νm in (15b). repeat (i) (i) (i) Convexify ĝ0 (νm , νm ) = g0 (νm ) + ∇g0 (νm − νm ). Solve: (i) h0 (ϕm , νm ) − ĝ0 (νm , νm ) + Ym ϕm min Ym (t)rm (P(t)) m=1 subject to (1). Here, the objective function is strictly convex for pm (t) ≥ 0, ∀ m ∈ M, and the constraints are compact. Therefore, the optimal solution of P⋆ (t) exists and is efficiently reached by numerical methods. After obtaining the optimal auxiliary variable and transmit power, we update the queues Qm (t + 1) and Ym (t + 1) as per (4) and (12), respectively. 4 2 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 Mean arrival rate λ [Gbps] Fig. 1. Average latency versus mean arrival rates, M = 16 per km2 . V. N UMERICAL R ESULTS We consider a single-cell massive MIMO system3 in which the MBS, with N = 32 antennas and P = 38 dBm, is located at the center of the 0.5 × 0.5 km2 square area. UEs (from 8 to 60 UEs per km2 ) are randomly deployed within the MBS’s coverage with a minimum MBS-UE distance of 35 m. Data arrivals follow a Poisson distribution with different means, and max min the rate requirements are specified as rm = 1.2λm , rm = 0.8λm , ∀ m ∈ M. The system bandwidth is 1 GHz. The path loss is modeled as a distance-based path loss with the line-ofsight (LOS) model4 for urban environments at 28 GHz [13]. The maximum delay requirement dth and the target reliability probability ǫ are set to 10 ms and 5%, respectively. The numerical results are obtained via Monte-Carlo simulations over 10000 realizations with different channel realizations and UE locations. Furthermore, we compare our proposed scheme with the following baselines: • Baseline 1 refers to the Lyapunov framework in which the probabilistic latency constraint (5) is considered. • Baseline 2 is a variant of Baseline 1 without the probabilistic latency constraint (5). A. Impact of Arrival Rate In Fig. 1, we report the average latency versus the mean arrival rates λ = E[a(t)] for M = 16. At low λ, all schemes do not violate latency constraints, and our proposed algorithm outperforms other baselines with a small gap. At higher λ, the average delay of baseline 2 increases dramatically as λ > 1.8 Gbps, since baseline 2 does not incorporate the 3 The multi-cell scenario raises a problem of additional delay due to the need of information exchange among base stations, which is required by either the coordination scheme or distributed approach. This problem is also a very interesting open topic for future work. 4 We assume that the probability of LOS communication is very high, while the impact of other channel models is left for future works. 1 3.5 Proposed algorithm Baseline 1 Baseline 2 Proposed algorithm Baseline 1 Baseline 2 Proposed algorithm Baseline 1 Baseline 2 λ = 2 Gbps 0.8 CCDF 0.7 λ = 2.4 Gbps 0.6 λ = 2.6 Gbps 0.5 0.4 0.3 Proposed: Pr(delay > 7.4) < 1e-4 0.2 BL1: Pr(delay > 9.4) < 1e-4 0.1 0.05 0.0001 5 8 10 15 20 25 30 35 40 45 Latency [ms] Fig. 2. Tail distribution (CCDF) of latency. delay constraint, whereas our proposed scheme reduces latency by 28.41% and 77.11% as compared to baselines 1 and 2, respectively, when λ = 2.4 Gbps. When λ > 2.4 Gbps, the average delay of all schemes increases, violating the delay requirement of 10 ms. It can be observed that under limited maximum transmit power, at very high traffic demand, the latency requirement could not be guaranteed. This highlights the tradeoff between the mean arrival rate and latency. In Fig. 2, we report the tail distribution (complementary cumulative distribution function (CCDF)) of latency to showcase how often the system achieves a delay greater than target delay levels. In particular, at λ = 2.4 Gbps, by imposing the probabilistic latency constraint (5), our proposed approach and baseline 1 ensure reliable communication with better guaranteed probabilities, i.e, Pr(delay > 7.5ms) < 10−4 and Pr(delay > 9.4ms) < 10−4 , respectively. In contrast, baseline 2 violates the latency constraint with a high probability, where Pr(delay > 10ms) = 74.75%. B. Impact of User Density In Fig. 3, we compare the average user throughput (avgUT) and average latency of our proposed approach with the two baselines under the impact of user density. Additionally, we consider the weighted sum rate maximization (WSRM) case without considering queue dynamics, i.e., problem (6) without the constraints (5) and (6b). The WSRM case is the conventional way to find the system throughput limit but suffers from higher latency. Since all users share the same resources, the average delay (“solid lines”) increases with the number of users M, whereas the avgUT (“dash lines”) decreases. Fig. 3 further shows that when M > 24, the delay of all schemes increases dramatically and is far-above the latency requirement. Hence, only a limited number of users can be served to guarantee the delay requirement, above which, a tradeoff between latency and network density exists. Our proposed approach achieves better throughput and higher latency reduction than baselines 1 and 2, while the WSRM case has the worst delay performance as expected. Compared with WSRM, our proposed approach maintains at least 87% of the throughput limit, while achieving up to 80% latency reduction. Moreover, our proposed approach reaches Gbps capacity, which represents the capacity improvement brought by the combination of mmWave and massive MIMO techniques. Numerical results show that our approach simultaneously provides order of magnitude capacity improvements and latency reduction. VI. C ONCLUSION In this letter, we have investigated the problem of mmWaveenabled massive MIMO networks from a latency and reliability Average user throughput [Gbps] BL2: Pr(delay > 10) = 74.75% 0.9 3 WSRM Proposed algorithm Baseline 1 Baseline 2 Throughput 2.5 2 1.5 Latency 1 0.5 8 12 16 20 24 28 32 36 40 Number of nodes per km 2 44 48 52 56 160 150 140 130 120 110 100 90 80 70 60 50 40 30 20 10 0 60 Average latency [ms] 4 Fig. 3. Average latency and avgUT versus number of users per km2 , λ = 2 Gbps. standpoint. Specifically, the problem is modeled as a NUM problem subject to the probabilistic latency/reliability constraint and QoS/rate requirement. By incorporating these constraints, we have proposed a dynamic Lyapunov control approach, which adapts to channel variations and system dynamics. Numerical results show that our proposed approach reduces the latency by 28.41% and 77.11% as compared to current baselines. R EFERENCES [1] “2020: Beyond 4G radio evolution for the gigabit experience,” White Paper, Nokia Siemens Networks, 2011. [2] E. G. Larsson, O. Edfors, F. Tufvesson, and T. L. Marzetta, “Massive MIMO for next generation wireless systems,” IEEE Commun. Mag., vol. 52, no. 2, pp. 186–195, Feb. 2014. [3] O. Semiari, W. Saad, and M. Bennis, “Downlink cell association and load balancing for joint millimeter wave-microwave cellular networks,” in Proc. IEEE Global Commun. Conf., Washington, D.C., USA, Dec. 2016, pp. 1–6. [4] T. K. Vu, M. Bennis, S. Samarakoon, M. Debbah, and M. Latva-aho, “Joint in-band backhauling and interference mitigation in 5G heterogeneous networks,” in Proc. 22th European Wireless Conf., Oulu, Finland, May 2016, pp. 1–6. [5] M. J. Neely, Stochastic Network Optimization with Application to Communication and Queueing Systems. Morgan and Claypool Publishers, Jun. 2010. [6] T. Lipp and S. Boyd, “Variations and extension of the convex–concave procedure,” Optimization and Eng., pp. 1–25, 2015. [7] A. Liu and V. Lau, “Hierarchical interference mitigation for massive MIMO cellular networks,” IEEE Trans. Signal Process., vol. 62, no. 18, pp. 4786–4797, Sep. 2014. [8] W. Feng, Y. Wang, D. Lin, N. Ge, J. Lu, and S. Li, “When mmWave communications meet network densification: A scalable interference coordination perspective,” IEEE J. Sel. Areas Commun., 2017, to be published. [9] S. Wagner, R. Couillet, M. Debbah, and D. T. M. Slock, “Large system analysis of linear precoding in correlated MISO broadcast channels under limited feedback,” IEEE Trans. Inf. Theory, vol. 58, no. 7, pp. 4509–4537, Jul. 2012. [10] J. D. Little and S. C. Graves, “Little’s law,” in Building intuition. Springer, 2008, pp. 81–100. [11] A. Mukherjee, “Queue-aware dynamic on/off switching of small cells in dense heterogeneous networks,” in Proc. IEEE Global Commun. Conf. Workshops, Atlanta, GA, USA, Dec. 2013, pp. 182–187. [12] T. H. A. Le and D. T. Pham, “The DC (difference of convex functions) programming and DCA revisited with DC models of real world nonconvex optimization problems,” Ann. Operations Research, vol. 133, no. 1, pp. 23–46, Jan. 2005. [13] M. R. Akdeniz, Y. Liu, M. K. Samimi, S. Sun, S. Rangan, T. S. Rappaport, and E. Erkip, “Millimeter wave channel modeling and cellular capacity evaluation,” IEEE J. Sel. Areas Commun., vol. 32, no. 6, pp. 1164–1179, Jun. 2014.
7cs.IT
Local weak form meshless techniques based on the radial point interpolation (RPI) method and local boundary integral equation (LBIE) method to evaluate European and American options Jamal Amani Rada , Kourosh Paranda, Saeid Abbasbandyb,∗ arXiv:1412.6063v1 [cs.CE] 29 Oct 2014 a Department of Computer Sciences, Faculty of Mathematical Sciences, Shahid Beheshti University, Evin, P.O. Box 198396-3113,Tehran,Iran b Department of Mathematics, Imam Khomeini International University, Ghazvin 34149-16818, Iran Abstract For the first time in mathematical finance field, we propose the local weak form meshless methods for option pricing; especially in this paper we select and analysis two schemes of them named local boundary integral equation method (LBIE) based on moving least squares approximation (MLS) and local radial point interpolation (LRPI) based on Wu’s compactly supported radial basis functions (WCS-RBFs). LBIE and LRPI schemes are the truly meshless methods, because, a traditional non-overlapping, continuous mesh is not required, either for the construction of the shape functions, or for the integration of the local subdomains. In this work, the American option which is a free boundary problem, is reduced to a problem with fixed boundary using a Richardson extrapolation technique. Then the θ-weighted scheme is employed for the time derivative. Stability analysis of the methods is analyzed and performed by the matrix method. In fact, based on an analysis carried out in the present paper, the methods are unconditionally stable for implicit Euler (θ = 0) and Crank-Nicolson (θ = 0.5) schemes. It should be noted that LBIE and LRPI schemes lead to banded and sparse system matrices. Therefore, we use a powerful iterative algorithm named the Bi-conjugate gradient stabilized method (BCGSTAB) to get rid of this system. Numerical experiments are presented showing that the LBIE and LRPI approaches are extremely accurate and fast. Keywords: Option Pricing; American option; Meshless weak form; LBIE; MLS; LRPI; Richardson Extrapolation; BCGSTAB; Stability analysis. AMS subject classification: 91G80; 91G60; 35R35. 1. Introduction Over the last thirty years, financial derivatives have raised increasing popularity in the markets. In particular, large volumes of options are traded everyday all over the world and it is therefore of great importance to give a correct valuation of these instruments. Options are contracts that give to the holder the right to buy (call) or to sell (put) an asset (underlying) at a previously agreed price (strike price) on or before a given expiration date (maturity). The majority of options can be grouped in two categories: European options, which can be exercised only at maturity, and American options, which can be exercised not only at maturity but also at any time prior to maturity. Options are priced using mathematical models that are often challenging to solve. In particular, the famous Black-Scholes model [1] yields explicit pricing formulae for some kinds of European options, including vanilla call and put, but the modeling of American options is quite complicated. Hence, an analytical solution is impossible. Therefore, to solve this problem, we need to have a powerful computational method. To this aim, the most common approaches are the finite difference/finite element/finite volume methods/fast Fourier transform (see, e.g., [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) and the binomial/triniomial ∗ Corresponding author Email addresses: [email protected];[email protected] (Jamal Amani Rad), [email protected] (Kourosh Parand), [email protected] (Saeid Abbasbandy) Preprint submitted to . December 19, 2014 trees (see, e.g., [20, 21, 22, 23]), nevertheless some authors have also proposed the use of meshless algorithms based on radial basis functions [24, 25, 26, 27, 28, 29] and on quasi radial basis functions [30]. Recently, a great attention has been paid to the development of various meshless formulations for solution of boundary value problems in many branches of science and engineering. Meshless methods are becoming viable alternatives to either finite element method (FEM) and boundary element method (BEM). Compared to the FEM and the BEM, the key feature of this kind of method is the absence of an explicit mesh, and the approximate solutions are constructed entirely based on a group of scattered nodes. Meshless methods have been found to possess special advantages on problems to that the conventional mesh-based methods are difficult to be applied. These generally include problems with complicated boundary, moving boundary and so on [31, 32, 33, 34, 35, 36, 37]. A lot of meshless methods are based on a weak-form formulation on global domain or a set of local sub-domains. In the global formulation background cells are needed for the integration of the weak form. Strictly speaking, these meshless methods are not truly meshless methods. It must be realized that integration is completed only those background cells with a nonzero shape function. In the financial literature global meshless method (or Kansa method) has been proposed for pricing options under various models such as the Black-Scholes model, stochastic volatility models and Merton models with jumps. In particular, in the case of Black-Scholes model, we mention two papers by Hon and his co-author [30, 26] where the global RBFs and quasi-radial basis functions are developed. Moreover, as regards the cases of stochastic volatility models and BlackScholes model on two underlying assets, new global meshless method is presented in Ballestra and Pacelli [25]. The techniques presented in [25] is combined of the Gaussian radial basis functions with a suitable operator splitting scheme. Also a numerical method has recently been presented by Saib et al. [38]. In particular, in this latter work, a differential quadrature radial basis functions is used to reduce the American option pricing problem under Merton’s jump-diffusion model to a system of ordinary differential equations. The interested reader can also see [39, 40]. In methods based on local weak-form formulation no cells are needed and therefore they are often known as truly meshless methods. By using a simple form for the geometry of the sub-domains, one can use a numerical integration method, easily. Recently, two family of meshless methods, on the basis of the local weak form for arbitrary partial differential equations with moving least-square (MLS) and radial basis functions (RBFs) approximation have been developed [41, 42, 43, 44, 45]. Local boundary integral equation method (LBIE) with moving least squares approximation and local radial point interpolations (LRPI) with radial basis functions have been developed by Zhu et al. [46] and Liu et al. [47, 48], respectively. Both methods (LBIE and LRPI) are meshless, as no domain/boundary traditional non-overlapping meshes are required in these two approaches. Particularly, the LRPI meshless method reduces the problem dimension by one, has shape functions with delta function properties, and expresses the derivatives of shape functions explicitly and readily. Thus it allows one to easily impose essential boundary and initial (or final) conditions. Though the LBIE method is an efficient meshless method, it is difficult to enforce the essential boundary conditions for that the shape function constructed by the moving least-squares (MLS) approximation lacks the delta function property. Some special techniques have to be used to overcome the problem, for example, the Lagrange multiplier method and the penalty method [49]. In this paper, meshless collocation method is applied to the nodes on the boundaries. The papers of Zhu et al. [46, 50, 51] in linear and non-linear acoustic and potential problems, and for heat conduction problems, the works of Sladek brothers [52, 53] by meshless LBIE are useful for researchers. This method has now been successfully extended to a wide rang of problems in engineering. For some examples of these problems, see [54, 55, 56] and other references therein. The interested reader of meshless methods can also see [57, 58]. The objective of this paper is to extend the LRPI based on Wu’s compactly supported radial basis functions (WCS-RBFs) with C 4 smoothness [59] and LBIE method based on moving least squares with cubic spline weight function to evaluate European and American options. To the best of our knowledge, the local weak form of meshless method has not yet been used in mathematical finance. Therefore, it appears to be interesting to extend such a numerical technique also to option valuation, which is done in the present manuscript. In particular, we develop a local weak form meshless algorithm for pricing both European and American options under the Black-Scholes model. In addition, in this paper the infinite space domain is truncated to [0, Smax ] with a sufficiently large Smax to avoid an unacceptably large truncation error. The options’ payoffs considered in this paper are non-smooth functions, in particular their derivatives are discontinuous at the strike price. Therefore, to 2 reduce as much as possible the losses of accuracy the points of the trial functions are concentrated in a spatial region close to the strike prices. So, we employ the change of variables proposed by Clarke and Parrott [60]. As far as the time discretization is concerned, we use the θ-weighted scheme. Stability analysis of the method is analyzed and performed by the matrix method in the present paper. Furthermore, in this paper we will see that the time semi-discretization is unconditionally stable for implicit Euler (θ = 0) and Crank-Nicolson (θ = 0.5) schemes. Finally, in order to solve the free boundary problem that arises in the case of American options is computed by Richardson extrapolation of the price of Bermudan option. In essence the Richardson extrapolation reduces the free boundary problem and linear complementarity problem to a fixed boundary problem which is much simpler to solve. The paper is organized as follows: In Section 2 a detailed description of the Black-Scholes model for European and American options is provided. Section 3 is devoted to presenting the LBIE and LRPI approaches and the application of such a numerical technique to the option pricing problems considered is shown in this section. The numerical results obtained are presented and discussed in Section 4 and finally, in Section 5, some conclusions are drawn. 2. The Black-Scholes model for European and American options For the sake of simplicity, from now we restrict our attention to options of put type. However the reader will note that the numerical method presented in this paper can be used with little modifications also to price call options. Let us consider a put option with maturity T and strike price E on an underlying asset s that follows (under the risk-neutral measure) the stochastic differential equation [61]: ds = r s dt + σ s dW, (2.1) where r and σ are the interest rate and the volatility, respectively. Moreover let V (s, t) denote the option price, and let us define the Black-Scholes operator [61]: LV (s, t) = − ∂ σ2 2 ∂ 2 ∂ V (s, t) − rs V (s, t) + rV (s, t). V (s, t) − s ∂t 2 ∂s2 ∂s (2.2) 2.1. European option The option price V (s, t) satisfies, for s ∈ (0, +∞) and t ∈ [0, T ), the following partial differential problem [61, 30, 26]: LV (s, t) = 0, (2.3) V (s, T ) = ς(s), (2.4) with final condition: and boundary conditions: V (0, t) = E exp{−r(T − t)}, lim V (s, t) = 0, s→+∞ (2.5) where ς is the so-called option’s payoff: ς(s) = max(E − s, 0), (2.6) which is clearly not differentiable at s = E. An exact analytical solution to the problem (2.3)-(2.5), i.e. the famous Black-Scholes formula, is available. 3 2.2. American option The option price V (s, t) satisfies, for s ∈ [0, +∞) and t ∈ [0, T ), the following partial differential problem [30, 26]: LV (s, t) = 0, s > B(t), (2.7) V (s, t) = E − s, ∂V (s, t) = −1, ∂s s=B(t) 0 ≤ s < B(t), (2.8) (2.9) V (B(t), t) = E − B(t), (2.10) with final condition: V (s, T ) = ς(s), (2.11) lim V (s, t) = 0, (2.12) and boundary condition: s→+∞ where B(t) denotes the so-called exercise boundary, which is unknown and is implicitly defined by (2.7)(2.12). The above free-boundary partial differential problem does not have an exact closed-form solution, and thus some numerical approximation is required. Problem (2.7)-(2.12) can be reformulated as a linear complementarity problem [10]: LV (s, t) ≥ 0, (2.13) V (s, t) − ς(s) ≥ 0, (LV (s, t)) · (V (s, t) − ς(s)) = 0, (2.14) (2.15) which holds for s ∈ (0, +∞) and t ∈ [0, T ), with final condition: V (s, T ) = ς(s), (2.16) and boundary conditions: V (0, t) = E, lim V (s, t) = 0. s→+∞ (2.17) In this work, the price of American option is computed by Richardson extrapolation of the price of Bermudan option which is also employed in other works, such as for example [8, 9, 23, 25, 62]. In essence the Richardson extrapolation reduces the free boundary problem and linear complementarity problem to a fixed boundary problem which is much simpler to solve. Thus, instead of describing the aforementioned linear complementarity problem or penalty method, we directly focus our attention onto the partial differential equation satisfied by the price of a Bermudan option which is faster and more accurate than other methods. Let us consider in the interval [0, T ], M + 1 equally spaced time levels t0 = 0, t1 , t2 , ..., tM = T . Let VM (s, t) denote the price of a Bermudan option with maturity T and strike price E. The Bermudan option is an option that can be exercised not on the whole time interval [0, T ], but only at the dates t0 , t1 , . . ., tM . That is we consider the problems ( LVM (s, t) = 0, (2.18) VM (0, t) = E, lims→∞ VM (s, t) = 0, which hold in the time intervals (t0 , t1 ), (t1 , t2 ), . . ., (tM−1 , tM ). By doing that also the relation (2.15) is automatically satisfied in every time interval (tk , tk+1 ), k = 0, 1, . . . , M − 1. Moreover, the relation (2.14) is enforced only at times t0 , t1 , . . ., tM−1 , by setting VM (s, tk ) = max( lim+ VM (s, t), ς(s)), t→tk 4 k = 0, 1, . . . , M − 1. (2.19) Note that the function VM (·, tk ) computed according to (2.19) is used as the final condition for the problem (2.18) that holds in the time interval (tk−1 , tk ), k = 1, 2, . . . , M − 1. Instead, the final condition for the problem (2.18) that holds in the time interval (tM−1 , tM ), according to the relation (2.16), is prescribed as follows: VM (s, tM ) = ς(s). (2.20) That is, in summary, problems (2.18) are recursively solved for k = M − 1, M − 2, . . . , 0, starting from the condition (2.20), and at each time tM−1 , tM−2 , . . ., t0 the American constraint (2.19) is imposed. The Bermudan option price VM (s, t) tends to become a fair approximation of the American option price V (s, t) as the number of exercise dates M increases. In this work the accuracy of VM (s, t) is enhanced by Richardson extrapolation which is second-order accurate in time. 3. Methodology To evaluate the option, the LBIE and LRPI methods are used in the present work. The methods are based on local weak forms over intersecting sub-domains. For ease of exposition, we focus our attention onto American option, as the application of the method to European option is substantially analogous and requires only minor modifications. At first we discuss a time-stepping method for the time derivative. 3.1. Time discretization First of all, we discretize the Black-Scholes operator (2.2) in time. For this propose, we can apply the Laplace transform or use a time-stepping approximation. Algorithms for the numerical inversion of a Laplace transform lead to a reduction in accuracy. Then, we employ a time-stepping method to overcome the time derivatives in this equation. Let V k (s) denote a function approximating VM (s, tk ), k = 0, 1, ..., M − 1. Note that the subscript M has been removed from V k (s) to keep the notation simple. According to (2.20) we set V M (s) = ς(s). Let us consider the following θ-weighted scheme: LV k (s) = d 1 θσ 2 2 d2 k+1 V (s) + θrs V k+1 (s) + (−θr + s )V k+1 (s) − 2 ds2 ds ∆t d (θ − 1)σ 2 2 d2 k V (s) − (θ − 1)rs V k (s) − s 2 2 ds ds 1 k )V (s). (−(θ − 1)r + ∆t Therefore, the American option problems are rewritten as follows: ( LV k (s) = 0, V k (0) = E, lims→∞ V k (s) = 0, and also, the relations (2.19) and (2.20) are rewritten as follows:   k = 0, 1, . . . , M − 1, V k (s) = max lim V k (s), ς(s) , t→t+ k+1 (3.1) (3.2) (3.3) V M (s) = ς(s). 3.2. Spatial variable transformation Now, the infinite space domain is truncated to [0, Smax ] with a sufficiently large Smax to avoid an unacceptably large truncation error. However, in [63] shown that upper bound of the asset price is three or four times of the strike price, so we can set Smax = 5E. The options’ payoffs considered in this paper are non-smooth functions, in particular their derivatives are discontinuous at the strike price. Therefore, to reduce the losses of accuracy the points of the trial functions are concentrated in a spatial region close to 5 s = E. So, we employ the following change of variables which is not new but has already been proposed by [60] and has also been employed for example in [25, 39, 40]: x(s) = or sinh−1 (ξ(s − E)) + sinh−1 (ξE) , sinh−1 (ξ(Smax − E)) + sinh−1 (ξE) ! 1 s(x) = sinh x sinh−1 (ξ(Smax − E)) − (1 − x) sinh−1 (ξE) + E. ξ (3.4) (3.5) Note that the Eq. (3.4) maps the [0, Smax ] to the [0, 1]. We define U (x, t) = e k (x) LU = V (s(x), t), d2 d θα(x) 2 U k+1 (x) + θβ(x) U k+1 (x) + γ1 U k+ (x) − dx dx d d2 k (θ − 1)α(x) 2 U (x) − (θ − 1)β(x) U k (x) − γ2 U k (x), dx dx (3.6) (3.7) where 2  1 2 s(x) , α(x) = σ 2 s′ (x) 2 ′′  s (x) s(x) s(x) 1 +r ′ , β(x) = − σ 2 ′ ′ 2 s (x) s (x) s (x)   1 , γ1 = − θr + ∆t   1 γ2 = − (θ − 1)r + . ∆t Using the change of variable (3.4), the relations (3.2) are rewritten as follows: ( e k (x) = 0, LU U k (0) = E, U k (1) = 0, (3.8) and also, the relations (3.3) are rewritten as follows: U k (x) = max( lim U k (x), ςe(x)), t→t+ k+1 where k = 0, 1, . . . , M − 1, (3.9) U M (x) = ςe(x),   ςe(x) = max E − s(x), 0 . (3.10) 3.3. The local weak form In this section, we use the local weak form instead of the global weak form. The LBIE and LRPI methods construct the weak form over local sub-domains such as Ωs , which is a small region taken for each node in the global domain Ω = [0, 1]. The local sub-domains overlap each other and cover the whole global domain Ω. This local sub-domains could be of any size. Therefore the local weak form of the approximate equation (3.8) for x ∈ Ωis can be written as ! Z d2 k+1 d k+1 θα(x) 2 U (x) + θβ(x) U (x) + γ1 U k+1 (x) u∗ dΩ dx dx Ωis ! Z d2 k d k k (θ − 1)α(x) 2 U (x) + (θ − 1)β(x) U (x) + γ2 U (x) u∗ dΩ, (3.11) = dx dx Ωis 6 which Ωis is the local domain associated with the point i, i.e. it is a interval centered at x of radius rQ . In LRPI, u∗ is the Heaviside step function ( 1, x ∈ Ωis , ∗ u (x) = 0, otherwise, as the test function in each local domain, but in LBIE method, u∗ is the fundamental solution for the one-dimensional Laplace operator defined by the equation ∂2 ∗ u (x, ξ) = δ(x, ξ), ∂x2 (3.12) where x and ξ are a field point and a source point, respectively, and δ is Dirac delta function. The fundamental solution and its derivative are given as follows 1 |x − ξ|, 2 1 ∂ ∗ u (x, ξ) = sgn(x − ξ), ∂x 2 u∗ (x, ξ) = (3.13) where the symbol sgn denotes the signum function. Using the integration by parts, we have ! Z d j d2 j ∗ ′ j α(x) 2 U (x)u dΩ = α(x) U (x) − α (x)U (x) u∗ dx dx Ωis ∂Ωis Z Z Z ∗ d j ∂u ∂u∗ + U j (x)α′′ (x)u∗ dΩ + U j (x)α′ (x) dΩ − U (x)α(x) dΩ, ∂x ∂x Ωis Ωis Ωis dx (3.14) and Z d β(x) U j (x)u∗ dΩ = β(x)U j (x)u∗ dx i Ωs Z ∂u∗ − U j (x)β(x) dΩ, ∂x Ωis 7 − ∂Ωis Z U j (x)β ′ (x)u∗ dΩ Ωis (3.15) for j = k, k + 1. In above relations, ∂Ωis is the boundary of Ωis . Using relations (3.11), (3.12), (3.14) and (3.15) for LBIE scheme, we get ! d k+1 θ i ′ k+1 |x − x | α(x) U (x) − α (x)U (x) 2 dx i ∂Ωs Z θ U k+1 (x)α′′ (x)|x − xi |dΩ + |x − xi |β(x)U k+1 (x) 2 Ωis ∂Ωis Z θ − U k+1 (x)β ′ (x)|x − xi |dΩ 2 Ωis Z Z θ U k+1 (x)β(x)sgn(x − xi )dΩ +γ1 U k+1 (x)dΩ − 2 i i Ωs Ω Z s Z θ θ d k+1 k+1 ′ i + U (x)α (x)sgn(x − x )dΩ − U (x)α(x)sgn(x − xi )dΩ 2 Ωis 2 Ωis dx ! d θ−1 |x − xi | α(x) U k (x) − α′ (x)U k (x) = 2 dx i θ 2 + Z θ−1 2 ∂Ωs θ−1 |x − xi |β(x)U k (x) 2 Ωis ∂Ωis Z Z θ−1 U k (x)β ′ (x)|x − xi |dΩ + γ1 U k (x)dΩ − 2 Ωis Ωis Z Z θ−1 θ−1 U k (x)β(x)sgn(x − xi )dΩ + U k (x)α′ (x)sgn(x − xi )dΩ − 2 2 Ωis Ωis Z θ−1 d k − U (x)α(x)sgn(x − xi )dΩ. 2 dx i Ωs + U k (x)α′′ (x)|x − xi |dΩ + (3.16) Also, because the derivative of the Heaviside step function u∗ is equal to zero, then for LRPI scheme using relations (3.14) and (3.15) the local weak form equation (3.11) is transformed into the following simple local integral equation ! d k+1 ′ k+1 (x) − α (x)U (x) θ α(x) U dx i +θ ∂Ωs Z U k+1 ′′ (x)α (x)dΩ + θβ(x)U k+1 (x) Ωis +γ1 Z −θ ∂Ωis Z U k+1 (x)β ′ (x)dΩ Ωis U k+1 (x)dΩ Ωis ! d k ′ k = (θ − 1) α(x) U (x) − α (x)U (x) dx +(θ − 1) +γ2 Z Z k ∂Ωis k ′′ − (θ − 1) U (x)α (x)dΩ + (θ − 1)β(x)U (x) Ωis ∂Ωis U k (x)dΩ. Z U k (x)β ′ (x)dΩ Ωis (3.17) Ωis It is important to observe that in relations (3.16) and (3.17) exist unknown functions, we should approximate these functions. To this aim the local integral equations (3.16) and (3.17) are transformed in to a system of algebraic equations with real unknown quantities at nodes used for spatial approximation, as described in the next section. 8 3.4. Spatial approximation Instead of using traditional non-overlapping, contiguous meshes to form the interpolation scheme, the LBIE and LRPIM methods use a local interpolation or approximation to represent the trial or test functions with the values (or the fictitious values) of the unknown variable at some randomly located nodes. There are a number of local interpolation schemes for this purpose. The moving least squares approximation and radial point interpolation are two of them. In this section, the fundamental idea of these approximations is reviewed. 3.4.1. The MLS approximation Consider a sub-domain Ωx of Ω in the neighborhood of a point x for the definition of the MLS approximation of the trial function around x. To approximate the distribution of function U k (x) in Ωx , over a e k (x) of number of randomly located nodes {xi }, i = 1, 2, ..., n, the moving least squares approximation U k U (x) for each x ∈ Ωx , can be defined by [49, 50, 51, 52, 54, 64, 65] e k (x) = pT (x)ak (x), ∀x ∈ Ωx , U (3.18) where pT (x) = [p1 (x) p2 (x) ... pm (x)] is a complete monomial basis of order m. In the present work, both the constant and the linear monomials are used, i.e. we set m = 2. Also ak (x) is an undetermined coefficient vector with components akj (x), j = 1, 2, ..., m, which is decided by minimizing the evaluation function Jk (x) shown below [49, 50, 51, 52, 54, 64, 65] k J (x) = n X i=1 = " " bik wi (x) p (x )a (x) − U T bk P.a (x) − U k i #T k " #2 # k b .W. P.a (x) − U , k (3.19) where wi (x) is a positive weight function associated with the node i, which decreases as |x − xi | increases. It always takes unit value at the sampling point x and vanishes outside the support domain Ωx of x. The cubic spline weight function is considered in the present work. The weight function corresponding to node i for a one-dimensional domain may be written as [49, 50, 51]  2 2 3  ri ≤ 0.5,  3 − 4ri + 4ri , 4 4 2 3 (3.20) wi (x) = 3 − 4ri + 4ri − 3 ri , 0.5 < ri ≤ 1,   0, ri > 1, where ri = |x − xi |/rw is the distance from node xi to x, while rw is the size of support for the weight function wi (x). b k are the fictitious nodal In relation (3.19), n is the number of nodes in the support domain Ωx and U i nodes. The matrices P and W are defined as [49, 50, 51, 52, 54, 64, 65]  T 1  p (x )  pT (x2 )    P= , W = Diag(w1 (x), w2 (x), . . . , wn (x)). (3.21)  ..   . pT (xn ) n×m The stationarity condition of Jk (x) in Eq. (3.19) with respect to ak (x) i.e. ∂Jk (x)/∂ak (x), leads to the b k (see [49, 50, 51, 52, 54, 64, 65] for more details) following linear relation between ak (x) and U from which b k, A(x)ak (x) = B(x)U (3.22) b k, ak (x) = A−1 (x)B(x)U (3.23) 9 where the matrices A(x) and B(x) are defined by B(x) = PT W, A(x) = PT WP = B(x)P. The MLS is well-defined only when A is non-singular or the rank of P equals m or at least m weight functions are non-zero i.e. n > m for each x ∈ Ω. Substituting Eq. (3.23) into Eq. (3.18), the approximate e k (x) can be expressed in terms of the shape functions as function U e k (x) = ϕT (x)U b k (x) = U n X i=1 where the nodal shape function ϕi (x) is given by bik , ϕi (x)U ∀x ∈ Ωx , (3.24) ϕT (x) = pT (x)A−1 (x)B(x), or ϕi = m X pj (x)[A−1 (x)B(x)]ji . (3.25) j=1 Derivatives of ϕi (x) are obtained as (see [54, 64, 65] for more details) ϕi,x = m X pj,x [A−1 B]ji + pj [A−1 Bx + A−1 x B]ji , j=1 m X ϕi,xx = −1 −1 pj,xx [A−1 B]ji + 2pj,x [A−1 Bx + A−1 Bxx + A−1 x B]ji + pj [2Ax Bx + A xx B]ji , j=1 −1 −1 = (A−1 )xx represent the one and two derivatives of the inverse of A with )x and Axx where A−1 x = (A respect to x, respectively, which are given by −1 A−1 Ax A−1 , x = −A −1 −1 A−1 − A−1 Ax A−1 − A−1 Ax A−1 xx = −Ax Ax A x , where (.)x denotes d(.) dx . 3.4.2. Local radial point interpolation According to the local point interpolation [48], the value of point interpolation approximation of U k (x) at any (given) point x ∈ Ω = [0, 1] is approximated by interpolation at n nodes x1 , x2 , . . ., xn (centers) laying in a convenient neighborhood of x i.e. Ωx . The domain in which these nodes are chosen, whose shape may depend on the point x, is usually referred to as local support domain. Various different local point interpolation approaches can be obtained depending on the functions used to interpolate U k (x). In this paper we focus our attention onto the so-called local radial point interpolation method (LRPI), which employs a combination of polynomials and radial basis functions. k The function that interpolate U k (x) for each x ∈ Ωx , which we denote by URBP I (x), is obtained as follows: k URBP I (x) = n X Ri (x)aki + m X Pj (x)bkj , (3.26) j=1 i=1 where P1 , P2 , . . ., Pm denote the first m monomials in ascending order (i.e. P1 = 1, P2 = x, . . ., Pm = xm−1 ) and R1 , R2 , . . ., Rn are n radial functions centered at x1 , x2 , . . ., xn , respectively. Moreover ak1 , ak2 , . . ., akn , bk1 , bk2 , . . ., bkm are n + m real coefficients that have to be determined. As far as the radial basis functions R1 , R1 , . . ., Rn are concerned, several choices are possible (see, for example, [66]). In this work we decide to use the Wu’s compactly supported radial basis functions 10 (WCS-RBFs) with C 4 smoothness [59], as they do not involve any free shape parameter (which is not straightforward to choose, see [67, 68, 69, 39, 40]). WCS-RBFs are as follows: Ri (x) = (1 − ri )6+ (6 + 36ri + 82ri2 + 72ri3 + 30ri4 + 5ri5 ), i = 1, 2, . . . , n, (3.27) where ri = |x − xi |/rw is the distance from node xi to x, while rw is the size of support for the radial function Ri (x). Also, (1 − ri )6+ is (1 − ri )6 for 0 ≤ ri < 1 and zero otherwise. Note that the monomials P1 , P2 , . . . , Pm are not always employed (if bki = 0, i = 1, 2, . . . , m, pure RBF approximation is obtained). In the present work, both the constant and the linear monomials are used to augment the RBFs (i.e. we set m = 2). k By requiring that the function URBP I interpolate U at x1 , x2 , . . ., xn , we obtain a set of n equations in k the n + m unknown coefficients a1 , ak2 , . . ., akn , bk1 , bk2 , . . ., bkm : n X Ri (xp )aki + m X j=1 i=1 b k (xp ), Pj (xp )bkj = U p = 1, 2, . . . , n, (3.28) b k are the fictitious nodal nodes. Moreover, in order to uniquely determine U k where U RBP I , we also impose: n X Pj (xi )aki = 0, j = 1, 2, . . . , m. (3.29) i=1 That is we have the following system of linear equations:  k    bk a U G = , bk 0 where bk = U h bk U 1 bk U 2 bk ... U n iT G=    R=     P=  R1 (x1 ) R1 (x2 ) .. . =  h b (x1 ) U R PT P 0 R2 (x1 ) R2 (x2 ) .. .  ... ... .. . b (x2 ) U b (xn ) ... U iT , (3.30) , Rn (x1 ) Rn (x2 ) .. . R1 (xn ) R2 (xn ) . . . Rn (xn ) P1 (x1 ) P1 (x2 ) .. . P2 (x1 ) P2 (x2 ) .. . ... ... .. . P1 (xn ) P2 (xn ) . . . Pm (xn ) Pm (x1 ) Pm (x2 ) .. .    ,     ,  ak = [ak1 ak2 . . . akm ]T , (3.31) bk = [bk1 bk2 . . . bkm ]T . (3.32) Unique solution is obtained if the inverse of matrix R exists, so that   k   bk a U −1 . =G bk 0 11 Accordingly, (3.26) can be rewritten as  k URBP I (x) = or, equivalently, k URBP I (x) =  RT (x) T PT (x) T R (x) P (x) Let us define the vector of shape functions: Φ(x) = [ ϕ1 (x) ϕ2 (x)    ak bk −1 G   bk U 0 ,  . (3.33) p = 1, 2, . . . , n, (3.34) . . . ϕn (x)] , where ϕp (x) = n X Ri (x)G−1 i,p + i=1 m X −1 Pj (x)Gn+j,p , j=1 −1 and G−1 . Using (3.34) relations (3.33) are rewritten in the more i,p is the (i, p) element of the matrix G compact form: k bk URBP I (x) = Φ(x)U , or, equivalently, k URBP I (x) = n X i=1 (3.35) b k ϕi (x). U i (3.36) It can be easily shown that the shape functions (3.34) satisfy the so-called Kronecker property, that is ϕi (xj ) = δij , (3.37) where δij is the well-known Kronecker symbol, so that essential boundary and final conditions such as those considered in Section 2 (e.g., (2.4), (2.5), (2.16), (2.17)) can be easily imposed. Note also that the derivatives k of URBP I (of any order) with respect to x are easily obtained by direct differentiation in (3.36). 3.5. Discretized equations For implementation of the LBIE and LRPI methods, N + 1 regularly nodes xj , j = 0, 1, ..., N are chosen in the interval [0, 1] where x0 = 0 and xN = 1. We define X = {x0 , x1 , ..., xN }. Distance between two nodes is defined by h = xi+1 − xi , for i = 0, 1, ..., N − 1. It is important to observe that U k+1 (x) must be considered as known quantities, since it is approximated at the previous iteration. We want to approximate U k (x) using radial point interpolation and MLS approximations. Substituting the displacement expression in Eqs. (3.24) and (3.36) into the local weak forms (3.16) and (3.17), respectively, the discrete equation for each interior node is obtained as follows Z n n X X k+1 b k+1 (β(x) − α′ (x))ϕj (x) b U Uj (θα′′ (x) − θβ ′ (x) + γ1 )ϕj (x)dΩ + θ j Ωis j=1 +θ n X j=1 = n X j=1 j=1 b k+1 α(x)ϕj,x (x) U j bk U j +(θ − 1) Z ∂Ωis ∂Ωis ((θ − 1)α′′ (x) − (θ − 1)β ′ (x) + γ2 )ϕj (x)dΩ Ωis n X j=1 b k (β(x) − α′ (x))ϕj (x) U j + (θ − 1) ∂Ωis 12 n X j=1 b k α(x)ϕj,x (x) U j (3.38) ∂Ωis and # θ ′ θ ′′ ′ i i (α (x) − β (x))|x − x | + (α (x) − β(x))sgn(x − x ) + γ1 ϕj (x)dΩ 2 Ωis 2 j=1 " # Z n n X θ θ X b k+1 k+1 i ′ i b Uj − |x − x |(β(x) − α (x)) ϕj (x) U α(x)sgn(x − x ) ϕj (x)dΩ + 2 j=1 j Ωis 2 j=1 ∂Ωis " # n θ X b k+1 |x − xi |α(x) ϕj,x (x) U + 2 j=1 j ∂Ωis " # Z n X θ − 1 θ − 1 k ′′ ′ i ′ i bj U = (α (x) − β (x))|x − x | + (α (x) − β(x))sgn(x − x ) + γ1 ϕj (x)dΩ 2 2 Ωis j=1 " # Z n n X X θ − 1 θ − 1 k i ′ i k b |x − x |(β(x) − α (x)) ϕj (x) bj U α(x)sgn(x − x ) ϕj (x)dΩ + U − 2 2 j=1 j Ωis j=1 ∂Ωis " # n θ − 1 X bk + U |x − xi |α(x) ϕj,x (x) . (3.39) 2 j=1 j i n X b k+1 U j " Z ∂Ωs The matrix forms of the relations (3.38) and (3.39) are respectively as follows ! n n X X b k+1 = (θ − 1)Aij + γ2 Bij θAij + γ1 Bij + θCij + θDij U j j=1 bk, +(θ − 1)Cij + (θ − 1)Dij U j and (3.40) ! n X e ij − θC e ij + θD e ij + θE e ij U e ij + γ1 B b k+1 = θA j j=1 where j=1 ! ! e e e bjk , −(θ − 1)Cij + (θ − 1)Dij + (θ − 1)Eij U Aij = Z (α′′ (x) − β ′ (x))ϕj (x)dΩ, Bij = Ωis e ij = B Z Z " , (3.41) Z ϕj (x)dΩ, Dij = α(x)ϕj,x (x) ∂Ωis ′′ ′ , ∂Ωis i ′ i # (α (x) − β (x))|x − x | + (α (x) − β(x))sgn(x − x ) ϕj (x)dΩ, Ωis ϕj (x)dΩ, Ωis e ij e ij + γ2 B (θ − 1)A j=1 Ωis Cij = (β(x) − α′ (x))ϕj (x) e ij = 1 A 2 n X e ij = 1 C 2 # (3.42) Z " 1 e ij = |x − xi |(β(x) − α′ (x)) ϕj (x) D 2 α(x)sgn(x − xi )ϕj,x (x)dΩ, Ωis , ∂Ωis " # 1 i e ij = |x − x |α(x) ϕj,x (x) E 2 . ∂Ωis In the LBIE method, it is difficult to enforce the boundary conditions (3.8) for that the shape function constructed by the MLS approximation lacks the delta Kronecker property. In this work, we use the 13 collocation method to the nodes on the boundary. In fact, at the boundary x0 and xN , U k (x) will be obtained by e k (x0 ) = E=U n X j=1 bjk , ϕj (x0 )U e k (xN ) = 0=U n X j=1 bjk , ϕj (xN )U (3.43) but in LRPIM, using the delta Kronecker property, the boundary conditions (3.8) can be easily imposed. In fact, we have bjk = 0, U bjk = δ1j E, U j = 1, 2, . . . , n. (3.44) Therefore, we can rewrite the relations (3.41) and (3.43) in LBIE scheme, and also (3.40) and (3.44) in LRPI scheme in the compact forms and In these systems, we have b k = QU b k+1 + H b k, PU (3.45) b k = GV b k+1 . FV (3.46) bk = [ U b0k U bk = [ U bk V 1 b1k U bk U 2 b2k U bk U 3 b k ]T1×(N +1) , ... U N T bk ... U N −1 ]1×(N −1) , b k is an 1 × (N + 1) vector also in the linear system (3.45), H bk = [ E H 0 0 . . . 0 ]T1×(N +1) , (3.47) and Q is the (N + 1) × (N + 1) banded matrix with bandwidth bw = 2⌊rw ⌋ + 1 whose first and last rows contain only zero elements and the other rows are where e i − θC e i + θD e i + θE e i, e i + γ1 B Qi = θ A e ij = A i = 1, . . . , N − 1, ( integration obtained in relation (3.42), xj ∈ X ∩ Ωis , 0, otherwise. e i, C e i, D e i and E e i are defined analogously. Also P is the (N + 1) × (N + 1) banded matrix The quantities B with bandwidth bw (See Figure 1) whose first and last rows given by the first and second of relations (3.43), respectively, and the other rows are Pi = e i − (θ − 1)C e i + (θ − 1)D ei e i + γ2 B (θ − 1)A e i , i = 1, . . . , N − 1. +(θ − 1)E (3.48) On the other hand, in the linear system (3.46), we have two banded matrices F and G of size (N −1)×(N −1) with bandwidth bw = 2⌊rw ⌋ + 1, so that Gi = θAi + γ1 Bi + θCi + θDi , Fi = (θ − 1)Ai + γ2 Bi + (θ − 1)Ci + (θ − 1)Di , for i = 1, 2, ..., N − 1. Finally, in LBIE scheme, combining Eqs. (3.9) and (3.45) leads to the following system: ( b k = QU b k+1 + H b k, PΞ (3.49) k k b b b U = max{Ξ , Π}, 14 to be recursively solved for k = M − 1, M − 2, . . . , 0, starting from b M = Π, b U (3.50) b are obtained from MLS approximation to option’s payoff (3.10). where Π And for LRPI scheme, we find the following iterative system ( b k = GV b k+1 , FΞ k b = max{Ξ b k , Π}, V to be recursively solved for k = M − 1, M − 2, . . . , 0, starting from b M = Π = [ ςe(x1 ) V ςe(x2 ) . . . ςe(xN −1 ) ]T . (3.51) Remark 1: Note that the numerical methods proposed in this work require solving at every time step a system of linear equations (systems (3.45) and (3.46)). These highly sparse linear equations can be solved using efficient solution techniques for sparse matrices based on either direct methods or iterative methods. Direct methods, like LU factorization method, can be applied to any non-singular matrix and are well adapted to matrix inversion and solution of linear systems. These methods are especially well suited to solving dense systems with O(N 3 ) computational complexity. Direct methods can be impractical if coefficient matrix is large and sparse, because the triangular factors of a sparse matrix usually have many more nonzero elements than itself. So a considerable amount of memory is required and even the solution of the triangular system costs many floating point operations. This necessitates the use of iterative algorithms to preserve the sparsity of the coefficient matrix. The most powerful iterative algorithm of these types is the Bi-conjugate gradient stabilized method (BCGSTAB) developed by Van de Vorst [70] for solving sparse linear systems. Suppose that the final system of equations has the form Ax = b. This method generates a sequence of approximate solutions {x(k) } and essentially involve the coefficient matrix A only in the context of matrix-vector multiplication which is relatively inexpensive for a sparse matrix O(N (2bw + 1)) as compared to a full matrix O(N 2 ). It should also be noted that the complexity of BCGSTAB method O(2N (2bw + 1)K), where K is the number of iteration of algorithm. We simply observe that complexity of this algorithm is very lower than complexity of direct methods. Note that in all the cases considered, the tolerance number tolerance is selected as 10−10 . Convergence was achieved after less than 5 iterations in all cases tested. Remark 2: The key note in applying the local weak form schemes is computing the local integrals using an accurate numerical integration rule. In the following we consider the well-known numerical integration 15 4 e ij and C e ij : rule named Simpson’s rule which has a truncate error of order O(rQ ) to Aij , Bij , A Aij = Z ′′ ′ (α (x) − β (x))ϕj (x)dΩ = Z xi +rQ (α′′ (x) − β ′ (x))ϕj (x)dx xi −rQ Ωis " rQ (α′′ (xi − rQ ) − β ′ (xi − rQ ))ϕj (xi − rQ ) + 4(α′′ (xi ) − β ′ (xi ))ϕj (xi ) = 2 # 4 + (α′′ (xi + rQ ) − β ′ (xi + rQ ))ϕj (xi + rQ ) + O(rQ ), Bij = Z ϕj (x)dΩ = Ωis e ij = 1 A 2 Z Ωis rQ = 4 ( + e ij = 1 C 2 " "( Z xi +rQ xi −rQ " # rQ 4 ϕj (x)dx = ϕj (xi − rQ ) + 4ϕj (xi ) + ϕj (xi + rQ ) + O(rQ ), 2 # (α′′ (x) − β ′ (x))|x − xi | + (α′ (x) − β(x))sgn(x − xi ) ϕj (x)dΩ ) (α′′ (xi − rQ ) − β ′ (xi − rQ ))rQ − (α′ (xi − rQ ) − β(xi − rQ )) ϕj (xi − rQ ) ) # 4 (α (x + rQ ) − β (x + rQ ))rQ + (α (x + rQ ) − β(x + rQ )) ϕj (x + rQ ) + O(rQ ), ′′ Z i ′ i ′ i i i α(x)sgn(x − xi )ϕj,x (x)dΩ Ωis " # rQ 4 − α(xi − rQ )ϕj,x (xi − rQ ) + α(xi + rQ )ϕj,x (xi + rQ ) + O(rQ ), = 4 The Bi-conjugate gradient stabilized method is presented in the following pseudo code: begin Set x(0) ← 0 Compute r(0) = b − Ax(0) Set p(0) ← r(0) , q(0) ← 0, v(0) ← 0, ω b (0) ← 1 , β (0) ← 1 and α(0) ← 1 (i) repeat i = 1, 2, ... until kr k2 < tolerancekr(0) k2 ; tolerance = 10−10 βb(i) =< p(i−1) , r(i−1) >, b(i) (i−1) ω (i) = ββ(i−1)ωbα(i−1) , β (i−1) = βb(i) , q(i) = r(i−1) + ω b (i) (q(i−1) − α(i−1) v(i−1) ), (i) (i) v = Aq , b(i) ω b (i) = <p(i)β ,v(i) > , s(i) = r(i−1) − ω b (i) v(i) , t(i) = As(i) , (i) (i) ,s > , α(i) = <t <t(i) ,t(i) > x(i) = x(i−1) + ω b (i) q(i) + α(i) s(i) , (i) (i) (i) (i) r =s −α t end repeat x = x(i) , end 16 3.6. Stability analysis In this section, we present an analysis of the stability of the LBIE and LRPI schemes. Initially, we consider the LBIE scheme. In this scheme, the solution at any time level can be obtained using Eqs. (3.24) and (3.49) e k = φ max{P−1 Qφ−1 U e k+1 + P−1 H b k , Π}, e U (3.52) where φ is the (N + 1) × (N + 1) banded matrix with bandwidth bw which is easily obtained using the relation (3.24). Then we have e k = φU b k, U and also we have e k = φΠ b k. Π e l . Assume that By choosing k = l and using (3.52), we get U bl = [ U b0l U b1l U b2l U b l ]T . ... U N Also, let Ule be the exact solution at the lth time level with the following components l Ule = [ Ue0 l Ue1 l Ue2 l . . . UeN ]T . e l is either smaller than U l or greater than it i.e. It is well-known that for any i = 0, 1, ..., N , U i ei l eil < Uei U , l eil ≥ Uei U , or ∀ i = 0, 1, . . . , N. e l and Ul which have the following property Case 1: Firstly, we consider the vector components of U e l eil ≥ Uei U , e l and 1 Ul as follow let us define the vectors 1 U e ( e l, U el ≥ Ul , U i i ei el 1 Ui = 0, otherwise, l 1 Uei = ( l el ≥ Ul , Uei , U i ei 0, otherwise. e l as follows Eq. (3.52) can be rewritten using the vector 1 U el 1U e l+1 + MP−1 H b l , MΠ}, e = φ max{P−1 Qφ−1 1 U (3.53) where M is a (N + 1) × (N + 1) matrix Mij = ( el ≥ Ul , 1, i = j, and U i ei 0, otherwise. (3.54) The error El1 at the lth time level is given by e l − 1 Ul . El1 = 1 U e (3.55) el 1U (3.56) It is important to observe that all components of El1 are positive values, also we conclude = El1 + 1 Ule . Using the relations (3.53) and (3.56), we get e b l + P−1 Qφ−1 El+1 , MΠ}, El1 + 1 Ule = φ max{P−1 Qφ−1 1 Ul+1 + MP−1 H e 1 17 (3.57) we can easily see that the relation (3.57) is transformed to the following equation using the maximum function properties: El1 + 1 Ule ≤ b l , MΠ} e φ max{P−1 Qφ−1 1 Ul+1 + MP−1 H e +φ max{P−1 Qφ−1 El+1 1 , O}, (3.58) where O is the zero vector. Also we know that l 1 Ue b l , MΠ}. e = φ max{P−1 Qφ−1 1 Ul+1 + MP−1 H e (3.59) Therefore, using (3.58) and (3.59) we can write El1 ≤ φ max{P−1 Qφ−1 El+1 1 , O}. (3.60) Finally, we obtain [71] ||El1 || ≤ ≤ ||φ max{P−1 Qφ−1 El+1 1 , O}|| ||φP−1 Qφ−1 El+1 || ≤ ||φP−1 Qφ−1 ||||El+1 1 1 ||, (3.61) or, equivalently ||El1 || ≤ ||φP−1 Qφ−1 ||||El+1 1 ||. (3.62) e l and Ul which have the following property Case 2. Now, we consider the vector components of U e el < Ul , U i ei e l and 2 Ul are two vectors defined by suppose that 2 U e ( el < Ul , e l, U U ei i i l e 2 Ui = 0, otherwise, l 2 Uei = ( l el < Ul , , U Uei ei i 0, otherwise. e l only Eq. (3.52) can be rewritten such to contain 2 U el 2U e l+1 + NP−1 H b l , NΠ}, e = φ max{P−1 Qφ−1 2 U where N is a (N + 1) × (N + 1) matrix defined by ( el < Ul , 1, i = j, and U i ei Nij = 0, otherwise. (3.63) (3.64) In this case we propose the error El2 at the lth time level It is clear that El2 is hold as e l − 2 Ul . El2 = 2 U e (3.65) El2 ≥ 0. (3.66) = 2 Ule − El2 . (3.67) By using relation (3.65), we obtain el 2U Therefore, the relation (3.63) converted to the following equation l 2 Ue b l − P−1 Qφ−1 El+1 , NΠ}. e + NP−1 H − El2 = φ max{P−1 Qφ−1 2 Ul+1 e 2 18 (3.68) Moreover, using the maximum function property, we have l 2 Ue − El2 ≥ b l , NΠ} e φ max{P−1 Qφ−1 2 Ul+1 + NP−1 H e −φ max{P−1 Qφ−1 El+1 2 , O}, (3.69) 0 ≤ El2 ≤ φ max{P−1 Qφ−1 El+1 2 , O}. (3.70) or Then, it follows from the norm and maximum property that [71] −1 ||El2 || ≤ ||φ max{P−1 Qφ−1 El+1 Qφ−1 El+1 2 , O}|| ≤ ||φP 2 || ≤ ||φP−1 Qφ−1 ||||El+1 2 ||, (3.71) or, equivalently ||El2 || ≤ ||φP−1 Qφ−1 ||||El+1 2 ||. (3.72) The numerical scheme will be stable if l → ∞, the error ||El1 || → 0 and ||El2 || → 0 [71]. This can be guaranteed provided ρ(φP−1 Qφ−1 ) ≤ 1 or ρ(P−1 Q) ≤ 1 (because P−1 Q and φP−1 Qφ−1 are similar matrices), where ρ denotes the spectral radius of the matrix. For the analysis, we need a simple version of the matrix P. It is given by e − (θ − 1)C e + (θ − 1)D e + (θ − 1)E e + Z, e + γ2 B P = (θ − 1)A e B, e C, e D e and E e are the (N + 1) × (N + 1) banded matrix with bandwidth bw whose first and last where A, rows of them contain only zero elements and the other rows are obtain using relation (3.48). Also in the above relation, Z is an (N + 1) × (N + 1) matrix   ϕj (x0 ), i = 0, Zij = ϕj (xN ), i = N,   0, otherwise, where x0 = 0 and xN = 1. Lemma 1. In the MLS approximation, if we put m = 2, rQ = 0.51h, rw = 4rQ , then the following relations hold: ϕj (x0 ) = δ0j , ϕj (xN ) = δN j , where δ is the Kronecker delta. Proof. We can write the relation (3.25) as follows ϕj (x0 ) = 2 X pk (0)[A−1 (0)B(0)]kj = [A−1 (0)B(0)]1j . k=1 Also using section 3.4.1, we have B(x) = and −1 A  w1 (x) x1 w1 (x) w2 (x) x2 w2 (x) ... wn (x) . . . xn wn (x)  ,  Pn x2i wi (x) (x) = " n #" # " #2 Pi=1 i=1 xi wi (x) Pn Pn Pn 2 w (x) − w (x) x x w (x) i=1 i i=1 i i i=1 i i 1 19  P − Pni=1 xi wi (x) . n i=1 wi (x) Then, one has " wj (0) −1 [A (0)B(0)]1j = " Pn i=1 Pn 2 i=1 xi wi (0) #" wi (0) Pn i=1 − xj # Pn i=1 x2i wi (0) − " # xi wi (0) Pn i=1 #2 . (3.73) xi wi (0) It is exactly clear that to boundary points x0 and xN , we have n = ⌊rw ⌋ + 1, then here n = 3. Indeed, we have xj = (j − 1)h, j = 1, 2, 3. Eq. (3.73) is calculated as follows " # P3 P3 2 2 wj (0) i=1 (i − 1)hwi (0) i=1 (i − 1) h wi (0) − (j − 1)h [A−1 (0)B(0)]1j = " P3 i=1 #" wi (0) P3 i=1 (i # − 1)2 h2 wi (0) − " P3 i=1 (i #2 . − 1)hwi (0) With a little computation, we conclude that " # wj (0) (2 − j)w2 (0) + 2(3 − j)w3 (0) −1 [A (0)B(0)]1j = " #, w1 (0)w2 (0) + w2 (0)w3 (0) + 4w1 (0)w3 (0) on the other hand, we know w3 (0) = 0, then [A−1 (0)B(0)]1j = (2 − j)wj (0) . w1 (0) Therefore, we obtain ϕj (x0 ) = [A−1 (0)B(0)]1j = δ1j . Now, we want to show ϕj (xN ) = δN j . Using relation (3.25), we have ϕj (xN ) = [A−1 (1)B(1)]1j + [A−1 (1)B(1)]2j , similar to the above discussion we can claim the following formula [A−1 (1)B(1)]1j = wj (1)[(1 − 2h)(1 − j)w1 (1) + (1 − h)(2 − j)w2 (1) + (3 − j)w3 (1)] , hw3 (1)(4w1 (1) + w2 (1)) and [A−1 (1)B(1)]2j = wj (1)[(j − 1)w1 (1) + (j − 2)w2 (1) + (j − 3)w3 (1)] . hw3 (1)(4w1 (1) + w2 (1)) Also, we get ϕj (xN ) = wj (1)[2(j − 1)w1 (1) + (j − 2)w2 (1)] . w3 (1)(4w1 (1) + w2 (1)) It is well-known that w1 (1) = 0, therefore we have ϕj (xN ) = ϕj (1) = δjN . 20  According to Lemma 1 we can write   δ1j , Zij = δN j ,   0, then we obtain i = 0, i = N, otherwise, P = (θ − 1)S + Q = θS + where 1 e B, ∆t (3.74) 1 e B + Z, ∆t (3.75) e − rB e −C e +D e + E. e S=A We simply observe that the first and last rows of Q contain only zero elements, so using Gershgorin theorem all the eigenvalues of Q are in Q, i.e.   0 0 ... 0 0 , Q(x) =  Q 0 0 ... 0 0 where Q = [Q2 Q3 ... QN ]T . Also, using the relation (3.74) and (3.75), we can see that  1 0 ... 0 P(x) =  P 0 0 ... 0 0 1 where  , P = [P2 P3 ... PN ]T . It is also worth noticing that one of the eigenvalues of P is λ = 1 i.e. |λ1 − 1| ≤ 0, → |λN +1 − 1| ≤ 0, λ1 = 1, → λN +1 = 1. This is obtained using the Gershgorin theorem on the first and last rows of P. Therefore, the other −1 eigenvalues of P are in matrix P. However, we can consider the ρ(P Q) instead of ρ(P−1 Q), we have P = (θ − 1)S + Q = θS + or e B on the other hand, we know that P −1 Q=P e B −1 −1 −1 1 e B, ∆t e P = (θ − 1)B e Q = θB e B e B −1 −1 −1 S+ e Q = (B 21 1 e B, ∆t S+ 1 I, ∆t (3.76) 1 I, ∆t −1 P) −1 e (B −1 Q), let us define e Σ=B −1 P, e Γ=B −1 Q, therefore, we can rewrite relation (3.77) as follows e Υ=B −1 S, 1 I, ∆t (3.77) θ∆tλ(Υ) + 1 λ(Γ) = ≤ 1, λ(Σ) (θ − 1)∆tλ(Υ) + 1 (3.78) Σ = (θ − 1)Υ + Γ = θΥ + 1 I. ∆t Now by applying Cayley-Hamilton theorem, we have λ(P −1 Q) = λ(Σ−1 Γ) = where λ are eigenvalues of the matrices. We can easily see that for implicit Euler (θ = 0) and CrankNicolson (θ = 0.5) schemes, the inequality (3.78) is always satisfied and the scheme will be unconditionally stable if ρ(Υ) ≤ 0. Figure 2 shows numerically how the spectral radius of Υ varies as a function of N and M . Recollect that the stability condition is satisfied only when ρ(Υ) ≤ 0. It can be seen from Figure 2 that this condition is satisfied in the present numerical methods i.e. LBIE and LRPI. In this work, we use Crank-Nicolson scheme which is second-order accuracy with respect to time variable. Remark 3: Note that the analysis of the stability of the LRPI method is similar to the above analysis. It should also be noted that the stability analysis for European option is similar to the American option. 4. Numerical results and discussions The numerical simulations are run on a PC Laptop with an Intel(R) Core(TM)2 Duo CPU T9550 2.66 GHz 4 GB RAM and the software programs are written in Matlab. Let U , ULBIE and ULRP I respectively denote the option price (either European or American) and its approximation obtained using the LBIE and LRPI methods developed in the Section 3. To measure the accuracy of the ULBIE and ULRP I methods at the current time (t = 0), the discrete maximum norm and the mean square norm have been used with the following definitions: MaxErrorLBIE = MaxErrorLRP I = RMSErrorLBIE RMSErrorLRP I max |ULBIE (xi , 0) − U (xi , 0)| , i=0,1,...,8 (4.1) max |ULRP I (xi , 0) − U (xi , 0)| , i=0,1,...,8 v u 8 X 1 u 2 t = (ULBIE (xi , 0) − U (xi , 0)) , 8 + 1 i=0 v u 8 X 1 u t (ULRP I (xi , 0) − U (xi , 0))2 . = 8 + 1 i=0 (4.2) In MaxErrorLBIE , MaxErrorLRP I , RMSErrorLBIE and RMSErrorLRP I , xi , i = 0, 1, .., 8 are nine different points that will be chosen in a convenient neighborhood of the strike E, i.e. xi ∈ ( 54 E, 65 E). For simplicity, in European and American options we set xi = 8 + 0.5i, i = 0, 1, .., 8 and xi = 80 + 5i, i = 0, 1, .., 8, respectively. Note that in the case of the American option the exact value of U is not available. Therefore, in (4.1), (4.2) we use instead a very accurate approximation of it, which is obtained using the LBIE method with a very large number of nodes and time steps (precisely we set N = 1024 and M = 1024). In the following analysis, the radius of the local sub-domain is selected rQ = 0.51h, where h is the distance between the nodes. The size of rQ is such that the union of these sub-domain must cover the whole global domain i.e. ∪Ωis ⊂ Ω. It is also worth noticing that the MLS approximation is well-defined only when A is non-singular or the rank of P equals m or at least m weight functions are non-zero i.e. n > m for each 22 x ∈ Ω. Therefore, to satisfy these conditions, the size of the support domain rw should be large enough to have sufficient number of nodes covered in Ωx for every sample point (n > m). In all the simulations presented in this work we use rw = 4rQ . Also, in Test cases 1 and 2, we use ξ = 1 and ξ = 0.1, respectively. These values are chosen by trial and error such as to roughly minimize the errors on the numerical solutions. To show the rate of convergence of the new schemes when h → 0 and ∆t → 0, the values of ratio with the following formula have been reported in the tables ) ( MaxErrorLBIE in the previous row , RatioLBIE = log2 MaxErrorLBIE in the current row ( ) MaxErrorLRP I in the previous row RatioLRP I = log2 . MaxErrorLRP I in the current row Finally, the computer time required to obtain the option price using the numerical method described in previous section is denoted by CP U T ime. 4.1. Test case 1 To test the proposed numerical schemes, our first test problem is the same test problem as is presented in [30] and [72]. To be precise, let us consider an European option with the parameters and option data which are chosen as in Table 1. Moreover, we set Smax = 5E. Of special interest to us is testifying the numerical convergence of the solution by this problem. Hence, applying the suggested schemes in this paper together with different choice of N and M , we get the consequences tabulated in Tables 2 and 3. The number of time discretization steps is set equal to nodes distributed in the domain. As we have experimentally checked, this choice is such that in all the simulations performed the error due to the time discretization is negligible with respect to the error due to the LBIE and LRPI discretization (note that in the present work we are mainly concerned with the LBIE and LRPI spatial approximation). From Tables 2 and 3, it can be seen that the LBIE and LRPI methods provide very accurate, stable and fast approximation for option pricing. We observe that the accuracy grows as the number of basis increases gradually, then the option price can be computed with a small financial error in a small computer time. In fact, for example, in LBIE scheme the option pricing is computed with at least 3 correct significant digits. note that, in Table 2, as well as in the following ones, the fact that MaxErrorLBIE is approximately 10−3 means that ULBIE (x, 0) is up to at least the 3th significant digit, equal to U (x, 0). Moreover, the computer times necessary to perform these simulations are extremely small. In fact, using 32 nodal points in domain and 32 time discretization steps, European option is computed with an error of order 10−4 in only 7 × 10−3 second, instead, using 128 nodal points and 128 time discretization steps, the option price is computed with an error of order 10−5 in 0.13 second and using 256 nodal points and 256 time discretization steps, the option price is computed with an error of order 10−6 in 0.44 second. On the other hand, by looking at Table 3, it can also be seen that in LRPI scheme error of orders 10−4 , 10−5 and 10−6 are computed using 64, 256 and 1024 nodal points and time discretization steps, respectively in 0.01, 0.42 and 7.07 seconds. We can observe that the option price computed by LBIE on sub-domains requires approximately 0.44 second to reach an accuracy of 10−6 compared to the 0.42 second required by LRPI method to reach an accuracy of 10−5 on the same number of sub-domains. Therefore, we can simply conclude that in this case LBIE method is more accurate than LRPI method. As the final look at the numerical results in Tables 2 and 3, MaxErrorLRP I we can see MaxError ≈ 4, i.e. LBIE scheme is approximately 4 times accurate than LRPI scheme. Also LBIE rate of convergence of LBIE is 2 but in LRPI, it is approximately 2. Remark 4: The error estimates of MLS approximation are given in [73] and [74] using different strategies. They have proved that the error of this approximation is of order O(∆xm ). According to theoretical bounds, the ratios should be approximately m. As we can see in Ratio of Table 2, the numerical results confirm the analytical bounds. Anyway, the presented schemes have nearly the order 2 (Note that in previous section we consider m = 2). Comparison with previous works: We can compare the prices obtained from the two meshless methods proposed in this paper with a solution computed in [26]. Hon and his co-author [26] proposed Kansa collocation method combined with method of lines (MOL) for the pricing of European options. 23 Kansa collocation method is a well-known strong form meshless method based on radial basis functions (especially multi-quadratic radial basis function which is used in [26]) and also the method of lines is a general way of viewing a time-dependent partial differential equation (PDE) as a system of ordinary differential equations (ODEs). The partial derivatives with respect to the space variables are discretized to obtain a system of ODEs in the variable t. This system could be obtained using an explicit fourth order backward time integration scheme (RK4). However, according to what was reported in [26], the numerical proposed therein allows us to obtain the European option price with the RM SError = 3 × 10−4 using N = 81 and M = 30. In [26], the authors say no any things about the computer time of algorithm but in the other paper of these authors [30], they said that the computer time of Qusi-RBF method for European option pricing which is 12 seconds, is much less than method proposed in [26]. The main reasons of why the our numerical methods are more efficient than the one proposed by [26] are the following: (1) In contrast to the sparse and banded matrices associated with local weak form meshless methods proposed in this paper, the matrices associated to system of the method in [26] usually leads to a fully populated matrices. (2) The approach followed in [26] is based on the MOLs, which allows one to reduce the model to a system of ordinary differential equations (ODEs). However the system of ODEs is solved using RK4 which is a iterative method, in particular, to reach convergence, such an iterative procedure requires us to perform at each time step, a long number of iterations, thus reducing the efficiency of the numerical scheme. However, according to what is reported in this paper, the numerical methods proposed do not have any requirement to solve a system of ODEs. (3) Looking at Tables 2 and 3 and reported result in [26], we can see that the solutions of [26] are slower and more inaccurate than our results. Putting all these things together (comment 2 and this comment), we conclude that the numerical method proposed in this paper is very fast and accurate than the method developed in [26]. (4) More importantly, in [26] there aren’t any stability analysis of scheme. (5) The convergence error of approximated solution obtained by [26] is the same as reported by Remark 4, i.e. O(∆x2 ), but it can be increased using our method by increasing value of m. (please see Remark 4). Let us compare the numerical schemes proposed in this work with that proposed in [30]. Again, in [30], Hon et al. solved this problem using combined MOL method and a strong form meshless method named as Qusi-RBF method. The method is more better than the proposed method in [26], because, the coefficient matrix of the final system is sparse and banded. In [30], the most significant result obtained in Test case 1 is the following: the RM SError is 4 × 10−5 in a computer time 12 seconds using M = 100 and N = 2000. Let us investigate the reasons why the numerical technique proposed in this paper performs significantly better than the method presented in [30]. (1) The final linear system of our work and [30] is a system using banded coefficient matrix with bandwidth 2P + 1, but value of P in our work and [30] is 5 and 20, respectively. Therefore, the coefficient matrix obtained using LBIE and LRPI schemes is very more sparse than [30]. (2) In this work, we solve at every time step a sparse and banded linear system using a powerful iterative algorithm named Bi-conjugate gradient stabilized method with complexity O(2N (2bw + 1)K), whereas in [30], the authors solved the final linear system with a direct method named banded LU factorization method with partial pivoting with complexity O(2N P (P + 2)). In fact, for example, suppose that in [30] we get P = 20 and in our meshless methods we get bw = 5 and K = 5. We can easily see that the complexity of [30] is more bigger that our schemes. (3) Authors of [30] did not present the stability analysis for their method. (4) Looking at Tables 2 and 3 and also reported numerical result in [30], we observed that solution of [30] is slower and more inaccurate than our results. In fact, for example, in [30] option price is founded with RMSError 4 × 10−5 in a computer time 12 seconds using N = 2000 and M = 100, whereas we compute the option price with RMSErrorLBIE 3.45 × 10−5 in a computer time 0.13 in LBIE using N = 128 and M = 128 and also RMSErrorLRP I 4.37 × 10−5 in a computer time 0.42 in LRPI second using N = 256 and M = 256. Putting all these things together we conclude that the numerical methods proposed in this paper are at least thirty of times faster and more efficient than the method of [30]. 4.2. Test case 2 For the second test problem consider an American option with the useful data which are provided in the Table 4. As done in Test case 1, we suppose Smax = 5E. The results of implementing the problem by utilizing the present methods with various number of sub-domains and time discretization steps are shown in Tables 5 and 6. Overall, as already pointed out, following the numerical findings in the different errors, convinces us that the error of the proposed techniques decrease very rapidly as the number of sub-domains in 24 domain and time discretization steps increase. In fact, for example, in LBIE and LRPI schemes the price of the American option can be computed with 3 correct significants in only 0.87 and 0.92 second, respectively which is excellent and very fast. We emphasize that the ratio shown in Tables 5 and 6 are approximately 1.5 order accuracy instead of second order. This is thanks to the fact that this model is a free boundary problem, therefore its solution is non-smoothness which spoils the accuracy of the spatial approximation (again we have experimentally checked that the time discretization alone is second-order accurate and thus the low rate of convergence is due to the error of the spatial approximation). Remark 5: We believe that, in this option model we can do a comparison between our schemes and numerical methods proposed in [30] and [26]. Firs of all, we emphasize that approximately this comparison is substantially analogous with presented comparison between theirs in Test case 1 and requires only minor changes. In particular, looking at Tables 5 and 6 and what is reported in [30] and [26] we simply observe that the numerical methods proposed in this paper perform much better than the numerical methods proposed in [30] and [26]. In fact, for example, the LBIE and LRPI allow us to compute the American option price with the errors 2.08 × 10−3 and 2.02 × 10−3 in 5.13 and 6.49 seconds, respectively (Tables 5 and 6) using N = 512 and M = 512, whereas, it takes 47 seconds for the quasi-RBF scheme to compute the option price with the error 3.4 × 10−3 using N = 2000 and M = 500. Putting all these things together, we conclude that the numerical method proposed in this paper is approximately seven times faster than the method developed in [30]. 5. Conclusions In this paper, the weak form meshless methods namely local boundary integral equation method (LBIE) based on moving least squares approximation (MLS) and local radial point interpolation (LRPI) based on Wu’s compactly supported radial basis functions (WCS-RBFs), were formulated and successfully applied to price European and American options under the Block-Scholes model. Overall the numerical achievements that should be highlighted here are as given in the following: (1) The price of American option is computed by Richardson extrapolation of the price of Bermudan option. In essence the Richardson extrapolation reduces the free boundary problem and linear complementarity problem to a fixed boundary problem which is much simpler to solve. Thus, instead of describing the aforementioned linear complementarity problem or penalty method, we directly focus our attention onto the partial differential equation satisfied by the price of a Bermudan option which is faster and more accurate than other methods. (2) The infinite space domain is truncated to [0, Smax ] with a sufficiently large Smax to avoid an unacceptably large truncation error. The options’ payoffs considered in this paper are non-smooth functions, in particular their derivatives are discontinuous at the strike price. Therefore, to reduce as much as possible the losses of accuracy the points of the trial functions are concentrated in a spatial region close to the strike prices. So, we employ the change of variables proposed by Clarke and Parrott [60]. (3) We used the θ-weighted scheme. Stability analysis of the method is analyzed and performed by the matrix method in the present paper. In fact, according to an analysis carried out in the present paper, the time semi-discretization is unconditionally stable for implicit Euler (θ = 0) and Crank-Nicolson (θ = 0.5) schemes. (4) Up to now, only strong form meshless methods based on radial basis functions (RBFs) and quasiRBF have been used for option pricing in mathematical finance field. These techniques yield high levels of accuracy, but have of a very serious drawback such as produce a very ill-conditioned systems and very sensitive to the select of collocation points. Again we do emphasize that in the new methods presented in this manuscript, coefficient matrix of the linear systems are sparse and banded with bandwidth bw = 2⌊rw ⌋ + 1. It should be noted that these coefficient matrices are positive definite. (5) The present methods are truly a meshless method, which do not need any element or mesh for both field interpolation and background integration. (6) Meshless methods using global RBFs such as Gaussian and multiquadric RBFs have a free parameter known as shape parameter. Despite many research works which are done to find algorithms for selecting the optimum values of ǫ [67, 68, 69, 75, 76], the optimal choice of shape parameter is an open problem which is still under intensive investigation. Cheng et al. [67] showed that when ǫ is very small then the RBFs system error is of exponential order but the solution breaks down when ǫ is smaller than the limiting 25 value. In general, as the value of the shape parameter ǫ decreases, the matrix of the system to be solved becomes highly ill-conditioned. To overcome this drawback of the global RBFs, the local RBFs such as Wu, Wendland and Buhmann compactly supported radial basis functions which are local and stable functions, are proposed which are applied in this work. (7) In the LBIE method, it is difficult to enforce the boundary conditions for that the shape function constructed by the MLS approximation lacks the delta Kronecker property but in LRPIM, using the delta Kronecker property, the boundary conditions can be easily imposed. In LBIE, we use the collocation method to the nodes on the boundary. (8) A crucial point in the weak form meshless methods is an accurate evaluation of the local integrals. Based on MLS and RBFs, the nodal trial functions are highly complicated, hence an accurate numerical integration of the weak form is highly difficult. In this work, the numerical integration procedure used is Simpson’s rule, which is well-known to be fourth-order accurate. (9) It should be noted that LBIE and LRPI schemes lead to banded and sparse system matrices. Therefore, we use a powerful iterative algorithm named the Bi-conjugate gradient stabilized method (BCGSTAB) to get rid of this system. Numerical experiments are presented showing that the LBIE and LRPI approaches are extremely accurate and fast. (10) To demonstrate the accuracy and usefulness of these methods, some numerical examples were presented. For all test cases, the RMSError, MaxError, Ratio and CPU Time of schemes to various nodal points in domain and time discretization steps, were reported. A good agreement between the results for the LBIE and LRPI techniques, and the solutions obtained by other numerical schemes in literature [30] and [26], was observed clearly.The results of our numerical experiments, confirm the validity of the new techniques. 26 References References [1] F. Black, M. Scholes, The pricing of options and corporate liabilities, J. Polit. Econ. 81 (1973) 637–659. [2] M. Brennan, E. Schwartz, Finite difference methods and jump processes arising in the pricing of contingent claim: A synthesis, J. Financ. Quant. Anal. 13 (1978) 461–474. [3] C. Vazquez, An upwind numerical approach for an American and European option pricing model, Appl. Math. Comput. 97 (1998) 273–286. [4] X. Wu, W. Kong, A highly accurate linearized method for free boundary problems, Comput. Math. Appl. 50 (2005) 1241–1250. [5] A. Arciniega, E. Allen, Extrapolation of difference methods in option valuation, Appl. Math. Comput. 153 (2004) 165–186. [6] M.Yousuf, A. Q. M. Khaliq, B. Kleefeld, The numerical approximation of nonlinear Black-Scholes model for exotic path-dependent American options with transaction cost, I. J. Comput. Math. 89 (2012) 1239–1254. [7] R. Zvan, P. A. Forsyth, K. R. Vetzal, A general finite element approach for PDE option pricing models, Ph.D. thesis, University of Waterloo, Waterloo (1998). [8] L. V. Ballestra, C. Sgarra, The evaluation of American options in a stochastic volatility model with jumps: An efficient finite element approach, Comput. Math. Appl. 60 (2010) 1571–1590. [9] L. V. Ballestra, L. Cecere, A numerical method to compute the volatility of the fractional Brownian motion implied by American options, Int. J. Appl. Math. 26 (2013) 203–220. [10] P. A. Forsyth, K. R. Vetzal, Quadratic convergence for valuing American options using a penalty method, SIAM J. Sci. Comput. 23 (2002) 2095–2122. [11] R. Zvan, P. A. Forsyth, K. Vetzal, A Finite Volume approach for contingent claims valuation, IMA J. Numer. Anal. 21 (2001) 703–731. [12] S. J. Berridge, J. M. Schumacher, An irregular grid approach for pricing high-dimensional American options, J. Comput. Appl. Math. 222 (2008) 94–111. [13] A. Q. M. Khaliq, D. A. Voss, S. H. K. Kazmi, Adaptive θ-methods for pricing American options, J. Comput. Appl. Math. 222 (2008) 210–227. [14] A. Q. M. Khaliq, D. A. Voss, S. H. K. Kazmi, A fast high-order finite difference algorithm for pricing American options, J. Comput. Appl. Math. 222 (2008) 17–29. [15] B. F. Nielsen, O. Skavhaug, A. Tveito, Penalty methods for the numerical solution of American multiasset option problems, J. Comput. Appl. Math. 222 (2008) 3–16. [16] J. Zhao, M. Davison, R. M. Corless, Compact finite difference method for American option pricing, J. Comput. Appl. Math. 206 (2007) 306–321. [17] D. Tangman, A. Gopaul, M. Bhuruth, Numerical pricing of options using high-order compact finite difference schemes, J. Comput. Appl. Math. 218 (2008) 270–280. [18] B. Hu, J. Liang, L. Jiang, Optimal convergence rate of the explicit finite difference scheme for American option valuation, J. Comput. Appl. Math. 230 (2009) 583–599. [19] S. Zhang, L. Wang, A fast numerical approach to option pricing with stochastic interest rate, stochastic volatility and double jumps, Commun. Nonlinear Sci. Numer. Simulat. 18 (2013) 1832–1839. 27 [20] J. C. Cox, S. A. Ross, M. Rubinstein, Option pricing: A simplified approach, J. Financ. Econ. 7 (1979) 229–263. [21] M. Broadie, J. Detemple, American option valuation: New bounds, approximations, and a comparison of existing methods, Rev. Financ. Stud. 9 (1996) 1211–1250. [22] M. Gaudenzi, F. Pressacco, An efficient binomial method for pricing American put options, Decis. Econ. Finance 4 (2003) 1–17. [23] S. L. Chung, C. C. Chang, R. C. Stapleton, Richardson extrapolation techniques for the pricing of American-style options, J. Futures Markets 27 (2007) 791–817. [24] A. Khaliq, G. Fasshauer, D. Voss, Using meshfree approximation for multi-asset American option problems, J. Chinese Institute Engineers 27 (2004) 563–571. [25] L. V. Ballestra, G. Pacelli, Pricing European and American options with two stochastic factors: A highly efficient radial basis function approach, J. Econ. Dyn. Cont. 37 (2013) 1142–1167. [26] Y. C. Hon, X. Mao, A radial basis function method for solving options pricing models, Financ. Eng. 8 (1999) 31–49. [27] A. Golbabai, D. Ahmadian, M. Milev, Radial basis functions with application to finance: American put option under jump diffusion, Math. Comp. Modelling 55 (2012) 1354–1362. [28] Z. Wu, Y. C. Hon, Convergence error estimate in solving free boundary diffusion problem by radial basis functions method, Eng. Anal. Bound. Elem. 27 (2003) 73–79. [29] M. D. Marcozzi, S. Choi, C. S. Chen, On the use of boundary conditions for variational formulations arising in financial mathematics, App. Math. Comput. 124 (2003) 197–214. [30] Y. C. Hon, A quasi-radial basis functions method for American options pricing, Comput. Math. Appl. 43 (2002) 513–524. [31] A. Shokri, M. Dehghan, A Not-a-Knot meshless method using radial basis functions and predictorcorrector scheme to the numerical solution of improved Boussinesq equation, Comput. Phys. Commun. 181 (2010) 1990–2000. [32] M. Dehghan, R. Salehi, A boundary-only meshless method for numerical solution of the Eikonal equation, Comput. Mech. 47 (2011) 283–294. [33] M. Dehghan, A. Shokri, Numerical solution of the nonlinear Klein-Gordon equation using radial basis functions, J. Comput. Appl. Math. 230 (2009) 400–410. [34] K. Parand, J. A. Rad, Kansa method for the solution of a parabolic equation with an unknown spacewise-dependent coefficient subject to an extra measurement, Comput. Phys. Commun., (2012) 184 (2013) 582–595. [35] S. Kazem, J. A. Rad, K. Parand, Radial basis functions methods for solving Fokker-Planck equation, Eng. Anal. Bound. Elem. 36 (2012) 181–189. [36] S. Kazem, J. A. Rad, K. Parand, A meshless method on non-Fickian flows with mixing length growth in porous media based on radial basis functions, Comput. Math. Appl. 64 (2012) 399–412. [37] K. Rashedi, H. Adibi, J. Rad, K. Parand, Application of meshfree methods for solving the inverse one-dimensional Stefan problem, Eng. Anal. Bound. Elem. 40 (2014) 1–21. [38] A. A. E. F. Saib, D. Y. Tangman, M. Bhuruth, A new radial basis functions method for pricing American options under Merton’s jump-diffusion model, I. J. Comput. Math. 89 (2012) 1164–1185. [39] L. V. Ballestra, G. Pacelli, A radial basis function approach to compute the first-passage probability density function in two-dimensional jump-diffusion models for financial and other applications, Eng. Anal. Bound. Elem. 36 (2012) 1546–1554. 28 [40] L. V. Ballestra, G. Pacelli, Computing the survival probability density function in jump-diffusion models: A new approach based on radial basis functions, Eng. Anal. Bound. Elem. 35 (2011) 1075– 1084. [41] M. Dehghan, A. Ghesmati, Numerical simulation of two-dimensional sine-gordon solitons via a local weak meshless technique based on the radial point interpolation method (RPIM), Comput. Phys. Commun. 181 (2010) 772–786. [42] D. Mirzaei, M. Dehghan, New implementation of MLBIE method for heat conduction analysis in functionally graded materials, Eng. Anal. Bound. Elem. 36 (2012) 511–519. [43] R. Salehi, M. Dehghan, A generalized moving least square reproducing kernel method, J. Comput. Appl. Math. 249 (2013) 120–132. [44] R. Salehi, M. Dehghan, A moving least square reproducing polynomial meshless method, Appl. Numer. Math. 69 (2013) 34–58. [45] M. Dehghan, A. Shokri, Implementation of meshless LBIE method to the 2D non-linear SG problem, , volume 79 (2009) pages 1662-1682 ., I. J. Numer. Meth. Eng. 79 (2009) 1662–1682. [46] T. Zhu, J. D. Zhang, S. N. Atluri, A local boundary integral equation (LBIE) method in computational mechanics, and a meshless discretization approach, Comput. Mech. 21 (1998) 223–235. [47] J. Wang, G. Liu, A point interpolation meshless method based on radial basis functions, Int. J. Numer. Meth. Eng. 54 (2002) 1623–1648. [48] G. Liu, Y. Gu, An Introduction to Meshfree Methods and Their Programing, Springer, Netherlands, 2005. [49] S. N. Atluri, H. G. Kim, J. Y. Cho, A critical assessment of the truly meshless local Petrov-Galerkin (MLPG), and local boundary integral equation (LBIE) methods, Comput. Mech. 24 (1999) 348–372. [50] T. Zhu, J. D. Zhang, S. N. Atluri, A meshless local boundary integral equation (LBIE) for solving nonlinear problems, Comput. Mech. 22 (1998) 174–186. [51] T. Zhu, J. D. Zhang, S. N. Atluri, A meshless numerical method based on the local boundary integral equation (LBIE) to solve linear and non-linear boundary value problems, Eng. Anal. Bound. Elem. 23 (1999) 375–389. [52] J. Sladek, V. Sladek, C. Zhang, Transient heat conduction analysis in functionally graded materials by the meshless local boundary integral equation method, Comput. Mat. Sci. 28 (2003) 494–504. [53] J. Sladek, V. Sladek, J. Krivacek, C. Zhang, Local BIEM for transient heat conduction analysis in 3-D axisymmetric functionally graded solids, Comput. Mech. 32 (2003) 169–176. [54] M. Dehghan, D. Mirzaei, Meshless local boundary integral equation (LBIE) method for the unsteady magnetohydrodynamic (MHD) flow in rectangular and circular pipes, Comput. Phys. Commun. 180 (2009) 1458–1466. [55] A. Shirzadi, V. Sladek, J. Sladek, A local integral equation formulation to solve coupled nonlinear reaction-diffusion equations by using moving least square approximation, Eng. Anal. Bound. Elem. 37 (2013) 8–14. [56] S. M. Hosseini, V. Sladek, J. Sladek, Application of meshless local integral equations to two dimensional analysis of coupled non-fick diffusion-elasticity, Eng. Anal. Bound. Elem. 37 (2013) 603–615. [57] V. Sladek, J. Sladek, Local integral equations implemented by MLS-approximation and analytical integrations, Eng. Anal. Bound. Elem. 34 (2010) 904–913. [58] X. Li, Meshless galerkin algorithms for boundary integral equations with moving least square approximations, Appl. Numer. Math. 61 (2011) 1237–1256. 29 [59] Z. Wu, Compactly supported positive definite radial functions, Adv. Comput. Math. 4 (1995) 283–292. [60] N. Clarke, K. Parrott, Multigrid for American option pricing with stochastic volatility, Appl. Math. Finance 6 (1999) 177–195. [61] J. C. Hull, Options, Futures, Other Derivatives, 7th ed., Prentice Hall, University of Toronto, 2002. [62] C. C. Chang, J. B. Lin, W. C. Tsai, Y. H. Wang, Using Richardson extrapolation techniques to price American options with alternative stochastic processes, Review of quantitative finance and accounting 39 (2012) 383–406. [63] P. Wilmott, J. Dewynne, S. Howison, Option Pricing: Mathematical Models and Computation, Oxford Financial Press, 1996. [64] M. Dehghan, D. Mirzaei, Meshless local Petrov-Galerkin (MLPG) method for the unsteady magnetohydrodynamic (MHD) flow through pipe with arbitrary wall conductivity, Appl. Numer. Math 59 (2009) 1043–1058. [65] M. Dehghan, D. Mirzaei, The meshless local Petrov-Galerkin MLPG method for the generalized twodimensional non-linear Schrodinger equation, Eng. Anal. Bound. Elem. 32 (2008) 747–756. [66] M. D. Buhmann, Radial Basis Functions: Theory and Implementations, Cambridge University Press, New York, 2004. [67] A. H. D. Cheng, M. A. Golberg, E. J. Kansa, Q. Zammito, Exponential convergence and H-c multiquadric collocation method for partial differential equations, Numer. Meth. Part. D. E. 19 (2003) 571–594. [68] R. E. Carlson, T. A. Foley, The parameter r2 in multiquadric interpolation, Comput. Math. Appl. 21 (1991) 29–42. [69] G. Fasshauer, J. Zhang, On choosing “optimal” shape parameters for RBF approximation, Numer. Algorithms 45 (2007) 346–368. [70] H. V. der Vorst, BCGSTAB: a fast and smoothly converging variant of BCG for the solution of nonsymmetric linear systems, SIAM J.Sci. Stat. Comp. 18 (1992) 631–634. [71] B. N. Datta, Numerical Linear Algebra and Applications, 2th ed., SIAM, 2010. [72] P. Wilmott, S. Howison, J. Dewynne, The Mathematics of Financial Derivatives, Cambridge University Press, 1995. [73] H. Wendland, Scattered Data Approximation, Cambridge University Press, New York, 2005. [74] D. Mirzaei, R. Schaback, M. Dehghan, On generalized moving least squares and diffuse derivatives, IMA J. Numer. Anal. 32 (2012) 983–1000. [75] S. Rippa, An algorithm for selecting a good parameter c in radial basis function interpolation, Advan. Comp. Math. 11 (1999) 193–210. [76] A. E. Tarwater, A parameter study of Hardy’s multiquadric method for scattered data interpolation, Report UCRL-53670, Lawrence Livermore National Laboratory, 1985. 30 Table 1: Test case 1, model parameters and data Volatility 0.2 year−0.5 Interest rate 0.05 year−1 Strike price 10 Maturity 0.5 year Table 2: Test case 1, efficiency of the LBIE scheme N M 16 32 64 128 256 512 1024 16 32 64 128 256 512 1024 N M 16 32 64 128 256 512 1024 16 32 64 128 256 512 1024 RMSErrorLBIE 3.17 × 10−3 2.42 × 10−4 5.90 × 10−5 1.46 × 10−5 3.61 × 10−6 8.78 × 10−7 2.09 × 10−7 MaxErrorLBIE 6.94 × 10−3 5.55 × 10−4 1.38 × 10−4 3.45 × 10−5 8.54 × 10−6 2.10 × 10−6 5.06 × 10−7 RatioLBIE − 3.64 2.01 2.00 2.01 2.02 2.05 CPU Time (s) RatioLRP I − 1.15 1.97 1.97 1.93 1.89 1.79 CPU Time (s) 0.005 0.007 0.02 0.13 0.44 3.79 6.34 Table 3: Test case 1, efficiency of the LRPI scheme RMSErrorLRP I 2.17 × 10−3 1.11 × 10−3 2.82 × 10−4 7.08 × 10−5 1.77 × 10−5 4.40 × 10−6 1.09 × 10−6 MaxErrorLRP I 5.70 × 10−3 2.57 × 10−3 6.54 × 10−4 1.67 × 10−4 4.37 × 10−5 1.18 × 10−5 3.42 × 10−6 31 0.003 0.005 0.01 0.14 0.42 4.11 7.07 Sub−figure 3 Sub−figure 2 Sub−figure 1 0 0 0 20 20 20 40 40 40 60 60 60 80 80 80 100 100 100 120 120 120 0 50 nz = 639 100 0 50 nz = 891 0 100 50 nz = 1141 100 Figure 1: Plot of sparsity for N = 128, rQ = 0.51h and rw = 4rQ (sub-figure 1), rw = 6rQ (sub-figure 2), rw = 8rQ (sub-figure 3) −0.064 −0.066 Spectral radius −0.068 −0.07 −0.072 −0.074 −0.076 LRPI LBIE −0.078 −0.08 0 200 400 600 N, M 800 Figure 2: Spectral radius of Υ in LRPI and LBIE methods 32 1000 1200 Table 4: Test case 2, model parameters and data Volatility 0.3 year−0.5 Interest rate 0.1 year−1 Strike price Maturity 100 1 year Table 5: Test case 2, efficiency of the LBIE scheme N M 64 128 256 512 64 128 256 512 RMSErrorLBIE 5.79 × 10−3 2.74 × 10−3 1.19 × 10−3 4.13 × 10−4 N 64 128 256 512 M 64 128 256 512 RMSErrorLRP I 8.13 × 10−3 3.49 × 10−3 1.37 × 10−3 4.50 × 10−4 MaxErrorLBIE 3.86 × 10−2 1.67 × 10−2 6.11 × 10−3 2.08 × 10−3 RatioLBIE − 1.21 1.44 1.55 CPU Time (s) RatioLRP I − 1.01 1.44 1.51 CPU Time (s) 0.02 0.21 0.92 6.49 0.05 0.22 0.87 5.13 Table 6: Test case 2, efficiency of the LRPI scheme MaxErrorLRP I 3.15 × 10−2 1.56 × 10−2 5.75 × 10−3 2.02 × 10−3 33
5cs.CE
1 When Vehicles See Pedestrians with Phones: A Multi-Cue Framework for Recognizing Phone-based Activities of Pedestrians arXiv:1801.08234v1 [cs.CV] 24 Jan 2018 Akshay Rangesh, Member, IEEE, and Mohan M. Trivedi, Fellow, IEEE Abstract—The intelligent vehicle community has devoted considerable efforts to model driver behavior, and in particular to detect and overcome driver distraction in an effort to reduce accidents caused by driver negligence. However, as the domain increasingly shifts towards autonomous and semi-autonomous solutions, the driver is no longer integral to the decision making process, indicating a need to refocus efforts elsewhere. To this end, we propose to study pedestrian distraction instead. In particular, we focus on detecting pedestrians who are engaged in secondary activities involving their cellphones and similar handheld multimedia devices from a purely vision-based standpoint. To achieve this objective, we propose a pipeline incorporating articulated human pose estimation, followed by a soft object label transfer from an ensemble of exemplar SVMs trained on the nearest neighbors in pose feature space. We additionally incorporate head gaze features and prior pose information to carry out cellphone related pedestrian activity recognition. Finally, we offer a method to reliably track the articulated pose of a pedestrian through a sequence of images using a particle filter with a Gaussian Process Dynamical Model (GPDM), which can then be used to estimate sequentially varying activity scores at a very low computational cost. The entire framework is fast (especially for sequential data) and accurate, and easily extensible to include other secondary activities and sources of distraction. Index Terms—Pedestrian activity recognition, exemplar SVMs, articulated pose tracking, panoramic surround behavior analysis, highly autonomous vehicles, deep learning, computer vision. I. I NTRODUCTION W ITH the explosion of hand-held device usage globally, smart phones have made their way into most hands. This trend is expected to continue as devices get cheaper and find more utility in our day to day lives. As of 2011, there were more phones than people in the USA, and internationally, the number of mobile phone subscriptions is an estimated 5.9 billion. Though such devices are extremely useful and even indispensable for many, it is this very dependence that is a major cause of pedestrian distraction, and possible injury. From here on-wards, we shall make use of the term cellphone as a placeholder for any hand-held multimedia device that a pedestrian may interact with. Distracted walking, like distracted driving, is likely to increase in parallel with the penetration of electronic devices into the consumer market. Although driver distraction has received abundant attention since the turn of the century, distraction among pedestrians is a relatively nascent area of research. The authors are with the Laboratory for Intelligent and Safe Automobiles, University of California, San Diego, CA 92092, USA. email - arangesh, [email protected] Fig. 1: Odds of failing to display optimal crossing behavior for different activities [2], along with their 95% confidence intervals. This is surprising given that pedestrians are in fact prone to acting less cautiously when distracted. Furthermore, a recent report by the Governors Highway Safety Association (GHSA) reveals a disturbing trend - between the mid-1970s and early 2000s, pedestrian deaths steadily declined, eventually dipping to around 11 percent of all motor vehicle fatalities. But since 2009, pedestrian fatalities have actually increased by 15 percent, climbing to 4,735 in 2013. Meanwhile, the percentage of pedestrians killed while using cell phones has risen, from less than 1 percent in 2004 to more than 3.5 percent in 2010, according to [1]. Also, the study shows that the number of pedestrians injured while on their cellphones has more than doubled since 2005. The severity of this phenomenon is further reflected by the number of studies conducted over the last few years, each of which arrive at similar conclusions. In a recent study conducted by Thompson et al. [2], they conclude that nearly one-third (29.8%) of all pedestrians performed a distracting activity while crossing, with text messaging associated with the highest risk among different technological and social factors (Figure 1). Meanwhile, Nasar et al. [1] found that mobilephone related injuries among pedestrians increased relative to total pedestrian injuries, and paralleled the increase in injuries for drivers, and in 2010 exceeded those for drivers. The study by Byington et al. [3] confirms this by a virtual street based simulation, stating that - while distracted, participants waited longer to cross the street, missed more safe opportunities to cross, took longer to initiate crossing when a safe gap was available, looked left and right less often, spent more time 2 looking away from the road, and were more likely to be hit or almost hit by an oncoming vehicle. Moreover, it is noted that the demographic of individuals between ages 18 and 29 is more susceptible to exhibit such behavior. For a detailed report on the global nature of the pedestrian safety problem and the inadequacy of current systems in ensuring it, we refer the reader to [4]. It is also interesting to note that as the emphasis of automobile manufacturers gradually shifts towards more automated vehicles, so must the emphasis placed on preventing pedestrian distraction related injuries. In such scenarios, the intelligent vehicle must be able to gauge the risk associated with each pedestrian, and demonstrate more caution in avoiding those with larger risks. In this study, we focus only on distraction due to technological factors, particularly the use of cellphones for different tasks, and ignore social impacts such as talking or walking in a group. To summarize, we propose to classify each of many pedestrians in an image, into one of 3 activity classes- none, texting and handheld phone call. We additionally extend this approach to work on sequences of images, where knowledge about temporal dynamics can enable faster and more efficient operation. The rest of the paper is organized as follows - Section II briefly outlines some related work in the field. Section III describes the data we are working with, and the semantic annotations that are available for use. Section IV details the proposed methodology to estimate confidence scores of cellphone based activities for a pedestrian using a single image, and section V extends this model to predict a score at every instance for a sequence of pedestrian images. Section VI lists the experiments carried out, and tabulates each of their results. Finally, section VII concludes this work. II. R ELATED W ORK There is an abundance of work related to human activity recognition and classification from the last decade. However, these studies pertain to generic human activities and are not of much use in studying pedestrian distraction. Even though there have been quite a few studies that deal with driver distraction and activity modeling [5]–[8], these models are not directly applicable to pedestrians because the forms of distraction and the activities of interest are considerably different. Nonetheless, there have been ample efforts devoted to studying pedestrians in the context of path prediction, intent analysis and action/activity recognition. We briefly go over these tasks, highlighting how they differ from the goal of this work. This study may appear similar to our previous work [9] in terms of the end goal, however, the proposed methodology is entirely different. We also use a significantly larger dataset and provide a more exhaustive evaluation in comparison to [9]. For a more detailed list of studies conducted on humans around vehicles, we refer the reader to [10]. Path prediction and gait analysis: There have been numerous studies on predicting the trajectories of pedestrians to prevent collisions and improve surround vehicle safety. These methods generally ignore high-level semantics (such as TABLE I: Related work in image based pedestrian safety. Study Path Prediction Intent Analysis Activity Recognition (Output Classes) Moeslund et al. [11] Gandhi et al. [12] Goldhammer et al. [13] Köhler et al. [16] Madrigal et al. [17] 3 3 3 3 3 3 3 3 - Schulz et al. [18] - 3 cross, turn into road, stop Bandyopadhyay et al. [19] Keller et al. [20] Kooij et al. [21] 3 3 3 3 walking, stopping walking, stopping Kataoka et al. [22] - 3 crossing, walking, standing, riding a bicycle Quintero et al. [23] 3 - walking, starting, standing, stopping Choi et al. [24] - - collective activities of pedestrians like crossing, waiting, queuing, walking, talking Rangesh et al. [9] - - using phone, none This work - - texting, handheld phone call, none pedestrian intent) and predict the paths based on low level cues alone [11]–[15]. Intent analysis: The aim of such studies is to make an estimate of the pedestrians’ intention in the near future, so as to take appropriate measures to reduce risk of collision. These studies are commonly carried out in conjunction with path prediction, in a manner that benefits both tasks. Recent examples in this domain are [16]–[21]. Action/Activity recognition: The terms action and activity have been used quite loosely in the context of pedestrians. In most cases, these terms allude to the different stages in the trajectory of a pedestrian [22], [23], e.g. walking, waiting, crossing etc. This notion of activity has also been extended to groups of people, where portions of a crowd are assigned a common activity based on context and collective behavior [24]. In this study, we use the term activity to refer to the secondary activity of a pedestrian being performed in addition to walking/crossing. Although, the tasks listed above are focused on modeling pedestrians and their behavior, none of them consider pedestrian distraction due to secondary activities like cellphone usage (see Table I for reference). Moreover, this study could be complementary to existing studies on pedestrian intention and path prediction, and could result in a more holistic understanding of pedestrian behavior. III. DATASET D ESCRIPTION & S EMANTIC A NNOTATIONS Since pedestrian distraction due to cellphone usage is more common among a young demographic, we mounted 4 GoPro cameras, each facing a different direction, on an intelligent 3 (a) Histogram of pedestrian bounding box heights (b) Pedestrian activities (c) Objects in pedestrian hands (d) Pedestrian samples from the dataset. The joints obtained after articulated pose estimation have been overlaid for reference. Fig. 2: Details pertaining to the proposed dataset. The dataset is demonstrably diverse in viewpoints, pedestrian size, activity and object interactions. vehicle testbed parked at an intersection in the UC San Diego campus. By capturing different viewpoints on each camera, we ensure that pedestrians are not predisposed to appear in a particular location or facing a certain direction. Most of the data is captured on afternoons and evenings, on both sunny and overcast days to ensure diverse illumination conditions and reasonable foot traffic. Since the proposed methodology carries out fine-grained analysis of pedestrians, we avoid night time situations where it is hard to identify small objects and features even for humans. Furthermore, pedestrians are captured holding a variety of objects in addition to cellphones, such as bags, drinks, food and other miscellaneous items. To facilitate the finer analysis of each pedestrian, videos were captured at 2.7k resolution, resulting in pedestrians as large as 1000 pixels in height in a few cases. Figure 2 visualizes certain key statistics of our dataset, and shows a few sample pedestrians chosen at random. The dataset comprises of a total of 1586 cropped pedestrians, each with annotated activities and objects. These pedestrians are then divided into train and test sets using a 75-25 split, while making sure that the fraction of occurrences of each activity is retained in both sets. Additionally, we annotate 7 sequences of pedestrians (3 for training, 4 for testing), each approximately 10 seconds in duration (≈ 300 frames). In this case, the pedestrian is assigned an activity for each frame to account for temporal dynamics. In addition to this, the upper body joints (listed in section IV) are annotated for each frame, to enable evaluation of the proposed articulated pose tracker. IV. S INGLE F RAME ACTIVITY C LASSIFICATION Figure 3 depicts the flow diagram of the proposed activity classification framework. The pipeline takes in an image patch corresponding to a pedestrian, and outputs the corresponding activity. We detail each processing block in the subsections that follow. Image of pedestrian Pose estimation query Hand localization Training exemplars Head localization nearest neighbors Hand analysis Pose analysis Head analysis Activity classification Output class Fig. 3: Flow diagram of proposed methodology for single frame activity classification. A. Articulated Pose Estimation The articulated pose of a pedestrian can be an invaluable cue in estimating the activity he/she is involved in. Recent advances in pose estimation using deep convolutional neural networks (ConvNets) have led to state of the art results on challenging benchmarks. We make use of one such architecture, called the Convolutional Pose Machines [25] proposed by Wei et al. This is a multi-stage ConvNet, where each subsequent stage operates both on image evidence as well as belief maps from preceding stages, gradually refining the pose estimate. This setup offers us great flexibility while choosing the number of stages, with the trade-off being speed versus accuracy. The network has been trained on the MPII 4 TABLE II: PCK scores [32] of the pose estimation module [25] on the test set before and after fine-tuning on the train set. Values close to 1 indicate near-perfect keypoint localization. TABLE III: Fraction of pedestrian hands falling within predicted wrist and hand centered windows for different values of window scale factor α. These evaluations were carried on a separate validation set. right right right left left left head neck shoulder elbow wrist shoulder elbow wrist α Before fine-tuning 1.00 1.00 0.99 1.00 0.96 1.00 1.00 0.94 After fine-tuning 1.00 1.00 0.99 1.00 0.97 1.00 1.00 0.96 dataset comprising of 25K images containing over 40K people, involved in 410 different activities, and outputs the locations of 16 joints corresponding to the articulated pose of a human body. We use this pre-trained network and fine-tune it on our own dataset. This gives us marginal improvements in performance compared to an out-of-the-box implementation (see Table II). Additionally, we only make use of the upper body joints for any further processing, as these are the most informative in our application. The framework can easily accommodate the full body pose instead, if necessary. The final set of keypoint locations retained are - head, neck, left shoulder, left elbow, left wrist, right shoulder, right elbow and right wrist. See Figure 2 for some visual results of the pose estimation module on the proposed dataset. Most human pose estimation algorithms require the rough location and scale of the human in the image plane. In this study, we assume that such information is available beforehand, and focus our attention on analyzing each pedestrian in finer detail. However, if desired, the location and scale of pedestrians may be obtained easily from any generic pedestrian detector. We would also like to point out that many recent studies like [26], [27] demonstrate state-of-the-art multiperson pose estimation in real time, without prior information on pedestrian locations and scales. This makes our approach viable for time critical applications like pedestrian safety and path planning. The pose estimation module is used in our pipeline for three specific purposes. First, it allows us to localize the head and hands of each pedestrian for further examination. Second, it is used to identify similar training exemplars in the pose space. Third, the pose alone may be used as a informative prior over all activities. In each of the following subsections, we make use of the articulated pose in a manner mentioned above. B. Hand Analysis using Exemplar SVMs An important cue for predicting the activity of a pedestrian are the objects they interact with. To identify the objects held in the hands of a pedestrian, we look at local image patches around the location of each hand. To do so, we first regress to the approximate location of the hands of a pedestrian, assuming that it is collinear with the joints corresponding to the elbow and wrist. Let (xe , ye ) and (xw , yw ) denote the image plane coordinates of the elbow and wrist respectively. Using the assumption above, the approximate location of the hand (xh , yh ) is obtained as follows: Wrist-centered Hand-centered window window 0.05 0.07 0.10 0.12 0.15 0.20 xh = xe + 0.0825 0.3400 0.9125 0.9850 0.9975 0.9975 0.7250 0.9275 0.9900 0.9950 0.9975 0.9975 xw − xe yw − ye , yh = ye + , r r (1) where r is a a parameter that depends on the ratio of distances of the elbow from the wrist and hand respectively. In our experiments, r = 5/6 seemed to generate the best results. Once we have the rough locations of both hands in the image plane, we crop out a local image window around these locations. The window size is chosen to be α·h for a pedestrian parametrized by (x, y, w, h). Here α is a hyper-parameter that ensures that the local window scales with the size of the pedestrian. In our experiments, α is set to 0.1 to extract training patches. α is chosen to ensure that the hand almost always falls into the window, and also that the window is small enough to capture only the object of interest and nothing more. As demonstrated in Table III, α = 0.1 offers the best results, beyond which increasing α does not improve hand localization by much. Examples of such local patches for windows centered around both the wrist and the hand can be found in Figure 4. It is obvious that inferring the hand location, even if approximate, helps in centering the object of interest with respect to the window. With a collection of such training patches centered around the hand, we proceed to build an object classifier. Our experiments demonstrated that traditional one-versus-all classifiers severely overfit the training data and failed to generalize well to new object instances. Moreover, training a separate classifier for each object class, as well as the intra-class variance (cellphones come in a variety of shapes and sizes) makes the classification task an especially hard one, considering the limited availability of training data. We bypass all these limitations by training an ensemble of exemplar-SVMs (ESVMs) [28]. The method is based on training a separate linear SVM classifier for every exemplar in the training set. Each ESVM is thus defined by a single positive instance and millions of negatives, obtained by hard negative mining. In our case, an ESVM is trained to represent a rigid HOG template from an image patch around each hand of every pedestrian in the training set. At test time, the ESVM that results in the highest score is considered to provide the best match, and the object label associated with the exemplar is transferred to the new test instance. Figure 5 shows a few examples of matched hand-object instances. 5 ∠x̄(i,j,k) = (a) (b) Fig. 4: Image patches obtained when the local window is centered around the (a)wrist versus the (b)hand. ∠x(i,j,k) . π (3) The final feature vector x ∈ R23 is obtained as a simple concatenation of the set of normalized joint locations and angles. Our experiments indicated this to be much more stable in terms of closest neighbors in comparison to using either just the joint locations, or just the joint angles. With a set of pose features gathered from the pedestrians in the training set, we train a simple K-nearest neighbor classifier using a K-d tree structure for fast neighbor retrieval. E. Pedestrian Activity Classification C. Gaze Analysis The rough gaze direction of a pedestrian can be very effective in separating out instances where pedestrians are just holding a phone, versus when they are actually engaged in its use. In this study, we use the gaze pathway from the GazeFollow Convnet proposed in [29]. The gaze pathway takes in an image patch of the head along with its normalized location in the image plane (obtained from the articulated pose), and returns a 13 × 13 heat-map (Figure 5) that encodes the rough gaze direction of the pedestrian. This sub-network has five convolutional layers followed by three fully-connected layers, the final output of which is a single channel heat-map. Finally, we reshape this output to produce a 169-length feature vector that encodes the gaze. D. Querying Nearest Neighbor Pose Exemplars The main intuition behind our approach is that pedestrians with similar body poses tend to interact with objects in a similar form, and are likely to be involved in analogous activities. To have such a notion of similarity, it is necessary to construct a suitable feature representation of the articulated pose, and to enforce a reasonable distance metric that ensures that similar poses are close by. We make use of a combination of the normalized joint locations and the normalized joint angles as the feature descriptor. Consider a pedestrian bounding box parametrized as (x, y, w, h). Here, x and y correspond to image coordinates of the top left corner of the bounding box, and w and h describe the dimensions of the box. For the pedestrian under consideration, the pose estimation network outputs a set of image locations {xi = (xi , yi )}i=1,··· ,8 corresponding to each joint in the upper body. The set of normalized joint locations {x̄i = (x̄i , ȳi )}i=1,··· ,8 are then found as follows: yi − y xi − x , ȳi = , ∀i = 1, · · · , 8. (2) w h Next, consider the set of joint triplets that are connected consecutively in the articulated pose tree. For each such triplet (xi , xj , xk ), let the angle subtended (in radians) at xj by the line segment joining points xi and xk be denoted by ∠x(i,j,k) . We have 7 such joint angles in the upper body pose. The normalized joint angle at xj is then obtained as follows: x̄i = Having set up the individual parts, we now focus on integrating the cues from the different modalities to predict a final class probability score. For this study, the possible output classes for activity classification are none, texting and handheld phone call, which we encode as y = 0, 1 and 2 respectively. Consider a new pedestrian with pose features xo calculated in the manner described above. The aim now is to predict a class label yo , and estimate the probability associated with this prediction. Let NK denote the set of K nearest neighbor pose exemplars obtained from the trained classifier in IV-D. We denote this set as follows NK = {(eli , oli , eri , ori , hi , yi )}i=1,··· ,K , (4) where eli and eri denote the trained ESVMs on the left and right hands (from IV-B), oli and ori denote the object labels associated with the left and right hands, hi represents the gaze features obtained as mentioned in IV-C, and yi denotes the activity label associated with the ith nearest neighbor exemplar. Let E denote the image evidence available for the pedestrian whose activity is to be predicted. The desired predictive distribution may then be expressed as P(yo |E; NK ) ∝ P(E|yo ; NK ) P(yo ; NK ). (5) Decomposing the image evidence into individual head and hand based evidences Ehead and Ehand , and making use of conditional independence yields P(yo |E; NK ) ∝ P(Egaze |yo ; NK ) P(Ehand |yo ; NK ) P(yo ; NK ). (6) Each term in the equation above is described below  P(Egaze |yo ; NK ) := max 1≤i≤K ho · hi ||ho ||2 · ||hi ||2  · 1{yo } (yi ), (7) where ho and hi are the gaze descriptors, and 1A (·) is the indicator function for set A. This is simply the cosine similarity between the gaze features within the same class. Next, let us denote the maximum match score obtained for ESVM eli on the left hand image patch as pli , and that for eri on the right hand image patch as pri . This probabilistic 6 Gaze ConvNet Gaze ConvNet Gaze ConvNet ESVM w ESVM w Match Match ESVM w Match Fig. 5: Illustration of head and hand related cues described in sections IV-B and IV-C. In each of the three examples above, for a pedestrian in the test set (left), the gaze heatmap obtained from the gaze ConvNet is shown on top and the best hand (object) exemplar match with a pedestrian from the train set is shown below. The matched pedestrian (right) and exemplar weights are shown in addition to the matched hand patch. Best viewed in color. score is obtained by testing each ESVM on the corresponding image patch, and then re-scaling the match score using the parameters determined by carrying out the Platt calibration for each ESVM offline. Further, only matches with an overlap score greater than 0.4 with the test patch are retained as done in [30]. We can now define the hand evidence likelihood as follows - P(Ehand |yo ; NK ) :=     min max pli · 1{0} (yi ),   i       r  max p · 1 (y ) ,  {0} i i   i if yo = 0     l    max pi · 1{1} (oli )+   i        pri · 1{1} (ori ) · 1{yo } (yi ) , if yo = 1, 2, (8) where 1 equals 1 if the object associated with the left hand is a cellphone, else it equals 0. The same is true for 1{1} (ori ) and the right hand. Finally, the term P(yo ; NK ) acts as a prior over the activities, given just the articulated pose of a pedestrian. This is defined to be l {1} (oi ) K P P(yo ; NK ) := i=1 1{yo } (yi ) K V. ACTIVITY C LASSIFICATION FOR S EQUENTIAL DATA In our proposed framework, the major bottleneck in terms of speed is the pose estimation network described in IV-A. Even though it is possible to reliably estimate the pose for a few pedestrians in real time using a GPU (for a reasonable number of stages in the network), the network can no longer operate at a desired frequency when the number of pedestrians in the scene are considerably large. This issue can be alleviated by tracking the articulated pose of pedestrians for the duration between successive outputs from the pose estimation network. This also ensures that the pose estimated by the network makes reasonable transitions between successive instances, thereby reducing single frame errors. A. GPDM-based Particle Filter for Articulated Pose Tracking In this sub-section, we briefly describe the proposed particle filter based tracking framework with a Gaussian Process Dynamical Model (GPDM) [31]. Let xit ∈ R23 be the state of particle i at time t, which represents the normalized pose features of a pedestrian as described in IV-D. Let lit ∈ R2 denote the latent space projection of xit using a Gaussian Process Latent Variable Model (GPLVM) as described below xt = f (lt ; A) + nx,t . . (9) Using the equations 6-9, the final predicted activity for the pedestrian is then chosen to be the MAP estimate - In addition to this, a GPDM enforces an auto-regressive dynamical model in the latent space lt = g(lt−1 ; B) + nl,t . yo∗ = arg max P(y|E; NK ). (10) y∈{0,1,2} Since the probability terms on the right hand side of equation 6 are not calibrated to provide compatible scores, we propose a second method based on late fusion of these scores. To do so, we create 9-length score vectors made up of the terms P(Egaze |yo ; NK ), P(Ehand |yo ; NK ) and P(yo ; NK ) for yo ∈ {0, 1, 2}. These vectors are created by performing a 5 fold cross validation split on the training set. Multi-class classification is carried out in a one versus all manner to predict the final activity of the pedestrian. (11) (12) Here, nx,t and ny,t are zero-mean, white Gaussian processes, f and g are nonlinear mappings parametrized by A and B respectively. Using small training sequences (x0 , x1 , · · · , xT ), we can solve for both the corresponding latent space projections (l0 , l1 , · · · , lT ), and the necessary hyperparameters in closed form [31]. Despite the use of small data sets, the GPDM learns an effective representation of the highly nonlinear dynamics associated with articulated pose tracking. At any instant t, the particle filter functions by propagating a set of particles in the latent space {lit }i , by sampling (with noise) from the dynamical model in equation 12. This 7 TABLE IV: Per class and overall accuracies for four sets of cues - hands alone, pose alone, pose and hands, and pose, hands and gaze. Accuracy Accuracy Accuracy Overall for None for Texting for Phone Call Accuracy Cues (a) hand only pose only pose+hands pose+hands+gaze (b) (c) (d) Fig. 6: Latent space projections of articulated pose trajectories for four different viewpoints. results in an updated set of particles {lit+1 }i . To determine the likelihood of each particle, it is necessary to project the latent particles back into the observation space using the learned GPLVM mapping (equation 11), where they may be evaluated against available measurements. This results in a corresponding set of particles {xit+1 }i in the observation space. To evaluate the likelihood of each particle, we note that most pose estimation networks output a heatmap for each joint location, which can be interpreted as a probabilistic score for its location in the image. With this in mind, let hj (·, ·) denote the heatmap for the j th joint; the function takes in the x and y coordinates of any location on the image plane, and returns the score associated with the location, encoded in the heatmap. The likelihood of a particle lit+1 is then considered to be L(lit+1 ) = L(xit+1 ) := 8 Y hj (xij , yji ), (13) j=1 where (xij , yji ) denotes the co-ordinates of the j th joint obtained from the pose features xit+i . In practice, we train a set of GPDMs for different activities and viewpoints (e.g. walking towards the camera, walking away from the camera, walking sideways etc.). During test time, particles are initialized in latent space by locating the latent point (across all GPDMs) whose mapping in observation space yields the best match with the current measurement. Figure 6 shows the learnt latent space mappings for 4 different viewpoints. B. Avenues for Speedup The tracking framework considerably reduces the burden on the pose estimation network in ensuring near real time operation. When a large number of pedestrians are present in the scene, we can simply run the networks on a subset of pedestrians, while the poses of the rest are updated based on state updates alone. When the network is finally run on a given pedestrian, the heatmaps are used as measurements to update the state of each particle in the filter. Alternatively, one can 0.94 0.90 0.93 0.97 0.58 0.65 0.71 0.88 0.20 0.67 0.81 0.89 0.810 0.858 0.916 0.946 make use of more recent real-time algorithms for multi-person pose estimation [26], [27], which enables faster operation due to reduced overhead from having separate detection and pose estimation modules. Additionally, by only running the ESVMs associated to the K nearest neighbor exemplars, we bypass the computational drawbacks associated with ESVMs. We can further reduce the computational burden required to predict class labels for a pedestrian at every instant in case of sequential data. Once the hand evidence term P(Ehand |yo ; NK ) in equation 8 is reliably estimated for all output classes, we need only update the head evidence and prior terms in equation 6 at every instant. This removes the need to run the ensemble of ESVMs at every frame. VI. E XPERIMENTAL A NALYSIS A. Single Frame Activity Classification The critical hyperparamater that needs to be set for the proposed pipeline is the neighborhood size K. We experiment with a set of different values - K ∈ {25, 50, 100, 200}. Figure 7 shows confusion matrices for different values of K, for both the MAP estimation scheme and the SVM based late fusion. The MAP estimation scheme is seen to perform relatively poorly. This can be attributed to the fact that the pose prior P(yo ; NK ) is far too dominant in comparison to the other two probability terms. This leads to predictions that are overly influenced by the pose term, and hence the considerable false positives for all values of K. In comparison, the SVM weights each individual cue accordingly and predicts a more balanced output. This leads to a much better overall accuracy in comparison to the MAP estimate. The best performance is seen for K = 100, which results in 94.6% overall accuracy. We notice that most mis-classifications in the output correspond to pedestrians who are considerably small in size (≤ 200 pixels in height), which makes it relatively harder to infer object labels and gaze information. Some other error modes are observed in cases where the pedestrian is holding objects that are considerably different to those observed in the training set. This issue however may be alleviated by collecting more data for training. Finally, there are cases where the correct label is ambiguous even to human annotators. This occurs when it is hard to infer the exact direction of gaze or the correct object label. For examplar results on the test dataset, we refer the reader to Figure 8. To understand the contribution and utility of each individual cue while making a prediction, we consider K = 100 corresponding to the best performing method. We train four 8 (a) K = 25 (b) K = 50 (c) K = 100 (d) K = 200 (e) K = 25 (f) K = 50 (g) K = 100 (h) K = 200 Fig. 7: Confusion matrices for MAP estimation (top row), and SVM based late fusion (bottom row). K = 100 with SVM based late fusion results in the best overall accuracy. separate SVM based fusion models, for four different sets of cues - hands only, pose only, pose and hands, and pose, hands and gaze. For each set of such cues, only features based on those cues are used for training the fusion SVM. Table IV shows the per class and overall accuracies for each of these configurations. Pose alone is seen to perform reasonably well, indicating that it is the strongest of the three cues. However, it tends to be too harsh in its assignment, depending too heavily on the nearest neighbors. Adding hand related cues from the ensemble of ESVMs considerably improves the classification accuracy, especially for the texting and phone call classes as these are more reliant on recognition of handobject interactions. Finally, adding gaze information further enhances the performance, noticeably for the texting class since this requires the pedestrian to look at the phone directly. As far as the processing time is concerned, our algorithm with K = 100 nearest neighbors takes about 4ms on average for each pedestrian on a 6th generation i7 CPU. This does not include the time for running the articulated pose estimation module, which we run independently on a Titan X GPU. As mentioned in V-B, state-of-the-art pose estimation for multiple persons is almost nearing real time operation, and the processing times for other operations in our framework are minimal in comparison. This indicates feasibility for real world applications. B. Pose Tracking As tracking the pose enables us to achieve speedups during runtime, it is important to validate its reliability on pedestrian sequences. We do this by training the proposed GPDM based particle filter on three pedestrian sequences. The tracker is then evaluated on 4 separate sequences from the test set using the PCK metric [32]. The results are shown in Table V. While tracking pedestrians in videos captured at 30Hz, it is seen that providing pose measurements even once every 6 frames (5Hz) is more than enough to result in very suitable tracks. TABLE V: PCK scores of proposed articulated pose tracking for different measurement rates, evaluated on 4 different pedestrian sequences. The tracking stays consistent and reliable even for relatively infrequent measurements obtained from the pose ConvNet. Measureright right right left left left ment rate head neck shoulder elbow wrist shoulder elbow wrist untracked 30 Hz 15 Hz 10 Hz 5 Hz 1.000 1.000 0.980 0.980 0.980 1.000 1.000 0.990 0.990 0.990 0.990 1.000 0.981 0.981 0.981 1.000 1.000 0.990 0.908 0.970 0.960 0.980 0.955 0.940 0.940 1.000 1.000 0.975 0.975 0.975 1.000 1.000 0.930 0.925 0.920 0.940 0.940 0.910 0.905 0.895 Furthermore, tracking with a measurement at every frame provides an improvement over the tracks obtained by running the pose ConvNet alone. This illustrates that tracking gives us robust estimates of the pose in addition to making our algorithm run faster. C. Activity Classification for Sequential Data Next, we evaluate our proposed framework on 4 test sequences, each captured at 30 Hz and approximately 10 seconds in duration (280 - 310 frames per sequence). Each frame in a test sequence is annotated with the correct activity class. Our activity classification framework (with K = 100) is run with the proposed articulated pose tracker, and predicts an output class for each frame. Additionally, we run the ensemble of ESVMs once every 50 frames as described in section V-B to reduce the computational burden. We plot the predicted and ground truth classes as a function of the frame number for each of the 4 test sequences in Figure 9. It is clearly observable that the activity classification framework, along with the pose tracker result in class labels that are quite consistent with the ground truth, even under frequent changes in the activity dynamics. 9 y* = 1 y* = 0 y* = 0 y* = 1 y* = 2 y* = 1 y* = 1 y* = 0 y* = 0 y* = 0 y* = 1 y* = 2 y* = 1 y* = 1 y* = 1 yGT = 0 y* = 0 y* = 0 y* = 2 yGT = 0 y* = 1 yGT = 0 Fig. 8: Examples of pedestrians from the test set along with their predicted activity classes (y ∗ ). Correctly predicted classes are enclosed in green boxes, and incorrectly predicted classes are enclosed in red boxes along with the corresponding ground truth class y GT . Ground Truth Output Class Phone Call Ground Truth Output Class Phone Call Ground Truth Output Class Phone Call Ground Truth Output Class Phone Call Texting Texting Texting Texting None None 50 100 150 200 250 300 None 50 100 150 200 250 300 None 50 100 150 200 50 100 150 200 Frame Number Frame Number Frame Number Frame Number (a) Sequence 1 (b) Sequence 2 (c) Sequence 3 (d) Sequence 4 250 300 Fig. 9: Plot of ground truth and predicted output class as a function of frame number for 4 test sequences. VII. C ONCLUDING R EMARKS In this paper, we studied pedestrian distraction caused by cellphone usage in an effort to reduce growing number of pedestrian fatalities. To this end, a multi-cue pipeline to recognize pedestrian activity is proposed. A pedestrian is classified to be either texting, in a phone call, or be involved in no secondary activities based on cues from the articulated pose, hands and gaze. ESVMs trained offline are used to encode hand-object labels, whereas gaze features are obtained from a pre-trained ConvNet. Each cue is then used to propose scores based on the K neighboring pedestrians from the training set. Finally, these scores are combined effectively using an SVM based late fusion scheme. In addition to this, we propose a GPDM based particle filter that operates based on measurements obtained from a pose estimation ConvNet in order to improve pose estimation, and speedup operation. Both the proposed methodology and the tracking framework are trained and evaluated on a unique pedestrian distraction dataset, which provides rich semantic annotations to facilitate a more detailed study of pedestrians. Although the results are promising, there are still many issues to be addressed. Pedestrian activities are rich in variety, and so are the objects they interact with. However, it must be noted that out proposal is highly scalable. Since it works on similarity based metrics obtained from pedestrians in the training set, as more diverse pedestrians are added to the training process, the performance would only improve, and without any evident drop in computational speed. Future work encompasses going beyond phone based distraction, and studying other sources of pedestrian distraction (e.g. talking, walking in a group, listening to music etc.), and integrating all such factors to predict a combined distraction score for each pedestrian. VIII. ACKNOWLEDGMENTS We would like to thank all our colleagues at the LISA lab, UCSD for their assistance in collecting and annotating the dataset. We would also like to express our gratitude to the reviewers and the editor for their valuable comments and suggestions. 10 R EFERENCES [1] J. L. Nasar and D. Troyer, “Pedestrian injuries due to mobile phone use in public places,” Accident Analysis & Prevention, vol. 57, pp. 91–95, 2013. [2] L. L. Thompson, F. P. Rivara, R. C. Ayyagari, and B. E. Ebel, “Impact of social and technological distraction on pedestrian crossing behaviour: an observational study,” Injury prevention, vol. 19, no. 4, pp. 232–237, 2013. [3] K. W. Byington and D. C. Schwebel, “Effects of mobile internet use on college student pedestrian injury risk,” Accident Analysis & Prevention, vol. 51, pp. 78–83, 2013. [4] T. Gandhi and M. M. Trivedi, “Pedestrian protection systems: Issues, survey, and challenges,” Transactions on Intelligent Transportation Systems, vol. 8, no. 3, pp. 413–430, 2007. [5] M. Roth, F. Flohr, and D. M. Gavrila, “Driver and pedestrian awarenessbased collision risk analysis,” in Intelligent Vehicles Symposium (IV), 2016 IEEE. IEEE, 2016, pp. 454–459. [6] T. Hoang Ngan Le, Y. Zheng, C. Zhu, K. Luu, and M. Savvides, “Multiple scale faster-rcnn approach to driver’s cell-phone usage and hands on steering wheel detection,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2016, pp. 46–53. [7] E. Ohn-Bar, S. Martin, A. Tawari, and M. M. Trivedi, “Head, eye, and hand patterns for driver activity recognition,” in Pattern Recognition (ICPR), 2014 22nd International Conference on. IEEE, 2014, pp. 660– 665. [8] A. Tawari, S. Sivaraman, M. M. Trivedi, T. Shannon, and M. Tippelhofer, “Looking-in and looking-out vision for urban intelligent assistance: Estimation of driver attentive state and dynamic surround for safe merging and braking,” in Intelligent Vehicles Symposium Proceedings, 2014 IEEE. IEEE, 2014, pp. 115–120. [9] A. Rangesh, E. Ohn-Bar, K. Yuen, and M. M. Trivedi, “Pedestrians and their phones-detecting phone-based activities of pedestrians for autonomous vehicles,” in Intelligent Transportation Systems (ITSC), 2016 IEEE 19th International Conference on. IEEE, 2016, pp. 1882– 1887. [10] E. Ohn-Bar and M. M. Trivedi, “Looking at humans in the age of self-driving and highly automated vehicles,” Transactions on Intelligent Vehicles, vol. 1, no. 1, pp. 90–104, 2016. [11] A. Mogelmose, M. M. Trivedi, and T. Moeslund, “Trajectory analysis and prediction for improved pedestrian safety: Integrated framework and evaluations,” in Intelligent Vehicles Symposium (IV). IEEE, 2015, pp. 330–335. [12] T. Gandhi and M. M. Trivedi, “Image based estimation of pedestrian orientation for improving path prediction,” in Intelligent Vehicles Symposium. IEEE, 2008, pp. 506–511. [13] M. Goldhammer, M. Gerhard, S. Zernetsch, K. Doll, and U. Brunsmann, “Early prediction of a pedestrian’s trajectory at intersections,” in 16th International Conference on Intelligent Transportation Systems (ITSC). IEEE, 2013, pp. 237–242. [14] A. Prioletti, A. Møgelmose, P. Grisleri, M. M. Trivedi, A. Broggi, and T. B. Moeslund, “Part-based pedestrian detection and featurebased tracking for driver assistance: real-time, robust algorithms, and evaluation,” IEEE Transactions on Intelligent Transportation Systems, vol. 14, no. 3, pp. 1346–1359, 2013. [15] A. Bera, S. Kim, T. Randhavane, S. Pratapa, and D. Manocha, “Glmprealtime pedestrian path prediction using global and local movement patterns,” in Robotics and Automation (ICRA), 2016 IEEE International Conference on. IEEE, 2016, pp. 5528–5535. [16] S. Köhler, M. Goldhammer, S. Bauer, K. Doll, U. Brunsmann, and K. Dietmayer, “Early detection of the pedestrian’s intention to cross the street,” in 15th International Conference on Intelligent Transportation Systems (ITSC). IEEE, 2012, pp. 1759–1764. [17] F. Madrigal, J.-B. Hayet, and F. Lerasle, “Intention-aware multiple pedestrian tracking,” in 22nd International Conference on Pattern Recognition (ICPR). IEEE, 2014, pp. 4122–4127. [18] A. T. Schulz and R. Stiefelhagen, “Pedestrian intention recognition using latent-dynamic conditional random fields,” in Intelligent Vehicles Symposium (IV). IEEE, 2015, pp. 622–627. [19] T. Bandyopadhyay, C. Z. Jie, D. Hsu, M. H. Ang Jr, D. Rus, and E. Frazzoli, “Intention-aware pedestrian avoidance,” in Experimental Robotics. Springer, 2013, pp. 963–977. [20] C. G. Keller and D. M. Gavrila, “Will the pedestrian cross? a study on pedestrian path prediction,” Transactions on Intelligent Transportation Systems, vol. 15, no. 2, pp. 494–506, 2014. [21] J. F. P. Kooij, N. Schneider, F. Flohr, and D. M. Gavrila, “Contextbased pedestrian path prediction,” in European Conference on Computer Vision. Springer, 2014, pp. 618–633. [22] H. Kataoka, Y. Aoki, Y. Satoh, S. Oikawa, and Y. Matsui, “Finegrained walking activity recognition via driving recorder dataset,” in 18th International Conference on Intelligent Transportation Systems (ITSC). IEEE, 2015, pp. 620–625. [23] R. Quintero, I. Parra, D. Llorca, and M. Sotelo, “Pedestrian path prediction based on body language and action classification,” in 17th International Conference on Intelligent Transportation Systems (ITSC). IEEE, 2014, pp. 679–684. [24] W. Choi, K. Shahid, and S. Savarese, “What are they doing?: Collective activity classification using spatio-temporal relationship among people,” in 12th International Conference on Computer Vision Workshops (ICCV Workshops). IEEE, 2009, pp. 1282–1289. [25] S.-E. Wei, V. Ramakrishna, T. Kanade, and Y. Sheikh, “Convolutional pose machines,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 4724–4732. [26] Z. Cao, T. Simon, S.-E. Wei, and Y. Sheikh, “Realtime multiperson 2d pose estimation using part affinity fields,” arXiv preprint arXiv:1611.08050, 2016. [27] G. Papandreou, T. Zhu, N. Kanazawa, A. Toshev, J. Tompson, C. Bregler, and K. Murphy, “Towards accurate multi-person pose estimation in the wild,” arXiv preprint arXiv:1701.01779, 2017. [28] T. Malisiewicz, A. Gupta, and A. A. Efros, “Ensemble of exemplarsvms for object detection and beyond,” in Computer Vision (ICCV), 2011 IEEE International Conference on. IEEE, 2011, pp. 89–96. [29] A. Recasens, A. Khosla, C. Vondrick, and A. Torralba, “Where are they looking?” in Advances in Neural Information Processing Systems, 2015, pp. 199–207. [30] A. Shrivastava, T. Malisiewicz, A. Gupta, and A. A. Efros, “Datadriven visual similarity for cross-domain image matching,” in ACM Transactions on Graphics (TOG), vol. 30, no. 6. ACM, 2011, p. 154. [31] J. M. Wang, D. J. Fleet, and A. Hertzmann, “Gaussian process dynamical models,” in NIPS, vol. 18, 2005, p. 3. [32] Y. Yang and D. Ramanan, “Articulated human detection with flexible mixtures of parts,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 12, pp. 2878–2890, 2013. Akshay Rangesh is currently working towards his PhD in electrical engineering from the University of California at San Diego (UCSD), with a focus on intelligent systems, robotics, and control. His research interests span computer vision and machine learning, with a focus on object detection and tracking, human activity recognition, and driver safety systems in general. He is also particularly interested in sensor fusion and multi-modal approaches for real time algorithms. Mohan Manubhai Trivedi is a Distinguished Professor at University of California, San Diego (UCSD) and the founding director of the UCSD LISA: Laboratory for Intelligent and Safe Automobiles, winner of the IEEE ITSS Lead Institution Award (2015). Currently, Trivedi and his team are pursuing research in intelligent vehicles, machine perception, machine learning, human-robot interactivity, driver assistance, active safety systems. Three of his students have received ”best dissertation” recognitions. Trivedi is a Fellow of IEEE, ICPR and SPIE. He received the IEEE ITS Society’s highest accolade ”Outstanding Research Award” in 2013. Trivedi serves frequently as a consultant to industry and government agencies in the USA and abroad.
1cs.CV
All-Transfer Learning for Deep Neural Networks and its Application to Sepsis Classification arXiv:1711.04450v1 [cs.CV] 13 Nov 2017 Yoshihide Sawada1 and Yoshikuni Sato2 and Toru Nakada2 and Kei Ujimoto2 and Nobuhiro Hayashi3 Abstract. In this article, we propose a transfer learning method for deep neural networks (DNNs). Deep learning has been widely used in many applications. However, applying deep learning is problematic when a large amount of training data are not available. One of the conventional methods for solving this problem is transfer learning for DNNs. In the field of image recognition, state-of-the-art transfer learning methods for DNNs re-use parameters trained on source domain data except for the output layer. However, this method may result in poor classification performance when the amount of target domain data is significantly small. To address this problem, we propose a method called All-Transfer Deep Learning, which enables the transfer of all parameters of a DNN. With this method, we can compute the relationship between the source and target labels by the source domain knowledge. We applied our method to actual twodimensional electrophoresis image (2-DE image) classification for determining if an individual suffers from sepsis; the first attempt to apply a classification approach to 2-DE images for proteomics, which has attracted considerable attention as an extension beyond genomics. The results suggest that our proposed method outperforms conventional transfer learning methods for DNNs. 1 Introduction Deep learning has been widely used in the fields of machine learning and pattern recognition [4, 11, 16, 22, 24, 42, 43] due to its advanced classification performance. Deep learning is used to train a large number of parameters of a deep neural network (DNN) using a large amount of training data. For example, Le et al. [24] trained 1 billion parameters using 10 million videos, and Krizhevsky et al. [22] trained 60 million parameters using 1.2 million images. They collected training data via the web. On the other hand, original data, such as biomedical data, cannot be easily collected due to privacy and security concerns. Therefore, researchers interested in solving the original task are unable to collect a sufficient amount of data to train DNNs. Conventional methods address this problem by applying transfer learning. Transfer learning is a method that re-uses knowledge of the source domain to solve a new task of the target domain [18, 30, 31, 34, 43]. It has been studied in various fields of AI, such as text classification [8], natural language processing [20], and image recognition [35]. Transfer learning for DNN can be divided into three approaches, supervised, semi-supervised, and unsupervised. Recent researches focus on unsupervised domain adaptation [14, 26]. Unsupervised and semisupervised approach assume that the target domain labels equal to 1 2 Advanced Research Division, Panasonic Corporation Department of Life Science, Tokyo Institute of Technology the source domain label. However, in the biomedical field, it is difficult to collect target domain data having the same label as the source domain. Therefore, we focus on the supervised transfer learning approach, which allows the labels of the source/target domain to be different. The state-of-the-art supervised transfer learning [1, 10, 29] construct the first (base) model based on the source domain data by using the first cost function. They then construct the second model based on the target domain data by re-using the hidden layers of the first model as the initial values and using the second cost function. This approach outperforms non-transfer learning when the source and target domains are similar. However, these methods faced with the problem that causes poor classification performance and overfitting when the output layer has to be trained on a significantly small amount of target domain data. Oquab et al. [29] and Agrawal et al. [1] used the Pascal Visual Object Classes [13] and Donahue et al. [10] used ImageNet [7]. The amount of target domain data of their studies was over 1,000 data points. On the other hand, the amount of original biomedical target domain data may be less than 100 data points. To prevent this problem, it is necessary to re-use all layers including the output layer. However, the method for effectively transferring the knowledge (model) including the output layer has yet to be proposed. In addition to the above problem, these methods are not structured to avoid negative transfer. Negative transfer is a phenomenon that degrades classification accuracy when we transfer the knowledge of the source domain/task. It is caused by using parameters computed using the data of the source domain/task irrelevant to the target task. Although Pan et al. [31] considered the avoidance of this phenomenon as a “when to transfer” problem, little research has been published despite this important issue. For example, Rosenstein et al. [34] proposed a hierarchical naı̈ve Bayes to prevent this problem. However, they did not use DNNs, and few articles have been devoted to research pertaining to DNNs. In this article, we propose a novel method based on the transfer learning approach, which uses two cost functions described above. By using this approach, we can prepare the first model in advance. It is difficult to upload the target domain data outside a hospital and prepare a sufficient computer environment, especially for small and medium sized hospitals. Therefore, we argue that this approach fits the clinical demand. The main difference is that our proposed method re-uses all parameters of a DNN trained on the source domain data and seamlessly links two cost functions by evaluating the relationship between the source and target labels on the basis of the source domain knowledge (Section 3). By using this relationship, our method regularizes all layers including the output layer. This means that it can reduce the risk of falling into the local-optimal solution caused by the ran- domness of the initial values. We call our method All-Transfer Deep Learning (ATDL). We applied ATDL to actual two-dimensional electrophoresis (2DE) image [32, 33] classification for determining if an individual suffers from sepsis. Sepsis is a type of disease caused by a dysregulated host response to infection leading to septic shock, which affects many people around the world with a mortality rate of approximately 25% [6, 9, 37]. Therefore, high recognition performance of this disease is important at clinical sites. We use 2-DE images of proteomics to determine sepsis, which is currently attracting considerable attention in the biological field as the next step beyond genomics. In addition, we also show that there is a correlation between the relationship described above and classification performance. This means that ATDL is possible to reduce the risk of negative transfer. We explain 2-DE images in Section 2 and explain experimental results in Section 4. The contributions of this article are as follows: • We propose ATDL for a significantly small amount of training data to evaluate the relationship between the source and target labels on the basis of the source domain knowledge. • The experimental results from actual sepsis-data classification and open-image-data classifications show that ATDL outperforms state-of-the-art transfer learning methods for DNNs, especially when the amount of target domain data is significantly small. • We argue that there is a correlation between the relationship described above and classification performance. • This is the first attempt to apply machine learning by using DNNs to 2-DE images. An actual sepsis-data classification accuracy of over 90% was achieved. 2 Two-dimensional Electrophoresis Images Two-dimensional electrophoresis images represent the difference between the isoelectric points and molecular weights of proteins [32, 33]. Figure 1 shows an overview of the process by which 2-DE images are produced, and Figure 2 illustrates examples of 2-DE images showing sepsis and non-sepsis. Such images are produced by first extracting and refining proteins from a sample. After that, the proteins are split off on the basis of the degree of isoelectric points and molecular weights. Therefore, the X-axis of 2-DE images represents the degree of molecular weights, Y-axis represents the degree of isoelectric points, and black regions represent the protein spots [28]. Normally, 2-DE images are analyzed for detection of a specific spot corresponding to a protein as a bio-marker, using computer assistance [5]. However, many diseases, such as sepsis, are multifactorial, which cause minute changes at many spots and unexpected spots in some cases. Therefore, when the polymerase chain reaction (PCR) method [3], which amplifies specific genes, is applied, we must guess the target genes, and testing of each gene must be carried out. If the number of biomarkers increases, the labor will also increase. On the other hand, if we directly use 2-DE images, this problem can be solved because we can consider the comprehensive changes of proteins at one time. From this situation, we try to use 2-DE images for diagnostic testing instead of using spot analysis. Figure 3 shows an overview of our system for detecting diseases by using 2-DE images. First, a doctor puts a sample of the blood of a patient on a micro-tip, then insert it into a device that can generate 2-DE images. Then, our system detects diseases and display the results to doctors. The main point with our system is to detect diseases, such as sepsis, with complex electrophoresis patterns of 2-DE STUVWXY         !" #$%&'()*+ ,-./0123 45 678 9:;<= >? @AB CDEFGHIJK LMNOPQR Figure 1. Overview of production process of 2-DE images. After extracting and refining proteins from sample, proteins are split off by degree of isoelectric points and molecular weights (SDS-PAGE [32, 33]). Z[\ ]^_`ab cde fghijklmno Figure 2. Examples of 2-DE images. X- and Y-axes represent degrees of molecular weights and isoelectric points, respectively, and black regions represent protein spots. images by using DNNs. It is a matter of course that current devices for generating 2-DE images are not suitable for this concept due to issues such as low-throughput ability and low reproducibility. A few groups [2, 17] have developed techniques to generate 2-DE images with high sensitivity, high throughput ability, and high reproducibility. However, even if they can solve these problems in generating 2-DE images, collecting 2-DE images produced from patients is difficult due to privacy and security concerns. This clearly indicates that the need for a classification method, such as ATDL, for a significantly small amount of training data is increasing. 3.2 Training Process pqrst uvwxyz 3.2.1 Construction of Deep Neural Network for Source Task {|} Š‹ŒŽ ‘’“”•– ~€‚ƒ„ † ‡ˆ‰ Figure 3. Overview of our system for detecting diseases. We focused on classification step involving analysis using DNNs. NOPQRS TUVWXY   µ¶· ¹̧º hi = s(W i h̃i−1 + bi ). ÜÝÞ ÷øù èéê ßàá úûü ôõö ëìí åæç òóñ âãä ýþÿ îïð   åæçèéêëìíîï ðñòóô õö÷ø    yz{|}~€ ‚ƒ„ Z[\]^_ `abcde fghi ()* š›œ ¦§¨ žŸ ©ª« ²³´ £¤¥ °̄± ¡¢ ¬­® §¨© ˆ‰Š •–— ª«¬ ‹ŒŽ ˜™š "#$ ÅÆÇ ÈÉÊËÌ %&'  ! †‡ jklm ¿ À Á ¤ ¥ ¦ ’ “ ” ž Ÿ ­®¯ ‘ ›œ »¼½¾ ¿ÀÁ ÇÈÉ ÃÄÅÆ ÙÚÛ It should be noted that layer i = 0 represents an input layer, that is, h̃0 = x̃s . The weight and bias are computed by minimizing a de-noising reconstruction error [38]. At the output layer ((L + 1)-th layer), we apply a regression function f (.) and the cost function of Ds as follows, nopq v w x rstu  " ¡¢£ ÊËÌÍ ÎÏÐÑ Öר ÒÓÔÕ s l({y s , xs }) = N 1 X s ||y j − f (hL |xsj )||2 , s N j (2) °±²³ ´µ¶· ¼ ½ ¾ ¸¹º» +,-./012 3456789 ÕÖרÙÚ ÛÜÝÞßà áâãä (1) ùúûüýþÿ —˜™ ÍÎÏ ÐÑÒÓÔ We first explain the SdA for constructing Ds . Let xs ∈ RDx denote a Dx dimensional source vector and W i and bi denote a weight matrix and bias vector of the i-th hidden layer (i = 1, 2, · · · , L), respectively. Let x̃ denote a corrupting vector drawn from corruption process q(x̃|x), and s(.) denote a sigmoid function. Then, the i-th hidden vector of Ds is as follows, ÂÃÄ where N s is the amount of source domain data, y sj is a label vector of xsj (yjs (k) = {0, 1}, k = 1, 2, · · · , Dy s ), Dy s is the dimension of y s , and f (hL |xsj ) = hL+1 = W L+1 hL + bL+1 . (3) The parameters of all layers are simultaneously fine-tuned using a stochastic gradient descent. In this article, we use {W i , bi |i = 1, 2, · · · , L + 1} as the initial parameters of Dt . :;<=>?@ABCD EFGHIJKLM Figure 4. Outline of ATDL. (A): Training DNN for source task, (B): computing relation vectors of each target label, (C): tuning all parameters to transfer Ds to Dt . 3 All-Transfer Deep Learning 3.2.2 Computation of Relation Vectors Relation vectors represent the characteristics of the target labels in the Dy s dimensional feature space computed by the source domain knowledge, Ds . Let rl ∈ RDys denote the l-th relation vector (l = 1, 2, · · · , Dy t ), Dy t denote the number of target labels, and xtl ∈ RDx denote a target vector corresponding to the l-th target label. Then, rl is computed using the following equation. 3.1 Overview rl = arg max p(hL+1 |xtl ), hL+1 An outline of the ATDL training process is shown in Figure 4. First, ATDL trains a DNN, Ds , to solve the task of the source domain (Figure 4 (A)). In this study, we constructed Ds on the basis of stacked de-noising autoencoder (SdA) [12, 38]. Second, ATDL computes the output vectors of each target vector by inputting them into the DNN trained on the source domain data (Figure 4 (B)). It then computes the relation vectors of each target label. A relation vector denotes a vector representing the relationship between the source and target labels on the basis of the source domain knowledge, Ds , by using the output vectors. Finally, we fine-tune all parameters in such a way that the variance between the output and relation vectors is sufficiently small (Figure 4 (C)). By using the steps corresponding to Figures 4 (B) and (C), we can transfer Ds to the DNN for the target task Dt , regularizing all parameters including the output layer. This means that ATDL provides Dt , which can avoid the local-optimal solution caused by the randomness of the initial values. (4) where p(hL+1 |xtl ) is the probability distribution of hL+1 given xtl . We assume p(hL+1 |xtl ) obeys a Gaussian distribution. Therefore, rl is equal to the average vector of f (hL |xtl ). t N (l) X 1 rl = t f (hL |xtl,j ), N (l) j (5) where xtl,j and N t (l) are the j-th target domain vector and amount of target domain data corresponding to the l-th target label, respectively. The k-th variable rl (k) means the strength of the relationship between the k-th source label and l-th target label. Therefore, by confirming the values of relation vectors, we can understand which labels of the source domain data are similar to those of the target domain data. 3.2.3 Fine-tuning After computing rl , we set r l as the l-th label vector of the target task, and all parameters including W L+1 and bL+1 are fine-tuned by minimizing the following main cost function using a stochastic gradient descent. It should be noted that this equation represents the variance of the target domain data. D l({r, xt }) = Table 1. CPU Memory GPU Experimental environment. Intel (R) Core (TM) i7-4930K 64.0GB GeForce GTX 760 t yt N (l) 1 X X ||r l − f (hL |xtl,j )||2 , Nt j (6) l where N t = N t (1) + N t (2) + · · · + N t (Dy t ). By using this algorithm, we can have Dt regularizing all parameters by using Ds . 3.3 Classification Process In the classification process, Dt predicts the label l̂ of the test vector x on the basis of the following equation. l̂ = arg min(rl − f (hL |x))⊤ Σl (rl − f (hL |x)), (7) Figure 5. Examples of 2-DE images that differ in extraction and refining protocol of protein. Label number of source domain data is from 1 (top left) to 9 (bottom right) in order. l where Σl is a covariance matrix. It should be noted that classification performance does not improve if r l̂ ≈ rl̂′ (l̂ 6= l̂′ ). This means that the source domain/task is not suitable for transfer. 4 Experimental Results We conducted experiments on 2-DE image classification for determining if an individual suffers from sepsis. We compared the classification performance of five methods: non-transfer learning, simple semi-supervised learning (SSL), transfer learning by Agrawal et al. [1], that by Oquab et al. [29], and ATDL. The SSL is a method to construct a mixture model that computes hi using xs and xt and fine-tunes using only xt . In addition, this method is a special case of that by Weston et al. [40], which embeds the regularizer to the output layer, when the parameter to balance between the object function and regularizer is zero. Agrawal’s method removes the output layer of Ds and adds a new output layer. In addition to these two steps, Oquab’s method contains an additional adaptation layer to compensate for the different statistics of the source and target domain data. Then, Agrawal’s method fine-tunes all layers including the hidden layers [41], and Oquab’s method fine-tunes only the adaptation and output layers. In our study, we used a soft max function as the output layer for constructing Ds of the above transfer learning, SSL, and non-transfer learning methods. To investigate the difference in classification performance, we changed the source domain data and evaluated classification performance. We used 2-DE images that were given different labels from the target domain data of sepsis or non-sepsis, MNIST [25], and CIFAR-10 [21], as the source domain data. In addition, to investigate the generality of our method, we applied it to a convolutional neural network (CNN) [25] and a different task of open-image-data classifications. For open-image-data classifications, we investigated the effectiveness of our method for two open image data classifications. Finally, we investigated the correlation coefficients between the classification performance and Mahalanobis distance of rl . 4.1 Environment and Hyperparameter Settings We used the computer environment summarized in Table 1 and pylearn2 [15] to minimize (2) and (6). In this study, we set the learning rate to λ/(1.00004 × t), where t is the iteration. Momentum gradually increased from 0.5 to µ when t increased. We selected the initial learning rate λ from {1.0 × 10−3 , 5.0×10−3 , 1.0×10−2 , 5.0×10−2 }, final momentum µ from {0.7, 0.99}, and size of minibatches from {10, 100}. 4.2 Actual Sepsis-Data Classification Table 2. List of source 2-DE images. These images represent different extraction and refining protocols of proteins. # of source 2-DE images Type of protocol N s (1) = 25 Change amount of protein N s (2) = 4 Change concentration protocol N s (3) = 30 Unprocessed N s (4) = 49 Removal of only top-2 abundant proteins N s (5) = 11 Focus on top-2 abundant proteins N s (6) = 15 Focus on 14 abundant proteins N s (7) = 12 Plasma sample instead of serum N s (8) = 19 Removal of Sugar chain N s (9) = 15 Other protocols For actual sepsis-data classification, we collected the following number of target 2-DE images N t = 98, sepsis data of N t (1) = 30 and non-sepsis data of N t (2) = 68. The size of the 2-DE images was 53 × 44 pixels (Dx = 2, 332), which was determined to save the information of the large spots. We evaluated classification performance on the basis of two-fold cross validation. As the source domain data, we first used 2-DE images with different labels from the target domain sepsis or non-sepsis data. These images were generated from patients which were diagnosed as being normal. The source task was to classify the differences between the extraction and refining protocols of proteins [39] shown in Table 2 and Figure 5. As shown in Figure 6. Example of relation vectors of actual sepsis-data classification. this table, we set N s = 180 and Dy t = 9. On the other hand, the target 2-DE images were generated using serum and by removing 14 abundant proteins. These data were generated from actual patients at Juntendo University Hospital and were judged by infectious disease tests and SOFA/SIRS score [37]. This study was approved by the institutional review board, and written informed consent was obtained from patients. 4.2.1 Comparison with Conventional Methods Table 3. Classification performance of actual function of the number of hidden layers. PPV NPV PCA + logistic regression 0.875 0.805 Non-transfer (L=1) 0.725 0.983 Non-transfer (L=2) 0.718 0.967 Non-transfer (L=3) 0.644 0.981 Non-transfer (L=4) 0.644 0.981 SSL (L=1) 0.682 1 SSL (L=2) 0.644 0.981 SSL (L=3) 0.592 0.980 SSL (L=4) 0.558 0.978 Oquab et al. [29] (L=1) 0.732 1 Oquab et al. [29] (L=2) 0.771 0.952 Oquab et al. [29] (L=3) 0.702 0.934 Oquab et al. [29] (L=4) 0.658 0.947 Agrawal et al. [1] (L=1) 0.750 1 Agrawal et al. [1] (L=2) 0.744 0.983 Agrawal et al. [1] (L=3) 0.690 0.982 Agrawal et al. [1] (L=4) 0.667 1 ATDL (L=1) 0.844 0.955 ATDL (L=2) 0.871 0.955 ATDL (L=3) 0.875 0.970 ATDL (L=4) 0.958 0.905 sepsis-data classification as MCC 0.545 0.755 0.726 0.676 0.676 0.736 0.676 0.620 0.580 0.783 0.753 0.670 0.648 0.800 0.796 0.722 0.720 0.812 0.834 0.859 0.806 F1 0.609 0.829 0.811 0.773 0.773 0.811 0.773 0.734 0.707 0.845 0.831 0.776 0.761 0.857 0.841 0.806 0.8 0.871 0.885 0.903 0.852 ACC 0.816 0.878 0.867 0.827 0.827 0.857 0.827 0.786 0.755 0.888 0.888 0.847 0.827 0.898 0.888 0.857 0.847 0.918 0.929 0.939 0.918 We compared the classification performances, including that of ATDL, with respect to the changing number of hidden layers L = 1, 2, 3 and 4. We set the dimension of the 1st hidden layer to D1 = 188 by PCA using xs and xt (cumulative contribution of 188 features is over 99.5%), and D2 , D3 , and D4 were set to the same dimensions. Table 3 lists the classification accuracies (ACCs) of six methods including the baseline, PCA + logistic regression (used 188 features). It also lists the positive predictive values (PPVs), negative predictive values (NPVs), Matthews correlation coefficients (MCCs), and F1scores (F1s) as reference. It should be noted that PPV and NPV are Figure 7. Example of relation vectors when source domain data are from CIFAR-10. used in diagnostic tests, MCC is used for evaluating performance considering the unbalance-ness of N t (1) and N t (2), and F1 is the harmonic value computed by precision (=PPV) and recall. As shown in this table, classification accuracy improved by using transfer learning. In addition, the classification accuracy of ATDL (L = 3) outperformed those of the other transfer learning methods. For example, the classification accuracy of ATDL improved at least 4 percentage points compared to that of Agrawal’s method of L = 1. These results suggest that ATDL is effective for performing actual sepsis-data classification. Figure 6 shows an example of relation vectors of sepsis and nonsepsis (L = 3). The red bars represent the relation vector of sepsis, whereas the green bars represent that of non-sepsis. The numbers on the X-axis correspond to the source label indices listed in Table 2. As shown in this figure, the relation vectors of sepsis and non-sepsis differed. These results suggest that rl can represent the characteristics of the target label in the feature space computed by Ds . 4.2.2 Comparison of Various Source Tasks Table 4. Classification performance of actual sepsis-data classification for different source tasks. Non-transfer (Di = 188) Non-transfer (Di = 500) Non-transfer (Di = 1, 000) CIFAR-10 (Di = 188) CIFAR-10 (Di = 500) CIFAR-10 (Di = 1, 000) MNIST (Di = 188) MNIST (Di = 500) MNIST (Di = 1, 000) 2-DE image (Di = 188) 2-DE image (Di = 500) 2-DE image (Di = 1, 000) PPV 0.718 0.644 0.7 0.657 0.923 0.690 0.778 0.839 0.828 0.875 0.844 0.824 NPV 0.967 0.981 0.966 0.889 0.912 0.982 0.968 0.940 0.913 0.970 0.955 0.969 MCC 0.726 0.676 0.709 0.568 0.804 0.722 0.780 0.786 0.735 0.859 0.812 0.818 F1 0.811 0.773 0.8 0.708 0.857 0.806 0.849 0.852 0.813 0.903 0.871 0.875 ACC 0.867 0.827 0.857 0.806 0.918 0.857 0.898 0.908 0.888 0.939 0.918 0.918 We compared classification performance with respect to changing the source domain data, which were obtained from MNIST, CIFAR10, and 2-DE images. The number of images extracted from MNIST and CIFAR-10 were N s = 50, 000. The CIFAR-10 images were converted to gray-scale, and the MNIST and CIFAR-10 images were resized to Dx = 53 × 44 = 2, 332 to ensure they were aligned with the 2-DE images. In addition, we set L = 3 and D1 = D2 = D3 . We Figure 8. Example of relation vectors when source domain data are from MNIST.           Figure 9. CNN structure. also evaluated classification performance with respect to changing the dimension of each hidden layer Di = 188, 500, and 1, 000. Table 4 lists the classification accuracies, and the PPVs, NPVs, MCCs, and F1s as reference. The classification accuracy based on the use of 2-DE images as the source domain data was higher than those obtained with MNIST and CIFAR-10, although the number of 2-DE images was smaller (N s = 180). Figure 7 shows an example of the relation vectors using CIFAR10 (Di = 500) and Figure 8 shows them using MNIST (Di = 500). Compared to Figure 6, the relation vector of sepsis was considerably closer to that of non-sepsis. These results show that information on the differences between the extraction and refining protocols of proteins is useful for classifying sepsis, rather than using CIFAR-10 and MNIST. Namely, if we collect the source domain data, we have to consider the relationship between the source and target domain data. 4.2.3 Applying ATDL to Convolutional Neural Network Table 5. Classification performance when ATDL was applied to CNN. PPV NPV MCC F1 ACC Non-transfer 0.717 0.966 0.726 0.812 0.867 ATDL 0.829 0.984 0.845 0.892 0.929 To investigate the effectiveness of our method regarding other DNNs, we applied it to a CNN and evaluated its classification performance by using 2-DE images as the source domain data. Figure 9 shows the structure of the CNN, which was determined on the basis of two-fold cross validation with respect to changing the hyperparameters shown in this figure. Table 5 lists the classification performances. The ATDL performed better than the non-transfer learning method and approximately equal to the SdA of ATDL (L = 3) shown in Table 3. Thus, these results suggest that ATDL is applicable to CNNs as well as SdAs. The CNN Figure 10. Relation vectors when ATDL was applied to CNN. Numbers on X-axis correspond to source label indices. is widely used in image recognition and achieves high classification accuracy on several standard data [19, 23, 24]. Therefore, we consider that ATDL is possible to be applied to various image recognition problems. Figure 10 shows the relation vectors. Sepsis had a relationship to the 4th source label (removal of only top-2 abundant proteins), which is the same as in Figure 6. This result suggests that there are biological relationships between them. In the future, we plan to examine this result from a biological point of view. 4.3 Open-Image Data Experiment Table 6. Accuracy of automobile and pedestrian crossing. # of target images N t 400 1,500 Non-transfer 0.724 0.753 SSL 0.750 0.789 Oquab et al. [29] 0.763 0.782 Agrawal et al. [1] 0.753 0.781 ATDL 0.789 0.797 Table 7. Accuracy of MNIST. # of target images N t 1,000 5,000 Non-transfer 0.854 0.926 SSL 0.844 0.928 Oquab et al. [29] 0.773 0.875 Agrawal et al. [1] 0.844 0.923 ATDL 0.887 0.928 10,000 0.945 0.951 0.887 0.951 0.932 To investigate the generalization of our method, we first applied our method to two open image data classifications: (1) CIFAR10 [21] as the source domain and images of an automobile and pedestrian crossing from ImageNet [22] as the target domain, and (2) SVHN [27] as the source domain and MNIST [25] as the target domain. Task (1) is an example in which the source/target domain data consist of color images, and (2) is an example of multiclass classification. For task (1), we constructed Ds on the basis of the SdA and set L = 3, Dy s = 10, Di = 1, 000 (i = 1, 2, 3), and N s = 50, 000. As the target test data, we used 750 images of automobile and 750 images of pedestrian crossing. For task (2), we also constructed Ds on the basis of the SdA and set L = 3, Dy s = 10, Di = 100 (i = Figure 11. Example of relation vectors of task (1). 89: 567 F G 234 H I /01 [ ,-. Figure 13. Relationship between Mahalanobis distance and classification performance. Blue lines represent classification performance of non-transfer learning method. )*+ &'( % !#$ ; < = > ? @ A B JKLMNO PQRST UVWXYZ C DE Figure 12. Example of relation vectors of task (2) (N t = 1, 000). Table 8. Correlation coefficient R and p-value of each classification performance. PPV NPV MCC F1 ACC R 0.627 0.521 0.663 0.657 0.665 p-value < 0.01 < 0.01 < 0.01 < 0.01 < 0.01 1, 2, 3), N s = 73, 257, and SVHN images were converted to grayscale. As the target test data, we used 10, 000 images from MNIST. Test images of task (1) and (2) were not included in the training target domain data. Table 6 and 7 list the classification accuracies of the five methods for different amounts of target domain data. It should be noted that we could not conduct actual sepsis-data classification in this experiment because collecting sepsis data is difficult. As shown in these tables, our method outperformed other methods when N t = 400, 1, 500 for task (1) and N t = 1, 000 for task (2). These results suggest that our method is effective when the amount of target domain data is significantly small. Figure 11 and 12 show examples of the relation vectors of each task. As shown in these figures, the target automobile showed a relationship with the source automobile (2nd source label) and source truck (10th source label). In addition, the highest relation of the character “6” of MNIST was the character “6” of SVHN. On the other hand, the relation vectors of the target automobile/pedestrian crossing differed. These results suggest that r l enabled the representation of the target label characteristics in the feature space computed by Ds , the same as 2-DE images. transfer. Let M denote the number of source domain sub-groups, Nas (a = 1, 2, · · · , M ) denote the amount of a-th source domain sub-group data, and X a = {y sb , xsb |b = 1, 2, · · · , Nas } denote the a-th source domain sub-group data sampled from all source domain data X. We constructed Dsa by using X a and computed the Mahalanobis distance dm (a) of r l by inputting the a-th DNN Dsa . Then, we finetuned to transfer from Dsa to Dt . We used MNIST as X and set M = 100 and Nas = 5, 000 (a = 1, 2, · · · , M ). Sub-groups were randomly selected from X, and Dsa was constructed on the basis of the SdA. The target task was sepsis-data classification, and we set L = 1, D1 = 188, and N t = 49 (N t (1) = 15, N t (2) = 34). As the target test data, we used 15 images of sepsis and 34 images of non-sepsis. It should be noted that all hyperparameters were fixed. To evaluate the relationship between dm (a) and classification performance t(a), we computed the correlation coefficient R as follows. 4.4 Correlation of Performance and Distance As described above, the classification performance of ATDL depends on the distance of rl . In this subsection, we discuss the investigation of the correlation between classification performance and Mahalanobis distance dm . If they correlate, ATDL can be used to select Ds before the fine-tuning process and reduce the risk of negative PM (dm (a) − d¯m )(t(a) − t̄) R = qP a , M ¯ 2 PM (t(a) − t̄)2 a (dm (a) − dm ) a (8) where d¯m and t̄ are the averages of dm and t. Figure 13 shows dm (a) and the corresponding classification performances, and Table 8 lists the correlation coefficients and p-values. The blue lines in Figure 13 represent the performance of non-transfer learning. The Mahalanobis distance and classification performances correlated, suggesting that higher classification performance than that of non-transfer learning is possible by using Dsa with large dm (a). This means that we can select Dsa effectively before the fine-tuning process. 5 Conclusion We proposed ATDL, a novel transfer learning method for DNNs, for a significantly small amount of training data. It computes the relation vectors that represent the characteristics of target labels by the source domain knowledge. By using the relation vectors, ATDL enables the transfer of all knowledge of DNNs including the output layer. We applied ATDL to actual sepsis-data classification. The experimental results showed that ATDL outperformed other methods. We also investigated the generality of ATDL with respect to changing the DNN model and target task, and compared the classification performance with respect to changing the source domain data. From the results, we argue that our method is applicable to other tasks, especially when the amount of target domain data was significantly small, and classification performance improves when we use the source domain data that are similar to the target domain data. Furthermore, we showed the possibility of selecting an effective DNN before the fine-tuning process. To the best of our knowledge, this work involved the first trial in which 2-DE images were analyzed using the classification approach, which resulted in over 90% accuracy. Thus, this article will be influential not only in machine learning, but also medical and biological fields. In the future, we will collect source domain 2-DE images that can be uploaded easily, apply ATDL to a deeper network, predict classification performance more accurate, and analyze the relation vectors from a biological point of view. 6 Acknowledgments We would like to acknowledge Dr. Iba, Professor of Juntendo University School of Medicine, for his help in collecting samples to generate 2-DE images. REFERENCES [1] Pulkit Agrawal, Ross Girshick, and Jitendra Malik, ‘Analyzing the performance of multilayer neural networks for object recognition’, in Proceedings of the European Conference on Computer Vision, 329–344, (2014). [2] Stephen Barnes, Helen Kim, and Victor M Darley-Usmar, ‘High throughput two-dimensional blue-native electrophoresis: a tool for functional proteomics of mitochondria and signaling complexes’, Proteomics, 2, 969–977, (2002). [3] John MS Bartlett and David Stirling, ‘A short history of the polymerase chain reaction’, PCR protocols, 3–6, (2003). [4] Yoshua Bengio, ‘Learning deep architectures for AI’, Foundations and trends in Machine Learning, 2(1), 1–127, (2009). [5] Matthias Berth, Frank Michael Moser, Markus Kolbe, and Jörg Bernhardt, ‘The state of the art in the analysis of two-dimensional gel electrophoresis images’, Applied microbiology and biotechnology, 76(6), 1223–1243, (2007). [6] R Phillip Dellinger, Mitchell M Levy, Andrew Rhodes, Djillali Annane, Herwig Gerlach, Steven M Opal, Jonathan E Sevransky, Charles L Sprung, Ivor S Douglas, Roman Jaeschke, et al., ‘Surviving sepsis campaign: international guidelines for management of severe sepsis and septic shock, 2012’, Intensive care medicine, 39(2), 165–228, (2013). [7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei, ‘Imagenet: A large-scale hierarchical image database’, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, (2009). [8] Chuong Do and Andrew Y Ng, ‘Transfer learning for text classification’, in Proceedings of the Advances in Neural Information Processing Systems, pp. 299–306, (2005). [9] Viktor Y Dombrovskiy, Andrew A Martin, Jagadeeshan Sunderram, and Harold L Paz, ‘Rapid increase in hospitalization and mortality rates for severe sepsis in the united states: A trend analysis from 1993 to 2003’, Critical care medicine, 35(5), 1244–1250, (2007). [10] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell, ‘Decaf: A deep convolutional activation feature for generic visual recognition’, in Proceedings of the International Conference on Machine Learning, pp. 647–655, (2014). [11] Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang, ‘Learning a deep convolutional network for image super-resolution’, in Proceedings of the European Conference on Computer Vision, 184–199, Springer, (2014). [12] Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio, ‘Why does unsupervised pretraining help deep learning?’, The Journal of Machine Learning Research, 11, 625–660, (2010). [13] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman, ‘The pascal visual object classes (VOC) challenge’, International journal of computer vision, 88(2), 303–338, (2010). [14] Yaroslav Ganin and Victor Lempitsky, ‘Unsupervised domain adaptation by backpropagation’, in ICML, pp. 1180–1189, (2015). [15] Ian J. Goodfellow, David Warde-Farley, Pascal Lamblin, Vincent Dumoulin, Mehdi Mirza, Razvan Pascanu, James Bergstra, Frédéric Bastien, and Yoshua Bengio, ‘Pylearn2: a machine learning research library’, arXiv preprint arXiv:1308.4214, (2013). [16] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean, ‘Distilling the knowledge in a neural network’, in Proceedings of the Deep Learning and Representation Learning Workshop, (2014). [17] Atsunori Hiratsuka, Hideki Kinoshita, Yuji Maruo, Katsuyoshi Takahashi, Satonari Akutsu, Chie Hayashida, Koji Sakairi, Keisuke Usui, Kisho Shiseki, Hajime Inamochi, et al., ‘Fully automated twodimensional electrophoresis system for high-throughput protein analysis’, Analytical chemistry, 79(15), 5730–5739, (2007). [18] Junlin Hu, Jiwen Lu, and Yap-Peng Tan, ‘Deep transfer metric learning’, in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 325–333, (2015). [19] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell, ‘Caffe: Convolutional architecture for fast feature embedding’, in Proceedings of the ACM International Conference on Multimedia, pp. 675–678, (2014). [20] Jing Jiang and ChengXiang Zhai, ‘Instance weighting for domain adaptation in nlp’, in Proceedings of the Annual Meeting of the Association for Computational Linguistics, pp. 264–271, (2007). [21] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. master’s thesis, university of tronto, 2009. [22] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton, ‘Imagenet classification with deep convolutional neural networks’, in Proceedings of the Advances in neural information processing systems, pp. 1097– 1105, (2012). [23] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton, ‘Imagenet classification with deep convolutional neural networks’, in NIPS, volume 1, pp. 1–9, (2012). [24] Quoc V Le, ‘Building high-level features using large scale unsupervised learning’, in Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 8595–8598, (2013). [25] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner, ‘Gradient-based learning applied to document recognition’, in Proceedings of the IEEE, volume 86, pp. 2278–2324, (1998). [26] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan, ‘Learning transferable features with deep adaptation networks’, in ICML, pp. 97–105, (2015). [27] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng, ‘Reading digits in natural images with unsupervised feature learning’, In NIPS workshop on deep learning and unsupervised feature learning, 1–9, (2011). [28] Patrick H O’Farrell, ‘High resolution two-dimensional electrophoresis of proteins.’, Journal of biological chemistry, 250(10), 4007–4021, (1975). [29] Maxime Oquab, Leon Bottou, Ivan Laptev, and Josef Sivic, ‘Learning [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] and transferring mid-level image representations using convolutional neural networks’, in Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pp. 1717–1724, (2014). Sinno Jialin Pan, Ivor W Tsang, James T Kwok, and Qiang Yang, ‘Domain adaptation via transfer component analysis’, IEEE Transactions on Neural Networks, 22(2), 199–210, (2011). Sinno Jialin Pan and Qiang Yang, ‘A survey on transfer learning’, IEEE Transactions on Knowledge and Data Engineering, 22(10), 1345–1359, (2010). Thierry Rabilloud, Mireille Chevallet, Sylvie Luche, and Cécile Lelong, ‘Two-dimensional gel electrophoresis in proteomics: past, present and future’, Journal of proteomics, 73(11), 2064–2077, (2010). Thierry Rabilloud and Cécile Lelong, ‘Two-dimensional gel electrophoresis in proteomics: a tutorial’, Journal of proteomics, 74(10), 1829–1841, (2011). Michael T Rosenstein, Zvika Marx, Leslie Pack Kaelbling, and Thomas G Dietterich, ‘To transfer or not to transfer’, in Proceedings of the NIPS’05 Workshop on Inductive Transfer: 10 Years Later, volume 2, pp. 7–10, (2005). Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell, ‘Adapting visual category models to new domains’, in Proceedings of the European Conference on Computer Vision, 213–226, (2010). Yoshihide Sawada, Yoshikuni Sato, Toru Nakada, Kei Ujimoto, and Nobuhiro Hayashi, ‘All-transfer learning for deep neural networks and its application to sepsis classification’, in ECAI, pp. 1586–1587, (2016). Mervyn Singer, Clifford S Deutschman, Christopher Warren Seymour, Manu Shankar-Hari, Djillali Annane, Michael Bauer, Rinaldo Bellomo, Gordon R Bernard, Jean-Daniel Chiche, Craig M Coopersmith, et al., ‘The third international consensus definitions for sepsis and septic shock (sepsis-3)’, Jama, 315(8), 801–810, (2016). Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol, ‘Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion’, The Journal of Machine Learning Research, 11, 3371–3408, (2010). John M Walker, The proteomics protocols handbook, Springer, 2005. Jason Weston, Frédéric Ratle, Hossein Mobahi, and Ronan Collobert, ‘Deep learning via semi-supervised embedding’, in Neural Networks: Tricks of the Trade, 639–655, Springer, (2012). Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson, ‘How transferable are features in deep neural networks?’, in Advances in Neural Information Processing Systems, pp. 3320–3328, (2014). Bolei Zhou, Agata Lapedriza, Jianxiong Xiao, Antonio Torralba, and Aude Oliva, ‘Learning deep features for scene recognition using places database’, in Proceedings of the 27th Advances in Neural Information Processing Systems, pp. 487–495, (2014). Fuzhen Zhuang, Xiaohu Cheng, Ping Luo, Sinno Jialin Pan, and Qing He, ‘Supervised representation learning: transfer learning with deep autoencoders’, in Proceedings of the International Conference on Artificial Intelligence, pp. 4119–4125, (2015).
1cs.CV
arXiv:1504.01148v2 [math.AC] 12 May 2016 On The Cohomological Dimension of Local Cohomology Modules Vahap Erdoğdu and Tuğba Yıldırım∗ Dedicated to the memory of Alexander Grothendieck Department of Mathematics Istanbul Technical University Maslak, 34469, Istanbul, Turkey Abstract Let R be a Noetherian ring, I an ideal of R and M an R-module with cd(I, M ) = c. In this article, we first show that there exists a descending chain of ideals I = Ic ) Ic−1 ) · · · ) I0 of R such that for each 0 ≤ i ≤ c − 1, cd(Ii , M ) = i and that the top local cohomology module HiIi (M ) is not Artinian. We then give sufficient conditions for a non-negative integer t to be a lower bound for cd(I, M ) and use this to conclude that in non-catenary Noetherian local integral domains, there exist prime ideals that are not set theoretic complete intersection. Finally, we set conditions which determine whether or not a top local cohomology module is Artinian. Keywords: Top local cohomology modules, Cohomological dimensions, Set theoretic complete intersections. 2000 Mathematics Subject Classification. 13D45, 13E10. 1 Introduction Throughout, R denote a commutative Noetherian ring with unity, I an ideal of R. For an R-module M, the i-th local cohomology module of M with support in I is defined as HiI (M) = lim ExtiR (R/I n , M). → ∗ Corresponding author 1 For details about the local cohomology modules, we refer the reader to [4] and [7]. One of the important invariant related to local cohomology modules is the cohomological dimension of M with respect to I, denoted by cd(I, M), and defined as: cd(I, M) = sup {i ∈ N | HiI (M) 6= 0}. If M = R, we write cd(I) instead of cd(I, R). There are two interesting questions related to local cohomology modules, the first one is to determine the lower and upper bounds for cd(I, M) and the second one is to determine whether or not HiI (M) is Artinian(see e.g. [1], [5], [6], [8], [9] and [10]). Our results in this regard are as follows: In section 2, we show that for an R-module M with cd(I, M) = c, there is a descending chain of ideals I = Ic ) Ic−1 ) · · · ) I0 of R such that for each 0 ≤ i ≤ c, cd(Ii , M) = i, and that the top local cohomology module HiIi (M) is not Artinian. In section 3, we prove a result that gives a sufficient condition for an integer to be a lower bound for the cohomological dimension, cd(I, M), of M at I. One of the important conclusion of this result is that over a Noetherian local ring (R, m), for a finitely generated R-module M of dimension n and an ideal I of R with dim(M/IM) = d ≥ 1, n − d is a lower bound for cd(I, M) and if moreover cd(I, M) = n − d, then Hdm (HIn−d (M)) ∼ = Hnm (M). As an application of this result, we show that in non-catenary Noetherian local integral domains, there exist prime ideals that are not set theoretic complete intersection. In section 4, we examine the Artinianness and non-Artinianness of top local cohomology modules. 2 Descending Chains With Successive Cohomological Dimensions In this section, we prove the existence of descending chains of ideals and locally closed sets with successive cohomological dimensions. The main result of this section is the following: 2 Theorem 2.1. Let R be a Noetherian ring, I an ideal of R and M an Rmodule with cd(I, M) = c > 0. Then there is a descending chain of ideals I = Ic ) Ic−1 ) · · · ) I0 such that cd(Ii , M) = i for all i, 0 ≤ i ≤ c. Moreover HiIi (M) is not Artinian for all i, 0 ≤ i ≤ c − 1. Proof. Consider the set S = { J ( I | cd(J, M) < c }. Clearly, the zero ideal belongs to S and so S is a non-empty subset of ideals of R. Since R is Noetherian, S has a maximal element, say Ic−1 . We claim that cd(Ic−1, M) = c − 1. To prove this, let x ∈ I \ Ic−1 and so Ic−1 + Rx ⊆ I. But then it follows from the maximality of Ic−1 in S and Remark 8.1.3 of [4] that c ≤ cd(Ic−1 + Rx, M) ≤ cd(Ic−1 , M) + 1 < c + 1. Hence cd(Ic−1 + Rx, M) = c. Now consider the exact sequence ··· / (Hc−1 Ic−1 (M))x / HcIc−1 +Rx (M) / HcIc−1 (M) = 0 . Since HcIc−1 +Rx (M) is nonzero, it follows that (Hc−1 Ic−1 (M))x is nonzero, then c−1 so is HIc−1 (M). Therefore the claim follows. Iterating this argument, one can obtain a descending chain of ideals, as desired. For the second part, let x ∈ Ii+1 \ Ii and consider the ideal Ii + Rx. Then it follows from the construction of the ideal Ii that cd(Ii + Rx, M) = i + 1. Now HiIi (M) is non-Artinian follows from Corollary 4.1 of [5]. Recall that a subspace Z of a topological space X is said to be locally closed, if it is the intersection of an open and a closed set. Let X be a topological space, Z ⊆ X be a locally closed subset of X and let F be an abelian sheaf on X. Then the ith local cohomology group of F with support in Z is denoted by HZi (X, F ). We refer the reader to [7] and [11] for its definition and details. If, in particular, X = Spec(R) is an affine scheme, where R is a commutative Noetherian ring, and F = M ∼ is the quasi coherent sheaf on X associated to an R-module M, we write HZi (M) instead of HZi (X, M ∼ ). The following corollary may be considered as an easy application of our result above. 3 Corollary 2.2. Let R be a Noetherian ring, M an R-module and I an ideal of R such that cd(I, M) = c > 1. Then there is a descending chain of locally closed sets Tc−1 ) Tc−2 ) · · · ) T1 in Spec(R) such that cd(Ti , M) = i for all 1 ≤ i ≤ c − 1. Proof. Let I be an ideal of R with cd(I, M) = c > 1. Then it follows from Theorem 2.1 that there is a descending chain of ideals I = Ic ) Ic−1 ) · · · ) I1 ) I0 such that cd(Ii , M) = i for all 0 ≤ i ≤ c. Let now Ui = V (Ii ) and define the locally closed sets Ti := U1 \ Ui+1 . Then it is easy to see that Tc−1 ) Tc−2 ) · · · ) T1 . On the other hand, it follows from Proposition 1.2 of [11] that there is a long exact sequence, ··· / HUj 1 (M) / HTj i (M) / H j+1 (M) Ui+1 / HUj+1 (M) 1 / ··· j As HUj i (M) ∼ = HIi (M) for all 1 ≤ i ≤ c − 1 and for all j ≥ 0, it follows from the above long exact sequence that cd(Ti , M) = i. 3 Lower Bound For Cohomological Dimension The main purpose of this section is to establish a lower bound for cohomological dimension and, in this regard, we prove the following theorem which gives a sufficient condition for an integer t to be a lower bound for cd(I, M). Theorem 3.1. Let R be a Noetherian ring, M an R-module (not necessarily finitely generated) and I an ideal of R with dim(R/I + Ann M ) = d. Let t ≥ 0 be an integer. If there exists an ideal J of R such that Hd+t I+J (M) 6= 0, then t is a lower bound for cd(I, M). Moreover, if cd(I, M) = t, then HdJ (HtI (M)) ∼ = Hd+t I+J (M) and dim Supp(HtI (M)) = d. 4 Proof. Consider the Grothendieck’s spectral sequence E2p,q = HpJ (HqI (M)) =⇒ Hp+q I+J (M) and look at the stage p + q = n. Since Supp(HqI (M)) ⊆ V (I) ∩ Supp(M) ⊆ V (I + Ann M), dim Supp(HqI (M)) ≤ d for all q. Therefore it follows from Grothendieck’s vanishing theorem that for all p > d, E2p,d+t−p = 0. But then since from the hypothesis Hd+t I+J (M) does not vanish, there is at least one p ≤ d such that E2p,d+t−p = HpJ (Hd+t−p (M)) 6= 0. I Hence Hd+t−p (M) 6= 0 and so cd(I, M) ≥ d + t − p ≥ t. I If, in particular, cd(I, M) = t, then E2p,q = 0 for all q > t. Now from the subsequent stages of the spectral sequence Ekd−k,t+k−1 / Ekd,t / Ekd+k,t−k+1 d,t and the fact that Ekd−k,t+k−1 = Ekd+k,t−k+1 = 0 for all k ≥ 2, we have E∞ = d,t d d+t t ∼ E2 . Hence HJ (HI (M)) = HI+J (M). Since HdJ (HtI (M)) 6= 0, it follows from Grothendieck’s vanishing theorem that dim Supp(HtI (M)) ≥ d. On the other hand, since dim Supp(HtI (M)) ≤ dim(R/I + Ann M ) = d, we conclude that dim Supp(HtI (M)) = d. So far, for a finitely generated R- module M, the best known lower bound for cd(I, M) is htM (I) = ht I(R/AnnM). As an immediate consequence of Theorem 3.1, we sharpen this bound to dim(M) − dim(M/IM) ≥ htM (I). Corollary 3.2. Let (R, m) be a Noetherian local ring, M a finitely generated R-module of dimension n and I an ideal of R such that dim(M/IM) = d. Then n − d is a lower bound for c = cd(I, M). Moreover, if c = n − d, then Hdm (HIn−d (M)) ∼ = Hnm (M) and dim Supp(HIn−d (M)) = d. Proof. This follows from Theorem 3.1 and the fact that Hmn (M) 6= 0. For an ideal I of R, it is a well-known fact that ht(I) ≤ cd(I) ≤ ara(I), where ara(I) denotes the smallest number of elements of R required to generate I up to radical. If, in particular, ara(I) = cd(I) = ht(I), then I is called a set-theoretic complete intersection ideal. Determining set-theoretic 5 complete intersection ideals is a classical and long-standing problems in commutative algebra and algebraic geometry. Many questions related to an ideal I to being a set-theoretic complete intersection are still open, see [12] for more details. Varbaro in [13] show that under certain conditions there exists ideals I satisfying the property that cd(I) = ht(I), knowing the existence of ideals with such properties, we have the following: Corollary 3.3. Let (R, m) be a Noetherian local ring of dimension n and I an ideal of R with d = dim(R/I) such that cd(I) = ht(I) = h. Then dim(R) = ht(I) + dim(R/I) and n−h Hm (HhI (R)) ∼ = Hnm (R). Proof. It follows from Corollary 3.2 that dim(R)−dim(R/I) ≤ cd(I) = ht(I), while the other side of the inequality always holds. Therefore dim(R) = ht(I) + dim(R/I). Now the required isomorphim follows from Corollary 3.2. We end this section with the following conclusion : Corollary 3.4. Let (R, m) be a non-catenary Noetherian local domain of dimension n. Then there is at least one prime ideal of R that is not a set theoretic complete intersection. Proof. Since R is non-catenary, there is a prime ideal p of R such that ht(p) < n − dim(R/p). Then it follows from Corollary 3.3 that cd(p) 6= ht(p) and therefore p can not be a set theoretic complete intersection ideal. 4 Artinianness and Non-Artinianness of Top Local Cohomology Modules Let (R, m) be a Noetherian local ring and M an R-module of dimension n. Recall that if M is a coatomic or a weakly finite (in particular, finitely generated, I-cofinite, or a balanced big Cohen Macaulay) module, then Hnm (M) is nonzero and Artinian [[2], [3]]. In light of this information, we have the following results the first of which is the generalization of Theorem 7.1.6 of [4]: 6 Theorem 4.1. Let (R, m) be a Noetherian local ring and M an R-module of dimension n such that Hnm (M) is Artinian. Then HnI (M) is Artinian for all ideals I of R. Proof. We use induction on d = dim(R/I). If d = 0, then I is an m-primary ideal and so HnI (M) ∼ = Hnm (M) is Artinian. Let now d > 0 and suppose the hypothesis is true for all ideals J of R with dim(R/J) < d. Choose an element x ∈ m such that dim(R/(I + Rx)) = d − 1 < d. Then by induction hypothesis, HnI+Rx (M) is Artinian. Now consider the exact sequence ··· / HnI+Rx (M) / HnI (M) / HnI (Mx ) / ··· Since HnI+Rx (M) is Artinian and HnI (Mx ) = 0 (dim(Mx ) < n, as x ∈ m), it follows from the above exact sequence that HnI (M) is Artinian. Recall that a class S of R-modules is a Serre subcategory of the category of R-modules, C(R), when it is closed under taking submodules, quotients and extensions. The main result of this section is the following: Theorem 4.2. Let R be a Noetherian ring, M an R-module (not necessarily finitely generated) and let S be a Serre subcategory of C(R). Let I and J be c−i two ideals of R such that Ht+i J (HI (M)) ∈ S for all 0 < i ≤ c = cd(I, M) and Ht+c / S for some positive integer t. Then HtJ (HcI (M)) ∈ / S. I+J (M) ∈ Proof. Consider the Grothendieck’s spectral sequence E2p,q = HpJ (HqI (M)) =⇒ Hp+q I+J (M) and look at the stage p + q = c + t. Let now 0 < i ≤ c = cd(I, M). Since t+i,c−i E∞ = Ert+i,c−i for sufficiently large r and Ert+i,c−i is a subquotient of t+i,c−i t+i,c−i E2 ∈ S, E∞ ∈ S for all 0 < i ≤ c = cd(I, M). On the other hand, since E2t,c = HtJ (HcI (M)) =⇒ Ht+c I+J (M), there exists a finite filtration 0 = Φt+c+1 Ht+c ⊆ Φt+c Ht+c ⊆ · · · ⊆ Φ1 Ht+c ⊆ Φ0 Ht+c = Ht+c p,q p t+c of Ht+c = Ht+c /Φp+1 Ht+c for all p + q = t + c. I+J (M) such that E∞ = Φ H p,q Since for all p < t, E∞ = 0, we have that Φt Ht+c = · · · = Φ1 Ht+c = 7 t+i,c−i Φ0 Ht+c = Ht+c . But then since E∞ = Φt+i Ht+c /Φt+i+1 Ht+c ∈ S for all t+1 t+c 0 < i ≤ c, Φ H ∈ S and so it follows from the short exact sequence 0 / Φt+1 Ht+c | {z ∈S } / Ht+c (M) | I+J{z } / t,c E∞ / 0 ∈S / t,c t,c t,c that E∞ ∈ / S. Since E∞ is a subquotient of E2t,c and E∞ ∈ / S, it follows that E2t,c = HtJ (HcI (M)) ∈ / S. Corollary 4.3. Let (R, m) be a Noetherian local ring, M an R-module of dimension n such that Hnm (M) 6= 0 with dim(R/I + AnnM ) = d. If cd(I,M ) n−i HI (M) is Artinian, then either cd(I, M) = n or Hm (HiI (M)) 6= 0 for some n − d ≤ i < cd(I, M). Proof. We prove the contrapositive of the statement. Let S be the category of n−i zero module and suppose that c = cd(I, M) < n and Hm (HiI (M)) = 0 ∈ S for all n − d ≤ i < c. But then since Hnm (M) ∈ / S, it follows from Theorem n−c 4.2 that Hm (HcI (M)) 6= 0. Hence dim Supp(HcI (M)) > 0 and so HcI (M) is not Artinian. The following results determine the Artinianness and non-Artinianness cd(I,M ) of the top local cohomology module, HI (M), for the ideals of small dimension. Theorem 4.4. Let (R, m) be a Noetherian local ring, M an R-module of dimension n such that Hnm (M) is nonzero and Artinian and let I be an ideal cd(I,M ) of R such that dim(R/I + Ann M ) = 1. Then HI (M) is Artinian if and only if cd(I, M) = n. Proof. Since dim(R/I + Ann M ) = 1 and Hnm (M) 6= 0 , it follows from Theorem 3.1 that either cd(I, M) = n − 1 or cd(I, M) = n. If cd(I, M) = n, then by Theorem 4.1, HnI (M) is Artinian. If, on the other hand, cd(I, M) = n − 1, then it follows from Theorem 3.1 that dim Supp(HIn−1 (M)) = 1 and so HIn−1 (M) is non-Artinian. Theorem 4.5. Let (R, m) be a Noetherian local ring, M an R-module of dimension n such that Hnm (M) is nonzero and Artinian and let I be an ideal cd(I,M ) of R with dim(R/I + Ann(M)) = 2. If HI (M) is Artinian, then either cd(I, M) = n, or cd(I, M) = n − 1 and H2m (HIn−2 (M)) 6= 0. 8 Proof. Since dim(R/I + Ann M ) = 2 and Hnm (M) 6= 0, it follows from Theorem 3.1 that n − 2 is a lower bound for cd(I, M). If cd(I, M) = n − 2, cd(I,M ) then again by Theorem 3.1, dim Supp(HIn−2 (M)) = 2 and so HI (M) is non-Artinian. If, on the other hand, cd(I, M) = n, then from Theorem cd(I,M ) 4.1, HI (M) is Artinian. Finally, if cd(I, M) = n − 1 and HIn−1 (M) is Artinian, then the result follows from Corollary 4.3. References [1] M. Aghapournahr and L. Melkersson, Artinianness of local cohomology modules, Ark. Mat., 52(2014), 1-10. [2] M. Aghapournahr and L. Melkersson, Finiteness properties of minimax and coatomic local cohomology modules, Arch. Math. 94 (2010) 519–528. [3] A. Bagheri, ‘A Non-Vanishing Theorem for Local Cohomology Modules’, Bull. Malays. Math. Sci. Soc. (2) 37 (2014) 65–72. [4] M. P. Brodmann and R. Y. Sharp, Local Cohomology, 2nd ed., Cambridge Studies in Advanced Mathematics, Vol. 136, Cambridge University Press, Cambridge, 2013. An algebraic introduction with geometric applications. [5] M. T. Dibaei and A. Vahidi, Artinian and Non-Artinian Local Cohomology Modules, Canad. Math. Bull., 54(2011), 619-629. [6] K. Divaani-Aazar, R. Naghipour and M. Tousi , Cohomological dimension of certain algebraic varieties , Proc. Amer. Math. Soc, 130(12) (2002), 3537 3544. [7] A. Grothendieck (notes by R. Hartshorne), ‘Local cohomology’ , Lect. Notes in Math. 41 Springer-Verlag, 1967. [8] R. Hartshorne, Cohomological dimension of algebraic varieties, Annals of Math., 88(1968), 403-450. [9] C. Huneke, Problems in local cohomology, Free Resolutions in Commutative Algebra and Algebraic Geometry Sundance 90, Res. Notes in Math., Jones and Barlett, 2(1992), 93-108. [10] C. Huneke and G. Lyubeznik, On the vanishing of local cohomology modules, Inv. Math., 102(1990), 73-93. [11] G. Lyubeznik, A partial survey of local cohomology, local cohomology and its applications,Lect. Notes Pure Appl. Math.,226 (2002), 121-154. [12] G. Lyubeznik , A survey of problems and results on the number of defining equations. Commutative Algebra, Math. Sci. Res. Inst. Publ., 15 (1989), 375-390. [13] M. Varbaro, Cohomological and Projective Dimensions , Compositio Mathematica, 149(2013), 1203-1210. 9
0math.AC
Score matching estimators for directional distributions Kanti V Mardia, John T Kent, and Arnab K Laha arXiv:1604.08470v1 [math.ST] 28 Apr 2016 University of Leeds and University of Oxford, University of Leeds, Indian Institute of Management Ahmedabad Abstract One of the major problems for maximum likelihood estimation in the wellestablished directional models is that the normalising constants can be difficult to evaluate. A new general method of “score matching estimation” is presented here on a compact oriented Riemannian manifold. Important applications include von Mises-Fisher, Bingham and joint models on the sphere and related spaces. The estimator is consistent and asymptotically normally distributed under mild regularity conditions. Further, it is easy to compute as a solution of a linear set of equations and requires no knowledge of the normalizing constant. Several examples are given, both analytic and numerical, to demonstrate its good performance. Some key words: Exponential family, Fisher-Bingham distribution, Riemannian manifold, sphere, torus, von Mises distribution. 1 Introduction A novel “score matching estimator” was proposed in Hyvärinen (2005, 2007) as an alternative to the maximum likelihood estimator. For exponential family models, a key advantage of this new estimator is that it avoids the need to work with awkward normalizing constants. A minor limitation is that it requires the underlying distributions to have sufficiently smooth probability densities. The score matching estimator was originally developed for densities on Euclidean space. The extension to Riemannian manifolds was sketched in Dawid and Lauritzen (2005) and Parry et al. (2012), but without a detailed analysis. Here we give a systematic investigation on a compact oriented Riemannian manifold M . The main focus is on exponential family models. Key applications include the Fisher-Bingham and multivariate von Mises distributions, which lie on spheres and related spaces. 1 2 Background on Riemannian manifolds A p-dimensional Riemannian manifold M , say, is characterized by a metric tensor G = G(x) = (gij (x)), where G(x) is a p × p symmetric positive definite matrix. Here x is a p-dimensional vector representing a typical element of M in local coordinates. Let G−1 (x) = (g ij (x)) denote the inverse matrix. A uniform measure on M can be defined in local coordinates by µ(dx) = {det(G(x))}1/2 dx. See, e.g., Jost (2005); Rosenberg (1997); Stein and Weiss (1971) for a background on Riemannian manifolds. Next, let u = u(x), v = v(x), x ∈ M , be two real-valued functions on M . Let ∇u = (∂u/∂xj , j = 1, . . . , p)T denote the gradient in local coordinates, i.e. the column vector of partial derivatives. An inner product on gradient vectors can be defined by hu, vi = hu, vi(x) = (∇u)T G−1 (∇v), (1) treated as a function of the local coordinate vector x. The Laplace-Beltrami operator, acting on u, is defined in local coordinates by ∆M u = p X h i {det(G(x))}−1/2 ∂/∂xi {det(G(x))}1/2 g ij (x)∂u/∂xj . (2) i,j=1 treated as a function of the local coordinate vector x. Although the gradient vector ∇u depends on the choice of local coordinates, the uniform measure µ(dx), the gradient inner product (1) and the Laplace-Beltrami operator (2) are invariant under a change of local coordinates. Stokes’ Theorem, also known as the divergence theorem, connects the gradient inner product and the Laplace-Beltrami operator. Further, if M is assumed compact and oriented, there is no need for boundary conditions. Theorem 1 (Stokes’ Theorem). If M is a compact oriented Riemannian manifold and u(x), v(x) are twice continuously differentiable functions on M , then Z Z hu, vi(x) µ(dx) = − (∆M u)v µ(dx). (3) M M If M is isometrically embedded as a p-dimensional surface in a Euclidean space, M ⊂ Rq , then a point in M can be represented either as a p-dimensional vector x in local coordinates or as a q-dimensional vector z = (z1 , . . . , zq )T , say, in Euclidean coordinates. In this setting it is possible to give simpler representations of the gradient inner product and the Laplace-Beltrami operators. Given a point z in M , the tangent plane to M at z is a p-dimensional hyperplane. Let P (z) = P = (pij ) denote the q × q orthogonal projection matrix onto this hyperplane. Then P = P T , P = P 2 and P has rank p. Suppose the functions u and v have been extended to a neighbourhood N of M as functions ũ(z), ṽ(z) of z ∈ N ⊂ Rq , and define the usual Euclidean gradient ∇E ũ = (∂ ũ/∂zj , j = 1, . . . , q)T . 2 The gradient inner product and the Laplace-Beltrami operator were given by (1) and (2) in local coordinates. They can also be written in Euclidean coordinates as hu, vi = (∇E ũ)T P (∇E ṽ) = (P ∇E ũ)T (P ∇E ṽ) and (4) q X  ∆M u = tr P ∇TE (P ∇E ũ) = pij ∂/∂zi (pjk ∂ ũ/∂zk ) . i,j,k=1 Note the derivatives in (4) are q-dimensional whereas the derivatives in (1) are p-dimensional; however, the inner product is the same. The simplest example is the sphere S2 = {z ∈ R3 : z T z = 1}. In polar coordinates, x = (θ, φ)T with θ = colatitude and φ = longitude, the metric tensor becomes " # 1 0 G= , 0 sin2 θ and the uniform measure becomes sin θdθdφ. The Laplace-Beltrami operator becomes ∆M u = ∂ 2 u/∂θ2 + cot θ∂u/∂θ + (sin θ)−2 ∂ 2 u/∂φ2 . The Euclidean embedding takes the form z1 = cos θ, z2 = sin θ cos φ, z3 = sin θ sin φ, and the projection matrix is P = I3 − zz T . It is straightforward to check that gradient inner products in (1) and (4) are two ways of writing the same function. 3 The score matching criterion on a compact oriented Riemannian manifold One way to motivate a statistical estimator is through the minimization of a divergence between two probability distributions. The most common example is the Kullback-Liebler divergence, which leads to the maximum likelihood estimator. In this paper we use a divergence due to Hyvärinen, which leads to the score matching estimator. Let f and f ∗ be two probability densities on a Riemannian manifold M , defined with respect to the uniform measure µ, where f and f ∗ are assumed to be everywhere nonzero and twice continuously differentiable. Define the Hyvärinen divergence (Hyvärinen, 2005, 2007) between the two densities in terms of an integrated gradient inner product for the log ratio, Z 1 ∗ Φ(f ; f ) = hlog(f /f ∗ ), log(f /f ∗ )i f ∗ (x)µ(dx) 2 M Z 1 = {hlog f, log f i − 2hlog f, log f ∗ i + hlog f ∗ , log f ∗ i} f ∗ (x) µ(dx). 2 M (5) 3 Hyvärinen proposed this divergence in the setting where M is a Euclidean space. In this setting the metric tensor G = I is hardly needed, and the the gradient inner P product (1) simplifies to hu, vi = pj=1 (∂u/∂xj )(∂v/∂xj ). For the rest of the paper we limit attention to the setting where M is compact and oriented. In some ways this setting is more complicated than the Euclidean case. The gradient inner product h·i is now given by (1); it can also be written as (4) when the manifold M can be embedded in a Euclidean space. However, in other ways this setting is simpler. Stokes’ Theorem (3) holds automatically without the need for boundary conditions and all continuous functions on M are automatically bounded and integrable. Two simple properties ensure that minimizing (5) over f is an identifiable approach to finding f ∗ . Property 1. If f = f ∗ , then Φ(f ; f ∗ ) = 0. Property 2. If f 6= f ∗ , then Φ(f ; f ∗ ) > 0. To prove these properties note by inspection in (5) that Φ(f ; f ∗ ) ≥ 0 for all choices of densities and that Φ(f ∗ ; f ∗ ) = 0. Conversely, if f 6= f ∗ , then we claim there must be at least one point x in some set of local coordinates such that ∇f (x) 6= ∇f ∗ (x); hence the integral (5) must be strictly positive. For if there were no such x, a contradiction would arise: the gradients would be everywhere equal and so the densities would be the same up to a proportionality constant; further, since both densities integrate to 1, the proportionality constant would have to equal 1. For fitting purposes, let f ∗ (x) be regarded as the “true” distribution of the data and let f (x) = f (x; π) denote a parametric model, where π is an m-dimensional vector of parameters. Then a “best-fitting” model can be defined by minimizing Φ(f ; f ∗ ) over the parameters π. Since the final term in (5) does not depend on f , it can be dropped from the minimization criterion. Further, by Stokes’ Theorem (3) and the simple result, ∂ log f ∗ (x)/∂xj = {f ∗ (x)}−1 ∂f ∗ (x)/∂xj , the middle term becomes Z Z ∗ ∗ − hlog f, log f if (x) µ(dx) = − hlog f, f ∗ i(f ∗ )−1 f ∗ (x) µ(dx) M M Z =− hlog f, f ∗ i µ(dx) M Z = (∆M log f )f ∗ (x) µ(dx). M The final term in (5) does not depend on f . Hence minimizing Φ(f ; f ∗ ) over the parameters π in f is equivalent to minimizing Z 1 ∗ Ψ(f ; f ) = {hlog f, log f i + 2(∆M log f )} f ∗ (x)µ(dx) 2 M 1 = E {hlog f, log f i + 2(∆M log f )} , (6) 2 4 where E denotes expectation under the measure f ∗ (x)µ(dx). At this stage it is no longer necessary to impose any regularity conditions on f ∗ ; indeed it can be replaced by any probability measure F ∗ , say, in which case we write Ψ(f, F ∗ ). For the rest of the paper we specialize to the case where f (x; π) forms a canonical exponential family on a compact oriented Riemannian manifold M with density f (x) = f (x; π) ∝ exp{π T t(x)} (7) with respect to the uniform measure µ(dx), where π is an m-vector of natural parameters and t(x) = (t1 (x), . . . , tm (x) is a vector of sufficient statistics. The sufficient statistics are assumed to satisfy the following regularity conditions. A1 The constant function 1 and the functions t` (x) (` = 1, . . . , m) are linearly independent on M . A2 The functions t` (x) (` = 1, . . . , m) are twice continuously differentiable with respect to x. The first assumption ensures the identifiability of π; different values of π correspond to different distributions. The second assumption justifies the use of Stokes’ Theorem. In this exponential family setting (6) simplifies to 1 Ψ(f ; F ∗ ) = π T W π − π T d, 2 where W = (w`1 `2 ) and d = (d` ) have elements w`1 `2 = E{ht`1 , t`2 i(x)}, d` = −E{∆M t` (x)} (`, `1 , `2 = 1, . . . , m). (8) (9) Minimizing (8) yields the moment equation W π − d = 0. In particular, if the “true” distribution F ∗ (dx) = f (x; π0 ) lies in the parametric family, it follows that π0 can be recovered from the moments in W and d by π0 = W −1 d. The identifiability property, Property 2 mentioned below (5), implies that W must be nonsingular. In later sections we illustrate how to calculate W and d in particular cases. In many examples the components of t(x) are eigenfunctions of the LaplaceBeltrami operator, so that ∆M t` (x) = −λ` t` (x), for suitable constants λ` > 0 (` = 1, . . . , m) See, e.g., Patrangenaru and Ellingson (2016, Ch 3.3) for the eigenfunctions of various manifolds arising in Statistics; the specific example of the sphere is discussed below. 4 The score matching estimator and its properties Let F ∗ = Fn denote the empirical distribution for a set of data {xh , h = 1, . . . , n}. The value π̂ minimizing Ψ(f ; Fn ) is called the score matching estimator. More 5 explicitly, π̂SME = Wn−1 dn , where Wn and dn are obtained from (9) after replacing the expectation under F ∗ by a sample average over the n data points. To discuss the asymptotic sampling properties of the score matching estimator, suppose the data comprise a random sample from the exponential family model f (x; π) with π = π0 . Since W is nonsingular in the population case, it follows from the strong law of large numbers, that Wn must be positive definite with probability 1 for sufficiently large n. This point has not generally been emphasized in the literature. Further, in many models this nonsingularity statement about Wn can be strengthened to conclude that there is a fixed value n0 , depending on the model but not on the data, such that Wn must be positive definite with probability 1 for n ≥ n0 . An analogous result for the p-dimensional multivariate normal distribution states that the sample covariance matrix is guaranteed to be positive definite with probability 1 for n ≥ p + 1. The limiting behaviour of π̂ is straightforward to describe. By the central limit theorem, dn and Wn are asymptotically jointly normally distributed with population means d and W . Hence by the delta method, it follows that n1/2 {π̂SME − π0 } ∼ Nm (0, Ω) for some limiting covariance matrix Ω. Further, by the asymptotic optimality of maximum likelihood, Ω ≥ I −1 under the usual ordering for positive semi-definite matrices, where I denotes the Fisher information matrix. The discussion here is limited to the exponential family case. Forbes and Lauritzen (2014) note that extra regularity conditions are needed for consistency and asymptotic normality when looking at score matching estimation for more general densities. The term “score” has several distinct connotations in estimation. (a) Conventionally, the “score” refers to a derivative of the log likelihood with respect to the parameters; it has close connections to maximum likelihood estimation. (b) However, in the context of the score matching estimator, the “score” refers to the derivative of the log likelihood with respect to the state variable x. (c) In addition, the term “scoring rule” (e.g., Forbes and Lauritzen, 2014; Parry et al., 2012) refers to a more general function of x and a distribution. Each scoring rule determines a divergence, and the minimization of the divergence leads to an estimator. A scoring rule is different from the scores in (a) and (b), though suitable choices for scoring rules lead to both the maximum likelihood and score matching estimators. 5 Details for the sphere For this paper the most important choice for the manifold M is the unit sphere P 2 Sp = {z ∈ Rq : zj = 1}, a p-dimensional manifold embedded in Rq , q = p + 1. 6 There are two natural coordinate systems: embedded Euclidean coordinates z and local coordinates x, i.e. polar coordinates in this case. First we set out the key steps for the derivative calculations. Let ũ(z) denote a scalar-valued function in Euclidean coordinates. The projected Euclidean gradient vector becomes P ∇E ũ = (I − zz T )∇E ũ, P = Iq − zz T . The eigenfunctions of ∆M on Sp , p ≥ 1, are known as the spherical harmonics. A spherical harmonic of degree k ≥ 0 has eigenvalue −λk where λk = k(k + p − 1) = k(k + q − 2); see, e.g., Chavel (1984, p. 35), Patrangenaru and Ellingson (2016, p. 125). The action of ∆M on the linear and quadratic spherical harmonics, expressed in Euclidean coordinates, can be summarized as follows, ∆M zj = −λ1 zj , ∆M (zi2 − zj2 ) = −λ2 (zi2 − zj2 ), (10) ∆M (zi zj ) = −λ2 (zi zj ), where i 6= j ∈ {1, . . . , q}. A systematic construction of higher order spherical harmonics is given in Stein and Weiss (1971, pp. 137–152), but they will not be needed here. Statistical models involving spherical harmonics of degree greater than two are straightforward in principle (e.g. Beran, 1979), but in practice the components of t(z) will usually consist of linear and quadratic functions of z. To illustrate these calculations, consider the Fisher-Bingham density on Sp ,  f (z) ∝ exp bT z + z T Az , (11) where b is a q-vector, and A is a q × q symmetric matrix, q = p + 1. To ensure P identifiability, the side condition qj=1 ajj = 0 is imposed. The density can be recast as 2 f (z) ∝ exp{b1 z1 + · · · + bq zq + a11 (z12 − zq2 ) + · · · + aq−1,q−1 (zq−1 − zq2 )+ a12 (2z1 z2 ) + · · · + a1q (2z1 zq ) + · · · + aq−1,q (2zq−1 zq )} (m ) X = exp π` t` (z) . `=1 Here the vector π denotes the m = q + q − 1 + q(q − 1)/2 parameters in b and A in the order listed, and the vector t = t(z) denotes the corresponding functions of z; that is, the linear terms, the diagonal quadratic terms, and the cross-product quadratic terms, respectively. Next we gather the information needed to evaluate W and d in (9). For each sufficient statistic t` = t` (z), create a vector-valued function u` = u` (z) = ∇E t` (z) by taking its Euclidean gradient, and create a scalar-valued function v` = v` (z) = z T u` . Then create an m × m matrix W with entries w`1 `2 = E{uT`1 u`2 − v`1 v`2 }. 7 (12) Table 1: Gradient details for the Fisher-Bingham density (11) on Sq . Here t` (z) and v` (z) are scalars; u` (z) is a q-dimensional vector. Also ej represents a unit vector along the jth coordinate axis (j = 1, . . . , q). t` (z) zj 2 zj − zp2 2zi zj u` (z) ej 2(zj ej − zq eq ) 2(zi ej + zj ei ) v` (z) zj 2 2(zj − zq2 ) 4zi zj . Table 1 gives the entries for u` and v` . Also create a vector d with entries d` = −E{∆M t` (z)}, (13) using equation (10) to evaluate the Laplace-Beltrami operator. 6 Hybrid estimators and reduced models The parameters for directional distributions can typically be split into two parts: the concentration parameters and the orientation parameters, where the normalizing constant depends just on the concentration parameters. Further it is often possible to estimate the orientation parameters explicitly using sample moments. Often this orientation estimator can be viewed as an exact or an approximate maximum likelihood estimator, and it can be computed without needing estimates of the concentration parameters. Further, if the orientation parameters are known, then the distribution of the data becomes a natural exponential family for the concentration parameters. We call this latter model reduced because the number of concentration parameters is smaller than the number of original parameters. Hence, the following hybrid strategy provides a tractable estimation procedure: (a) Split the parameters for the full model into orientation and concentration parameters. (b) Estimate the orientation parameters for the original data and the transform the data to a standardized form. (c) After standardization, the estimated orientation parameters take a simple canonical form. Treating them as known for the standardized data, the concentration parameters become natural parameters in a reduced exponential family. (d) Use the score matching estimator to estimate the concentration parameters of the reduced model for the standardized data. 8 Table 2: Log densities for various standard directional distributions in full and reduced form. In full form, the models include both orientation and concentration parameters. In reduced form there are just concentration parameters. The models named in square brackets are too general to have a useful reduced form, but the submodels listed below them do have a useful reduced form. The first four models lie on the sphere Sp . The final two models are multivariate (MV) von Mises models lying on the torus (S1 )k . Name Full Reduced von Mises-Fisher µT z Bingham z T Az [Fisher-Bingham] µT z + z T Az — Kent Aµ = 0; λ1 = 0, λ2 = −λ3 = β κz1 + β(z22 − z32 ) [ MV von Mises] k X r=1 MV von Mises sine z T Λz = X µ(r)T z (r) + z (r)T Ω(r,s) z (s) κz1 Pq−1 j=1 λj (zj2 − zp2 ) — r<s P P k (rs) 0 0 (r) 0  sr ss , + κ c  r r<s λ r=1  c0r = cos θ(r)0 , s0r = sin θ(r)0 ,   θ(r)0 = θ(r) − θ(r) (r) Set θ0 = 0. 0 The resulting estimator can be called the hybrid score matching estimator and denoted by π̂SME,hybrid . The next section gives several examples from directional statistics to illustrate this estimation strategy. Table 2 summarizes the form of each density. See, e.g. Jammalamadaka and Sengupta (2001); Mardia and Jupp (2000) for background information on these distributions. The first three examples lie on the sphere M = Sp ; the last example lies on the torus, a direct product of k circles, M = (S1 )k . In each case the details (a)–(d) are specified explicitly. In all cases we assume a sample of size n from the stated distribution. On the sphere the data are represented by an n × q matrix Z whose rows zhT (h = 1, . . . , n), say, are q-dimensional unit vectors in Euclidean coordinates. The models are special cases of the Fisher-Bingham density (11) and Table 1 gives the details needed for the gradient calculations. On the torus, it is more convenient to use polar coordinates to represent the data as an n × k matrix Θ of angles lying in [0, 2π), with gradient calculations carried out directly. In each case the key step is to derive the formulas for the matrix Wn and the vector dn in the reduced model. 9 7 7.1 Directional distributions von Mises-Fisher distribution (a) The density for the full von Mises-Fisher distribution takes the form in (7) with t(z) = (z1 , . . . , zq )T being the vector of linear functions in z. This model forms a canonical exponential family. The parameter vector can be written π = κµ0 where κ ≥ 0 is a scalar concentration parameter and µ0 is a unit orientation vector. On the circle, it is sometimes convenient to write µ0 = (cos θ0 , sin θ0 )T in polar coordinates. (b) For the data matrix Z(n×q), the sufficient statistic is the q-dimensional sample mean vector z. The maximum likelihood estimate of µ0 is the unit vector µ̂0,MLE = z/||z|| and is also the hybrid score matching estimator. Let R be a q × q orthogonal matrix such that RT µ̂0,MLE = e1 , where e1 is a unit vector along the first coordinate axis in Rq , and let Y = ZR, i.e. yh = RT zh (h = 1, . . . , n), denote the standardized data. (c) As shown in Table 2, the reduced model for Y involves just a single concentration parameter κ. (d) For the reduced model, Wn and dn in (12)–(13) are one-dimensional, Wn = 1 − 1X 2 yh1 , n dn = (q − 1) X yh1 , so that the hybrid score matching estimator of κ becomes κ̂SME,hybrid = dn /Wn , (14) expressed in terms of the first two sample moments of the standardized data. All sums here and below range over h = 1, . . . , n. The score matching estimator for the von Mises distribution can also be derived from the two trigonometric moments, E(cos νθ) = Iν (κ)/I0 (κ), ν ≥ 0, for ν = 1, 2. Using the Bessel function identity Iν+1 (κ) = Iν−1 (κ) − 2ν Iν (κ) κ (15) with ν = 1 and simplifying yields the population version of (14) for the circle, q = 2. Analogous results using Legendre polynomials yield the population version of (14) for larger values of q. If q = 2 and the data are represented in polar coordinates, (zh1 , zh2 ) = (cos θh , sin θh )(h = 1, . . . , n), then the score matching estimators can be recast in polar coordinates. In particular, the estimated orientation angle for the hybrid score matching estimator is 10 θ̂0,SME,hybrid = θ̂0,MLE = atan2(S̄, C̄) = θ̂0 , say, (16) where atan2(.) is defined so that atan2(y, x) = θ if and only if (cos θ, sin θ)T ∝ (x, y)T for x2 + y 2 > 0, and where C̄ = 1X cos θh , n S̄ = 1X sin θh , n R̄ = p S̄ 2 + C̄ 2 . The hybrid score matching estimator of κ can be re-expressed as P cos(θh − θ̂0 ) nR̄ κ̂SME,hybrid = P 2 =P 2 . sin (θh − θ̂0 ) sin (θh − θ̂0 ) (17) The full score matching estimator on the circle is also straightforward to derive, with m = 2 and sufficient statistics t1 (θ) = cos θ and t2 (θ) = sin θ. Set P P C̄2 = n1 cos 2θh , S̄2 = n1 sin 2θh , R̄2 = (C̄22 + S̄22 )1/2 . Then Wn and dn have elements 1 (n) w11 = (1 − C̄2 ), 2 (n) 1 (n) w12 = − S̄2 , 2 1 (n) w22 = (1 + C̄2 ), 2 (n) and d1 = C̄, d2 = S̄. Since |Wn | = (1 − R̄22 )/4, the full score matching estimator becomes θ̂0,SME = atan2{C̄ S¯2 + S̄(1 − C¯2 ), C̄(1 + C¯2 ) + S̄ S¯2 } 2 2 κ̂SME = 2{R̄2 (1 + R̄2 ) + 2(C̄ 2 − S̄ 2 )C¯2 + 4C̄ S̄ S¯2 }1/2 /(1 − R̄2 ). After rotating the data so that S̄ = 0, the full score matching estimate of κ turns out to be the same as the hybrid estimate if S̄2 = 0. 7.2 Bingham distribution (a) The parameter matrix A for the Bingham distribution in Table 2 is a symmetric q × q matrix, where without loss of generality, the trace of A may be taken to be 0. If A = ΓΛΓT is the spectral decomposition of A, then the orthogonal   matrix Γ = γ(1) , . . . , γ(q) , whose columns are eigenvectors of A, represents the orientation parameters and the eigenvalues Λ = diag(λj ) represent the P concentration parameters, with qj=1 λj = tr(A) = 0. (b) Given the n × q original data matrix Z calculate the moment of inertia matrix T (Z) = (1/n)Z T Z and find its spectral decomposition T (Z) = GLGT . Then the maximum likelihood estimate of Γ is G. Define the standardized data matrix by Y = ZG. (c) In the reduced model, the matrix A simplifies to the diagonal matrix Λ, with P Pq 2 2 y T Λy = q−1 j=1 λj (yj − yq ) since j=1 λj = 0. 11 (d) For the reduced model π becomes the parameters λj (j = 1, . . . , q − 1) and the estimates Wn and dn have entries for i, j = 1, . . . , q − 1, ( P 4 2 − (y 2 − y 2 )2 }, {y 2 + yhq i=j (n) hi hq wij = n P hi 4 2 − (y 2 − y 2 )(y 2 − y 2 )}, {yhq i 6= j hi hq hj hq n and (n) di 7.3 = 2q X 2 2 (yhi − yhq ). n Kent distribution The Fisher-Bingham distribution in Table 2 has q 2 +3q −2 parameters which can be estimated by the score matching estimator. However, this distribution has too many parameters to be of much interest in practice. Instead it is more useful to consider sub-families of this distribution. One such sub-family for S2 is the 5-parameter FB5 distribution, also known as the Kent distribution, which forms a curved exponential family. (a) For the Kent distribution, µ = κγ(1) is assumed to be an eigenvector of A = ΓΛΓT with eigenvalue λ1 = 0; the other two eigenvalues are assumed to be of equal size with opposite signs, λ2 = −λ3 = β. The orthogonal matrix Γ contains the orientation parameters and there are two concentration parameters, κ ≥ 0 and β ≥ 0. (b) Kent (1982) describes a moment estimator Γ̂ for the orientation matrix, which will also be used for the hybrid score matching estimator. After standardizing to Y = Z Γ̂, the sample mean vector becomes y = (R, 0, 0)T and the moment of inertia matrix T (Y ) = (1/n)Y T Y satisfies (T (Y ) )23 = (T (Y ) )32 = 0 and (T (Y ) )22 − (T (Y ) )33 ≥ 0. (c) The reduced form of the distribution is given in Table 2 with π = (κ, β)T having two components. (d) The estimates Wn and dn have entries X 2X (n) (n) (n) 2 2 2 w11 = 1 − yh1 , w12 = w21 = yh1 (yh3 − yh2 ), n 4X 2 (n) 2 2 2 2 ) } − (yh2 − yh3 w22 = {yh2 + yh3 n and 2X 6X 2 (n) (n) 2 d1 = yh1 , d2 = (yh2 − yh3 ). n n 7.4 Multivariate von Mises sine model on the torus Q A general model on a product manifold M = kr=1 M (r) = M (1) ⊗ · · · ⊗ M (k) , involving first order interaction terms, takes the form f (x; π) ∝ exp{ k X π (r)T t(r) (x(r) ) + X r<s r=1 12 t(r)T (x(r) )Ω(r,s) t(s) (x(s) )} (Jupp and Mardia, 1980). Different sufficient statistics, of possibly different dimensions, are allowed each manifold M (r) . In principle it is also possible to include higher order interactions, and in some applications it may be desirable to consider submodels by setting some of the parameters to 0. An important example of this construction is the general multivariate von Mises (r) (r) distribution on the torus M = (S1 )k , for which t(r) (z (r) ) = (z1 , z2 )T = (cos θ(r) , sin θ(r) )T comprises the two Euclidean coordinates on each circle. See e.g. (Mardia, 1975; Mardia and Patrangenaru, 2005) for the torus case. Kume et al. (2013) give an extension to a product of higher dimensional spheres, q > 2. Even on the torus, this model has too many interaction parameters to be easily interpretable, so simplifications are often considered, including a sine model and two versions of a cosine model (e.g., Mardia, 2013, p. 501). For this paper we limit attention to the sine model on the torus; the cosine versions can be analyzed similarly. (r) (a) The density for the sine model takes the form in Table 2 where θ(r)0 = θ(r) −θ0 (r) (Mardia et al., 2008; Singh et al., 2002). Here θ0 (r = 1, . . . , k), denote a set of orientation or centering parameters. The sine model forms a curved exponential family. (b) The centering parameters can be estimated marginally by the sample mean (r) (r) (r) (r) directions θ̂0 (r = 1, . . . , k) on each circle separately. Let φh = θh − θ̂0 denote the standardized angles for the n data points arranged as an n × k matrix Φ. In this example, it is simpler to work in polar coordinates than in Euclidean coordinates. (c) The reduced model takes the form f (φ) = exp{ k X κ(r) cos φ(r) + X λ(rs) sin φ(r) sin φ(s) } (18) r<s r=1 and forms a canonical exponential family with m = k + k(k − 1)/2 parameters. The m-dimensional sufficient statistic, denoted t(φ), say, can be split into two blocks, cos φ(r) (r = 1, . . . , k) and sin φ(r) sin φ(s) (r < s). (d) Working in polar coordinates, the m × k matrix of partial derivatives ∇T t(φ) can be similarly be partitioned into two blocks, where the nonzero elements are (∇ cos φ(r) )j = − sin φ(r) , j = r ( n o cos φ(r) sin φ(s) , j = r, (r) (s) ∇(sin φ sin φ ) = j sin φ(r) cos φ(s) , j = s, for j, r, s = 1, . . . , k, r < s. Then Wn = 1X T ∇ t(φh ){∇T t(φh )}T , n 13 where φh = (φh1 , . . . , φhk )T denotes the k-vector of angles for row h of the standardized data matrix. The functions cos φ(r) are eigenfunctions of the Laplace-Beltrami operator with eigenvalue -1. Similarly, the product functions sin φ(r) sin φ(s) are eigenfunctions with eigenvalue -2. Hence the elements of dn have entries 1X (r) cos φh (r = 1, . . . , k), n 2X (r) (s) = sin φh sin φh (r < s). n d(n) r = 0 1 2 ^ κ 3 4 d(n) rs 0.0 0.2 0.4 0.6 0.8 R Figure 1: Comparison of two estimators of κ for the von Mises distribution with n = 2: maximum likelihood estimator (solid line) and score matching estimator (dashed line). 8 Efficiency study for the von Mises distribution For the von Mises distribution on the circle, it is possible to study the behaviour of the score matching estimator in more detail, both empirically and analytically. The score matching estimators were described in (16) and (17). The maximum likelihood estimator of θ0 is the same as hybrid score matching estimator. The maximum likelihood estimator of κ is κ̂M LE = A−1 1 (R̄), where Aν (κ) = Iν (κ)/I0 (κ), ν ≥ 0. 14 1.00 0.90 0.80 ARE 0 2 4 6 8 10 κ Figure 2: Asymptotic relative efficiency (ARE), as a ratio of mean squared errors, for the estimation of κ for the von Mises distribution, comparing the score matching estimator to the maximum likelihood estimator. Table 3 gives the relative efficiency, as a ratio of mean squared errors, comparing the score matching estimator of log κ to the maximum likelihood estimator. Each entry is based on 100,000 simulated datasets. The log transformation is used to improve the numerical stability of the results, though in the final column for asymptotic relative efficiency, the use of a transformation makes no difference. The simulation from von Mises distribution was carried out in R (R Core Team, 2013) using the package CircStat (Jammalamadaka and Sengupta, 2001; Lund and Agostinelli, 2012). For all cases, the relative efficiency is at least 78% and is generally much closer to 100%. The case n = 2 is interesting because it is possible to write the estimators in closed form and so compare their behaviour in detail. Further, the hybrid and full score matching estimators are identical in this setting. After centering, the standardized data take the form ±θ for a single value of θ, 0 < θ < π/2, where for simplicity we exclude the extreme possibilities θ = 0, π/2. Then κ̂SME = cos θ/ sin2 θ, κ̂MLE = A−1 1 (cos θ). (19) The two estimators are compared in Figure 1 as a plot of the estimated κ vs. R = arccos θ. Although (19) does not provide enough information to compute the relative efficiency, even in the extreme setting n = 2 the two estimators are 15 Table 3: Relative efficiency, as a ratio of mean squared errors, comparing the score matching estimator of log κ to the maximum likelihood estimator. The final column ARE gives the asymptotic relative efficiency as n → ∞, taken from (20). κ n=2 n = 10 n = 20 n = 100 ARE 0.5 100 89 93 95 95 1 98 88 86 85 85 2 98 92 85 79 78 10 100 100 99 99 99 Table 4: Great Whin Sill data on the sphere S2 , with sample size n = 34, and fitted by the Kent distribution. Estimates of κ and β are given by four different methods described in the text. Method κ̂ β̂ Hybrid SME 42.13 9.34 Hybrid MLE 42.16 9.27 Hybrid approximate MLE 41.76 8.37 Full MLE 42.41 9.28 reasonably similar, with the difference tending to 0 as R → 0 and with the relative difference tending to 0 as R → 1. The maximum difference between the two estimators is about κ̂MLE − κ̂SME = 2.46 − 1.80 = 0.66 when R = 0.76, i.e. θ = 41o . In the limiting case n → ∞, it is possible to compute analytically the asymptotic relative efficiency of the hybrid score matching estimator for κ, relative to the maximum likelihood estimator, ARE = A2 (κ)  1 . {2κ − 3A1 (κ)} κ − κA21 (κ) − A1 (κ) (20) A plot of (20) is given in Figure 2 and a proof is given in the Appendix. 9 9.1 Numerical examples Kent distribution The Great Whin Sill dataset was analyzed in Kent (1982) and is presented here to illustrate various estimates of the concentration parameters for the Kent distribution; see Table 4. The first three methods of estimation are hybrid estimators. Hence, as discussed in Section 7.3, the moment estimator is used for the orthogonal matrix representing the orientation parameters. After rotation of the data, the reduced model involves just the two concentration parameters. 16 Table 5: Isoleucine data, component 1, on the torus (S1 )4 , with sample size n = 23, and fitted using the multivariate von Mises sine model. Estimates of the concentration parameters are given by three different methods: the hybrid score matching estimator (SME), the hybrid composite likelihood estimator and the hybrid approximate maximum likelihood estimator (AMLE). SME 4.3 -6.3 3.4 2.5 * 45.4 24.5 6.03 * * 59.3 -4.6 * * * 2.2 composite 4.9 -7.3 4.0 3.4 * 48.4 26.3 7.1 * * 61.6 -5.6 * * * 2.5 6.6 * * * AMLE -5.3 3.1 47.1 24.4 * 60.1 * * 3.1 6.0 -4.3 3.6 Here are further details about the estimators in Table 4. The hybrid score matching estimator for κ and β was described in Section 7.3. The “hybrid maximum likelihood estimate” is the maximum likelihood estimate for the concentration parameters after rotating the data using the moment estimate of orientation (eqn. (4.8) in Kent (1982)). The “hybrid approximate maximum likelihood estimate” is the same, but using a normal approximation for the normalizing constant (eqn. (4.9) in Kent (1982)). The “full maximum likelihood estimate” involves maximizing the 5-parameter likelihood over both the orientation and concentration parameters; the estimated orientation is negligibly different from the moment estimator and is not reported here. All the estimates of the concentration parameters are close together. 9.2 Torus In Mardia et al. (2012), k = 4 angles from the amino acid isoleucine were modelled by a mixture of multivariate von Mises sine models and grouped into 17 clusters. Here we look at just one of those clusters, Cluster 1, and look at the fits to the concentration parameters from three estimation methods. All the methods are hybrid methods. Thus in each case location is estimated using the moment estimator given by the sample mean directions for each of the k = 4 angles. After rotation the reduced model involves just the k(k + 1)/2 = 10 concentration parameters. The hybrid score matching estimator was described in Section 7.4. The hybrid approximate maximum likelihood estimator uses a high concentration normal approximation for the normalizing constant in the reduced model; the numerical values were given in Mardia et al. (2012). The hybrid composite likelihood estimator is based on the conditional von Mises distribution in the reduced model for each angle given the remaining angles; the methodology is summarized in Mardia et al. (2009). The estimated parameters are given in Table 5. The estimates are presented as a symmetric matrix: the diagonal elements are the κ(r) and the off-diagonal elements are the λ(rs) in (18), given for clarity just in the upper triangle. In general all the 17 estimates match reasonably closely. 10 Discussion Methods of estimation for exponential families on manifolds can be divided into at least three broad categories: • Maximum likelihood estimators, both the exact version and approximate versions. Although the exact version is preferred in principle, there may be problems in practice evaluating the normalizing constant. Hence approximations may be used, such as (a) saddlepoint (Kume et al., 2013), (b) holonomic (Sei and Kume, 2015), and (c) approximate normality under high concentration. • Composite maximum likelihood estimation. Suppose a point on the manifold can represented as a set of variables, such that the conditional distribution of each variable given the rest is tractable. Then the composite likelihood is the product of the conditional densities. In some cases this method can be very efficient (Mardia et al., 2009). • Score matching estimators. As shown in this paper these estimators often reduce to the solution to a set of linear equations based on sample moments of the data. Hence the method is easy to implement and straightforward to apply to large datasets, including streaming data. Strictly speaking, an approximate maximum likelihood estimator, at a fixed level of approximation, will not be consistent as the sample size n → ∞. The score matching estimator is always consistent under the mild regularity conditions (A1)– (A2) on f in Section 3, with an asymptotic variance at least as large as the maximum likelihood estimator. The the numerical examples here suggest the efficiency of the hybrid score matching estimator, compared to the maximum likelihood estimator, will often be close to 1. Score matching estimators can also be developed for distributions on noncompact manifolds, including Euclidean spaces. The simplest example is the multivariate normal distribution (Hyvärinen, 2005) where it turns out that the score matching estimator is identical to the maximum likelihood estimator. Many directional distributions are approximately normal under high concentration. Hence we expect high efficiency of the score matching estimator in this setting. See Table 3 for confirmation in the von Mises case. In the directional setting, the score matching estimator can often be interpreted as a “double moment estimator”. For example, for the von Mises-Fisher distribution the sufficient statistic is a linear function of z, but the matrix Wn in the score matching estimator involves quadratic functions of z. Similarly, for the Bingham distribution the sufficient statistic is a quadratic function of z, but the matrix Wn in the score matching estimator involves quartic functions of z. This paper has emphasized the setting where M is a sphere or a product of spheres. Work is in progress to investigate the score matching estimator for models 18 on other important manifolds such as Stiefel and Grassmann manifolds. Acknowledgements The authors are grateful to Derek Harland, John Wood and Peter Kim for helpful discussions about the differential geometry, and to Peter Forbes for helpful discussions of the von Mises case. The first author also thanks the Indian Institute of Management Ahmedabad for hospitality during his visits to carry out some of this work. 11 Appendix This section gives a proof of the asymptotic relative efficiency for the score matching estimator of κ in (20). For simplicity the proof focuses on the estimator in the reduced model. First, it can be shown that, asymptotically, nvar(κ̂SME,hybrid ) = κ {2κ A21 (κ) − 3A1 (κ)}. (A1) To verify this equation note that, treating θ as random from the von Mises distribution, var(cos θ) = 1 − A21 (κ) − A1 (κ)/κ, var(sin2 θ) = 81 {3 + A4 (κ) − 4A2 (κ)} − A21 (κ)/κ2 and cov(cos θ, sin2 θ) = 41 {A1 (κ) − A3 (κ)} − A21 (κ)/κ. Using the delta rule gives var(κ̂SME,hybrid ) =  κ κ(8 + 3κ2 )I0 − 8I1 − 4κ2 I1 − 4κ3 I2 + 4κ2 I3 + κ3 I4 , 8nI1 A1 (κ) with the shorthand notation Iα = Iα (κ). Repeated use of (15) leads to (A1). For the maximum likelihood estimator it can be shown that, asymptotically, n var(κ̂MLE ) = 1− A21 (κ) 1 . − A1 (κ)/κ (A2) For both estimators the asymptotic variance converges to 2 as κ → 0 and is asymptotic to 2κ2 as κ → ∞. Hence for small and large κ , the asymptotic relative efficiency tends to 1. Combining (A1) and (A2) yields (20). The discussion here has emphasized the hybrid score matching estimator and the maximum likelihood estimator for the full model with two unknown parameters. But in fact there are other models and estimators to consider, including three versions of the score matching estimator and two versions of the maximum likelihood estimator. The hybrid score matching estimator and the full score matching estimator are defined for the full model with two unknown parameters θ0 and κ. The score matching estimator can also be defined under the reduced model with just one unknown parameter. It turns out that all three estimators of κ have the same asymptotic variance. Similarly, the maximum likelihood estimator of κ can be 19 defined in the setting of the full model or the reduced model. Again both estimators have the same asymptotic variance. Hence the asymptotic relative efficiency takes the same value for all these possibilities. References Beran, R. (1979). Exponential models for directional data. Ann. Statist., 7:1162– 1178. Chavel, I. (1984). Eigenvalues in Riemannian Geometry. Academic Press, Orlando. Dawid, A. P. and Lauritzen, S. L. (2005). The geometry of decision theory. In Proceedings of the Decond International Symposium on Information Geometry and Applications, pages 22–28. Univ. Tokyo. Forbes, P. G. M. and Lauritzen, S. (2014). Linear estimating equations for exponential families with applications to Gaussian linear concentrations models. Linear Algebra and its Applications, 473:261–283. Hyvärinen, A. (2005). Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6:695–709. Hyvärinen, A. (2007). Some extensions of score matching. Computational Statistics and Data Analysis, 51:2499–2512. Jammalamadaka, S. R. and Sengupta, A. (2001). Topics in Circular Statistics. World Scientific. Jost, J. (2005). Riemannian Geometry and Geometric Analysis, fourth edition. Springer, Berlin. Jupp, P. E. and Mardia, K. V. (1980). A general correlation coefficient for directional data and related regression problems. Biometrika, 67:163–73. Kent, J. T. (1982). The Fisher–Bingham distribution on the sphere. J. Roy. Statist. Soc. B, 44:71–80. Kume, A., Preston, S. P., and Wood, A. T. A. (2013). Saddlepoint approximations for the normalizing constant of Fisher–Bingham distributions on products of spheres and Stiefel manifolds. Biometrika, 100:971–984. Lund, U. and Agostinelli, C. (2012). CircStats. R package version 0.2-4. Mardia, K. V. (1975). Statistics of directional data (with discussion). J. Roy. Statist. Soc. B, 37:349–393. Mardia, K. V. (2013). Statistical approaches to three key challenges in protein structural bioinformatics. Applied Statistics, 62:487–514. 20 Mardia, K. V., Hughes, G., Taylor, C. C., and Singh, H. (2008). A multivariate von Mises distribution with applications to bioinformatics. The Canadian Journal of Statistics, 36:99–109. Mardia, K. V. and Jupp, P. E. (2000). Directional Statistics. Wiley. Mardia, K. V., Kent, J. T., Hughes, G., and Taylor, C. C. (2009). Maximum likelihood estimation using composite likelihoods for closed exponential families. Biometrika, 96:975–982. Mardia, K. V., Kent, J. T., Zhang, Z., Taylor, C. C., and Hamelryck, T. (2012). Mixtures of concentrated multivariate sine distributions with applications to bioinformatics. J. Appl. Statist., 39:2475–2492. Mardia, K. V. and Patrangenaru, V. (2005). Directions and projective shapes. Ann. Statist., 33:1666–1699. Parry, M., Dawid, A. P., and Lauritzen, S. (2012). Proper local scoring rules. Ann. Statist., 40:561–592. Patrangenaru, V. and Ellingson, L. (2016). Nonparametric Statistics on Manifolds and Their Applications to Object Data Analysis. CRC Press, Boca Raton. R Core Team (2013). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. Rosenberg, D. (1997). The Laplacian on a Riemannian Manifold. Cambridge University Press. Sei, T. and Kume, A. (2015). Calculating the normalising constant of the Bingham distribution on the sphere using the holonomic gradient method. Statistics and Computing, 25:321–332. Singh, H., Hinizdo, V., and Demchuk, E. (2002). Probabilistic model for two dependent circular variables. Biometrika, 89:719–723. Stein, E. M. and Weiss, G. (1971). Introduction to Fourier Analysis on Euclidean Spaces. Princeton University Press. 21
10math.ST
arXiv:1711.08295v1 [math.GR] 22 Nov 2017 SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS ROMAIN TESSERA AND MATTHEW C. H. TOINTON Abstract. Benjamini, Finucane and the first author have shown that if (Γn , Sn ) is a sequence of d Cayley graphs such that |Snn | ≪ nD |Sn |, then the sequence (Γn , Snn ) is relatively compact for the Gromov–Hausdorff topology and every cluster point is a connected nilpotent Lie group equipped with a left-invariant sub-Finsler metric. In this paper we show that the dimension of such a cluster point is bounded by D, and that, under the stronger bound |Snn | ≪ nD , the homogeneous dimension of a cluster point is bounded by D. Our approach is roughly to use a well-known structure theorem for approximate groups due to Breuillard, Green and Tao to replace Snn with a coset nilprogression of bounded rank, and then to use results about nilprogressions from a previous paper of ours to study the ultralimits of such coset nilprogressions. As an application we bound the dimension of the scaling limit of a sequence of vertex-transitive graphs of large diameter. We also recover and effectivise parts of an argument of Tao concerning the further growth of single set S satisfying the bound |S n | ≤ M nD |S|. Contents 1. Introduction 2. Background on approximate groups 3. GH-limits and ultralimits 4. The abelian case 5. Progressions in free nilpotent groups 6. Overview of the general case 7. Reduction to simply connected nilpotent Lie groups 8. Reduction to ultralimits of normed Lie algebras 9. Marked Lie algebras 10. Volume growth and Hausdorff dimension of the limit Appendix A. Detailed growth of nilprogressions References 1 5 7 9 12 15 17 26 27 29 32 36 1. Introduction We start by recalling Gromov’s famous polynomial growth theorem. The first author is supported by grant ANR-14-CE25-0004 “GAMME”. The second author is supported by grant FN 200021 163417/1 of the Swiss National Fund for scientific research; for earlier periods of this project he was supported by ERC grant GA617129 ‘GeTeMo’ and a Junior Research Fellowship from Homerton College, University of Cambridge. 1 2 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Theorem ([14, 27]). Let Γ be a group generated by a finite symmetric subset S. If there exists an unbounded sequence of integers mn , and constants C and D such that |S mn | ≤ CmD n for all n, then Γ is virtually torsion-free nilpotent. Conversely, we know from Bass and Guivarc’h [1, 16] that for every torsion-free nilpotent group Γ equipped with a symmetric finite generating subset S there exists a constant C = C(Γ, S) ≥ 1 such that for every n ∈ N we have C −1 nhdim (Γ) ≤ |S n | ≤ Cnhdim (Γ) , where hdim (Γ) is the homogeneous dimension of Γ (it is in particular an integer). More recently, Shalom and Tao [22] showed that for every D there exists n0 such that for every group Γ generated by a finite symmetric subset S, if there exists just one integer n1 ≥ n0 such that (1.1) |S n1 | ≤ nD 1 then Γ is virtually nilpotent. Breuillard, Green and Tao [8, Corollary 11.5] subsequently showed that (1.1) could be weakened to a “relative” polynomial-growth condition of the form (1.2) |S n1 | ≤ nD 1 |S|. One can actually go further and show that if one takes a “large” group Γ satisfying (1.2) then when “zooming out” at scale n1 it “looks like” a connected nilpotent Lie group. To make this idea precise, one can use the Gromov–Hausdorff topology, or GH topology, which gives a way to measure how “close” two metric spaces are to one another; see §3 for a precise definition. To study Γ “zoomed out” at scale n1 , one can consider the rescaled Cayley graph (Γ, dnS1 ) with respect to the GH topology. The first author obtained the following result in this direction in joint work with Benjamini and Finucane. Theorem 1.1 ([2, Theorem 3.2.2.]). Let (Γn , Sn ) be a sequence of Cayley graphs such that |Snn | ≪ d nD |Sn |. Then for every sequence mn ≫ n the sequence (Γn , mSnn ) is GH-relatively compact, and every cluster point is a connected nilpotent Lie group equipped with a left-invariant sub-Finsler metric. Remarks. The authors of [2] use the terminology Carnot–Carathéodory metric to mean a subFinsler metric (we caution that sometimes Carnot–Carathéodory is used more specifically to mean sub-Riemmannian). Moreover, whilst [2, Theorem 3.2.2.] is stated for finite graphs this is in fact a misprint and the proof is also valid for infinite graphs. Finally, [2, Theorem 3.2.2.] has the stronger hypothesis that |Snn | = O(nD ), but the same proof yields the same result under the hypothesis of Theorem 1.1 that |Snn | = O(nD |Sn |). Main new results. Our first result in this paper bounds by D the dimension of any cluster point arising from Theorem 1.1. Theorem 1.2. Let (Γn , Sn ) be a sequence of Cayley graphs such that |Snn | ≪ nD |Sn |. Then for d every sequence mn ≫ n the sequence (Γn , mSnn ) is GH-relatively compact, and every cluster point is a connected nilpotent Lie group of dimension at most D equipped with a left-invariant sub-Finsler metric. Remark 1.3. In particular, the homogeneous dimension of every cluster point coming from Theorem 1.2 is at most (D − 1)D/2 + 1. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 3 In light of the Bass–Guivarc’h formula, it is tempting to wonder whether even the homogeneous dimension should be bounded by D. However, the following example shows that Theorem 1.2 and  1ZZ Remark 1.3 are both sharp. Consider the subset S of the discrete Heisenberg group H(Z) = 0 1 Z 0 0 1 defined by   1 [−n,n] [−n3 ,n3 ] , S= 0 1 [−n,n] 0 0 1 which also appears in [23, Example 1.11]. This set Sn satisfies |Snn | ≤ n3 |Sn |, while one easily checks that the scaling limit of (H(Z), dSn /n) is the real Heisenberg group, whose homogeneous dimension is 4 but whose dimension is indeed 3 (note that, although S is not symmetric, this can be fixed by considering the set S ∪ S −1 in its place; we leave the details to the reader). Nonetheless, replacing the relative growth hypothesis (1.2) with the stronger absolute growth hypothesis (1.1) we can indeed bound the homogeneous dimension by D, as follows. Theorem 1.4. Let (Γn , Sn ) be a sequence of Cayley graphs such that |Snn | ≪ nD . Then for every d sequence mn ≫ n the sequence (Γn , mSnn ) is GH-relatively compact, and every cluster point is a connected nilpotent Lie group of homogeneous dimension at most D equipped with a left-invariant sub-Finsler metric. We emphasise that the proofs of Theorems 1.2 and 1.4 (and, indeed, Theorem 1.1) build on the fundamental structure theorem for approximate groups proved by Breuillard, Green and Tao in [8]. Our new results also crucially rely on more specific results about approximate groups that we established in our previous paper [24]. The dimension and the homogeneous dimension coincide for a connected abelian Lie group. Accepting for a moment that if the groups Γn appearing in Theorem 1.2 are abelian then every cluster point naturally comes with the structure of an abelian group, it follows that in the abelian setting we do have Theorem 1.4 under the weaker hypothesis of Theorem 1.2, as follows. Theorem 1.5. Let (Γn , Sn ) be a sequence of abelian Cayley graphs such that |Snn | ≪ nD |Sn |. Then d for every sequence mn ≫ n the sequence (Γn , mSnn ) is GH-relatively compact, and every cluster point is a connected abelian Lie group of dimension at most D equipped with an invariant Finsler metric. In fact, as well as a stronger statement, the abelian case admits a much shorter proof than the general case that nonetheless captures many of the ideas we use in the general case and so may serve as a useful introduction to the general case for first-time readers. We therefore give this short proof in §4. Application to scaling limits of vertex-transitive graphs of large diameter. As a corollary of Theorem 1.5 we obtain the following refinement of [2, Theorems 1 & 2]. In [2, Theorem 1], Benjamini, Finucane and the first author show that if (Xn ) is a sequence of vertexdSn ) transitive graphs satisfying the large-diameter condition |Xn | ≪ diam(Xn )D then (Xn , diam(X n) is GH-relatively compact and every cluster point is a torus equipped with an invariant Finsler metric. In [2, Theorem 2] they give a sharp bound on the dimension of the limiting torus under the assumption that the degree of the sequence Xn is uniformly bounded. We are now able to lift this condition on the degree. Indeed, combining Theorem 1.5 with [2, Propositions 3.1.1 & 3.3.1] as in the proof of [2, Theorem 2], we obtain the following result. 4 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Corollary 1.6. Let (Xn ) be a sequence of finite vertex-transitive graphs satisfying the large-diameter condition (1.3) |Xn | ≪ deg(Xn )diam(Xn )D , d Sn ) where deg(Xn ) is the degree of Xn (potentially going to infinity). Then the sequence (Xn , diam(X n) is GH-relatively compact, and every cluster point is a torus of dimension at most D equipped with an invariant Finsler metric. The Hausdorff dimension of the scaling limit. It is interesting to note that in both Theorems 1.2 and 1.4 we use D to control some algebraic invariant of the limit. Indeed, both the dimension and the homogeneous dimension depend only on the limiting Lie group, not on the limiting metric. It is therefore tempting to try to refine Theorems 1.2 by relating D to the Hausdorff dimension of the limit, which always lies between the dimension and the homogeneous dimension (see e.g. the proof of [4, Theorem 13]). The following statement shows that this is in fact impossible in quite a strong sense. Proposition 1.7. For every positive non decreasing function f such that limt→∞ f (t) = ∞, there exists a sequence of symmetric generating subsets Sn of the discrete Heisenberg group H(Z) such that |Sn |n ≪ f (n)n3 |Sn |, whilst (H(Z), dSn /n) converges to the real Heisenberg group equipped with the left-invariant Carnot–Carathéodory metric associated to the ℓ∞ -norm on R2 , whose Hausdorff dimension coincides with the homogeneous dimension (which is 4). We refer to §10 for the necessary background on Carnot–Carathéodory metrics. It turns out that this proposition itself is sharp, in the sense that the condition |Snn | ≪ f (n)n3 |Sn | cannot be improved to |Sn |n ≪ n3 |Sn |. This follows from the following general fact. Proposition 1.8. Suppose that the assumptions of Theorem 1.2 are satisfied, and that the sequence d (Γn , mSnn ) converges to a connected Lie group G of dimension exactly D equipped with some leftinvariant sub-Finsler metric d. Then d is Finsler and (G, d) has Hausdorff dimension D. Further growth of locally polynomially growing sets. A key ingredient in the proof of Theorem 1.1 was a result of Breuillard and the second author [9, Theorem 1.1] implying, for example, that there exists a constant CD such that if (1.2) holds for sufficiently large n1 (depending k |S m | for every k ∈ N and m ≥ n . Tao subsequently gave a more precise on D) then |S km | ≤ CD 1 description of the further growth of S m , as follows. Theorem 1.9 (Tao [23, Theorem 1.9]). Given D > 0 there exists N = NM,D such that if n ≥ N and S is a finite symmetric generating set for a group G such that |S n | ≤ M nD |S| then there exists a non-decreasing continuous piecewise-linear function f : [0, ∞) → [0, ∞) with f (0) = 0 and at most OD (1) distinct linear pieces, each with a slope that is a natural number at most OD (1), such that log |S mn | = log |S n | + f (log m) + OD (1) for every m ∈ N. Tao phrases his argument in the language of non-standard analysis, both to streamline the presentation and to give easier access to some results of [8] that are also phrased in that language. It turns out that some of the techniques we have developed in the present paper and its predecessor SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 5 [24] allow us to translate Tao’s argument to a finitary setting (we emphasise that it is still essentially Tao’s argument). Since the details are brief, we take this opportunity to present them in the appendix. We caution that Theorem 1.9 is still ineffective, since the argument uses [8, Theorem 1.6] as a black box (see Remark A.8 for details). Nonetheless, this is now the only source of ineffectiveness in the argument, and so Theorem 1.9 is effective for any class of group in which there is an effective version of [8, Theorem 1.6] (this includes residually nilpotent groups [26] and certain linear groups [7, 12], for example). In particular, an effective version of [8, Theorem 1.6] in general would yield an effective version of Theorem 1.9 in general. Notation. We follow the standard convention that if X, Y are real quantities and z1 , . . . , zk are variables or constants then the expressions X ≪z1 ,...,zk Y and Y ≫z1 ,...,zk X each mean that there exists a constant C > 0 depending only on z1 , . . . , zk such that X is always at most CY . We write X ≍z1 ,...,zk Y to mean that X ≪z1 ,...,zk Y ≪z1 ,...,zk X. Moreover, the notation Oz1 ,...,zk (Y ) denotes a quantity whose absolute value is at most a certain constant (depending on z1 , . . . , zk ) multiple of Y , whilst Ωz1 ,...,zk (X) denotes a quantity that is at least a certain positive constant (depending on z1 , . . . , zk ) multiple of X. Thus, for example, the meaning of the notation X ≤ O(Y ) is identical to the meaning of the notation X ≪ Y . Here, and throughout this paper, we use the standard notation AB = {ab : a ∈ A, b ∈ B}, −1 An = {a1 · · · an : ai ∈ A} and A−n = {a−1 1 · · · an : ai ∈ A}. We also adopt the additional convention that given two subsets A, B of a group we write A ≈z1 ,...,zk B to mean that A ⊂ B Oz1,...,zk (1) and B ⊂ AOz1 ,...,zk (1) . If A, B are subsets of a Lie algebra, we adopt the same convention but with additive notation, writing A ≈z1 ,...,zk B to mean that A ⊂ Oz1 ,...,zk (1)B and B ⊂ Oz1 ,...,zk (1)A. Definition 1.10. Given C ≥ 1 and K ≥ 0 and metric spaces X, Y , a map f : X → Y is said to be a (C, K)-quasi-isometry if C −1 d(x, y) − K ≤ d(f (x), f (y)) ≤ Cd(x, y) + K, for every x, y ∈ X, and every y ∈ Y lies at distance at most K from f (X). Overview of the paper. In Section 2 we recall some notation and background material on approximate groups and progressions from our previous paper. In Section 3 we define Gromov– Hausdorff limits, explaining how to reduce their study to the study of ultralimits, and then in Section 4 we give a direct proof of Theorem 1.5. We give an overview of the general argument for Theorems 1.2 and 1.4 in Section 6, reducing their proofs to two results labelled Proposition 6.1 and Theorem 6.2. We prove Proposition 6.1 in Section 7, and Theorem 6.2 in Sections 8 and 9. Finally, we prove Propositions 1.7 and 1.8 in Section 10, and Theorem 1.9 in the appendix. Acknowledgements. The authors are grateful to Itai Benjamini for stimulating discussions. 2. Background on approximate groups The strenghtening of Gromov’s theorem due to Breuillard, Green and Tao described in the 1/2 introduction relies on the observation that if S satisfies (1.2) then there is some n ≥ n1 such that S n is a so-called approximate group. A finite subset A of a group G is said to be a K-approximate 6 ROMAIN TESSERA AND MATTHEW C. H. TOINTON subgroup of G, or simply a K-approximate group, if it is symmetric and contains the identity and there exists X ⊂ G with |X| ≤ K such that A2 ⊂ XA. The central result of approximate group theory is a remarkable theorem of Breuillard, Green and Tao [8, Corollary 2.11] describing the algebraic structure of an arbitrary approximate group in terms of certain objects called progressions, versions of which we now define. This result underpins the approach of the present paper. Following [25], we define the ordered progression on generators u1 , . . . , ud ∈ G with lengths L1 , . . . , Ld is to be Pord (u; L) := {uℓ11 · · · uℓdd : |li | ≤ Li }. If P is an ordered progression and H is a finite subgroup normalised by P , then we say that HP is an ordered coset progression. Following [8], we say that the tuple (u; L) = (u1 , . . . , ud ; L1 , . . . , Ld ) is in C-upper-triangular form if, whenever 1 ≤ i < j ≤ d, for all four choices of signs ± we have   CLj+1 CLd ±1 , . . . , (2.1) [u±1 , u ] ∈ P u , . . . , u ; j+1 ord d Li Lj i j Li Lj . We say that an ordered progression is in C-upper-triangular form if the corresponding tuple is. We say that a coset ordered coset progression HP is in C-upper-triangular form if the corresponding tuple is in C-upper-triangular form modulo H. Given m > 0, an ordered progression P on the tuple (u; L) = (u1 , . . . , ud ; L1 , . . . , Ld ) is said to be m-proper with respect to a homomorphism π : hP i → N if the elements π(uℓ11 · · · uℓdd ) are all distinct as the ℓi range over those integers with |ℓi | ≤ mLi . The progression P is said to be m-proper with respect to a subgroup H ⊳ hHP i if P is m-proper with respect to the quotient homomorphism hHP i → hHP i/H. In this case we also say that the coset ordered coset progression HP is m-proper. If a coset ordered coset progression HP is m-proper for every m < 0 then we say it is infinitely proper. Having made these definitions, we can now state the main the result of Breuillard, Green and Tao. This result is essentially [8, Corollary 2.11], although we state a version of it from our earlier paper [24, Theorem 1.4] in order to be compatible with our notation. Theorem 2.1 (Breuillard–Green–Tao). Let A be a K-approximate group. Then there exist an ΩK (1)-proper ordered coset progression HP ⊂ A4 , of rank and step at most OK (1) and in OK (1)upper-triangular form, and a set X ⊂ hAi with |X| ≪K 1 such that A ⊂ XHP . This result enters the present paper via Proposition 7.5. We adapt some of the above terminology for use in a Lie group G. In particular, given elements R (u; L) via u1 , . . . , ud ∈ G and positive reals L1 , . . . , Ld we define the real ordered progression Pord R (u; L) = {uℓ11 · · · uℓdd : ℓi ∈ [−Li , Li ]}, Pord calling d the rank of this progression. We say that (u; L) is in C-upper-triangular form over R if for every i < j ≤ d and for all four choices of signs ± we have   CLj+1 CLd ±1 R , . . . , u , . . . , u ; [u±1 , u ] ⊂ P j+1 d Li Lj ord i j Li Lj . Finally, given group elements u1 , . . . , ud and positive reals L1 , . . . , Ld , and given integers i1 < . . . < ik ∈ [1, d], we often abbreviate (ui1 , . . . , uik ; Li1 , . . . , Lik ) to simply (ui1 , . . . , uik ; L). SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 7 3. GH-limits and ultralimits In this section we describe two different ways of defining a limit of a sequence of metric spaces: a Gromov–Hausdorff limit and an ultralimit. Underpinning the entire approach of this paper is the standard fact, stated below as Lemma 3.9, that in the setting we are concerned with these two types of limit coincide. We start by describing Gromov–Hausdorff limits, or GH-limits as we call them from now on. Definition 3.1. Given a sequence Xn of compact metric spaces we will say that Xn GH-converges to X if the Xn have bounded diameter and if there exist maps φn : Xn → X such that for all ε, then for n large enough, • every point of X is at ε-distance of a point of φn (Xn ); • (1 − ε)d(x, y) − ε ≤ d(φn (x), φn (y)) ≤ (1 + ε)d(x, y) + ε for all x, y ∈ Xn . GH-convergence also extends naturally to (not necessarily compact) locally compact pointed metric spaces [15, §3], as follows. Definition 3.2. Given a sequence (Xn , on ) of locally compact pointed metric spaces, (Xn , on ) is said to converge to the locally compact pointed metric space (X, o) if for every R > 0, the sequence of balls B(on , R) GH-converges to B(o, R). Gromov gave the following useful criterion for GH-precompactness. Lemma 3.3 (Gromov’s compactness criterion, [10, Theorem 5.41]). A sequence of metric spaces (Xn ) is relatively GH-compact if and only if the Xn have bounded diameter, and are “equi-relatively compact”: for every ε > 0, there exists N ∈ N such that for all n ∈ N, Xn can be covered by at most N balls of radius ε. This fact readily extends to pointed metric spaces as follows. Corollary 3.4. A sequence of pointed metric spaces (Xn , on ) is relatively GH compact if and only if for every ε > 0, there exists N ∈ N such that for all n ∈ N, B(on , 1/ε) can be covered by at most N balls of radius ε. The following standard observation is particularly useful in light of Corollary 3.4 (recall that a metric space is called homogeneous if its group of isometries acts transitively). Lemma 3.5. Let (X, d) be a homogeneous discrete metric space, and assume that for all r > 0 and x ∈ X we have |B(x, 2r)| ≤ C|B(x, r)|. Then B(x, 2r) is covered by OC (1) balls of radius r. Proof. Let (xi )i∈I be a maximal r-separated (i.e. elements are at pairwise distance at least r) subset of B(x, 2r). Since the balls B(xi , r/3) are disjoint and contained in B(x, 3r), we deduce that I has cardinality OC (1). On the other hand we deduce from maximality that the balls B(xi , r) cover B(x, 2r).  Corollary 3.6. Let (Xn , on ) be a sequence of pointed discrete metric spaces such that for every n, the metric space Xn is homogeneous and satisfies some uniform doubling property: there exists a sequence εn → 0 and a constant C such that for all n ∈ N, r ≥ εn , |B(on , 2r)| ≤ C|B(on , r)|. Then the sequence of pointed metric spaces (Xn , on ) is GH-relatively compact. In [15, §3], Gromov discusses functoriality of these notions of convergence. In particular, he mentions a notion of equivariant GH-convergence. In [13, §3], Fukaya and Yamaguchi provide a 8 ROMAIN TESSERA AND MATTHEW C. H. TOINTON precise notion of GH-convergence for sequences of triplets (Xn , Gn , on ), where (Xn , on ) are locally compact pointed metric spaces, and Gn is a group of isometries of Xn . They prove the important fact that if (Xn , on ) GH-converges to (X, o) and if Gn is a group of isometries of Xn acting transitively, then in some suitable sense, a subsequence of the triplet (Xn , Gn , on ) converges to (X, G, o) where G is a subgroup of isometries of X acting transitively. We will recover this fact in a special case, through the convenient notion of ultralimits. Before we can define ultralimits, we need to define ultrafilters. An ultrafilter is a map from ω : P(N) → {0, 1}, such that ω(N) = 1, and which is “additive” in the sense that ω(A ∪ B) = ω(A) + ω(B) for all A and B disjoint subsets of N [11]. It is easy to check that this is equivalent to the definition used in [8], for example. Given an ultrafilter ω, we say that a statement holds for ω-almost every n ∈ N if the set A of n for which the statement holds satisfies ω(A) = 1. We write xn =ω yn to mean that xn = yn for ω-almost every n; we write xn ≪ω yn to mean that there exists some real number C such that xn ≤ Cyn for ω-almost every n; and we write Oω (xn ) for a sequence that is ≪ω xn , write Ωω (xn ) for a sequence that is ≫ω xn , and write oω (xn ) for a sequence that is not in Ωω (xn ). Let us highlight a slightly subtle distinction between the notation xn ≪ω yn and the asymptotic notation xn ≪ yn . The notation xn ≪ yn implies the existence of some universal constant C such that xn ≤ Cyn for all n, whereas the notation xn ≪ω yn merely requires that for the sequence in question there exists some constant C such that xn ≤ Cyn for ω-almost every n. Thus, for example, if we let m be an arbitrary integer, and then defined f (n) = m for every n, we would have f (n) ≪ω 1, but we could not write f (n) ≪ 1 because for any choice of C we would violate this assertion by choosing m = ⌈C + 1⌉. Ultrafilters are used to “force” convergence of bounded sequences of real numbers. Given such a sequence an , its limit is defined to be the unique real number a such that for every ε > 0 we have |an − a| < ε for ω-almost every n. In this case we denote limω an = a, or write an →ω a. A trivial observation that is nonetheless extremely useful in this paper is the following. Lemma 3.7. Let (an ) be a sequence of real numbers taking only finitely many different values. Then an =ω limω an . An ultrafilter is called non-principal if it vanishes on finite subsets of N. Non-principal ultrafilters are known to exist, although this requires the axiom of choice [11]. From now on we fix some nonprincipal ultrafilter ω. Definition 3.8. Given a sequence of pointed metric spaces (Xn , on ), its ultralimit (X∞ , o∞ ) with respect to ω is the quotient of Xω = {(xn ) ∈ Πn Xn : d(xn , on ) ≪ω 1} by the equivalence relation xn ∼ yn if d(xn , yn ) =ω o(1). It is equipped with a distance defined by d∞ ((xn ), (yn )) = limω d(xn , yn ). It is a basic fact that a sequence an ∈ R converging to a ∈ R in the usual sense also converges to a with respect to ω, in the sense that limω an = a. A similar fact holds for ultralimits of pointed metric spaces, as follows. Lemma 3.9 ([10, Exercise 5.52]). If a sequence of pointed metric spaces converges in the pointed GH sense to X, then its ultralimit with respect to ω is isometric to X. Assume from now that the sequence (Xn , on ) is a sequence of groups (Gn , en , dn ) where en is the identity element and dn is some left-invariant metric. Then Gω is a group that acts transitively on SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 9 G∞ . The stabiliser of the identity is Gω,0 = {(xn ) ∈ Πn Gn : d(xn , en ) =ω o(1)}. If the Gn are abelian groups, then G∞ naturally comes with an abelian group structure as well. More generally, Gω,0 is a normal subgroup of Gω if and only if for all sequences (gn ) and (hn ) such that d(gn , en ) =ω O(1) and d(hn , en ) =ω o(1) we have d([gn , hn ], en ) =ω o(1). In this case (G∞ , d∞ ) naturally comes with a metric group structure. We close this section by recording the following basic fact about maps between metric spaces that behave well under ultra-limits. The proof is straightforward from the definition of an ultralimit, so we leave it as an exercise. Proposition 3.10. Let ω be a non-principal ultrafilter on N. Assume that (Xn , on ) and (Xn′ , o′n ) are sequences of pointed metric spaces, and let φn : Xn → Xn′ be a sequence of maps. We denote by ′ , o′ ) the respective ultralimits of (X , o ) and (X ′ , o′ ). (X∞ , o∞ ) and (X∞ n n n n ∞ (i) Assume that there exists C ≥ 1 such that for every sequence un , vn ∈ B(on , Oω (1)) we have d(φ(un ), φ(vn )) ≤ω Cd(un , vn ) + oω (1). Then there exists a C-Lipschitz map φ∞ : X∞ → Y∞ , defined as φ∞ (limω un ) = limω φ(un ) for all un ∈ B(on , Oω (1)). (ii) Assume that in addition to (i) that there exist α, β > 0 such that for every sequence u′n ∈ B(o′n , β) there exist un ∈ B(on , α) such that d(u′n , φn (un )) = oω (1). Then φ∞ (B(o∞ , α)) contains B(o′∞ , β). Corollary 3.11. Let φn : (Gn , dn ) → (Hn , δn ) be a sequence of morphisms between two groups equipped with left-invariant metrics such the assumptions of Proposition 3.10 (ii) are satisfied. Assume, moreover, that Gω,0 and Hω,0 are normal subgroups of respectively Gω and Hω , and hence that the ultralimits G∞ and H∞ naturally come with group structures (this is the case, for example, if Gn and Hn are abelian). Then φ∞ is a Lipschitz open homomorphism, and if H∞ is connected then φ∞ is surjective, and therefore is an isomorphism. We end this section with the following standard observation. Remark 3.12. Recall that an ultralimit of a sequence of geodesic metric spaces is geodesic (see for instance [20, §7.5]). On the other hand if (Xn ) is a sequence of connected graphs equipped with their usual geodesic distances dn , mn is a sequence going to infinity, and ω is a non-principal ultrafilter, the mn -rescaled ultralimit of (Xn , dn ) is isometric to the mn -rescaled ultralimit of the 0-skeletons of Xn equipped with the induced metric. In particular the latter is geodesic. Applied to our setting, if (Gn , dSn ) is a sequence of groups equipped with word metrics, then limω (Gn , dSn /mn ) is geodesic (hence connected). 4. The abelian case In this section we provide the short proof of Theorem 1.5. This provides a gentle introduction to the methods of the rest of the paper, but is completely independent of the subsequent sections; in particular, the reader interested only in Theorem 1.4 could easily skip the present section. Given an abelian group G, a coset progression of rank d is a subset of G of the form P H, where H < G is a finite subgroup and P = P (u, L), with u = (u1 , . . . , ud ) for some ui ∈ G and L = (L1 , . . . , Ld ) for some Li ≥ 1, is defined via o n P = uℓ11 · · · uℓdd : |ℓj | ≤ Lj . 10 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Given m > 0, this coset progression is called m-proper if the morphism φ : Zd → G/H mapping the canonical basis x = (x1 , . . . , xi ) to u is injective in restriction to P (x, mL). The following lemma is both standard and trivial. Lemma 4.1. Let P be a coset progression of rank at most d inside an abelian group G. Then for every k ∈ N there exists Xk ⊂ G with |Xk | ≪d 1 such that P 2k ⊂ Xk P k . We recall the following result from our previous paper. Theorem 4.2 ([24, Theorem 1.16]). Let A be a K-approximate group such that hAi is abelian. Then for every m > 0 there exists an m-proper coset progression HP of rank at most K O(1) such that A ⊂ HP ⊂ AOK,m (1) . Lemma 4.3. Under the assumptions of Theorem 1.5, for all but finitely many n ∈ N there exists a sequence kn ∈ N with n1/4 ≤ kn ≤ n1/2 and a 2-proper coset progression Hn Pn of rank dn ≪D 1 such that (4.1) Snkn ⊂ Hn Pn ⊂ SnOD (kn ) , and such that, writing Pn = Pord (u(n) , L(n) ), the rank dn is minimal in the sense that for each (n) (n) (n) (n) 1 ≤ i ≤ dn , if L̄(n) = (L1 , . . . , Li−1 , 0, Li+1 , . . . , Ldn ) then Snkn is not contained in Hn P (u(n) , L̄(n) ). Proof. Applying [24, Lemma 8.2] with ⌊n1/2 ⌋ in place of n gives, for all but finitely many n, an integer ℓn satisfying n1/4 ≤ ℓn ≤ 21 n1/2 such that |Sn5ℓn |/|Snℓn | ≪D 1. It then follows from [9, Lemma 2.2] that Sn2ℓn is an OD (1)-approximate group. Setting kn = 2ℓn , the existence of a 2-proper coset progression Hn Pn satisfying (4.1) then follows from Theorem 4.2. We obtain the minimality of dn simply by deleting dimensions whenever this is possible without violating (4.1).  We will eventually apply the following lemma to the coset progressions coming from Lemma 4.3. Lemma 4.4. Let Γ be an abelian group with finite symmetric generating set S containing the identity, let k ∈ N, and let HP = HP (u; L) be a 2-proper coset progression of rank d such that S k ⊂ HP but such that (4.2) S k 6⊂ HP (u; L1 , . . . , Li−1 , 0, Li+1 , . . . , Ld ) for every i. Then Li ≥ k for every i and S ⊂ HP (u; L/k). Proof. Let x1 , . . . xd be a basis of Zd , write Q = P (x, L), and let ϕ : Zd → Γ be the homomorphism mapping xi to ui for each i. The properness of HP implies that there exists a unique subset U ⊂ Q such that ϕ(U ) = S modulo H. We first claim that U k ⊂ Q. Indeed, let ℓ ∈ N be minimal such that there exists z1 , . . . , zℓ ∈ U with z = z1 · · · zℓ ∈ / Q, noting that by minimality we have z1 · · · zℓ−1 ∈ Q and hence z ∈ Q2 \ Q. If ℓ ≤ k we would have ϕ(z) ∈ S k ⊂ HP , and so there would exist z ′ ∈ Q with ϕ(z) = ϕ(z ′ ) mod H, contradicting the 2-properness of P . Thus ℓ > k, and in particular (4.3) U k ⊂ Q, as claimed. This immediately implies that S ⊂ HP (u; L/k), as required. Combined with (4.2) and the properness of HP , it also implies that for every i satisfying 1 ≤ i ≤ d there exists z ∈ U such that the ith coordinate of z is non-zero. It then follows from (4.3) that z k , whose ith coordinate is at least k, belongs to Q, and so Li ≥ k, as required.  SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 11 Lemma 4.5. Let d ∈ N, and let (Γn , Vn ) be a sequence of abelian Cayley graphs such that for every n the generating set Vn := P (u(n) , K (n) )Hn is a coset progression of rank at most d. Then for every sequence mn → ∞ the sequence of (pointed) metric spaces (Γn , dVn /mn ) is GH-relatively compact. Moreover, for every non-principal ultrafilter ω the ultralimit limω (Γn , dVn /mn ) is a connected abelian Lie group equipped with a Finsler metric. Proof. It follows from Corollary 3.4 and Lemma 4.1 that (Γn , dVn /mn ) is relatively compact. Observe that since Hn is contained in a ball of radius 1 = o(mn ), the limit is not affected by modding out by Hn , so we can simply assume that it is trivial. Note also that by Lemma 3.7 we may assume that the rank of Vn is equal to d for every n. Consider then the morphism πn : Zd → Γn mapping the canonical basis x = (x1 , . . . , xd ) to u(n) , and write Wn := P (x(n) , K (n) ). Being a length space, limω (Γn , dVn /mn ) is in particular connected, therefore Corollary 3.11 and Remark 3.12 implies that limω φn : limω (Zd , dWn /mn ) → limω (Γn , dVn /mn ) exists and is a surjective morphism. It is therefore sufficient to prove that limω (Zd , dWn /mn ) is a normed real vector space of dimension d. Note that WnR = P R (x(n) , K (n) ) is the convex hull of Wn in Rd , and by [2, Lemma 2.2.5.], for all k ∈ N (WnR )k ⊂ Wnk (WnR )Od (1) . Hence, (Zd , Wn ) ֒→ (Rd , WnR ) is a (Od (1), Od (1))-quasi-isometry. We deduce from Corollary 3.11 that limω (Zd , dWn /mn ) is bi-Lipschitz isomorphic to limω (Rd , dWnR /mn ). Observe that (Rd , WnR ) is isometric to (Rd , W R ), where W R = P R (x(n) , 1)), and one easily checks that limω (Rd , dW R /mn ) is isometric to (Rd , k · k), where the norm k · k has W R as unit ball. In conclusion, limω (Zd , dWn /mn ) is bi-Lipschitz isomorphic to Rd , and since its metric is invariant and geodesic (by Remark 3.12), it actually comes from a norm (see the proof of [2, Theorem 2.2.4]).  Lemma 4.6. Let d ∈ N, let ω be a non-principal ultrafilter, and let (Γn , Vn ) be a sequence of abelian Cayley graphs such that for ω-almost every n the generating set Vn := P (u(n) , K (n) )Hn is a coset (n) progression of rank d. Then, on permuting the indices of ui for every such n if necessary, there (n) (n) exists d′ ≤ d such that the coset progression Vn′ := P (u, K1 , . . . , Kd′ , 0, . . . , 0))Hn is Ωω (mn )′ ′ ′ ′ proper and, writing Γn = hVn i the inclusion (Γn , Vn ) ֒→ (Γn , Vn ) is a 1-Lipschitz (1, oω (mn ))-quasiisometry. Proof. The lemma is trivial if d = 0, so we may assume that d ≥ 1 and, by induction, that the lemma holds with d − 1 in place of d. If Vn is Ωω (mn )-proper the lemma is trivially satisfied, so we may assume that there exists a sequence rn = oω (mn ) and, for ω-almost every n, an element z (n) ∈ P (x(n) , K (n) )rn such that, writing x1 , . . . xd for the standard basis of Zd and ϕn : Zd → Γn for the homomorphism mapping xi (n) to ui for each i, we have ϕn (z (n) ) = 1. On permuting the coordinates of z (n) we may assume that (n) (n) (n) (n) |zd |/Kd = maxi |zi |/Ki . (n) (n) Let Λn be the subgroup of Γn generated by Wn = P (u, K1 , . . . , Kd−1 , 0)). We claim that, for every r ≥ 0, every element v of length r in (Γn , Vn ) lies at distance at most rn + 1 (with respect to dVn ) from an element y ∈ Λn of length r + rn with respect to dWn . By definition, such a v is of (n) the form v = uj11 . . . ujdd h with maxi |ji |/Ki = r, and h ∈ Hn . Let q and t be integers such that (n) (n) (n) jd = qzd + t, with |t| < |zd | and 0 ≤ q ≤ |jd |/|zd |. Now, using that ϕn (z (n) ) = 1, we obtain v = yutd h, 12 ROMAIN TESSERA AND MATTHEW C. H. TOINTON j −qz (n) jd−1 −qz (n) (n) (n) (n) d−1 where y = u11 1 . . . ud−1 . In particular, v lies at distance at most |t|/Kd +1 ≤ |zd |/Kd + 1 ≤ rn + 1 from y. On the other hand, y lies in the ball of radius (n) max |ji |/Ki i (n) (n) + q max |zi |/Ki i (n) (n) = r + q|zd |/Kd ≤ r + rn , which proves the claim. This implies that the inclusion (Λn , Wn ) ֒→ (Γn , Vn ) is a 1-Lipschitz (1, oω (mn ))-quasi-isometry. We conclude by applying the induction hypothesis to (Λn , Wn ).  Proof of Theorem 1.5. Let kn , Hn , Pn and dn be as given by Lemma 4.3 for all but finitely many (n) n, and note that by Lemma 4.4 we may assume that for every such n we have Li ≥ω kn for every (n) (n) i and Sn ⊂ Hn P (u(n) ; L(n) /kn ). Combined with (4.1), this implies that setting Ki = Li /kn ≥ 1 for every i and writing Vn = P (u(n) , K (n) )Hn we have (4.4) Vnkn ≈D Snkn . m /k This implies in particular that the word metrics on Γn associated respectively to Sn n n and to m /k Vn n n are OD (1)-bi-Lipschitz equivalent. Lemma 4.5 therefore implies that (Γ, dSn /mn ) is GHprecompact, as required. Lemma 3.9 implies that given a cluster point (X, dX ) of (Γ, dSn /mn ) we may fix a non-principal ultrafilter ω and assume that (Γ, dSn /mn ) →ω (X, dX ). We claim that we may also assume that Sn =ω Vn . We first consider the ultralimits. On the one hand, observe that by Corollary 3.11 the identity map (Γ, dSn /mn ) → (Γ, dSnkn /(mn /kn )) (resp. Γ, dVn /mn ) → (Γ, dVnkn /(mn /kn ))) induces an isometric isomorphism between the ultralimits. Moreover, since the identity (Γ, dSnkn /(mn /kn )) → (Γ, dVnkn /(mn /kn )) is OD (1)-bi-Lipschitz by (4.4), by Corollary 3.11 it induces a bi-Lipschitz isomorphism between the ultralimits, which are both geodesic by Remark 3.12. Composing these maps, we deduce that the identity map (Γ, dSn /mn ) → (Γ, dVn /mn ) induces a bi-Lipschitz isomorphism between the ultralimits. Since a geodesic invariant metric on an abelian connected Lie group is Finsler [3] (or see the proof of [2, Theorem 2.2.4.]), we deduce that if one ultralimit has a Finsler metric then so does the other. Second, observe that as Sn ⊂ Vn , we have |Sn | ≤ |Vn |. On the other hand, since kn = o(n), (4.4) implies that there exists c ≫D 1 such that Vncn ⊂ Snn , which combines with Lemma 4.1 to imply that |Vnn | ≪ |Snn |. The assumption that |Snn | ≪ nD |Sn | therefore implies that |Vnn | ≪ nD |Vn |, and so we may assume that Sn = Vn , as claimed. Since dn ≪D 1, Lemma 3.7 implies that there exists d ≪D 1 such that dn =ω d. Lemma 4.6 then reduces matters to the case where Sn is Ωω (mn )-proper. One consequence is that Snn ≫ω nd |Sn |, so that d ≤ D. A second consequence is that, writing Wn = P (x, K (n) ), the morphism limω (Zd , dWn /mn ) → limω (Γn , dSn /mn ), which is surjective by Corollary 3.11 is injective in restriction to a ball of radius Ωω (1). By the end of the proof of Lemma 4.5, we have that limω (Zd , dWn /mn ) is a normed vector space of dimension d. Hence the dimension of any cluster point of (Γn , dSn /mn ) equals d ≤ D, as required.  5. Progressions in free nilpotent groups Throughout this paper N = Nd,s denotes the free s-nilpotent group on d generators x = R be the Malcev (x1 , . . . xd ), and L = (L1 , . . . , Ld ) is a tuple of positive integers. Let N R = Nd,s completion of N , namely the free s-nilpotent Lie group of rank d, and let n be its Lie algebra. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 13 We recall that the Baker–Campbell–Hausdorff formula states that for elements X, Y in a Lie algebra we have (5.1) exp(X) exp(Y ) = exp(X + Y + 21 [X, Y ] + 1 12 [X, [X, Y ]] + · · · ). The precise values of the rationals appearing later in the series (5.1) are not important for our arguments; all that matters is that in a nilpotent Lie group the series is finite and depends only on the nilpotency class of the group. For each i we set fi = log xi . Following [17, §11.1] and [6, §1], we extend f1 , . . . , fd to a list f = f1 , . . . , fr of so-called basic commutators in the fi . We first define general commutators in the fi recursively, starting by declaring f1 , . . . , fd themselves to be commutators. As part of the recursive definition, we assign to each commutator α a weight vector χ(α) = (χ1 (α), . . . , χr (α)); for f1 , . . . , fd , these weight vectors are simply given by χi (fi ) = 1 and χj (fi ) = 0 for i 6= j. Now, given commutators α and β whose weight vectors have already been defined, the Lie bracket [α, β] is also defined to be a commutator, with weight vector χ(α) + χ(β). We define the total weight |χ(α)| of a commutator α to be kχ(α)k1 . We also now declare f1 , . . . , fd to be basic commutators. Having defined the basic commutators f1 , . . . , fm of total weight less than k, we define the basic commutators of total weight k to be those commutators of the form [fi , fj ] with i > j and |χ(fi )| + |χ(fj )| = k, and such that if fi is of the form [fs , ft ] then j ≥ t. We order these arbitrarily subject to the constraint that basic commutators with the same weight vector are consecutive, and abbreviate χ(i) = χ(fi ). Note that the arbitrariness of the order implies that the list of basic commutators is not uniquely defined. We caution that the basic commutators in the fi are not in general equal to the logarithms of the basic commutators in the xi . It is well known that (f1 , . . . , fr ) is a basis of n, and more generally that the basic commutators of total weight at least i form a basis for ni , the ith term of the lower central series of n; see [17, §11] or [18]. As in our previous paper [24], given L ∈ Rd and χ ∈ Nd we use the P notation Lχ to denote the χ1 χd χ tuple L1 · · · Ld . Thus BR (f ; L ) is the set of linear combinations of i λi fi where |λi | ≤ Lχ(i) . We also write Lf = (Lχ(1) f1 , . . . , Lχ(r) fr ). We remark that BR (f ; Lχ ) is the continuous version of the nilbox B(f1 , . . . , fd ; L) appearing in [6]. Lemma 5.1. For every L ∈ Nd we have [BR (f ; Lχ ), BR (f ; Lχ )] ⊂ Od,s (1)BR (f ; Lχ ). Proof. Since BR (f ; Lχ ) = BR (Lf ; 1), we may assume that L = 1. The lemma then follows from the  fact that BR (f ; 1) is a compact neighbourhood of the origin. Lemma 5.2. For every n ∈ N we have R (x, L)n ≈ χ (i) Pord d,s exp(BR (f ; (nL) ) ≈d,s exp(BR (f ; nL)), R R (x, L)n ≈ (ii) Pord d,s Pord (x, nL), and χ (iii) exp(BR (f ; (nL) ) ⊂ exp(BR (f ; Lχ )Od,s,n (1) . R (x, nL) = P R (xL , n), B (f ; (nL)χ ) = B (Lf ; nχ ), Proof. Observe that for all n ∈ N we have Pord R R ord and BR (f ; nL) = BR (Lf ; n), which reduces the the proof of these statements to the case where L = 1. Then (iii) and the n = 1 case of (i) simply follow from the fact that all terms are compact generating sets (explicit constants can also be obtained through the Baker–Campbell–Hausdorff formula); the general case of (i) follows from the proof of [16, Theorem II.1]. Finally, (i) implies χ R n R (x, nL) ≈  that Pord d,s exp(BR (f ; (nL) ) ≈d,s Pord (x, L) , which implies (ii). 14 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Proposition 5.3. For all k ∈ N we have (5.2) R R R Pord (x; L)k ⊂ Pord (xL ; 1)Od,s (k) Pord (x; L)Od,s (1) ⊂ Pord (x; L)Od,s (k) Pord (x; L)Od,s (1) . Moreover, (5.3) R Pord (x; L)k ∩ N ⊂ Pord (x; L)Od,s (k) . Proof. The second inclusion of (5.2) is trivial. To prove the first inclusion, note first that applying i the automorphism of NR that maps xL i to xi reduces the statement to the case where Li = 1, and so it suffices to prove that R R (x; 1)Od,s (1) . (x; 1)k ⊂ Pord (x; 1)Od,s (k) Pord Pord Let D be a compact subset such that N D = N R . Observe that the map φ : NR → N that sends g ∈ NR to the unique γ ∈ N such that g ∈ γD is a left-inverse of the inclusion N → NR . Since R (x; 1) and P the latter is a quasi-isometry for the word metric associated to Pord ord (x; 1), we deduce k R that φ itself is a quasi-isometry. In particular, the ball Pord (x; 1) of radius k must me contained in the preimage by φ of a ball of radius Od,s (k). This implies that R (x; 1)k ⊂ Pord (x; 1)Od,s (k) D, Pord R (x; 1) generates N R . The inclusion and so the first inclusion of (5.2) follows from the fact that Pord R  (5.3) then follows from the fact that Pord (x; L) ∩ N = Pord (x; L). Note that ordered progressions are “almost” symmetric in the sense that for group elements x1 , . . . , xd and integers L1 , . . . , Ld the ordered progression Pord (x, L) satisfies (5.4) Pord (x, L)−1 ⊂ Pord (x, L)d (a similar statement holds for real ordered progressions). We deduce the following statement. R (x; L) ∪ P R (x; L)−1 Then for Corollary 5.4. Denote P = Pord (x; L) ∪ Pord (x; L)−1 and PR = Pord ord all k ∈ N we have O (1) P k ⊂ PRk ⊂ P Od,s (k) PR d,s . In particular, the inclusion (N, P ) → (NR , PR ) is a (Od,s (1), Od,s (1))-quasi-isometry. Let us also note the equally trivial fact that for m ∈ N we have (5.5) Pord (x, mL) ⊂ Pord (x, L)dm . We end this section with an application of Proposition 5.3. Breuillard and the second author [9] have shown that doubling of a Cayley graph at some sufficiently large scale implies uniform doubling at all subsequent scales, as follows. Theorem 5.5 ([9, Theorem 1.1]). For every K ≥ 1 there exist n0 = n0 (K) ∈ N and θ(K) ≥ 1, such that if S is a finite symmetric set inside some group, and if there exists n ≥ n0 for which (5.6) |S 2n+1 | ≤ K|S n |, then for every m ≥ n and every c ∈ N we have |S cm | ≤ θ(K)c |S m |. Using the main result of [8], they reduce Theorem 5.5 to the following statement. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 15 Proposition 5.6 ([9, Theorem 2.8]). Let K ≥ 1 and s ≥ 1. Suppose that S is K-approximate subgroup in some s-step nilpotent group G. Then for every m ≥ 1 the set S m is an OK,s (1)approximate subgroup. The proof of Proposition 5.6 in [9] requires some fairly involved computations with nilprogressions. We take the opportunity here to note that Proposition 5.3 yields an alternative proof of Proposition 5.6. We make use of the following well-known lemma, the proof of which is left as an exercise. Lemma 5.7. Let r0 ≥ 1, j ∈ N and φ : (X, dX ) → (Y, dY ) be a (C, K)-quasi-isometry between two metric spaces, and assume that for all all r ≥ r0 , all balls of radius 2r in Y are covered by at most j balls of radius r. Then there exists j ′ = Oj,C,K (1) and r0′ = Oj,C,K (r0 ) such that for all r ′ ≥ r0′ , all balls of radius 2r ′ in X are covered by at most j ′ balls of radius r ′ . Lemma 5.8. We keep the notation of Corollary 5.4. For all r ≥ 1 there exists X ⊂ NR of cardinality Os,d (1) such that PR2r ⊂ XPRr . i Proof. Applying the automorphism of NR that maps xL i to xi reduces the statement to the case where Li = 1. In that case, it follows from [16, Theorem II.1] that there exists some K = Od,s (1) such that |PR2r | ≤ K|PRr | for every r, and so the result follows from Lemma 3.5.  Proof of Proposition 5.6. By the first paragraph of the proof of [9, Theorem 2.8], it is sufficient to find a positive integer M0 depending only on K and s such that S M0 m is an OK,s (1)-approximate subgroup for all m ≥ 1. We may assume that S generates G, in which case it follows from [25, Theorem 1.5] that there exists a normal subgroup H ⊳ G, as well as u1 , . . . , ud ∈ G and L1 , . . . , Ld ∈ N with d ≤ K Os (1) such that (5.7) S ⊂ H(Pord (u; L) ∪ Pord (u; L)−1 ) ⊂ S K Os (1) . Write N = Nd,s for the free s-step nilpotent group on d generators x1 , . . . , xd , let π : N → G be the homomorphism taking xi to ui for every i, and write P = Pord (x; L) ∪ Pord (x; L)−1 . It follows from Corollary 5.4, Lemma 5.7 and Lemma 5.8 that there exists r0 ≪K,s 1 such that for every r ≥ r0 there exists Xr ∈ G of cardinality OK,s (1) such that π(P )2r ⊂ Xr π(P )r . It also follows from (5.7) that there exists M0 ≪K,s 1 such that S ⊂ Hπ(P )r0 ⊂ S M0 , and hence S 2M0 m ⊂ Hπ(P )2M0 r0 m 2M0 ⊂ Xmr Hπ(P )r0 m 0 as required. 2M0 M0 m ⊂ Xmr S , 0  6. Overview of the general case In this section we give an overview of the proofs of Theorems 1.2 and 1.4. The majority of the argument is contained in the following two results, which we prove in the next few sections. Proposition 6.1. Let (Γn , Sn ) and (mn ) be as in Theorem 1.2. Then there exists a natural number d ≪D 1 and, for ω-almost every n, a simply connected nilpotent Lie group Gn of dimension d and homogeneous dimension at most D such that there is a basis e(n) of the Lie algebra of Gn and a tuple L(n) ∈ Ndn such that (e(n) ; L(n) ) is in OD (1)-upper-triangular form. There also exists a sequence 16 ROMAIN TESSERA AND MATTHEW C. H. TOINTON (n) (n) R (u(n) ; L(n) ) with u of integers jn → ∞ such that, denoting Qn = Pord = exp ei , the sequence i (Gn , dQn /jn ) is relatively compact for the GH topology, limω (Gn , dQn /jn ) is a connected nilpotent Lie group with a geodesic metric, and dim lim(Γn , dSn /mn ) ≤ dim lim(Gn , dQn /jn ). ω ω Moreover, under the stronger assumption of Theorem 1.4, we have in addition hdim lim(Γn , dSn /mn ) ≤ hdim lim(Gn , dQn /jn ). ω ω Theorem 6.2. Let Gn be a sequence of simply connected nilpotent Lie groups of dimension d, and let e(= e(n) ) be a basis of the Lie algebra gn of Gn , and let (jn ) be a sequence of integers tending to (n) (n) ∞. Suppose that for each n the convex hull Ωn of {±e1 , . . . , ±ed } satisfies [Ωn , Ωn ] ⊂ Oω (1)Ωn . R (u; 1). Then (G , d Write ui = exp(ei ), and let Qn = Pord n Qn /jn ) is relatively compact for the GH topology, limω (Gn , dQn /jn ) is a connected nilpotent Lie group with a geodesic metric, dim lim(Gn , dQn /jn ) = d, ω and if hdim (Gn ) ≤ω D, then hdim lim(Gn , dQn /jn ) ≤ D. ω Proof of Theorems 1.2 and 1.4. It follows from Theorem 1.1 that the sequence (Γn , dSn /mn ) is relatively compact and that every cluster point is a connected nilpotent Lie group with a left-invariant sub-Finsler metric. Given such a cluster point (G, d), on restricting to a subsequence we may assume d d that (Γn , mSnn ) → (G, d), and hence by Lemma 3.9 that (Γn , mSnn ) →ω (G, d). The theorems then follow from Proposition 6.1 and Theorem 6.2, noting that upon replacing the pairs (e(n) , L(n) ) coming from Proposition 6.1 with (L(n) e(n) , 1) they indeed satisfy the hypotheses of Theorem 6.2.  Proposition 6.1 and Theorem 6.2 each feature a statement about the relative compactness of a sequence (Gn , dQn /jn ) and the form of its ultralimit. Underpinning this aspect of these results is the following statement. Proposition 6.3. Let (jn ) be a sequence of integers going to infinity, and let (Γn , Pn ) be a sequence of Cayley graphs such that either Γn is a finitely generated nilpotent group of bounded step and Pn is an ordered progression of bounded rank, or Γn is a connected nilpotent Lie group of bounded step and Pn is a real ordered progression of bounded rank. Let dPn denote the word metric associated to Pn . Then the sequence (Γn , j1n dPn ) is relatively compact for the GH topology and limω (Γn , j1n dPn ) is a connected nilpotent Lie group equipped with a geodesic metric. R (u, L), where u = Proof. We first treat the connected case. Assume therefore that Pn = Pord (n) (n) (u1 , . . . , ud ) ∈ Γdn and L(n) = (L1 , . . . , Ld ) ∈ (1, ∞)d , and we assume that Γn has step at most s. Let NR be the free connected nilpotent Lie group of step s and rank d, let x1 , . . . xr be elements inducing a basis of NR /[NR , NR ] and let πn : NR → Γn be the canonical projection mapping xi to ui . R (x, L(n) )). To prove the relative compactness of (Gn , Pn ) it is then sufficient to prove it for (NR , Pord L (n) Applying the automorphism of NR that maps xi i to xi reduces this statement to the case where (n) Li = 1. However, as in the proof of Lemma 5.8, it follows from [16, Theorem II.1] and the R (x; 1)) has the doubling property, and so its relative argument of [9, Lemma 2.2] that (NR , Pord compactness is a consequence of Corollary 3.4. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 17 The ultralimit π∞ : lim(NR , dP R ω ord (x;L (n) ) /jn ) ≃ NR → lim(Γn , dP R ω ord (u;L (n) ) /jn ) of the sequence πn induces a transitive action by isometries of NR on limω (Γn , dP R (u;L(n) ) /jn ). ord Therefore, to conclude it is enough to show that the limit is a group, or equivalently that for all sequences gn , hn ∈ Γn such that d(gn , en ) = Oω (1), and d(hn , en ) = oω (1), then d([gn , hn ], en ) = oω (1). Once again, up to lifting these sequences in NR , we are reduced to proving this statement R (x, 1)), for which it follows by an easy computation based on Lemma 5.2. for sequences in (NR , Pord The discrete case similarly reduces to the case of N = Nr,s , the free step s nilpotent group generated by x1 , . . . xr , equipped with the word metric associated to Pord (x; L). Reasoning as in R (x, L(n) )) is a the proof of Proposition 5.3, we see that the injection (N, Pord (x; L(n) )) → (NR , Pord (O(1), O(1))-quasi-isometry, so that the proof reduces to the connected case.  7. Reduction to simply connected nilpotent Lie groups The aim of this section is to prove Proposition 6.1. An important tool in the proof is the notion of a Lie progression. Definition 7.1 (Lie coset progression). Let m ∈ N ∪ {∞}, let Γ be a group, and let y1 , . . . , yd ∈ Γ. An ordered coset progression HPord (y; L) is said to be an m-proper Lie coset progression of rank d and homogeneous dimension D in C-upper-triangular form if there exists a connected, simply connected nilpotent Lie group G with Lie algebra g of homogeneous dimension D, with basis e1 , . . . , ed such that (e; L) is in C-upper-triangular form and exphe1 , . . . , ed i is a subgroup of G, and such that, writing ui = exp ei for each i, there exists a map ϕ : hu1 , . . . , ud i → hy1 , . . . yd i that is a homomorphism modulo H such that ϕ(ui ) = yi for each i and such that Pord (u; L) is m-proper with respect to ϕ modulo H. We also define the injectivity radius of this Lie coset progression to be the supremum of those j ∈ R such that ϕ is injective modulo H on Pord (u; L)j . If H is trivial then we say simply that Pord (y; L) is an m-proper Lie progression of rank d and homogeneous dimension D in C-upper-triangular form. Remark 7.2. It follows from [24, Proposition 4.1] and that an m-proper Lie coset progression of rank d in C-upper-triangular form is m-proper and in OC,d (1)-upper-triangular form as an ordered coset progression. Remark 7.3. Adopting the notation from Definition 7.1, it follows from Remark 7.2 and [24, Lemma 2.1] that if HP is an m-proper Lie coset progression then it has injectivity radius ΩC,d (m1/d ). The following result essentially reduces the proof of Proposition 6.1 to the study of Lie progressions. Theorem 7.4. Let D > 0. Let (Γn , Sn ) be a sequence of Cayley graphs such that (7.1) |Snn | ≪ω nD |Sn |. Then there exist integers t ≪D 1 and a sequence of positive integers kn = oω (n) such that for ω-almost every n there exists a Lie coset progression Hn Pn ⊂ Γn of rank at most D in OD (1)upper-triangular form with injectivity radius Ωω (n/kn ), and a finite subset Xn ⊂ Snt such that |Xn | ≪D 1 and such that for every r ≥ 1 we have Xn Hn Pnr ⊂ Snrkn ⊂ Xn Hn PnOD (r) Moreover, if |Snn | ≪ω nD then ω-almost every Pn has homogeneous dimension at most D. 18 ROMAIN TESSERA AND MATTHEW C. H. TOINTON We spend the first part of this section proving Theorem 7.4. The starting point is the following result from our first paper. Proposition 7.5 ([24, Proposition 1.10]). Let M, D ′ > 0, and let S be a finite symmetric generating k D ′ |S| for ′ set for a group G such that 1 ∈ S. Then there exists N ′ = NM,D ′ such that if |S | ≤ M k some k ≥ N ′ then there exist integers t, η ≪D′ 1, a set X ⊂ S t such that |X| ≪D′ 1, and a 1-proper Lie coset progression HP of rank at most OD′ (1) in OD′ (1)-upper-triangular form such that (7.2) for every r ∈ N. XHP r ⊂ S rk ⊂ XHP ηr , Remarks on the proof. The proposition here is slightly stronger than [24, Proposition 1.10] in that that proposition does not specify that the progression should be a Lie progression. To obtain this extra conclusion requires two minor modifications of the proof. More precisely, it requires two minor modifications of the proof of [24, Proposition 8.1], which is a more detailed statement from which we deduce [24, Proposition 1.10]. The first modification is to replace [24, Theorem 1.15] with [24, Theorem 7.1] in the proof ([24, Theorem 7.1] mentions the Lie structure explicitly, whereas this is suppressed in the statement of [24, Theorem 1.15]). The second modification is to remove from the proof of [24, Proposition 8.1] the stage where we delete generators that are not necessary for [24, (8.5)] to hold.  The next result allows us to modify the progression coming from Proposition 7.5 to make it proper in some sense. Proposition 7.6. Let (Γn ) be a sequence of groups, let η ∈ N, and suppose that for ω-almost every n we have a finite symmetric generating set Sn for Γn , a finite subset Xn of Γn , and a Lie coset progression Hn Pn in Γn of rank d in C-upper-triangular form such that (7.3) Xn Hn Pn ⊂ Snkn r ⊂ Xn Hn Pnηr for every r ∈ N. Suppose that the injectivity radius of Hn Pn is oω (n/kn ). Then for ω-almost every n there exists kn′ = oω (n) and a Lie coset progression Hn′ Pn′ of rank strictly less than d and injectivity radius Ωω (n/kn′ ) in Od (1)-upper-triangular form such that (7.4) for every r ∈ N. ′ Xn Hn′ (Pn′ )r ⊂ Snkn r ⊂ Xn Hn′ (Pn′ )OC,d (ηr) There are two main ingredients in our proof of Proposition 7.6. The first is one of the key results from our previous paper, as follows. Proposition 7.7 ([24, Proposition 7.2]). Let H0 P0 be a Lie coset progression of rank d in C-uppertriangular form that is not m-proper. Then there exists an m-proper Lie coset progression HP of rank strictly less than d and in Od (1)-upper-triangular form such that OC,d,m (1) H0 P0 ⊂ HP ⊂ H0 P0 . The second ingredient is an important property of Lie progressions in upper-triangular form, namely that a power of such a progression is itself roughly equal to such a progression, as follows. Proposition 7.8. Let G be a nilpotent Lie group with Lie algebra g with basis e1 , . . . , ed such that Λ = he1 , . . . , ed i satisfies [Λ, Λ] ⊂ Λ, and let L1 , . . . , Ld ∈ N. Then for each k ∈ N there exists a SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 19 basis e′1 , . . . , e′d for g and L′1 , . . . , L′d ∈ N such that (e′ , L′ ) is in 1-upper triangular form and such that, writing ui = exp ei and u′i = exp e′i for each i, we have Pord (u; L)k ≈d Pord (u′ , L′ ). In proving Proposition 7.8 we make use of the following lemma. We recall from our previous paper that we say a convex body Ω in a vector space V is strictly thick with respect to a lattice Λ if there exists some λ < 1 such that λΩ ∩ Λ generates Λ. Lemma 7.9. In the set-up of Proposition 7.8, for all k ∈ N there exists a symmetric convex body R (u; L)k ≈ exp(Ω). Ω ⊂ g, strictly thick with respect to he1 , . . . , ed i, such that [Ω, Ω] ⊂ Ω and Pord d Proof. Note that the step s of G satisfies s ≪d 1, so that any bound that in principle depends on d and s may in fact be taken to depend only on d. Write π : N R → G for the homomorphism mapping xi to ui for each i, write πn : n → g for the corresponding homomorphism of Lie algebras, write fi = log xi for each i, and extend (fi ) to a list of basic commutators as in Section 5. It follows R (x; L)k ≈ from Lemmas 5.1 and 5.2 that [BR (f ; (kL)χ ), BR (f ; (kL)χ )] ⊂ Od (1)BR (f ; (kL)χ ) and Pord χ exp(BR (f ; (kL) )). The same argument used in the proof of [24, Proposition 5.1] to put the tuple (e, L) into 1-upper-triangular form then implies that there exists some L′ ∈ Zr satisfying (kL)χ(i) ≤ L′i ≤ Od ((kL)χ(i) ) such that [BR (f ; L′ ), BR (f ; L′ )] ⊂ BR (f ; L′ ), and then Lemma 5.2 (iii) implies that exp(BR (f ; L′ )) ≈d exp(BR (f ; (kL)χ )). The desired conclusion therefore follows by taking Ω = πn (BR (f ; L′ )).  Proof of Proposition 7.8. Let Ω be given by Lemma 7.9, so that (7.5) R (u; L)k ≈d exp(Ω). Pord By [24, Proposition 5.1] there exists a basis e′ of the lattice he1 , . . . , ed i ⊂ g, and L′ ∈ Zd such that (e′ ; L′ ) is in 1-upper-triangular form and such that Ω ⊂ BR (e′ ; L′ ) ⊂ Od (1)Ω. The Baker–Campbell–Hausdorff formula then implies that (7.6) whilst Lemma 5.2 (i) implies that (7.7) exp(Ω) ≈d exp(BR (e′ ; L′ )), R exp(BR (e′ ; L′ )) ≈d Pord (u′ , L′ ). Proposition 7.8 then follows from (7.5), (7.6) and (7.7).  Proof of Proposition 7.6. Since a Lie coset progression of rank 0 has infinite injectivity radius, by induction on d it suffices to prove the proposition without the conclusion that Hn′ Pn′ has injectivity radius Ωω (n/kn′ ). The fact that Hn Pn has injectivity radius oω (n/kn ) implies in particular that if we define jn to jn be the minimum integer such that ϕ−1 n (Hn ) ∩ P̃n 6= {e} then (7.8) jn = oω (n/kn ). Proposition 7.8 and Remark 7.3 then imply that there exist Lie coset progressions Hn Qn of rank d in OC,d (1)-upper triangular form such that (7.9) Hn Qn ≈C,d Hn Pnjn 20 ROMAIN TESSERA AND MATTHEW C. H. TOINTON for ω-almost every n, and ξ > 0 depending only on C and d such that for ω-almost every n the Lie coset progression Hn Qn is not ξ-proper. Proposition 7.7 therefore implies that there exist Lie coset progressions Hn′ Pn′ of rank strictly less than d and in Od (1)-upper-triangular form such that Hn′ Pn′ ≈C,d Hn Qn (7.10) for ω-almost every n. It then follows from (7.3), (7.9) and (7.10) that (7.4) holds for some kn′ ≪ω jn kn , which by (7.8) is in oω (n), as required.  Lemma 7.10. Let d, η, k, t be positive integers. Let S be a finite symmetric generating subset for a group Γ, let HP ⊂ Γ be a 1-proper Lie coset progression of rank at most d, and let X ⊂ S t be such that XHP r ⊂ S rk ⊂ XHP ηr for every r ∈ N. Then, writing T = S 3t ∩ HP (d+1)η , we have HP ⊂ (S 2t+1 ∩ HP (d+1)η )k ⊂ T k . In particular, for all r ≥ 1 we have (7.11) S rk ⊂ S t T ηrk . Proof. Let z ∈ HP . Since HP ⊂ S k , we can write z = sk . . . s1 , with si ∈ S. Let g0 = 1, and for every 1 ≤ i ≤ k write gi = si si−1 . . . s1 , observing that therefore z = gk . Hence for all 1 ≤ i ≤ k −1 there exists xi ∈ X and zi ∈ HP η such that gi = xi zi . We therefore have that zi zi−1 = xi si x−1 i−1 , 2t+1 (d+1)η which belongs to S ∩ HP by (5.4).  Lemma 7.11. Under the assumptions of Lemma 7.10, and writing q = max{3tη, (d+ 1)η}, we have |X| T k ⊂ HP (d+3) q . Proof. Since T k ⊂ S 3tk by definition, we have (7.12) T k ⊂ XHP 3tη . We first claim that, writing q = max{3tη, (d + 1)η}, there exist X ′ ⊂ X and m ∈ N satisfying q ≤ m ≤ (d + 3)|X| q such that (7.13) XHP 3tη ⊂ X ′ HP m and (7.14) xHP m ∩ HP 2m = ∅ for every x ∈ X ′ \{1}. To prove this claim, we first take X ′ = X and m = q. These choices certainly satsify (7.13). If they also satisfy (7.14) then the claim is proved. If not, there exists x ∈ X ′ \{1} such that xHP m ∩ HP 2m 6= ∅, which by (5.4) means that xHP m ⊂ HP (d+3)m . If we replace X ′ by X ′ \{x} and m by (d + 3)m then (7.13) is therefore still satisfied, and so we check again whether (7.14) is satisfied, and repeat if necessary. This process terminates after at most |X| steps, and so the claim is proved. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 21 We now claim that T j ⊂ HP m for j = 1, . . . , k, which of course implies in particular that |X| ⊂ HP (d+3) q , as required. The case j = 1 follows from the definition of T and the fact that m ≥ q, so by induction we may assume that T j−1 ⊂ HP m . This then implies that Tk T j ⊂ HP m+(d+1)η ∩ X ′ HP m ⊂ HP m (by (7.12) and (7.13)) (by definition of X ′ and m), and the claim is proved.  In order to use the growth bounds in the hypothesis of Theorem 7.4, we use two lower bounds on the growth of sets in nilpotent groups of given dimension. The first of these gives a lower bound on the growth in terms of the homogeneous dimension, as follows. Lemma 7.12. Let Λ be a torsion-free nilpotent group of rank r and step s, and let G be its Mal’cev completion. Then for every symmetric generating subset Σ of Λ we have for n ∈ N. |Σn | ≫s,r nhdim G ±1 Proof. Note that Σ contains a set of the form (s±1 1 , . . . , sr ), where the si generate Λ/[Λ, Λ]. Let s q = dim C (Λ) ⊗ Q. As iterated commutators ci of length s form a generating set of C s (Λ) ⊗ Q, we can extract a basis (ci1 , . . . , ciq ). Let ci = [sj1 , . . . , sjs ]. For all (k1 , . . . , ks ) ∈ Ns , we have [sjk11 , . . . , skjss ] = cik1 k2 ...ks . Hence the ball of radius n contains Ωr,s (ns ) elements of the form cki . We deduce that it contains Ωr,s(nqs ) elements of C s (Λ). Hence the lemma follows by induction on s.  The second such result gives a lower bound on the relative growth in terms of the dimension. Proposition 7.13. Let d ∈ N, there exists c = c(d) > 0 such that the following holds. Let Λ be a torsion-free nilpotent group with Mal’cev completion G of dimension d. Then for every symmetric generating subset Σ of Λ we have |Σn | ≥ cnd |Σ| for n ∈ N. The proof is, unsurprisingly, by induction on d. The induction step is based on the following standard result from additive combinatorcs. Lemma 7.14. Let A and B be finite subsets of Z. Then |A + B| ≥ |A| + |B| − 1. In particular, by induction on n we have |nA| ≥ n(|A| − 1). Proof. Label the elements of A as a1 < . . . < ap and the elements of B as b1 < . . . < bq , and note that the elements a1 + b1 , a2 + b1 , . . . , ap + b1 , ap + b2 , . . . , ap + bq are strictly increasing, and therefore, in particular, distinct.  Proof of Proposition 7.13. Let Λ′ be a subgroup of Λ such that Λ/Λ′ ∼ = Z and such that the Mal’cev completion of Λ′ has codimension 1 in G, and write π : Λ → Λ/Λ′ for the quotient homomorphism. Let R be a set of representatives in Λ of the cosets of Λ′ that have non-trivial intersection with Σ, and note that by symmetry of Σ we have Σ ⊂ R(Σ2 ∩ Λ′ ). Since |R| = |π(Σ)|, this implies that (7.15) |Σ| ≤ |π(Σ)||Σ2 ∩ Λ′ |. 22 ROMAIN TESSERA AND MATTHEW C. H. TOINTON On the other hand, given n ∈ N let Rn be a set of representatives in Λ of the cosets of Λ′ that have non-trivial intersection with Σn . Since |Rn | = |π(Σ)n |, Lemma 7.14 implies that |Rn | ≫ n|π(Σ)|, and by induction we may assume that |(Σ2 ∩ Λ′ )n | ≫d nd−1 |Σ2 ∩ Λ′ |. Since Rn (Σ2 ∩ Λ′ )n ⊂ Σ3n , this combines with (7.15) to imply that which implies the required bound. |Σ3n | ≫d nd |Σ|,  D′ Proof of Theorem 7.4. For ω-almost every n we may apply Proposition 7.5 with = 2D to obtain t integers t, η depending only on D, and for ω-almost every n a subset Xn ⊂ Sn with |Xn | ≪D 1 and a 1-proper√Lie coset progression Hn Pn of rank OD (1) in OD (1)-upper triangular form such that r n Xn Hn Pnr ⊂ Sn ⊂ Xn Hn Pnηr for all r. By Lemma 3.7, on passing to an appropriate subsequence we may assume that √ each of these Lie coset progressions has the same rank d ≪D 1. By Proposition 7.6, on replacing n with some sequence kn = oω (n) we may assume that Hn Pn has injectivity radius Ωω (n/kn ). It remains to show that d ≤ D, and that if |Snn | ≪ω nD then the homogeneous dimension of ω-almost every Pn is at most D. By the definition of a Lie coset progression, for ω-almost every n we have a connected, simply (n) (n) connected nilpotent Lie group Gn with Lie algebra with basis e1 , . . . , ed such that (e(n) ; L(n) ) (n) (n) is in C-upper-triangular form and exphe1 , . . . , ed i is a subgroup of Gn , and such that, writing (n) (n) (n) (n) (n) (n) ui = exp ei for each i and Λn = hu1 , . . . , ud i, there exists a map ϕn : Λn → hy1 , . . . yd i that (n) (n) is a homomorphism modulo Hn such that ϕn (ui ) = yi for each i, such that Pn = Pord (y (n) ; L(n) ), and such that ϕn is injective on Pord (u(n) ; L(n) )Ωω (n/kn ) modulo Hn . (d+1)η Writing Tn = Sn3t ∩ Hn Pn for every n where this is defined, Lemmas 7.10 and 7.11 imply that there exists ρ ∈ N depending only on D such that (7.16) Hn Pn ⊂ T kn ⊂ Hn Pnρ . The fact that the injectivity radius tends to infinity with respect to ω implies that for ω-almost every n there exists a unique subset T̃n ⊂ Pord (u(n) ; L(n) )(d+1)η such that ϕn (T̃n )Hn = Tn Hn . The second containment of (7.16) then implies that ϕn is injective modulo Hn in restriction to T̃nqn for some sequence qn ≫ω n, which implies in particular that (7.17) |T̃nqn ||Hn | =ω |Tnqn Hn |. o (n) We may assume that qn ≤ω n/4t, which combined with the fact that Tn ⊂ Sn3t and Hn ⊂ Snω implies that Tnqn Hn ⊂ω Snn , and hence (7.18) |Tnqn Hn | ≤ω |Snn |. Since qn ≥ω kn , it follows from (7.16) that T̃nqn contains Pord (u(n) ; L(n) ), and hence generates Λn , and so Lemma 7.12 implies that (7.19) and Proposition 7.13 implies that (7.20) |T̃nqn | ≫ω nhdim Gn |T̃nqn | ≫ω nd |T̃n |. Finally, the fact that Sn ⊂ Xn Hn Pnη and Xn ⊂ Snt implies that Sn ⊂ Xn (Snt+1 ∩ Hn Pnη ) ⊂ Xn Tn , and hence (7.21) |Tn | ≥ |Sn |/|Xn | ≫D |Sn |. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 23 Combining these inequalities gives |Snn | ≥ω |Tnqn Hn | (by (7.18)) =ω |T̃nqn ||Hn | ≫ω nd |T̃n ||Hn | ≥ω nd |Tn | (by (7.17)) (by (7.20)) (by definition of T̃n ) d ≫ω n |Sn | (by (7.21)), and so (7.1) implies that d ≤ω D, as required. Moreover, (7.17), (7.18) and (7.19) imply that if |Snn | ≪ω nD then hdim Gn ≤ω D, as required.  Having reduced the proof of Proposition 6.1 to the study of Lie progressions via Theorem 7.4, we now study these progressions a little. Proposition 7.15. Let G be a connected, simply connected nilpotent Lie group with Lie algebra g with basis e1 , . . . , ed , and let L1 , . . . , Ld ∈ N be such that (e; L) is in C-upper-triangular form. Write ui = exp ei for each i, and write Λ = hu1 , . . . , ud i. Then for every k ∈ N we have R Pord (u, L)k ⊂ Pord (u; L)k ∩ Λ and R Pord (u; L)k ∩ Λ ⊂ Pord (u, L)Od,C (k) . R (u; L)n ⊂ P R (u; O Lemma 7.16. In the setting of Proposition 7.15 we have Pord C,d,n (L)) for every ord n ∈ N. Proof. The argument of [24, Proposition 4.1] implies that (u; L) is in OC,d (1)-upper-triangular form over R. The result then follows from using this in place of the upper-triangular form over Z in the proof of [24, Lemma 2.1].  Proof of Proposition 7.15. The first conclusion is trivial. Write s for the nilpotency class of Λ, noting that s ≪d 1, and write π : N = Nd,s → Λ for the homomorphism mapping xi to ui for each i. Then note that R R (u; L)Od (1) (u; L)k ⊂ Pord (u; L)Od (k) Pord Pord R (u; Od,C (L)) ⊂ Pord (u; L)Od (k) Pord (by Proposition 5.3) (by Lemma 7.16), and hence that R Pord (u; L)k ∩ Λ ⊂ Pord (u; L)Od (k) Pord (u; Od,C (L)) ⊂ Pord (u; L)Od,C (k) (by (5.5)), which gives the second conclusion. Corollary 7.17. Under the assumptions of Proposition 7.15 the embedding of Cayley graphs R (u; L)) (Λ, Pord (u, L)) ֒→ (G, Pord is an (Od,C (1), Od,C (1))-quasi-isometry (see Definition 1.10).  24 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Corollary 7.18. Let (Gn ) be sequence of connected, simply connected nilpotent Lie groups of di(n) (n) mension d. For each n write gn for the Lie algebra of Gn , and let e(n) = e1 , . . . , ed be a basis (n) (n) for gn and L(n) = (L1 , . . . , Ld ) ∈ Nd a d-tuple of integers such that (e(n) ; L(n) ) is in C-upper(n) (n) (n) (n) triangular form. Write ui = exp ei for each i, and write Λn = hu1 , . . . , ud i. Let Sn be a generating set for Λn , and suppose that (kn ) is a sequence of positive integers such that kn = o(n) and such that Snkn ≈ω Pord (u(n) , L(n) ). Then for every  sequence (mn ) of integers such that mn ≫ n the sequences (Λn , dSn /mn ) and  Gn , dP R dS lim Λn , n ω mn ord (u(n) ;L(n) ) mn /kn  are precompact and ∼ = lim Gn , dP R ord (u (n) ;L(n) ) ! . mn /kn   dP R (u(n) ;L(n) ) ord Proof. Proposition 6.3 implies precompactness of the sequence Gn , , which by Corolmn /kn ω lary 7.17 implies that of (Λn , dSn /mn ). The isomorphism of the limits then follows from Corollary 7.17.  (d+1)η Lemma 7.19. Let (Γn , Sn ) and (mn ) be as in Theorem 1.1, and write Tn = Sn3t ∩ Hn Pn for the ω-almost every n for which this is therefore defined by Theorem 7.4. Then the sequence (hHn Pn i, dTn /mn ) is precompact, and for ω-almost every n there exists a surjective continuous morphism from limω (hHn Pn i, dTn /mn ) to limω (Γn , dSn /mn ), both being connected nilpotent Lie groups (equipped with left-invariant sub-Fisnler metrics). Proof. To see that (hHn Pn i, dTn /mn ) is precompact, simply note that |Tnn | ≤ |Sn |3t ≪ω n3tD and apply Theorem 1.1. To prove the existence of the surjective morphism, first note that the inclusion ψn : (hHn Pn i, dTn ) → (Γn , dSn ) is 3t-Lipschitz, whilst Lemma 7.10—specifically (7.11)—implies that for all r ≥ 1 and u ∈ Snrkn there exists v ∈ Tn±ηrkn such that dSn (u, v) ≤ t. The desired morphism is therefore given by Corollary 3.11.  Proof of Proposition 6.1. Applying Theorem 7.4, we obtain a sequence (7.22) kn = o(n), positive integers d, t, η depending only on D, and, for ω-almost every n, a Lie coset progression Hn Pn ⊂ Γn of rank d and injectivity radius Ωω (n/kn ) in OD (1)-upper-triangular form, and, if |Snn | ≪ nD , of homogeneous dimension at most D. We also obtain a finite subset Xn ⊂ Snt such that |Xn | ≪D 1 and such that for every r ≥ 1 we have (d+1)η Defining Tn = Sn3t ∩ Hn Pn Xn Hn Pnr ⊂ Snrkn ⊂ Xn Hn Pnηr . , it follows from Lemmas 7.10 and 7.11 that Hn Pn ⊂ Tnkn ⊂ Hn PnOD (1) , (7.23) and from Lemma 7.19 that (hHn Pn i, dTn /mn ) is precompact and (7.24) dim lim(Γn , dSn /mn ) ≤ dim lim(hHn Pn i, dTn /mn ) ω ω and (7.25) hdim lim(Γn , dSn /mn ) ≤ hdim lim(hHn Pn i, dTn /mn ). ω ω SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 25 By the definition of a Lie coset progression, for each n for which Pn is defined there exists a connected, simply connected nilpotent Lie group Gn —of homogeneous dimension at most D if (n) (n) (n) (n) |Snn | ≪ nD —with Lie algebra gn with basis e1 , . . . , ed and positive integers L1 , . . . , Ld such (n) (n) that (e(n) ; L(n) ) is in OD (1)-upper-triangular form, such that exphe1 , . . . , ed i is a subgroup of (n) (n) (n) (n) Gn , and such that, writing ui = ei and Λn = hu1 , . . . , ud i for each i, there exists a map (n) (n) (n) (n) ϕn : Λn → hy1 , . . . yd i that is a homomorphism modulo Hn such that ϕn (ui ) = yi for each i R (u(n) , L(n) ), we claim that (G , Q ) satisfies and such that Pn = Pord (y (n) ; L(n) ). Writing Qn = Pord n n o(n) ′ the proposition with jn = mn /kn . It follows from (7.22) that Hn ⊂ Tn , writing Γn = hHn Pn i/Hn , and writing ψn : hHn Pn i → Γ′n for the quotient homomorphism, we have (7.26) lim(hHn Pn i, dTn /mn ) ∼ = lim(Γ′n , dψn (Tn ) /mn ). ω ω Since the injectivity radius of Hn Pn tends to infinity with respect to ω, and since ψn (Tn ) ⊂ O (1) ψn (Pn D ), for ω-almost every n there exists a unique subset T̃n ⊂ Pord (u(n) ; L(n) )OD (1) such that ψn ◦ ϕn (T̃n ) = ψn (Tn ). It also follows from (7.23) and the increasing injectivity radius that for ω-almost every n we have T̃nkn ≈D Pord (u(n) ; L(n) ), and so Corollary 7.18 implies that taking jn = mn /kn , which tends to infinity by (7.22), the sequences (Λn , dT̃n /mn ) and (Gn , dQn /jn ) are both precompact and lim(Λn , dT̃n /mn ) ∼ = lim(Gn , dQn /jn ). (7.27) ω ω Since (Γ′n , dψn (Tn ) /mn ) is the image of (Λn , dT̃n /mn ) under ψn ◦ ϕn , we have (7.28) dim lim(Γ′n , dψn (Tn ) /mn ) ≤ dim lim(Λn , dT̃n /mn ) ω ω and (7.29) hdim lim(Γ′n , dψn (Tn ) /mn ) ≤ hdim lim(Λn , dT̃n /mn ). ω ω It therefore follows from combining (7.24), (7.25), (7.26), (7.27), (7.28) and (7.29) that (Gn , Qn ) satisfies the proposition, as claimed.  We close this section by noting that the proof of Theorem 7.4 actually gives a more precise result that we record here for potential future use. Proposition 7.20. Let M, D > 0. There exists N = NM,D ∈ N such that whenever n ≥ N and (Γ, S) is a Cayley graph such that |S n | ≤ M nD |S|, the following holds. For every δ > 0 there exist j = OD,δ (1), an increasing sequence nδ = k1 < k2 < . . . < kj < kj+1 = n such that for every i = 1 . . . j, there exists a Lie coset progression Hi Pi ⊂ Γ of rank at most OD,δ (1) in OD,δ (1)-uppertriangular form, and a finite subset Xi ⊂ S OD,δ (1) such that |Xi | ≪D,δ 1 and such that • for all r ≥ 1, Xi Hi Pir ⊂ Siki r ⊂ XHP OD,δ (r) ; • Hi Pi has injectivity radius ΩD,δ (ki+1 /ki ). 26 ROMAIN TESSERA AND MATTHEW C. H. TOINTON 8. Reduction to ultralimits of normed Lie algebras In this section we give an overview of the proof of Theorem 6.2. The basic strategy is to bound the homogeneous dimension (resp. the dimension) of the ultralimit by considering its Lie algebra as the ultralimit of the normed Lie algebras (gn , k · kn ), where k · kn is a suitable sequence of norms. There are three main steps. The first step is to define the ultralimit of the (gn , k · kn ), as follows. Before being a Lie algebra, or even a real vector space, (gn , k · kn ) is an abelian group equipped with an invariant distance dn (associated to its norm). Hence we can define (g∞ , d∞ ) as the ultralimit limω (gn , dn ) as in Definition 3.8. It is easy to see that g∞ naturally comes with a real vector space structure, and that d∞ is associated to a norm k · k∞ . Note moreover that if the dimension of gn is in Oω (1), then the dimension of g∞ is finite and actually equals limω dim(gn ). Indeed, up to passing to a subsequence, we can assume that the dimension is fixed, but then all the (gn , k · kn ) are uniformly bi-Lipschitz equivalent to one another, and hence to g∞ , which therefore has the same dimension. In order for the Lie bracket to converge as well along the ultrafilter, we need k · kn to be in some way compatible with the Lie bracket. This compatibility condition turns out to translate geometrically into a “triangular form” property for the unit ball, as follows. Lemma 8.1. Let (gn , k·kn ) be a sequence of normed Lie algebras of bounded dimension, and suppose that for ω-almost every n, the unit ball Bn = Bk·kn (0, 1) satisfies [Bn , Bn ] ⊂ Oω (1)Bn . Then the bracket operation on g∞ [lim un , lim vn ] = lim[un , vn ] ω ω ω is well defined and makes g∞ into a Lie algebra. Moreover, if the Lie algebras gn are nilpotent, then so is g∞ . The next step is to show that the Lie algebras gn appearing in Theorem 6.2 satisfy the conditions of Lemma 8.1, as follows. Lemma 8.2. Under the assumptions of Theorem 6.2 there exists a sequence of symmetric convex bodies Bn ⊂ gn such that, denoting k · kn the norm whose unit ball is Bn , (i) [Bn , Bn ] ⊂ Bn ; O(j ) (ii) for every sequence gn ∈ Gn we have gn ∈ Qn n if and only if k log gn kn = O(1); o(j ) (iii) for every sequence gn ∈ Gn we have gn ∈ Qn n if and only if k log gn kn = o(1). The final step is to bound the homogeneous dimension of the ultralimit Lie algebra, as follows. Theorem 8.3. Let (gn , k · kBn ) be a sequence of normed nilpotent Lie algebras of dimension d such that the unit balls Bn satisfy [Bn , Bn ] ⊂ O(1)Bn . Then hdim (g∞ ) ≤ lim hdim (gn ). ω The proof of Theorem 8.3 is somewhat involved, and so we defer it until the next section. The proofs of Lemmas 8.1 and 8.2 are more straightforward, and we present them shortly. First, however, let us put all of these results together to prove Theorem 6.2. Proof of Theorem 6.2. Lemma 8.2 (i) implies that (g∞ , k · kn ) satisfies the assumptions of Lemma 8.1, making g∞ a Lie algebra. Then Lemma 8.2 (ii) and (iii) together with the Baker–Campbell– Hausdorff formula imply that exp and log commute with the ultralimits, and so g∞ canonically identifies with the Lie algebra of limω (Gn , dQn /jn ) (which exists and is a connected nilpotent Lie SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 27 group equipped with a geodesic metric by Proposition 6.3). The desired bound on the homogeneous dimension therefore follows from Theorem 8.3 and the fact that hdim (Gn ) = hdim (gn ). Note that the dimension is GH-continuous among normed vector spaces, and therefore that dim limω (Gn , dQn /jn ) = d, as required. Indeed vector spaces of dimension d are Od (1)-bilipschitz equivalent to the euclidean space of dimension d. Therefore given a sequence of vector spaces of dimension d, its ultralimit is bilipschitz equivalent to the ultralimit of the constant sequence equal to the euclidean space of dimension d.  Proof of Lemma 8.1. The assumption that [Bn , Bn ] ⊂ O(1)Bn implies that the set of sequences un such that kun kBn =ω o(1) is an ideal in the Lie algebra {un : kun kBn =ω O(1)}, and this in turn implies that the Lie bracket is well defined, as claimed. Assume that the Lie algebras gn are nilpotent. Since their dimension is bounded, this implies that they are s-nilpotent for some s ∈ N. This clearly implies that g∞ is s-nilpotent as well.  Proof of Lemma 8.2. Let N = Nd,d be the free d-step nilpotent Lie group of rank d, let n be its Lie algebra, let f = (f1 , . . . , fd ) be a basis of a complement of [n, n], and let xi = exp(fi ). We consider R (u, L) = π (P R (x, L). the projection πn : N → Gn mapping x to u. As we already noted, Qn = Pord n ord Now the lemma follows from Lemma 5.2. Indeed, let Ωn = B(f, (jn L)χ ), and let Bn = πn (Ωn ). The first statements is an obvious consequence of Lemma 5.2, and moreover we deduce that exp(Bn ) ≈ o(j ) Qjnn . The proofs of (ii) and (iii) being similar, we focus on (iii). Let gn ∈ Gn be such that gn ∈ Qn n . R (x, L)o(jn ) be such that π(g̃ ) = g . By Lemma 5.2, log g̃ ∈ B(f, (o(j L))χ ). we have Let g˜n ∈ Pord n n n n that log g̃n ∈ Ωo(jn ) ⊂ o(1)Ωn . Hence projecting back to gn , we see that log gn ∈ o(1)Bn , or in other words that k log gn kBn = o(1). Conversely, assume that wn ∈ o(1)Bn , that we lift via πn to an element w˜n ∈ o(1)Ωn . Multilinearity of the basic commutators implies that for all 0 ≤ ε ≤ 1, we have εB(f, (jn L)χ ) ⊂ B(f, (ε1/d jn L)χ ). Hence w˜n ∈ B(f, (o(jn )L)χ ), which by Lemma 5.2, R (x, L)o(jn ) , from which we deduce that g := exp(w ) ∈ Qo(jn ) , as implies that g̃n := exp(w̃n ) ∈ Pord n n n required.  9. Marked Lie algebras In this section we prove Theorem 8.3. We fix s, d ∈ N, let n = ns,d be the free s-nilpotent Lie algebra of rank d, and let x = (x1 , . . . , xd ) be a basis of a complement of [n, n]. The basic objects in consideration in this section are pairs (g, π), where g is an s-nilpotent Lie algebra of rank at most d, and π : n → g is a surjective morphism. Such a pair is equivalent to a pair (g, e), where e is a family of d vectors of g that generate g as a Lie algebra. We call such a pair a marked Lie algebra. An isomorphism of marked Lie algebras (g, π) → (g′ , π ′ ) is an isomorphism between g and g′ that commutes with π and π ′ . Alternatively, an isomorphism of marked Lie algebras (g, e) → (g′ , e′ ) is an isomorphism between g and g′ that maps e to e′ . Isomorphism classes of marked Lie algebras are in one-to-one correspondence with ideals of n. P WePdefine a relation in (g, e) toPbe a linear combination i λi ei of the basic commutators ei such that i |λi | = 1, and satisfying i λi ei = 0. Alternatively, it is an element of u ∈ ker π satisfying kvkΩ = 1 for the norm whose unit ball Ω is the convex hull of the ±ei . We now define a distance on the set of isomorphism classes of marked Lie algebras. Definition 9.1. Given ε > 0 we say that d((g, e), (g′ , e′ )) ≤ ε if for every relation u ∈ ker π of norm 1 there exists a relation u′ ∈ ker π ′ of norm 1 such that ku − u′ kΩ ≤ ε, and for every relation v ′ ∈ ker π ′ of norm 1 there exists a relation v ∈ ker π of norm 1 such that kv − v ′ kΩ ≤ ε. 28 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Remark 9.2. Observe that this distance coincides with the Hausdorff distance between the compact subsets ker π ∩ ∂Ω and ker π ′ ∩ ∂Ω, where ∂Ω is the unit sphere for k · kΩ . In particular, we deduce that the space of isomorphism classes of marked groups is compact. Let (gn , πn ) be a sequence of marked Lie algebras of rank at most d and step at most s. We now have two natural ways to define an ultralimit of this sequence. First, we may consider the limit (ḡ, π̄) along ω with respect to the topology defined in Definition 9.1. Note that in this case ḡ = n/ ker π̄, where ker π̄ denotes the subspace of n spanned by all those u that appear as ω-limits of sequences un with un ∈ ker πn ∩ ∂Ω. On the other hand, we may consider the ultralimit of a sequence of normed Lie algebras as in the previous section. Indeed, since [Ω, Ω] ⊂ Ω we also have [π(Ω), π(Ω)] ⊂ π(Ω), and so Lemma 8.1 implies that g∞ is a well-defined Lie algebra. Moreover, the constant sequence (n, k · kΩ ) satisfies limω (n, k · kΩ ) = (n, k · kΩ ), and it is then easy to verify that πn converges along ω to some surjective morphism π∞ : n → g∞ in the sense that for every bounded sequence wn ∈ (n, k · kΩ ) we have π∞ (wn ) = limω πn (wn ). Conveniently, these two definitions give the same limit, as follows. Proposition 9.3. The ultralimits (ḡ, π̄) and (g∞ , π∞ ) are isomorphic. P (n) (n) (n) (n) Proof. Let λi ei be a sequence of relations in gn . Then since the kei kBn ≤ 1 and |λi | ≤ 1, (n) (n) (∞) the limits limω ei = e∞ = λi exist, and we have i and limω λi X (n) (n) X (∞) (∞) λi ei = λi ei , 0 = lim ω (n) (n) P from which we deduce that limω λi ei is a relation in g∞ . P (∞) Conversely, if i λi ei is a relation in g∞ , then this means that there exists a sequence un such P (n) that kun kBn =ω o(1) such that i λi ei − un = 0. Note that the condition on un means that P (n) (n) (n) un = µi ei , with µi =ω o(1). Therefore we have for ω-a.e. n, X (n) (n) (λi − µi )ei = 0. i Dividing this sum by in gn . P i |λi (n) − µi | (which tends to 1) shows that P (∞) i λi ei is a limit of relations  Proposition 9.3 reduces the proof of Theorem 8.3 to the following elementary (and probably well-known) fact. Proposition 9.4. The homogeneous dimension of marked Lie algebras is lower semicontinuous with respect to the topology implied by Definition 9.1. We start with two preliminary lemmas. We let g be a nilpotent Lie algebra, and write g = C1 (g) ⊂ C2 (g) ⊂ . . . for the lower central series. For each u ∈ g we write ξ(u) for the maximal k such that u ∈ Ck (g). The following lemma trivially follows from the fact that the Ci (g) are closed. Lemma 9.5. Given a finite-dimensional Lie algebra g, the map u → ξ(π(u)) is upper semicontinuous. Write Z(g) for the centre of g, and for all k write ak (g) = dim Ck (g)/Ck+1 (g). SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 29 Lemma 9.6. Let u ∈ Z(g). Then for k 6= ξ(u) we have ak (g/hui) = ak (g), and and for k = ξ(u) we have ak (g/hui) = ak (g) − 1. In particular, hdim (g/hui) = hdim (g) − ξ(u). Proof. These statements are obvious for k ≤ ξ(u), and so we may assume that k > ξ(u), and need to prove that ak (g/hui) = ak (g). Write p : g → g/hui. For all j we have p(Cj (g)) = Cj (p(g)), and so ak (p(g)) ≤ ak (g). If this inequality were strict then there would exist v ∈ Ck (g) \ Ck+1 (g) such that v + tu ∈ Ck+1 (g) for some t 6= 0. However, this would imply that tu ∈ Ck (g), and hence u ∈ Ck (g), contradicting the assumption that k > ξ(u).  Proof of Proposition 9.4. First, we claim that given a marked Lie algebra (g, π), we can always find a finite set of generators of ker π (as a vector space) u1 , . . . , ul such that for all 1 ≤ i ≤ l the element ui is central modulo the ideal generated by u1 , . . . ui−1 and such that kui kΩ = 1 (ui is a relator). To see that, start with an element in ker π, and if it is not central in n, take a non-trivial commutator with a unit vector of n, normalise it and repeat this procedure until we get a non-trivial central unit vector in ker π. This will give us the first vector u1 . Then do the same replacing n by n/hu1 i, and so on until (u1 , . . . , ul ) generates the kernel. This proves the claim. (n) (n) For all n, we let (u1 , . . . , uln ) be a generating set of ker πn satisfying the claim. Note that since (n) ln is bounded by the dimension of n, we can assume that it is constant = l. Let ūi = limω ui . Clearly, (ū1 , . . . , ūl ) also satisfies the above property. We claim that for all 1 ≤ i ≤ l, (n) (n) hdim (n/hū1 , . . . , ūi i) ≤ lim hdim (n/hu1 , . . . , ui i). ω The proposition follows by applying this to i = l. This statement follows by induction on i. The case i = 0 (corresponding to taking n all along) is obvious. And if we have proved it for i, then one easily sees that (n) n/hū1 , . . . , ūi+1 i = lim n/hū1 , . . . , ūi , ui+1 i. ω (n) Hence the statement follows by Lemmas 9.5 and 9.6, using that ui+1 is central in n/hū1 , . . . , ūi i.  Proof of Theorem 8.3. This follows from Propositions 9.3 and 9.4.  10. Volume growth and Hausdorff dimension of the limit In this section we examine to what extent the Hausdorff dimension of a cluster point arising from Theorem 1.2 can be related to the exponent D. We have seen in the introduction that nothing can be said in general, unless the dimension of the limit equals D, in which case we shall show that it coincides with the Hausdorff dimension (or equivalently that the limiting metric is Finsler by [4, Theorem 13]). We start recalling a few well-known facts about Carnot–Carathéodory metrics on simply connected nilpotent Lie groups (see for instance [5]). We often abbreviate the term ‘Carnot–Carathéodory metric’ to simply ‘cc-metric’. Let n be the Lie algebra of a simply connected nilpotent Lie group N , and let m be a vector subspace complementary to [n, n] equipped with a norm k · k. A smooth path γ : [0, 1] → N is said to be horizontal if γ(t)−1 · γ ′ (t) belongs to m for all t ∈ [0, 1]. The length of γ with respect to k · k is then defined by Z 1 (10.1) l(γ) = kγ(t)−1 · γ ′ (t)kdt. 0 30 ROMAIN TESSERA AND MATTHEW C. H. TOINTON The Carnot–Carathéodory distance associated to k · k on N is then defined by (10.2) d(x, y) = inf {l(γ) : γ(0) = x, γ(1) = y}, γ where the infimum is taken over all piecewise-horizontal paths (i.e. concatenations of finitely many horizontal paths). Note that if N = Rm , so that m = n, then the Carnot–Carathéodory metric is just the distance associated to the norm k · k (one easily checks that up to isometry, this distance indeed only depends on the norm k · k). Recall that the real Heisenberg group H(R) is defined as the matrix group     1 u w  H(R) =  0 1 v  ; u, v, w ∈ R ,   0 0 1 and that the discrete Heisenberg H(Z) sits inside H(R) as the cocompact discrete subgroup consisting of unipotent matrices with integral coefficients. The group H(R) (resp. H(Z)) is 2-step nilpotent; indeed, its centre, which coincides with its derived subgroup, is isomorphic to R (resp. Z), and consists in matrices whose only non-zero coefficient is the top right coefficient. It follows that H(R)/[H(R), H(R)] ∼ = R2 (and similarly H(Z)/[H(Z), H(Z)] ∼ = Z2 ). The group H(R) comes with a one-parameter group of automorphisms (δt )t∈R defined as follows:     1 tu t2 w 1 u w δt  0 1 v  =  0 1 tv  . 0 0 1 0 0 1 Given a norm k · k on R2 , there exists a unique left-invariant Carnot–Carathéodory metric dcc on H(R) that projects to k · k and is scaled by δt , i.e. such that dcc (e, δt (g)) = tdcc (e, g) for all t ∈ R∗+ and all g ∈ H(R). Normalise the Haar measure on H(R) so that the ball of radius 1 has volume 1. It follows from the formula defining δt that for all r > 0, the ball of radius r for this metric has measure equal to r 4 . In particular, the Hausdorff dimension of H(R) equals 4 (see [21, Lemma C.3]). For every j, k, l ∈ N write     1 [−j,j]∩Z [−k,k]∩Z 1 [−j,j] [−k,k] P (j, k) = 0 and PR (j, k) = 0 1 [−l,l] , 1 [−l,l]∩Z 0 0 1 0 0 1 and write S(j, k) = P (j, k) ∪ P (j, k)−1 ⊂ H(Z) and SR (j, k) = PR (j, k) ∪ PR−1 (j, k) ⊂ H(R). A straightforward calculation shows that P −1 (j, k) ⊂ P (j, j 2 + k), and so if k ≥ j 2 we have (10.3) P (j, k) ⊂ S(j, k) ⊂ P (j, 2k), and similarly PR (j, k) ⊂ SR (j, k) ⊂ PR (j, 2k). The following lemma is an easy consequence of a celebrated result of Pansu [19] (strictly speaking, we use [5, Theorem 1.4 ] which is a slight generalisation due to Breuillard). Lemma 10.1. Let jn and qn be sequences of positive integers such that qn → ∞, and let Sn = S(jn , jn2 ). Then (H(Z), dSn /qn ) GH-converges to H(R) endowed with the cc-metric associated to the ℓ∞ -norm on R2 . SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 31 Proof. We consider a relatively compact subset D ⊂ H(R) such that H(R) is the disjoint union of left H(Z)-translates of D. For every left-invariant distance d on H(Z), define a H(Z)-invariant pseudo distance dR on H(R), defined as dR (g, h) = d(γ, λ) where g ∈ ΓD and h ∈ λD. Note that the embedding (H(Z), d) → (H(R), dR ) is an isometry (in particular it is essentially surjective, in the sense that every point of H(R) lies at distance zero from a point of H(Z)). For every j ∈ N, we denote   1 ±j 0 Pj = 0 1 ±j , 0 0 1 Pj−1 . and Sj = Pj ∪ Note that we have R dR 2 ) ≤ dS(j ,j 2 ) ≤ dSR (jn ,j 2 ) . S(jn ,jn n n n Applying the automorphism δjn−1 to H(R), we obtain R dR 2 ) (δj −1 (·), δj −1 (·)) ≤ dSR (1,1) . S(1,1) ≤ dS(jn ,jn n n But then it follows from [5, Theorem 1.4] that (H(R), dR 2 ) (δj −1 (·), δj −1 (·))/qn ) GH-converges S(jn ,jn n n ∞ to H(R) endowed with the cc-metric associated to the ℓ -norm on R2 . Now δjn defines an isometric R isomorphism from (H(R), dR 2 ) (δj −1 (·), δj −1 (·))/qn ) to (H(R), dS(j ,j 2 ) /qn ). And we have seen S(jn ,jn n n n n at the beginning of this proof that the injection (H(Z), dS(jn ,jn2 ) /qn ) → (H(R), dR 2 ) /qn ) is an S(jn ,jn isometry as well. So we deduce that (H(Z), dS(jn ,jn2 ) /qn ) converges to H(R) endowed with the cc-metric associated to the ℓ∞ -norm on R2 , and the lemma follows.  Proof of Proposition 1.7. Pick a sequence an such that nan ≈ f (n). Let Sn = S(n, n3−an ). Using (10.3), one easily checks that |Snn | ≍ n8 and |Sn | ≍ n5−an , and so |Snn |/|Sn | ≪ n3 nan ≍ f (n)n3 . We now prove that the limit is isometric to the cc-metric associated to the ℓ∞ -norm. This follows from Lemma 10.1 together with the fact that there exists tn going to zero such that for all tn n ≤ k ≤ n S(n, n3−an )k = S(n, n2 )k . Indeed, a direct calculation (left to the reader), shows that for all positive integers i, j, m such that (mi)2 ≥ 10mj, S(i, j)m = S(i, i2 )m . Therefore, in order to find tn , one has to solve in t the equation t4 n8 = 10t3 n8−an , giving t =  10n−an . We now move on to the proof of Proposition 1.8, starting with an immediate consequence of Proposition 7.13. Lemma 10.2. Let Λ be a torsion-free nilpotent group with Mal’cev completion G of dimension d. Let Σ be a symmetric finite generating set of Λ, let n ≥ 0 and C be such that |Σn | ≤ Cnd |Σ|. Then for every i, j with 0 < i < j ≤ n we have c(j/i)d |Σi | ≤ |Σj | ≤ (C/c2 )(j/i)d |Σi |, where c is the constant coming from Proposition 7.13. 32 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Proof of Proposition 1.8. We first reduce to the case where Γn has no torsion and its Mal’cev completion has dimension D. Indeed, combining Theorem 7.4 and Lemma 7.19, we are reduced to the case where Γn is a torsion-free nilpotent group. In that case, the connected Lie group Gn of Proposition 6.1 is simply its Mal’cev completion (this is Corollary 7.18). Finally we deduce from Theorem 6.2 that the dimension of Gn equals the dimension of the ultralimit, i.e. D. It then follows from Lemma 10.2 that in the ultralimit G∞ (with mn = n) we have (c2 /C)r D |B(e, 1)| ≤ |B(e, r)| ≤ (1/c)r D |B(e, 1)| for every r ≤ 1. This is well known to imply that the Hausdorff dimension equals D (see [21, Lemma C.3]). Finally we deduce from [4, Theorem 13] that the metric is Finsler.  Appendix A. Detailed growth of nilprogressions The purpose of this appendix is to prove Theorem 1.9. We essentially reproduce Tao’s original proof of the theorem in [23, §4], but substitute in various results from the present paper and its predecessor [24] to make the argument finitary. Proposition 7.5 essentially reduces Theorem 1.9 to the study of the growth of Lie progressions. The key result on that topic is the following. Proposition A.1. Let P be a Lie progression of rank d in C-upper-triangular form for some C. Then there exists a non-decreasing continuous piecewise-linear function f : [0, ∞) → [0, ∞) with f (0) = 0 and at most Od (1) distinct linear pieces, each with a slope that is a natural number at most Od (1), such that log |P m | = log |P | + f (log m) + Od (1) for every m ∈ N. Remark A.2. In fact, we do not need the Lie progression P appearing in Proposition A.1 to be in upper-triangular form; it would be enough for the lattice Λ generated in the Lie algebra by the basis defining P to satisfy [Λ, Λ] ⊂ Λ as in Proposition 7.8. We prove Proposition A.1 are using material from Section 7 and the following results, which are almost identical in spirit to part of Tao’s argument in [23, §4]. Proposition A.3. Let G be a connected, simply connected nilpotent Lie group with Lie algebra g with basis e1 , . . . , ed , and write Λ = he1 , . . . , ed i. Suppose that exp Λ is a subgroup of G. Write ui = exp ei for each i, let L1 , . . . , Ld be positive integers, and write P = Pord (u; L). Then there exists a polynomial f of degree Od (1) with positive coefficients such that |P m | ≍d f (m). Lemma A.4. Let f be a polynomial of degree k with no negative coefficients. Then there exists a continuous, piecewise-monomial function h of increasing degree with at most k + 1 pieces, each of which has a positive coefficient, such that f (x) ≍k h(x) for x > 0. Proof. Following Tao [23, §4], write f (x) = α0 + α1 x + . . . + αk xk , and note that for every a, b > 0 we have a + b ≍ max{a, b}, so that f (x) ≍k max αi xi . i We may therefore take h(x) = maxi αi xi .  SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 33 Before we prove Proposition A.3, let us see how it combines with Lemma A.4 to imply Proposition A.1. Proof of Proposition A.1. We proceed by induction on d, taking the trivial case d = 0 as the base. If P is infinitely proper then the result follows from Proposition A.3 and Lemma A.4. If not then P has finite injectivity radius, say k ∈ N, and Proposition A.3 and Lemma A.4 imply that there exists a non-decreasing continuous piecewise-linear function f : [0, ∞) → [0, ∞) with f (0) = 0 and at most Od (1) distinct linear pieces, each with a slope that is a natural number at most Od (1), such that (A.1) log |P m | = log |P | + f (log m) + Od (1) for every m ≤ k. Let c > 0 be a constant to be determined by depending only on d. Proposition 7.8 implies that there exists a Lie progression P0 of rank d in 1-upper-triangular form and with injectivity radius Od (1) such that (A.2) P ck ⊂ P0 ⊂ P Od (ck) . Remark 7.3 implies that there exists q ≪d 1 such that P0 is not q-proper. Proposition 7.7 therefore implies that there exists a Lie coset progression HP1 of rank strictly less than d in Od (1)-upperO (1) triangular form such that P0 ⊂ HP1 ⊂ P0 d , and then (A.2) implies that P ck ⊂ HP1 ⊂ P Od (ck) . We may thus choose c so that (A.3) Od (r) HP1r ⊂ P rk ⊂ HP1 for every r ∈ N. Following Tao [23, §4], write P̂ for the image of P1 in the quotient hHP1 i/H and note that (A.4) |HP1r | = |H||P̂ r | for every r ∈ N. By induction we may assume that there exists a non-decreasing continuous piecewise-linear function h : [0, ∞) → [0, ∞) with h(0) = 0 and at most Od (1) distinct linear pieces, each with a slope that is a natural number at most Od (1), such that log |P̂ r | = log |P̂ | + h(log r) + Od (1) for every r ∈ N. This implies in particular that |P̂ ℓr | ≪ℓ,r |P̂ r | for every ℓ, r ∈ N, and hence, combined with (A.3) and (A.4), that |P rk | ≍d |H||P̂ r | for every r ∈ N. It follows that log |P rk | = log |P k | + h(log r) + Od (1) for every r ∈ N. The monotonicity of log |P m | in m therefore implies that m m k log |P k | + h(log⌊ m k ⌋) − Od (1) ≤ log |P | ≤ log |P | + h(log⌈ k ⌉) + Od (1) for every m ≥ k, and so the fact that the slope of h is bounded in terms of d implies that log |P m | = log |P k | + h(log m k ) + Od (1) for every m ≥ k. In light of (A.1), this implies that log |P m | = log |P | + f (log k) + h(log m − log k) + Od (1) for every m ≥ k. Since h(0) = 0, this combines with (A.1) to give the desired result for all m.  We start our proof of Proposition A.3 with a general lemma from linear algebra, which was essentially present in [23, §4]. 34 ROMAIN TESSERA AND MATTHEW C. H. TOINTON Lemma A.5. Let r ≥ d, x1 , . . . xr to span Rd , and M1 , . . . , Mr > 0. There exist i1 < . . . < id such that BR (x; M ) ⊂ r · BR (xi1 , . . . , xid ; Mi1 , . . . , Mid ). Proof. Pick the i1 < . . . < id that maximise vol(BR (xi1 , . . . , xid ; Mi1 , . . . , Mid )) (where the volume is defined with respect to the canonical basis of Rd ). On reordering the xi ’s, we can assume that ij = j for all 1 ≤ j ≤ d. It suffices to show that for a given xk we have (A.5) Mk xk ∈ BR (x1 , . . . , xd ; M1 , . . . , Md ). View each xi as a column vector with coordinates with respect to the basis x1 , . . . , xd , and write A for the d × d matrix with columns M1 x1 . . . , Md xd . Cramer’s rule implies that the solution y ∈ Rd to the equation Ay = Mk xk satisfies |yj | = vol(BR (x1 , . . . , xj−1 , xk , xj+1 , . . . , xd ; M1 , . . . , Mj−1 , Mk , Mj+1 , . . . , Md )) vol(BR (x1 , . . . , xd ; M1 , . . . , Md )) (i.e. with xj replaced by xk in the numerator). By maximality, this implies in particular that |yj | < 1, which gives (A.5), as required.  From now on in this section we adopt the notation of Proposition A.3. We also extend e = (e1 , . . . , ed ) to the list e = (e1 , . . . , er ) of basic commutators, as defined in Section 5. Given a measurable subset B of g we write vol(B) for the measure of B, normalised so that the lattice Λ has determinant 1. Proposition A.6. For every m ∈ N we have |P m | ≍d vol(BR (e; (mL)χ )). Proof. A result of van der Corput [28] states that for any convex body K ⊂ Rd we have |Zd ∩ K| ≥ 1 vol(K), which in this case implies that 2d vol(BR (e; (mL)χ )) ≤ 2d |Λ ∩ BR (e; (mL)χ )| for every m ∈ N. Since  R exp Λ ∩ BR (e; (mL)χ ) ⊂ exp Λ ∩ Pord (u; L)m ⊂ P Od (m) (by Lemma 5.2 (i)) (by Proposition 5.3), this implies that for some constant Bd > 0 we have (A.6) for every m ∈ N. Since vol(BR (e; (mL)χ )) ≪d |P Bd m | P vol(BR (e; (αmL)χ )) ≪ α i |χ(i)| vol(BR (e; (mL)χ )) for every α ≥ 1 and every m, on replacing m by Bd−1 m in (A.6) we obtain vol(BR (e; (mL)χ )) ≪d |P m |, which is one direction of what we need to prove. SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 35 For the other direction, write Q = [0, 1]d and note that R (u; L)m P m ⊂ exp Λ ∩ Pord (since exp Λ is a group) χ  ⊂ exp Λ ∩ BR (e; (Od (mL)) ) and hence (by Lemma 5.2 (i)), |P m | ≤ |Λ ∩ BR (e; (Od (mL))χ )| = vol   Λ ∩ BR (e; (Od (mL))χ ) + Q ≤ vol BR (e; (Od (mL))χ ) χ ≪d vol BR (e; (mL) ), (since Q ⊂ BZ (e; L)) as required.  Lemma A.7. There exists a polynomial f of degree Od (1) with no negative coefficients such that vol(BR (e; (mL)χ )) ≍d f (m). Proof. We continue to follow Tao [23, §4]. Set X f (m) = vol(BR (ei1 , . . . , eid ; (mL)χ )), 1≤i1 <...<id ≤r and note that f (m) = X vol(BR (ei1 , . . . , eid ; Lχ ))m Pd j=1 |χ(ij )| , 1≤i1 <...<id ≤r which is certainly of the required form. It follows from Lemma A.5 that vol(BR (e; (mL)χ )) ≤ r d f (m), whilst the fact that BR (ei1 , . . . , eid ; (mL)χ ) ⊂ BR (e; (mL)χ ) for every i1 , . . . , id implies that  f (m) ≤ dr vol(BR (e; (mL)χ )).  Proof of Theorem 1.9. It follows from Proposition 7.5 that there exist |X| ≪D 1, and a Lie coset progression HP of rank at most OD (1) in OD (1)-upper-triangular form such that (A.7) HP m ⊂ S mn ⊂ XHP OD (m) , for every m ∈ N. Write P̂ for the image of P in the quotient hHP i/H, and note that |HP m | = |H||P̂ m | for every m ∈ N. Since Proposition A.1 implies that |P̂ rm | ≪r,D |P̂ m | for every r, m ∈ N, this combines with (A.7) to imply that |S mn | ≍D |H||P̂ m | for every m ∈ N, and so the theorem follows from Proposition A.1.  Remark A.8. The ineffectiveness in Theorem 1.9 arises from the single use of Proposition 7.5 at the beginning of the proof; the ineffectiveness of Proposition 7.5 in turn arises from a single use of [8, Theorem 1.6] (see also the remark immediately after the proof of [24, Proposition 8.3]). 36 ROMAIN TESSERA AND MATTHEW C. H. TOINTON References [1] H. Bass, The degree of polynomial growth of finitely generated nilpotent groups, Proc. London Math. Soc. (3) 25 (1972), 603–614. [2] I. Benjamini, H. Finucane and R. Tessera. On the scaling limit of finite vertex transitive graphs with large diameter. Combinatorica 36 (2016), 1–41. [3] V. N. Berestovskiı́. Homogeneous manifolds with an intrinsic metric. I, Sibirsk. Mat. Zh. 29(6) (1988), 17–29. [4] V. N. Berestovskiı́. Locally Compact Homogeneous Spaces with Inner Metric, J. Gen. Lie Theory Appl. 9(1) (2015), 6 pp. [5] E. Breuillard. Geometry of locally compact groups of polynomial growth and shape of large balls. arXiv:0704.0095. [6] E. Breuillard and B. J. Green. Approximate groups. I. The torsion-free nilpotent case, J. Inst. Math. Jussieu 10(1) (2011), 37–57. [7] E. Breuillard and B. J. Green. Approximate groups, II: the solvable linear case, Q. J. Math. 62(3) (2011), 513–521. [8] E. Breuillard, B. J. Green and T. C. Tao. The structure of approximate groups, Publ. Math. IHES. 116(1) (2012), 115–221. [9] E. Breuillard and M. C. H. Tointon. Nilprogressions and groups with moderate growth, Adv. Math. 289 (2016), 1008–1055. [10] M. Bridson and A. Hefliger, Metric Spaces of Non-Positive Curvature, Grundl. der Math. Wiss. 319, Springer Verlag (1999). [11] W. W. Comfort and S. Negrepontis. The theory of ultrafilters, Berlin, New York: Springer-Verlag (1974). [12] N. Gill and H. A. Helfgott. Growth in solvable subgroups of GLr (Z/pZ), Math. Ann. 360(1) (2014) 157–208. [13] K. Fukaya and T. Yamaguchi. The fundamental groups of almost nonnegatively curved manifolds, Math. Ann. 136 (1992), 253–333. [14] M. Gromov. Groups of polynomial growth and expanding maps, Publ. Math. IHES 53 (1981), 53–73. [15] M. Gromov. Metric structures for Riemannian and non-Riemannian spaces, volume 152 of Progress in Mathematics. Birkhäuser Boston Inc., Boston, MA (1999). Based on the 1981 French original, With appendices by M. Katz, P. Pansu and S. Semmes. [16] Y. Guivarc’h. Croissance polynomiale et périodes des fonctions harmoniques, Bull. Sc. Math. France 101 (1973), 333–379. [17] M. Hall. The theory of groups, Amer. Math. Soc./Chelsea, Providence, RI (1999). [18] M. Hall. A basis for free Lie rings and higher commutators in free groups, Proc. Amer. Math. Soc. 1 (1950), 575–581. [19] P. Pansu. Croissance des boules et des géodésiques fermées dans les nilvariétés. Ergodic Theory Dyn. Syst. 3 (1983), 415–445. [20] J. Roe, Lectures on Coarse Geometry, Univ. Lecture Ser., vol. 31, American Mathematical Society, Providence, RI, 2003 [21] S. Semmes, Finding curves on general spaces through quantitative topology, with applications to Sobolev and Poincaré inequalities, Selecta Math. 2 (1996), 155–295. [22] Y. Shalom and T. Tao, A finitary version of Gromov’s polynomial growth theorem. Geom. Funct. Anal. 20 (2010), no. 6, 1502–1547. [23] T. C. Tao. Inverse theorems for sets and measures of polynomial growth, Q. J. Math. 68(1) (2017), 13–57. [24] R. Tessera and M. C. H. Tointon. Properness of nilprogressions and the persistence of polynomial growth of given degree, arXiv:1612.05152. [25] M. C. H. Tointon. Freiman’s theorem in an arbitrary nilpotent group, Proc. London Math. Soc. (3) 109 (2014), 318–352. [26] M. C. H. Tointon. Approximate subgroups of residually nilpotent groups, arXiv:1509.03876. [27] L. van den Dries and A .J. Wilkie. Gromov’s theorem on groups of polynomial growth and elementary logic, J. Alg. 89 (1984), 349–374. [28] J. G. van der Corput. Verallgemeinerung einer Mordellschen Beweismethode in der Geometrie der Zahlen II, Acta Arith. 2 (1936), 145–146. Laboratoire de Mathématiques d’Orsay, Univ. Paris-Sud, CNRS, Université Paris-Saclay, 91405 Orsay, France E-mail address: [email protected] SCALING LIMITS OF CAYLEY GRAPHS WITH POLYNOMIALLY GROWING BALLS 37 Insitut de Mathématiques, Université de Neuchâtel, Rue Emile-Argand 11, CH-2000 Neuchâtel, Switzerland E-mail address: [email protected]
4math.GR
Pseudo-Centroid Clustering Fred Glover Department of Electrical, Computer and Energy Engineering School of Engineering & Science University of Colorado Boulder, Colorado 80309, USA [email protected] October 2016 Abstract Pseudo-centroid clustering replaces the traditional concept of a centroid expressed as a center of gravity with the notion of a pseudo-centroid (or a coordinate free centroid) which has the advantage of applying to clustering problems where points do not have numerical coordinates (or categorical coordinates that are translated into numerical form). Such problems, for which classical centroids do not exist, are particularly important in social sciences, marketing, psychology and economics, where distances are not computed from vector coordinates but rather are expressed in terms of characteristics such as affinity relationships, psychological preferences, advertising responses, polling data and market interactions, where distances, broadly conceived, measure the similarity (or dissimilarity) of characteristics, functions or structures. We formulate a K-PC algorithm analogous to a K-Means algorithm and focus on two key types of pseudo-centroids, MinMax-centroids and (weighted) MinSum-centroids, and describe how they, respectively, give rise to a K-MinMax algorithm and a K-MinSum algorithm which are analogous to a K-Means algorithm. The K-PC algorithms are able to take advantage of problem structure to identify special diversity-based and intensity-based starting methods to generate initial pseudo-centroids and associated clusters, accompanied by theorems for the intensity-based methods that establish their ability to obtain best clusters of a selected size from the points available at each stage of construction. We also introduce a regret-threshold PC algorithm that modifies the K-PC algorithm together with an associated diversification method and a new criterion for evaluating the quality of a collection of clusters. Keywords: Clustering – centroids – K-Means – K-Medoids – Advanced starting methods – Metaheuristics. Published online in Soft Computing, ( ), pp. 1-22, Springer, 13 October 2016 at http://link.springer.com/article/10.1007/s00500-016-2369-6, content sharing version: http://rdcu.be/k1kY. 1 1. Introduction. Consider a set X of n points, given by X = {xr, r  N = {1, …, n}}. We are interested in the clustering problem that consists of identifying a partition of X into subsets C = C(h), h  K= {1,…,k} for specified values of k. In this paper, we are specifically interested in clustering problems where the goal is to organize clusters by a criterion based on the distances of points in each cluster from a common (suitably defined) “central point,” but where the points lack coordinates that make it possible to draw on the notion of a classical centroid as used in methods such as the K-Means algorithm. We emphasize that we interpret “distance” in a broad sense to encompass any value assigned to a pair of points that expresses their proximity or similarity. We may think of distance as a type of repulsion, for example, where larger distances reflect a reduced desirability of placing the two associated points in a common cluster. We also allow consideration of negative distances, which may be viewed as a form of attraction. To handle situations where distances are not restricted to constitute a metric based on spatial coordinates of a vector, we introduce the notion of a pseudo-centroid (PC) to replace that of a classical centroid. This enables us to describe K-PC algorithms by analogy with the K-Means algorithm for applications in which points xr to be clustered include non-numerical coordinates (or lack coordinates altogether). Such problems occur prominently, for example, in the social media, marketing and economics areas, where distances, broadly conceived, may represent affinity relationships, psychological preferences, advertising responses, polling data, market interactions and so forth. We establish the background and general ideas underlying pseudo-centroid clustering, and focus particularly on two forms of this clustering we call K-MinMax and K-MinSum clustering. The MinMax and MinSum-centroids make it possible to generate starting clusters for the K-MinMax and K-MinSum clustering algorithms that embody a meaningful structure in relation to the goal of producing a best collection of final clusters and which apply as well to other definitions of pseudo-centroids discussed in Section 9. We demonstrate this by providing advanced starting procedures for these clustering algorithms of two types, called diversity-based and intensitybased methods, which also offer ways to aid in determining good values of k and provide variants that can be used with K-Means algorithms. We also including special adaptive versions of the intensity-based methods designed to reduce the number of iterations subsequently performed by K-PC algorithms and to increase the likelihood of yielding final clusters that are the best achievable. The intensity-based methods are accompanied by theorems that identify the quality of clusters they produce. 2. Background and related research A variety of papers have undertaken to develop measures to replace Euclidean distances, or in some cases to transform non-numerical coordinates (such as those for categorical variables) into numerical coordinates to permit Euclidean distances to be calculated. For instance, Ralambondrainy (1995) converts multiple category attributes into binary attributes (1 if a 2 category is present, 0 if absent) to treat binary attributes as numeric in the K-Means algorithm (MacQueen, 1967). This approach needs to handle a large number of binary variables if used in data mining, where categorical attributes often involve hundreds or thousands of categories. Huang (1998) goes farther by developing ways to handle categorical variables utilizing a simple dissimilarity measure for categorical objects proposed by (Kaufman and Rousseeuw, 1990) and applies a variant of the K-Means algorithm using modes instead of means for clusters, together with a frequency-based method to update modes to minimize the clustering cost function. The foregoing approaches continue to rely on coordinates, however, rather than directly making use of distance measures to characterize a notion of centrality without the need to refer to coordinates. Even in situations where Euclidean distances exist naturally and provide the possibility for creating centroids, a reliance on such centroids is not always desirable. For example, as illustrated in Cao and Glover (2010), centroids can create difficulties for problems where communications or travel between points must take place within a specified network, since centroids may lie in unreachable areas such as rivers or fields that cannot be traversed, or may compel some points that lie in a centroid-based cluster to cross such areas to reach other cluster points, thus linking points that are not desirable to be grouped within a cluster together. On the other hand, there are many methods that rely on distances without making use of centroids. Such methods avoid the problems that typically arise by centroid-based methods and have a venerable tradition, although at the cost of abandoning an effort to group points with reference to a point that satisfies a meaningful alternative definition of centrality. For example, Fan (2009) describes a distance measure that modifies Euclidean distances to incorporate an “obstructed distance” between two locations if their straight line link is intersected by geographic obstacles such as rivers, mountains or highways. He then undertakes to use these distances by a method that uses a simulated annealing approach to correct distortions introduced by an attempt to use a K-Means algorithm. But no measure is offered to replace a centroid-based measure as relied on by the K-Means procedure. In a related setting, geographic information system (GIS) technology is often utilized due to its ability to supply vital information such as geographic feature data, street network information, speed limits on street segment and lengths of street segments. This technology is also able to keep track of restrictions such as vehicle heights, weights and volumes that need to be considered by optimization procedures. For example, Estivill-Castro and Lee (2001) combine data mining and GIS as a means to consider geographic obstacles such as hills or rivers. The authors devise a clustering algorithm utilizing a Voronoi diagram to set up a topological structure for a set of points as a basis for retrieving spatial information related to various definitions of neighbors. Once again, having established the topological structure, no way of representing centrality is provided. Another use of a Voronoi diagram to yield a more appropriate space is given in Kwon et al. (2007) as a basis for a tabu search method for solving capacitated vehicle routing problems. However, relying on the Voronoi topology by itself without a new concept of central point was not sufficient to allow the approach to beat the existing benchmark results. 3 A different type of application is addressed by Strehl and Ghosh (2002), who develop a clustering algorithm for data mining problems found in the retail industry and some Web applications, where data reside in a very high-dimensional space. This approach introduces a similarity relationship defined on each pair of data samples and transforms the problem into one over the similarity domain so that the original high-dimensional space is no longer needed. The goal is to cluster data samples into k groups so that data samples for different clusters have similar characteristics. Lacking a meaningful centrality measure, the authors formulated the clustering problem as an NP-hard vertex-weighted graph partitioning problem and developed an algorithm called Optimal Partitioning of Space Similarities Using Metis (OPOSSUM) using the Metis approach proposed by Karypis and Kumar (1998) as the multi-objective graph partitioning engine. Another recourse to a more complex model representation to cluster objects in the absence of an ability to take advantage of central points occurs in Kochenberger et al. (2005), who use clique partitioning to cluster microarray data. A type of approach that is related to one of the types of pseudo-centroid methods described in this paper is the K-Medoid algorithm embodied in the Partitioning Around Medoids (PAM) algorithm of Kaufman and Rousseeuw (1990), and in its extended variant Clustering Large Applications CLARA). Ng and Han (2002) further extend this approach with a method called CLARANS (Clustering Large Applications based upon RANdomized Search). Specifically, our definition of a MinMax-centroid corresponds to one of the definitions of a medoid, but the medoid definition incorporated into the foregoing K-Medoid algorithms has a different foundation that stems from a coordinate-centric perspective (seeking to minimize the maximum deviation of cluster points from a classical centroid). Similarly, another treatment of medoids in Park and Jun (2009) employs a definition corresponding to our definition of a MinSum pseudocentroid, but again resorts to a coordinate-centric perspective for its implementation and lacks the generality that makes the pseudo-centroid framework applicable to other definitions as well. Because of these differences, the K-Medoid algorithms cited above operate differently from the K-MinMax and K-MinSum algorithms and fail to gain access to associated starting algorithms and their associated theorems described in subsequent sections. It is important to point out that not all forms of clustering can benefit from exploiting a measure of centrality. A reliance on centrality is purposely missing in the case of the spanning tree methods which provide an ability to generate clusters that may be embedded in others (see, e.g. Xu et al., 2001; Paivinen, 2005; Shamsul, et al., 2011). Similarly, centrality measures are not relevant to a variety of applications approached by the use of hierarchical clustering methods (Anderberg, 1973, Jain and Dubes, 1988) or by the use of methods such as the cohesive clustering approach of Cao et al. (2015). Many other examples of these types exist. At the same, centrality plays a vital role in numerous clustering problems and hence constitutes the focus of this paper. The remainder of this paper is organized as follows. Section 3 introduces the basic concepts underlying pseudo-centroids (PCs) and their embodiment in a K-PC algorithm. Sections 4 and 5, respectively, introduce the two instances of a PC-centroid called the MinMax-centroid and the MinSum-centroid, together with their associated K-MinMax and K-MinSum algorithms. Section 6 addresses the topic of advanced starting methods to generate initial sets of points for the K 4 MinMax and K-MinSum algorithms, and describes the class of diversity-based starting methods that also can help to determine good values of k for the number of clusters to be generated. Section 7 then introduces the class of intensity-based starting methods with a focus on the primary intensity-based methods. These methods have an ability to successively generate clusters that are locally optimal for the chosen number of elements to be included in a cluster, given the set of elements available at the current stage of construction. The more advanced adaptive intensity-based starting methods are introduced in Section 8, which allow the number of elements in a cluster to be generated adaptively at each stage. Finally, a strategic variant of the K-PC algorithm, called the regret-threshold PC algorithm, is introduced in Section 9, together with a diversification method and a new criterion for evaluating a collection of clusters. The paper concludes with observations concerning other types of pseudo-centroids and applications involving metaheuristic optimization in Section 10. 3. Pseudo-Centroids and a K-PC Algorithm Let d(i,j) denote a distance measure defined on the elements xi, xj  X. We follow the convention d(i,i) = 0, but do not require that d(i,j) satisfies the conditions to be a metric or that it be non-negative. For convenience, as in the case of d(i,j), we allow points xi and xj to be referenced by their indexes. Let C denote an arbitrary set of points (indexes) in N. In the following we refer to a separation measure Separate(i: C) that represents the separation of i from other points j  C \ {i}. As developed here, Separate(i: C) is a function of the distances d(i,j) for j  C \ {i} and specific instances of Separate(i: C) are given in the following sections. Definition PC: A Pseudo-Centroid of C is a point i*  C that gives the smallest value of Separate(i: C); i.e.: Separate(i*, C) = Min(Separate(i: C): i  C) The value Separate(i*: C) will be called the span of C, and denoted Span(C). The span value may be thought of as a “radius” about i* (defined by reference to the set separation measure Separate(i: C)), conceiving i* as a “central point,” such that all points j  C \ {i} lie within the separation Span(C) from i*. An important characteristic of pseudo-centroids, as will be evident from the two primary instances we discuss later, is that unlike ordinary centroids they may not be unique. We account for this by including a variation of our algorithms based on pseudo-centroids that refers to the set C* of all points in C that qualify as a pseudo-centroid of C; i.e., C* = {i  C: Separate(i: C) = Span(C)). The point i* in Definition PC thus belongs to C*. We first describe the K-PC algorithm by assuming we arbitrarily single out a particular element of C* to be identified as i*, in the case where more than one such element exists, and then describe the variant that references all of C*. 5 K-PC Algorithm 0. Begin with a collection of k points N(K) = {i(h), h  K}  N, and assign each of the n – k points j  N \ N(K) to the point i = i(h) that is closest to it by the measure d(i,j). (That is, j  N \ N(K) is assigned to a point i(h) = arg min (d(i(h),j): h  K).) Identify an initial collection of clusters C(h), h  K, each consisting of i(h) and the points assigned to it. 1. Identify a pseudo-centroid i*(h) for each cluster C(h) in accordance with Definition PC; i.e., Separate(i*: C) = Span(C) for i* = i(h) and C = C(h). Denote this set of pseudocentroids by N*(K) = {i*(h): h  K}. 2. Reassign each of the n – k points j  N \ N*(K), to the pseudo-centroid i = i*(h) that is closest to it by the measure d(i,j), thus assigning each j to an associated new cluster C(h) that contains i*(h). 3. Repeat Steps 1 and 2 (creating a new set of pseudo-centroids at Step 1) until the set N*(K) does not change or until a chosen iteration limit is reached. As the foregoing description shows, the KC-PC algorithm closely follows the format of the KMeans algorithm (considering both in their simplest forms) except for the reference to the separation measure Separate(i: C) and the introduction of pseudo-centroids in place of classical centroids. The variant of the foregoing algorithm that incorporates the set C* of all pseudo-centroids amends the definition of N*(K) so that it becomes the union of the sets C*(h), h  K. Then Steps 1 and 2 of the K-PC algorithm become as follows. Modified Steps 1 and 2 to incorporate all pseudo-centroids 1. Identify the set C*(h) of pseudo-centroids for each cluster C = C(h) by C*(h) = {i  C: Separate(i: C) = Span(C)}. Denote this set of pseudo-centroids by N*(K) = (C*(h): h  K). 2. Reassign each of the n – |N*(K)| points j  N \ N*(K), to the pseudo-centroid i*  N*(K) that is closest to it by the measure d(i,j), thus assigning each j to the associated new cluster C(h) such that i*  C*(h) (retaining each i*  C*(h) in the this new cluster). An additional variant of the K-PC algorithm allows all n points j  N to be reassigned in Step 2 instead of only the points j  N \ N*(K). If the distances d(i,j) are non-negative, and we interpret the convention d(i,i) = 0 to permit d(i,i) to be slightly negative, then this implies that a pseudocentroid will be re-assigned to itself, and hence the outcome of Step 2 will not change for this variant. However, in the case where negative distances exist, the indicated variant could reassign a pseudo-centroid to a different pseudo-centroid, and thus reduce the number of clusters 6 generated. Later we discuss other variants of the K-PC algorithm, including a Regret-Threshold PC algorithm, which in turn suggest new variants of the K-Means algorithm. Finally, we note that the classical form of the K-Means algorithm terminates when an objective function expressed as the sum of the distances, or squared distances, of each point from its assigned centroid, summed over all centroids, reaches a local minimum. An analogous (though clearly not equivalent) objective function for the K-PC algorithm is to minimize ∑(Span(C(h)): h  K) This function may likewise be replaced by one in which the Span(C(h)) values are squared. Thus an alternative termination point for the K-PC algorithm is to terminate when this function attains a local minimum, where the next iteration causes the function to increase. This objective may also be modified to replace Span(C(h)) by Span(C(h))/|C(h)|, thus seeking to minimize the sum of the “average” span values over the clusters. In Section 9 we present a somewhat different function for evaluating the clusters which can also be used to identify good values of k. 4. The MinMax-Centroid and the K-MinMax Algorithm The first principal instance of a pseudo-centroid we consider, the MinMax-centroid, arises by defining Separate(i: C) = Max(d(i,j), j  C \ {i}), which we also denote by MaxDist(i,C). Then we obtain the instance of Definition PC given by Definition MinMax: A MinMax-Centroid of C is a point i*  C whose maximum distance from all other points in C is smallest; i.e.: MaxDist(i*: C) = Min(MaxDist(i: C): i  C) Then Span(C) = MaxDist(i*: C) and for this case will be denoted MMSpan(C). The statement of the K-MinMax Algorithm then becomes essentially the same as the statement of the K-PC algorithm, upon replacing “pseudo-centroid” with “MinMax-centroid,” “Separate(i: C(h))” with “MaxDist(i: C(h))” and “Span(C) with MMSpan(C).” K-MinMax Algorithm 0. Begin with a collection of k points N(K), and assign each of the n – k points j  N \ N(K) to the point i = i(h)  N(K) that is closest to it by the measure d(i,j). Identify an initial collection of clusters C(h), h  K, each consisting of i(h) and the points assigned to it. 1. Identify a MinMax-centroid i*(h) for each cluster C(h); i.e., MaxDist(i*: C) = MMSpan(C) for i* = i(h) and C = C(h). Denote the set of MinMax-centroids by N*(K) = {i*(h): h  K}. 7 2 Reassign each of the n – k points j  N \ N*(K), to the MinMax-centroid i = i*(h) that is closest to it by the measure d(i,j), ), thus assigning each j to an associated new cluster C(h) that contains i*(h). 3 Repeat Steps 1 and 2 (creating a new set of MinMax-centroids at Step 1) until the set N*(K) does not change or until a chosen iteration limit is reached. The time complexity of the K-MinMax algorithm compared to that of the K-Means algorithm depends on the dimension d of the points i N (vectors xi, i N), which are used to compute a centroid in the K-Means algorithm, as determined by the execution of Step 1 (since Steps 0 and 2 are essentially the same in both algorithms). The complexity of identifying a MinMax-centroid of a cluster C(h) in Step 1 of the K-MinMax algorithm is O(|C(h)|2 ), while the complexity of identifying an ordinary centroid with the K-Means algorithm is O(|C(h)|d). If the distances d(i,j) must be precomputed from coordinates, rather than being given directly from the problem data base for the application of concern, then this will inflate the the complexity of the K -MinMax algorithm. In this respect, it may be noted that even where distances rely on coordinate calculations, commercial enterprises or government agencies may prefer not to disclose the information contained in these coordinates, and therefore will preprocess the data to produce distances before passing them along to a clustering algorithm. 1 Independently of such considerations, the computational effort of Step 1 in the K-MinMax algorithm can potentially be improved as follows: Accelerated update for Step 1. For each MinMax-centroid i* = i*(h) identified in Step 1, let match(i*) be a point j* that determines the MMSpan(C(h)); that is, d(i*, j*) = MaxDist(i*: C(h)). If j* belongs to the new cluster C(h) produced in Step 2, then the computation to identify the MinMax-centroid of C(h) on the next execution of Step 1 can restrict attention to the set of points C+(h) that were added to C(h) in Step 2. Specifically, for each i  C+(h) compute the value MaxDist(i: C(h)) = Max(d(i,j): j  C(h) \ {i}) and from these values identify i'(h) = arg min(MaxDist(i: C(h)): i  C+(h)). Then the MinMax-centroid of the new C(h) passed from Step 2 to Step 1 is either i'(h) or i*(h), depending on which of MaxDist(i'(h): C(h)) and MMSpan(C(h)) (= d(i*(h),j*)) is smaller. The modification of the K-MinMax algorithm to refer to the full sets of MinMax-Centroids C*(h), when these may contain more than one element, changes Steps 1 and 2 as indicated earlier. In this case the changed form of Step 1 identifies C*(h) by C*(h) = {i  C: MaxDist(i: C) = MMSpan(C)} for C = C(h) (together with redefining N*(K) = (C*(h): h  K)) and the changed form of Step 2 reassigns each of the n – |N*(K)| points j  N \ N*(K), to the MinMaxcentroid i*  N*(K) that is closest to it, creating new clusters C(h) (which, respectively, inherit the previous elements of C*(h)). The Accelerated Update of Step 1 can be applied to the situation where we keep track of the sets C*(h) as a result of the fact that MMSpan(C(h)) is the same value regardless of which element i* 1 Communication from B. Cao, regarding applications of the method of Cao et al. (2015) to commercial applications. 8  C*(h) is used to identify it, and it is only necessary to retain a single associated element j* in C(h) (for some i*) to imply the value MMSpan(C(h) (previously = d(i*,j*)) remains at least as large in the new C(h) as it was before. Likewise we may refer to a single index i'(h) to compare the two distances MaxDist(i'(h): C(h)) and MMSpan(C(h)). Then the new set of MinMaxcentroids will be determined according to which of these distances is smaller. Since all MinMaxcentroids of the old C(h) are required to be carried forward as elements of the new C(h), the new set C*(h) will contain the old C*(h) plus any additional points of C +(h) that qualify to be included. 5. MinSum-Centroids and a K-MinSum Algorithm The second type of pseudo-centroid we focus on, called a MinSum-centroid, results by defining defining Separate(i: C) = SumDist(i,C), where SumDist(i,C) = ∑ (d(i,j), j  C \ {i}). Then we obtain the instance of Definition PC given by Definition MinSum: A MinSum-centroid of C is a point i*  C whose sum of distances from all other points in C is smallest; i.e.: SumDist(i*: C) = Min(SumDist(i: C): i  C) Then SumDist(i*: C) identifies the value of Span(C), which in this case will be denoted MSSpan(C). A weighted version of a MinSum-centroid can be created without introducing weights separately but simply by modifying the distances. Specifically, suppose it is desired to attach a weight w(D) to each d(i,j) such that d(i,j) = D. Then it suffices to create the new value d'(i,j) := w(D)d(i,j) for D = d(i,j) and then use d'(i,j) in place of d(i,j). To keep the ordering the same for d'(i,j) and d(i,j) we would specify that w(D) is a monotonically increasing function of D. This occurs, for example, for non-negative distances by setting w(D) = Dp where p  0. (E.g., setting p = 1 yields d'(i,j) = d(i,j)2 .) For weights w(D) that grow fast enough (as where w(D) = Dp for a very large power p), the MinSum-centroid becomes a special instance of the MinMax-centroid – one where ties among candidates for i* are implicitly broken by a lexicographic rule: if the largest d(i,j) values are the same, then the second largest d(i,j) values are compared for the tied elements, and if ties remain at this level, the third largest d(i,j) values are compared for the resulting tied elements, and so on. However, a scheme employing such large weights is very likely to produce d(i,j) values too large to be easily handled computationally, thus making the direct MinMax-centroid preferable to the weighted MinSum-centroid for problems where maximum distances are more relevant than (weighted) sums of distances. On the other hand, when weights of reasonable size are employed, the structures of clusters produced by a K-MinMax Algorithm and a K-MinSum Algorithm can differ appreciably, and 9 hence it becomes of interest to compare the two approaches to determine which may have advantages in particular contexts. While the statement of the K-MinSum Algorithm can be readily inferred from the statement of the K-PC Algorithm and our preceding definitions, we give explicit instructions for the KMinSum Algorithm as follows. By this means, we are able to make observations about the KMinSum Algorithm that differ from those concerning the K-MinMax Algorithm, particularly in the context of advanced starting methods of later sections. K-MinSum Algorithm 0. Begin with a collection of k points N(K), and assign each of the n – k points j  N \ N(K) to the point i = i(h)  N(K) that is closest to it by the measure d(i,j). Identify an initial collection of clusters C(h), h  K, each consisting of i(h) and the points assigned to it. 1. Identify a MinSum-centroid i*(h) for each cluster C(h); i.e., SumDist(i*: C) = MSSpan(C) for i* = i(h) and C = C(h). (SumDist(i: C(h)): i  C(h)). Denote the set of MinSum-centroids by N*(K) = {i*(h): h  K}. 2. Reassign each of the n – k points j  N \ N*(K), to the MinSum-centroid i = i*(h) that is closest to it by the measure d(i,j), ), thus assigning each j to an associated new cluster C(h) that contains i*(h). 3. Repeat Steps 1 and 2 (creating a new set of MinSum-centroids at Step 1) until the set N*(K) does not change or until a chosen iteration limit is reached. The time complexity of the K-MinSum algorithm is the same as that of the K-MinMax algorithm, and hence the comparison to the complexity of the K-Means algorithm again depends on the dimension d of the points i N (vectors xi, i N) involved in computing a centroid, as determined by the execution of Step 1. Specifically, the different complexities for executing this step are O(|C(h)|2 ) for the K-MinSum algorithm and O(|C(h)|d) for the K-Means algorithm. The computational effort of Step 1 in the K-MinSum algorithm can potentially be improved by a somewhat different method than in the case of the K-MinMax algorithm. Accelerated update for Step 1 of the MinSum Algorithm. Let C' = C'(h) denote the set of points C(h) before executing Step 2 and C" = C"(h) denote the set of points after executing Step 2. Let Co = C'  C" (the points that remain in C(h) after the reassignment of Step 2), C + = C" \ C' (the points added to C(h) in Step 2) and C - = C' \ C" (the points dropped from C(h) in Step 2). Assume the values SumDist(i,C') have been saved before executing Step 2. Then for i  Co , the new SumDist(i: C(h)) value is given by SumDist(i: C") = SumDist(i,C') + ∑(d(i,j): j  C+) – ∑(d(i,j): j  C-). This update can be useful for saving computation on iterations where some of the clusters C(h) do not greatly change their composition by Step 2 (i.e., where C o is relatively large compared to C + and C-). 10 We now turn to one of the main features of the K-PC algorithm that motivates our study, which is the ability to derive an initial collection of clusters and their pseudo-centroids by means of special types of advanced starting algorithms. 6. Advanced Starting Methods We introduce two types of advanced starting methods, called Diversity-Based Starting Methods and Intensity-Based Starting Methods,2 to generate an initial set of points N(K) = {i(h), h  K} for the K-MinMax and the K-MinSum algorithms. The diversity-based methods are simpler and require less computation than the intensity-based methods, and apply equally to the MinMax and MinSum cases. (These methods can also be used to generate starting points for the K-Means algorithm.) The more advanced intensity-based methods take slightly different forms for the MinMax and MinSum cases. Their greater computational complexity makes them less suited for large clustering problems, though they afford an opportunity to generate a better set of initial points to become N(k) in the K-MinMax and K-MinSum algorithms. They also generate MinMax and MinSum-centroids to compose the set N*(k) for the first execution of Step 2, and simultaneously produce associated clusters C(h). The intensity-based methods are of two types, which we call Primary and Adaptive. Both generate a best cluster of a given size from the elements available at each step. This does not assure the final collection of clusters will be optimal since the cluster size may not be chosen correctly and a best cluster at a given stage may not be a globally best choice over all stages. Nevertheless, it increases the likelihood that the quality of the initial clusters will lead to reducing the overall number of iterations of the K-PC algorithm and improve the quality of the final clusters produced. The remainder of this section is devoted to the diversity-based starting methods. The intensitybased starting methods are then described in the two subsequent sections, introducing the Primary Intensity-Based Algorithms in Section 7 and the Adaptive Intensity-Based Algorithms in Section 8. Diversity-Based Starting Methods The diversity-based starting methods constitute an elaboration of an approach suggested in Glover (1994) which may be formulated in the present context by viewing N as the set from The “intensity-based” terminology does not relate to “intensification methods” as used in metaheuristic algorithms. However, the “diversity-based” terminology carries an association with “diversification methods” used in such algorithms. 2 11 which to create a subset N(K) of k elements. In this setting, the approach may be described as starting with an arbitrary seed element from N as the first element of N(K) and then sequentially selecting each of the remaining k – 1 elements to maximize its minimum distance from the elements chosen so far. We first depict a simple instance of this method based on the following terminology. Let Ho = {i(h): h = 1, …, ko } denote the set of starting points selected as of iteration ko , where ko ranges from 1 to k. As the points i(h) are successively selected from N and added to Ho , we also refer to the set Io = N \ Ho which identifies the points remaining in N as candidates to be selected for inclusion in Ho on the next iteration. By the sequence of updating Ho , the value MinD(i) identified below is equivalent to the value defined as MinD(i) = Min(d(i,i(1)), …, d(i,i(ko – 1)). Simple Diversity-Based Starting Method Initialization: Choose an arbitrary point i  N, set i(1) = i, ko = 1, Ho = {i(1)} and Io = N \ {i(1)}. Core Loop For ko = 2 to k: Identify MinD(i) = Min(d(i,j): j  Ho ) for each i  Io . Choose i' = arg max(MinD(i): i  Io ) and set i(ko ) = i', Ho := Ho  {i'} and Io := Io \ {i'}3 EndFor The final set Ho = {i(ko ): ko = 1 to k} becomes the set of starting points for the K-MinMax or the K-MinSum algorithm. The computational complexity of this method is O(n∙k2 ), since we examine O(n) points on each of the k – 1 iterations from ko = 2 to k, and examine the distances from each point to ko – 1 other points. The original proposal for the preceding method (in a different context) gave extended tiebreaking rules for choosing i(ko ) where multiple points qualified to be a point i' satisfying MinD(i') = Max(MinD(i)). Instead of employing such rules, we now propose a refinement of the Simple Diversity-Based Starting Method. The underlying idea is to consider the maximum of the smallest MinD(i(ko )) value for the elements i(ko ) in Ho = {i(ko ): ko = 1 to k} to be an indicator of the quality of Ho . Due to the construction of Ho , this maximum MinD(i(ko )) value results when i(ko ) = i(k), the last element added to Ho . Hence, we adopt the goal of maximizing MinD(i(k)), and re-run the algorithm by allowing it to choose this last element i(k) as the new starting element i(1). This approach is based on the supposition that if element i(k) (which is a limiting element in determining the quality of the current Ho ) belongs to a better set Ho , then we increase the possibility of finding such a better Ho by making i(k) the first element of this set, to increase the distance of other points from it. At the conclusion of the execution that has specified the old i(k) to be the new 3 The MinD(i) values used in these computations need not be stored as a vector indexed by i, but can generated and compared sequentially. 12 i(1), we therefore check whether the resulting final MaxMin distance MinD(i(k)) exceeds this distance on the previous execution (denoted PreviousMaxMin). If so, the maximization objective value is improving and we re-run the algorithm by again setting i(1) = i(k) for this new i(k). The method stops when MinD(i(k)) < PreviousMaxMin, at which point the Ho that was generated at the end of the previous execution (denoted PreviousHo ) is recovered, thus picking a local optimum for maximizing MinD(i(k)). We refer below to the modified version of the previous Core Loop that handles this objective as the Core Algorithm. Refined Diversity-Based Starting Method Initialization: Choose an arbitrary point i  N, set i(1) = i, ko = 1, Ho = {i(1)} and Io = N \ {i(1)}. Set PreviousMaxMin = – Large and CurrentMaxMin = 0. Core Algorithm While CurrentMaxMin > PreviousMaxMin For ko = 2 to k: Identify MinD(i) = Min(d(i,j): j  Ho ) for each i  Io Choose i' = arg max(MinD(i): i  Io ) and set i(ko ) = i', Ho := Ho  {i'} and Io := Io \ {i'} EndFor CurrentMaxMin = MinD(i') If (CurrentMaxMin ≤ PreviousMaxMin) then Break 4 Else PreviousMaxMin = CurrentMaxMin PreviousHo = Ho i(1) = i'; Ho = {i(1)}; Io = N \ {i(1)} Endif EndWhile The foregoing approach can also choose an element of Ho other than the last to become the new i(1) (for example, selecting a “middle element” i(ko ) from the sequence, obtained by rounding ko = (k – 1)/2 to an integer). However, the stopping criterion should continue to be defined in reference to a local maximum for MinD(i(k)), the last element of Ho . Hence the only change in the foregoing pseudocode is to select a different element than the last element i(k) in Ho to become the new i(1). The computational complexity of the procedure remains O(n∙k2 ) provided a constant limit (e.g., 5 or 10) is placed on the number of executions allowed in searching for a locally maximum MinD(i(k)) value. The value MinD(i(k)) for the last element of Ho can also serve another function, since it gives an estimate of the least distance for separating the PC-centroids. If this estimated distance is small we may conclude there is a significant chance that k has been chosen too large. Moreover, a 4 The instruction Break means to exit the “current loop” (the innermost loop the instruction is embedded in). 13 process of monitoring the successive MinD(i(ko )) values as ko ranges upward from 2 can disclose ko values where MinD(i(ko )) abruptly decreases or falls below a minimum desired distance separating the clusters generated. The preceding Refined Diversity-Based method can be further refined by not waiting until ko = k to apply it, but instead by selecting a value kCheck < k which is treated temporarily as if it were the final ko . In this way, the objective of maximizing MinD(i(k)) can be additionally pursued at an earlier stage of building the set Ho , thus potentially affording greater leeway for selecting subsequent elements to add to Ho that will keep the MaxMin distance high. This refinement may be executed for multiple (successively larger) values of kCheck, but we indicate the form of the method for choosing only a single kCheck value. Thus we first iterate from ko = 2 to kCheck, and then after finding a local maximum for the last MinD(i') (for i' = i(kCheck)), we continue iterating from ko = kCheck + 1 to k to complete the method (concluding by seeking a maximum value for MinD(i') for k o = k).5 We call this approach the Compound Diversity-Based Starting Method which we organize to always iterate over ko from kFirst to kCheck instead of over 2 to k.6 Compound Diversity-Based Starting Method Initialization: Choose k'  [2, k – 1]. Choose an arbitrary point i  N, set ko = 1, i(1) = i, Ho = {i(1)} and Io = N \ {i(1)}. Set PreviousMaxMin = – Large, CurrentMaxMin = 0 and kFirst = 2. While kFirst ≤ k Compound Core Algorithm While CurrentMaxMin > PreviousMaxMin For ko = kFirst to kCheck Identify MinD(i) = Min(d(i,j): j  Ho ) for each i  Io Choose i' = arg max(MinD(i): i  Io ) and set i(ko ) = i', Ho := Ho  {i'} and Io := Io \ {i'} EndFor CurrentMaxMin = MinD(i') If (CurrentMaxMin ≤ PreviousMaxMin) then Break Else PreviousMaxMin = CurrentMaxMin PreviousHo = Ho i(1) = i'; Ho = {i(1)}; Io = N \ {i(1)} kFirst = 2 (to reset kFirst after having assigned it the value 5 An interesting small value of k' to initiate such an approach is 3. This permits starting with kFirst = 2 and later increasing kFirst to kCheck + 1 accompanied by resetting kCheck = k for the final execution. 6 14 kCheck + 1 following the first execution of the Compound Core Algorithm) Endif EndWhile (End Compound Core Algorithm) If kCheck < k then kFirst = kCheck + 1 kCheck = k PreviousMaxMin = – Large; CurrentMaxMin = 0 Elseif kCheck = k then Break Endif EndWhile We consider one last type of diversity-based starting method, called the Targeted DiversityBased Starting Method, which instead of seeking to maximize MinD(i) at each iteration selects a target value T for MinD(i) and identifies Deviation(i) = |MinD(i) – T| for the goal of minimizing this latter deviation. An appropriate value for T may be determined by first executing one of the preceding diversity-based starting methods and then selecting T to be final the mean or the median of the MinD(i(ko )) values generated as ko ranges from 2 to k (noting that no MinD(i(ko )) value exists for ko = 1), This targeted diversity-based approach will typically yield the same choice of i' = i(k) as by the MaxMin choice of the preceding methods on the final iteration for ko = k. We identify a simple instance of this method analogous to the Simple Diversity-Based Starting Method described earlier. Simple Targeted Diversity-Based Starting Method Initialization: Choose an arbitrary point i  N, set i(1) = i, ko = 1, Ho = {i(1)} and Io = N \ {i(1)}. For ko = 2 to k: Identify MinD(i) = Min(d(i,j): j  Ho ) and Deviation(i) = |MinD(i) – T| for each i  Io Choose i' = arg min(Deviation(i): i  Io ) and set i(ko ) = i', Ho := Ho  {i'} and Io := Io \ {i'}7 EndFor As with the previous diversity-based starting methods, the Targeted Diversity-Based Starting Method can be embodied in refined versions that identify different initial choices of i(1) for restarting the method, continuing in this case as long as the T value computed at the end of each execution is increasing, to yield a local maximum relative to the rule for selecting T. A special 7 As in the case of the MinD(i) values, the Deviation(i) values can be identified sequentially and do not need to be stored as vectors indexed by i. 15 variant of the Targeted Diversity-Based Starting Method designed to create a more compact set of diverse points is described in Section A of the Appendix. 7. Primary Intensity-Based Starting Methods The intensity-based starting methods exploit the structure of the MinMax and MinSum-centroids to generate a starting collection of clusters where the current cluster at each iteration is the best one possible, subject to the elements available for generating a cluster and the chosen value for the cluster size at that iteration. Rather than identifying starting points for the set N(K) in Step 0, the intensity-based methods generate a starting collection of clusters C(h) and the associated set N*(K) of MinMax-centroids or MinSum-centroids to be passed to Step 2, thereby bypassing the first execution of Steps 0 and 1. These intensity-based procedures require O(n2 ∙(k + log n)) effort in comparison with the O(n∙k2 ) effort of the diversity-based algorithms of Section 6, which should be taken into account in considering their use for large problems. However, the ability of the intensity-based methods to select the best cluster of a given size from the collection of elements available affords an opportunity to reduce the number of iterations consumed by the K-MinMax and K-MinSum algorithms and thereby compensate for the time invested in obtaining the initial clusters. We employ the following notation and conventions which apply to the adaptive intensity-based methods as well as to the primary methods. Notation and Conventions No = a subset of N consisting of all points at a particular stage of construction available to belong to clusters C(h) not yet created. (Hence No begins equal to N, and then shrinks as elements are removed to populate each cluster C(h) as it is created.) We let no = |N o | and to begin take N o = N. δ(i) = a logical “indicator variable,” where δ(i) = True if i  No and False otherwise. (The use of this indicator variable allows the algorithms that follow to be expressed in a convenient form, although more efficient versions of the algorithms may be produced by reference to doubly linked lists.) ko = the number of clusters (and hence the number of MinMax-centroids) that remain to be generated, starting at ko = k and decreasing ko by 1 at each iteration until reaching 1. Each iteration is identified by its ko value. C(ko ) = the cluster generated at iteration ko . MMCentroid(ko ) = the MinMax-centroid i* for C(ko ). 16 ClusterSize = the targeted number of elements |C(k o )| in the cluster C(ko ). In the simple (first) version of the algorithm described below, ClusterSize receives a value that is (approximately) the same for each ko , while in the succeeding more advanced version ClusterSize varies adaptively for different ko values. ScanSize = the number of distances d(i,j) scanned from element i at iteration k o . Since element i itself will belong to the cluster C(ko ) to be generated, ScanSize = ClusterSize – 1. We determine bounds MinSize and MaxSize on ClusterSize as follows. At least one of the ko clusters remaining to be created must have a size that equals or exceeds the average number of elements no /ko that can be assigned to these clusters. We adopt the goal of insuring the current cluster C(ko ) will attain this size and hence set MinSize = no /ko  (where   is the roof function that rounds fractional values upward). In the version of the algorithm that only allows a single value for the size of C(k o ), we choose ClusterSize = MinSize. We observe that this choice is highly natural for applications such as Cao and Glover (2010) where it is highly desirable to have clusters that are all approximately of the same size. For the adaptive version of the algorithm we allow ClusterSize to vary between MinSize and an upper bound MaxSize. Let GlobalMinSize be a constant denoting the fewest number of elements permitted in any cluster (set externally, independent of the value MinSize). (For our following purposes, it is useful to choose GlobalMinSize  2.) Then on the current iteration, with k o clusters remaining to be constructed, the maximum number of elements permitted in the current cluster C(ko ) is MaxSize = no – GlobalMinSize∙(ko – 1) Correspondingly, we set the lower and upper bounds on the number of elements scanned from any given point i by MinScan = MinSize – 1 and MaxScan = MaxSize – 1. Finally, all of the intensity-based methods are based on a preprocessing step that creates an ordered set of indexes i(1), i(2), …, i(n-1) for each i  N to sequence the distances d(i,j) for each i  N\{i} in ascending order so that d(i,i(1)) ≤ d(i,i(2)) … ≤ d(i,i(n-1)) This preliminary ordering is potentially the most expensive part of the intensity-based methods, with a time complexity of O(n2 ∙log n). Remaining operations of the intensity-based methods are O(n2 ∙k) which makes the total complexity O(n2 ∙(k + log n)) which may reduce to the complexity of creating the preliminary ordering if log n > k. An exception occurs if the distances d(i,j) are integers and for each i, Max(d(i,j): j  N) – Min(d(i,j): j  N) has an O(n) range, in which case a 17 properly constructed bucket sort can sequence the distances for all i  N in O(n2 ) time, and the O(n2 ∙k) complexity dominates. It is to be noted that the preliminary ordering needs to be done only once, and its information can be re-used in refined versions of the algorithms subsequently described and also re-used to generate K-MinMax and K-MinSum clusters for different values of k. Since the intensity-based methods differ for the K-MinMax and the K-MinSum algorithms, we begin by introducing these starting methods for the K-MinMax setting, starting with the simpler “primary” version that selects the single value ScanSize = MinScan. Primary MinMax Starting Method Initialization: Begin with the ordered indexes i(1), i(2), …, i(n-1) for each i  N and set N o = N, no = n and δ(j) = True, j  N. For ko = k to 1, ClusterSize = no /ko  (ClusterSize = MinSize) ScanSize = ClusterSize – 1 Execute the MinMax Distance Algorithm (described below) (At the conclusion: i* = arg min(Max (d(i,,j): j  C) (= MMSpan(C)) over all sets C  No such that |C| = ClusterSize.) Generate C(ko ) and update the set No (This step re-executes the relevant part of the MinMax Distance Algorithm for i = i* to determine the set C = C(ko ) associated with i*.) C(ko ) =  Scan = 0 For s = 1 to n – 1 j = i*(s) If (δ(j) = True) then (j is an element of No \ {i} Scan := Scan + 1 No := No \ {j} C(ko ) = C(ko )  {j} δ(j) = False If (Scan = ScanSize) Break Endif Endfor N o := No \ {i*} C(ko ) = C(ko )  {i*} δ(i*) = False MMCentroid(ko ) = i* no := no – ClusterSize 18 Endfor On the final iteration of the Primary Algorithm when ko = 1, the step of generating C(ko ) can be shortcut by simply setting C(1) = N o and MMCentroid(1) = i* (and there is no need to update No because it will become empty). This ability to shortcut the final update of C(k o ) for ko = 1 also holds for all intensity-based starting methods subsequently discussed. The MinMax-centroids of MMCentroid(ko ), ko = 1, …, k, generated by the foregoing method give the initial set of points N*(K) = (i(h), h  K} that can be passed directly to Step 2 of the KMinMax Algorithm along with the associated clusters C(k o ). This likewise is true of all intensitybased methods subsequently discussed (referring to the array MSCentroid(k o ) in the case of the K-MinSum algorithm). The internal MinMax Distance algorithm executed within the Primary Algorithm, described next, is understood to share its arrays and values with the Primary Algorithm. MinMax Distance Algorithm Conventions: i* identifies a point i that yields a MinMax-centroid for a “best” C of size ClusterSize in N o . BestDistance = the value Min((Max (d(i*,j): j  C): C  No ) that gives MMSpan(C) for this “best” C. Large = a large positive number Initialization: BestDistance = Large For i  N o Scan = 0 (the number of elements j scanned from i) For s = 1 to n – 1 j = i(s) If (δ(j) = True) then (j is an element of No \ {i}) Scan := Scan + 1 If (Scan = ScanSize) Break Endif Endfor If (d(i,j) < BestDistance) then i* = i BestDistance = d(i,j) Endif Endfor The rationale underlying the foregoing method may be expressed as follows. Let v = ClusterSize and no = |N o |, for ClusterSize and N o determined at iteration ko , and let CSet = {C  N o : |C| = v} 19 denote the set of all clusters C in N o of size v. Assume at each iteration ko we seek to identify a “best” cluster C best that minimizes MMSpan(C) over the clusters C in CSet. Evidently, one way to do this, which we would hope to improve upon, is to examine the clusters in CSet (where |CSet| = no !/v!(no – v)!) and then determine the MinMax-centroid i' of each C in CSet to compute MMSpan(C) = Max(d(i',j): j  C \ {i'}). The following result establishes the ability of the Primary Starting Method to achieve the desired outcome with vastly less effort. Theorem 1. The cluster C(ko ) and the associated point i* identified at the conclusion of iteration ko of the Primary Starting Method respectively qualify to be Cbest and its MinMaxcentroid. Proof: Let io (t), t = 1, …, no – 1 identify the subsequence of i(s), s = 1, …, n – 1 such that δ(j) = True for j = i(s). Hence, defining jt = io (t) (with the identity of i implicit), the ordering of distances d(i,j) for point i can be written d(i,j1 ) ≤ d(i,j2 ) ≤ … ≤ d(i,jno-1 ). Consider the cluster Ci consisting of i and the points jt for t = 1 to v – 1. (Note that t corresponds to successive values of Scan, and v – 1 = ScanSize.) It is possible that i is not a MinMax-centroid of C i and hence the distance d(i,jv-1 ) may be larger than MMSpan(Ci). Neverthless, for a point i* that qualifies as a MinMax-centroid of Cbest (at least one such i* must exist) there can be no better candidate for Cbest than the set C i* , and the distance d(i*,jv-1 ) must equal MMSpan(Cbest ). Therefore, letting BestDistance denote the minimum of the d(i,jv-1 ) values over all points i examined so far, the Primary MinMax Starting Method goes through the successive indexes jt , t = 1 to v – 1, for each i  N o (where jt depends on i) and stops at t = v – 1 to check whether d(i,jv-1 ) < BestDistance. If the inequality holds, then BestDistance is updated to be the current d(i,jv-1 ) and i* is recorded as i, which verifies the validity of the Starting Method and establishes the claim of the theorem. Note the foregoing proof also shows it would be possible to interrupt the sequence of t values for a given i  N o if d(i,jt )  BestDistance, and thus break from the “For loop” at this point. The foregoing analysis also makes it clear that the Primary MinMax Starting Method succeeds in finding a best C and its MinMax-centroid for a given N o in O(no ∙n) time. (This time could be reduced to O(no ∙v) if the sequence io (t) were used directly instead of relying on the check δ(j) = True for j = i(s)). For the iterations for ko = k to 1 the total effort is therefore bounded above by O(n2 ∙k), as remarked earlier. We are motivated to improve upon the outcome obtained by the Primary Starting Method by accounting for the fact that an ideal collection of clusters may well have somewhat different numbers of elements in different clusters. One way to pursue such an improvement is to look beyond the end of the execution of the Primary Starting Method to identify values for ClusterSize = ClusterSize(ko ), for ko = 1 to k which are then used to launch a second execution of the Starting Method. We consider two such approaches next. Refinement to Choose Different ClusterSize values. Approach 1: After applying the Primary Starting Method (to bypass Steps 0 and 1 of the K-MinMax algorithm), perform the first execution of Step 2 to determine a new collection of clusters C(h), h  K. Index these clusters so the values |C(h)| are in descending order for h = k to 20 1 and set ClusterSize(h) = |C(h)|. Finally, rerun the Primary Starting Method by setting ScanSize = ClusterSize(ko ) – 1 in the “For loop” from ko = k to 1. We choose to put the ClusterSize(ko ) values in descending order as ko goes from k to 1 by noting that N o will be larger, and hence will offer greater latitude for choosing C(ko ), for larger values of k. (This approach may be shortened by interrupting the Primary Starting Method after executing it for any value k o * and reassigning the elements of N \ No in Step 2 to obtain a subset of clusters C(h) for h = k to ko *. The indexes of clusters are then arranged as indicated above to produce descending ClusterSize(ko ) for ko = k to ko *. Remaining ClusterSize values for ko = ko *– 1 to 1 can be determined by ClusterSize = no /ko  exactly as before.) Approach 2: This approach is the same as the first, except that it waits until a later iteration of the K-MinMax Algorithm to select and order the collection of clusters C(h) at Step 2. If the approach waits until the final iteration, the overall effort of generating the final clusters may be expected to be less than twice the amount of the first execution of the K-MinMax Algorithm, because effort is saved on the second execution by not having to re-do the preprocessing step that determines the sequence (i(s): s = 1, …, n-1) for each i  N. In addition, fewer iterations may be required on the second execution due to the chance of generating a better set of starting clusters. The Adaptive Intensity-Based Starting Methods described in Section 8 give a different way to account for the fact that the best clusters C(h) can vary in size. Primary Intensity-Based Method for the K-MinSum Problem We organize the Primary Intensity-Based Starting Method for the K-MinSum Algorithm in the same manner as for the K-MinMax Algorithm. This method is quite similar to the Primary MinMax Starting Method, the chief difference being to replace MaxDist(i) with SumDist(i), and to replace the list MMCentroid(ko ) with a corresponding list MSCentroid(ko ) to identify the MinSum-centroids generated. To avoid ambiguity concerning this correspondence, and to clarify how the MinSum process differs from the MinMax process, we identify the Primary MinSum Starting Method in Section B of the Appendix. 8. Adaptive MinMax and MinSum Starting Methods As already noted, the adaptive starting methods for the K-MinMax and K-MinSum algorithms add a layer of sophistication beyond that of the primary starting methods, in order to respond to the challenge of determining how to select varying cluster sizes in the absence of prior knowledge about the ideal sizes. We begin by considering an adaptive method for the KMinMax algorithm. 21 8.1 Foundation of the Adaptive MinMax Starting Method The Adaptive MinMax method has two phases. Phase 1 resembles the Primary MinMax method by identifying a BestDistance value over all i  No for ClusterSize = MinSize. In addition, it identifies a value DistanceLimit that limits the largest distance d(i,j) based on the successive differences in the ascending d(i,j) values that are used to compute BestDistance. Phase 2 then makes use of the information generated in Phase 1 by examining each i  N o and all elements j in the set J(i) = {j No \ {i}: d(i,j) ≤ DistanceLimit) to identify a set of “best points” i as candidates for the MinMax-centroid i*. This set of points is defined by BestSet = {i  No : |J(i)| = MaxJ} where MaxJ = Max(|J(i)|: i  No ). Finally, to choose among elements in BestSet, the method conputes the value D(i) = Max(d(i,j): d(i,j) ≤ DistanceLimit) and selects the element i* that gives. i* = arg min (D(i): i  BestSet) This construction insures i* will be a MinMax-centroid over the set C = J(i*)  {i*} and, as in the case of the Primary MinMax method, will identify a best such set among those of the same size. Since the adaptively determined cluster C can contain somewhat more than MinSize elements, the upper limit MaxSize is imposed by the calculation indicated earlier as a safeguard against the possibility that |C| may become too large. If the procedure is modified to permit MaxSize to receive a value as large as |N o |, then the current cluster could potentially absorb all of N o , and under such a condition the method will terminate with fewer than k clusters.8 Such a variation can be of interest for enabling the adaptive starting method to propose a new (smaller) value for k. An evaluation criterion to verify when fewer clusters can be appropriate is suggested in Section 9. In spite of the more advanced character of the adaptive starting method, the use of the ordering (i(s): s = 1, …, n-1) makes it possible to identify the sets J(i) and values D(i) in Phase 2 of the adaptive method implicitly, rather than explicitly, as part of the process of identifying i*. Adaptive MinMax Starting Method Initialization: Begin with the ordered indexes i(1), i(2), …, i(n-1) for each i  N and set N o = N, no = n and δ(j) = True, j  N. For ko = k to 1 MinSize =  no /ko  MaxSize = no – MinSize∙(ko – 1) MinScan = MinSize – 1 8 An exception occurs when ko = 1, at which point all of N o is absorbed in any case. 22 MaxScan = MaxSize – 1 Execute the Phase 1 MinMax Algorithm (to identify BestDistance) Execute the Phase 2 MinMax Algorithm (to identify i*) Generate C(ko ) and update the set No (This portion of the Adaptive MinMax Method is identical to that of the Primary MinMax Method, except that “If (Scan = BestScan) Break” replaces “If (Scan = ScanSize) Break”.) Endfor Next we describe the Phase 1 and Phase 2 algorithms embedded in the Adaptive MinMax method. We employ a bare minimum of descriptive comments, since the mnemonic names of the variables and the instructions of the algorithm should make the interpretation clear. Phase 1 MinMax Algorithm Assumption: No contains at least 2 elements BestDistance = Large BestMinGap = 0 For i  N o MinGap = Large Sum = 0 SumGap = 0 Scan = 0 For s = 1 to n – 1 j = i(s) If (δ(j) = True) then Scan := Scan + 1 Distance = d(i,j) Sum := Sum + Distance If (Scan > 1) then Gap = Distance – PreviousDistance SumGap = SumGap + Gap MinGap = Min(Gap,MinGap) Endif If (Scan = MinScan) then s(i) = s (initialize Phase 2 at s = s(i)) Break Endif PreviousDistance = Distance Endif Endfor If ((Distance < BestDistance) 23 or ((Distance BestDistance BestMinGap BestSumGap = BestDistance) and (MinGap > BestMinGap)) ) then = Distance = MinGap = SumGap Endif Endfor BestMeanGap = BestSumGap/(MinScan – 1) TargetGap = λ∙BestMeanGap + (1 – λ)∙BestMinGap) (suggested default, λ = .3) (The following value is inherited in Phase 2 as a limit for i  No ) DistanceLimit = BestDistance + TargetGap Phase 2 Adaptive MinMax Algorithm Conventions: DistanceLimit = the largest distance allowed for d(i,j) when scanning from element i. BestScan = the value of Scan that produces the best candidate for i*. Inherited from Phase 1: s(i), i  No , and DistanceLimit Initialization: BestDistance = Large BestScan = MinScan – 1 For i  N o Scan = MinScan – 1 (Scan is immediately incremented to MinScan in the next loop) For s = s(i) to n – 1 j = i(s) If (δ(j) = True) then (automatically true for s = s(i)) Scan := Scan + 1 (reaches MinScan on first execution, when s = s(i)) If (d(i,j) > DistanceLimit) then Scan := Scan – 1 Break Endif) Distance = d(i,j) If (Scan = MaxScan) Break Endif Endfor If (Scan  MinScan) then (i is a candidate for i*) If ((Scan > BestScan) or ((Scan = BestScan) and (Distance < BestDistance))) then i* = i BestScan = Scan BestDistance = Distance Endif Endif Endfor 24 We observe that Approaches 1 and 2 of the “Refinement to Choose Different ClusterSize Values” for the Primary MinMax Starting Method can also be used with the Adaptive MinMax Starting Method, where upon restarting the K-MinMax algorithm for the second pass the primary starting method is used together with setting ClusterSize = ClusterSize(ko ). The justification of the Adaptive MinMax Starting Method is provided in Theorem 2, following. As in the discussion that precedes Theorem 1, let v = ClusterSize , where in this case ClusterSize is not specified in advance but is determined at iteration ko to be the value BestScan + 1 for BestScan at the conclusion of this iteration. As before, let CSet = {C  No : |C| = v}. Now at each iteration ko we seek to identify a “best” cluster C best that minimizes MMSpan(C) over the clusters C in CSet, where v is not fixed at the start of iteration ko . Subject to the restriction Scan ≤ MaxScan, which implies v ≤ MaxScan + 1, we undertake to make v as large as possible. Because of this dependency on the variable value of v, we refer to C best as Cbest (v) and to the best value of v as v*, hence identifying the best cluster C finally obtained as Cbest (v*). Theorem 2. The cluster C(ko ) and the associated point i* identified at the conclusion of iteration ko of the Adaptive MinMax Starting Method respectively qualify to be Cbest (v*) and its MinMax-centroid. Proof: As in the proof of Theorem 1, let io (t), t = 1, …, no – 1 identify the subsequence of i(s), s = 1, …, n – 1 such that δ(j) = True for j = i(s). Hence, defining jt = io (t) (with the identity of i implicit), the ordering of distances d(i,j) for point i can be written d(i,j1 ) ≤ d(i,j2 ) ≤ … ≤ d(i,jno-1 ). Now the cluster C i consisting of i and the points jt for t = 1 to v – 1 depends on v as a variable rather than as a constant. The first priority is to make v as large as possible, subject to requiring v ≤ MaxScan + 1, and more particularly subject to requiring d(i,jv-1 ) ≤ DistanceLimit where DistanceLimit is determined by BestDistance and TargetGap computed in Phase 1 according to the choice of the parameter λ. The best value v* for v is the value BestScan + 1 for BestScan as updated in Phase 2, whenever BestScan can be increased subject to BestScan ≤ MaxScan. The final “If … then” instruction in Phase 2 first increases BestScan (hence implicitly increases v*) when possible, and otherwise decreases the value BestDistance when BestScan remains unchanged. By this layer of priorities, the method always first increases v*, and for v* unchanged selects the minimum value d(i,jv*-1 ) for BestDistance. Consequently, by the same reasoning as in the proof of Theorem 1, it follows that ultimately C best (v*) identifies a cluster that is the best for the largest admissible value v* for v, and thus qualifies to be treated as the cluster denoted Cbest in Theorem 1 with i* constituting its associated MinMax-centroid. The analysis of the complexity of the Primary MinMax Starting Method applies as well to the Adaptive MinMax Starting Method in spite of its more elaborate form. This result carries over with the replacement of “MinMax” by “MinSum” and “MMCentroid” by “MSCentroid” to become applicable to the corresponding starting method for the K-MinSum problem. 25 8.2 The Adaptive MinSum Starting Method The Adaptive MinSum Starting Method follows a pattern similar to that of the Adaptive MinMax Starting Method with some minor departures. As in the case of the Primary MinSum Starting Method, we include the pseudo-code for the Adaptive MinSum method in Section B of the Appendix to clearly disclose the details where the two methods differ. 9. A Regret-Threshold PC Algorithm and a Diversified Restarting Method We conclude by proposing a modification of the K-PC Algorithm called a Regret-Threshold PC Algorithm that applies both to the K-MinMax and K-MinSum algorithms, and which can also be used to modify the K-Means Algorithm by replacing references to the pseudo-centroid with references to the ordinary centroid. The strategy of the Regret-Threshold algorithm is to form a candidate list consisting of the elements that are reassigned to new clusters in Step 2 of the K-PC Algorithm and to permit only elements belonging to a subset of this candidate list to be reassigned. The elements eligible for reassignment are determined by a threshold value T which is based on a regret measure, as follows. Referring to Step 2 of the K-PC Algorithm, let CandidateList = {j  N: j qualifies to be reassigned to a new cluster C(h)}, and for j  CandidateList, let: i' = Assign(j) denote the pseudo-centroid of the cluster C(h') that j is currently assigned to i" = ReAssign(j) denote the pseudo-centroid of new cluster C(h") to which j would be reassigned by Step 2. ADist(j) = d(i',j) denote the assign distance for j RDist(j) = d(i",j) denote the reassign distance for j. Regret(j) = ADist(j) – RDist(j) Hence, the larger the value of Regret(j), the greater is the regret for not reassigning j to the new pseudo-centroid ReAssign(j) (and hence to the associated cluster C(h")) in Step 2. These definitions equally apply in the situation where multiple points may be recorded as pseudocentroids of a cluster C(h), as represented by the set C*(h). We then use the threshold T by identifying a selected number r of the “largest regret” elements in CandidateList, as where r is determined to admit some fraction F of these elements for consideration. As a simple example, F may be chosen from the interval [.05, .2] subject to assuring that at least 1 element passes the threshold. When F = 1, this approach is the same as the K-PC approach. (Instead of making F constant, a natural variant is to begin by selecting F larger and then allowing it to become smaller as the number of iterations grows.) 26 Upon assigning T a value that will accept these specified elements, the eligible elements to be reassigned in Step 2 are those belonging to SelectList = {j  CandidateList: Regret(j)  T} An upper bound may be additionally imposed on the size of SelectList when ties in the regret values would cause SelectList to contain more elements than considered desirable. The foregoing Regret-Threshold approach may be accompanied by a restarting algorithm to create a new set of initial clusters that differ strategically from the set of clusters produced at the termination of a current execution, as a basis for obtaining a new set of final clusters on an ensuing execution. This algorithm, which we call the Diversified Restart Method, may be used with the earlier K-PC algorithms as well as with the Regret-Threshold approach. Accordingly, we use the term “Clustering Algorithm” to refer to any of these algorithms. Diversified Restart Method Terminology: Let C(h), h  K, denote the final set of clusters produced by the Clustering Algorithm, and let C*(h) denote the set of pseudo-centroids associated with C(h) and C* denote the union of the sets C*(h), h  K. (We allow the option of saving only one element in C*(h).) For each j  N, let h = h(j) identify the cluster C(h) containing j and denote the pseudo-centroid to which j is assigned by i = PC 1 (j)  C*(h). (Thus PC1 (j) is the pseudo-centroid in C* closest to j.) Finally, let d1 (j) = d(j, PC1 (j)) and let d2 (j) = Min(d(j,i): i  C* \ C*(h) for h = h(j)}. (Hence d1 (j) is the distance from the pseudo-centroid “first closest” to j, while d2 (j) is the distance from the pseudo-centroid “second closest” to j, restricting attention in the latter case to pseudocentroids outside of C*(h).) 1. Beginning from the final set of Clusters C(h), create a new set of clusters (to start another execution of the clustering algorithm) by assigning each j  N \ C* to the pseudo-centroid PC2 (j)  C* to j. 2. Restart the Clustering Algorithm with the new set of clusters and executing Step 1 of the Clustering Algorithm to identify new pseudo-centroids for each C(h). We observe that the first step above associates each j  N \ C* with a cluster C(h') (containing PC2 (j)) that is different from the cluster C(h). An alternative is to reassign only a portion of the points j  N \ C* to an alternative pseudo-centroid before restarting. More pronounced forms of diversification can be achieved by redefining PC2 (j) to be the pseudocentroid that is “third closest” to j, or in the extreme to be the pseudo-centroid farthest from j. However, according to the types of diversification often favored in metaheuristic methods, the definition of PC 2 (j) above is likely to be preferred. Alternative Measure for Evaluating the Collection of Clusters The definitions underlying the Diversification Method give a natural way to create a function for evaluating the clusters, which also can be used to identify good values for k. 27 Let do (j) = d2 (j) – d1 (j) ( 0). The magnitude of do (j) signals the relative appropriateness of assigning j to a cluster with pseudo-centroid PC 1 (j), as opposed to assigning j to some other clusters in the current collection. We can exclude elements of C* from having an impact by the convention do (j) = 0 for j  C*, or we can include them by defining d 1 (j) = 0 for j  C* in the definition of do (j). Then an overall measure of the “quality” of C(h) is given by Do (h) = ∑(do (j): j  C(h)) or by Meano (h) = Do (h)/|C(h)|. The denominator |C(h)| may be replaced by |C(h)\C*(h)| if pseudo-centroids are excluded from consideration in defining do (j). Finally, by drawing on Do (h) we may evaluate the entire collection of clusters C(h), h  K by Value = ∑ (Meano (h): h  K) Here larger values indicate higher quality. 9 The Value term may be considered an alternative to the Davies-Bouldin validity index (Davies and Bouldin, 1979) which is frequently used to compare the quality of different collections of clusters. Since Value can meaningfully compare cluster collections for different values of k, this term can be used with other approaches such as those suggested in earlier sections for evaluating collections to find a preferred k value. The do (j) quantities used to define Do (h) and Meano (h) can also serve to create a stochastic variant of the Diversified Restart approach. In this case, probabilities can be computed for reassigning points that are inversely related to the magnitude of the do (j) values. Then, as an extension of the variant that only permits a subset of the elements j  N \ C* to be reassigned, a cutoff value can be established to prevent reassignment of points with d o (j) values exceeding a specified magnitude, and the probabilities for reassigning remaining elements can be used to accept or reject such reassignments. Such a strategy reflects the heuristic notion that points with the largest do (j) values in all likelihood should be maintained in a common cluster. 10. Conclusions The proposals of the preceding sections provide a wide range of strategies for clustering with pseudo-centroid methods, and lay a foundation for studies to compare these methods across alternative classes of clustering problems. Other types of pseudo-centroids, such as a 9 A variation to accentuate the influence of points with larger D o (h) values is to define Meano (h) = Do (h)2 /|C(h)|. 28 MinProduct-centroid, a MinMedian-centroid, which are defined in the obvious way, give rise to associated K-MinProduct and K-MinMedian clustering algorithms whose forms can be identified by analogy with the K-MinMax and K-MinSum algorithms.10 Similarly, we can identify K-PC algorithms associated with a MinSpan-centroid for Span = Max – Min, and with various “ratiobased” pseudo-centroids, such as a MinSpanRatio-centroid based on a ratio such as Max/Min (excluding Min = 0, conceiving that two points separated by a 0 distance represent the same point) and a MinSumRatio-centroid based on a ratio such as Sum/Max ratio (or Sum/Median). These variations employing more subtle types of pseudo-centroids also invite study. Another potential area for exploitation arises by noting that the pseudo-centroid approaches may be contrasted with fuzzy clustering approaches as in Sudha et al. (2012) and imprecise knowledge clustering approaches as in Anwar et al. (1992). An interesting topic for research would be to integrate elements of these latter approaches with the pseudo-centroid approaches. In recent years a variety of metaheuristic algorithms for clustering have emerged to obtain better outcomes than those produced by classical approaches, which in effect are heuristics for obtaining local optima for associated evaluation functions (though these functions are not always clearly defined). While the results and procedures of this paper are offered independent of the metaheuristic context, we observe that metaheuristic algorithms can be employed to enhance the effectiveness of these clustering approaches in the same way that metaheuristic algorithms are used to enhance the K-Means and K-Medoid approaches. Conversely, there is a great potential to enhance the operation of metaheuristic algorithms by making use of clustering. Proposals of this type have been made, for example, to improve intensification and diversification strategies for tabu search and to refine the rules for selecting solutions to be combined by scatter search and path relinking (which could also apply to solutions combined by genetic algorithms).11 The notions underlying pseudo-centroid clustering may find applications in these areas as well. Compliance with Ethical Standards: Funding: This study was not funded. Conflict of Interest: The author declares that he has no conflict of interest. Ethical approval: This article does not contain any studies with human or animal participants. 10 The K-MinProduct problem can also be approached via the K-MinSum algorithm by using logarithms. The K-MinMedian problem is not to be confused with the K-median problem, which is based on a different concept relying on coordinate vectors. We can also define a K-MedianMedian algorithm, among other novel variants. 11 See, for example, Glover (1994, 1997) 29 References Anderberg, M. R. (1973) Cluster Analysis for Applications, Academic Press. Anwar, T. M., H. W. Beck and S. B. Navathe (1992) “Knowledge Mining by Imprecise Querying: A Classification-based Approach,” Proceedings of the Eighth International Conference on Data Engineering, IEEE Computer Society, Washington, D.C., pp. 622-630. Cao, B. and F. Glover (2010) “Creating Balanced and Connected Clusters to Improve Service Delivery Routes in Logistics Planning,” Journal of Systems Science and Systems Engineering, Vol. 19, No. 4, pp. 453-480. Cao, B., F. Glover and C. Rego (2015) “A tabu search algorithm for cohesive clustering problems,” Journal of Heuristics, Vol. 21, pp. 457–477. Davies, D. L. and D. W. Bouldin (1979) “A Cluster Separation Measure,” IEEE Transactions Pattern Analysis and Machine Intelligence 1, pp. 224-227. Estivill-Castro, V. and I. Lee (2001), Fast Spatial Clustering with Different Metrics and in the Presence of Obstacles. GIS’01, November 9 – 10, pp. 142 – 147. Fan, Bo (2009), A hybrid spatial data clustering method for site selection: The data driven approach of GIS mining. Experts Systems with Applications, 36, pp. 3923 – 3936. Glover, F. (1994) "Tabu Search for Nonlinear and Parametric Optimization (with Links to Genetic Algorithms)," Discrete Applied Mathematics, 49, pp. 231-255. Glover, F. (1997) “A Template for Scatter Search and Path Relinking,” in Artificial Evolution, Lecture Notes in Computer Science, 1363, J.-K. Hao, E. Lutton, E. Ronald , M. Schoenauer and D. Snyers, Eds. Springer, pp. 13-54. Huang, Z. (1998) “Extensions to the k-Means Algorithm for Clustering Large Data Sets with Categorical Values,“ Data Mining and Knowledge Discovery 2, pp. 283-304. Jain, A. K. and R.C. Dubes (1988) Algorithms for Clustering Data, Prentice-Hall, Englewood Cliffs, NJ. Karypis, G., V. Kumar (1998), A Fast and High Quality Multilevel Scheme for Partitioning Irregular Graphs. SIAM Journal of Scientific Computing 20, pp. 359 -- 392. Kauffmann, L. and P.J. Rousseeuw (1990) Finding Groups in Data – an Introduction to Cluster Analysis. Wiley. 30 Kochenberger, G., F. Glover, B. Alidaee and H. Wang (2005) “Clustering of Microarray data via Clique Partitioning,” Journal of Combinatorial Optimization, 10, pp. 77-92. Kwon, Y.-J., J. G. Kim, J. Seo, D. H. Lee, and D. S. Kim (2007), A Tabu Search Algorithm using Voronoi Diagram for the Capacitated Vehicle Routing Problem, Proceeding of 5th International Conference on Computational Science and Applications, IEEE Computer Society, pp. 480 – 485. MacQueen, J.B. (1967) “Some Methods for classification and Analysis of Multivariate Observations,” Proceedings of 5-th Berkeley Symposium on Mathematical Statistics and Probability", Berkeley, University of California Press, 1 pp. 281 -- 297. Ng, R. and J. Han (2002) “CLARANS: a Method for Custering Objects for Satial Data Mining,” IEEE Transactions Knowledge of Data Engineering 14(5), pp. 1003-1016. Paivinen, N. (2005) “Clustering with a minimum spanning tree of scale-free-like structure,”. Pattern Recognition Letters, 26(7) pp. 921–930. Park, H-S. and C-H. Jun (2009) “A simple and fast algorithm for K-medoids clustering,” Expert Systems with Applications 36, pp. 3336-3341. Ralambondrainy, H. (1995) “A conceptual version of the k-means algorithm,” Pattern Recognition Letters, 16:1147–1157. Shamsul, A., M. Inostroza-Ponta, L. Mathieson,, R. Berretta, and P. Moscato (2011) “Clustering Nodes in Large-Scale Biological Networks Using External Memory Algorithms,” In Xiang et al. (Eds.): ICA3PP 2011 Workshops, Part II, LNCS 7017, pp. 375–386. Strehl, A. and J. Ghosh (2002) “Relationship-Based Clustering and Visualization for HighDimensional Data Mining,” INFORMS Journal on Computing, pp. 1 – 23. Sudha, K.R., Y.B. Raju and A.C. Sekhar (2012) “Fuzzy C-Means clustering for robust decentralized load frequency control of interconnected power system with Generation Rate Constraint,” Electrical Power and Energy Systems 37, pp. 58-66. Xu, Y., V. Olman, and D. Xu (2001) “Minimum spanning trees for gene expression data clustering,” Genome Informatics, 12 pp. 24–33. 31 Appendix: Additional Supporting Methods and Pseudocode A. Diversity-Based Starting Methods 1. A Targeted Diversity-Based Starting Method to Produce More Compact Sets of Points A more elaborate variant of the Targeted Diversity-Based Starting Method stems from the observation that for some number of iterations, there are likely to be numerous ties for the point i' = arg min(Deviation(i): i  Io ), that is, there may be many points i' whose minimum distance from the points j  Ho is close to T (yielding Deviation(i') close to 0), and we would prefer to choose among them in a way that keeps the growing collection of points in H o compact. This potential for ties is particularly evident if we choose T to be the value MinD(i(k)) which is the final MaxMin value when the last element i(k o ) = i(k) is added to Ho by the Simple DiversityBased Starting Method. Since the point i(k) lies at a distance at least T = MinD(i(k)) from all other points in Ho , selecting i(k) as the starting point i(1) yields numerous points i for which Deviation(i) = |MinD(i) – T| is close to 0. As a result, a sequence of points chosen to populate Ho could initially resemble a straight line (and subsequently a bent line with gradual fill- in), whose endpoints get progressively farther away from the points added earlier. Such a “line configuration” would be encouraged, for example, by breaking ties in the choice of i' to favor points farthest from the most recent point i(k o ) added to Ho . We introduce two refinements as a basis for generating a more compact collection of points in Ho . First, we identify a target T and a starting point i(1) as follows. Relative to the set Ho = {i(ko ): ko = 1 to k} generated from an execution of the Simple Diversity-Based method or one of its refined variants, identify the min distance for each i = i(ko )  Ho from the other points in Ho , given by MinDo (i) = Min(d(i,j): j  Ho \ {i}). (This is effectively equivalent to the previous definition of MinD(i), since the latter is restricted to elements i not in Ho .) Then we identify the mean of these MinDo (i) values given by MeanMinD = ∑MinDo (i): i  Ho )/k Finally, we select the target T = MeanMinD and pick a point i# of Ho to become the new i(1) (to generate a new Ho ) whose MinDo (i) value is closest to MeanMinD: i# = arg min(|MinDo (i) – MeanMinD|: i  Ho ) The choice of T = MeanMinD and i(1) = i# to launch the targeted Diversity-Based Starting Method is then accompanied by introducing a tie-breaking rule for choosing i' that minimizes the maximum distance from the points currently in Ho . 32 For greater latitude of choice, we choose a small value To and require all qualifying points to belong to the set Io ' = {i  Io : Deviation(i) ≤ MinDev + To }, where we define MinDev = Min(Deviation(i): i  Io ) (hence all points that satisfy Deviation(i) = MinDev qualify to be chosen as i' in the Targeted Diversity-Based method). For example, To can be obtained by setting To = f∙T for is a small non-negative fraction f. (When f = 0 and hence To = 0, the set Io ' consists strictly of the points that qualify to be i' in the Simple Targeted Diversity-Based method.) Finally we define MaxD(i) = Max(d(i,j): j  Ho ) and choose i', the element to be added to Ho at each iteration, by i' = arg min(MaxD(i): i  Io '), thereby minimizing the maximum distance from points in Ho , given that i' lies in Io '. This gives the following method. Targeted Diversity-Based Starting Method with Flexible Tie-Breaking Initialization: Choose the point i(1) = i# and the target T = MeanMinD, and set ko = 1, Ho = {i(1)} and Io = N \ {i(1)}. For ko = 2 to k: Identify MinD(i) = Min(d(i,j): j  Ho ), Deviation(i) = |MinD(i) – T| for each i  Io , MinDev = Min(Deviation(i): i  Io ), Io ' = {i  Io : Deviation(i) ≤ MinDev + To } and for i  Io ', identify MaxD(i) = Max(d(i,j): j  Ho ). Choose i' = arg min(MaxD(i): i  Io ') and set i(ko ) = i', Ho := Ho  {i'} and Io := Io \ {i'} EndFor This approach likewise can be iterated, by choosing a new the target T = MeanMinD and starting point i(1) = i# from the Ho most recently generated. A natural variant of the method results by replacing MaxD(i) with SumD(i) = ∑(d(i,j): j  Ho ). The earlier Diversity-Based Starting Methods of Section 6 can similarly be modified to generate more compact sets of points by defining MaxMin = Max(MinD(i): i  Io ) and Io ' = {i  Io : MinD(i)  MaxMin – To }. Then as in the Targeted Tie-Breaking Approach above, for i  Io ' we identify MaxD(i) = Max(d(i,j): j  Ho ) and choose i' = arg min(MaxD(i): i  Io ') (or alternatively replace MaxD(i) with SumD(i)). The starting point i(1) = i# can also be used, without reference to the target T. 2. Successive Elimination Diversity-Based Starting Methods Another type of diversity-based starting methods employs a successive elimination strategy that shares an organization related to that of the Intensity-Based methods, except that it strictly aims to create a diverse set of points, again denoted by Ho , instead of to generate clusters at the same time. The basic strategy is as follows. 33 Initialization: Set No = N, no = n and Ho = . For ko = 1 to k: Apply an Elimination Choice Rule (as identified below) to select a point i'  No. and let Ho := Ho  {i'} and No := No \Proximity(i'), where Proximity(i') denotes the set of no /ko  points j  No \{i'} that are closest to i. . EndFor A trivial possibility for the Elimination Choice Rule would be to simply choose i' randomly from No . More interesting possibilities are as follows, where for each point i  No , let Proximity(i) be defined the same as the set Proximity(i'), i.e., the set of no /ko  points j  N o \{i} that are closest to i. Elimination Choice Rule. Let PC(i) = a PC-centroid of Proximity(i) according to the case in question, and let V(i) = Span(Proximity(i)). (For example, in the MinMax case, PC(i) is a point i* in Proximity(i) whose maximum distance from all other points in Proximity(i) is smallest, and V(i) = MaxDist(i*: Proximity(i).) Then choose i' in N o to be a point that gives a value of V(i) that is (a) largest, (b) smallest or (c) ‘closest to the mean’ of such values for i  No. Using an instance (a), (b) or (c) of the preceding rule, an iterated version of the method can be employed by successively restarting again from ko = 1, pre-selecting the value i' for ko = 1 to be the “final i' value” for ko = k (chosen at the end of the preceding iteration). In this iterated approach, a variation is to draw on ideas related to those of other Diversity-Based methods by redefining Proximity(i) after the first iteration (over ko = 1 to k) to consist not just of the no /ko  points j  No \{i} that are closest to i, but to encompass all points j  No such that d(i,j) ≤ U, where U is the mean or maximum d(i',j) value for j  Proximity(i') over i'  Ho on the previous iteration. After the first iteration of the method over ko = 1 to k, this approach requires less computation than determining the no /ko  points closest to i. Because of the increased speed of using a definition of Proximity(i) based on U instead of no /ko , a value of U may be selected earlier, after examining only one or a few ko values, and subsequently adjusted at each new iteration according to the numbers of elements admitted to Proximity(i) on the preceding iteration. Referring to U may exhaust all elements of N before Ho contains k elements, and if U is estimated to be of reasonable size, this may signal that k is selected too large. B. Intensity-Based Starting Methods 1. The Primary MinSum Starting Method We now consider the intensity-based starting method associated with the MinSum-centroid. In the following we omit explanatory comments for pseudocode that is made clear by the observations for the corresponding Primary MinMax Starting Method. 34 Primary MinSum Method Initialization: Begin with the ordered indexes i(1), i(2), …, i(n-1) for each i  N and set N o = N, no = n and δ(j) = True, j  N. For ko = k to 1 ClusterSize = no /ko  ScanSize = ClusterSize – 1 Execute the MinSum Distance Algorithm (At the conclusion: i* = arg min(Max (d(i,,j): j  C) (= MSSpan(C)) over all sets C  No such that |C| = ClusterSize.) Generate C(ko ) and update the set N o (This portion of the Primary MinSum Method is identical to that of the Primary MinMax Method, except that MSCentroid(ko ) = i* replaces MMCentroid(ko ) = i*.) Endfor The internal MinSum Distance algorithm is also nearly a replica of the internal MinMax Distance algorithm upon replacing BestDistance with a corresponding value BestSum. All arrays and values of the MinSum Distance Algorithm are shared with the Primary MinSum Starting Method. MinSum Distance Algorithm Conventions: BestSum = the MinSum value ∑(d(i,j): = d(i*,j) associated with the best candidate for i*. Initialization: BestSum = Large For i  N o : Sum = 0 Scan = 0 For s = 1 to n – 1 j = i(s) If (δ(j) = True) then Sum := Sum + d(i,j) Scan := Scan + 1 If (Scan = ScanSize) Break Endif Endfor If (Sum < BestSum) then i* = i BestSum = Sum Endif 35 Endfor An analog of Theorem 1 applies to this Primary MinSum Starting Method, which we do not bother to state here. 2. Advanced Intensity-Based Starting: The Adaptive MinSum Starting Method The description of the “external” portion of the Adaptive MinSum method, given next, is nearly identical to that of the Adaptive MinMax Starting Method. However, the internal Adaptive Phase 1 and Phase 2 algorithms differ more significantly from the MinMax case, as indicated below. Adaptive MinSum Method Initialization: Begin with the ordered indexes i(1), i(2), …, i(n-1) for each i  N and set N o = N, no = n and δ(j) = True, j  N. For ko = k to 1 MinSize = no /ko  MaxSize = no – MinSize∙(ko – 1) MinScan = MinSize – 1 MaxScan = MaxSize – 1 Execute the Phase 1 MinSum Algorithm (to identify BestSum and associated values) Execute the Phase 2 MinSum Algorithm (to identify i*) Generate C(ko ) and update the set No (This portion of the Adaptive MinSum Method is identical to that of the Primary MinSum Method, except that “If (Scan = BestScan) Break” replaces “If (Scan = ScanSize) Break”.) Endfor Phase 1 MinSum Algorithm Assumption: No contains at least 2 elements BestDistance = Large BestMinGap = 0 BestSum = Large For i  N o MinGap = Large Sum = 0 SumGap = 0 Scan = 0 For s = 1 to n – 1 j = i(s) 36 If (δ(j) = True) then Scan := Scan + 1 Distance = d(i,j) Sum := Sum + Distance If (Scan > 1) then Gap = Distance – PreviousDistance SumGap = SumGap + Gap MinGap = Min(Gap,MinGap) Endif If (Scan = MinScan) then Sum(i) = Sum (initialize Phase 2 at Sum = Sum(i)) s(i) = s (initialize Phase 2 at s = s(i)) Break Endif PreviousDistance = Distance Endif Endfor If ((Sum < BestSum) or ((Sum = BestSum) and (Distance < BestDistance)) or ((Sum = BestSum) and (Distance = BestDistance) and (MinGap > BestMinGap)) ) then BestSum = Sum BestDistance = Distance BestSumGap = SumGap BestMinGap = MinGap Endif Endfor BestMeanGap = BestSumGap/(MinScan – 1) TargetGap = λ∙BestMeanGap + (1 – λ)∙BestMinGap) (suggested default, λ = .3) (The following 3 values are inherited to apply for each i  N o in Phase 2) DistanceLimit = BestDistance + TargetGap (applies to MinMax version) FirstSumLimit = BestSum + TargetGap DeltaSum = DistanceLimit Phase 2 Adaptive MinSum Algorithm Conventions: Sum = Sum d(i,j) using the ordered scanning of elements from i  N o BestSum = the Sum value for the current best candidate for i*. DistanceLimit = the largest distance allowed for d(i,j) when scanning from element i. SumLimit = the limit on Sum, increasing by DeltaSum at each Scan > MinScan BestScan = the value of Scan that produces the best candidate for i*. Inherited from Phase 1: 37 DistanceLimit, FirstSumLimit, DeltaSum and s(i), Sum(i), i  No Initialization: BestDistance = Large BestScan = Large BestSum = Large For i  N o Scan = MinScan – 1 (Scan will be immediately incremented to MinScan) SumLimit = FirstSumLimit Sum = Sum(i) For s = s(i) to n – 1 j = i(s) If (δ(j) = True) then (automatically true for s = s(i)) Scan := Scan + 1 (reaches MinScan on first execution when s = s(i)) If (Scan > MinScan) then Sum := Sum + d(i,j) SumLimit := SumLimit + DeltaSum Endif If (Sum > SumLimit) then Scan := Scan – 1 Break (exit the “For loop”) Endif If (Scan = MaxScan) Break Endif Endfor If (Scan  MinScan) then (i is a candidate for i*) If ((Scan > BestScan) or ((Scan = BestScan) and (Sum < BestSum))) then i* = i BestSum = Sum BestScan = Scan Endif Endif Endfor The analog of Theorem 2 and its proof that applies to the Adaptive MinSum Starting Method gives BestSum the role taken by BestDisance, but otherwise establishes the same double layer of priorities to assure the final C best (v*) (for v* = BestScan + 1) and its associated point i* give the cluster and MinSum-centroid we seek. 38
8cs.DS
1 Automatic Pavement Crack Detection Based on Structured Prediction with the Convolutional Neural Network arXiv:1802.02208v1 [cs.CV] 1 Feb 2018 Zhun Fan, Senior Member, IEEE, Yuming Wu, Jiewei Lu, and Wenji Li Abstract—Automated pavement crack detection is a challenging task that has been researched for decades due to the complicated pavement conditions in real world. In this paper, a supervised method based on deep learning is proposed, which has the capability of dealing with different pavement conditions. Specifically, a convolutional neural network (CNN) is used to learn the structure of the cracks from raw images, without any preprocessing. Small patches are extracted from crack images as inputs to generate a large training database, a CNN is trained and crack detection is modeled as a multi-label classification problem. Typically, crack pixels are much fewer than non-crack pixels. To deal with the problem with severely imbalanced data, a strategy with modifying the ratio of positive to negative samples is proposed. The method is tested on two public databases and compared with five existing methods. Experimental results show that it outperforms the other methods. Index Terms—Pavement crack detection, convolutional neural network, deep learning, structured prediction, multi-label classification, imbalanced data. I. I NTRODUCTION P AVEMENT distress detection is a significant step for pavement management [1]. The goal is to obtain the pavement condition information for maintenance. Cracking is the most common type of pavement distress. Since automated crack detection systems are safer, lower costing, more efficient, and more objective, the research about them has attracted wide attention from both the academy and the industry [2], [3]. Automated crack detection is a challenging task. In the past few decades, image based algorithms of crack detection have been widely discussed. In early studies, methods are mostly based on combination or improvement of conventional digital image processing techniques, like thresholding [4], mathematical morphology [5], and edge detection [6]. These methods are generally based on photometric and geometric hypotheses about properties of crack images [7]. The most distinguished photometric property is that crack pixels are the darker pixels in an image. Based on that, threshold value is determined globally or locally to segment cracks and background [4], [8], [9]. However, these approaches are very sensitive to noise as they are performed on individual pixels. In order to overcome this problem, other methods take geometric information into account. For instance, the continuity property of cracks is considered to reduce the false detection [5]. Local binary Zhun Fan, Yuming Wu and Jiewei Lu are with the Guangdong Provincial Key Laboratory of Digital Signal and Image Processing, College of Engineering, Shantou University, Shantou 515063, China (email: zfan, 16ymwu1, [email protected]). pattern operator is used to determine whether a pixel belongs to cracks based on the local orientation [10]. Wavelet transform is applied to separate crack regions and crack free regions with multi-scale analysis [11]. These methods detect cracks efficiently, but they are not precise enough for finding all the cracks in an image. More recent works have been proposed to improve the accuracy of the detection method, and can be sorted into the following several branches. Minimal Path Based Methods: Minimal path problem is to find best paths between nodes of a graph. Several methods based on the minimal path principle are proposed. Kaul et al. propose an algorithm that can find an open curve without knowing either the endpoints or topology of the curve [12]. Nguyen et al. take brightness and connectivity into account simultaneously to provide features of anisotropic cracks along free-form paths [13]. Amhaz et al. propose strategies to select endpoints at a local scale and to select minimal paths at the global scale [14]. These methods utilize distinguished features of crack pixels in a global view. However, the drawback is that they are too computationally intensive for practical applications. Machine Learning: With the development of machine learning, several methods focusing on feature extraction and pattern recognition have been proposed for crack detection [15]–[18]. In CrackIT [16], Oliveira et al. use the mean and the standard deviation for unsupervised learning to distinguish blocks with crack from blocks without crack. Cord et al. use AdaBoost to select textural descriptors that can describe crack images [17]. In CrackForest [18], Shi et al. propose a new descriptor based on random structured forests to characterize cracks. The performance of these methods are great but very dependent on the extracted features. However, due to complicated pavement conditions, it is hard to find features effective for all pavements. Deep Learning: For image classification tasks, deep learning has been proven to work better than traditional machine learning methods [19]. Recently, deep learning methods are successfully applied on damage and distress detection [20]– [23]. Cha et al. use a sliding window to divide the image into blocks and CNN is used to predict whether the block contains cracks or not [20]. But the method can only find patch level cracks without considering the pixel level. In [23], Zhang et al. use CNN to predict whether an individual pixel belongs to crack based on the local patch information. However, the method ignores the spatial relations between pixels and overestimates crack width. In [21], Zhang et al. use CNN to 2 Fig. 1. Two examples of structured prediction based on CNN. (a) Two pixel examples of the original image. (x1 , y1 ), (x2 , y2 ) are the coordinate of the pixel. (b) The extracted patches centered on the pixels. In the method the size of the patches is 27 × 27. (c) The structured prediction results of CNN with the patches input. (c1 ) is obtained from (b1 ) and (c2 ) is obtained from (b2 ). In the method the size of the output structure is 5 × 5. (d) The probability map obtained by applying structured prediction on all pixels. predict class for each pixel of the image. However, it still needs manually designed feature extractors for preprocessing, and CNN is only used as a classifier. Besides, its network architecture is strictly related to the input image size, which prevents generalization of the method. Since CNN can extract good features from raw data, this paper propose a CNN based method that can learn the crack structure of a small patch within an image to find the whole crack on pixel level without preprocessing. Specifically, patches are exacted on each individual pixel of a raw image to build a training database. Then a CNN architecture is proposed for structured prediction as a multi-label problem [24]. Since crack pixels are much less than non-crack pixels in a typical image, applying structured prediction directly can hardly obtain a satisfied result. To solve the multi-label classification problem with imbalanced samples, we propose a strategy with modifying the ratio of positive to negative training samples. After training, the CNN can predict the centered structure of each input patch. Then all structure results of an image are summed to obtain a probability output, which reflects the condition of pavement generally, as shown in Fig. 1. Finally a decision threshold is set to obtain a binary output. The proposed method is compared with traditional methods like Canny [25] and local thresholding [26], and the state-of-art methods like Free-Form Anisotropy (FFA) [13], CrackForest [18], and Minimal Path Selection (MPS) [14]) to validate its effectiveness. The contributions of the paper are the following: 1) apply CNN based structured prediction on crack detection and obtain an outstanding performance; 2) propose a strategy to solve the multi-label classification problem with imbalanced samples and analyze its influence. This paper is organized as the following. Section II describes the implementing details of the convolutional neural network, including data preparation, the architecture of CNN and training details. Section III gives the results and evaluations. Section IV describes the structured prediction in detail. Section V describes the influence of the imbalanced samples and the strategy to deal with it. The generalization of the method is discussed in Section VI. Conclusions and perspectives are given in Section VII. Fig. 2. The extracted patch centered on pixel (x, y). h is the distance between the edges and the center. Thus the size of the patch is (2h + 1) × (2h + 1). II. T HE M ETHOD A. Data Preparation The proposed method is trained and tested on two databases: CFD [18]1 with RGB images and AigleRN [7]2 with gray-level images. The CFD database contains 118 RGB images with a resolution of 320 × 480 pixels. All images are taken by an iphone5 from pavements of Beijing, China. These images contain noises such as shadows, oil spots and water stains, and have non-uniform illumination. We use 72 images for training and 46 images for testing. The AigleRN database contains 38 gray-level images, which have been collected on French pavement and have been pre-processed to reduce the nonuniform illumination. Compared to the images in CFD, the pavement images in AigleRN are with more complex texture. We use 24 images for training and 14 images for testing. The input of the network are patches extracted from images based on each specific pixel, as shown in Fig. 2. In this work, we set the patch size as 27 × 27 and thus h = 13. Typically, RGB images with 3 channels and gray-level images with 1 channel are used as input of the network. So we propose a network with 3 channels input and a network with 1 channel input respectively. In a typical crack image, non-crack pixels are a lot more than crack pixels. For a classification task with imbalanced samples, the proportion of positive and negative samples has a great impact on the network performance. Specifically, according to the manually labeled ground truth, if the center pixel of the extracted patch is a crack pixel, the corresponding 1 https://github.com/cuilimeng/CrackForest-dataset 2 https://www.irit.fr/∼Sylvie.Chambon/Crack Detection Database.html 3 Fig. 3. Example of negative (left) and positive (right) 27×27 training patches extracted from the CFD database. TABLE I T RAINING DATABASE CFD Image dimensions Images Positive patches Negative patches Total patches Positive : Negative 320×480 Training 72 185,483 556,449 741,932 1:3 Testing 46 107,112 6,958,488 7,065,600 1:65 we use s to denote the size of the output structure. Thus s = 5 as shown in Fig. 1(c). The s × s window is flattened into s2 neurons in the network, as the output layer of the CNN shown in Fig. 4, and is fully connected to the second last layer. Thus the structured prediction problem is modeled as an multi-label problem and s2 labels are from the corresponding ground truth. Details about the multi-label problem is discussed in Section IV. For a multi-label classification problem, sigmoid function is the commonly used activation function for the output. Except the output units, all hidden layers are equipped with Rectified Linear Units (ReLU) [28] for dealing with nonlinearity. C. Training and Testing AigleRN 991×462/311×462 Training 24 39,208 117,624 156,832 1:3 Testing 14 42,317 4,168,351 4,210,668 1:98.5 patch is a positive sample and vice versa. To modify the proportion and keep the samples uniform, for training, all positive samples are extracted first. Then negative samples are extracted randomly according to the setting proportion. Generally, the ratio of positive to negative samples is set to 1:3, which is discussed in Section V. Then the training database can be obtained as shown in Fig. 3. In testing procedure, all pixels from an image are used and symmetric padding is used to deal with the boundary of the image. As a result, we can obtain all samples from an image in testing. For instance, 153,600 samples can be obtained in a 320×480 image. Details of the training and testing database are shown in Table I. Data with zero mean and equal variance is preferred for optimization in machine learning. For image input, a common practice is scaling the raw data from [0, 255] to [-1, 1]. This preprocessing is adopted our work. B. Network Architecture Typical CNN contains convolutional layers, max-pooling layers and fully-connection (FC) layers. The proposed network has 4 convolutional layers with 2 max-pooling layers and 3 FC layers. The architecture of the network is illustrated in Fig. 4 and Table II. Extracted patches are used as input of the network with 3 channels in CFD and 1 channel in AigleRN. All convolutional layers are equipped with kernel of 3 × 3 and stride of 1, whose effectiveness has been verified in VGG-Net [27]. Zeros padding on the boundary of each convolutional layer is assigned to preserve the spatial resolution of resulting feature maps after convolution. Max pooling is performed with stride 2 over a 2 × 2 window. As shown in Fig. 1, the output of the network is a prediction of the structure centered in the input patch. For generalization, In a multi-label problem, all output units are not mutually exclusive, which means that more than one positive output may exist at the same time. In this case, cross entropy is commonly used in the loss function, which is defined as: 2 L=− s X (yi log yˆi + (1 − yi ) log(1 − yˆi )) i=1 where yi and yˆi are the label and prediction of the ith output unit, respectively; s2 is the number of labels. To prevent the network from overfitting, weight decay is adopted in the paper to penalize the large weights. The L2 penalty term is added to the loss function and loss L0 used for optimization is: 1X 2 Wj L0 = L + β · 2 j where L is the cross entropy function, β is the L2 penalty factor and Wj is the jth weight in the network, including weights in convolutional layers and FC layers. β is set to 0.0005 in the experiment. Dropout [29] is also a simple and effective approach for preventing overfitting. During training, value of hidden neurons is set to zero randomly. It is applied on the first two FC layers and the dropout ratio is set to 0.5. Weights in convolutional layers and FC layers are initialized using Xavier method [30]. Adam [31] is adopted as the optimizer with default setting in the original paper (learning rate set to 0.001). The batch size for each iteration is set to 256, and 20,000 iterations (43 epochs) in AigleRN and 30,000 iterations (13 epochs) in CFD are conducted. In testing, each pixel is used for generating an input patch, so input patches overlap, leading to overlap of output windows. Typically, s2 decisions can be obtained from a pixel except that it is near the boundary. Then for a testing image, all outputs from a pixel are summed and normalized to [0,1]. As a result, we can obtain a probability map from the results of all the pixels of an image. III. R ESULTS The network is programmed under TensorFlow. All experiments are conducted on the workstation with Intel Xeon E52690 2.9GHz CPU, 64GB RAM and Nvidia Quadro K5000 GPU. 4 Fig. 4. An illustration of the CNN architecture. The leftmost image is the input patch with 3 channels. Other cubes indicate the feature maps obtained from convolution (Conv) or max pooling. All convolutional layers are with kernel of 3 × 3, stride 1 and zeros padding. Max pooling is performed with stride 2 over a 2 × 2 window. TABLE II A RCHITECTURE OF THE CNN. L AYER NAMES ARE F OLLOWED BY N UMBERS OF F EATURE M APS . S QUARE B RACKETS S PECIFY K ERNEL S IZE , S TRIDE AND PADDING . Input → conv16 [3×3,1,1] → conv16 [3×3,1,1] → maxpool [2×2,2,0] → conv32 [3×3,1,1] → conv32 [3×3,1,1] → maxpool [2×2,2,0] → FC64 → FC64 → FC25 A. Evaluation We test the performance of the network on test images. For evaluation, precision (P r), recall (Re) and F1 score (F 1) are introduced, which are commonly used in classification problems, and defined as: TP TP + FP TP Re = TP + FN 2 × P r × Re F1 = P r + Re where T P , F P , F N are the numbers of true positive, false positive and false negative respectively. Considering that the ground truth is subjective manually labels and there are transitional areas between crack pixels and non-crack pixels in real images, small distance between the detected result and the reference, which is 2 pixels in [14] and 5 pixels in [18], is accepted for evaluation. We accept 2 pixels in the paper. Pr = B. Results on CFD Exemplar detections on CFD are shown in Fig. 5. The output of the network is a probability map as shown on the third row. Whiter color indicates that the pixel is more likely to be a crack pixel. Then the decision probability is set to 0.5 to remove the pixels with low probability, and a binary output is obtained. It can be observed that only few pixels are removed from binarization. The reason is that the contrast between the detected crack pixels and the detected non-crack pixels in the probability map is high. According to the output images in Fig. 5, our method can effectively deal with complex background and complex crack topology. Fig. 6 and Table III shows the comparison with some other algorithms. It can be observed that the two traditional methods Fig. 5. Part of crack detection results by the proposed method (from top to bottom: original image, ground truth, probability map, binary output). are not suitable for crack detection as they are sensitive to noises. Since both CrackForest and the proposed method are supervised learning methods, we generate the same training and testing databases for them. Notice that crack width is overestimated in CrackForest, leading to the high recall but low precision as shown in Table III. Evaluation results shown in Table III indicate that the proposed method outperforms CrackForest. 5 Fig. 6. Results comparing on CFD (from left to right: original image, ground truth, Canny, local thresholding, CrackForest, the proposed method). TABLE III C RACK D ETECTION R ESULTS E VALUATION ON CFD Canny Local thresholding CrackForest The proposed method Pr Re F1 0.4377 0.7727 0.7466 0.9119 0.7307 0.8274 0.9514 0.9481 0.4570 0.7418 0.8318 0.9244 TABLE IV C RACK D ETECTION R ESULTS E VALUATION ON A IGLE RN Canny Local thresholding FFA MPS The proposed method Pr Re F1 0.1989 0.5329 0.7688 0.8263 0.9178 0.6753 0.9345 0.6812 0.8410 0.8812 0.2881 0.6670 0.6817 0.8195 0.8954 C. Results on AigleRN Fig. 7 and Table IV present the results of different algorithms on AigleRN. It is again observed that the two traditional methods are sensitive to noise and fail to find the continuous cracks. FFA can find some cracks in a local scale, but can hardly find all the continuous cracks. MPS is more effective to find the continuous cracks on a global view. Compared to MPS, our proposed method can find the cracks with better precision and higher recall. From image results, it is clear that the proposed method outperforms the others. IV. O UTPUT S TRUCTURE Generally, CNN is used for classification [19]. Typical classification problems contain single-label classification and multi-label classification. In a single-label classification problem, a sample can only be classified into one class. For example, in [23], crack detection is modeled as a binary classification problem and a pixel is classified as a crack pixel or a non-crack pixel based on its neighbouring information. However, in a multi-label classification problem, a sample can be classified into more than one class. Structured prediction based on CNN, modeled as a multi-label classification problem, is quite a new idea [24]. The method utilizes the information of a patch to predict not only the centered pixel but the centered structure. This operation takes the spacial relations between pixels into account, i.e., a crack pixel is more likely to be neighboured by another crack pixel and vice versa. In this experiment, we explore the performance of the structured prediction. The size of the output structure is denoted by s. Results presented are obtained for s = 1, 3, 5, 7, i.e., the number of output units is set to 1, 9, 25, 49, respectively. Other configurations remain unchanged. Specifically, for s = 1, the model is simplified to the pixel classification problem similar to [23]. The performance with different sizes of output structure is shown in Fig. 8. From Fig. 8, it can be observed that all results for structured prediction, particularly for s = 5, are better than that for pixel classification. To identify the difference between the structured prediction and the pixel classification, we present the probability maps for s = 1 and s = 5, as shown in Fig. 9. Both of them can detect the cracks but pixel classification is much more sensitive to noises. This is natural when considering the procedure of patches extraction and classification. Classifying a pixel based on its neighbouring information is the original design. However, the network is essentially classifying the patches in the procedure. Thus, limited by samples, it may be trapped in overfitting and misunderstand the classification problem. For example, if the mean of the extracted patches distinguishes between positive samples and negative samples, CNN may essentially turn to a classifier of patches based on the mean. The mean is a good feature for patches but is not enough to classify the pixel, since it is sensitive to the interference like non-uniform illumination. It is very confusing as we can not ensure what is CNN based on to classify the patches. Structured prediction can solve this problem to some extent, as it aims to predict several outputs at the same time. The outputs between patch to patch differ slightly based on the labels. Therefore, the network can not rely on single feature 6 Fig. 7. Results of different methods on AigleRN (from left to right: original image, ground truth, Canny, local thresholding, FFA, MPS, the proposed method). to accurately predict all outputs of a patch. This prevents the network from misunderstanding the problem. Another explanation is for the testing procedure. In pixel classification, only one decision is obtained from the network for a pixel. However, in structured prediction, s2 decisions can be obtained for a pixel by scanning all pixels through the whole image. These decisions are summed to obtain a more accurate result. Besides, normalizing the whole output image to [0,1] gives a global view to smooth the detected pixels. V. R ATIO OF P OSITIVE TO N EGATIVE S AMPLES Applying structured prediction directly can hardly obtain a satisfying result. As is shown in Table I, crack pixels are much fewer than non-crack pixels in typical crack images. The ratio of positive to negative samples is down to 1:65 in CFD, and even down to 1:98.5 in AigleRN. In such a classification task with severely imbalanced samples, the ratio of positive to negative has a great impact on the training results. To clarify the problem, assume that the natural ratio(i.e., 1:65) is used in training, if the predicted results of CNN are all negative, i.e., it predicts all pixels to be non-crack pixels, it can obtain a high accuracy as 65/(65 + 1) = 0.985. Thus if no treatment is conducted to deal with imbalanced data, the network prefers predicting negative results in training, which would lead to overestimation of the number of non-crack pixels in testing, as shown in Fig. 11. Typically, in a multi-label problem, one output unit represents one class. Specifically in our method, an output unit represents a pixel on the particular position. For output units, a significant characteristic is that if a crack pixel appears, it is likely to find crack pixels on other units. Based on this characteristic, we introduce the terms positive sample and negative sample that used in binary classification, as we just care about the probabilities of crack pixels and non-crack 7 Fig. 8. Precision, recall and F1 score value variations with different sizes of output structure. Testing on CFD and AigleRN respectively. Fig. 10. Precision, recall and F1 score value variations with different ratios of positive to negative samples. Testing on CFD and AigleRN respectively. Fig. 9. Example probability maps with s = 1 (middle) and s = 5 (right) for the original image (left). (a) Original image (b) R = 1 pixels appearing. The particular position is not so important. According to the patch extraction procedure, we define an input extracted from a crack pixel as a positive sample, and an input extracted from a non-crack pixel as a negative sample. Experiments are conducted to make a thorough investigation on the influence of the ratio. In the experiment, the total number of positive samples and negative samples are kept constant, and the ratio of positive to negative samples is modified. The ratio R is defined as: (c) R = 3 (d) R = 5 (e) R = 59 (f) Natural(R = 184) R= negative samples positive samples For example, if we keep the number of total samples to be 120, R = 1 means 60 positive samples and 60 negative samples, while R = 2 means 40 positive samples and 80 negative samples. We set the number of total training samples to be 360,000 for CFD and 60,000 for AigleRN. All training samples are generated from training dataset randomly, and we test the model with different training conditions on the whole testing dataset. The result is shown in Fig. 10. From Fig. 10, upward trend of precision and downward trend of recall can be clearly seen. The reason is that increasing negative samples in training would evidently increase the probability of negative prediction of the model, as is discussed above. This can be observed more clearly from Fig. 11. With higher R in training, the model overestimate the number of the non-crack pixels, which leads to higher precision and lower Fig. 11. Results of the network with different ratios of positive to negative samples in training. Natural means all samples are extracted randomly. recall. F1 score varies accordingly. Besides, precision and recall are computed according to manual labels, which are different from database to database. Since cracks in ground truth of CFD are wider than those of AigleRN generally, the best ratios for different database are different. From Fig. 10, the acceptable range of R is 2 6 R 6 5 for CFD and 2 6 R 6 3 for AigleRN. VI. G ENERALIZATION S TUDY From results shown in Section III, we can see that the model works efficiently on CFD database and AigleRN database, 8 Fig. 12. Examples of cross database testing. From left to right on the top (training/testing): original image, CFD/CFD, AigleRN/CFD, Hybrid/CFD. From left to right on the bottom: original image, AigleRN/AigleRN, CFD/AigleRN, Hybrid/AigleRN. All outputs are probability maps. TABLE V C ROSS DATABASE T ESTING Test AigleRN CFD AigleRN P r = 0.9178 Re = 0.8812 F 1 = 0.8954 P r = 0.9651 Re = 0.3832 F 1 = 0.4812 CFD P r = 0.6488 Re = 0.8819 F 1 = 0.7182 P r = 0.9119 Re = 0.9481 F 1 = 0.9244 Hybrid P r = 0.9042 Re = 0.8448 F 1 = 0.8677 P r = 0.9018 Re = 0.9494 F 1 = 0.9210 Train respectively. In this section, the generalization of the model is discussed. In practical applications, different data acquisition systems bring different types of data. Besides, conditions of pavements differ from road to road. We conduct cross database testing on the two databases to confirm the validation of the model generalization. We conduct three experiments: training on CFD and testing on AigleRN, training on AigleRN and testing on CFD, and training and testing on a hybrid database. In the first two experiments, the training and testing databases generated previously are used. For the hybrid database, we take half of both training databases to generate a new training database and test on the other images. The examples of results are shown in Fig. 12 and the evaluations are shown in Table V. It is observed that in cross testing, cracks detected by the model trained on AigleRN are very thin, leading to low recall and high precision, and the opposite is true for the model trained on CFD. In addition, a hybrid data training can make a trade-off. Moreover, results from hybrid data training suggest that with more data from different pavement conditions, CNN can learn better to predict cracks for different roads with the same architecture. VII. C ONCLUSION AND P ERSPECTIVES In this paper, an effective method based on CNN is proposed for pavement crack detection. Compared with other state-of- art methods, the proposed method shows a better performance in terms of dealing with different pavement texture. After training, the model can predict cracks close to the manual labels. This evidently shows that deep learning methods have potential for crack structure prediction. The network can learn from raw images without any preprocessing and output very satisfactory results. With training and testing on different databases, we observe a good generalization of the model. With hybrid data training, the potential of a general model for different conditions of pavements may be brought out. Since CNN has a good learning ability for images, the network architecture can also be considered for other types of data, such as laser and 3D camera images, which are commonly obtained from systems of pavement distress detection. Moreover, from cross testing we can see the influence of the manual labels to the detection results. As shown in experiments, thinner crack labels lead to thinner crack outputs. This is basically because labelling still limited by judgements of human experts. Our main perspective is to develop Semisupervised or unsupervised learning methods to break through the limitations of human judgments. R EFERENCES [1] H. Zakeri, F. M. Nejad, and A. Fahimifar, “Image based techniques for crack detection, classification and quantification in asphalt pavement: a review,” Archives of Computational Methods in Engineering, vol. 24, no. 4, pp. 935–977, 2017. [2] Q. Zou, Y. Cao, Q. Li, Q. Mao, and S. Wang, “Cracktree: Automatic crack detection from pavement images,” Pattern Recognition Letters, vol. 33, no. 3, pp. 227–238, 2012. [3] D. Zhang, Q. Li, Y. Chen, M. Cao, L. He, and B. Zhang, “An efficient and reliable coarse-to-fine approach for asphalt pavement crack detection,” Image and Vision Computing, vol. 57, pp. 130–146, 2017. [4] H. Oliveira and P. L. Correia, “Automatic road crack segmentation using entropy and image dynamic thresholding,” in Proc. Eur. Signal Process. Conf., 2009, pp. 622–626. [5] N. Tanaka and K. Uematsu, “A crack detection method in road surface images using morphology.” in Proc. Workshop Mach. Vis. Appl., vol. 98, 1998, pp. 17–19. [6] H. Zhao, G. Qin, and X. Wang, “Improvement of canny algorithm based on pavement edge detection,” in Proc. Int. Conf. Image, Signal process., vol. 2. IEEE, 2010, pp. 964–967. [7] S. Chambon and J.-M. Moliard, “Automatic road pavement assessment with image processing: Review and comparison,” International Journal of Geophysics, vol. 2011, 2011. 9 [8] J. Tang and Y. Gu, “Automatic crack detection and segmentation using a hybrid algorithm for road distress analysis,” in Proc. Int. Conf. Syst., Man, Cybern. IEEE, 2013, pp. 3026–3030. [9] Q. Li and X. Liu, “Novel approach to pavement image segmentation based on neighboring difference histogram method,” in Proc. Int. Conf. Image, Signal process., vol. 2. IEEE, 2008, pp. 792–796. [10] Y. Hu and C.-x. Zhao, “A local binary pattern based methods for pavement crack detection,” Journal of Pattern Recognition Research, vol. 1, no. 20103, pp. 140–147, 2010. [11] P. Subirats, J. Dumoulin, V. Legeay, and D. Barba, “Automation of pavement surface crack detection using the continuous wavelet transform,” in Proc. Int. Conf. Image Process. IEEE, 2006, pp. 3037–3040. [12] V. Kaul, A. Yezzi, and Y. Tsai, “Detecting curves with unknown endpoints and arbitrary topology using minimal paths,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, no. 10, pp. 1952– 1965, 2012. [13] T. S. Nguyen, S. Begot, F. Duculty, and M. Avila, “Free-form anisotropy: A new method for crack detection on pavement surface images,” in Proc. Int. Conf. Image Process. IEEE, 2011, pp. 1069–1072. [14] R. Amhaz, S. Chambon, J. Idier, and V. Baltazart, “Automatic crack detection on two-dimensional pavement images: An algorithm based on minimal path selection,” IEEE Transactions on Intelligent Transportation Systems, vol. 17, no. 10, pp. 2718–2729, 2016. [15] P. Delagnes and D. Barba, “A markov random field for rectilinear structure extraction in pavement distress image analysis,” in Proc. Int. Conf. Image Process., vol. 1. IEEE, 1995, pp. 446–449. [16] H. Oliveira and P. L. Correia, “Automatic road crack detection and characterization,” IEEE Transactions on Intelligent Transportation Systems, vol. 14, no. 1, pp. 155–168, 2013. [17] A. Cord and S. Chambon, “Automatic road defect detection by textural pattern recognition based on adaboost,” Computer-Aided Civil and Infrastructure Engineering, vol. 27, no. 4, pp. 244–259, 2012. [18] Y. Shi, L. Cui, Z. Qi, F. Meng, and Z. Chen, “Automatic road crack detection using random structured forests,” IEEE Transactions on Intelligent Transportation Systems, vol. 17, no. 12, pp. 3434–3445, 2016. [19] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems, 2012, pp. 1097–1105. [20] Y.-J. Cha, W. Choi, and O. Büyüköztürk, “Deep learning-based crack damage detection using convolutional neural networks,” Computer-Aided Civil and Infrastructure Engineering, vol. 32, no. 5, pp. 361–378, 2017. [21] A. Zhang, K. C. Wang, B. Li, E. Yang, X. Dai, Y. Peng, Y. Fei, Y. Liu, J. Q. Li, and C. Chen, “Automated pixel-level pavement crack detection on 3D asphalt surfaces using a deep-learning network,” Computer-Aided Civil and Infrastructure Engineering, vol. 32, no. 10, pp. 805–819, 2017. [22] K. Gopalakrishnan, S. K. Khaitan, A. Choudhary, and A. Agrawal, “Deep convolutional neural networks with transfer learning for computer vision-based data-driven pavement distress detection,” Construction and Building Materials, vol. 157, pp. 322–330, 2017. [23] L. Zhang, F. Yang, Y. D. Zhang, and Y. J. Zhu, “Road crack detection using deep convolutional neural network,” in Proc. Int. Conf. Image Process. IEEE, 2016, pp. 3708–3712. [24] P. Liskowski and K. Krawiec, “Segmenting retinal blood vessels with deep neural networks.” IEEE transactions on medical imaging, vol. 35, no. 11, pp. 2369–2380, 2016. [25] J. Canny, “A computational approach to edge detection,” IEEE Transactions on Pattern Analysis and Machine Intelligence, no. 6, pp. 679–698, 1986. [26] W. Niblack, An introduction to digital image processing. Strandberg Publishing Company, 1985. [27] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. [28] V. Nair and G. E. Hinton, “Rectified linear units improve restricted boltzmann machines,” in Proc. Int. Conf. Mach. Learn., 2010, pp. 807– 814. [29] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting.” Journal of Machine Learning Research, vol. 15, no. 1, pp. 1929–1958, 2014. [30] X. Glorot and Y. Bengio, “Understanding the difficulty of training deep feedforward neural networks,” in Proc. Int. Confe. Art. Intell., Stat., 2010, pp. 249–256. [31] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014.
1cs.CV
arXiv:1802.09904v3 [cs.AI] 25 Mar 2018 Ab initio Algorithmic Causal Deconvolution of Intertwined Programs and Networks by Generative Mechanism∗ Hector Zenil1,2,3,4 , Narsis A. Kiani1,2,3,4 , Jesper Tegnér2,3,5 1 Algorithmic Dynamics Lab, Centre for Molecular Medicine, Karolinska Institute, Stockholm, Sweden 2 Unit of Computational Medicine, Department of Medicine, Karolinska Institute, Stockholm, Sweden 3 Science for Life Laboratory, SciLifeLab, Stockholm, Sweden 4 Algorithmic Nature Group, LABORES for the Natural and Digital Sciences, Paris, France 5 Biological and Environmental Sciences and Engineering Division, Computer, Electrical and Mathematical Sciences and Engineering Division, King Abdullah University of Science and Technology (KAUST), Kingdom of Saudi Arabia {hector.zenil, narsis.kiani, jesper.tegner}@ki.se Abstract To extract and learn representations leading to generative mechanisms from data, especially without making arbitrary decisions and biased assumptions, is a central challenge in most areas of scientific research particularly in connection to current major limitations of influential topics and methods of machine and deep learning as they have often lost sight of the model component. Complex data is usually produced by interacting sources with different mechanisms. Here we introduce a parameter-free model-based approach, based upon the seminal concept of Algorithmic Probability, that decomposes an observation and signal into its most likely algorithmic generative mechanisms. Our methods use a causal calculus to infer model representations. We demonstrate the method ability to distinguish interacting mechanisms and deconvolve them, regardless of whether the objects produce strings, space-time evolution diagrams, images or networks. We numerically test and evaluate our method and find that it can disentangle observations from discrete dynamic systems, random and complex networks. We think that these causal inference techniques can contribute as key pieces of information for estimations of probability distributions complementing other more statistical-oriented techniques that otherwise lack model inference capabilities. ∗ An online implementation to estimations of graph complexity is available online at http://www.complexitycalculator.com 1 Keywords: Model generation; signal decomposition; segmentation; algorithmic renormalization; algorithmic image segmentation; graph partitioning; algorithmic machine learning; model generation; feature selection. 1 Introduction Classical information theory has provided rigorous ways to capture our intuitive notions regarding uncertainty and information, and made an enormous impact in doing so. One of the fundamental measures here is mutual information, which captures the average information contained in one variable about another, and vice versa. If we have two source variables and a target, for example, we can measure the information held by one source about the target, the information held by the other source about the target, and the information held by those sources together about the target. Any other notion about the directed information relationship between these variables, which can be captured by classical information-theoretic measures (e.g., conditional mutual information terms) is linearly redundant with those three quantities. However, intuitively, there is strong desire to measure further notions of how this directed information interaction may be decomposed, e.g., how much information the two source variables hold redundantly about the target, how much each source variable holds uniquely, and how much information can only be discerned by synergistically examining the two sources together. These notions go beyond the traditional information-theoretic view of a channel serving the purpose of reliable communication, considering now the situation of multiple communication streams converging on a single target. This is a common situation in biology, and in particular in neuroscience, where, say, the ability of a target to synergistically fuse multiple information sources in a non-trivial fashion is likely to have its own intrinsic value, independently of reliability of communication. The absence of measures for such decompositions into redundant, unique and synergistic information is arguably the most fundamental missing piece in classical information theory. Triggered by the formulation of the Partial Information Decomposition framework by Williams and Beer in 2010, the past few years have witnessed a concentration of work by the community in proposing, contrasting, and investigating new measures to capture these notions of information decomposition. Typically, models encode features of data in statistical form and in single variables and merged models, even in cases where several data sources are 2 involved. Quantitative measures to disentangle complex signals and methods to tell apart causal mechanisms from noise and (ir)relevant interactions are of broad interest in areas such as statistical mechanics, reverse engineering, network inference, data reconstruction and scientific discovery in general, being germane to the challenge of causal analysis. For example, the development of techniques for learning disentangled representations using probabilistic machine and deep learning methods has recently gained significant momentum [11]. More broadly, model-based representations from data is one of the main challenges in machine learning, artificial intelligence and causal discovery and inference. Here we introduce a framework based upon the theory of algorithmic probability, which in our formulation is capable of identifying different sources that may explain and provide different models for each of the possible causes of convoluted or intertwined data. Casual inference has been one of the most challenging problems in science. The debate about causality has not prevented the development of successful and mature mathematical and algorithmic frameworks, first in the form of classical statistics and today in the form of computability and algorithmic information theories. Based on these latest mature mathematical frameworks that are acknowledged to fully characterize the concept of randomness as opposed to causal (deterministic), we introduced a suite of algorithms [20] to study the algorithmic information dynamics of evolving systems, and also methods to reduce the dimensions of data [21] based on the same principles. Algorithmic data dimension reduction and algorithmic deconvolution are two challenges which can be viewed as opposite sides of the same coin. On the one hand, data reduction is achieved by finding elements that are considered redundant, using as a criterion their contribution to the algorithmic content of the description of the data. Such elements provide the basis for compression and they can therefore safely be removed. On the other hand, the algorithmic deconvolution by generative mechanisms operates by identifying the elements that are likely to be part of the same causal path of some production rule or generating mechanism. The deconvolution is thus able to decompose causes and pinpoint the different sources generating the observed data. 2 2.1 Notation and Background Cellular automata We use cellular automata as causal dynamical systems to illustrate the algorithm before demonstrating its capabilities on more sophisticated objects 3 of a convoluted nature and its applications to objects such as complex networks. A cellular automaton is a computer program that applies in parallel a global rule composed of local rules on a tape of cells with symbols (e.g. binary). Thoroughly studied in [22], Elementary Cellular Automata (or ECA) are one-dimensional cellular automata that take into consideration in their local rules the cell next to the centre and the centre cell. Definition 2.1. A cellular automaton (or CA) is a tuple hS, (L, +), T, f i with a set S of states, a lattice L with a binary operation +, a neighbourhood template T , and a local rule f . The set P of states S is a finite set with elements s taken from a finite alphabet with at least two elements. Definition 2.2. The neighbourhood template T = hη1 , ..., ηm i is a sequence of L. In particular, the neighbourhood of cell i is given by adding the cell i to each element of the template T : T = hi + η1 , ..., i + ηm i. Each cell i of the CA is in a particular state c[i] ∈ S. A configuration of the CA is a function c : L → S. The set of all possible configurations of the CA is defined as SL . As a discrete dynamic system, the evolution of the CA occurs in discrete time steps t = 0, 1, 2, ..., n. The transition from a configuration ct at time t to the configuration c(t+1) at time t + 1 is induced by applying the local rule f . The local rule is to be taken as a function f : S |T | → S which maps the states of the neighbourhood cells of time step t in the neighbourhood template T to cell states of the configuration at time step t + 1: ct+1 [i] = f (ct [i + η1 ], ..., ct [i + ηm ]) (1) The general transition from configuration to configuration is called the global map and is defined as: F : S L → S L . In the case of 1-dimensional CA it is common to introduce the radius of the neighbourhood template which can be written as h−r, −r + 1, ..., r − 1, ri and has length 2r + 1 cells. With a given radius r the local rule is a function |S|(2r+1) |S|(2r+1) f : Z|S| → Z|S| with Z|S| rules. Elementary Cellular Automata (ECA) have a radius r = 1 (closest neighbours), having the neighbourhood template h−1, 0, 1i, meaning that the neighbourhood comprises a central 3 cell. From this it follows that the rule space for ECA contains 22 = 256 rules. Enumeration of ECA rules: It is common to follow the lexicographic ordering scheme introduced by Wolfram [22]. According to this encoding, the 256 ECA rules can be encoded by 8-bits. 4 2.2 Causation and Algorithmic Probability The concept of algorithmic complexity [5, 2] is at the core of the challenge of complexity in discrete dynamic systems, as it involves finding the most statistically likely generating mechanism (computer program) that produces a set of given data. Formally, the algorithmic complexity (also known as Kolmogorov-Chaitin complexity) is the length of the shortest computer program that reproduces the data from its compressed form when running on a universal Turing machine. We apply the so-called Coding Theorem Method (CTM) and Block Decomposition Method (BDM) as introduced in [3, 9, 13, 19] based on the seminal concept of Algorithmic Probability [10, 6] to estimate algorithmic complexity [5, 2]. 3 Methods and deconvolution algorithm The aim of the deconvolution algorithm is to break a dataset into groups that do not share certain features (essentially causal clustering and algorithmic partition by probable generative mechanism, completely different from traditional clustering and partition in machine learning approaches). Usually these characteristics are a parameter to maximize, but ultimately the purpose is to distinguish components that are generated similarly from those that are generated differently. In information-theoretic terms the question is therefore as follows: What are the elements (e.g. nodes or edges) that can break a network into the components that maximize their algorithmic information content, that is, those elements that preserve the information about the underlying programs generating the data? Formally, let E = E(G) be the set of all edges of a graph G, we seek the edges {e1 , . . . , en }, ∈ Ej ⊂ G that break G into N disconnected components such that the removal Ej minimizes the loss of information in G among all subsets Ei ⊂ E, i.e. C(G\Ej∗ ) ≤ C(G\Ei∗ ) for all i. The algorithm’s pseudo-code can thus be written as follows: 1. Find the subset of edges with index j such that C(G\Ej∗ ) ≤ C(G\Ei∗ ) for all i. 2. Remove the elements in Ej from G. 3. Repeat 1 with G := G\{Ej } until N number of subcomponents is reached (or closest value to N ). 4. The number of components is the sum of the remaining subcomponents that were deleted plus those that prevailed. 5 The only parameter that the algorithm requires is the number of components into which an object will be decomposed. However, there is a natural way to find the optimal terminating step and therefore the number of maximum possible components that minimize the sum of the lengths of the candidate generating mechanisms thereby truly making the algorithm parameter-free as it is not required to have a preset number of desired components. However, before introducing the terminating criterion (c.f. next section) for the number of components, let’s analyze what it might mean for two components s1 and s2 to have same algorithmic information content C(s1 ) = C(s2 ). Clearly that subcomponents s1 and s2 have the same algorithmic complexity (an integer—or a real value if using AP-based BDM— indicating the size of the approximated minimal program) does not imply that the two components are generated by exactly the same generating mechanism. However, because of the exponential decay of the algorithmic probability of an increasingly random object, we have it that the less random it is, the exponentially more likely it is that the underlying mechanism will be the same (see Fig. 4C). This is because there are exponentially fewer short programs than long ones. For example, in the extreme case of connected graphs, we have it that the complete graph denoted by Kn has the smallest possible algorithmic complexity ∼ log(n). If C(s1 ) = C(s2 ) ∼ log(n) then s1 and s2 are, with extremely high probability, generated by the same algorithm that generates either the complete graph or the empty graph (with same lowest algorithmic complexity as it requires no description other than either all nodes connected or all nodes disconnected). Conversely, if C(s1 ) = C(s2 ) but C(s2 ) and C(s1 ) depart from log(n) (and approximate algorithmic randomness) then the likelihood of being generated by the same algorithm exponentially vanishes. So the information regarding both the algorithmic complexity of the components and their relative size sheds light on the candidate generating mechanisms and is less likely to coincide ‘by chance’ for non-trivial cases. 3.0.1 Algorithm terminating criterion The immediate question is where we should stop breaking down a system into its causal components. The previous section suggests a terminating criterion. Let S be the object which has been produced by N mostly independent generative mechanisms. We decompose S into n parts s1 , . . . , sn in such a way that each si , i ∈ {1 . . . n} has an underlying generating mechanism found by running the algorithm iteratively for increasing n, but after each 6 iteration we calculate the minimum of the differences in algorithmic complexity among all subcomponents. The algorithm should then stop where the number of subcomponents is exactly N when the sum of the lengths— the estimated algorithmic complexity—of each of the programs will diverge from the expected log(N ) because the length of the individual causal mechanisms producing each new component will be breaking a component that could previously be explained by the causal mechanism at a previous iteration of the algorithm. As a trivial example, let’s take the string 1n , where S n means that the pattern S is repeated n times. After application of the algorithm, the terminating criterion will suggest that 1n cannot be broken down into smaller segments, each with a different causal generating mechanism, whose total length sums will be shorter than the length of the generating mechanism producingP 1n itself. This is because the sum of the length of the shortest programs i |pi | running on a universal Turing machine generating segments of 1n of length mi < n each, such that the concatenation ∪i=1 pi = 1n , will be strictly greater than C(1n ), given that each pi halting criterion will require i log mi bits more than C(1n ). In the case of Fig. 2, the terminating criterion retrieves N = 3 components from the two interacting ECA (rule 60 and 110). This does not contradict the fact that we started from two generating mechanisms, because there are three clear regimes that are actually likely to be reproducible by three different generating mechanisms, as suggested by the deconvolution algorithm itself, and as found in [7], where it has been shown that rule 110 can be emulated by the composition of two simpler ECA rules (rules 51 and 118). As seen in Fig. 2, among the possible causal partitions, N = 2 successfully deconvolves ECA rule 60 from rule 110 on the first run, with a stronger difference than the difference found between N = 3 components when breaking rule 110 into its two different regimes. 3.1 Graph complexity The concept of algorithmic probability (also known as Levin’s semi-measure) yields a method for approximating algorithmic complexity related to the frequency of patterns in the adjacency matrix of a network, including therefore the number of subgraphs in a network. The algorithmic probability [10, 6, 2] of a subgraph H ∈ G is a measure that describes the probability that a random computer program p will produce H when run on a 2-dimensional tape 7 1 ) Turing machine U also referred to as a Turmite. That universal (prefix-free P is, m(G) = p:U (p)=H∈G 1/2|p| . The probability semi-measure m(G) is related to algorithmic complexity C(G) in that m(G) is at least the maximum term in the summation of programs m(G) ≥ 2−C(G) , given that the shortest program carries the greatest weight in the sum. The Coding Theorem establishes the connection between m(G) and C(G) as ([6]): | − log2 m(G) − C(G)| < c (Eq. 1), where c is some fixed constant, independent of s. The theorem implies that one can estimate the algorithmic complexity of a graph from the frequency of production from running random programs and applying the Coding theorem: C(G0 ) = − log2 m(G) + O(1). The Coding theorem establishes that graphs produced with lower frequency by random computer programs have higher algorithmic complexity, and vice versa. The BDM of a graph thus consists in decomposing the adjacency matrix of a graph into subgraphs of sizes for which complexity values have been estimated, then reconstructing an approximation of the algorithmic complexity of the graph by adding the complexity of the individual pieces according to the rules of information theory, as follows: C(G) = X log2 (nu ) + C(ru ) (2) (ru ,nu )∈Adj(G)d×d where Adj(G)d×d represents the set with elements (ru , nu ), obtained when decomposing the adjacency matrix of G into all subgraphs contained in G of size d. In each (ru , nu ) pair, ru is one such submatrix of the adjacency matrix and nu its multiplicity (number of occurrences). As can be seen from the formula, repeated subgraphs only contribute to the complexity value with the subgraph BDM complexity value once plus a logarithmic term as a function of the number of occurrences. This is because the information content of subgraphs is only sub-additive, as one would expect from the growth of their description lengths. Applications of m(G) and C(G) have been explored in [3, 9, 8, 13], and include applications to graph theory and complex networks [12] and [13] where the technique was first introduced. The only parameters used for the application of BDM, as suggested in [19], is to set the overlapping of the decomposition to the maximum 12 bits for strings and 4 square bits for arrays given the current best CTM approximations [9] from an empirical distribution based on all Turing machines with up to 5 states, and no string/array overlapping in the decomposition 1 The group of valid programs forms a prefix-free set (no element is a prefix of any other, a property necessary to keep 0 < m(G) < 1). 8 for maximum efficiency (as it runs in linear time) and for which the error (due to boundary conditions) has been shown to be bounded [19]. However, the algorithm introduced here is independent of the method used to approximate algorithmic complexity such as BDM. BDM assigns an index associated with the size of the most likely generating mechanism producing the data according to Algorithmic Probability [10]. BDM is capable of capturing features in data beyond statistical properties [19, 16] and thus represents an improvement over classical information theory. Because finding the program that reproduces a large object is computationally very expensive– even to approximate–BDM finds short candidate programs using another method [3, 9] that finds and reproduces fragments of the original object and then puts them together as a candidate algorithmic model of the whole object [19, 13]. These short computer programs are effectively model candidates explaining each fragment, with the long finite sequence of short models being itself a generating mechanistic model. 4 4.1 Numerical experiments Decomposition of sequences and space-time diagrams In this section, we will test the suggested algorithm on different types of objects, in order to show its applicability and power. We start with the simplest version of an object which conveys information, a string, and move later to consider richer objects such as networks. We will use different programs to produce different parts of a string, that is a program p to generate segment s1 and program p0 to generate segment s2 put next to each other. Clearly the string has been generated by two generating mechanisms (p and p0 ). Now we use the algorithm to deconvolve the string and find the number of generating mechanisms and most likely model mechanisms (the program themselves) inducing a form of algorithmic partition based on the likelihood of each segment to be produced by different generating mechanisms. Figs. 1A-E illustrate how strings that have short generating mechanisms are significantly and consistently more sensitive to perturbations. The resulting string is 01010101010101010101010101010101010101010101010101 01110100101010100000001001100111100110000011100110 with the colours corresponding to the parts suggested by the different regimes, according to their algorithmic contribution and the segment’s resilience to perturbations (by deletion and replacement) to the original string. Behind every real number approximating the algorithmic complexity of a string there is the 9 A B C D E F G Figure 1: Proof of concept applied to a binary string composed of two segments with different underlying generating mechanisms (computer programs). A: Log plot of complexity estimation of a regular segment (blue) consisting of the repetition of ‘01’ 25 times followed by a random-looking segment (red). B: Log plot reversing the order of A yet preserving the qualitative behaviour of the different segments. C: The code of the smallest generating program (a non-terminating Turing machine) depicted visually (states are arrows in different directions) producing the string of 01n for any n (0 is white and 1 is orange) starting from a blank tape as shown in the space-time diagram (E). D: the same computer program as a state diagram. F: Interacting programs with different generating mechanisms (ECA rules 255 v 110) running for 60 steps. G: Algorithmic information footprint, every pixel is deleted and its original contribution to the whole quantified and coloured accordingly. If grey, then it makes the lowest contribution, blue represents a low contribution and red the highest contribution (randomness). 10 discovery of a large set of generating programs when using the Algorithmic Probability (AP)-based measure BDM producing the object. We not only could find the number of mechanisms correctly (Figs. 1A and B) but the candidate programs (which for this trivial example are exactly the original) that generate each segment (Figs. 1C-E) by way of seeking for the shortest computer programs in a bottom up approach (see [3, 9, 13, 19]). Finding the shortest programs is, however, secondary, because we only care about the different explanatory power that different programs have to explain the data in full or in part pinpointing the different causal nature of the segments and helping in the deconvolution of the original observation. Figs. 1C-E depict the computer program (a non-terminating Turing machine) that is found when calculating the BDM of the 01n string. The BDM approximation to the algorithmic complexity of any 01n string is thus the number of small computer programs that are found capable of generating the same string or, conversely (via the algorithmic Coding theorem, see [3, 9, 13]), the length of the shortest program producing the string. For example, the string 01n was trivially found to be generated by a large number of small computer programs (in Fig. 1C,D depicted a non-terminating Turing machine with E its output) using our algorithmic methods (as opposed to, e.g., using lossless compression, which would only obfuscate the possible generating model) with only two rules out of 2×2 rules for the size of Turing machine with only two states and two symbols and no more, thus of very low algorithmic complexity compared to, e.g., generating a random-looking string that would require a more complex (longer) computer program. The computer program of a truly random string will grow in proportion to the length of the random string, but for a low complexity string such as 01n , repeated any number of times n, the length of the computer program is of (almost) fixed size, growing only by log(n) if the computer program is required to stop after n iterations. In this case 01n is a trivial example with a strong statistical regularity whose low complexity could be captured by applying Shannon entropy alone on blocks of size 2. Figs. 1 F and G illustrate how the algorithm can separate regions produced by generating mechanisms of different algorithmic information content by observing their space-time dynamics, thereby contributing to the deconvolutin of regions that are produced by different generating mechanisms. In this example both programs are sufficiently robust to not break down (see Sup. Inf.) when they interact with each other, with rule 110 prevailing over 255. Yet, in the general case it is not always easy to tell these mechanisms apart. In more sophisticated examples such as in Figs. 2 D to E, we see how the algorithm can break down contiguous regions separating an object into 11 two major components corresponding to the different generating computer programs that are intertwined and actively interacting with each other. The experiment was repeated 20 times with programs with differing qualitative (e.g. Wolfram class) behaviour. Fig. 2 F demonstrates that perturbations to regions in red are considered to have a more random effect and are thus by themselves less algorithmically complex (random) versus simple. When regions are of the same algorithmic complexity they are likely to be generated by similar algorithms, or more precisely, algorithms that are of similar minimal length. Regions in blue move the space-time evolution away from randomness and are themselves more algorithmically random. Blue structures on the left hand side correspond to large triangles occurring in ECA rule 110 that are usually used to compute and transfer information in the form of particles. However, triangular patterns transfer information in a limited way because their light cone of influence reduces at the greatest possible speed of the automaton, and they are assigned an absolute neutral information value. Absolute neutral values are those closest to 0. Once separated, the two regions have clearly different algorithmic characteristics given by their causal perturbation sensitivity, with the right hand side being more sensitive to both random and non-random perturbations. Moreover, Fig. 2 F shows results compatible with the theoretical expectation and findings in [20] where a measure of reprogrammability associated with the number and magnitude of elements that can move a dynamical system towards or away from randomness was introduced and shown to be related to fundamental properties of the attractor space of the system. 4.2 Graph and network deconvolution Classification can usually be viewed as solving a problem which has an underlying tree structure according to some measure of interest. One way to think of optimal classification is to discover a tree structure at some level of depth, with tree leaves closer to each other when such objects have a common or similar causal mechanism and for which no feature of interest has been selected. Fig. 3 illustrates how the algorithm may data, in this case starting from a trivial example that breaks complete K-ary trees. Traditionally, partitioning is induced by an arbitrary distance measure of interest that determines the connections in a tree, with elements closer to a cluster centre connected by edges. The algorithm breaks the trees (see Fig. 3) into as many components as desired by iterating the algorithm until the number of desired components is obtained or the terminating criterion is applied 12 A B C D E F Figure 2: A: The output of two different intertwined programs (ECA rules 60 and 110) with qualitatively complex output behaviour (11 to 60 steps depicted here, from a random initial condition) interacting with each other (one of which has been proven to be Turing-universal and the other has also been conjectured to be universal [22]), each producing structures of a similar type that, from an observer’s perspective, are difficult to distinguish (see Subfigure C) as is artificially done in B (knowing which pixel is generated by which rule). C: What an observer of the last runtime would see in the form of a stream of bits with no clear statistical distinction. D: The algorithm pinpoints the regions of neutral, positive and negative, with the contiguous largest blue component segmenting the image into two components. E: only negative vs positive causal contributions where both Shannon entropy and a popular lossless compression algorithms fail (see SI). F: Sanity check/validation: Statistically significant quantitative differences among the parts after application of the algorithm as illustrated in E among apparently weak qualitative differences as illustrated in Subfig. A. 13 (c.f. Subsection 3.0.1). Figs. 3A,B provide examples illustrating how to maximize topological symmetry. The algorithm can be applied, without loss of generalization, to any non-trivial graph, as in Figs. 3C,D or on any dataset for that matter. The same task using classical information theory (Shannon entropy) is shown not to be sensitive enough (see Sup. Inf.), and a popular lossless compression algorithm (Compress based on LZW) provided a noisy approximation (see Sup. Inf.) to the results obtained by using the Block Decomposition Method, as defined in [19], whose description is provided in the Sup. Inf. Figs. 3C-E illustrate how randomly connected graphs with different topologies can be broken into their respective generative mechanisms. Fig. 3C is a complete graph of size 20 randomly connected by 3 edges to a scale-free graph of size 100. The graphs are generated by different mechanisms, one is a small program that, given a number N of nodes, produces a graph with all nodes connected to all other N − 1 nodes and has a program of small length that grows only by log N [15]. The scale-free network is generated by the canonical preferential attachment algorithm with two edges per node and requires a slightly longer algorithm that grows by log N + c [15] where c is a small constant accounting for the pseudo-random choice of attachment nodes. The algorithm breaks the graphs into two components, each of which corresponds to the graphs with different degree distribution (depicted below each case) associated with its generating mechanism. This is because |P (G1 )| + |P (G2 )| + . . . + |P (Gn )| + |P (eGi )| > |P (G1 G2 . . . Gn )| for any Gi , where eGi is the set of edges randomly connecting Gi to Gj for any i and j for all G of low algorithmic complexity. 4.3 Robustness and limitations Fig. 3 D illustrates a similar case to Fig. 3 C, but instead of a complete graph an Erdös Rényi (E-R) graph with edge density 0.5 is produced and connected by 3 random edges to a scale-free network produced in the same fashion as in Fig. 3 C. Again, the algorithm was able to break it down into the two corresponding subgraphs. Fig. 3 D represents a test case to evaluate the effect of additive noise by connecting an E-R graph of increasing size and with an increasingly greater number of random edges. Next we ask how much structure, if any, can be recovered/extracted when adding a random (E-R) graph to different types of structured networks. To this end, we conducted a series of numerical experiments shedding light on the limitations of the algorithm introduced here in the face of additive 14 A B C D E Figure 3: A,B: Forced deconvolution of a tree by minimization of graph algorithmic information loss thereby maximizing causal resemblance of the resultant components (hence causal clustering). Depicted are the components of a K-ary trees of size 6 (A) and 10 (B) and their resulting graphs after one iteration of the deconvolution algorithm. C: Deconvoluting a graph composed by a complete graph and a scale-free (S-F) network generated by preferential attachment and randomly connected between them. Negative edges break down the graph into components corresponding to the different underlying generating mechanisms. D: Deconvolution of a random graph (E-R) and a scale-free (S-F) network. E: The algorithm first separates the subcomponents with the largest algorithmic difference, followed by other subcomponents. 15 A B C Figure 4: A: Causal deconvolution of graphs, a S-F graph (2 new links per added node) from an E-R (0.5 edge density) graph emulating noise (each point represents the average of 10 replicates). When the number of links increases as a function of the subgraph sizes, the separability is robust (red square markers) compared to increasing the number of random links only for graphs of fixed size (40 nodes), when successful separation is compromised, noise (E-R) and structure (S-F) being indistinguishable. B: A small sample of 6 graphs among the 10 × 20 = 200 graphs randomly connecting a S-F to an E-R graph. Success at identifying randomly connecting links is shown and was found to be very robust. C: Objects have exponentially greater chances of being produced by the same generating mechanism if they are of low algorithmic randomness and thus of high algorithmic probability. 16 noise. The same results were obtained for the simpler case of connecting any complete graph of increasing size to any other graph such as E-R or S-F. Fig. 4 shows the results from the experiments separating graphs, in this case a scale-free graph (S-F) from an Erdös Rényi graph (E-R), the former generated by a Barábasi-Albert preferential attachment algorithm [1] and the latter produced by a pseudo-random generator. Fig. 4A quantifies the error and optimal signal-to-noise ratio for optimal deconvolution, testing the algorithm under additive noise both for fixed and growing size subcomponents. Fig. 4B shows links coloured in red as identified by the algorithm having the highest algorithmic information value when their removal sends the original composed system towards lower algorithmic information content, thereby telling apart the two subcomponents. Negative links are mostly on the side of the E-R graph. In other words, the SF can be extracted with the greatest precision and a lower rate of false positives from the mix, which is to be expected given the random nature of the added links that connect the graphs, making them more like the E-R links than the S-F. If only the number of random links among graphs increases for fixed size graphs (Fig. 4B blue circle marks) a maximum precision of about 0.9 is reached before degradation. That is, at around 32.5% of the links randomly connecting the components. In other words, the algorithm is robust, telling apart noise from structure even after up to 0.325 (from the random links connecting the components) + 0.5 (from the E-R component) = 0.825, i.e. 82.5% of all links are random. On the other hand, the number of false positives is constant at about 5%, in the case shown in Fig. 4B all of the false positives (red links not connecting the two graphs with different topology) are inside the E-R graph and mostly nonexistent on the side of the less random S-F graph. 5 Remarks and conclusions For some more sophisticated yet successful examples on which these new algorithmic methods may outperform applications of entropy in general (without access to true probability distributions) and other computable measures see [19], and [16] for a non-trivial example in which entropic measures fail (by offering divergent descriptions of the same evolving system). The generation of these models is key in our approach because the integer (or real) value assigned to a system as an estimation of its algorithmic complexity is nothing but a guiding index of the number of specific models found by our method that are capable of explaining and generating the data. 17 One possible objection is that any number of interacting rules can be thought of as a single rule producing an intertwined output because we known from Turing universality that any number of interacting programs can also be rewritten as a single program in a larger rule space (defined by state × symbol) incorporating all the behaviours together. That is, any computer program can be decomposed into one or more computer programs producing the same output. This means that separating programs and signals is, in some way, not fundamental. Fig. 2C-F shows, for example, that by iterating the deconvolution algorithm not only do the two main components of the image correspond to the two generating ECA rules, but a second application of the algorithm would produce a third or more components corresponding to further resilient features generated by the rules, which can be considered rules themselves within a smaller rule (state/symbol) space. However, in the deconvolved observations the interacting rule determining how two or more rules may interact effectively constitutes a third global rule to which the algorithm has no direct access or an apparent region in the observed window. We have introduced and tested a parameter-free algorithm for causal deconvolution of interlaced and interacting mechanisms using fundamental concepts drawn from the theory of Algorithmic Probability and Algorithmic Information Theory. Our approach enables a parameter-free analysis of the deconvolution problem, since we have removed the need for pre-defined usercentric definitions of global properties or local rules (e.g. distance metrics) to determine the algorithm. Instead, relating our algorithm to the algorithmic information theory provides us with a fundamental metric. While the algorithm uses state-of-the-art algorithms to approximate algorithmic complexity (CTM and BDM), the algorithm and methods introduced here are independent of the approximating method chosen (e.g. lossless compression). However, the precision and accuracy is not. Yet, the algorithm is sufficiently robust to disentangle sophisticated intertwined causal mechanisms. This opens the possibility of parlaying these algorithmic methods into a more elaborate machine learning framework. For example, the extracted causal information can be used as a prior distribution for machine and deep learning techniques. This is useful because efficient techniques for pattern recognition are as a rule weak on inferring models, and thus ill-equipped to capture the underlying generative mechanisms and thereby produce predictive and prescriptive causal models that exceed the descriptive nature of current classical and modern statistical approaches. 18 Acknowledgements H.Z. was supported by the Swedish Research Council (Vetenskapsrådet) grant No. 2015-05299. References [1] R. Albert, A.-L. Barabási, Statistical mechanics of complex networks, Reviews of Modern Physics, 74 (1): 47–97, 2002. [2] G.J. Chaitin. On the length of programs for computing finite binary sequences Journal of the ACM, 13(4):547–569, 1966. [3] J.-P. Delahaye and H. Zenil, Numerical Evaluation of the Complexity of Short Strings: A Glance Into the Innermost Structure of Algorithmic Randomness, Applied Mathematics and Computation 219, 63–77, 2012. [4] E. Hermo-Reyes and J.J. Joosten, “Competing Cellular Automata” http://demonstrations.wolfram.com/ CompetingCellularAutomata/, Wolfram Demonstrations Project, June 17, 2014. [5] A.N. Kolmogorov. Three approaches to the quantitative definition of information, Problems of Information and Transmission, 1(1):1–7, 1965. [6] L.A. Levin. Laws of information conservation (non-growth) and aspects of the foundation of probability theory, Problems of Information Transmission, 10(3):206–210, 1974. [7] J. Riedel and H. Zenil, Rule Primality and Compositional Emergence of Turing-universality from Elementary Cellular Automata, forthcoming, 2017. XXX [8] F. Soler-Toscano, H. Zenil, J.-P. Delahaye and N. Gauvrit, Correspondence and Independence of Numerical Evaluations of Algorithmic Information Measures, Computability, vol. 2, no. 2, pp. 125–140, 2013. [9] F. Soler-Toscano, H. Zenil, J.-P. Delahaye and N. Gauvrit, Calculating Kolmogorov Complexity from the Frequency Output Distributions of Small Turing Machines, PLoS One 9(5), e96223, 2014. 19 [10] R.J. Solomonoff, A formal theory of inductive inference: Parts 1 and 2. Information and Control, 7:1–22 and 224–254, 1964. [11] N. Siddharth, B. Paige, J-W van de Meent, A. Desmaison, N.D. Goodman, P. Kohli, F. Wood, P.H.S. Torr, Learning Disentangled Representations with Semi-Supervised Deep Generative Models, arXiv:1706.00400 [stat.ML], 2017. [12] H. Zenil, F. Soler-Toscano, K. Dingle and A. Louis, Graph Automorphisms and Topological Characterization of Complex Networks by Algorithmic Information Content, Physica A: Statistical Mechanics and its Applications, vol. 404, pp. 341–358, 2014. [13] H. Zenil, F. Soler-Toscano, J.-P. Delahaye and N. Gauvrit, TwoDimensional Kolmogorov Complexity and Validation of the Coding Theorem Method by Compressibility, 2013. [14] H. Zenil, N.A. Kiani and J. Tegnér, Quantifying Loss of Information in Network-based Dimensionality Reduction Techniques, Journal of Complex Networks 4, 342–362, 2016. [15] H. Zenil, N.A. Kiani and J. Tegnér, Methods of Information Theory and Algorithmic Complexity for Network Biology, arXiv:1401.3604, 2014. [16] H. Zenil, N.A. Kiani and J. Tegnér, Low-Algorithmic-Complexity Entropy-deceiving Graphs, Physics Reviews E. 96, 012308, 2017. [17] H. Zenil, Compression-based Investigation of the Dynamical Properties of Cellular Automata and Other Systems, Complex Systems, 19(1), pages 1–28, 2010. [18] H. Zenil and E. Villarreal-Zapata, Asymptotic Behaviour and Ratios of Complexity in Cellular Automata Rule Spaces, International Journal of Bifurcation and Chaos, vol. 13, no. 9, 2013. [19] H. Zenil, S. Hernández-Orozco, N.A. Kiani, F. Soler-Toscano, A. Rueda-Toicen, A Decomposition Method for Global Evaluation of Shannon Entropy and Local Estimations of Algorithmic Complexity, arXiv:1609.00110 [cs.IT], 2016. [20] H. Zenil, N.A. Kiani, F. Marabita, Y. Deng, S. Elias, A. Schmidt, G. Ball, J. Tegnér, An Algorithmic Information Calculus for 20 Causal Discovery and Reprogramming Systems, 2017. BioArXiv DOI: https://doi.org/10.1101/185637 [21] H. Zenil, N.A. Kiani, J. Tegnér, Data Reduction and Network Sparsification by Minimal Algorithmic Information Loss, arXiv XXX [22] S. Wolfram, A New Kind of Science, Wolfram Media, Champaign IL., 2002. 21 Supplementary Information 5.1 Interacting programs Figure 5: Interacting programs such as cellular automata require us to define how the interaction happens by, e.g., deciding what set of rules apply at the intersection. For instance, one of the two sets of local rules or a 3rd set of rules effectively defining a super cellular automaton that most likely is another cellular automaton in a larger rule-space (requiring more states to define the two sub-cellular automata and the interaction). Depicted here is the type of interaction we explored, and this case shows the richness of such possible interactions where both rules ‘spill over’ each other. The qualitative behaviour of each program can heuristically be identified by what is known as its Wolfram class, which in turn has been formalized using tools and methods from algorithmic complexity in [17, 18]. Informally, Wolfram class 1 represents evolutions of programs that converge to a simple fixed configuration, exemplars of Wolfram class two converge to repetitive simple behaviour, those of Wolfram class 3 produce unbounded apparently statistically random behaviour and exemplars of Wolfram class 4 reproduce apparently open-ended persistent structures. None of what has been introduced here depends on this behavioural characterization based on different heuristics, and it is thus in no way fundamental to the results reported. The interaction rule is interaction rule number 1 according to the enumeration open-source program on the Wolfram Demonstrations website publicly available at http://demonstrations.wolfram.com/CompetingCellularAutomata/ [4] determining the way in which the local rules from each global ECA rule will 22 be dictated and applied at their intersection. 5.2 Graph generation The graphs used throughout this paper were generated using the Wolfram Language on the Mathematica platform using the function RandomGraph[] with uniform distribution (UniformGraphDistribution[]) for ErdösRényi graphs and a scale-free distribution (BarabasiAlbertGraphDistribution[]) for the scale-free networks constructed by starting from a cycle graph of size 3 and a vertex of k edges added at each step according to the preferential attachment algorithm [1] following a distribution proportional to the vertex degree. All experiments were replicated and averaged from a set of at least 20 instances. 5.3 Comparison with entropy and lossless compression Fig. 6 shows the results obtained by using classical information theory (Shannon entropy) and one of the most popular lossless compression algorithms (Compress) based on LZW as an approximation to algorithmic (Kolmogorov-Chaitin) complexity instead of BDM. Because all values collapse into a single value for entropy, the colours displayed are the result of an artificial sorting of the pixels based on their indices, from top to bottom. Compression is a lower-quality approximation of what we reported in Figs. 1C-F, where the reported algorithm based on the BDM is clearly an improvement. A B Figure 6: Shannon entropy (A) and lossless compression (Compress) underperform, not being sensitive enough in performing the same task reported in Figs. 1C-F. 23
2cs.AI
Rise of the humanbot Ricard Solé1, 2, 3 1 ICREA-Complex Systems Lab, Universitat Pompeu Fabra, Dr Aiguader 88, 08003 Barcelona, Spain Institut de Biologia Evolutiva, CSIC-UPF, Pg Maritim de la Barceloneta 37, 08003 Barcelona, Spain 3 Santa Fe Institute, 1399 Hyde Park Road, Santa Fe NM 87501, USA arXiv:1705.05935v1 [q-bio.NC] 16 May 2017 2 The accelerated path of technological development, particularly at the interface between hardware and biology has been suggested as evidence for future major technological breakthroughs associated to our potential to overcome biological constraints. This includes the potential of becoming immortal, having expanded cognitive capacities thanks to hardware implants or the creation of intelligent machines. Here I argue that several relevant evolutionary and structural constraints might prevent achieving most (if not all) these innovations. Instead, the coming future will bring novelties that will challenge many other aspects of our life and that can be seen as other feasible singularities. One particularly important one has to do with the evolving interactions between humans and non-intelligent robots capable of learning and communication. Here I argue that a long term interaction can lead to a new class of “agent” (the humanbot). The way shared memories get tangled over time will inevitably have important consequences for both sides of the pair, whose identity as separated entities might become blurred and ultimately vanish. Understanding such hybrid systems requires a second-order neuroscience approach while posing serious conceptual challenges, including the definition of consciousness. Keywords: Singularity, evolution,social interacting robots,major transitions,mind,memory,ageing Can a machine think? Could it have pain? Ludwing Wittgenstein I. INTRODUCTION The beginnings of the 21-st century have been marked by a rapid increase in our understanding of brain organisation and a parallel improvement of robots as embodied cognitive agents (Steels 2003; Cangelosi 2010; Nolfi and Mirolli 2009; Vershure et al 2014). This has taken place along with the development of enormously powerful connectionist systems, particularly within the domain of convolutional neural networks (Lecun et al 2015; Kock 2015). Two hundred years after the rise of mechanical automata, that became the technological marvels of the Enlightnment (Woods 2003) new kinds of automata are emerging, capable of interacting with humans in adaptive ways. The requirements for building an intelligent or a conscious machine are likely to be still ahead in the future, but some advances and new perceptions of the problem are placing the possibility at the forefront of ”what-if” questions (Vershure 2016). To a large extent, today’s discussion on what separates humans from their artificial counterparts is deeply tied to the problem of how to properly define mind and consciousness (Zarkadakis 2015). In the 1950s, the development of cybernetics by Norbert Wiener and others along with the beginning of theoretical neuroscience and Turing’s proposal for an intelligence test (Turing 1950) were received with a similar interest, triggering a philosophical debate on the limits and potential of man-made imitations of life (Nourbakhsh 2013). The study of the first ”cybernetic machines” made by a few pioneers such as Gray Walter generated a great expectation. For the first time ”behaviour” emerged as a word associated to mechanical machines, this time empowered by the rising technology that allowed to combine hardware and a new form of engineering inspired -to some extent- by natural devices (Water 1950, 1951; see also Braitenberg 1984). Those early experiments provided some interesting insights into the patterns of exploration of simple agents that where able to detect edges, respond to light and modify their movements according to some simple feedback mechanisms. Although their simple behaviour was essentially predictable, it was not completely free from surprise (Holland 1997). Later work in the 1990s and afterwards incorporated artificial neural systems as an explicit form of introducing learning and behaviour largely inspired in biology (Vershure et al 1992; Edelman 1992; Sporns and Alexander, 2002; Prescott et al 2006). Nowadays we are rapidly moving towards a new generation of domestic, human-friendly robots that will probably trigger a new technological revolution, similar in some ways to the one proposed by the first personal computers. There is a great promise in this revolution. The promise of robots helping us, playing with us or simply having some basic support functions is pushing forward software and hardware companies towards designing cheap robotic systems. For the general public the fascination remains in the humanoids, those who really look like us. We are actually witnessing a rehearsal of the mechanical automata mania of the 18th century, except that the new automata will be much more autonomous and perhaps closer to us than ever. Not surprisingly, the rise of the new robots has come about with a parallel growth of new fields associated to human-robot interactions (Breazeal 2003; Fong et al 2003; Dautenhahn 2007) and the exploration of learning, cognition and evolution potentials of artificial agents (Clark and Grush 1999; Schaal 1999; 2 a b c d r h FIG. 1 Humans and robots have been interacting in increasingly more complex ways, most of them limited to simple tasks. However, communicating robots (a) could in the future interact in deeper ways both among them and with humans (image courtesy of Luc Steels -the human in the picture- and the Neurocybernetics group at Osnabruck). Fictional stories on future human-robot interactions, including (b) the movie Robot and Frank or (c) TV series Humans have started to consider the relevance of strong emotional ties established between elderly or impaired human beings and (possibly non-intelligent) robots capable of learning and communicating through natural language. Evolving connectomes will inevitably result from HRI (d). The long-term association between a human and a robotic agent, when the later is equipped with both communication skills and learning capacities implies the creation of an association network Γ linking both ”brains” through a number of shared memories. The relative importance of this shared connectome will be a function of the cognitive apparatus of each partner and the depth of emotional engagement. Floreano and Mattiusi 2008; Takeno 2013). Along with the science and engineering of these humanlike agents, science fiction is also exploring some relevant (and sometimes unexpected) consequences of these near futures. Most early works on robots have been centered on the possibility of intelligent, or even self-aware machines. Isaac Asimov published the Sci-Fi classic I robot three years before Turing’s landmark paper on intelligence, picturing a would-be society where robots become a central part of our lives (Asimov 1947). Perhaps the most interesting reflection of Asimov’s tales is the unexpected, the unforeseen consequences of robotic actions while interacting with their most complex part of the environment: us, the humans. The robots incorporate a set of hardwired rules (the ”laws” of robotics) preventing the machines from harming humans and harming themselves but in special contexts, when a conflict among the laws emerges, the unexpected should be expected. The scientific progress made in the field of human- robot interactions (HRI) and artificial intelligence (AI) have renewed the interest in the potential consequences of advanced cognitive robots (Wallach and Allen, 2009; Bradshaw et al., 2004; Murphy and Woods, 2009) and in particular the role played by embodiment in communicating agents (figure 1a) which is known to play a key role in the development of complex behavioural traits (Steels 2003, 2015). The plots in new Sci-Fi stories have become more subtle, and much more interesting. In the movie Robot and Frank, for example, we have a moving story of a declining man (Frank) facing the initial phases of Alzheimer’s and a robot companion which, despite a lack of real intelligence, shares experiences and memories with his human partner (fig 1b). At some point, the robot asks Frank to wipe out his memories. Frank rejects the idea, while the robot tells him ”I am not a person, I am just an advanced simulation” but afterwards he uses a number of very personal (Frank-like) sentences to make his argument, resulting from previous learned 3 talks and experiences. A related situation also shows up in an episode of the Sci-Fi series Humans where Dr George Millican, an elderly man and one of the main characters, owns a faulty robot named Odi (fig 1c). The boy-like robot is an old model that stores memory chunks of shared, unique experiences, some of them related to deceased Millican’s wife. Because of this, Millican does not accept the mandatory replacement of old models, thus hiding Odi inside a closet. None of the previous examples is related to truly intelligent robots. Instead, the subtle ties and their consequences arise from shared cognition and emotions. Nowadays, despite our distance from the sci-fi proposals, robot designs are already present in a wide range of situations where they are social partners. This includes household pets, healthcare assistants or even educational companions. Even when the robotic agent has a limited repertoire of interactions, its actions can be perceived as part of some ”personality”, particularly in relation with robotic pets (Min Lee et al 2006; Li and Chignell 2010; Miklosi and Gacsi 2012; Park et al 2012). One goal of robotic research is the development of autonomous robots, capable of perception but also of making decisions by themselves and more importantly to communicate (Breazeal 2002; 2003; Breazeal et al 2016). Here several levels of complexity are possible, from programmed agents responding to a more or less simple and predictable environment to robots capable of complex interactions with humans, able to use natural language and learn from experience. The later scenario implies sophisticated implementations grounded in neurorobotics (Arbib et al 2006; Oztop et al 2006; Arbib et al 2008). One goal of this paper is actually provide a general space of HRI complexity where different classes of interactions can be located. As will be argued in the next section, these shared memories and other common relationships define a network of interactions describing the HRI that can contribute, but also replace, parts of the brain functions (figure 1d). This diagram displays an idealised bipartite system (Γ) including both the human cognitive network (Γh , the brain) and the artificial neural network embedded in the robotic agent (Γr ). The whole network Γ will change in time as changes in the two subnetworks occur but also through the creation of all levels of correlations emerging from the HRI. What happens when this network is the outcome of a long-term exchange? What are the consequences for a HR pair when the human node is affected by some kind of impairment? As will be argued below, by considering the relative cognitive complexities of each agent in this HRI and the influence of the degree of emotional engagement, a space of HRI can be defined following the approach of second-person neuroscience (Schlibach et al 2013). Within this space of possibilities, one in particular can involve the emergence of a new class of cognitive agent transcending both humans and robots, perhaps defining a novel form of synthetic evolutionary transition (Solé 2016). The consequences of such novel hybrid system will be discussed. II. THE SPACE OF HUMAN-ROBOT INTERACTIONS Here we are interested in the problem of how a socially interacting robot can trigger emotional and even cognitive changes in the human partner. In order to do so we need to take into account several components of this interaction, which is mediated by a complex network of exchanges and could be described in the context of distributed adaptive control theory (see Lallee and Vershure 2015). Two major groups of HRI interactions can be defined here. This first involves those scenarios where interactions are short-lived (the robot companion exchanges take place over a small time window) or predictable (the robot is programmed for simple tasks). The second instead incorporates robotic agents that can learn from experience and interact through long time spans. A major difference between the two cases, in terms of the HRI is the absence and presence of emotional engagement (EE). The choice of EE as a key axis in our approach is grounded in previous studies on second-person neuroscience (Schlibach et al 2013). In this field, the key assumption is that an active social engagement between two (or more) individuals is fundamentally different from a mere observation of subjects. Within our context, we will distinguish between a situation of low EE where the two partners in a HRI are essentially independent from another one where each agent shapes others cognition. The space of HRI proposed here is summarised in figure 2a, where three axes have been used to locate different classes of robotic agents. In a way, this can be seen as the landscape of human-robot interactions. It provides a tentative picture of the diverse array of qualitative classes of HRI. Three axes are introduced, namely: the degree of cognitive complexity of robots and humans and a third axis linked to the emotional engagement, resulting from both a long-term interaction and the potential for learning and adaptation displayed by the robot. As shown in figure 2b and 2c, we can decompose this space, which we have partitioned in eight arbitrary combinations, in two main layers including low and high emotional ties. Below we present and discuss these two layers separately. A. Low emotional engagement In this level of engagement, robots are typically associated to simple tasks with low (if any) of cognitive complexity and playing the role of decision-making systems exhibiting low communication skills (figure 3b). Most standard socially interacting robots (at least the first generations of them) fall in this domain. The typical scenario is a programmed artificial agent that can perform predictable tasks and is expected to operate in simple environments. Humans (from toddlers to adults) interacting with sim- 4 ple robots (such as toys or automata following simple orders) would define a lower bound of low cognitive complexity for both agents. Cleaning robots such as Roomba and receptionist robots answering requests from clients (giving simple types of information) would be obvious examples, although even in this case the use of personalization toolkits triggers emotional connections (Sung et al 2009). In this domain, robots with high cognitive skills interacting with cognitively impaired individuals over specific tasks give the last option in our list. Robots can help in providing support to the elderly or impaired in ways that do not require learning potential from the artificial agent side. Robots capable of identifying the needs of their human partners can be helpful even if not emotionally engaged, while robots with a large amount of available data sets can be interesting as expert systems with userfriendly (humanoid) interfaces. Instead we weight cognition in terms of (pre-programmed) diverse repertoires of responses. Agents and operative systems exhibiting a rich repertoire of interactions, such as SIRI (which can assist blind people) or Alexa would fit the high-cognitive complexity corner. Here of course ”cognition” does not have the meaning that can be attributed to a neural system. For some of these non-embodied systems, a very large repertoire of potential answers can be communicated with the help of a natural language interface. The success of some systems such as Watson, which was trained for a specific goal (answering questions on the Jeopardy quiz show) using hundreds of millions of webpages illustrate the potential for surpassing humans in searching and solving questions. This layer and the next layer in our space, now allowing higher emotional engagement, are not clear cut. This is particularly relevant if we take into account the human tendency to extract behavioural or emotional clues from the interaction with even simple computer programs. It is worth remembering that even the earliest attempts to program machines (Weizenbaum 1966) capable for answering questions, such as ELIZA (which used pattern matching to simulate a conversation) led to rather unexpected reactions (Weizenbaum 1976). ELIZA was supposed to imitate a speaking psychiatrist, essentially creating simple responses triggered by key words that were then used to create simple questions. But in many cases, people failed to believe they were talking with a computer (which was far beyond in computer power from anything existing today). Similarly, some robots can be simple companions if their interactions span a short time scale but create a strong bond (from human to machine) with their owners if interactions occur over long, shared periods of time. To reach the second layer, we must allow artificial agents to learn and adapt in flexible ways, as well as be capable of exhibiting and detecting emotions. B. High emotional engagement Long-term relationships in HRI can lead to a rather distinct set of patterns that strongly depart from the previous layer. Here we consider the possibility that the robotic agents have been interacting with a given individual in a flexible manner and over an extended period of time. Such interaction might occur at different levels and this too is strongly dependent on the relative cognitive complexity or each partner (the human and the robot) as well as the level and span of their emotional interaction. A healthy, adult human brain is a highly complex system that can nevertheless engage in an emotionally strong relationship with a pet. Humans and dogs (and other pets) have been co-evolving over hundreds of thousands of years until today, where our animal companions have limited cognition powers but a highly developed set of skills associated to emotion recognition (Hare et al 2002). One side effect of this process is our tendency to generate empathy for non-living objects resembling pets. These evolutionary responses have left a detectable cognitive signal (Stoeckel et al 2014). What has been the outcome of HRI between human and artificial pets? A first glimpse of the implications of long-term exchanges between humans and pet robots capable of learning was provided by AIBO dogs, used as companions in a broad range of conditions, from preschool children to elder patients (Kahn et al 2006, Melson et al 2009). In the future, these type of pets (as well as those emerging from the Virtual reality world) are likely to become the rule rather than the exception (Rault 2015). Despite the lack of a complex communication, the domestication of dog’s cognition has lead to emotional ties that can be strong. All studies on HRI involving robotic pets reveal that human perception is markedly biased towards perceiving them as life-like entities and treated as such, instead as artifacts (Kahn et al 2006). This creates a number of interesting situations relevant for the problem addressed here, an in particular the blurring of lines between ontological categories. As a consequence, emotional ties and their consequent effects are likely to be shared. Such effects are enhanced by the development of some ”personality” associated to robot learning capacities, which can strengthen emotional ties. These differential behaviours result from the historical sequence of HRI events: by tapping AIBO’s head sensor after a given behavioural display, it is possible to enforce or decrease a given response, but each case and how it relates with other responses will depend on each specific HRI. Among other things, the loss of a pet can trigger a strong reaction in the human, but also in the animal end of the tie. Perhaps not surprisingly a similar situation has been emerging in relation with AIBO owners who, unable to repair their old dog robots, have to accept their ”death” and eventually organise funerals not different from those made for the living counterparts. In this case, the human and the robot are separated by a huge cognitive complexity gap, but the capacity of the robot for learn- 5 HAL9000 Expert AI Artificial cognitive complexity Watson Humanbot collaborative HRI Siri Alexa recepcionist ! robots Therapeutic! robots power exoskeleton an c ogn GWT Aibo (dog robot) Roomba Paro ! (seal robot) Hum Asimo game-playing! robots itive Nao com plexi ty KOG ELIZA Kismet ! ot Em ion a nt me e ag ng le FIG. 2 The cognitive space of H-R interactions under the two-agent perspective taken here. Non-robotic systems (such as ELIZA, SIRI or Watson) are also included. The axes represent (in a qualitative ordering) emotional engagement as well as two dimensions associated to the complexity displayed by the human and the artificial agents, respectively. Here the relative location of each system needs to be taken as indicative. Some of these robots appear in the high human cognitive complexity domain, mainly because their full operational function is expected to take place here, although they could in principle be useful in the other side of the cognition space. The domain where humanbot systems would emerge is indicated by a blurred sphere. A broad array of possible HRI pairs could be expected here, involving strong cognitive dependences that could generate, particularly when the human side is impaired, a new class of cognitive agent. ing and somewhat adopt some personality makes a big difference for their owners. The previous example would correspond to the possible interactions in the lower part of our space (figure 2c) associated with low robotic cognition. A relevant scenario is the interaction between elderly patients requiring care and therapy (the so called fourth age) and some robots, such as Paro: an artificial, seal-shaped agent. Paro is equipped with sensors detecting touch, light, sounds or movement, with motors and actuators and other standard robotic features but also with some additional features such as responses to cuddling and a constant seeking of eye contact. Additionally, several emotions have been programmed and it can respond to its own name as well as learn other names. Paro has been used in treatment of patients with dementia. The result of these interactions was a reduction of anxiety and helping recover from chronic ailments as well as improving communication with other patients and often creating strong attachments (Kidd et al 2006, Takayanagi et al 2014). Similar patterns have been found using AIBO (Melson et al 2009). Most companion robots helping patients with dementia are programmed to respond to specific tasks in a more or less flexible way. On a basic level, the robot can be very useful by reminding the human the name and/or location of objects. This has been proposed as a memory prosthetics for elders (Ho et al 2013) where the robotic companion would be equipped with a visual episodic memory, but consider now a HRI capable of learning and using natural language. On another level, it can serve as a medium to communicate with other humans and preventing isolation. Similarly, if capable of moving in outdoors environments, it could greatly improve orientation. But what if the artificial agent is equipped with a powerful cognitive system beyond simple reactions and capable of dealing with daily living environments using multimodal integration learning? Here deep neural networks can play a fundamental role, including the use of natural language (Noda et al 2014). Consider a robotic agent capable of maintaining a conversation, using natural language, and capable of gathering relevant information concerning past events related with the life of the patient, detecting goals and wishes as well as emotions and capable also of facial expression to share emotional states. This would also be a very de- 6 a Robot cognition + Low emotional engagement Cognitive ! support! robot Robot cognition f g h i j k Expert robots Receptionist robot Cleaning robot - + e Game-playing robots - b d Human cognition + High emotional engagement HumanBot Collaborative! HR interaction Therapeutic robots Home support robots - Robotic pets - Human cognition + FIG. 3 The cognitive space of H-R interactions (a-b) here the two layers associated to different emotional engagement (related to short/long term interactions) have been separated indicating potential examples within each discrete class. Several examples of robotic agents engaged in HRI are shown in d-k, including programmed systems with little or no emotional responses nor learning capabilities to robots capable of simulating emotions, seeking eye contact and other features that enhance human emotional and social responses. Here we show: (d) Roomba cleaning robot, (e) REEM, from PAL robotics, (f) ASIMO, (g) Pepper, (h) Aibo, (i) Paro the seal, (j) Nao and (k) Milo. sirable form of interaction, since the loss of memories or -more generally- the difficulties to access stored recollections can be a great source of stress for elder people with mild cognitive impairment1 and Alzheimer’s patients in particular, specially in early phases of the disease. An artificial agent capable of coping with memory decay and disorientation by means of verbal communication would leverage the anxieties associated to cognitive decline and improve reasoning and judgement. If flexible enough, a 1 This refers usually to a transition stage between a normal process of brain ageing and dementia, characterised by low performance in memory tasks neural agent can learn how to help the human in the most useful and personalised way. And here comes the problem. The HRI involved here leads to a rather unique outcome. For example, if the artificial agent provides support to losses in episodic memory, a first paradoxical situation might emerge: it can occur that some events become absent from the impaired brain while they remain stored within the artificial agent. Such stored recollections can be easily over-interpreted by the artificial agent, in particular their relative value and potential correlations among different memories. On a general level, reminding the human subject where are the lost keys or a misplaced wallet are simple and yet important tasks that can easily counterbalance or alleviate early symptoms. 7 But it can also have a major impact on autobiographical memory. This class of memory, associated to the left prefrontal cortex, provides the basis for putting together a timeline of past events connected to visual and sensoryperceptual features. We should have in mind that a major limitation of robotic agents (and a crucial component of the human mind, Suddendorf 2013) is their lack of understanding or representation of time. The agent, if properly equipped with visual recognition systems, can have seen pictures of family members (alive or not) and learned about their stories from the patient. These stories can be true or not, but in both cases the agent will contribute to store and recover them. A great advantage of any neural-based system capable of pattern recognition and generalisation (as deep learning networks, see LeCun et al 2015, and references therein) is that the robot can extract correlations required to help in more complex tasks, particularly in relation to episodic, semantic and working memory as well as language and executive functioning. But these correlations rely on both the (possibly faulty) input provided by the human and the emotional weight given to each memory by both partners within the HRI. Because correlations are likely to be generated from biased perceptions, the resulting internal correlation matrix created by the robot (and returned to the human through HRI events) can depart from the original correlations generated in the brain. If we take into account that memories themselves are not reliable (this in particular affects priming) the longterm HRI inevitably leads to considerable deviations from the original memory web. In this respect, we have a first glimpse of an anomalous pattern: potential memory deficits are compensated by the reliable storage of information residing in the artificial neural network, which can use false memories, create incorrect (but strong) correlations associated to emotional events and feed-back them into the mind of the human. Can this process lead to a runaway amplification phenomenon? What seems likely to occur is that mismatches between the relevance and emotional weight associated to different memory patterns and their interactions might promote deep distortions of the memory and behavioral landscapes. As the HRI proceeds, a new set of interactions will coalesce between the human connectome Γh (figure 1d) and the network of neural correlations created within the robot brain (Γr ). The whole cognitive map must be found in the merged structure Γ that includes both networks along with all the human-robot correlations that have emerged and that we also indicate as links between areas. The loss of plasticity that results from ageing or damage reinforces dependencies among human and robotic cognitive maps mediated by co-occurrence patterns. The view of a given object or image elicits a response in both sides that defines effectively an interaction between both, since these responses will immediately lead to an information exchange. Consider for example a picture of someone (or any other representation of it) that is identified by the human and also stored by the robotic companion. Pre- vious exchanges will have weighted the relevance of this picture and the associated subnetwork of related objects, people or actions. As cognitive impairment grows in time, the relative importance of the object representation within the artificial system might have been enhanced beyond its original relevance, while exciting and reinforcing other related subnetworks. If decisions or actions derive from this perception, the loss of proper decision making by the human might have been displaced towards the robot, thus shifting the deep correlates from one agent to the other and helping to preserve episodic and semantic memory. Alternatively, different perception and decision layers might become segregated between them. If the memory of this specific image is gone from the human, it can nevertheless remain accessible in the artificial side, which would now contain part of the autobiographical memory. Since other related events connected to this memory might indirectly interact with the brain network, it is possible that novel forms of hybrid memory might emerge. However, despite the positive side of keeping otherwise erased memories, the dynamics associated to the formation of the HR network can easily shift the importance of events over time and even disrupt it. Unless under some external supervision by close relatives of the patient, the humanbot can lead to a shared mind that strongly departs from the organisation and coherence of the original subject. In other words, one outcome of this HRI is the conscious experience of a different subject, like living in the mind of someone else. The humanbot is a likely outcome of future HRI and its potential to become real is tied to the new generations of robots equipped with powerful learning systems and high memory capacities. These robots might be not yet here, but they are certainly much closer than the coming of intelligent machines. III. DISCUSSION The increasing frequency of dementias, being Alzheimer’s the most common one, will affect millions of human beings in the next decades (Reitz et al 2011). While prevention strategies are developed and new drugs are been tested, the need to caregivers helping these patients is becoming a major issue. Beyond the staggering economic costs, caregivers (often family members) are also affected by strong physical and emotional stress. In many cases, their health is also deteriorated. The possibility of using a robotic agent providing help seems a desirable option, although ethical issues need to be considered (Ienca et al 2016). Because cognitive decay is a central issue in most cases, the artificial agent should be equipped with a flexible, adaptive system capable of dealing with changing conditions and specific needs. But such plasticity and learning potential can generate new emergent phenomena. In this paper we have explored the potential outcomes of long-term HRI with artificial agents able to replace memory deficits and communicat- 8 ing through a natural language interface. As discussed above, the increasing replacement of faulty cognitive networks is likely to create a profound dependency of the human companion that can eventually end in a blurred boundary between the robot and the brain. There are other implications derived from this class of long-term HRI: (a) The theory of attractor neural networks (Amari and Maginu 1988; Amit 1992; Rojas 2013) has shown that the qualitative responses of neural networks concerning their responses to noise, memory potential and other properties can experience sharp changes as some parameters are tuned. One particular example is the rapid decline of associative memory as the neural network is damaged beyond a given threshold. Similarly, the qualitative changes associated to an mismatch between the memory requirements and the available cognitive power can lead to the emergence of spurious memory states that is decoupled from the real repertoire of original memories. In all these cases, neural networks display different phases separated by well defined phase transition points (Amit 1992). If these results, grounded in simple neural network models, can be extrapolated to our hybrid system, we would expect to observe tipping points in the cognitive organisation of memories and other key properties. (b) human beings display awareness, while machines (so far) do not. A relevant problem concerning consciousness is how to define it and even how to measure it (Tononi and Edelman 1998). Some efforts in this direction suggest that a single parameter Φ could be defined that can capture the degree of consciousness (Tononi 2012). Using this parameter, obtained from an information theoretic approach, it has been argued that we can to the least order different case studies, from animals to impaired human brains or machines (Tononi and Koch 2015). An interesting outcome of this approach is the suggestion that machines (in particular those based on von Neumann architecture) are not conscious (Tononi et al. 2016). Without discussing this conclusion, it seems clear that the humanbot, by inhabiting the boundaries between human and machine will also incorporate some level of consciousness (as measured by Φ). Under the conditions described above, we need to ask the impact of the cognitive replacement associated to the increasing interdependence and how is consciousness shared by both parts. (c) Once the human is gone, we should seriously evaluate what is left behind within the robot. As long term interactions are likely to shape the robotic cognitive network, some key components of the human’s mind might remain there for inspection or preservation. Once deceased, what is left can keep changing as other inputs from the external world keep entering the system, thus modifying or even erasing the previous stored memories. What to do next? Should the capacity for inspecting the environment be put on hold? Would the robot be ca- pable of interacting with friends and close people of the deceased in meaningful ways? Should the stored information be preserved as the only relevant remain of the gone mind? One of the most interesting and puzzling components of Asimov’s vision of a future with robots playing a major role in our society was the existence of a novel research field: robopsychology. Experts in this area had to deal with the sometimes unexpected behavior of robots, emerging from the conflicts associated to the there rules of robotics and their inevitable interaction with a complex external world. In the picture presented here, a different (but related) class of robotic psychology might emerge in the future. The interaction, merging and blurring of behavioral patterns resulting from the HRI described above defines an uncharted territory. Long before machines might outsmart us or develop consciousness or intelligent behaviour (Barrat 2013) we will need to either face the rise of the humanbot or prevent it to happen. Acknowledgments The author would like to thank Luis Seoane, Marti Sanchez-Fibla and Paul Vershure for a critical reading of the manuscript and useful discussions on artificial intelligence, evolved agents and complexity. Also to Joan Manel Solé, with whom I discussed and wrote as freshmen my first codes implementing the ELIZA program. This work has been supported by the Botı́n Foundation by Banco Santander through its Santander Universities Global Division, a MINECO FIS2015-67616 fellowship and by the Santa Fe Institute. IV. REFERENCES 1. Amari, S. I., and Maginu, K. (1988). Statistical neurodynamics of associative memory. Neural Networks 1, 63-73. 2. Amit, D. J. (1992). Modeling brain function: The world of attractor neural networks. Cambridge University Press. 3. Arel, I., Rose, D. C., and Karnowski, T. P. 2010. Deep machine learning-a new frontier in artificial intelligence research [research frontier]. Comput. Intell. Magazine IEEE 5, 13-18. 4. Barrat, J. (2013) Our final invention. Artificial intelligence and the end of the human era. Thomas Dunne Books. New York. 5. Bradshaw, Jeffrey M., et al. 2004. Making agents acceptable to people. In: Intelligent Technologies for Information Analysis. Springer Berlin Heidelberg, pp. 361-406. 9 6. Breazeal, C. L. 2004. Designing sociable robots. MIT press. 7. Breazeal, C. L. et al. 2016. Social Robotics. In: Springer Handbook of Robotics. Springer. pp. 1935-1972. 8. Buttazzo, G. 2001. Artificial consciousness: Utopia or real possibility?. Computer 34, 24-30. 9. Clark, A. and Grush, R. (1999). Towards a cognitive robotics. Adaptive Behavior, 7, 5-16. 10. Edelman, G. 1992. Bright air, brilliant fire. Basic Books. 11. Fellous, J. M. and Arbib, M. A. (Eds.). 2005. Who needs emotions?: The brain meets the robot. Oxford University Press. 12. Floreano, D., Ijspeert, A. J. and Schaal, S. 2014. Robotics and Neuroscience. Curr. Biol. 24, R910R920. 13. Gorbenko, A., Popov, V. and Sheka, A. 2012. Robot self-awareness: Exploration of internal states. Applied Math. Sci. 6, 675-688. 14. Holland, O. 2003. Machine consciousness. Imprint Academic. 22. Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A. et al. 2015. Human-level control through deep reinforcement learning. Nature 518, 529-533. 23. Noda, K., Arie, H., Suga, Y. and Ogata, T. (2014). Multimodal integration learning of robot behavior using deep neural networks. Robotics and Autonomous Systems 62, 721-736. 24. Nourbakhsh, I. R. 2013. Robot futures. MIT Press. 25. Oztop, E., Kawato, M. and Arbib, M. 2006. Mirror neurons and imitation: A computationally guided review. Neural Networks 19, 254-271. 26. Prescott, T. J., Gonzalez, F. M. M., Gurney, K., Humphries, M. D. and Redgrave, P. (2006). A robot model of the basal ganglia: behavior and intrinsic processing. Neural Networks, 19, 31-61. 27. Rault, J. L. (2015). Pets in the Digital Age: Live, Robot, or Virtual?. Frontiers Vet. Science, 2. 28. Reitz, C., Brayne, C. and Mayeux, R. (2011). Epidemiology of Alzheimer disease. Nature Rev. Neurology, 7, 137-152. 29. Reggia, J. A. 2013. The rise of machine consciousness: Studying consciousness with computational models. Neural Networks 44, 112-131. 15. Ienca, M., Jotterand, F., Vic?, C. and Elger, B. (2016). Social and Assistive Robotics in Dementia Care: Ethical Recommendations for Research and Practice. International Journal of Social Robotics 8, 565-573. 30. Rojas, R. (2013). Neural networks: a systematic introduction. Springer Science. 16. Kahn P. H., Friedman, B., Perez-Granados, D. R. and Freier, N. G. (2004, April). Robotic pets in the lives of preschool children. Interaction Studies 7, 405-436. 32. Sporns, O., and Alexander, W. H. (2002). Neuromodulation and plasticity in an autonomous robot. Neural Networks, 15, 761-774. 17. Kidd, C. D., Taggart, W., and Turkle, S. (2006). A sociable robot to encourage social interaction among the elderly. In Proceedings 2006 IEEE International Conference on Robotics and Automation, 2006. ICRA 2006. pp. 3972-3976. 18. Koch, C. 2015. Do Androids Dream?. Sci. Am. Mind 26, 24-27. 19. LeCun, Y., Bengio, Y. and Hinton, G. 2015. Deep learning. Nature, 521, 436-444. 20. Marques, H. G. and Holland, O. 2009. Architectures for functional imagination. Neurocomputing 72, 743-759. 21. Melson, G. F., Kahn Jr, P. H., Beck, A. and Friedman, B. (2009). Robotic pets in human lives: Implications for the human-animal bond and for human relationships with personified technologies. Journal Social Issues, 65, 545-567. 31. Solé, R. (2016). Synthetic transitions: towards a new synthesis. Phil. Trans. R. Soc. B, 371, 20150438. 33. Sung, J., Grinter, R. E. and Christensen, H. I. (2009, April). Pimp my roomba: Designing for personalization. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (pp. 193-196). ACM. 34. Suddendorf, T. 2013. The gap: The science of what separates us from other animals. Basic Books. 35. Takayanagi, K., Kirita, T., and Shibata, T. (2014). Comparison of Verbal and Emotional Responses of Elderly People with Mild/Moderate Dementia and Those with Severe Dementia in Responses to Seal Robot, PARO. Frontiers Aging Neurosci. 6, 257. 36. Takeno, J. 2012. Creation of a Conscious Robot: Mirror Image Cognition and Self-Awareness. CRC Press. 37. Tononi, G. and Koch, C. 2015. Consciousness: here, there and everywhere?. Phil. Trans Royal Soc. London B 370, 20140167. 10 38. Tononi, G. 2012. Φ, Phi, a voyage from the brain to the soul. Pantheon Books. New York. 39. Tononi, G. and Edelman, G. M. 1998. Consciousness and complexity. Science 282, 1846-1851. 40. Tononi, G., Boly, M., Massimini, M. and Koch, C. (2016). Integrated information theory: from consciousness to its physical substrate. Nature Reviews Neuroscience (in press). 41. Turing, A. M. 1950. Computing machinery and intelligence. Mind 59, 433-460. 42. Verschure, P. F., Kröse, B. J. and Pfeifer, R. (1992). Distributed adaptive control: The self-organization of structured behavior. Robotics and Autonomous Systems, 9, 181-196. 43. Verschure, P. F., Pennartz, C. M. and Pezzulo, G. (2014). The why, what, where, when and how of goal-directed choice: neuronal and computational principles. Phil. Trans. R. Soc. B, 369, 20130483. 44. Verschure, P. F. (2016). Synthetic consciousness: the distributed adaptive control perspective. Phil. Trans. R. Soc. B, 371, 20150448. 45. Weizenbaum, J. (1966). ELIZA: a computer program for the study of natural language communication between man and machine. Comm. ACM. 36-45. 46. Zarkadakis, G. (2015). In Our Own Image: Will artificial intelligence save or destroy us?. Random House. New York.
2cs.AI
Sparse Sliced Inverse Regression for High Dimensional Data Qian Lin arXiv:1611.06655v1 [math.ST] 21 Nov 2016 Center of Mathematical Sciences and Applications Harvard University Cambridge, MA 02138 USA E-mail: [email protected] Zhigen Zhao Department of Statistical Science Fox School of Business Temple University Philadelphia, PA 19122 E-mail: [email protected] Jun S. Liu Department of Statistics Harvard University Cambridge, MA 02138-2901 USA E-mail: [email protected] Summary. For multiple index models, it has recently been shown that the sliced inverse regression (SIR) is consistent for estimating the sufficient dimension reduction (SDR) subspace if and only if the dimension p and sample size n satisfies that ρ = lim np = 0. Thus, when p is of the same or a higher order of n, additional assumptions such as sparsity have to be imposed in order to ensure consistency for SIR. By constructing artificial response variables made up from top eigenvectors of the estimated conditional covariance matrix, vd ar(E[x|y]), we introduce a simple Lasso regression method to obtain an estimate of the SDR subspace. The resulting algorithm, Lasso-SIR, is shown to be consistent and achieve the optimal convergence rate under certain sparsity conditions when p is of order o(n2 λ2 ) where λ is the generalized signal noise ratio. We also demonstrate the superior performance of Lasso-SIR compared with existing approaches via extensive numerical studies and several real data examples. 1. Introduction Dimension reduction and variable selection have become indispensable steps for most data analysts in this big data era, where thousands or even millions of features are easily obtained for only hundreds or thousands of samples (n). With these ultra high-dimensional data, an effective modeling strategy is to assume that only a few features and/or a few linear combinations of these features carry the information that researchers are interested in. Namely, 2 Lin, Zhao, and Liu one can consider the following multiple index model [Li, 1991]: y = f (βτ1 x, β τ2 x, ..., βτd x, ǫ), (1) where x follows a p dimensional elliptical distribution with covariance matrix Σ, the βi ’s are unknown projection vectors, d is unknown but is assumed to be much smaller than p, and the error ǫ is independent of x and has mean 0. When p is very large, it is perhaps reasonable to further restrict each βi to be a sparse vector. Since the introduction of the sliced inverse regression (SIR) method by Li [1991], many sufficient dimension reduction (SDR, a term coined by Cook [1998]) methods have been proposed to estimate the space spanned by (β 1 , · · · , βd ) with few assumptions on the link function f (·). With the multiple index model (1), the objective of all SDR methods is to find the minimal subspace S ⊆ Rp such that y ⊥ ⊥ x | PS x, where PS stands for the projection operator to the subspace S. When the dimension of x is moderate, all SDR methods including SIR, which is most popular due to its simplicity and computational efficiency, have shown successes in various application fields [Xia et al., 2002, Ni et al., 2005, Li and Nachtsheim, 2006, Li, 2007, Zhu et al., 2006]. However, these methods were previously known to work only when the sample size n grows much faster than the dimension p, an assumption that becomes inappropriate for many modern datasets, such as those from biomedical researches. It is thus of great interest to have a thorough investigation of “the behavior of these SDR estimators when n is not large relative to p”, as raised by Cook et al. [2012]. Lin et al. [2015] made an attempt to address the aforementioned challenge for SIR. They showed that, under mild conditions, the SIR estimate of the central space is consistent if and only if ρn = lim np goes to zero as n grows. Additionally, they showed that the convergence rate of the SIR estimate of the central space (without any sparsity assumption) is ρn . When p is much greater than n, however, certain constraints must be imposed in order for SIR to be consistent. The sparsity assumption, i.e., the number of active variables (s) must be an order of magnitude smaller than n and p, appears to be a reasonable one. In a follow-up work, Neykov et al. [2016] studied the sign support recovery problem of the single index model (d = 1), suggesting that the correct optimal convergence rate for estimating the central space , a speculation that is partially confirmed in Lin et al. [2016]. It is shown that, might be s log(p) n for multiple index models with bounded dimension d and the identity covariance matrix, the log(p/s) optimal rate for estimating the central space is ds+s nλ , where λ is the smallest non-zero eigenvalue of var(E[x|y]). They further showed that the Diagonal-Thresholding algorithm proposed in Lin et al. [2015] achieves the optimal rate for the single index model with the identity covariance matrix. The main idea. In this article, we introduce an efficient Lasso variant of SIR for the multiple index model (1) with a general covariance matrix Σ. Consider the single index model: y = f (βτ x, ǫ). Let η be the eigenvector associated with the largest eigenvalue of var(E[x|y]). Since β ∝ Σ−1 η, there are two immediate ways to estimate the space spanned by β. The first approach, as discussed in Lin et al. [2015], estimates the inverse of Σ and η separately (see Algorithm 1). The second one avoids estimating the inverse of the covariance matrix Σ directly by solving the following penalized least square problem k n1 XX τ β − ηk22 + µkβk1 , where X is the p × n covariate matrix formed by the n samples (see Algorithm 2). However, Sparse Sliced Inverse Regression for High Dimensional Data 3 similar to most L1 penalized approaches for nonlinear models, theoretical underpinning of this approach has not been well understood. Since these two approaches provide good estimates compared with other existing approaches (e.g.,Li [1991], Li and Nachtsheim [2006], Li [2007]), we set them as benchmarks for further comparisons. b of vd We note that an eigenvector η ar(E[x|y]), where vd ar(E[x|y]) is an estimate of the conditional covariance matrix var(E[x|y]) using SIR [Li, 1991], must be a linear combination e ∈ Rn of the column vectors of X. Thus, we can construct an artificial response vector y 1 e , and estimate β by solving another penalized least square problem: b = nXy such that η τ 1 e 2 ky − X βk2 + µkβk1 (see Algorithm 3). We call this algorithm “Lasso-SIR”, which is 2n computationally very efficient. In Section 3, we further show that the convergence rate of , which is optimal if s = O(p1−δ ) for some the estimator resulting from Lasso-SIR is s log(p) nλ positive constant δ. Note that Lasso-SIR can be easily extended to other regularization and SDR methods, such as SCAD (Fan and Li [2001]), Group Lasso (Yuan and Lin [2006]), sparse Group Lasso (Simon et al. [2013]), SAVE (Cook [2000]), etc. Connection to Other work. Estimating the central space is widely considered as a generalized eigenvector problem in the literature [Li, 1991, Li and Nachtsheim, 2006, Li, 2007, Chen and Li, 1998]. Lin et al. [2016] explicitly described the similarities and differences between SIR and PCA (as first studied by Jung and Marron [2009]) under the “high dimension, low sample size (HDLSS)” scenario. However, after comparing their results with those for Lasso regression, Lin et al. [2016] advocated that a more appropriate prototype of SIR (at least for the single index model) should be the linear regression. In the past three decades, tremendous efforts have been put into the study of linear regression models y = xτ β + ǫ for HDLSS data. By imposing the L1 penalty on the regression coefficients, the Lasso approach [Tibshirani, 1996] is rate optimal in estimating β in the sense that it achieves the maximum convergence rate [Raskutti et al., 2011]. Because of apparent limitations of linear models, there are many attempts to build flexible and computationally friendly semi-parametric models, such as the projection pursuit regression [Friedman and Stuetzle, 1981, Chen, 1991], sliced inverse regression [Li, 1991], and MAVE [Xia et al., 2002]. However, none of these methods work under the HDLSS setting. Existing theoretical results for HDLSS data mainly focus on linear regressions [Raskutti et al., 2011] and submatrix detections [Butucea et al., 2013], and are not applicable to index models. In this paper, we provide a new framework for the theoretical investigation of regularized SDR methods for HDLSS data. The rest of the paper is organized as follows. After briefly reviewing SIR, we present the Lasso-SIR algorithm in Section 2. The consistency of the Lasso-SIR estimate and its connection to the Lasso regression are presented in Section 3. Numerical simulations and real data applications are reported in Sections 4 and 5. Some potential extensions are briefly discussed in Section 6. To improve the readability, we defer all the proofs and brief reviews of some existing results to the appendix. 4 2. Lin, Zhao, and Liu Sparse SIR for High Dimensional Data 2.1. Notation We adopt the following notations throughout this paper. For a matrix V , we call the space generated by its column vectors the column space and denote it by col(V ). The i-th row and j-th column of the matrix are denoted by V i,∗ and V ∗,j , respectively. For (column) vectors x and β ∈ Rp , we denote their inner product hx, βi by x(β), and the k-th entry of x by x(k). For two positive numbers a, b, we use a ∨ b and a ∧ b to denote max{a, b} and min{a, b} respectively; We use C, C ′ , C1 and C2 to denote generic absolute constants, though the actual value may vary from case to case. For two sequences {an } and {bn }, we denote an ≻ bn and an ≺ bn if there exist positive constants C and C ′ such that an ≥ Cbn and an ≤ C ′ bn , respectively. We denote an ≍ bn if both an ≻ bn and an ≺Pbn hold. The (1, ∞) norm and (∞, ∞) norm of matrix A are defined by kAk1,∞ = max1≤j≤p pi=1 |Ai,j | and is sufficiently max1≤i,j≤n kAi,j k respectively. To simplify discussions, we assume that s log(p) nλ small. We emphasize again that our covariate data X is a p × n instead of the traditional n × p matrix. 2.2. A brief review of Sliced Inverse Regression (SIR) In the multiple index model (1), the matrix B formed by the vectors β1 , ..., βd is not identifiable. However, col(B), the space spanned by the columns of B is uniquely defined. Given n i.i.d. samples (yi , xi ), i = 1, · · · , n, as proposed in Li [1991], SIR first divides the data into H equal-sized slices according to the order statistics y(i) , i = 1, . . . , n. To ease notations and arguments, we assume that n = cH and E[x] = 0, and re-express the data as yh,j and xh,j , where h refers to the slice number and j refers to the order number of a sample in the h-th slice, i.e., yh,j = y(c(h−1)+j) , xh,j = x(c(h−1)+j) . Here x(k) is the concomitant of y(k) . Let the sample mean in the h-th slice be denoted by xh,· , then Λ , var(E[x|y]) can be estimated by: b Λ H H 1 X 1 = x̄h,· x̄τh,· = X τH X H H h=1 H (2) where X H is a p×H matrix formed by the H sample means, i.e., X H = (x1,· , . . . , xH,· ). Thus, cH ), where V cH is the matrix formed by the top d eigenvectors col(Λ) is estimated by col(V b c of ΛH . The col(V H ) was shown to be a consistent estimator of col(Λ) under a few technical conditions when p is fixed [Duan and Li, 1991, Hsing and Carroll, 1992, Zhu et al., 2006, Li, 1991, Lin et al., 2015], which are summarized in the online supplementary file. Recently, cH ) is consistent for col(Λ) if and only if ρn = p → 0 Lin et al. [2015, 2016] showed that col(V n as n → ∞, and that the number of slices H can be chosen as a fixed integer independent of n and p when the dimension d of the central space is bounded. When x’s distribution is elliptically symmetric, Li [1991] showed that Σcol(B) = col(Λ), (3) and thus our goal is to recover col(B) by solving the above equation, which can be easily b −1 col(V cH ) when ρn → 0 [Lin et al., 2015], where \ =Σ and consistently achieved by col(B) 5 Sparse Sliced Inverse Regression for High Dimensional Data b = 1 XX τ , the sample covariance matrix of x. However, this simple approach breaks Σ n down when ρn 6→ 0, especially when p ≫ n. Although stepwise methods [Zhong et al., 2012, Jiang and Liu, 2014] can work under HDLSS settings, the sparse SDR algorithms proposed in Li [2007] and Li and Nachtsheim [2006] appeared to be ineffective. Below we describe two intuitive non-stepwise methods for HDLSS scenarios, which will be used as benchmarks in our simulation studies to measure the performance of newly proposed SDR algorithms. Diagonal Thresholding-SIR. When p ≫ n, the Diagonal Thresholding (DT) screening method [Lin et al., 2015] proceeds by marginally screening all the variables via the diagonal b and then applying SIR to those retained variables to obtain an estimate of elements of Λ H col(B). The procedure is shown to be consistent if the number of nonzero entries in each row of Σ is bounded even when p ≫ n. Algorithm 1 DT-SIR b to select the set of important predic1: Use the magnitudes of the diagonal elements of Λ H tors I, with |I| = o(n) 2: Apply SIR to the data (y, xI ) to estimate a subspace SbI . 3: Extend SbI to a subspace in Rp by filling in 0′ s for unimportant predictors. Matrix Lasso. We can bypass the estimation and inversion of Σ by solving an L1 penalization problem. Since (3) holds at the population level, we speculate that a reasonable estimate of col(B) can be obtained by solving a sample-version of the equation with an b 1, · · · , η b d be the appropriate regularization term to cope with the high dimensionality. Let η b eigenvectors associated with the largest d eigenvalues of ΛH . Replacing Σ by its sample version n1 XX τ and imposing an L1 penalty, we obtain a penalized sample version of (3): 1 b i k22 + µi kβk1 k XX τ β − η n (4) for an appropriate choice of parameter µi . Algorithm 2 Matrix Lasso b ; b 1 , ..., η b d be the eienvectors associated with the largest d eigenvalues of Λ 1: Let η H b 2: For 1 ≤ i ≤ d, let β i be the minimizer of equation (4) for an appropriate choice of µi ; b , ..., β b ). 3: Estimate the central space col(B) by col(β 1 d This simple procedure can be easily implemented to produce sparse estimates of βi ’s. Empirically it works reasonably well, so we set it as another benchmark to compare with. Since we later observed that its numerical performance was consistently worse than that of our main algorithm, Lasso-SIR, we did not further investigate its theoretical properties. 6 Lin, Zhao, and Liu 2.3. Lasso-SIR Let us first consider the single index model y = f (xτ β0 , ǫ). (5) Without loss of generality, we assume that (xi , yi ), i = 1, . . . , n, are sorted i.i.d. samples such that y1 ≤ y2 ≤ · · · ≤ yn . Construct an n × H matrix M = I H ⊗ 1c , where 1c is the c × 1 vector with all entries being 1. Then, according to the definition of X H , we can b = 1 X X τ and let η b be the largest eigenvalue of Λ b be the write X H = XM /c. Let λ H H H H corresponding eigenvector of length 1. That is, b= λ̂η Thus, by defining 1 τ 1 τ b= b. XH XH η X M M τ Xη H nc e= y 1 b cλ b M Mτ Xη (6) e . Note that a key in estimating the central space col(β) of SIR is the we have η̂ = n1 X y b and n1 XX τ respectively, this equation equation η ∝ Σβ. If approximating η and Σ by η τ 1 1 b ∝ β, one can consider the e ∝ n XX β. To recover a sparse vector β can be written as n X y following optimization problem min ||β||1 , e − X τ β)||∞ ≤ µ, subject to ||X(y which is known as the Dantzig selector [Candes and Tao, 2007]. A related formulation is the Lasso regression, where β is estimated by the minimizer of Lβ = 1 e − X τ βk22 + µkβk1 . ky 2n (7) As shown by Bickel et al. [2009], the Dantzig Selector is asymptotically equivalent to the Lasso for linear regressions. We thus propose and study the Lasso-SIR algorithm in this paper and leave the discussion of the Dantzig selector in a future work. Algorithm 3 Lasso-SIR (for single index models) b , respectively; b and η b be the first eigenvalue and eigenvector of Λ 1: Let λ H e= 2: Let y 1 b M M τ Xη cb λ and solve the Lasso optimization problem b β(µ) = arg min Lβ , where Lβ = 3: Estimate Pβ by Pβ b(µ) . 1 e − X τ βk22 + µkβk1 ; ky 2n Clearly, we do not need to estimate the inverse of Σ in Lasso-SIR. Moreover, since the optimization problem (7) is well studied for linear regression models [Tibshirani, 1996, Sparse Sliced Inverse Regression for High Dimensional Data 7 Efron et al., 2004, Friedman et al., 2010], we may formally “transplant” their results to the index models. Specifically, we use the R package glmnet to solve the optimization problem where the tuning parameter µ is chosen based on cross-validation. Last but not least, Lasso-SIR can be easily generalized to the multiple index model (1). b and η b , 1 ≤ i ≤ d, be the d-top eigenvalues of Λ b = (η b 1, · · · , η b d ) be the corresponding Let λ i H eigenvectors. Similar to the definition of the “pseudo response variable” for the single index f as model, we define a multivariate pseudo response Y 1 1 1 f b diag( , · · · , ). Y = M M τ Xη b b c λ1 λd (8) We then apply the Lasso on each column of the pseudo response matrix to produce the b ′ s. corresponding β i Algorithm 4 Lasso-SIR (for multiple index model) b respectively. b and η b i , i = 1, · · · , d be the top d eigenvalues and eigenvectors of Λ 1: Let λ i H f = 1 M M τ Xη b diag( 2: Let Y c tion problem 1 b λ1 , · · · , b1 ) and for each 1 ≤ i ≤ d solve the Lasso optimizaλd b = arg min L β β,i where Lβ,i = i 1 f kY ∗,i − X τ βk22 + µkβk1 . 2n c be the matrix formed by β b ,··· ,β b . The estimate of PB is given by P . 3: Let B 1 d b B The number of directions d plays an important role when implementing Algorithm 4. A common practice is to locate the maximum gap among the ordered eigenvalues of the matrix b , which does not work well under HDLSS settings. In Section 3, we show that there exists Λ H a gap among the adjusted eigenvalues λ̂ai = λ̂i ||β̂i ||2 where β̂i is the i-th output of Algorithm 4. Motivated by this, we estimate d according to the following algorithm: Algorithm 5 Estimation of the number of directions d 1: Apply Algorithm 4 by setting d = H; 2: For each i, calculate λ̂ai = λ̂i ||β̂i ||2 ; 3: Apply the k-means method on λ̂ai with k being 2 and the total number of points in the cluster with larger λ̂a is the estimated value of d. 3. Consistency of Lasso-SIR For simplicity, we assume that x ∼ N (0, Σ). The normality assumption can be relaxed to elliptically symmetric distributions with sub-Gaussian tail; however, this will make technical arguments unnecessarily tedious and is not the main focus of this paper. From now on, we assume that d, the dimension of the central space, is bounded; thus we can assume that H, 8 Lin, Zhao, and Liu the number of slices, is also finite [Lin et al., 2016, 2015]. In order to prove the consistency, we need the following technical conditions: A1) There exist two positive constants Cmin < Cmax , such that Cmin < λmin (Σ) ≤ λmax (Σ) < Cmax ; A2) There exists a constant κ ≥ 1, such that 0 < λ = λd (var(E[x|y]) ≤ ... ≤ λ1 (var(E[x|y]) ≤ κλ ≤ λmax (Σ); A3) The central curve m(y) = E[x|y] satisfies the sliced stability condition. Condition A1 is quite mild and standard. Condition A2 is merely a refinement of the coverage condition, rank(var(E[x|y])) = d, a common assumption in the SIR literature. A3 is a condition on the central curve, or equivalently, a regularity condition on the link funcb γ converges to var(γ τ E[x|y]) for any tion f (·) and the noise ǫ. It guarantees that γ τ Λ H γ ∈ col(var(E[x|y])). These conditions play indispensable roles in establishing the phase transition phenomenon of SIR [Lin et al., 2015] and the minimax rate of SIR over a large class of models [Lin et al., 2016]. As discussed in Lin et al. [2016] and Neykov et al. [2016], Condition A3 can be derived from a slightly stronger version of the commonly used condition introduced by Hsing and Carroll [1992]. To improve the readability and avoid duplicating existing results, we leave further discussion of Condition A3 in the online supplementary file. For single index model, there is a more intuitive explanation of the condition A2. Since rank(var(E[x|y])) = 1, condition A2 is simplified to 0 < λ = λ1 ≤ λmax (Σ) which is a direct corollary of the total variance decomposition identity ( i.e., var(x) = var(E[x|y]) + E[var(x|y)]). We may treat λ as a generalized SN R and A2 simply requires that the generalized SNR is non-zero. Remark 1 (Generalized SN R and eigenvalue bound). Recall that the the signalto-noise ratio (SN R) for the linear model y = βτ x + ǫ, where x ∼ N (0, Σ) and ǫ ∼ N (0, 1), is defined as SN R = kβk22 βτ0 Σβ0 E[(βτ x)2 ] . = E[y 2 ] 1 + kβk22 βτ0 Σβ 0 where β0 = β/kβk2 . A simple calculation shows that var(E[x|y]) = Σββτ Σ β τ0 Σβ0 kβk22 +1 , and λ(var(E[x|y])) = β τ0 ΣΣβ0 kβk22 , βτ0 Σβ0 kβk22 + 1 where λ(var(E[x|y])) is the unique non-zero eigenvalue of var(E[x|y]). This leads to the identity βτ ΣΣβ 0 λ(var(E[x|y])) = 0 τ SN R. β0 Σβ 0 Thus, we call λ, the smallest non-zero eigenvalue of var(E[x|y]), the generalized SN R for multiple index models. Sparse Sliced Inverse Regression for High Dimensional Data 9 b be the Theorem 1 (Consistency of Lasso-SIR for Single Index Models). Let β α output of Algorithm 3. Assume that nλ = p for some α > 1/2 and that conditions A1-A3 hold for the single index model, y = f (βτ0 x, ǫ), where β 0 is a unit vector, then kPβb − Pβ0 kF ≤ C1 s s log(p) nλ holds with probability at least 1 − C2 exp(−C3 log(p)) for some constants C2 and C3 . The technical assumption nλ = pα for some α > 1/2 could be replaced by some sparsity conditions on the covariance matrix Σ. Since our focus here is to introduce the Lasso-SIR algorithm, we leave this extension in our future study. Next, we state the theoretical result regarding the multiple index model (1). b be the output of Algorithm 4 where Theorem 2 (Consistency of Lasso-SIR). Let B d, the dimension of central subspace, is known. Assume that that nλ = pα for some α > 1/2 (where λ is the smallest nonzero eigenvalue of var(E[x|y]) ), and that conditions A1-A3 hold for the multiple index model (1), then kPB b − PB kF ≤ C1 s s log(p) . nλ holds with probability at least 1 − C2 exp(−C3 log(p)) for some constants C2 and C3 . s log(p/s) 2 Lin et al. [2016] have speculated that the lower bound of the risk EkPB b − PB kF is nλ when the dimension of the central space is bounded. This implies that if s = O(p1−δ ) for some positive constant δ, the Lasso-SIR algorithm achieves the optimal rate, i.e., we have the following corollary. Corollary 1. Assume that conditions A1-A3 hold for the multiple index model (1) and d, the dimension of central subspace, is bounded. If nλ = pα for some α > 1/2 and s = O(p1−δ ), the Lasso-SIR estimate PB b achieves the minimax rate. Remark 2 (Comparison with Lasso regression). Consider the linear regression y = β τ x + ǫ, where x ∼ N (0, Σ) and ǫ ∼ N (0, 1). It is shown in Raskutti et al. [2011] that the lower bound of the minimax rate of the l2 distance between any estimator and the true β s log(p) b is s log(p/s) and the convergence rate of Lasso estimator β . Namely, the Lasso Lasso is n n 1−δ estimator is rate optimal for linear regression when s = O(p ) for some positive constant δ. A simple calculation shows that λ(var(E[x|y])) ∼ kβk22 , if kβk is bounded away from ∞. Consequently, b kβ − βk2 ≤C kPβb − Pβ kF ≤ 4 Lasso Lasso kβk2 s s log(p) nλ(var(E[x|y])) (9) holds with high probability. In other words, the projection matrix Pβb based on Lasso is Lasso rate optimal. From this view point, the Lasso-SIR has extended the Lasso to the non-linear 10 Lin, Zhao, and Liu multiple index models. This justifies a suggestion in Chen and Li [1998], stating that SIR should be viewed as an alternative or generalization of the multiple linear regression. The connection also justifies a speculation in Lin et al. [2016] that a more appropriate prototype of the high dimensional SIR problem should be the sparse linear regression rather than the sparse PCA and the generalized eigenvector problem. Determining the dimension d of the central space is a challenge problem for SDR, especially for HDLSS cases. If we want to discern signals (i.e., the true directions) from noises (i.e., b of Λ b , i = 1, ..., H, we face the problem the other directions) simply via the eigenvalues λ i H b that all these λi ’s are of order p/n, but the gap between the signals and noises is of order λ (≤ Cmax ). With the Lasso-SIR, we can bypass this difficulty by using the adjusted eigenvalues b kβ b k , i = 1, ..., H. To this end, we have the following theorem. λ̂ai = λ i i 2 b be the output of Algorithm 4 for i = 1, ..., H. Assume that nλ = pα Theorem 3. Let β i for some α > 1/2, s log(p) = o(nλ), and H > d, then, for some constants C1 , C2 C3 and C4 , √ λ̂ai ≥ C1 λ − C2 λ̂ai ≤ C3 p s p log(p) √ λ + C4 nλ s log(p) , for 1 ≤ i ≤ d, and n s s log(p) , for d + 1 ≤ i ≤ H, n hold with probability at least 1 − C5 exp(−C6 log(p)) for some constants C5 and C6 . In the sparse linear regression literature, the region s2 = o(p) is often referred to as the “highly sparse” region [Ingster et al., 2010]. Theorem 3 shows that there is a clear gap between the signal (i.e., the first d adjusted eigenvalues) and noise (i.e., the other adjusted eigenvalues) in the highly sparse region if p1/2 = o(nλ). 4. Simulation Stuides 4.1. Single Index Models Let β be the vector of coefficients and let S be the active set; namely, βi = 0, ∀i ∈ S c . Furthermore, for each i ∈ S, we simulated independently βi ∼ N (0, 1). Let x be the design matrix with each row following N (0, Σ). We consider two types of covariance matrices: (i) Σ = (σij ) where σii = 1 and σij = ρ|i−j| ; and (ii) σii = 1, σi,j = ρ when i, j ∈ S or i, j ∈ S c , and σi,j = 0.1 when i ∈ S, j ∈ S c or vice versa. The first one represents a covariance matrix which is essentially sparse and we choose ρ among 0, 0.3, 0.5, and 0.8. The second one represents a dense covariance matrix with ρ chosen as 0.2. In all the simulations, we set n = 1, 000 and let p vary among 100, 1,000, 2,000, and 4,000. For all the settings, the random error ǫ follows N (0, I n ). For single index models, we consider the following model settings: I. y = xβ + ǫ where S = {1, 2, · · · , 10}; II. y = (xβ)3 /2 + ǫ where S = {1, 2, · · · , 20}; III. y = sin(xβ) ∗ exp(xβ) + ǫ where S = {1, 2, · · · , 10}; Sparse Sliced Inverse Regression for High Dimensional Data Table 1. Estimation error for the first type covariance matrix with ρ = 0.5. p Lasso-SIR DT-SIR Lasso M-Lasso Lasso-SIR(Known d) 100 0.12 0.47 0.11 0.19 0.12 1000 0.18 0.65 0.15 0.26 0.18 I 2000 0.20 0.74 0.16 0.30 0.20 4000 0.23 0.90 0.18 0.39 0.23 100 0.07 0.60 0.23 0.27 0.07 1000 0.12 0.78 0.31 0.17 0.12 II 2000 0.15 0.86 0.34 0.20 0.15 4000 0.20 0.99 0.37 0.28 0.19 100 0.21 0.55 1.25 0.26 0.21 1000 0.28 0.74 1.32 0.51 0.27 III 2000 0.35 0.87 1.34 0.66 0.31 4000 0.46 1.00 1.33 0.83 0.39 100 0.46 0.92 0.78 0.58 0.45 1000 0.62 1.07 0.87 0.78 0.58 IV 2000 0.71 1.22 0.89 0.94 0.59 4000 0.71 1.30 0.91 1.00 0.63 100 0.12 0.37 0.42 0.15 0.12 1000 0.20 0.55 0.55 0.41 0.20 V 2000 0.38 0.80 0.60 0.67 0.29 4000 0.78 1.22 0.77 1.06 0.48 11 dˆ 1 1 1 1 1 1 1 1 1 1 1.1 1.1 1 1.1 1.3 1.2 1 1 1.2 1.5 IV. y = exp(xβ/10) + ǫ where S = {1, 2, · · · , 50}; V. y = exp(xβ + ǫ) where S = {1, 2, · · · , 7}. The goal is to estimate col(β), the space spanned by β. As in Lin et al. [2015], the \ col(β)), where D(M, N ), the distance between two estimation error is defined as D(col(β), p subspaces M, N ⊂ R , is defined as the Frobenius norm of PM − PN where PM and PN are the projection matrices associated with these two spaces. The methods we compared with are DT-SIR, matrix Lasso (M-Lasso), and Lasso. The number of slices H is chosen as 20 in all simulation studies. The number of directions d is chosen according to Algorithm 5. Note that both benchmarks (i.e., DT-SIR and M-Lasso) require the knowledge of d as well. To be fair, we use the d estimated based on Algorithm 5 for both benchmarks. For comparison, we have also included the estimation error of Lasso-SIR assuming d is known. For each p, n, and ρ, we replicate the above steps 100 times to calculate the average estimation error for each setting. We tabulated the results for the first type of covariance matrix with ρ = 0.5 in Table 1 and put the results for other settings in Tables C1-C4 in the online supplementary file. The average of estimated directions dˆ is reported in the last column of these tables. The simulations show that Lasso-SIR outperformed both DT-SIR and M-Lasso under all settings. The performance of DT-SIR has become worse when the dependence is stronger and denser. The reason is that this method is based on the diagonal threshold and is only supposed to work well for the diagonal covariance matrix. Overall, Algorithm 5 provided a reasonable good estimate of d especially for moderate covariance matrix. When assuming d is known, the performances of both DT-SIR and M-Lasso are inferior to Lasso-SIR, and are 12 Lin, Zhao, and Liu Table 2. Estimation error for the first type covariance matrix with ρ = 0.5. p Lasso-SIR DT-SIR M-Lasso Lasso-SIR(Known d) 100 0.26 0.57 0.31 0.26 1000 0.33 0.74 0.62 0.33 VI 2000 0.36 0.92 0.73 0.38 4000 0.44 1.12 0.87 0.42 100 0.32 0.67 0.42 0.32 1000 0.60 0.93 1.02 0.66 VII 2000 0.95 1.18 1.35 0.83 4000 1.17 1.43 1.47 1.08 100 0.29 0.61 0.34 0.25 1000 0.37 0.82 0.69 0.35 VIII 2000 0.54 1.00 0.92 0.47 4000 0.88 1.37 1.27 0.71 100 0.43 0.74 0.48 0.43 1000 0.47 0.91 0.91 0.48 IX 2000 0.58 1.11 1.12 0.50 4000 0.57 1.25 1.23 0.56 dˆ 2 2 2 2 2 2.1 2.3 2.1 2 2 2.2 2.5 2 2 2.1 2 thus not reported. Under Setting I when the true model is linear, Lasso performed the best among all the methods, as expected. However, the difference between Lasso and Lasso-SIR is not significant, implying that Lasso-SIR does not sacrifice much efficiency without the knowledge of the underlying linearity. On the other hand, when the models are not linear (Case II-VI), LassoSIR worked much better than Lasso. It is seen that Lasso works better than Lasso-SIR for Setting V when ρ is large or the covariance matrix is dense. One explanation is that Lasso-SIR tends to overestimate d under these conditions while Lasso used the actual d. If assuming d = 1 in Lasso-SIR, its estimation error is smaller than that of Lasso. 4.2. Multiple Index Models Let β be the p × 2 matrix of coefficients and S be the active set. Let x be simulated similarly as in Section 4.1, and denote z = xβ. Consider the following settings: VI. yi = |zi2 /4 + 2|3 ∗ sgn(zi1 ) + ǫi where S = {1, 2, · · · , 7} and β1:4,1 = 1, β5:7,2 = 1, βi,j = 0 otherwise; VII. yi = zi1 ∗ exp(zi2 ) + ǫi where S = {1, 2, · · · , 12} and β1:7,1 , β8:12,2 ∼ N (0, 1), and βi,j otherwise; VIII. yi = zi1 ∗ exp(zi2 + ǫi ) where S = {1, 2, · · · , 12} and β1:7,1 , β8:12,2 ∼ N (0, 1), and βi,j otherwise; IX. yi = zi1 ∗(2+zi2 /3)2 +ǫi where S = {1, 2, · · · , 12} and β1:8,1 = 1, β9:12,2 = 1 and βi,j otherwise. and =0 =0 =0 For the multiple index models, we compared both benchmarks (DT-SIR and M-Lasso) with Lasso-SIR. Lasso is not applicable for these cases and is thus not included. Similar to Sparse Sliced Inverse Regression for High Dimensional Data 13 Section 4.1, we tabulated the results for the first type covariance matrix with ρ = 0.5 in Table 2 and put the results for others in Tables C5-C8 in the online supplementary file. For the identity covariance matrix (ρ = 0), there was little difference between performances of Lasso-SIR and DT-SIR. However, Lasso-SIR was substantially better than DT-SIR in other cases. Under all settings, Lasso-SIR worked much better than the matrix Lasso. For the dense covariance matrix Σ2 , Algorithm 5 tended to underestimate d, which is worthy of further investigation. 4.3. Discrete Response We consider the following simulation settings where for the response variable Y is discrete. X. XI. XII. XIII. y = 1(xβ + ǫ > 0) where S = {1, 2, · · · , 10}; y = 1(exp(xβ) + ǫ > 0) where S = {1, 2, · · · , 7}; y = 1((xβ)3 /2 + ǫ) where S = {1, 2, · · · , 20}; Let z = xβ where S = {1, 2, · · · , 12}, β is a p by 2 matrix with β1:7,1 , β8:12,2 ∼ N (0, 1) and βi,j = 0 otherwise. The response yi is yi = where ǫij ∼ N (0, 1).   1, 2,  3, if zi1 + ǫi1 < 0, if zi1 + ǫi1 > 0 and zi2 + ǫi2 < 0, if zi1 + ǫi1 > 0 and zi2 + ǫi2 > 0, In settings X, XI, and XII, the response variable is dichotomous, and βi ∼ N (0, 1) when i ∈ S and βi = 0 otherwise. Thus the number of slices H can only be 2. For Setting XIII where the response variable is trichotomous, the number of slices H is chosen as 3. The number of direction d is chosen as H − 1 in all these simulations. Similar to the previous two sections, we calculated the average estimation errors for LassoSIR (Algorithm 4), DT-SIR, M-Lasso, and generalized-Lasso based on 100 replications and reported the result in Table 3 for the first type covariance matrix with ρ = 0.5 and the results for other cases in Tables C9-C12 in online supplementary file. It is clearly seen that Lasso-SIR performed much better than DT-SIR and M-Lasso under all settings and the improvements were very significant. The generalized Lasso performed as good as Lasso-SIR for the dichotomous response; however, it performed substantially worse for Setting XIII. 5. Applications to Real Data 5.1. Arcene Data Set We first apply the methods to a two-class classification problem, which aims to distinguish between cancer patients and normal subjects from using their mass-spectrometric measurements. The data were obtained by the National Cancer Institute (NCI) and the Eastern Virginia Medical School (EVMS) using the SELDI technique, including samples from 44 patients with ovarian and prostate cancers and 56 normal controls. The dataset was downloaded from the UCI machine learning repository (Lichman [2013]), where a detailed description can be found. It has also been used in the NIPS 2003 feature selection challenge (Guyon et al. 14 Lin, Zhao, and Liu Table 3. Estimation error for the first type covariance matrix with ρ = 0.5. p Lasso-SIR DT-SIR M-Lasso Lasso 100 0.21 0.58 0.26 0.21 1000 0.26 1.21 0.51 0.28 X 2000 0.27 1.33 0.59 0.29 4000 0.28 1.39 0.65 0.31 100 0.36 0.85 0.57 0.34 1000 0.44 1.32 1.07 0.45 XI 2000 0.46 1.38 1.16 0.48 4000 0.52 1.41 1.20 0.52 100 0.24 0.63 0.49 0.22 1000 0.34 1.18 0.53 0.32 XII 2000 0.36 1.29 0.61 0.35 4000 0.40 1.37 0.68 0.39 100 0.38 1.08 0.60 1.06 1000 0.38 1.79 1.13 1.08 XIII 2000 0.40 1.92 1.24 1.09 4000 0.41 1.98 1.31 1.10 [2004]). For each subject, there are 10,000 features where 7,000 of them are real variables and 3,000 of them are random probes. There are 100 subjects in the validation set. After standardizing X, we estimated the number of directions d as 1 using Algorithm 5. We then applied Algorithm 3 and the sparse PCA to calculate the direction of β and the corresponding components, followed by a logistic regression model. We applied the fitted model to the validation set and calculated the probability of each subject being a cancer patient. We also fitted a Lasso logistic regression model to the training set and applied it to the validation set to calculate the corresponding probabilities. In Figure 1, we plot the Receiver Operating Characteristic (ROC) curves for various methods. Lasso-SIR, represented by the red curve, was slightly better than Lasso (insignificant) and the sparse PCA, represented by the green and blue curves respectively. The areas under these three curves are 0.754, 0.742, and 0.671, respectively. 5.2. HapMap In this section, we analyzed a data set with a continuous response. We consider the gene expression data from 45 Japanese and 45 Chinese from the international “HapMap” project (Thorisson et al. [2005], Thorgeirsson et al. [2010]). The total number of probes is 47,293. According to Thorgeirsson et al. [2010], the gene CHRNA6 is the subject of many nicotine addiction studies. Similar to Fan et al. [2015], we treat the mRNA expression of CHRNA6 as the response Y and expressions of other genes as the covariates. Consequently, the number of dimension p is 47,292, much greater than the number of subjects n=90. We first applied Lasso-SIR to the data set with d being chosen as 1 according to Algorithm 5. The number of selected variables was 13. Based on the estimated coefficients β and X, we calculated the first component and the scatter plot between the response Y and this component, showing a moderate linear relationship between them. We then fitted a linear 15 0.4 Sensitivity 0.6 0.8 1.0 1.2 Sparse Sliced Inverse Regression for High Dimensional Data −0.2 0.0 0.2 LASSO−SIR Lasso Sparse PCA 1.0 0.8 0.6 0.4 0.2 0.0 Specificity Fig. 1. ROC curve of various methods for Arcene Data set. regression between them. The R-sq of this model is 0.5596 and the mean squared error of the fitted model 0.045. We also applied Lasso to estimate the direction β. The tuning parameter λ is chosen as 0.1215 such that the number of selected variables is also 13. When fitting a regression model between Y and the component based on the estimated β, the R-sq is 0.5782 and the mean squared error is 0.044. There is no significant difference between these two approaches. This confirms the message that Lasso-SIR performs as good as Lasso when the linearity assumption is appropriate. We have also calculated a direction and the corresponding components based on the sparse PCA (Zou et al. [2006]). We then fitted a regression model. The R-sq is only 0.1013 and the mean squared error is 0.093, significantly worse than the above two approaches. 5.3. Classify Wine Cultivars We finally investigate the popular wine data set that people have used to compare various classification methods. This is a three-class classification problem. The data, available from the UCI machine learning repository (Lichman [2013]), consists of 178 wines grown in the same region in Italy under three different cultivars. For each wine, the chemical analysis was conducted and the quantities of 13 constituents are obtained, which are Alcohol, Malic acid, Ash, Alkalinity of ash, Magnesium, Total Phenols, Flavanoids, Nonflavanoid Phenols, Proanthocyanins, Color intensity, Hue, OD280/OD315 of diluted wines, and Proline. One of the goals is to use these 13 features to classify the cultivar. The number of directions d is chosen as 2 according to Algorithm 5. We tested PCA, DT-SIR, M-Lasso, and Lasso-SIR, for obtaining these two directions. In Figure 2, we plotted the projection of the data onto the space spanned by two components. The colors of the points correspond to three different cultivars. It is clearly seen that Lasso-SIR provided the best separation of the three cultivars. When using one vertical and one horizontal line to classify three groups, only one subject would be wrongly classified. 16 Lin, Zhao, and Liu PCA Bench I 2 2 1 C2 C2 0 0 −2 −1 −2 −4 −2.5 0.0 2.5 −1 0 C1 C1 Bench II LASSO−SIR 1 2 2 C2 C2 0 0 −2 −2 −3 −2 −1 0 C1 1 2 −2 −1 0 1 2 3 C1 Fig. 2. We plotted the second component versus the first component for all the wines, which are labeled with different colors, representing different cultivars (1–red, 2–green, 3–blue). The four methods for calculating the directions are PCA, DT-SIR, M-Lasso, and Lasso-SIR from top-left to bottom-right. It is clearly seen that Lasso-SIR offered the best separation among these three groups. Sparse Sliced Inverse Regression for High Dimensional Data 6. 17 Discussion In this paper, we have proposed Lasso-SIR, an efficient high-dimensional variant of the sliced inverse regression [Li, 1991], to obtain a sparse solution to the estimation of the sufficient dimensional reduction space for multiple index models, and showed that it is rate optimal if nλ = pα for some α > 1/2, where λ is the smallest nonzero eigenvalue of var(E[x|y]). This technical assumption on n, λ and p is slightly disappointing from the ultra-high dimensional perspective. We believe that this technical assumption arises from an intrinsic limitation in estimating the central subspace, i.e., some further sparsity assumptions on either Σ or var(E[x|y]) or both are needed to show the consistency of any estimation method. We will address such extensions in our future researches. Cautious reader may find that the concept of “pseudo-response variable” is not essential for developing the theory of the Lasso-SIR algorithm. However, by re-formulating the SIR method as a linear regression problem using the pseudo-response variable, we can formally consider the model selection consistency, regularization path and many others for the LassoSIR. In other words, the Lasso-SIR does not only provide an efficient high dimensional variant of SIR, but also extends the rich theory developed for Lasso linear regression in the past decades to the multiple index models. Acknowledgments This research was partly supported by NSF Grant IIS-1633283, NSF Grant DMS-1120368, and NIH Grant R01 GM113242-01. Appendix: Sktech of Proofs of Theorems 1 and 2 We need two propositions to prove Theorems 1 and 2. The first one reveals some properties b . of the eigenvectors of Λ H b = 1 X Xτ Proposition 1. Assume that Conditions A1), A2) and A3) hold. Let Λ H H H H b j be the eigenvector of unit length be the SIR estimate of Λ = var(E[x|y]) using (2). Let η b j = 1, ..., H. If nλ = pα for some α > 1/2, there b of Λ, associated with the j-th eigenvalue λ j exist positive constants C1 and C2 such that b j k2 ≥ C1 kPΛ η s λ bj λ b j k2 ≤ C2 , 1 ≤ j ≤ d and kPΛ η p p log(p) nλ s λ bj λ ,d + 1 ≤ j ≤ H (10) hold with high probability. Here we say that an event Ω happens with high probability if P(Ω) ≥ 1 − C3 exp(−C4 log(p)) for some constants C3 and C4 . Remark: This result might be of independent interest. In order to justify that the sparsity assumption for the high dimensional setting is necessary, Lin et al. [2015] have shown q that p b 1 )] = 0 if and only if lim nλ = 0. Proposition 1 states that the projection of E[∠(η1 , η j = 1, ..., d, onto the true direction is non-zero if nλ > p1/2 . b η λ j bj, 18 Lin, Zhao, and Liu The proof of Proposition 1 is technical. To improve the readability, we sketch the key steps here and put the detailed proof in the online supplementary file. Let x = z + w be the orthogonal decomposition with respect to col(var(E[x|y])) and its orthogonal complement. We define two p×H matrices Z H = (z 1,· , ..., z H,· ) and W H = (w1,· , ..., wH,· ) whose definition are similar to the definition of X H . We then have the following decomposition XH = ZH + W H . (11) 1/2 By definition, we know that Z H ⊥ ⊥ W H , Z τH W H = 0, and W H = √1c Σ1 E H , where Σ1 is the covariance matrix of w and E H is a p × H matrix with i.i.d. standard normal entries. We have the following lemma: Lemma 1. Assume that ν1 is a large enough constant only depends on the constant κ. For sufficiently large constant a, the event Ω = Ω1 ∩ Ω2 holds with high probability where n o κ 1 1 1 )λ ≤ λmin ( Z τH Z H ) ≤ λmax ( Z τH Z H ) ≤ (1 + )κλ 2ν1 H H 2ν1 p o tr(Σ ) p log(p) 1 1 Wτ WH − IH ≤a . H H n n F Ω1 = ω | (1 − n Ω2 = ω | (12) (13) Proof. The proof is presented in the online supplementary file. ✷ For any ω ∈ Ω, we can choose a p × p orthogonal matrix T and an H × H orthogonal matrix S such that     B1 0 0 0 1 1    0 0 B2 B3  T Z H (ω)S = and T W H (ω)S = H H 0 B4 0 0 (14) where B1 is a d × d matrix, B2 is a d × d matrix, B3 is a d × (H − d) matrix and B4 is a (p − 2d) × (H − d) matrix. By definition of the event ω, we have 1 κ )λ ≤ λmin (B1τ B1 ) ≤ λmax (B1τ B1 ) ≤ (1 + )κλ 2ν1 2ν1 p   τ tr(Σ1 ) p log(p) B2τ B3 B2 B2 − IH ≤ a′ τ τ τ B3 B2 B3 B3 + B4 B4 n n F (1 − for some constant a′ . Thus, we only need to prove the following lemma:  (15)  B1 0 α  B2 B3  be a p × H Lemma 2. Assume that nλ = p for some α > 1/2. Let M = 0 B4 matrix, where B1 is a d × d matrix, B2 is a d × d matrix, B3 is a d × (H − d) matrix and b j be the eigenvector associated with B4 is a (p − 2d) × (H − d) matrix satisfying (15). Let η τ b b onto the j-th eigenvalue λj of M M , j = 1, ..., H. Then the length of the projection of η √ r rj p log(p) λ its first d-coordinates is at least C bλ for j = 1, ..., d and is at most C nλ for b λj j = d + 1, ..., H. λj Sparse Sliced Inverse Regression for High Dimensional Data 19 Proof. See the online supplementary file. Next, we briefly review the restricted eigenvalue (RE) property, which was first introduced in Raskutti et al. [2010], before stating the second proposition. Given a set S ⊂ [p] = {1, ..., p}, define the set C(S, α) as C(S, α) = {θ ∈ Rp | kθS c k1 ≤ αkθS k1 }. We say that a sample matrix XX τ /n satisfies the restricted eigenvalue condition over S with parameter (α, κ) ∈ [1, ∞) × (0, ∞) if 1 τ θ XX τ θ ≥ κ2 kθk22 , n ∀θ ∈ C(S, α). (16) If (16) holds uniformly for all the subsets S with cardinality s, we say that XX τ /n satisfies the restricted eigenvalue condition of order s with parameter (α, κ). Similarly, we say that the covariance matrix Σ satisfies the RE condition over S with parameter (α, κ) if kΣ1/2 θk2 ≥ κkθk for all θ ∈ C(S, α). Additionally, if this condition holds uniformly for all the subsets S with cardinality s, we say that Σ satisfies the restricted eigenvalue condition of order s with parameter (α, κ). The following Corollary is borrowed from Raskutti et al. [2010]. Corollary 2. Suppose that Σ satisfies the RE condition of order s with parameter (α, κ). Let X be the p × n matrix formed by n i.i.d samples from N (0, Σ). For some universal positive constants a1 , a2 and a3 , if the sample size satisfies n > a3 (1 + α)2 maxi∈[p] Σii s log(p), κ2 then the matrix n1 XX τ satisfies the RE condition of order s with parameter (α, κ8 ) with probability at least 1 − a1 exp (−a2 n). It is clear that λ√min (Σ) ≥ Cmin implies that Σ satisfies the RE condition of any order s with parameter (3, Cmin ). Thus, we have the following proposition. Proposition 2. Assume that Condition A1) holds. For some universal constants a1 , a2 and a3 , if the sample size satisfies that n > a1 s log(p), then the matrix n1 XX τ satisfies √ the RE condition for any order s with parameter (3, Cmin /8) with probability at least 1 − a2 exp (−a3 n). Next, we sketch key points and intermediate results of the proofs of the two theorems and leave details in the online supplementary files. Sketch of the proof of Theorem 1. Recall that for single index model y = f (βτ0 x, ǫ) b associated with the b the eigenvector of Λ where β0 is a unit vector, we have denoted by η H b Let β b be the minimizer of largest eigenvalue λ. Lβ = 1 e − X τ βk + µkβk1 , ky 2n 20 Lin, Zhao, and Liu e = Σ−1 η e . Let η 0 = Σβ 0 , η e = Pη0 η b and β e ∝ β0 . e ∈ Rn such that η b = n1 X y where y b Since we are interested in the distance between the directions of β and β0 , we consider the b − β. e A slight modification of the argument in Bickel et al. [2009] implies difference δ = β r r that, if we choose µ = C log(p) nb λ for sufficiently large constant C, we have kδk2 ≤ C1 s log(p) nb λ with high probability. The detailed arguments are put in the online supplementary file. The q −1 λ e e e , imply that C1 Proposition 1, Condition A1) and β = Σ η ≤ kβk 2 ≤ C2 holds with b λ high probability for some constants C1 and C2 . Thus, we have kPβb − Pβ0 kF = kPβb − Pβe kF ≤ 4 b − βk e kβ 2 holds with high probability. e 2 kβk e ≤C = 4kδk2 /kβk 2 s s log(p) nλ (17) ✷ b j be the (unit) eigenvectors associated with the j-th eigenProof of Theorem 2. Let η b e = Σ−1 η e /kβ e k . Applying the e j = PΛ η bj, β e j and γ j = β values of ΛH , j = 1, ...., d. Let η j j j 2 argument in Theorem 1 to other eigenvectors gives us that v s u u s log(p) s log(p) b −β e k ≤ Ct kβ and kPβb − Pβe kF ≤ C j j 2 b j j nλ nλj (18) e , j = 1, ..., d, are bounded below by hold with high probability. Thus, if i) the lengths of β j C r λ e , j = 1, ..., d, are with high probability and, ii) the angles between any two vectors of β j b λj bounded below by some q constant with high probability, then the Gram-Schmit process implies that kPB b − PB kF ≤ C that d is bounded. s log(p) nλ holds with high probability from (18) and the assumption We only need to verify i) and ii). i) follows from the Proposition 1 and the Condition A1), e = Σ−1 η e j , j = 1, ..., d. ii) can be easily derived from the following two intuitively since β j straightforward statements. e j ′ s , j = 1, ..., d are nearly π/2. Since I. The angles between any two vectors in η α nλ = p for some α > 1/2, we only need to prove that  ej, η ej ) cos ∠(η  ≤C p p log(p) nλ (19) holds with high probability for any i 6= j. Recall that We have the following √ decomposition X H = Z H + W H . It is easy to see that col(Z H ) = col(var(E[x|y])) and c cov(w)−1/2 W H is identically distributed to a matrix, E1 , with all the entries are i.i.d. standard normal   A 1 and random variables. Let us choose an orthogonal matrix T such that √H T Z H = 0   0 √1 T W H = bj where A is a d × H matrix and B is a (p − d)× H matrix. Thus, T η H B Sparse Sliced Inverse Regression for High Dimensional Data 21 b , j = 1, ..., d. If we associated with the j-th eigenvalue λ j √ r p log(p) τ τ λ b have a) λmin (AA ) ≥ λ, b) kPcol(T Z H ) (T η j )k2 ≥ C b and c) kB B − µI H kF ≤ C n is the eigenvector of τ 1 τ H T XHXHT λj for some scalar µ > 0, then the statement I is reduced to the following linear algebra lemma. Lemma 3. Let A be a d×H matrix√(d < H) with λmin (AAτ ) = λ. Let B be a (p−d)×H p log(p) . Let ξbj be the j-th (unit) eigenvector of CC τ matrix such that kB τ B − µI H k2F ≤ C n b where C τ = (Aτ , B τ ) and ξ e be the projection of ξ b associated with the j-th eigenvalue λ j j j onto its first d-coordinates. If kξej k2 ≥ C  r λ b λj cos ∠(ξei , ξej )  , then for any i 6= j, ≤C p p log(p) . nλ (20) Thus, ξei ′ s are nearly orthogonal if nλ = pα for some α > 1/2. b , then ξ b = 1 Cα and ξ e = 1 Aα . It is easy to see that b j = Cτ ξ Proof. Let α j j j j j b b λj λj q q b j and kC α b j . Since α b j is also the (unit) eigenvector of b j k2 ≥ λ b j/ λ b j k2 = λ kα C τ C = Aτ A + µI + (B τ B − µI), for any i 6= j, we have bi bi + α b τj (B τ B − µI)α b j + µα b τj α bi = α b τj Aτ Aα b τj C τ C α 0=α τ bj λ bi ξ e ξ e b i. b τj (B τ B − µI)α =λ j i+α √ r p log(p) b k2 ≥ C λ , ∀i 6= j, we have and k ξ Since kB τ B − tr(Σ)I H kF ≤ C j n b λj p b 1/2 λ b 1/2 b τj λ ξτj ξi bi τ α 1 α p log(p) j i τ b b (B B − µI) 1/2 ≤ C ≤ C ξj ξi . =C 1/2 b b kξi k2 kξj k2 λ λλ nλ λ j i ✷ Note that a) follows from the Lemma 3, b) follows from Proposition 1 and c) follows from the Lemma 8. Thus statement I holds. e ′ s are bounded away from 0. II. The angles between any two vectors in β Since j −1 e e β j = Σ η j , we only need to prove that there exists a positive constant ζ < 1 such that ei e τi Σ−1 Σ−1 η η ≤ ζ. −1 e −1 e kΣ η i k2 kΣ η j k2 (21) e 1 /kη e 1 k2 , ..., η e d /kη e d k2 ) = T M , where T is a p × d orthogonal matrix. Since η e j /kη e j k′2 s Let (η τ are nearly mutually orthogonal, we know that M M is nearly an identity matrix. Thus, by some continuity argument, the statement is reduced to the following linear algebra lemma. 22 Lin, Zhao, and Liu Lemma 4. Let A be a p×p positive definite matrix such that Cmin ≤ λmin (A) ≤ λmax (A) ≤ Cmax for some positive constants Cmin and Cmax . There exists constant 0 < ζ < 1 such that for any p × d orthogonal matrix B, we have B τ∗,i Aτ AB ∗,j ≤ζ kAB ∗,i k2 kAB ∗,j k2 ∀i 6= j. (22) Proof. When d is finite, without loss of generality, we can assume that B is a p × 2 matrix. Note that the expression on the left side is invariant under orthogonal transformation of B. We can simply assume that B is a matrix with the last p − 2-rows consisting of all zeros. The result follows immediately based on basic calculation. ✷ References P. J. Bickel, Y. Ritov, and A. B. Tsybakov. Simultaneous analysis of Lasso and Dantzig selector. The Annals of Statistics, 37(4):1705–1732, 2009. Cristina Butucea, Yuri I Ingster, et al. Detection of a sparse submatrix of a high-dimensional noisy matrix. Bernoulli, 19(5B):2652–2688, 2013. E. Candes and T. Tao. The Dantzig selector: Statistical estimation when p is much larger than n. The Annals of Statistics, 35(6):2313–2351, 2007. C. H. Chen and K. C. Li. Can SIR be as popular as multiple linear regression? Statistica Sinica, 8(2):289–316, 1998. H. Chen. Estimation of a projection-pursuit type regression model. The Annals of Statistics, 19(1):142–157, 1991. D. R. Cook. Regression graphics. Wiley Series in Probability and Statistics: Probability and Statistics. John Wiley & Sons, Inc., New York, 1998. D. R. Cook. SAVE: a method for dimension reduction and graphics in regression. Communications in statistics-Theory and methods, 29(9-10):2109–2121, 2000. D. R. Cook, L. Forzani, and A. J. Rothman. Estimating sufficient reductions of the predictors in abundant high-dimensional regressions. The Annals of Statistics, 40(1):353–384, 2012. N. Duan and K. C. Li. Slicing regression: a link-free regression method. The Annals of Statistics, 19(2):505–530, 1991. B. Efron, T. Hastie, I. Johnstone, and R. Tibshirani. Least angle regression. The Annals of statistics, 32(2):407–499, 2004. J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American statistical Association, 96(456):1348–1360, 2001. J. Fan, Q. Shao, and W. Zhou. Are discoveries spurious? distributions of maximum spurious correlations and their applications. arXiv preprint arXiv:1502.04237, 2015. Sparse Sliced Inverse Regression for High Dimensional Data 23 J. Friedman, T. Hastie, and R. Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of statistical software, 33(1):1, 2010. J. H. Friedman and W. Stuetzle. Projection pursuit regression. Journal of the American statistical Association, 76(376):817–823, 1981. I. Guyon, S. Gunn, A. Ben-Hur, and G. Dror. Result analysis of the NIPS 2003 feature selection challenge. In Advances in neural information processing systems, pages 545–552, 2004. T. Hsing and R. J. Carroll. An asymptotic theory for sliced inverse regression. The Annals of Statistics, 20(2):1040–1061, 1992. Yuri I Ingster, Alexandre B Tsybakov, Nicolas Verzelen, et al. Detection boundary in sparse regression. Electronic Journal of Statistics, 4:1476–1526, 2010. B. Jiang and J. S. Liu. Variable selection for general index models via sliced inverse regression. The Annals of Statistics, 42(5):1751–1786, 2014. S. Jung and J. S. Marron. PCA consistency in high dimension, low sample size context. The Annals of Statistics, 37(6B):4104–4130, 2009. K. C. Li. Sliced inverse regression for dimension reduction. Journal of the American Statistical Association, 86(414):316–327, 1991. L. Li. Sparse sufficient dimension reduction. Biometrika, 94(3):603–613, 2007. L. Li and C. J. Nachtsheim. Sparse sliced inverse regression. Technometrics, 48(4):503–510, 2006. M. Lichman. UCI machine http://archive.ics.uci.edu/ml. learning repository, 2013. URL Q. Lin, Z. Zhao, and J. S. Liu. On consistency and sparsity for sliced inverse regression in high dimensions. arXiv preprint arXiv:1507.03895, 2015. Q. Lin, X. Li, H. Dong, and J. S. Liu. On optimality of sliced inverse regression in high dimensions. 2016. M. Neykov, Q. Lin, and J. S. Liu. Signed support recovery for single index models in highdimensions. Annals of Mathematical Sciences and Applications, 1(2):379–426, 2016. L. Ni, D. R. Cook, and C. L. Tsai. A note on shrinkage sliced inverse regression. Biometrika, 92(1):242–247, 2005. G. Raskutti, M. J. Wainwright, and B. Yu. Restricted eigenvalue properties for correlated gaussian designs. The Journal of Machine Learning Research, 11:2241–2259, 2010. G. Raskutti, M. J. Wainwright, and B. Yu. Minimax rates of estimation for high-dimensional linear regression over-balls. Information Theory, IEEE Transactions on, 57(10):6976–6994, 2011. 24 Lin, Zhao, and Liu N. Simon, J. Friedman, T. Hastie, and R. Tibshirani. A sparse-group lasso. Journal of Computational and Graphical Statistics, 22(2):231–245, 2013. T. E. Thorgeirsson, D. F. Gudbjartsson, and many others. Sequence variants at CHRNB3CHRNA6 and CYP2A6 affect smoking behavior. Nature genetics, 42(5):448–453, 2010. G. A. Thorisson, A. V. Smith, L. Krishnan, and L. D. Stein. The international HapMap project web site. Genome research, 15(11):1592–1593, 2005. R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B, pages 267–288, 1996. Y. Xia, H. Tong, W. K. Li, and L. X. Zhu. An adaptive estimation of dimension reduction space. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 64(3): 363–410, 2002. M. Yuan and Y. Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006. W. Zhong, T. Zhang, Y. Zhu, and J. S. Liu. Correlation pursuit: forward stepwise variable selection for index models. Journal of the Royal Statistical Society: Series B, 74(5):849–870, 2012. L. Zhu, B. Miao, and H. Peng. On sliced inverse regression with high-dimensional covariates. Journal of the American Statistical Association, 101(474):640–643, 2006. Hui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of computational and graphical statistics, 15(2):265–286, 2006. 1 Sparse Sliced Inverse Regression for High Dimensional Data Web-based supporting materials for “Sparse Sliced Inverse Regression for High Dimensional Data” by “Lin, Q., Zhao, Z., and Liu, S. J.” A. Proofs of Theorems A.1. Proof of Theorem 1 Let T = supp(β0 ), then |T | ≤ s. For a vector γ ∈ Rp , let γ T and γ T c be the sub-vector consists of the components of γ in T and T c respectively. Let us introduce the event E = E1 ∩ E2 ∩ E3 ∩ E4 where E1 = n n o ω | kδ T c k1 ≤ 3kδT k1 , 1 E2 = ω | XX τ satisfies the RE condition of order s with parameter(3, n s n log(p) o 1 E3 = ω | k XX τ δk∞ ≤ µ where µ = b1 b n nλ n √ Cmin o ) 8 s λ o . b λ Here b1 and b2 are sufficiently large constants to be specified later. Because Proposition 1 implies that E4 happens with high probability( i.e., P (E4 ) ≥ 1 − C1 exp (−C2 log(p)) for some constants C1 and C2 ), Proposition 2 implies that E2 happens with high probability, Lemma 5 (see below) implies that E3 happens with high probability, and Lemma 7 (see below) implies that E1 happens with high probability, we conclude that E happens with high probability. Conditioning on E, we have √ 1 1 1 Cmin kδk22 ≤ kX τ δk2 ≤ kXX τ δk∞ kδk1 ≤ 4µkδ T k1 ≤ 4 sµkδ T k2 . 64 n n r q √ s log(p) λ . Since we have C Thus, conditioning on E, we have kδk2 ≤ C256 sµ = C 1 b ≤ min b E4 = b k 2 ≥ b2 ω | kPΛ η nλ e ≤ C conditioning on E, we know that kβk 2 2 kPβb − Pβ0 kF = kPβb − Pβe kF ≤ 4 b − βk e kβ 2 e kβk 2 ≤C λ s s log(p) . nλ r Lemma 5. Assume that condition A1), A2) and A3) hold. Let µ = A ciently large A, we have that 1 k XX τ δk∞ ≤ µ n ✷ log(p) . nb λ For suffi- (A.1) 2 Lin, Zhao, and Liu holds with high probability. e =η b − β, e η e and Σβ e , we have b = n1 X y Proof. Since δ = β 1 1 1 1 b − Xy e e k∞ + kX ỹ − nη e k∞ + k( XX τ − Σ)βk kXX τ δk∞ ≤ kXX τ β ∞. n n n n {z } | {z } | {z } | I II b we have 0 ∈ For I. By the definition of β, e k∞ ≤ µ. Xy 1 n (A.2) III   b , i.e., b − Xy e + µsgn β XX τ β   1 b kXX τ β n − For II. Let x = z +w be the orthogonal decomposition with respect to col(var(E[x|y])) and its orthogonal complement. Recall that we have introduced the decomposition: X H = Z H +W H . √ It is easy to see that col(Z H ) = col(η 0 ) and c cov(w)−1/2 W H is identically distributed to a matrix, E1 , with all the entries are i.i.d. standard normal random variables. Let Since 1 1 1 b , α2 = √ W τH η b and α = √ X τH η b = α1 + α2 . α1 = √ Z τH η H H H τ 1 b H XH XH η bη b and η b , we know that kαk22 = λ b= =λ e = Pη0 η b= we know η 1 √ ZH α Hb λ b − Pη0 η b k∞ we know that kη A2 (> 1), we have  P k cov(w) √ c 1/2 √ 1 √ W H α. Hb λ 1 Z H α + √ 1 b W H α. Hb λ Hλ From this, p √ b Since kαk1 ≤ Hkαk2 = H λ, b −Pη0 η b= and η ≤ √1 kW H k∞,∞ . It is easy to see that for positive constant b λ E1 k∞,∞ > λ1/2 max (Σ) s  A2 H log(pH)  ≤ 2 exp−(A2 −1) log(pH) , n r √ 1/2 b − Pη0 η b k∞ ≤ A i.e., by letting A > 2λmax (Σ) A2 H, we have that kη probability. log(p) nb λ holds with high For III. Let x = Σ1/2 ǫ where ǫ ∼ N (0, I p ), then X = Σ1/2 E where E is a p × n matrix with i.i.d standard normal entries. Let   n o 1 τ F(t) = ω | kΣ1/2 EE − I p Σ−1/2 η 0 k∞ > tλmax (Σ)1/2 λmin (Σ)−1/2 . n We have the following elementary bound on this event. Lemma 6. P(F(t)) ≤ 4 exp− 3nt2 16 +log(p) . (A.3) Proof. For any two deterministic vectors α1 and α2 , let e 1 , α2 ) = E(α  ω | |α1   1 τ EE − I p α2 | > tkα1 k2 kα2 k2 . n (A.4) 3 Sparse Sliced Inverse Regression for High Dimensional Data We know that for 0 < t < 1/2,   3 nt2 e 1 , α2 ) ≤ 4 exp− 16 . P E(α 1/2 (A.5) Combining with the facts kΣi,∗ k ≤ λmax (Σ)1/2 and kΣ−1/2 η 0 k2 ≤ λmin (Σ)−1/2 , we know that 1/2 kΣ   1 τ EE − I p Σ−1/2 η 0 k∞ > tλmax (Σ)1/2 λmin (Σ)−1/2 n 3 happens with probability at most 4 exp− 16 nt 2 +log(p) (A.6) . ✷ e = Σ−1 η e, η e = kη e kη 0 and kη e k ≤ 1, we know that Since β   1 τ 1 e e kkΣ1/2 k (XX τ − nΣ) βk EE − I p Σ−1/2 η 0 k∞ . ∞ = kη n n Conditioning on F( q 16A3 log(p) ) 3n (A.7) ∩ E4 , we have 1 e k (XX τ − nΣ) βk ∞ >C n s λ 16A3 log(p) λmax (Σ)1/2 λmin (Σ)−1/2 . b 3n λ (A.8) Combining the Lemma 6 and Proposition 1, we know that (A.8) happens with high probability. To summarize, we know that, for sufficiently large constant A, holds with high probability. r Lemma 7. Let µ = A holds with high probability. log(p) . nb λ k n1 XX τ δk∞ r ≤A log(p) nb λ ✷ For sufficiently large constant A, we have kδT c k1 ≤ 3kδT k1 Proof. Since Lβb ≤ Lβe , we have 1 1 e ∞ ≤ µ(kβk e 1 − kβk b 1 ). −kδk1 k X ye − XX τ βk n n (A.9) e − kβk b ≤ kδ k − kδ c k and kδk = kδ k + kδ c k , if k 1 X ye − 1 XX τ βk e Since kβk 1 1 T 1 T 1 1 T 1 T 1 ∞ ≤ n n A1 r log(p) nb λ and A > 2A1 , we have kδT c k1 ≤ A+A1 A−A1 kδT k1 ≤ 3kδT k1 . e e e − XX τ βk b−η e k∞ + k( n1 XX τ − Σ)βk Since n1 kX y ∞ = II + III where II and ∞ ≤ kη III are introduced in (A.2). r From the bounds of II and III in Lemma 5, we know that e ∞ ≤ A1 k n1 X ye − n1 XX τ βk log(p) nb λ holds with high probability for some A1 (does not depend on choice of µ) and some constants C1 and C2 . ✷ 4 Lin, Zhao, and Liu A.2. Proof of Theorem 3 b , η b i of Λ b i be the eigenvector associated with the i-th eigenvalue λ b i and Let η H e i = PΛ η e = Ση e β , i = 1, . . . , H. The argument in Theorem 1 implies that, for any 1 ≤ i ≤ H, i i The Proposition 1 implies that e k ≥C kβ 1 i 2 s λ b λ i b −β e k ≤C kβ i i 2 s e k ≤C , 1 ≤ i ≤ d and kβ 2 i 2 s log(p) s b nλ λ b λ i . (A.10) p p log(p) , d + 1 ≤ i ≤ H. nλ (A.11) The above two statements give us the desried result in Theorem 3. ✷ A.3. Proof of Proposition 1 Proof of Lemma 1 By Lemma 10, one of main contributions of Lin et al. [2016], we know that Ω1 happens with high probability follows. By the following lemma, we know that Ω2 happens with high probability. Lemma 8. Let d1 , . . . , dp be positive constants. We have the following statements: i) For p i.i.d standard normal random variables x1 , . . . , xp , there exist constants C1 and C2 such that for any sufficiently small a , we have ! p2 a2 − P 2 1X d C 2 di (xi − 1)| > a ≤ C1 exp 2 j j . P | p i (A.12) ii) For 2p i.i.d standard normal random variables x1 , . . . , xp y1 , · · · , yp , there exist constants C1 and C2 such that for any sufficiently small a , we have ! p2 a2 − P 2 1X d C di xi yi | > a ≤ C1 exp 2 j j . P | p i (A.13) Proof. ii) is a direct corollary of i). And i) followsQfrom a typical deviation argument, i.e., all we need to do is choosing proper t such that e−pt pj=1 √ 1 is bounded by the RHS 1−2tdj of (A.12). This could be done by simple Taylor expansion argument. ✷ ✷ Proof of Lemma 2 The proof needs the Sin-Theta theroem, which we reviewed below: Lemma 9. Let A and A + E be symmetric matrices satisfying A = [F 0 , F 1 ]  A0 0 0 A1  F τ0 F τ1  , A + E = [G0 , G1 ]  Λ0 0 0 Λ1  Gτ0 Gτ1  Sparse Sliced Inverse Regression for High Dimensional Data 5 where [F 0 , F 1 ] and [G0 , G1 ] are orthogonal matrices. If the eigenvalues of A0 are contained in an interval (a,b) , and the eigenvalues of Λ1 are excluded from the interval (a − δ, b + δ) for some δ > 0, then min(kF τ1 EG0 kF , kF τ0 EG1 kF ) 1 √ kF 0 F τ0 − G0 Gτ0 kF ≤ . δ 2    E1 E2 D1 0 E τ1 E τ3 Let us consider the eigen-decompositions: Q1 , M M = E3 E4 0 D2 E τ2 E τ4  τ        B1 B1 + pµ 0 F1 0 D ′1 0 F τ1 0 n Id Q2 , = whereD1 , D ′1 pµ ′ 0 0 F2 0 D2 0 F τ2 n I H−d ( resp. D 2 , D′2 ) are d × d (resp. (H − d) × (H − d) ) diagonal matrices. From (15), we know that τ p p p log(p) pµ p log(p) pµ −C ≤ λmin (D1 ) ≤ λmax (D1 ) ≤ κλ + +C λ+ n np n p n pµ p log(p) p log(p) pµ and −C ≤ λmin (D2 ) ≤ λmax (D2 ) ≤ +C . n n n n √ p log(p) Thus the eigengap is of order λ − ( which is of order λ, since nλ = pα for some n α > 1/2). √ Let us apply the Sin-Theta theorem on them. From (15) , we know that kQ1 − Q2 k F ≤ C p log(p) . n Thus, we have      p p log(p) , nλ F √ √ p log(p) p log(p) τ τ i.e., kE 3 E 3 kF ≤ C nλ . Similar argument gives us kE 2 E 2 kF ≤ C nλ . E1 E3 E τ1 E τ3 − Id 0 0 0 ≤C (A.14) b of M M τ . Let Let η be the (unit) eigenvector associated with the non-zero eigenvalue λ     η1 α1 us write η =  η 2  where η 1 , η 2 ∈ Rd and η 3 ∈ Rp−2d . Let α = = M τ η, where α2 η3 α1 = B1τ η 1 + B2τ η 2 ∈ Rd and α2 = B3τ η 2 + B4τ η 3 ∈ RH−d . It is easy to verify that √α is the b of M τ M and (unit) eigenvector associted with the eigenvalue λ B1 α 1 η1 = p p , b λ b λ B2 α 1 B3 α 2 B4 α 2 η 2 = p p + p p , and η 3 = p p . b λ b b λ b b λ b λ λ λ p b λ b is among the first d eigenvalues of M τ M , then kα / λk b is bounded below by some If λ 1 2 q λ b is among the last H − d eigenvalues of M τ M , positive constant. Thus kη 1 k2 ≥ C b . If λ λ √   q √  p p log(p) p log(p) λ b then kα1 / λk1 = O . Thus kη 1 k2 ≤ O κ b nλ . ✷ nλ λ  6 Lin, Zhao, and Liu B. Conditions for SIR to be Consistent All the results in this appendix are borrowed from Lin et al. [2016] and Lin et al. [2015] with some minor modifications. We state them here mainly for the purpose of self-content. In order that SIR gives a consistent estimate of the central space, researchers (for more discussion, see Li [1991], Hsing and Carroll [1992], Zhu et al. [2006] and Lin et al. [2015]) require the several technical assumptions, A′ ) Linearity Condition and Coverage Condition. n span E[x|y] o n = span V ∗,1 , ..., V ∗,d o (B.1) where V ∗,i is the i-th columns of the orthogonal matrix V and a smoothness and tail condition on the central curve E[x|y], i.e., B′ ) Smoothness and Tail Condition. Smoothness condition: For B > 0 and n ≥ 1, let Πn (B) be the collection of all the n-point partitions −B ≤ y(1) ≤ · · · ≤ y(n) ≤ B of [−B, B]. The central curve m(y) satisfies the following: lim sup n−1/4 n→∞ y∈Π (B) n Tail condition: such that n X i=2 km(yi ) − m(yi−1 )k2 = 0, ∀B > 0. e for some B0 > 0, there exists a non-decreasing function m(y) on (B0 , ∞), e 4 (y)P (|Y | > y) → 0 as y → ∞ m e e ′ )| for y, y ′ ∈ (−∞, −B0 ) ∪ (B0 , ∞) km(y) − m(y ′ )k2 ≤ |m(y) − m(y (B.2) Recent results in Lin et al. [2015], Lin et al. [2016] and Neykov et al. [2016] suggest that the following sliced stability condition (see Definition 1) is more convenient to build the high dimensional theory of SIR. Definition 1. Let Y be a univariate random variable. For 0 < γ 1 < 1 < γ 2 , let AH (γ 1 , γ 2 ) denote all partitions {−∞ = a1 ≤ a2 ≤ . . . ≤ aH+1 = +∞} of R, such that γ γ1 ≤ P(ah ≤ Y ≤ ah+1 ) ≤ 2 . H H A curve m(y) is ϑ-sliced stable with respect to y, if there exist positive constants γ 1 , γ 2 , γ 3 such that for any partition ∈ AH (γ 1 , γ 2 ) and any β ∈ Rp , one has: X  γ 1 H+1 var β τ m(Y ) ah−1 ≤ Y < ah ≤ 3ϑ var (β τ m(Y )) . H h=1 H A curve is sliced stable if it is ϑ-sliced stable for some positive constant ϑ. (B.3) Sparse Sliced Inverse Regression for High Dimensional Data 7 τ Note that the LHS of (B.3) ≈ var(E[β m(Y )|Y ]) = 0, so the sliced stability condition is merely requiring the convergence rate to be a power of the slice number and is believed to be a general condition. In fact, Neykov et al. [2016] shows that if we replace the tail condition (B.2) by a slightly stronger condition e )4 ] < ∞, E[m(Y (B.4) then B′ ) implies the sliced stability condition with ϑ = 12 . One of the main implication of the sliced stability condition is the following lemma (see Lin et al. [2015]), which plays the key role in their sequential works. Lemma 10. Let x ∈ Rp be a sub-Gaussian random variable. For any unit vector β ∈ Rp , let x(β) = hx, βi and m(β) = hm, βi = E[x(β) | y], we have the following: i) If var(m(β)) = 0 , there exists positive constants C1 , C2 and C3 such that for any b = O(1) and sufficiently large H, we have  P(varH (x(β)) > b) ≤ C1 exp −C2  nb + C3 log(H) . H2 ii) If var(m(β)) 6= 0 , there exists positive constants C1 , C2 and C3 such that, for any ν > 1, we have 1 |varH (x(β)) − var(m(β))| ≥ var(m(β)) 2ν with probability at most   n var(m(β)) + C3 log(H) . C1 exp −C2 H 2ν 2 where we choose H such that H ϑ > C4 ν for some sufficiently large constant C4 . We summarize serveral simple implications of this lemma into the following Proposition, the proof of which is simple and thus omited. For interest readers, we refer to Lin et al. [2016]. Proposition 3. There exist positive constants C1 ,C2 and C3 , such that kβτ ΛH β − βτ var(E[x|y])βk2 ≥  1 τ β var(E[x|y])β 2ν  (B.5) with probability at most C1 exp −C2 Hnλ 2 ν 2 + C3 log(H) . Proof. It follows from Lemma 10 and the fact that for any β ∈ col(var(E[x|y])), var(m(β))) ≥ λ. ✷ C. Results of simulations 8 Lin, Zhao, and Liu Table C1. Estimation error: Σ = Σ1 , and ρ = 0. p Lasso-SIR DT-SIR Lasso M-Lasso 100 0.09 0.21 0.08 0.09 1000 0.12 0.21 0.10 0.22 I 2000 0.14 0.22 0.10 0.29 4000 0.18 0.22 0.11 0.39 100 0.05 0.29 0.23 0.05 1000 0.09 0.35 0.30 0.12 II 2000 0.12 0.38 0.31 0.18 4000 0.15 0.41 0.33 0.27 100 0.17 0.23 1.14 0.20 1000 0.27 0.30 1.25 0.63 III 2000 0.35 0.34 1.31 0.77 4000 0.45 0.42 1.29 0.93 100 0.35 0.79 0.41 0.98 1000 0.59 0.96 0.61 0.84 IV 2000 0.72 1.02 0.67 1.01 4000 0.95 1.14 0.71 1.23 100 0.10 0.18 0.55 0.11 1000 0.12 0.19 0.69 0.30 V 2000 0.15 0.19 0.72 0.37 4000 0.18 0.20 0.74 0.47 Lasso-SIR(Known d) 0.09 0.12 0.14 0.18 0.05 0.09 0.11 0.15 0.18 0.23 0.26 0.34 0.35 0.56 0.64 0.82 0.09 0.13 0.15 0.18 dˆ 1 1 1 1 1 1 1 1 1 1.1 1.1 1.3 1 1.1 1.2 1.4 1 1 1 1 Table C2. Estimation error: Σ = Σ1 and ρ = 0.3. p Lasso-SIR DT-SIR Lasso M-Lasso 100 0.10 0.435 0.09 0.12 1000 0.15 0.50 0.12 0.24 I 2000 0.18 0.50 0.13 0.31 4000 0.21 0.49 0.14 0.42 100 0.06 0.46 0.22 0.08 1000 0.11 0.55 0.28 0.14 II 2000 0.14 0.55 0.30 0.20 4000 0.19 0.58 0.32 0.32 100 0.19 0.50 1.18 0.24 1000 0.29 0.60 1.30 0.58 III 2000 0.35 0.63 1.32 0.73 4000 0.57 0.75 1.33 0.98 100 0.38 0.85 0.56 0.54 1000 0.56 0.97 0.70 0.77 IV 2000 0.65 1.03 0.76 0.92 4000 0.79 1.12 0.79 1.09 100 0.10 0.47 0.48 0.14 1000 0.14 0.55 0.60 0.35 V 2000 0.17 0.56 0.66 0.44 4000 0.30 0.60 0.72 0.66 Lasso-SIR(Known d) 0.1 0.15 0.17 0.22 0.06 0.11 0.14 0.19 0.19 0.25 0.29 0.4 0.37 0.54 0.58 0.65 0.1 0.15 0.18 0.25 dˆ 1 1 1 1 1 1 1 1 1 1 1.1 1.4 1 1 1.1 1.3 1 1 1 1 Sparse Sliced Inverse Regression for High Dimensional Data Table C3. Estimation error: Σ = Σ1 , and ρ = 0.8. p Lasso-SIR DT-SIR Lasso M-Lasso 100 0.18 1.34 0.16 1.01 1000 0.24 1.38 0.22 0.79 I 2000 0.27 1.39 0.23 0.53 4000 0.32 1.39 0.25 0.45 100 0.10 1.34 0.33 1.17 1000 0.16 1.39 0.55 1.08 II 2000 0.19 1.39 0.71 0.92 4000 0.23 1.40 0.92 0.54 100 0.28 1.34 1.26 1.00 1000 0.45 1.38 1.29 0.92 III 2000 0.54 1.39 1.30 0.84 4000 0.76 1.43 1.29 0.89 100 0.74 1.40 1.21 0.91 1000 0.75 1.41 1.23 0.88 IV 2000 0.79 1.44 1.26 0.94 4000 0.93 1.52 1.27 1.09 100 0.19 1.31 0.36 1.10 1000 0.31 1.38 0.56 0.55 V 2000 0.50 1.42 0.74 0.71 4000 1.15 1.66 0.82 1.25 Lasso-SIR(Known d) 0.18 0.24 0.27 0.32 0.11 0.16 0.19 0.23 0.28 0.44 0.54 0.68 0.72 0.76 0.75 0.76 0.19 0.32 0.47 0.80 dˆ 1 1 1 1 1 1 1 1 1 1 1 1.1 1 1 1.1 1.4 1 1 1.1 2.1 Table C4. Estimation error: Σ = Σ2 and ρ = 0.2. p Lasso-SIR DT-SIR Lasso M-Lasso 100 0.13 1.22 0.09 0.16 1000 0.33 1.37 0.11 0.65 I 2000 0.30 1.37 0.12 0.74 4000 0.36 1.38 0.13 0.81 100 0.10 1.26 0.24 0.11 1000 0.25 1.37 0.31 0.47 II 2000 0.30 1.38 0.33 0.59 4000 0.31 1.40 0.35 0.65 100 0.24 1.24 1.19 0.33 1000 0.55 1.33 1.30 0.98 III 2000 0.59 1.35 1.28 1.08 4000 0.58 1.36 1.28 1.14 100 0.54 1.37 1.19 0.60 1000 0.63 1.41 1.25 0.87 IV 2000 0.64 1.41 1.27 0.99 4000 0.65 1.41 1.26 1.07 100 0.23 1.23 0.49 0.29 1000 1.03 1.10 0.61 1.15 V 2000 1.09 0.96 0.67 1.20 4000 1.07 0.99 0.71 1.21 Lasso-SIR(Known d) 0.13 0.26 0.30 0.30 0.10 0.25 0.29 0.32 0.23 0.40 0.45 0.47 0.54 0.63 0.65 0.66 0.13 0.79 0.86 0.87 dˆ 1 1.1 1 1.1 1 1 1 1 1 1.3 1.3 1.3 1 1 1 1 1.1 1.6 1.6 1.7 9 10 Lin, Zhao, and Liu Table C5. Estimation error: Σ = Σ1 and ρ = 0. p Lasso-SIR DT-SIR M-Lasso Lasso-SIR(Known d) 100 0.15 0.18 0.23 0.14 1000 0.18 0.17 0.61 0.17 VI 2000 0.22 0.20 0.72 0.20 4000 0.28 0.20 0.86 0.27 100 0.27 0.35 0.32 0.27 1000 0.37 0.40 0.93 0.37 VII 2000 0.44 0.41 1.09 0.45 4000 0.75 0.64 1.40 0.60 100 0.87 0.88 0.90 0.23 1000 0.45 0.44 0.91 0.31 VIII 2000 0.34 0.35 0.80 0.34 4000 0.57 0.53 1.04 0.41 100 0.87 0.89 0.91 0.26 1000 0.60 0.54 1.10 0.39 IX 2000 0.78 0.71 1.18 0.59 4000 0.96 0.83 1.25 0.83 dˆ 2 2 2 2 2 2 2 2.4 1.2 1.8 2 1.8 1.2 1.7 1.6 1.5 Table C6. Estimation error: Σ = Σ1 and ρ = 0.3. p Lasso-SIR DT-SIR M-Lasso Lasso-SIR(Known d) 100 0.20 0.34 0.25 0.20 1000 0.24 0.30 0.61 0.23 VI 2000 0.26 0.36 0.71 0.26 4000 0.31 0.41 0.84 0.29 100 0.28 0.63 0.42 0.28 1000 0.41 0.71 0.95 0.40 VII 2000 0.58 0.78 1.17 0.54 4000 0.97 0.92 1.46 0.78 100 0.25 0.55 0.35 0.22 1000 0.32 0.59 0.77 0.29 VIII 2000 0.34 0.69 0.81 0.34 4000 0.57 0.77 1.11 0.47 100 0.31 0.50 0.43 0.31 1000 0.35 0.47 0.99 0.35 IX 2000 0.42 0.55 1.17 0.40 4000 0.51 0.56 1.28 0.44 dˆ 2 2 2 2 2 2 2.1 2.3 2 2 2 2.2 2 2 2.1 2 Sparse Sliced Inverse Regression for High Dimensional Data Table C7. Estimation error: Σ = Σ1 and ρ = 0.8. p Lasso-SIR DT-SIR M-Lasso Lasso-SIR(Known d) 100 0.52 1.86 1.01 0.51 1000 0.79 1.92 0.93 0.79 VI 2000 0.96 1.94 1.05 0.94 4000 1.14 2.01 1.26 1.06 100 0.80 1.77 1.07 0.72 1000 1.09 1.78 1.23 1.34 VII 2000 1.09 1.76 1.23 1.39 4000 1.12 1.76 1.27 1.42 100 0.42 1.81 0.79 0.34 1000 1.00 1.97 1.22 0.86 VIII 2000 1.12 1.93 1.27 1.17 4000 1.16 1.89 1.27 1.28 100 0.78 1.90 0.95 0.79 1000 0.92 1.95 1.08 0.90 IX 2000 0.97 1.97 1.17 0.95 4000 1.12 2.03 1.37 1.01 dˆ 2 2 2 2.2 1.6 1.3 1.3 1.2 2 2.2 2.1 1.8 2 2 2 2.3 Table C8. Estimation error: Σ = Σ2 and ρ = 0.2. p Lasso-SIR DT-SIR M-Lasso Lasso-SIR(Known d) 100 0.27 1.73 0.43 0.21 1000 1.01 1.73 1.11 0.26 VI 2000 1.01 1.73 1.14 0.29 4000 1.02 1.73 1.18 0.38 100 0.39 1.70 0.55 0.31 1000 1.03 1.73 1.25 0.47 VII 2000 1.04 1.73 1.30 0.55 4000 1.04 1.73 1.34 0.69 100 0.24 1.69 0.34 0.24 1000 0.97 1.73 1.15 0.33 VIII 2000 1.03 1.74 1.24 0.35 4000 1.03 1.74 1.26 0.41 100 1.00 1.69 1.04 0.40 1000 1.03 1.73 1.22 0.67 IX 2000 1.03 1.73 1.27 0.73 4000 1.04 1.73 1.30 0.89 dˆ 1.9 1 1 1 1.9 1 1 1 2 1.1 1 1 1 1 1 1 11 12 Lin, Zhao, and Liu Table C9. Estimation error: Σ = Σ1 and ρ = 0. p Lasso-SIR DT-SIR M-Lasso 100 0.19 0.23 0.22 1000 0.22 1.13 0.60 X 2000 0.23 1.24 0.67 4000 0.24 1.29 0.71 100 0.36 0.82 0.41 1000 0.44 1.29 1.16 XI 2000 0.41 1.35 1.22 4000 0.45 1.37 1.23 100 0.23 0.53 0.25 1000 0.30 1.12 0.62 XII 2000 0.32 1.23 0.71 4000 0.34 1.29 0.75 100 0.36 0.92 0.43 1000 0.44 1.69 1.22 XIII 2000 0.44 1.80 1.30 4000 0.43 1.85 1.33 Lasso 0.18 0.25 0.27 0.29 0.37 0.43 0.48 0.47 0.21 0.30 0.34 0.36 1.05 1.08 1.09 1.10 Table C10. Estimation error: Σ = Σ1 and ρ = 0.3. p Lasso-SIR DT-SIR M-Lasso Lasso 100 0.20 0.50 0.26 0.19 1000 0.24 1.15 0.56 0.26 X 2000 0.25 1.25 0.63 0.28 4000 0.26 1.31 0.68 0.30 100 0.34 0.86 0.57 0.34 1000 0.43 1.31 1.13 0.43 XI 2000 0.42 1.36 1.20 0.45 4000 0.45 1.38 1.22 0.48 100 0.22 0.54 0.28 0.21 1000 0.29 1.10 0.57 0.30 XII 2000 0.31 1.22 0.66 0.34 4000 0.33 1.29 0.71 0.36 100 0.38 0.99 0.61 1.06 1000 0.39 1.73 1.19 1.08 XIII 2000 0.41 1.84 1.29 1.09 4000 0.42 1.88 1.33 1.10 Sparse Sliced Inverse Regression for High Dimensional Data Table C11. Estimation error: Σ = Σ1 and ρ = 0.8. p Lasso-SIR DT-SIR M-Lasso Lasso 100 0.28 1.36 0.99 0.28 1000 0.45 1.41 0.90 0.39 X 2000 0.55 1.41 0.82 0.46 4000 0.65 1.41 0.77 0.54 100 0.40 1.38 0.84 0.39 1000 0.71 1.41 1.04 0.69 XI 2000 0.89 1.41 1.11 0.88 4000 1.02 1.4 1.17 1.02 100 0.36 1.37 1.17 0.30 1000 0.63 1.41 1.16 0.52 XII 2000 0.83 1.41 1.14 0.71 4000 1.03 1.41 1.09 0.91 100 0.48 1.92 0.89 1.10 1000 0.56 1.99 1.14 1.12 XIII 2000 0.59 2.00 1.21 1.14 4000 0.61 2.00 1.31 1.15 Table C12. Estimation error: Σ = Σ2 and ρ = 0.2. p Lasso-SIR DT-SIR M-Lasso Lasso 100 0.19 1.24 0.28 0.19 1000 0.23 1.41 0.61 0.26 X 2000 0.24 1.41 0.68 0.28 4000 0.26 1.41 0.73 0.31 100 0.36 1.29 0.58 0.35 1000 0.42 1.41 1.16 0.43 XI 2000 0.46 1.41 1.22 0.48 4000 0.46 1.41 1.24 0.49 100 0.24 1.25 0.31 0.22 1000 0.32 1.40 0.62 0.32 XII 2000 0.34 1.41 0.71 0.34 4000 0.35 1.41 0.77 0.38 100 0.40 1.72 0.67 1.06 1000 0.44 1.99 1.22 1.09 XIII 2000 0.46 2.00 1.31 1.10 4000 0.45 2.00 1.37 1.11 13
10math.ST
Multi-Pointer Co-Attention Networks for Recommendation Yi Tay Nanyang Technological University Singapore [email protected] Luu Anh Tuan Institute for Infocomm Research Singapore [email protected] arXiv:1801.09251v1 [cs.CL] 28 Jan 2018 ABSTRACT Many recent state-of-the-art recommender systems such as D-ATT, TransNet and DeepCoNN exploit reviews for representation learning. This paper proposes a new neural architecture for recommendation with reviews. Our model operates on a multi-hierarchical paradigm and is based on the intuition that not all reviews are created equal, i.e., only a select few are important. The importance, however, should be dynamically inferred depending on the current target. To this end, we propose a review-by-review pointer-based learning scheme that to extract important reviews from user and item reviews, subsequently matches them in a word-by-word fashion. This enables not only the most informative reviews to be utilized for prediction but also a deeper word-level interaction. Our pointer-based method operates with a novel gumbel-softmax based pointer mechanism that enables incorporation discrete vectors within differentiable neural architectures. Our pointer mechanism is co-attentive in nature, i.e., learning pointers which are co-dependent on useritem relationships. Finally, we propose a multi-pointer learning scheme that learns to combine multiple views of interactions between user and item. Overall, we demonstrate the effectiveness of our proposed model via extensive experiments on 24 benchmark datasets from Amazon and Yelp. Empirical results show that our approach significantly outperforms existing state-of-the-art, with up to 19% and 71% relative improvement when compared to TransNet and DeepCoNN respectively. We study the behavior of our multi-pointer learning mechanism, shedding light on evidence aggregation patterns in review-based recommender systems. KEYWORDS Deep Learning; Recommendation; Collaborative Filtering ACM Reference Format: Yi Tay, Luu Anh Tuan, and Siu Cheung Hui. 2018. Multi-Pointer Co-Attention Networks for Recommendation. In Proceedings of ACM Conference (Conference’17). ACM, New York, NY, USA, 9 pages. https://doi.org/10.1145/ nnnnnnn.nnnnnnn 1 INTRODUCTION On most e-commerce platforms today, the ability to write and share reviews is not only a central feature but is also a strongly encouraged act. Reviews are typically informative, pooling an extensive Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. Conference’17, July 2017, Washington, DC, USA © 2018 Association for Computing Machinery. ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. . . $15.00 https://doi.org/10.1145/nnnnnnn.nnnnnnn Siu Cheung Hui Nanyang Technological University Singapore [email protected] wealth of knowledge for prospective customers. However, the extensive utility of reviews do not only end at this point. Reviews are also powerful in capturing preferences of authors, given the rich semantic textual information that cannot be conveyed via implicit interaction data or purchase logs. As such, there have been immense interest in collaborative filtering systems that exploit review information for making better recommendations [4, 17, 37]. Recent advances in deep learning has spurred on various innovative models that exploit reviews for recommendation [2, 24, 37]. The intuition is simple yet powerful, i.e., each user is represented as all reviews he (she) has written and an item is represented by all reviews that was written for it. All reviews are concatenated to form a single user (item) document. Subsequently, a convolutional encoder is employed to learn a single latent representation for the user (item). User and item embeddings are then matched using a parameterized function such as Factorization Machines [21]. This has shown to be highly performant [24], outperforming a wide range of traditionally strong baselines such as Matrix Factorization (MF). Models such as DeepCoNN [37], TransNets [2] and D-ATT [24] are recent state-of-the-art models that are heavily grounded in this paradigm. Intuitively, this modeling paradigm leaves a lot to be desired. Firstly, the naive concatenation of reviews into a single document is unnatural, ad-hoc and noisy. In this formulation, reviews are treated indiscriminatingly irregardless of whether they are important or not. A user’s bad review about a coffee shop should be mostly irrelevant when deciding if a Spa is a good match. Secondly, user and item representations are static irregardless of the target match. For example, when deciding if a coffee shop is a good match for a user, the user’s past reviews about other coffee shops (and eateries) should be highly relevant. Conversely, reviews about spas and gyms should not count. Hence, a certain level of dynamism is necessary. Finally, the only accessible interaction between user and item is through a fixed dimensional representation, which is learned via excessive compression of large user-item review banks into lowdimensional vector representations. For richer modeling of user and item reviews, deeper and highly accessible interaction interfaces between user-item pairs should be mandatory. Recall that reviews were fundamentally written independently, at different times, and for different products (or by different people). There should be no reason to squash everything into one long document if they can be modeled independently and then combined later. More importantly, a user may write hundreds of reviews over an extended period of time while an item may effortlessly receive a thousand of reviews. As such, existing modeling paradigms will eventually hit a dead-end. Overall, this work proposes four major overhauls have to be made to existing models, i.e., (1) reviews should be modeled independently, (2) not all reviews are equally important and should be weighted differently, (3) the importance of each review should be dynamic and dependent on the target match and finally (4), user and item reviews should interact not only through compressed vector representations but at a deeper granularity, i.e., word-level. To this end, we propose a Multi-Pointer Co-Attention Network (MPCN), a novel deep learning architecture that elegantly satisfies our key desiderata. Our model is multi-hierarchical in nature, i.e., each user is represented by n reviews of ℓ words each. Subsequently, all user and item reviews (for this particular instance pair) is matched to determine the most informative reviews. In order to do so, we design a novel pointer-based co-attention mechanism. The pointer mechanism extracts the named reviews for direct reviewto-review matching. At this stage, another co-attention mechanism learns a fixed dimensional representation, by modeling the wordlevel interaction between these matched reviews. This forms the crux of our review-by-review modeling paradigm. Finally, we introduce a multi-pointer learning scheme that can be executed an arbitrary k times, extracting multiple multi-hierarchical interactions between user and item reviews. 1.1 Our Contributions In summary, the prime contributions of this paper are as follows: • We propose a state-of-the-art neural model for recommendation with reviews. Our proposed model exploits a novel pointer-based learning scheme. This enables not only noisefree but deep word-level interaction between user and item. • We conduct experiments on 24 benchmark datasets. Our proposed MPCN model outperforms all state-of-the-art baselines by a significant margin across all datasets. Our compared baselines are highly competitive, encompassing not only review-based models but also state-of-the-art interactiononly models. We outperform models such as Neural Matrix Factorization (NeuMF) [8], DeepCoNN [37], D-ATT [24] and TransNet [2]. Performance improvement over DeepCoNN, TransNets and D-ATT are up to 71%, 19% and 5% respectively. • We investigate the inner workings of our proposed model and provide insight about MPCN works under the hood. Additionally, analyzing the behavior of our pointer mechanism allows us to better understand the nature of the problem. Through analysis of our pointer mechanism, we show that different problem domains have different patterns of ‘evidence aggregation’, which might require different treatment and special care. 2 RELATED WORK In this section, we identify and review several key areas which are highly relevant to our work. 2.1 Review-based Recommendation The utility of exploiting reviews for recommendations have been extensively discussed and justified in many works [2, 11, 17, 24, 37]. This not only enables a mitigation of cold-start issues but also provide a richer semantic modeling of user and item characteristics. While relatively earlier works have mainly concentrated efforts on topic modeling and language modeling approaches [4, 17, 30], the recent shift towards deep learning models is prominent. The advantages of neural architectures are clear, i.e., not only do these models dispense with laborious feature engineering altogether, they are often highly competitive. In many recent works, Convolutional neural networks (CNN) act as automatic feature extractors, encoding a user (item) into a low-dimensional vector representation. User and item embeddings are then compared with a matching function. An earlier neural model, the Deep Co-operative Neural Networks (DeepCoNN) [37] represents a user as all the reviews that he (she) has written. Likewise, an item is represented as all the reviews ever written (by other users) for it. User and item documents are then encoded with CNNs and passed into a Factorization Machine (FM) [21] for matching. It was later argued that DeepCoNN’s competitive performance exploits the fact that test reviews were leaked (into the training set) [2]. As such, this reduces the recommendation problem to resemble a noisy adaption of standard document-level sentiment analysis. To this end, [2] proposed TransNets, augmenting a DeepCoNN-like neural network with an additional multi-task learning scheme. More specifically, it learns to transform the penultimate hidden layer of DeepCoNN into a CNNencoded representation of the test review. This signal was found to be useful, improving the performance on multiple benchmarks. DeepCoNN and TransNet are relatively simple model architectures. Another recently proposed model, the Dual Attention CNN model (D-ATT) [24] proposed augmenting CNNs with neural attention. The key idea of neural attention [1] is to emphasize important segments of documents by weighting each word by a learned attention vector. The final representation comprises a weighted linear combination of all input embeddings. Two variants of attention mechanism are proposed, i.e., local and global, both modeling different views of user-item review documents. However, these models are not without flaws. As mentioned, these models follow the same paradigm of representing user and items as a giant concatenated document of all their reviews which suffers inherent drawbacks such as (1) noise, (2) lack of dynamic target-dependent and (3) lack of interaction interfaces. 2.2 Text Matching and Co-Attentional Models Our work is closely related to the problems domains of sequence pair modeling. A wide spectrum of models have been proposed for modeling relationships between two sequences, e.g., questionanswer [5, 26], premise-hypothesis [20, 22, 27] which are very similar to the user-item modeling problem at hand. In these fields, learning representations without fine-grained interaction modeling, i.e., absence of interaction interfaces ala DeepCoNN, is known to be far outperformed by new models which utilize co-attentional mechanisms [5, 36]. Co-attentions learn pairwise attention between two sequences [35] (or modalities [15]), enabling pair-aware attention weights to be learned. 2.3 Recent Advances in Deep Learning Notably, our network solely relies on attention mechanisms, and showcases the potential neural architectures that do not use convolutional and recurrent layers. This is reminiscent of (and inspired by) the Transformer [28] architecture which uses multi-headed attention, concatenating outputs of each attention call. Additionally, our work is characterized by the usage of pointers, which have been popularized by both Pointer Networks [29] which learn to predict an output token which exists in the sequence itself, i.e., pointing to a token. The usage of pointers are primarily motivated for discrete problems and have also been widely adopted for answer span prediction in question answering [32]. In this models, pointers are commonly applied at the last layer and have no issues since the model optimizes a loss function such as the cross entropy loss. However, our model requires the usage of pointers within the network (between layers). As such, a form of hard attention is required. Due to the non-differentiability of hard attention, it has been much less popular than the standard soft attention. In order to generate discrete pointers, we utilize the recent gumbel-softmax [10] trick which is capable of learning one-hot encoded vectors. Notably, the gumbel-softmax was recently adapted for automatic compositional learning of Gumbel TreeLSTMs [3], in which the gumbel-softmax is exploited to adaptively learn to make merging decisions. 2.4 OUR PROPOSED MODEL In this section, we present a layer-by-layer description of our proposed model. The overall model architecture is illustrated in Figure 2. 3.1 Sum Input Encoding Our model accepts two input sequences, a (user) and b (item). Each input sequence is a list of reviews {r 1 , r 2 · · · r ℓd } where ℓd is the maximum number of reviews. 3.1.1 Embedding Layer. Each review is a sequence of ℓw words which are represented as one-hot encoded vectors. For a and b, we pass all words into an embedding matrix Wd × |V | where V is the vocabulary, retrieving a d dimensional vector for each word. Our network is hierarchical in nature, i.e., instead of representing all user (or item) reviews as one long document, we represent each user (or item) as a sequence of reviews. Each review is then hierarchically constructed from a sequence of words. 3.1.2 Review Gating Mechanism. Each review is represented as a sum of its constituent word embeddings to form the vector ∈ Rd . Intuitively, not all reviews that a user writes and not all reviews Sum Word-level Co-Attention Expand Review To Word-level Expand Review To Word-level Review Pointers 0 1 0 0 0 0 0 1 Row/Col Max Pooling Review Pointers Review-level Co-Attention Deep Learning for Recommendation Factorization-based models [9, 19, 21] were popular standard machine learning baselines for interaction-based recommendation. Today, we see a shift into deep learning, in which neural models are claiming state-of-the-art performance. He et al. [8] proposed a neural framework that combines a generalized matrix factorization formulation with multi-layered perceptrons. He and Chua [7] proposed a neural adaptation of factorization machines. [34] proposed recurrent models for sequential modeling of interaction data. Tay et al. [25] proposed a translation-based framework that exploits neural attention for modeling user-item relations. Li et al. [13] proposed a encoder-decoder based framework for both rating prediction and generating tips. A separate class of deep models based on auto-encoders [14, 23, 31] have also been proposed for recommendation tasks. 3 FM Review Embeddings User Reviews Item Reviews Figure 1: Illustration of proposed model architecture for Pointer-based Learning (Best viewed in color). This example illustrates a one pointer example. Review gating mechanism and multi-pointer learning is omitted for clarity. written for a product is important. We design a first-stage filter, i.e., a review gating mechanism that accepts each review as an input and controls how much information passes through to the next level. Given the input x ∈ Rℓr ×d , which represents either a or b. x¯i = σ (Wд x i ) + bд ⊙ tanh(Wu x i + bu ) (1) where ⊙ is the Hadamard product and σ is the sigmoid activation function. x i is the i-th review of sequence x. Wд , Wu ∈ Rd ×d and bд , bu ∈ Rn are parameters of this layer. While the purpose of the co-attention layer is to extract important reviews, we hypothesize that applying a pre-filter (gating mechanism) helps improve performance on certain datasets. 3.2 Review-level Co-Attention In this layer, the aim is to select the most informative review from the review bank of each user and item respectively. 3.2.1 Affinity Matrix. Given a list of review embeddings from each user (a ∈ Rℓr ×d ) and item (b ∈ Rℓr ×d ) banks, we calculate an affinity matrix between them. This is described as follows: si j = F (ai )⊤ M F (b j ) (2) where Md ×d and S ∈ Rℓr ×ℓr . F (.) is a feed-forward neural network function with l layers. In practice, l is tuned amongst [0, 2] where l = 0 reverts Equation (2) to the bilinear form. 3.2.2 Pooling Function. By taking the row and column wise maximum of the matrix s and using them to weight the original list of reviews a and b, we are able to derive the standard co-attention mechanism. This is described as follows: a ′ = (G(max(s)))⊤a col b ′ = (G(max(s)))⊤b r ow (3) There are different choices for the pooling operation. The choice of the max pooling is because, intuitively max pooling selects the review which has the maximum influence (or affinity) with all reviews from its partner. This type of co-attention is known to be extractive, characterized by its usage of max-pooling. Note that we apply the function G(.) to maxcol (s) and maxr ow (s). In most applications, G(.) would correspond to the standard softmax function, which converts the input vector into a probability distribution. Vectors a ′, b ′ would then be the co-attentional vector representations). However, in our case, we desire further operations on the selected reviews and therefore do not make use of these representations. Instead, G(.) has to return a one-hot encoded vector, pointing to the selected reviews, forming the real objective behind this co-attentional layer. However, the Softmax function returns a continuous vector, which is unsuitable for our use-case. The usage of discrete vectors in neural architectures is known to be difficult, as the arg max operation is non-differentiable. Hence, we leverage a recent advance, the Gumbel-Max trick, for learning to point. The next section describes this mechanism. 3.3 Review Pointers We leverage a recent advance, the Gumbel-Softmax [10] for incorporating discrete random variables in the network. 3.3.1 Gumbel-Max. In this section, we describes Gumbel-Max [16], which facilitates the key mechanism of our MPCN model. Gumbel-Max enables discrete random variables (e.g., one hot vectors) to be utilized within an end-to-end neural network architecture. Consider a k-dimensional categorical distribution where class probabilities p1 , · · · pk are defined in terms of unnormalized log probabilities π1 , · · · πk : exp(log(πi )) pi = Í k exp(log(π )) j j=1 (4) Rk A one hot sample z = (z 1 , · · · zk ) ∈ from the distribution can be drawn by the following: ( 1 , i = arg maxj (log(π j ) + дj ) zi = (5) 0 , otherwise дi = − log(− log(ui )) ui ∼ U ni f orm(0, 1) (6) where дi is the Gumbel noise which perturbs each log(πi ) term such that the arg max operation is equivalent to drawing a sample weighted by pi , · · · pk . 3.3.2 Straight-Through Gumbel-Softmax. In the Gumbel-Softmax, the key difference is that the arg max function is replaced by the differentiable softmax function as described as follows: log(π )+д i i exp( ) τ yi = Í log(π )+д j i k exp( ) τ j=1 (7) where τ is a temperature parameter. As τ approaches zero, the output of the Gumbel-Softmax distribution becomes cold, i.e., becomes closer to a one-hot vector. In the straight-through (ST) adaptation, the forward-pass is discretized by converting the vector output to a one-hot vector via arg max: ( 1 , i = arg maxj (y j ) yi = (8) 0 , otherwise However, the backward pass maintains the flow of continuous gradients which allows the model to be trained end-to-end. This is useful as we only want important reviews to be selected (i.e., hard selected) to be considered in computation of the loss function. Notably, alternatives such as REINFORCE [33] exists. However, it is known to suffer from high variance and slow convergence [10]. 3.3.3 Learning to Point. In order to compute a review pointer (for user and item), we set G(.) in Equation 3 to use the Gumbel Softmax. However, since we are interested only in the pointer (to be used in subsequent layers), the pointer is then calculated as: pa = (Gumbel(max(s))) col pb = (Gumbel(max(s))) r ow (9) By applying pa to a, we select the pa − th review of user a and pb − th review of item b. The selected reviews are then passed into the next layer where rich interactions are extracted between these reviews. 3.4 Word-level Co-Attention The review-level co-attention smooths over word information as it compresses each review into a single embedding. However, the design of model allows the most informative reviews to be extracted by the use of pointers. These reviews can then be compared and modeled at word-level. This allows a user-item comparison of finer granularity which facilitates richer interactions as compared to simply composing the two review embeddings. Let ā, b̄ be the selected reviews using the pointer learning scheme. Similar to the review-level co-attention, we compute a similarity matrix between ā and b̄. The key difference is that the affinity matrix is computed word-by-word and not review-by-review. w i j = F (āi )⊤ Mw F (b̄ j ) (10) where Mw ∈ Rd ×d and w ∈ Rℓw ×ℓw . Next, to compute the coattentional representation of reviews ā, b̄, we take the mean pooling. ā ′ = (S(avдcol (s)))⊤ā b̄ ′ = (S(avдr ow (s)))⊤b̄ (11) where S(.) is the standard Softmax function and F (.) is a standard feed-forward neural network with l layers. The rationale for using the average pooling operator here is also intuitive. At the reviewlevel, a large maximum affinity score of a review with respect to all opposite reviews (even when a low average affinty socre) warrants it being extracted, i.e., a strong signal needs to be further investigated. However, at a word-level, max-pooling may be biased towards identical words and are have a great inclination to act as a word matching operator. Hence, we want to maintain a stable co-attentive extractor. Our early empirical experiments also justify this design. Finally ā ′ and b̄ ′ are the output representations. 3.5 i=1 Multi-Pointer Learning While our objective is to eliminate noisy reviews by the usage of hard pointers, pointing to only a single pair of review might be insufficient. Hence, we a devise a multi-pointer composition mechanism. The key idea is to use multiple pointers where the number of pointers np is a user-defined hyperparameter. Our model runs the Review-level Co-Attention np times, each generating a unique pointer. Each of the np review pairs are then modeled with the Word-level Co-Attention mechanism. The overall output is a list of vectors {ā 1′ , · · · ān′ p } and {b̄1′ , · · · b̄n′ p }. Additionally, we also found it useful include the sum embedding of all words belonging to the user (item). This mainly helps in robustness, in-case where user and item does not have any matching signals that was found by our pointer mechanism. We explore three ways to compose these embeddings. • Concatenation - All pointer outputs are concatenated, e.g., [ā 1′ ; · · · ān′ p ]. This has implications to the subsequent layers, especially if np is large. Hence we consider the last alternative. • Additive Composition - All pointer outputs are summed, e.g., sum(ā 1′ , · · · ān′ p ). • Neural Network - All pointer outputs are concatenated and passed through a single layered non-linear layer. e.g., ReLU (W ([ā 1′ ; · · · ān′ p ]) +b which maps the concatenated vector into a d dimension vector. Note that this is applied to b̄ ′ as well but omitted for brevity. Let the output of this layer be a f and bf . In our experiments, we tune amongst the three above-mentioned schemes. More details are provided in the ablation study. FM FM Neural Network Multi-Pointer Learning p1 Additive Multi-Pointer Sum p1 p3 Model User Reviews Item Reviews Multi-Pointer Learning p3 Model User Reviews Item Reviews Figure 2: Illustration of Neural Network (left) and Additive (right) based Multi-Pointer Learning. 3.6 real-valued feature vector and models the pairwise interactions between features using factorized parameters. The FM function is defined as follows: n n Õ n Õ Õ F (x) = w 0 + wi xi + ⟨vi , v j ⟩ x i x j (12) Prediction Layer This layer accepts a f , bf as an input. The concatenation of [a f ; bf ] is passed into a factorization machine (FM) [21]. FMs accepts a i=1 j=i+1 where x ∈ Rk is a real-valued input feature vector. ⟨., ⟩ is the dot product. The parameters {v 1 . . . vn } are factorized parameters (vectors of v ∈ Rk ) used to model pairwise interactions ((x i , x j )). Í w 0 is the global bias and ni=1 w i x i represents a linear regression component. The output of F (x) is a scalar, representing the strength of the user-item interaction. The network is trained end-to-end by minimizing the standard mean squared error loss following [24]. 4 EMPIRICAL EVALUATION In this section, we present our experimental setup and empirical evaluation. Our experiments are designed to answer the following research questions (RQs): (1) RQ1 - Does our proposed approach outperform state-of-theart models such as D-ATT and DeepCoNN? How much is the relative improvement? (2) RQ2 - What are the impacts of some of the design / architectural choices of MPCN? (3) RQ3 - What are the effects of the key hyperparameters of our model (e.g., number of pointers etc.) on model performance? (4) RQ4 - Are we able to derive any insight about how MPCN works by analyzing the behavior of the pointer layer? 4.1 Datasets We utilize datasets from two different sources which are described as follows: (1) Yelp Dataset Challenge - Yelp is an online review platform for businesses such as restaurants, bars and spas etc. We use the dataset from the latest challenge1 . (2) Amazon Product Reviews - Amazon is a well-known Ecommerce platform. Users are able to write reviews for products they have purchased. We use 23 datasets from the Amazon Product Review corpus2 [6, 18]. In total, we provide model comparisons over 24 benchmark datasets. For all datasets, we split interactions into training, development and testing sets. We utilize a time-based split, i.e., the last item of each user is added to the test set while the penultimate is used for development. For Amazon, the datasets are preprocessed in a 5-core fashion (i.e., each user and item have at least 5 reviews to be included). Since the datasets can be found in the official webpage, we do not restate their statistics to save space. For Yelp, we use a 20-core setting, providing a comparison on a denser dataset. We tokenize the reviews using NLTK and retain words that appear at least 10 times in the vocabulary. We would like to emphasize that, when building user and item representations using their respective reviews, all reviews belonging to interactions from the test and development sets were not included. This is to prevent the problem from reverting to a sentiment analysis task, albeit noisier [2]. 1 https://www.yelp.com/dataset/challenge 2 http://jmcauley.ucsd.edu/data/amazon/ Dataset Yelp17 Instant Video Instruments Digital Music Baby Patio / Lawn Gourmet Food Automotive Pet Supplies Office Products Android Apps Beauty Tools / Home Video Games Toys / Games Health CellPhone Sports / Outdoors Kindle Store Home / Care Clothing CDs / Vinyl Movies / TV Electronics MF 1.735 2.769 6.720 1.956 1.755 2.813 1.537 5.080 1.736 1.143 1.922 1.950 1.569 1.627 1.802 1.882 1.972 1.388 1.533 1.667 2.396 1.368 1.690 1.962 Interaction FM MLP 1.726 1.727 1.331 1.532 1.166 1.081 1.382 1.361 1.614 1.585 1.311 1.279 1.348 1.442 1.599 1.071 1.618 1.649 0.998 1.122 1.871 1.805 1.711 1.631 1.310 1.356 1.665 1.576 1.195 1.286 1.506 1.522 1.668 1.622 1.195 1.120 1.217 1.231 1.547 1.584 1.492 1.462 1.555 1.432 1.852 1.518 2.120 1.950 NEUMF 1.691 1.451 1.189 1.332 1.598 1.251 1.464 1.013 1.646 1.069 1.842 1.552 1.314 1.568 1.222 1.415 1.606 1.299 1.398 1.654 1.535 1.368 1.775 1.651 D-CON 1.385 1.285 1.483 1.202 1.440 1.534 1.199 1.130 1.447 0.909 1.517 1.453 1.208 1.307 1.057 1.299 1.524 1.039 0.823 1.259 1.322 1.045 1.960 1.372 Reviews TNET D-ATT 1.363 1.428 1.007 1.004 1.100 0.964 1.004 1.000 1.338 1.325 1.123 1.037 1.129 1.143 0.946 0.881 1.346 1.337 0.840 0.805 1.515 1.509 1.404 1.409 1.122 1.101 1.276 1.269 0.974 0.982 1.249 1.269 1.431 1.452 0.994 0.990 0.797 0.813 1.235 1.237 1.197 1.207 1.010 1.018 1.176 1.187 1.365 1.368 MPCN 1.349 0.997 0.923 0.970 1.304 1.011 1.125 0.861 1.328 0.779 1.494 1.387 1.096 1.257 0.973 1.238 1.413 0.980 0.775 1.220 1.187 1.005 1.144 1.350 Improvement (%) ∆DC ∆T N ∆DA 2.7 1.0 5.9 28.9 1.0 0.7 60.7 19.2 4.4 23.9 3.5 3.1 10.4 2.6 1.6 51.7 11.1 2.6 6.6 0.4 1.6 31.2 9.9 2.3 9.0 1.4 0.7 16.7 7.8 3.3 1.5 1.4 1.0 4.8 1.2 1.6 10.2 2.4 0.5 4.0 1.5 1.0 8.6 0.1 0.9 4.9 0.9 2.5 7.9 1.3 2.8 6.0 1.4 1.0 6.2 2.8 4.9 3.2 1.2 1.4 11.4 0.8 1.7 4.0 0.5 1.3 71.3 2.8 3.8 1.6 1.1 1.3 Table 1: Performance comparison (mean squared error) on 24 benchmark datasets. The best performance is in boldface. ∆DC , ∆T N , ∆DA are the relative improvements (%) of MPCN over DeepCoNN (D-CON), TransNet (T-NET) and D-ATT respectively. MPCN achieves state-of-the-art performance, outperforming all existing methods on 24 benchmark datasets. 4.2 • Dual Attention CNN Model (D-ATT) [24] is a recently proposed state-of-the-art CNN-based model that uses reviews for recommendation. This model is characterized by its usage of two forms of attention (local and global). A final user (item) representation is learned by concatenating representations learned from both local and global attention. The dot product between user and item representations is then used to estimate the rating score. Compared Methods We compare against a series of competitive baselines. • Matrix Factorization (MF) is a standard and well-known baseline for CF. It represents the user and item rating with the inner product, i.e., p ⊤q. • Factorization Machines (FM) [21] are general purpose machine learning algorithms that use factorized parameters to model pairwise interactions a real-valued feature vector. We concatenate the user-item latent embedding together and pass it through the FM model. • Multi-layered Perceptrons (MLP) are strong neural baselines for CF and was used as a baseline in [8]. We use the same pyramidal scheme of 3 layers. • Neural Matrix Factorization (NeuMF) [8] is the state-ofthe-art model for interaction-only CF. It casts the MF model within a neural framework and combines the output with Multi-layered perceptrons. • Deep Co-Operative Neural Networks (DeepCoNN) [37] is a review-based convolutional recommendation model. It trains convolutional representations of user and items and passes the concatenated embedding into a FM model. • TransNet [2] is an improved adaptation of DeepCoNN which incorporates transform layers and an additional training step that enforces the transformed representation to be similar to the embedding of the actual target review. user and item review documents and passes the learned embeddings into a FM model. Given our already extensive comparisons against the state-of-theart, we omit comparisons with models such as HFT [17], Collaborative Topic Regression [30], Collaborative Deep Learning (CDL) [31] and ConvMF [11] since they have been outperformed by the recently proposed DeepCoNN or D-ATT model. 4.3 Experimental Setup The evaluation metric is the well-known (and standard) meansquared error which measures the square error between the rating prediction and ground truth. We implement all models ourselves in Tensorflow. All models are trained with Adam [12] with an initial learning rate of 10−3 . We train all models for a maximum of 20 epochs with early stopping (i.e., if model performance does not improve for 5 epochs) and report the test result from the best performing model on the development set. We found that models tend to converge before 20 epochs. However, an exception is that the MF baseline requires many more epochs to converge. As such, we train the MF model till convergence. For interaction only models, the embedding size is set to 50. For TransNet and DeepCoNN, the number of filters is set to 50 and the filter size is 3. For D-ATT, the global attention layer uses filter sizes of [2, 3, 4]. The word embedding layer is also set to 50 dimensions. We regularize models with a dropout rate of 0.2 and a fixed L2 regularization of 10−6 . Dropout is applied after all fully-connected and convolutional. We use two transform layers in the TransNet model. All word embeddings are learned from scratch as we found that using pretrained embeddings consistently degrades performance across all datasets (and models). The maximum document length is set to 600 words (20 reviews of 30 tokens each) which we empirically found to be a reasonable length-specific performance bound. We assign a special delimiter token to separate reviews within a user (item) document for DeepCoNN, TransNet and D-ATT. If FM is used, the number of factors is set to 10. For our proposed model, the number of pointers p is tuned amongst {1, 3, 5, 8, 10}. On most datasets, the optimal performance is reached with 2 − 3 pointers. 4.4 Experimental Results Table 1 reports the results of our experiments. Firstly, we observe that our proposed MPCN is the top performing model on all 24 benchmark datasets. This ascertains the effectiveness of our proposed model and clearly answers RQ1. MPCN consistently and significantly outperforms DeepCoNN, TransNet and D-ATT, which are all recent competitive review-based methods for recommendation. The relative improvement is also encouraging with gains of up to 71% (DeepCoNN), 19% (TransNet) and 5% (D-ATT). On majority of the datasets, performance gains are modest, seeing an improvement of 1% − 3% for most models. Notably, the average percentage improvement of MPCN over DeepCoNN is 16%. The average performance gain over TransNet and D-ATT is a modest 3.2% and 2.2% respectively. Pertaining to the relative ranking of the review-based models, our empirical evaluation reaffirms the claim of [2], showing that TransNet always outperforms DeepCoNN. However, the relative ranking of D-ATT and TransNet switches positions frequently. Notably, TransNet uses the test review(s) as an additional data source (albeit as a training target) while D-ATT does not make use of this information. The additional training step of TransNet is actually quite effective and hypothetically could be used to enhance D-ATT or MPCN as well. However, we leave that for future work. Next, the performance of interaction-only models (MF, FM etc.) is consistently lower than review-based models (e.g., DeepCoNN). The relative performance of all interaction models is generally quite inconsistent over various datasets. However, one consistent fact is that MF performs worse to models most of the time. The top scoring interaction model often switches between FM and MLP. Finally, we give readers a sense of computational runtime. We provide a estimate that we found generally quite universal across multiple datasets. Let t be the runtime of DeepCoNN, the runtime of MPCN p = 1 is approximately ≈ 0.4t. MPCN with 2 and 3 pointers are 0.8t and 1.2t respectively. TransNet and D-ATT runs at ≈ 2t. On medium size datasets (e.g., Amazon Beauty), t ≈ 40s on a GTX1060 GPU (batch size is 128). We found that if popt ≤ 2, then MPCN is faster than DeepCoNN. While popt ≤ 5 is the threshold for being equal with D-ATT and TransNet in terms of runtime. 5 HYPERPARAMETER & ABLATION ANALYSIS In this section, we study the impact of key hyperparameter settings and various architectural choices on model performance. 5.1 Ablation Analysis We study the impacts of various architectural decisions on model performance (RQ2). Table 2 reports an ablation analysis conducted on the development sets of four benchmark datasets (Beauty, Office, Musical Instruments (M-Instr) and Amazon Instant Video (Inst-Vid)). We report the results of several different model variations. We first begin describing the default setting in which ablation reports are deviated from. In the default setting, we use the standard model with all components (review gates, word-level co-attention, FM prediction layer). The Multi-Pointer aggregation (aggr) is set to use a neural network (single layer nonlinear transform). The number of layers in the co-attention layer is set to l = 0. We report the validation results from 7 different variations, with the aims of clearly showcasing the importance of each component. In (1) we remove the review gating mechanism. In (2), we replace the FM with the simple inner product. In (2-3), we investigate the effects of different pointer aggregation (aggr) functions. They are the concatenate and additive operators respectively. In (4-5), we set l = 0 (remove layer) and l = 2. In (6) , we remove the word level co-attention layer. In this case, the representation for user and item is simply the pointed review embedding. In (7), we remove the review-level co-attention (RLCA). This variation is no longer ‘hierarchical’, and simply applies word-level co-attention to user and item reviews. Architecture (0) Default (1) Remove Gates (2) Remove FM (2) Agrr (Concat) (3) Aggr (Additive) (4) set l = 0 (5) set l = 2 (6) Remove WLCA (7) Remove RLCA Beauty 1.290 1.299 1.286 1.279 1.290 1.293 1.295 1.296 1.304 Office 0.770 0.760 0.808 0.788 0.767 0.776 0.775 0.778 0.789 M-Instr 0.827 0.837 0.924 0.832 0.829 0.830 0.829 0.831 0.839 Inst-Vid 0.975 0.979 0.997 0.971 0.971 0.976 0.974 0.999 0.1003 Table 2: Ablation analysis (validation MSE) on four datasets. Firstly, we observe the default setting is not universally the best across four datasets. As mentioned, the review gating mechanism helps in 3 out of 4 presented datasets. In the office dataset, removing the review gating layer improves performance. We found this to be true across most datasets, i.e., the review gating mechanism helps more often than not, but not always. The impacts of removing FM is quite easily noticed, leading to huge performance degradation on the M-Instr dataset. Deprovement on Inst-Vid and Office is also significant. On the other hand, removing FM marginally improved performance on Beauty. We also discovered that there is no straightforward choice of aggr functions. Notably, the relative ranking of all three variants (concat, additive and neural network) are always interchanging across different datasets. As such, they have to be tuned. We also noticed that the choice of l = 1 is safe across most datasets, as increasing or decreasing would often lead to performance degradation. Finally, removing the WLCA and RLCA consistently lowered performance on all datasets, which ascertains the effectiveness of the WLCA layer. Notably, removing RLCA seems to hurt performance more, which signifies that modeling at a review-level is essential. 5.2 Effect of Number of Pointers Table 3 reports the effect of varying pointers on performance (RQ3). We use 4 datasets of varying sizes as an illustrative example (Patio, Automotive, Sports and Video Games). The datasets shown are sorted from smallest to largest in terms of number of interactions. Clearly, we observe that the optimal number of pointers varies across all datasets. We found this to hold true for the remainder datasets that are not shown. This seems to more of a domain-dependent setting since we were not able to find any correlation with dataset size. For most datasets, the optimal pointers falls in the range of 1 − 3. In exceptional cases (Video Games), the optimal number of pointers was 5. Ptr 1 2 3 4 5 Patio 0.992 0.980 0.975 0.991 0.991 Automotive 0.842 0.855 0.843 0.844 0.844 Sports 0.926 0.933 0.938 0.938 0.935 Video Games 1.885 1.178 1.194 1.189 1.121 Table 3: Validation MSE on various datasets when varying the number of pointers. The best result is in boldface. The optimal number of pointers is domain-dependent. we believe that this is trying to solicit the user’s preferences about a type of product. We provide some qualitative examples in Table 4. Consider the context of video games, it finds that the user has written a review about rpg (roleplaying games). At the same time, it finds that the item review consists of a (positive) review of the item being a good rpg game. As a result, it surfaces both reviews and concurrently points to both of them. This follows suit for the other examples, e.g., it finds a matching clue of puzzle games (turnbased) in the second example. The last example is taken from the Gourmet Food dataset. In this case, it discovers that the user likes cocoa, and concurrently finds out that the product in question has some relevant information about chocolate. 6.2 Behavior of Multi-Pointer Learning In this section, we study the behavior of our multi-pointer mechanism. First and foremost, this serves as another sanity check and to observe if multi-pointers are really necessary, i.e., if pointers are not pointing all to the same reviews. Hence, this section aims to provide better insight into the inner workings of our proposed model. We trained a MPCN model with four pointers. A quick observation is that all four pointers point to different reviews (given the same user item pair). This is automatic, and does not require any special optimization constraint (such as explicitly enforcing the model to choose different reviews through an extra optimization term). Moreover, we analyze the affinity matrix from the reviewlevel co-attention. Figure 3 shows the affinity matrix for pointers one to four. 1.0 1 2 0.8 5 6 IN-DEPTH MODEL ANALYSIS 0.6 9 6.1 What are the pointers pointing to? User Review game is really beautiful! coolest rpg ever... .. game is completely turned based, so you have time to ponder you actions.. just love this little guy ... phone is reasonably easy to put in and take out is a nice charger..but after a few momths it wasn’t charging... cocoa is a wonderful, rich tasting, not overly sweet product .. Item Review ..a gift for a friend who really loves rpg games. he really loved it! ..is a great and engaging puzzler game but wasn’t too challenging ..case really fits the 5s like a glove.. it is clearly a used or refurbished battery.. used to eat the dark and milk chocolate, and then i tried this and can’t explain how good they are Table 4: Excerpts from top matching User and Item reviews extracted by MPCN’s pointer mechanism. In this section, we list some observations by analyzing the behavior of the MPCN model. Firstly, we observed that pointers react to aspects and product sub-categories. In many cases, we observed that the pointer mechanism tries to find the most relevant review written by the user for a given product. If the target item is a phone case, then our model tries to find a review written by the user which is directed towards another phone case product. Intuitively, 4 7 0.6 9 8 10 10 10 11 11 11 12 12 12 0.4 0.4 13 14 15 18 0.2 17 0.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (a) p = 1 0.2 17 0.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (b) p = 2 16 0.2 17 18 19 20 0.4 15 16 18 19 20 13 14 15 16 18 19 0.4 13 14 15 0.2 17 0.6 9 12 14 0.8 5 6 8 11 13 1.0 3 0.8 5 7 0.6 9 1 2 4 6 8 10 16 In this section, we present several insights pertaining to the inner workings of our proposed model. This aims to answer RQ4. 0.8 5 7 8 1.0 3 4 6 7 1 2 3 4 6 1.0 1 2 3 19 20 0.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (c) p = 3 20 0.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (d) p = 4 Figure 3: Visualisation of Review-level Co-Attention. Matching patterns differ significantly across multiple calls, hence generating different pointers Secondly, it is also intuitive that it is not absolutely necessary for MPCN to always point to unique reviews given the same useritem pair. We observed a relatively significant one-to-many pointer pattern on top of the usual one-to-one pattern. In this case, the same review for user (item) is being matched with n (many) different reviews from the item (user). This is also observed to be dataset / domain dependent. In a small minority of cases, all pointers pointed to same reviews constantly (all repeated condition). However, this is understandable as there is just insufficient information in the user and item review bank. Additionally, we analyzed a small sample from the test set, determining if any of the following conditions hold for each test case. Table 5 reports the percentages of test samples which falls into each category. We report results on five datasets Digital Music (D-Music), Android Apps (Apps), Video Games (V-Games), Gourmet Food (Food) and Yelp17. Here, we observe that pointer behavior is largely influenced by domain. The first three are concerned with electronic domains while the last two are more focused on food Condition (1) All unique (2) 1 Repeated (3) All Repeated (4) One-to-Many D-Music 85.2% 13.2% 1.6% 64.8% Apps 87.5% 12.5% 0.0% 57.8% V-Games 82.0% 17.2% 1.6% 57.8% Food 99.2% 0.7% 0.0% 23.4% Yelp17 99.2% 0.7% 0.0% 43.7% Table 5: Analysis of Multi-Pointer Behavior of MPCN on five datasets using np = 3. (and restaurants). We clearly observe that Food and Yelp have very similar pointer behavior. In general, electronic problem domains usually make an inference using a select few subset of reviews. This is made evident by the high one-to-many ratio which signifies that there is often one important review written by the user (or item) that contributes more (and needs to be matched with multiple opposing reviews). Conversely, food problem domains require more evidences across multiple reviews. We believe this is one of the biggest insights that our work offers, i.e., shedding light on how evidence aggregation works (and differs across domains) in reviewbased recommendation. 7 CONCLUSION We proposed a new state-of-the-art neural model for recommendation with reviews. Our proposed Multi-Pointer Co-Attention Networks outperforms many strong competitors on 24 benchmark datasets from Amazon and Yelp. We conduct extensive analysis on the inner workings of our proposed multi-pointer learning mechanism. By analyzing the pointer behavior across multiple domains, we conclude that different domains (such as food-related and electronics-related) have different ‘evidence aggregation’ patterns. While our model dynamically handles this aspect, we believe this warrants further investigation. REFERENCES [1] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473 (2014). [2] Rose Catherine and William Cohen. 2017. TransNets: Learning to Transform for Recommendation. arXiv preprint arXiv:1704.02298 (2017). [3] Jihun Choi, Kang Min Yoo, and Sang-goo Lee. 2017. Unsupervised learning of task-specific tree structures with tree-lstms. arXiv preprint arXiv:1707.02786 (2017). [4] Qiming Diao, Minghui Qiu, Chao-Yuan Wu, Alexander J. Smola, Jing Jiang, and Chong Wang. 2014. Jointly modeling aspects, ratings and sentiments for movie recommendation (JMARS). In The 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’14. [5] Cícero Nogueira dos Santos, Ming Tan, Bing Xiang, and Bowen Zhou. 2016. Attentive Pooling Networks. CoRR abs/1602.03609 (2016). [6] Ruining He and Julian McAuley. 2016. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In Proceedings of the 25th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee, 507–517. [7] Xiangnan He and Tat-Seng Chua. 2017. Neural Factorization Machines for Sparse Predictive Analytics. (2017). [8] Xiangnan He, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu, and Tat-Seng Chua. 2017. Neural Collaborative Filtering. In Proceedings of the 26th International Conference on World Wide Web (WWW ’17). 173–182. [9] Xiangnan He, Hanwang Zhang, Min-Yen Kan, and Tat-Seng Chua. [n. d.]. Fast Matrix Factorization for Online Recommendation with Implicit Feedback. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, SIGIR 2016, Pisa, Italy, July 17-21, 2016. [10] Eric Jang, Shixiang Gu, and Ben Poole. 2016. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144 (2016). [11] Donghyun Kim, Chanyoung Park, Jinoh Oh, Sungyoung Lee, and Hwanjo Yu. 2016. Convolutional Matrix Factorization for Document Context-Aware Recommendation. In Proceedings of the 10th ACM Conference on Recommender Systems (RecSys ’16). ACM, New York, NY, USA. [12] Diederik P. Kingma and Jimmy Ba. 2014. Adam: A Method for Stochastic Optimization. CoRR abs/1412.6980 (2014). [13] Piji Li, Zihao Wang, Zhaochun Ren, Lidong Bing, and Wai Lam. 2017. Neural Rating Regression with Abstractive Tips Generation for Recommendation. (2017). [14] Xiaopeng Li and James She. 2017. Collaborative Variational Autoencoder for Recommender Systems. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD ’17). [15] Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. 2016. Hierarchical question-image co-attention for visual question answering. In Advances In Neural Information Processing Systems. 289–297. [16] Chris J Maddison, Daniel Tarlow, and Tom Minka. 2014. A* sampling. In Advances in Neural Information Processing Systems. 3086–3094. [17] Julian McAuley and Jure Leskovec. 2013. Hidden factors and hidden topics: understanding rating dimensions with review text. In Proceedings of the 7th ACM conference on Recommender systems. ACM, 165–172. [18] Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. 2015. Image-based recommendations on styles and substitutes. In Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval. ACM, 43–52. [19] Andriy Mnih and Ruslan R Salakhutdinov. 2008. Probabilistic matrix factorization. In Advances in neural information processing systems. 1257–1264. [20] Ankur P. Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. 2016. A Decomposable Attention Model for Natural Language Inference. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016. 2249–2255. [21] Steffen Rendle. 2010. Factorization Machines. In ICDM 2010, The 10th IEEE International Conference on Data Mining, Sydney, Australia, 14-17 December 2010. 995–1000. [22] Tim Rocktäschel, Edward Grefenstette, Karl Moritz Hermann, Tomáš Kočiskỳ, and Phil Blunsom. 2015. Reasoning about entailment with neural attention. arXiv preprint arXiv:1509.06664 (2015). [23] Suvash Sedhain, Aditya Krishna Menon, Scott Sanner, and Lexing Xie. 2015. Autorec: Autoencoders meet collaborative filtering. In Proceedings of the 24th International Conference on World Wide Web. ACM, 111–112. [24] Sungyong Seo, Jing Huang, Hao Yang, and Yan Liu. 2017. Interpretable Convolutional Neural Networks with Dual Local and Global Attention for Review Rating Prediction. In Proceedings of the Eleventh ACM Conference on Recommender Systems (RecSys ’17). [25] Yi Tay, Anh Tuan Luu, and Siu Cheung Hui. 2017. Translational recommender networks. arXiv preprint arXiv:1707.05176 (2017). [26] Yi Tay, Minh C. Phan, Anh Tuan Luu, and Siu Cheung Hui. [n. d.]. Learning to Rank Question Answer Pairs with Holographic Dual LSTM Architecture. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, Shinjuku, Tokyo, Japan, August 7-11, 2017. [27] Yi Tay, Luu Anh Tuan, and Siu Cheung Hui. 2017. A Compare-Propagate Architecture with Alignment Factorization for Natural Language Inference. (2017). arXiv:arXiv:1801.00102 [28] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention Is All You Need. arXiv preprint arXiv:1706.03762 (2017). [29] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. 2015. Pointer networks. In Advances in Neural Information Processing Systems. 2692–2700. [30] Chong Wang and David M Blei. 2011. Collaborative topic modeling for recommending scientific articles. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 448–456. [31] Hao Wang, Naiyan Wang, and Dit-Yan Yeung. 2015. Collaborative deep learning for recommender systems. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 1235–1244. [32] Shuohang Wang and Jing Jiang. 2016. Machine comprehension using match-lstm and answer pointer. arXiv preprint arXiv:1608.07905 (2016). [33] Ronald J Williams. 1992. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning 8, 3-4 (1992), 229–256. [34] Chao-Yuan Wu, Amr Ahmed, Alex Beutel, Alexander J. Smola, and How Jing. 2017. Recurrent Recommender Networks. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM 2017, Cambridge, United Kingdom, February 6-10, 2017. 495–503. [35] Caiming Xiong, Victor Zhong, and Richard Socher. 2016. Dynamic Coattention Networks For Question Answering. CoRR abs/1611.01604 (2016). [36] Xiaodong Zhang, Sujian Li, Lei Sha, and Houfeng Wang. 2017. Attentive Interactive Neural Networks for Answer Selection in Community Question Answering. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA. 3525–3531. [37] Lei Zheng, Vahid Noroozi, and Philip S. Yu. 2017. Joint Deep Modeling of Users and Items Using Reviews for Recommendation. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM 2017. 425–434.
2cs.AI
Visual7W: Grounded Question Answering in Images arXiv:1511.03416v4 [cs.CV] 9 Apr 2016 Yuke Zhu† Oliver Groth‡ Michael Bernstein† Li Fei-Fei† † Computer Science Department, Stanford University ‡ Computer Science Department, Dresden University of Technology Abstract Where does this scene take place? We have seen great progress in basic perceptual tasks such as object recognition and detection. However, AI models still fail to match humans in high-level vision tasks due to the lack of capacities for deeper reasoning. Recently the new task of visual question answering (QA) has been proposed to evaluate a model’s capacity for deep image understanding. Previous works have established a loose, global association between QA sentences and images. However, many questions and answers, in practice, relate to local regions in the images. We establish a semantic link between textual descriptions and image regions by object-level grounding. It enables a new type of QA with visual answers, in addition to textual answers used in previous work. We study the visual QA tasks in a grounded setting with a large collection of 7W multiple-choice QA pairs. Furthermore, we evaluate human performance and several baseline models on the QA tasks. Finally, we propose a novel LSTM model with spatial attention to tackle the 7W QA tasks. Why is there foam? A) Because of a wave. ✔ B) Because of a boat. C) Because of a fire. D) Because of a leak. A) In the sea. ✔ B) In the desert. C) In the forest. D) On a lawn. What is the dog doing? What is the dog standing on? A) Surfing. ✔ B) Sleeping. C) Running. D) Eating. A) On a surfboard. ✔ B) On a table. C) On a garage. D) On a ball. Which paw is lifted? Figure 1: Deep image understanding relies on detailed knowledge about different image parts. We employ diverse questions to acquire detailed information on images, ground objects mentioned in text with their visual appearances, and provide a multiple-choice setting for evaluating a visual question answering task with both textual and visual answers. suggest, a tighter semantic link between textual descriptions and corresponding visual regions is a key ingredient for better models. As Fig. 1 shows, the localization of objects can be a critical step to understand images better and solve image-related questions. Providing these image-text correspondences is called grounding. Inspired by Geman et al.’s prototype of a visual Turing test based on image regions [8] and the comprehensive data collection of QA pairs on COCO images [25] such as VQA [1] and Baidu [7], we fuse visual QA and grounding in order to create a new QA dataset with dense annotations and a more flexible evaluation environment. Object-level grounding provides a stronger link between QA pairs and images than global image-level associations. Furthermore, it allows us to resolve coreference ambiguity [19, 35] and to understand object distributions in QA, and enables visually grounded answers that consist of object bounding boxes. Motivated by the goal of developing a model for visual QA based on grounded regions, our paper introduces a dataset that extends previous approaches [1, 7, 36] and proposes an attention-based model to perform this task. We collected 327,939 QA pairs on 47,300 COCO images [25], together with 1,311,756 human-generated multiple-choices and 561,459 object groundings from 36,579 categories. Our data collection was inspired by the age-old idea of the W 1. Introduction The recent development of deep learning technologies has achieved successes in many perceptual visual tasks such as object recognition, image classification and pose estimation [15, 21, 25, 38, 39, 42, 43]. Yet the status quo of computer vision is still far from matching human capabilities, especially when it comes to understanding an image in all its details. Recently, visual question answering (QA) has been proposed as a proxy task for evaluating a vision system’s capacity for deeper image understanding. Several QA datasets [1, 7, 27, 36, 49] have been released since last year. They contributed valuable data for training visual QA systems and introduced various tasks, from picking correct multiple-choice answers [1] to filling in blanks [49]. Pioneer work in image captioning [4, 5, 13, 45, 47], sentence-based image retrieval [14, 40] and visual QA [1, 7, 36] shows promising results. These works aimed at establishing a global association between sentences and images. However, as Flickr30K [34, 48] and Visual Madlibs [49] 1 questions in journalism to describe a complete story [22]. The 7W questions roughly correspond to an array of standard vision tasks: what [9, 15, 39], where [24, 50], when [30, 32], who [35, 42], why [33], how [23, 31] and which [16, 17]. The Visual7W dataset features richer questions and longer answers than VQA [1]. In addition, we provide complete grounding annotations that link the object mentions in the QA sentences to their bounding boxes in the images and therefore introduce a new QA type with image regions as the visually grounded answers. We refer to questions with textual answers as telling questions (what, where, when, who, why and how) and to such with visual answers as pointing questions (which). We provide a detailed comparison and data analysis in Sec. 4. A salient property of our dataset is the notable gap between human performance (96.6%) and state-of-the-art LSTM models [28] (52.1%) on the visual QA tasks. We add a new spatial attention mechanism to an LSTM architecture for tackling the visually grounded QA tasks with both textual and visual answers (see Sec. 5). The model aims to capture the intuition that answers to image-related questions usually correspond with specific image regions. It learns to attend to the pertinent regions as it reads the question tokens in a sequence. We achieve state-of-the-art performance with 55.6%, and find correlations between the model’s attention heat maps and the object groundings (see Sec. 6). Due to the large performance gap between human and machine, we envision our dataset and visually grounded QA tasks to contribute to a long-term joint effort from several communities such as vision, natural language processing and knowledge to close the gap together. The Visual7W dataset constitutes a part of the Visual Genome project [20]. Visual Genome contains 1.7 million QA pairs of the 7W question types, which offers the largest visual QA collection to date for training models. The QA pairs in Visual7W are a subset of the 1.7 million QA pairs from Visual Genome. Moreover, Visual7W includes extra annotations such as object groundings, multiple choices and human experiments, making it a clean and complete benchmark for evaluation and analysis. 2. Related Work Vision + Language. There have been years of effort in connecting the visual and textual information for joint learning [2, 19, 33, 35, 40, 52]. Image and video captioning has become a popular task in the past year [4, 5, 13, 37, 45, 47]. The goal is to generate text snippets to describe the images and regions instead of just predicting a few labels. Visual question answering is a natural extension to the captioning tasks, but is more interactive and has a stronger connection to real-world applications [3]. Text-based question answering. Question answering in NLP has been a well-established problem. Successful applications can be seen in voice assistants in mobile devices, search engines and game shows (e.g., IBM Waston). Traditional question answering system relies on an elaborate pipeline of models involving natural language parsing, knowledge base querying, and answer generation [6]. Recent neural network models attempt to learn end-to-end directly from questions and answers [12, 46]. Visual question answering. Geman et al. [8] proposed a restricted visual Turing test to evaluate visual understanding. The DAQUAR dataset is the first toy-sized QA benchmark built upon indoor scene RGB-D images. Most of the other datasets [1, 7, 36, 49] collected QA pairs on Microsoft COCO images [25], either generated automatically by NLP tools [36] or written by human workers [1, 7, 49]. Following these datasets, an array of models has been proposed to tackle the visual QA tasks. The proposed models range from probabilistic inference [27, 44, 51] and recurrent neural networks [1, 7, 28, 36] to convolutional networks [26]. Previous visual QA datasets evaluate textual answers on images while omitting the links between the object mentions and their visual appearances. Inspired by Geman et al. [8], we establish the link by grounding objects in the images and perform experiments in the grounded QA setting. 3. Creating the Visual7W Dataset We elaborate on the details of the data collection we conducted upon 47,300 images from COCO [25] (a subset of images from Visual Genome [20]). We leverage the six W questions (what, where, when, who, why, and how) to systematically examine a model’s capability for visual understanding, and append a 7th which question category. This extends existing visual QA setups [1, 7, 36] to accommodate visual answers. We standardize the visual QA tasks with multi-modal answers in a multiple-choice format. Each question comes with four answer candidates, with one being the correct answer. In addition, we ground all the objects mentioned in the QA pairs to their corresponding bounding boxes in the images. The object-level groundings enable examining the object distributions and resolve the coreference ambiguity [19, 35]. 3.1. Collecting the 7W Questions The data collection tasks are conducted on Amazon Mechanical Turk (AMT), an online crowdsourcing platform. The online workers are asked to write pairs of question and answer based on image content. We instruct the workers to be concise and unambiguous to avoid wordy or speculative questions. To obtain a clean set of high-quality QA pairs, we ask three AMT workers to label each pair as good or bad independently. The workers judge each pair by whether an average person is able to tell the answer when seeing the Q: What endangered animal is featured on the truck? Q: Where will the driver go if turning right? Q: When was the picture taken? Q: Who is under the umbrella? A: A: A: A: A: A: A: A: A: A: A: A: A: A: A: A: A bald eagle. A sparrow. A humming bird. A raven. Q: Which pillow is farther from the window? Onto 24 ¾ Rd. Onto 25 ¾ Rd. Onto 23 ¾ Rd. Onto Main Street. Q: Which step leads to the tub? During a wedding. During a bar mitzvah. During a funeral. During a Sunday church service. Q: Which is the small computer in the corner? Two women. A child. An old man. A husband and a wife. Q: Which item is used to cut items? Q: Why was the hand of the woman over the left shoulder of the man? Q: How many magnets are on the bottom of the fridge? A: They were together and engaging in affection. A: The woman was trying to get the man’s attention. A: The woman was trying to scare the man. A: The woman was holding on to the man for balance. A: A: A: A: Q: Which doughnut has multicolored sprinkles? Q: Which man is wearing the red tie? 5. 2. 3. 4. Figure 2: Examples of multiple-choice QA from the 7W question categories. The first row shows telling questions where the green answer is the ground-truth, and the red ones are human-generated wrong answers. The what, who and how questions often pertain to recognition tasks with spatial reasoning. The where, when and why questions usually involve high-level common sense reasoning. The second row depicts pointing (which) questions where the yellow box is the correct answer and the red boxes are human-generated wrong answers. These four answers form a multiple-choice test for each question. image. We accept the QA pairs with at least two positive votes. We notice varying acceptance rates between categories, ranging from 92% for what to 63% for why. The overall acceptance rate is 85.8%. VQA [1] relied on both human workers and automatic methods to generate a pool of candidate answers. We find that human-generated answers produce the best quality; on the contrary, automatic methods are prone to introducing candidate answers paraphrasing the ground-truth answers. For the telling questions, the human workers write three plausible answers to each question without seeing the image. To ensure the uniqueness of correct answers, we provide the ground-truth answers to the workers, and instruct them to write answers of different meanings. For the pointing questions, the workers draw three bounding boxes of other objects in the image, ensuring that these boxes cannot be taken as the correct answer. We provide examples from the 7W categories in Fig. 2. 3.2. Collecting Object-level Groundings We collect object-level groundings by linking the object mentions in the QA pairs to their bounding boxes in the images. We ask the AMT workers to extract the object mentions from the QA pairs and draw boxes on the images. We collect additional groundings for the multiple choices of the pointing questions. Duplicate boxes are removed based on the object names with an Intersection-over-Union threshold question ambiguity What is the man wearing? A black shirt. answer ambiguity What is the vehicle with ads on it? A red bus. Figure 3: Coreference ambiguity arises when an object mention has multiple correspondences in an image, and the textual context is insufficient to tell it apart. The answer to the left question can be either gray, yellow or black, depending on which man is meant. In the right example, the generic phrase red bus can refer to both buses in the image. Thus an algorithm might answer correctly even if referring to the wrong bus. of 0.5. In total, we have collected 561,459 object bounding boxes, on average 12 boxes per image. The benefits of object-level groundings are three-fold: 1) it resolves the coreference ambiguity problem between QA sentences and images; 2) it extends the existing visual QA setups to accommodate visual answers; and 3) it offers a means to understand the distribution of objects, shedding light on the essential knowledge to be acquired for tackling the QA tasks (see Sec. 4). We illustrate examples of coreference ambiguity in Fig. 3. Ambiguity might cause a question to have more than Table 1: Comparisons on Existing Visual Question Answering Datasets DAQUAR [27] Visual Madlibs [49] COCO-QA [36] Baidu [7] VQA [1] Visual7W (Ours) # QA 12,468 56,468 117,684 316,193 614,163 327,939 # Images 1,447 9,688 69,172 316,193 204,721 47,300 AvgQLen 11.5 ± 2.4 4.9 ± 2.4 8.7 ± 2.7 6.2 ± 2.0 6.9 ± 2.4 AvgALen 1.2 ± 0.5 2.8 ± 2.0 1.0 ± 0 1.1 ± 0.4 2.0 ± 1.4 LongAns 3.4% 47.4% 0.0% 3.8% 27.6% TopAns 96.4% 57.9% 100% 82.7% 63.5% HumanPerf COCO X X X X X X MC X X Human-Machine Performance Gap We expect that a good QA benchmark should exhibit a sufficient performance gap between humans and state-of-the-art models, leaving room for future research to explore. Additionally a nearly perfect human performance is desired to certify the quality of its questions. On Visual7W, we conducted two experiments to measure human performance (cf. Table 1, HumanPerf ), as well as examining the percentage of questions that can be answered without images. Our results show both strong human performance and a strong interdependency between images and QA pairs. We provide the 1 We report the statistics of VQA dataset [1] with its real images and Visual Madlibs [49] with its filtered hard tasks. The fill-in-the-blank tasks in Visual Madlibs [49], where the answers are sentence fragments, differ from other QA tasks, resulting in distinct statistics. We omit some statistics for Baidu [7] due to its partial release. X X Top 20 objects man trees shirt wall grass tree woman people sky building 4. Comparison and Analysis Advantages of Grounding The unique feature of our Visual7W dataset is the grounding annotations of all textually mentioned objects (cf. Table 1, Grounding). In total we have collected 561,459 object groundings, which enables the new type of visual answers in the form of bounding boxes (cf. Table 1, VisualAns). Examining the object distribution in the QA pairs sheds light on the focus of the questions and the essential knowledge to be acquired for answering them. Our object groundings spread across 36,579 categories (distinct object names), thereby exhibiting a long tail pattern where 85% of the categories have fewer than 5 instances (see Fig. 4). The open-vocabulary annotations of objects, in contrast with traditional image datasets focusing on predefined categories and salient objects [25, 38], provide a broad coverage of objects in the images. VisualAns X one plausible answers at test time, thus complicating evaluation. Our online study shows that, such ambiguity occurs in 1% of the accepted questions and 7% of the accepted answers. This illustrates a drawback of existing visual QA setups [1, 7, 27, 36, 49], where in the absence of objectlevel groundings the textual questions and answers are only loosely coupled to the images. In this section, we analyze our Visual7W dataset collected on COCO images (cf. Table 1, COCO), present its key features, and provide comparisons of our dataset with previous work. We summarize important metrics of existing visual QA datasets in Table 1.1 Grounding person window table head water snow hair sign ground wood Figure 4: Object distribution in telling and pointing QA. The rank of an object category is based on its frequency with rank #1 referring to the most frequent one. The pointing QA pairs cover an order of magnitude more objects than the telling QA pairs. The top 20 object categories indicate that the object distribution’s bias towards persons, daily-life objects and natural entities. detailed analysis and comparisons with the state-of-the-art automatic models in Sec. 6. Table 2: Model and Human Performances on QA Datasets VQA (open-ended) [1] VQA (multiple-choice) [1] Facebook bAbI [46] Ours (telling QA) Ours (pointing QA) Model 0.54 0.57 0.92 0.54 0.56 Human 0.83 0.92 ∼1.0 0.96 0.97 ∆ 0.29 0.35 0.08 0.42 0.41 Table 2 compares Visual7W with VQA [1] and Facebook bAbI [46], which have reported model and human performances. Facebook bAbI [46] is a textual QA dataset claiming that humans can potentially achieve 100% accuracy yet without explicit experimental proof. For VQA [1], numbers are reported for both multiple-choice and open-ended evaluation setups. Visual7W features the largest performance gap (∆), a desirable property for a challenging and long-lasting evaluation task. At the same time, the nearly perfect human performance proves high quality of the 7W questions. QA Diversity The diversity of QA pairs is an important feature of a good QA dataset as it reflects a broad coverage of image details, introduces complexity and potentially requires a broad range of skills for solving the questions. To obtain diverse QA pairs, we decided to rule out binary questions, contrasting Geman et al.’s proposal [8] and VQA’s approach [1]. We hypothesize that this encourages workers to write more complex questions and also prevents inflating answer baselines with simple yes/no answers. softmax 5.1. Recurrent QA Models with Spatial Attention LSTM CNN CNN which is the brown bread ? ht-1 convolutional feature maps C(I) attention terms at Q: Which is the brown bread? A1: A2: A3: A4: Figure 5: Diagram of the recurrent neural network model for pointing QA. At the encoding stage, the model reads the image and the question tokens word by word. At each word, it computes attention terms based on the previous hidden state and the convolutional feature map, deciding which regions to focus on. At the decoding stage, it computes the log-likelihood of an answer by a dot product between its transformed visual feature (fc7) and the last LSTM hidden state. When examining the richness of QA pairs, the length of questions and answers (cf. Table 1, AvgQLen, AvgALen) is a rough indicator for the amount of information and complexity they contain. The overall average question and answer lengths are 6.9 and 2.0 words respectively. The pointing questions have the longest average question length. The telling questions exhibit a long-tail distribution where 51.2%, 21.2%, and 16.6% of their answers have one, two or three words respectively. Many answers to where and why questions are phrases and sentences, with an average of 3 words. In general, our dataset features long answers where 27.6% of the questions have answers of more than two words (cf. Table 1, LongAns). In contrast, 89% of answers in VQA [1], 90% of answers in DAQUAR [27] and all answers in COCO-QA [36] are a single word. We also capture more long-tail answers as our 1,000 most frequent answers only account for 63.5% of all our answers (cf. Table 1, TopAns). Finally we provide human created multiplechoices for evaluation (cf. Table 1, MC). 5. Attention-based Model for Grounded QA The visual QA tasks are visually grounded, as local image regions are pertinent to answering questions in many cases. For instance, in the first pointing QA example of Fig. 2 the regions of the window and the pillows reveal the answer, while other regions are irrelevant to the question. We capture this intuition by introducing a spatial attention mechanism similar to the model for image captioning [47]. LSTM models [11] have achieved state-of-the-art results in several sequence processing tasks [5, 13, 41]. They have also been used to tackle visual QA tasks [1, 7, 28]. These models represent images by their global features, lacking a mechanism to understand local image regions. We add spatial attention [10, 47] to the standard LSTM model for visual QA, illustrated in Fig. 5. We consider QA as a two-stage process [7, 28]. At the encoding stage, the model memorizes the image and the question into a hidden state vector (the gray box in Fig. 5). At the decoding stage, the model selects an answer from the multiple choices based on its memory (the softmax layer in Fig. 5). We use the same encoder structure for all visual QA tasks but different decoders for the telling and pointing QA tasks. Given an image I and a question Q = (q1 , q2 , . . . , qm ), we learn the embeddings of the image and the word tokens as follow: v0 = Wi [F (I)] + bi (1) vi = Ww [OH(ti )], i = 1, . . . , m (2) where F (·) transforms an image I from pixel space to a 4096-dimensional feature representation. We extract the activations from the last fully connected layer (fc7) of a pre-trained CNN model VGG-16 [39]. OH(·) transforms a word token to its one-hot representation, an indicator column vector where there is a single one at the index of the token in the word vocabulary. The Wi matrix transforms the 4096-dimensional image features into the di -dimensional embedding space v0 , and the Ww transforms the one-hot vectors into the dw -dimensional embedding space vi . We set di and dw to the same value of 512. Thus, we take the image as the first input token. These embedding vectors v0,1,...,m are fed into the LSTM model one by one. The update rules of our LSTM model can be defined as follow: it = σ(Wvi vt + Whi ht−1 + Wri rt + bi ) (3) ft = σ(Wvf vt + Whf ht−1 + Wrf rt + bf ) (4) ot = σ(Wvo vt + Who ht−1 + Wro rt + bo ) (5) gt = φ(Wvg vt + Whg ht−1 + Wrg rt + bg ) (6) ct = ft ct−1 + it (7) ht = ot φ(ct ) gt (8) where σ(·) is the sigmoid function, φ(·) is the tanh function, and is the element-wise multiplication operator. The attention mechanism is introduced by the term rt , which is a weighted average of convolutional features that depends upon the previous hidden state and the convolutional features. The exact formulation is as follows: et = waT tanh(Whe ht−1 + Wce C(I)) + ba (9) at = softmax(et ) (10) rt = aTt C(I) (11) Figure 6: Response time of human subjects on the telling QA tasks. The boxes go from the first quartile to the third quartile of the response time values. The bars in the centers of the boxes indicate the median response time of each category. where C(I) returns the 14 × 14 512-dimensional convolutional feature maps of image I from the fourth convolutional layer from the same VGG-16 model [39]. The attention term at is a 196-dimensional unit vector, deciding the contribution of each convolutional feature at the t-th step. The standard LSTM model can be considered as a special case with each element in at set uniformly. Wi , bi , Ww and all the W s and bs in the LSTM model and attention terms are learnable parameters. 5.2. Learning and Inference The model first reads the image v0 and all the question tokens vq1 , vq2 , . . . , vqm until reaching the question mark (i.e., end token of the question sequence). When training for telling QA, we continue to feed the ground-truth answer tokens va1 , va2 , . . . , van into the model. For pointing QA, we compute the log-likelihood of an candidate region by a dot product between its transformed visual feature (fc7) and the last LSTM hidden state (see Fig. 5). We use crossentropy loss to train the model parameters with backpropagation. During testing, we select the candidate answer with the largest log-likelihood. We set the hyperparameters using the validation set. The dimensions of the LSTM gates and memory cells are 512 in all the experiments. The model is trained with Adam update rule [18], mini-batch size 128, and a global learning rate of 10−4 . 6. Experiments We evaluate the human and model performances on the QA tasks. We report a reasonably challenging performance delta leaving sufficient room for future research to explore. 6.1. Experiment Setups As the 7W QA tasks have been formulated in a multiplechoice format, we use the same procedure to evaluate hu- man and model performances. At test time, the input is an image and a natural language question, followed by four multiple choices. In telling QA, the multiple choices are written in natural language; whereas, in pointing QA, each multiple choice corresponds to an image region. We say the model is correct on a question if it picks the correct answer among the candidates. Accuracy is used to measure the performance. An alternative method to evaluate telling QA is to let the model predict open-ended text outputs [1]. This approach works well on short answers; however, it performs poorly on long answers, where there are many ways of paraphrasing the same meaning. We make the training, validation and test splits, each with 50%, 20%, 30% of the pairs respectively. The numbers are reported on the test set. 6.2. 7W QA Experiments 6.2.1 Human Experiments on 7W QA We evaluate human performances on the multiple-choice 7W QA. We want to measure in these experiments 1) how well humans can perform in the visual QA task and 2) whether humans can use common sense to answer questions without seeing the images. We conduct two sets of human experiments. In the first experiment (Question), a group of five AMT workers are asked to guess the best possible answers from the multiple choices without seeing the images. In the second experiment (Question + Image), we have a different group of five workers to answer the same questions given the images. The first block in Table 3 reports the human performances on these experiments. We measure the mean accuracy over the QA pairs where we take the majority votes among the five human responses. Even without the images, humans manage to guess the most plausible answers in some cases. Human subjects achieve 35.3% accuracy, 10% higher than chance. The human performance without images is remarkably high (43.9%) for the why questions, indicating that many why questions encode a fair amount of common sense that humans are able to infer without visual cue. However, images are important in the majority of the questions. Human performance is significantly improved when the images are provided. Overall, humans achieve a high accuracy of 96.6% on the 7W QA tasks. Fig. 6 shows the box plots of response time of the human subjects for telling QA. Human subjects spend double the time to respond when the images are displayed. In addition, why questions take a longer average response time compared to the other five question types. Human subjects spend an average of 9.3 seconds on pointing questions. However, that experiment was conducted in a different user interface, where workers click on the answer boxes in the image. Thus, the response time is not comparable with the telling QA tasks. Interestingly, longer response time does not imply higher performance. Human subjects spend more Overall 0.353 0.966 0.383 0.305 0.352 0.462 0.359 0.521 0.556 w/ Image w/o Image Multiple Choices Image Table 3: Human and model performances in the multiple-choice 7W QA tasks (in accuracy) Telling Pointing Method What Where When Who Why How Which Human (Question) 0.356 0.322 0.393 0.342 0.439 0.337 Human (Question + Image) 0.965 0.957 0.944 0.965 0.927 0.942 0.973 Logistic Regression (Question) 0.420 0.375 0.666 0.510 0.354 0.458 0.354 Logistic Regression (Image) 0.408 0.426 0.438 0.415 0.337 0.303 0.256 Logistic Regression (Question + Image) 0.429 0.454 0.621 0.501 0.343 0.356 0.307 LSTM (Question) 0.430 0.414 0.693 0.538 0.491 0.484 LSTM (Image) 0.422 0.497 0.660 0.523 0.475 0.468 0.299 LSTM (Question + Image) [28] 0.489 0.544 0.713 0.581 0.513 0.503 0.521 Ours, LSTM-Att (Question + Image) 0.515 0.570 0.750 0.595 0.555 0.498 0.561 Q: Who is behind the batter? Q: What adorns the tops of the post? Q: How many cameras are in the photo? Q: Why is there rope? Q: What kind of stuffed Q: What animal is being animal is shown? petted? A: Catcher. A: Umpire. A: Fans. A: Ball girl. A: Gulls. A: An eagle. A: A crown. A: A pretty sign. A: One. A: Two. A: Three. A: Four. A: To tie up the boats. A: To tie up horses. A: To hang people. A: To hit tether balls. A: Teddy Bear. A: Monkey. A: Tiger. A: Bunny rabbit. A: A sheep. A: Goat. A: Alpaca. A: Pig. H: Catcher. ✓ H: Gulls. H: To hit tether balls. ✗ H: Monkey. ✗ M: Gulls. ✓ ✓ H: Three. ✗ ✗ M: One. ✓ M: To hang people. ✗ M: Teddy Bear. ✓ M: A sheep. ✓ H: Catcher. ✓ H: Gulls. ✓ H: One. ✓ H: To tie up the boats. ✓ H: Teddy Bear. M: A crown. ✗ M: One. ✓ M: To hang people. ✗ M: Teddy Bear. ✓ ✓ H: Goat. ✗ M: Catcher. ✓ M: Umpire. H: A sheep. ✓ M: A sheep. ✓ Figure 7: Qualitative results of human subjects and the state-of-the-art model (LSTM-Att) on multiple-choice QAs. We illustrate the prediction results of six multiple-choice QAs, with and without images. The green answer corresponds to the correct answer to each question, and the rest three are wrong answer candidates. We take the majority votes of five human subjects as the human predictions (H) and the top predictions from the model (M). The correct predictions are indicated by check marks. time on questions with lower accuracy. The Pearson correlation coefficient between the average response time and the average accuracy is −0.135, indicating a weak negative correlation between the response time and human accuracy. class labels. At test time, we select the top-scoring answer candidate. For pointing QA, we perform k-means to cluster training set regions by fc7 features into 5000 clusters, used as class labels. At test time, we select the answer candidate closest to the centroid of the predicted cluster. 6.2.2 LSTM The LSTM model in Malinowski and Fritz [28] for visual QA with no attention modeling, which can be considered as a simplified version of our full model with the attention terms set to be uniform. Model Experiments on 7W QA Having examined human performance, our next question is how well the state-of-the-art models can perform in the 7W QA task. We evaluate automatic models on the 7W QA tasks in three sets of experiments: without images (Question), without questions (Image) and with images (Question + Image). In the experiments without images (questions), we zero out the image (questions) features. We briefly describe the three models we used in the experiments: Logistic Regression A logistic regression model that predicts the answer from a concatenation of image fc7 feature and question feature. The questions are represented by 200dimensional averaged word embeddings from a pre-trained model [29]. For telling QA, we take the top-5000 most frequent answers (79.2% of the training set answers) as the LSTM-Att Our LSTM model with spatial attention introduced in Sec. 5, where the attention terms in Eq. (10) determines which region to focus on at each step. We report the results in Table 3. All the baseline models surpass the chance performance (25%). The logistic regression baseline yields the best performance when only the question features are provided. Having the global image features hurts its performance, indicating the importance of understanding local image regions rather than a holistic representation. Interestingly, the LSTM performance (46.2%) significantly outperforms human perfor- A B cat cake What kind of animal is in the photo? A cat. C Where are the carrots? At the top. Why is the person holding a knife? To cut the cake with. D How many people are there? Three. Figure 8: Object groundings and attention heat maps. We visualize the attention heat maps (with Gaussian blur) on the images. The brighter regions indicate larger attention terms, i.e., where the model focuses. The bounding boxes show the object-level groundings of the objects mentioned in the answers. mance (35.3%) when the images are not present. Human subjects are not trained before answering the questions; however, the LSTM model manages to learn the priors of answers from the training set. In addition, both the questions and image content contribute to better results. The Question + Image baseline shows large improvement on overall accuracy (52.1%) than the ones when either the question or the image is absent. Finally, our attention-based LSTM model (LSTM-Att) outperforms other baselines on all question types, except the how category, achieving the best model performance of 55.6%. We show qualitative results of human experiments and the LSTM models on the telling QA task in Fig. 7. Human subjects fail to tell a sheep apart from a goat in the last example, whereas the LSTM model gives the correct answer. Yet humans successfully answer the fourth why question when seeing the image, where the LSTM model fails in both cases. The object groundings help us analyzing the behavior of the attention-based model. First, we examine where the model focuses by visualizing the attention terms of Eq. (10). The attention terms vary as the model reads the QA words one by one. We perform max pooling along time to find the maximum attention weight on each of the 14×14 image grid, producing an attention heat map. We see if the model attends to the mentioned objects. The answer object boxes occupy an average of 12% of image area; while the peak of the attention heat map resides in answer object boxes 24% of the time. That indicates a tendency for the model to attend to the answer-related regions. We visualize the atten- Figure 9: Impact of object category frequency on the model accuracy in the pointing QA task. The x-axis shows the upper bound object category frequency of each bin. The y-axis shows the mean accuracy within each bin. The accuracy increases gradually as the model sees more instances from the same category. Meanwhile, the model manages to handle infrequent categories by transferring knowledge from larger categories. tion heat maps on some example QA pairs in Fig. 8. The top two examples show QA pairs with answers containing an object. The peaks of the attention heat maps reside in the bounding boxes of the target objects. The bottom two examples show QA pairs with answers containing no object. The attention heat maps are scattered around the image grid. For instance, the model attends to the four corners and the borders of the image to look for the carrots in Fig. 8(c). Furthermore, we use object groundings to examine the model’s behavior on the pointing QA. Fig. 9 shows the impact of object category frequency on the QA accuracy. We divide the object categories into different bins based on their frequencies (by power of 2) in the training set. We compute the mean accuracy over the test set QA pairs within each bin. We observe increased accuracy for categories with more object instances. However, the model is able to transfer knowledge from common categories to rare ones, generating an adequate performance (over 50%) on object categories with only a few instances. 7. Conclusions In this paper, we propose to leverage the visually grounded 7W questions to facilitate a deeper understanding of images beyond recognizing objects. Previous visual QA works lack a tight semantic link between textual descriptions and image regions. We link the object mentions to their bounding boxes in the images. Object grounding allows us to resolve coreference ambiguity, understand object distributions, and evaluate on a new type of visually grounded QA. We propose an attention-based LSTM model to achieve the state-of-the-art performance on the QA tasks. Future research directions include exploring ways of utilizing common sense knowledge to improve the model’s performance on QA tasks that require complex reasoning. Acknowledgements We would like to thank Carsten Rother from Dresden University of Technology for establishing the collaboration between the Computer Vision Lab Dresden and the Stanford Vision Lab which enabled Oliver Groth to visit Stanford to contribute to this work. We would also like to thank Olga Russakovsky, Lamberto Ballan, Justin Johnson and anonymous reviewers for useful comments. This research is partially supported by a Yahoo Labs Macro award, and an ONR MURI award. References [1] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. L. Zitnick, and D. Parikh. VQA: Visual question answering. ICCV, 2015. 1, 2, 3, 4, 5, 6 [2] K. Barnard, P. Duygulu, D. Forsyth, N. De Freitas, D. M. Blei, and M. I. Jordan. Matching words and pictures. The Journal of Machine Learning Research, 3:1107–1135, 2003. 2 [3] J. P. Bigham, C. Jayant, H. Ji, G. Little, A. Miller, R. C. Miller, R. Miller, A. Tatarowicz, B. White, S. White, et al. Vizwiz: nearly real-time answers to visual questions. In Proceedings of the 23nd annual ACM symposium on User Interface Software and Technology, 2010. 2 [4] X. Chen and C. L. Zitnick. Mind’s eye: A recurrent visual representation for image caption generation. In CVPR, 2015. 1, 2 [5] J. Donahue, L. Anne Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell. Long-term recurrent convolutional networks for visual recognition and description. In CVPR, 2015. 1, 2, 5 [6] D. Ferrucci et al. Building Watson: An overview of the DeepQA project. AI Magazine, 2010. 2 [7] H. Gao, J. Mao, J. Zhou, Z. Huang, L. Wang, and W. Xu. Are you talking to a machine? dataset and methods for multilingual image question answering. NIPS, 2015. 1, 2, 4, 5 [8] D. Geman, S. Geman, N. Hallonquist, and L. Younes. Visual turing test for computer vision systems. Proceedings of the National Academy of Sciences, 112(12):3618–3623, 2015. 1, 2, 4 [9] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. 2 [10] K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015. 5 [11] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. 5 [12] M. Iyyer, J. Boyd-Graber, L. Claudino, R. Socher, and H. Daumé III. A neural network for factoid question answering over paragraphs. In Empirical Methods in Natural Language Processing, 2014. 2 [13] A. Karpathy and L. Fei-Fei. Deep visual-semantic alignments for generating image descriptions. CVPR, 2015. 1, 2, 5 [14] A. Karpathy, A. Joulin, and L. Fei-Fei. Deep fragment embeddings for bidirectional image sentence mapping. In NIPS, pages 1889–1897, 2014. 1 [15] A. Karpathy, G. Toderici, S. Shetty, T. Leung, R. Sukthankar, and L. Fei-Fei. Large-scale video classification with convolutional neural networks. In CVPR, 2014. 1, 2 [16] S. Kazemzadeh, V. Ordonez, M. Matten, and T. L. Berg. Referit game: Referring to objects in photographs of natural scenes. In EMNLP, 2014. 2 [17] M. H. Kiapour, X. Han, S. Lazebnik, A. C. Berg, and T. L. Berg. Where to buy it: Matching street clothing photos in online shops. ICCV, 2015. 2 [18] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 [19] C. Kong, D. Lin, M. Bansal, R. Urtasun, and S. Fidler. What are you talking about? text-to-image coreference. In CVPR, 2014. 1, 2 [20] R. Krishna, Y. Zhu, O. Groth, J. Johnson, K. Hata, J. Kravitz, S. Chen, Y. Kalantidis, L.-J. Li, D. A. Shamma, M. Bernstein, and L. Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. In arXiv preprint arxiv:1602.07332, 2016. 2 [21] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1097–1105, 2012. 1 [22] R. Kuhn and E. Neveu. Political journalism: New challenges, new practices. Routledge, 2013. 2 [23] C. H. Lampert, H. Nickisch, and S. Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In CVPR, 2009. 2 [24] T.-Y. Lin, Y. Cui, S. Belongie, and J. Hays. Learning deep representations for ground-to-aerial geolocalization. In CVPR, 2015. 2 [25] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Common objects in context. In ECCV. 2014. 1, 2, 4 [26] L. Ma, Z. Lu, and H. Li. Learning to answer questions from image using convolutional neural network. arXiv preprint arXiv:1506.00333, 2015. 2 [27] M. Malinowski and M. Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In NIPS, pages 1682–1690, 2014. 1, 2, 4, 5 [28] M. Malinowski, M. Rohrbach, and M. Fritz. Ask your neurons: A neural-based approach to answering questions about images. ICCV, 2015. 2, 5, 7 [29] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013. 7 [30] F. Palermo, J. Hays, and A. A. Efros. Dating historical color images. In ECCV. 2012. 2 [31] G. Patterson and J. Hays. Sun attribute database: Discovering, annotating, and recognizing scene attributes. In CVPR, 2012. 2 [32] L. C. Pickup, Z. Pan, D. Wei, Y. Shih, C. Zhang, A. Zisserman, B. Scholkopf, and W. T. Freeman. Seeing the arrow of time. In CVPR, 2014. 2 [33] H. Pirsiavash, C. Vondrick, and A. Torralba. Inferring the why in images. arXiv preprint arXiv:1406.5472, 2014. 2 [34] B. Plummer, L. Wang, C. Cervantes, J. Caicedo, J. Hockenmaier, and S. Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-tosentence models. ICCV, 2015. 1 [35] V. Ramanathan, A. Joulin, P. Liang, and L. Fei-Fei. Linking people with ”their” names using coreference resolution. In ECCV, 2014. 1, 2 [36] M. Ren, R. Kiros, and R. Zemel. Exploring models and data for image question answering. NIPS, 2015. 1, 2, 4, 5 [37] M. Rohrbach, W. Qiu, I. Titov, S. Thater, M. Pinkal, and B. Schiele. Translating video content to natural language descriptions. In ICCV, 2013. 2 [38] 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, pages 1–42, April 2015. 1, 4 [39] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. ICLR, 2014. 1, 2, 5, 6 [40] R. Socher, A. Karpathy, Q. V. Le, C. D. Manning, and A. Y. Ng. Grounded compositional semantics for finding and describing images with sentences. Transactions of the Association for Computational Linguistics, 2:207–218, 2014. 1, 2 [41] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In NIPS, pages 3104–3112, 2014. 5 [42] Y. Taigman, M. Yang, M. Ranzato, and L. Wolf. Deepface: Closing the gap to human-level performance in face verification. In CVPR, 2014. 1, 2 [43] A. Toshev and C. Szegedy. Deeppose: Human pose estimation via deep neural networks. In CVPR, 2014. 1 [44] K. Tu, M. Meng, M. W. Lee, T. E. Choe, and S.-C. Zhu. Joint video and text parsing for understanding events and answering queries. In IEEE MultiMedia, 2014. 2 [45] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, 2015. 1, 2 [46] J. Weston, A. Bordes, S. Chopra, and T. Mikolov. Towards ai-complete question answering: a set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015. 2, 4 [47] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhutdinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. 1, 2, 5 [48] P. Young, A. Lai, M. Hodosh, and J. Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67– 78, 2014. 1 [49] L. Yu, E. Park, A. C. Berg, and T. L. Berg. Visual Madlibs: Fill in the blank Image Generation and Question Answering. ICCV, 2015. 1, 2, 4 [50] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning deep features for scene recognition using places database. In NIPS, 2014. 2 [51] Y. Zhu, A. Fathi, and L. Fei-Fei. Reasoning about object affordances in a knowledge base representation. ECCV, 2014. 2 [52] C. L. Zitnick, D. Parikh, and L. Vanderwende. Learning the visual interpretation of sentences. In ICCV, 2013. 2
9cs.NE
Autonomous Take-Off and Flight of a Tethered Aircraft for Airborne Wind Energy Lorenzo Fagiano, Eric Nguyen-Van, Felix Rager, Stephan Schnez, and Christian Ohler∗† arXiv:1608.01889v2 [cs.SY] 16 Feb 2017 Abstract A control design approach to achieve fully autonomous take-off and flight maneuvers with a tethered aircraft is presented and demonstrated in real-world flight tests with a small-scale prototype. A ground station equipped with a controlled winch and a linear motion system accelerates the aircraft to take-off speed and controls the tether reeling in order to limit the pulling force. This setup corresponds to airborne wind energy systems with ground-based energy generation and rigid aircrafts. A simple model of the aircraft’s dynamics is introduced and its parameters are identified from experimental data. A model-based, hierarchical feedback controller is then designed, whose aim is to manipulate the elevator, aileron and propeller inputs in order to stabilize the aircraft during the take-off and to achieve figure-of-eight flight patterns parallel to the ground. The controller operates in a fully decoupled mode with respect to the ground station. Parameter tuning and stability/robustness aspect are discussed, too. The experimental results indicate that the controller is able to achieve satisfactory performance and robustness, notwithstanding its simplicity, and confirm that the considered take-off approach is technically viable and solves the issue of launching this kind of airborne wind energy systems in a compact space and at low additional cost. 1 Introduction Airborne Wind Energy (AWE) systems aim at extracting energy from the wind by using autonomous tethered aircrafts, kept aloft by either aerodynamic or aerostatic lift [1, 2]. By using light and flexible tethers instead of a massive structure, like the tower of wind turbines, AWE technologies feature relatively low capital costs and can operate above 200 m from the ground, where the wind is generally faster and more consistent. The price paid for these advantages is a higher system complexity, which makes the development of AWE difficult. At the current stage, power production has been studied theoretically and assessed experimentally by several companies and academic research groups worldwide, for different AWE concepts [3, 4, 5, 6, 7, 8, 9, 10, 11]. However, system reliability and robustness during power generation has not been demonstrated yet, not even on a small scale, at least judging from the publicly available literature. Due to the complex dynamics of AWE systems, involving the interaction of ground-based equipments with long, flexible tether(s) and with the aircraft immersed in an uncertain and variable wind field, successful simulations and small experiments do not represent a significant proof of long-term reliability and performance: only an experimental validation carried over several months can provide enough confidence in any AWE system to really foster its industrial development, and these long-term tests have not been carried out or documented yet. In turn, a prerequisite for such a long-term experimental validation is the development of a viable (technically and economically) approach for autonomous take-off and landing in compact space. For AWE systems that employ the so-called “pumping” or “yoyo” operation, i.e. where the tether is repeatedly reeled-out under high load from a winch installed on the ground and reeled-in under low load, this important feature appears to be still missing, again judging from the scientific literature. In fact, while for the power production phase there is a consensus on how the system shall operate, the related modeling and control aspects are relatively well-understood and experimental results have been reported [12, 13, 10, 14, 11], for take-off and landing it is not even clear what approach to pursue. Consequently, there appears to be a lack of understanding of what are the most relevant problems involved, and there are no documented experimental results in the literature. There is therefore a need for research and development efforts targeted at studying and demonstrating take-off and landing strategies for pumping AWE systems, from first-principle, conceptual analyses down to the specific engineering problems that need to be solved during implementation. In this paper, we present a contribution in this direction, focusing our attention on the take-off phase of systems that employ rigid aircrafts. In this context, outside the scientific literature there is evidence of autonomous take-off ∗ This is the pre-print of a paper accepted for publication on the IEEE Transactions on Control systems Technology and is subject to IEEE Copyright. doi: 10.1109/TCST.2017.2661825. L. Fagiano is with Politecnico di Milano, Dip. di Elettronica, Informazione e Bioingegneria, 20133 Milano, Italy. E. Nguyen-Van, F. Rager, S. Schnez and C. Ohler are with ABB Switzerland Ltd., Corporate Research, 5405 Baden-Dättwil - Switzerland. E-mail addresses: [email protected], {eric-nguyen-van | felix.rager | stephan.schnez | christian.ohler}@ch.abb.com. † Corresponding author: Lorenzo Fagiano. 1 operation via a winch launch [15], which however requires a significant space in all directions in order to adapt to the wind conditions. Another take-off approach that has been practically demonstrated employs vertical-axis propellers to slowly lift the aircraft to a safe altitude before shifting to the power production phase [16]. In this case, the required land occupation is rather small, however the additional onboard mass might compromise the system’s performance during power generation. Within the scientific literature, the take-off of pumping AWE generators has been addressed only to a limited extent, mainly considering a rotational take-off approach [17, 18]. In recent contributions [19, 20] we compared different take-off approaches on the basis of qualitative and quantitative criteria, and concluded that a linear approach is among the most promising solutions, with a good tradeoff between ground-based equipments, land occupation and additional onboard mass. In such an approach, the aircraft is accelerated to take-off speed over a short distance by a motor installed on the ground and then it climbs to a safe altitude using relatively small onboard propellers. At a recent AWE conference, the company Ampyx Power also announced the development of a similar approach for their system [21]. The main contribution of this paper is to prove experimentally such a linear take-off concept on a small scale, with fully autonomous operation. Additional contributions are represented by the modeling and control design steps that we carried out in order to achieve this result. The coordination between the ground station and the aircraft is essential to achieve a successful take-off. Here, we adopt a completely decoupled strategy, where the controller of the ground station and the one on the glider do not exchange any information. Rather, the ground station controller exploits a local, indirect measurement of the tether force to adjust the reeling speed. For the sake of brevity, this control algorithm is only briefly described here; the full details are presented in [22]. Instead, the focus of the present paper is on the design of the onboard control system and on the results of the autonomous take-off tests. We first introduce a simple model of the aircraft and identify its parameters using experimental data. Then, we use the model to design a hierarchical controller able to achieve autonomous take-off, transition to figure-of-eight patterns and flight along such patterns at roughly constant elevation. We finally present and discuss experimental results. Albeit the tests have been performed on a small-scale prototype, the control approach and most of the findings can be easily carried over to larger system sizes. We conclude with some final remarks and indicate the potential improvements that can be subject of future research. It is important to point out that our whole research activity towards autonomous take-off and flight has been conceived as a proof-of-concept study rather than a final, optimized solution. To the best of our knowledge, this is nevertheless the first contribution in the scientific literature that provides the full details and the experimental validation of a control approach for the take-off of a tethered aircraft in compact space, to be used for AWE systems. The paper is organized as follows. Section 2 presents the system layout, the features of the employed experimental setup and the considered control objectives. Section 3 describes the modeling, identification and control design aspects. The experimental results are presented in section 4, and conclusions are drawn in section 5. 2 System description and control objectives The considered system is composed of a ground station connected to a rigid aircraft by a single tether, see Fig. 1 for a sketch and Fig. 2 for a picture of the employed small-scale prototype. We first describe the two main subsystems, i.e. the ground station and the aircraft, followed by a brief overview of the ground station control strategy. We finally present the desired system operation and the consequent control objectives for the aircraft’s controller. 2.1 Ground station Referring to Figs. 1-2, the ground station is equipped with a first motor/generator (“winch motor”) connected to a winch that stores the tether attached to the aircraft. In a power-generating system, the winch motor also acts as generator during the power production phase. Before leaving the ground station, the tether passes through a series of pulleys, one of which is attached to a mass-spring mechanism used to reduce the stiffness of the link between the aircraft and the ground station. The last pulley is installed on a slide able to move on linear rails. The slide is used to accelerate the aircraft up to take-off speed. The slide position is controlled by a second motor (“slide motor”) installed on the ground station. In this way, most of the power injected during the take-off maneuver is provided by the slide motor and the resulting required space can be quite compact: in our prototype, only about 3.5 m of travel distance are needed to accelerate to about 9 m/s and then brake the slide. Finally, the ground station also comprises a power supply, the drives to control the two motors, a real-time machine for control and data-acquisition, a human-machine interface and the mechanical frame that supports all the mentioned components. In our prototype, the power supply is composed of two 12V batteries connected in parallel and a DC-AC inverter providing a 220 VAC, 3 kW single-phase line to the drives and to all the measurement and control hardware. The main features of our small-scale prototype are reported in Table 1, while the full details are given in [22]. 2.2 Aircraft We consider a rigid aircraft with conventional design, equipped with an horizontal axis propeller and with four control surfaces - elevator, ailerons, rudder and flaps. As a matter of fact, in our control approach we use only the motor, ailerons 2 Z 𝑊𝑊 𝒑𝒑̇ 7 𝑣𝑣𝑎𝑎 x 𝜑𝜑 𝜃𝜃 y pZ z pX 2 5 pY 1 3 X 6 𝛾𝛾ref,to Y 4 Figure 1: Sketch of the considered system, showing: 1. the winch motor, 2. the winch, 3. the tether connecting the winch to the aircraft, 4. the tether tensioning system, 5. the slide, 6. the rails, 7. the aircraft. The inertial coordinate system (X, Y, Z) and the local one (x, y, z) are also shown, together with the aircraft position p and velocity ṗ, the roll and pitch rotations ϕ, θ, the wind velocity vector relative to ground, W , the resulting apparent wind velocity va , and the angle γref,to between the take-off direction (dotted arrow) and the X-axis. 7 5 6 4 3 2 1 9 11 10 8 12 13 Figure 2: Picture of the small-scale prototype built at ABB Corporate Research. The numbers 1. to 7. correspond to the components also depicted in Fig. 1. In addition, the picture shows: 8. the slide motor and drum, 9. the box containing power supply, inverter, and drives, 10. the real-time machine for data-logging and high-level control of the ground station, 11. the laptop used to interface with the drives and the real-time machine. and elevator to control the aircraft, since these proved to be sufficient to achieve good performance. Further improvements can be obtained by exploiting also the remaining control surfaces. A mechanism to attach and detach the tether is also installed on the aircraft. The following onboard measurements are available to be used for feedback control: position and velocity with respect to the ground; roll, pitch and yaw angles and their rates; 3D accelerations with respect to a local (i.e. fixed with the aircraft) reference frame; airspeed along the local longitudinal axis. In our prototype, we use a commercial model glider made of styrofoam (visible in Fig. 2), which we reinforced with fiberglass and modified to add the tether attachment mechanism. In the glider we installed an inertial measurement unit (IMU) (an SBG Systems “Ellipse-N” unit [23]) and a pitot probe, which together provide the above-mentioned measurements at a rate of 50 Hz, large enough for the considered control problem since the aircraft dynamics exhibit dominant poles lower than 5 Hz (see sections 3-4 for more details on the time constants of the glider dynamics). We also installed an embedded platform (an Arduino MEGA 2560 board [24]) to fuse all the measurements, log the data, and compute and actuate the control inputs. A commercial remote controller and the corresponding onboard receiver are 3 Table 1: Main technical features of the employed prototype. Ground station Winch and slide motors’ maximum continuous torque 13 Winch and slide motors’ peak torque 26 Winch and slide motors’ rated speed 208 Tether length 150 Rails’ length 4.5 Slide mass 9 Spring maximum compression 0.32 Spring stiffness 60 Battery bank capacity 260 Battery bank voltage 12 Inverter continuous power 3000 Inverter peak power 6000 Glider Wingspan 1.68 Mean Aerodynamic Chord 0.194 Aspect Ratio 8.89 Wing Surface Area 0.3174 Mass 1.2 Peak Motor Power 360 Rated Motor Power 290 Battery voltage 14.4 Propeller diameter 0.22 Nm Nm rad/s m m kg m N/m Ah V W W m m m2 kg W W V m used to pilot the aircraft manually if needed, and to switch between manual and automatic flight modes. Fig. 3 shows the inside of the glider’s fuselage, with the IMU and the control board. The control surfaces and the tether release mechanism are actuated by standard servomotors widely employed in the model glider business, and the front propeller is driven by a standard brushless DC motor. For the sake of brevity, only the main characteristics of the glider are shown in Table 1, while the full details on the employed hardware, sensors, actuators etc. are reported in [22]. 4 2 3 1 7 6 5 Figure 3: Onboard measurement and control hardware for the glider. 1. DC-DC power converter; 2. motor driver; 3. inertial measurement unit; 4. GPS antenna; 5. Arduinor Mega 2560 embedded platform; 6. extension boards; 7. RC receiver. 2.3 Ground station control As anticipated in the introduction, the details of the ground station design and control are outside the scope of this paper and can be found in [22]. However, we recall here the principle of operation of the winch control system, since this is instrumental to understand one of the main assumptions that we consider when modeling the aircraft and designing its onboard controller. A first goal for the winch control strategy is to limit the force exerted by the tether on the aircraft to relatively small values. This aspect is fundamentally different from what is usually considered in AWE during the power generation 4 phase, where the tether force is very large. The main reason for this difference is that, during power generation, crosswind trajectories are flown at large speed and the aircraft’s velocity vector is roughly perpendicular to the tether, thus the tether force does not affect the aircraft forward velocity. On the contrary, during take-off the aircraft speed is much lower and its velocity vector is almost aligned with the tether, such that even a small tether force can slow-down the aircraft and provoke a stall situation. At the same time, reeling out with no load must be also avoided, in order to prevent entanglement of the tether and to limit the tether sag, which increases the weight and drag forces acting on the aircraft and might as well lead to entanglement with obstacles on the ground. Such conflicting control objectives (low tether force and low tether sag) require some sort of coordination between the aircraft and the ground station. A natural approach to this problem would be to exploit communication between the two sub-systems to try to coordinate their motion. However, such an exchange of information between the controllers might be still not enough to achieve the required coordination, since one would need to gather not only the aircraft velocity vector and the tether length and speed, but also the relative angle between the aircraft velocity and the tether. The latter might be very difficult to estimate or measure with good enough accuracy. Furthermore, even with perfect knowledge of the position and velocity of both the aircraft and tether/winch, the torque limitation and the inertia of the winch might still prevent the control system from acting fast enough to avoid a stall situation when the tether force becomes too large. In our study, a key design choice we made is to have no exchange of information between the ground station controller and the aircraft. The main advantage of this choice is that communication reliability issues and delays do not have to be dealt with, while the main disadvantage is that the achievable system performance, for example in terms of flight pattern repeatability and tolerance to wind disturbances, is inferior to the case when communication between the aircraft and the ground is exploited. Since our activity was conceived as a proof of concept and performance optimization was not a priority, we decided not to exploit communication. In order to solve the winch/aircraft coordination problem without using an active exchange of information, we designed the above-mentioned mass-spring system. The employed spring is relatively soft, such that a small pulling force on the tether produces a rather large displacement. The spring compression helps to reduce the harshness with which the tether pulls on the aircraft, and gives more time to the winch control system to react. The spring displacement is measured by a potentiometer and employed as a feedback variable to compute the reference reeling speed for the winch. A standard proportional controller in an inner control loop is then in charge of tracking such a reference speed by adjusting the motor current, which is subject to saturation (hence imposing a saturation on the motor torque). The full details of the ground station controller and more in general of the ground station design are described in [22]. However, for the sake of completeness we include here a short description of the feedback control strategy that computes the reference winch speed. More specifically, let us denote with xs (k) the measured spring compression, where k ∈ Z indicates the discrete time instants employed by the ground station controller. We set two threshold values, xIs , xII s , which divide the available spring travel in three zones: • Zone a (0 ≤ xs (k) ≤ xIs ): the spring is practically uncompressed, the winch shall decrease speed and eventually reel-in; • Zone b (xIs < xs (k) < xII s ): the spring is subject to low force, the winch speed shall be held (constant tether speed); • Zone c: (xII s ≤ xs (k) ≤ xs ): the spring is subject to relatively large force, the winch shall increase its speed and reel-out to release the tether. Then, the reference winch speed, θ̇ref,w (k), is computed according to the following strategy (see Fig. 4): If 0 ≤ xs (k) < xIs (Zone a) xs (k) − xIs I xI,a s −xs  fbck   a θ̇ref,w (k) = min 0, max θ̇ref,w , θ̇ref,w (k − 1) + Ts θ̈ref,w x̄s (k) x̄s (k) = Else if xIs ≤ xs (k) < xII s (Zone b) θ̇ref,w (k) = θ̇ref,w (k − 1) Else if xII s ≤ xs (k) ≤ xs (Zone c) x̄s (k) = xs (k) − xII s xII,c −xII s s   fbck  c θ̇ref,w (k) = max 0, min θ̇ref,w , θ̇ref,w (k − 1) + Ts θ̈ref,w x̄s (k) 5 fbck fbck a c where θ̇ref,w , θ̇ref,w are the desired minimum and maximum reference speed values that can be issued, and θ̈ref,w , θ̈ref,w are the desired angular accelerations for the reference speed. Such values are scaled according to the position of the II,c I potentiometer relative to the values xI,a > xII s < xs and xs s , respectively for zones a and c, which are design parameters as well. Equation (1) represents an integral controller, where the integrated quantity is the distance of the spring position xs (k) from the interval (xIs , xII s ) (i.e. zone b) and the gain is piecewise constant, since it is different in zones a and c. Moreover, a saturation of the integrated variable to negative (resp. positive) values is operated whenever the spring enters zone a (resp. c), in order to quickly start to reel-in (resp. reel-out) when the tether is released (resp. pulled). As shown fbck fbck a c < 0, θ̇ref,w , θ̈ref,w > 0, xI,a ≈ xIs /2 and in [22], a sensible choice for the involved design parameters is θ̇ref,w , θ̈ref,w s II,c xs ≈ (xs + xII s )/2. 𝑥𝑥𝑠𝑠 a b c 𝑥𝑥𝑠𝑠 a 𝜃𝜃̈ ref,w c 𝜃𝜃̈ ref,w × Integrator saturation in zones a and c � 𝜃𝜃̇ref,w Figure 4: Block-diagram of the feedback contribution to the reference winch speed. The actual winch control strategy is slightly more complex, since it involves also a feed-forward term during the take-off transient, in order to latch the winch speed to the slide speed, see [22] for details. An example of the typical behavior obtained with the described winch control system is shown in Fig. 5, which presents the aircraft airspeed, winch speed, reference winch speed, spring compression and an estimate of the tether force during autonomous tethered flight, while the aircraft is pulling on the tether and then starting a turn maneuver. The difference between the aircraft airspeed and the tether speed is due to the relative orientation between the two. Referring to Fig. 5, the initial spring position is such that, according to the winch control strategy, the reeling speed is held constant (equal to zero in this specific case). Then, at t ' 15 s the tether becomes taut and the spring compresses, entering a region where the reference winch speed is increased (according to the winch control law). When the tether length becomes larger than the distance between the aircraft and the ground station, the tether becomes slack again and the spring is released. Then, the reference winch speed is first held in place (as the spring travels through the "hold" region) and then quickly ramped down toward negative values. However, as the winch slows down, the aircraft might pull again on the tether, hence giving place to the oscillating behavior of the winch speed, until finally after t ' 18.5 s the tether force settles again on a roughly constant value, corresponding to a fixed spring position. This kind of transient is very common with the adopted strategy, where the winch controller and the aircraft controller are fully decoupled and coordination has to be done via the spring compression. An oscillating behavior of the spring while the tether is taut indicates that the (average) reel-out speed is matching well with the aircraft speed projected along the tether: the alternative would be either to reel-out too fast, with consequent full decompression of the spring and tether entanglement on the ground, or to reel-out too slowly, with consequent stall of the aircraft. It can be noted that the typical perturbation of the glider speed due to the tether force is less than 1 m/s, which is an acceptable performance for the sake of our study. A rough estimate of the the tether force, neglecting the inertia and viscous friction of the spring mechanism, can be obtained by simply scaling the spring compression by its stiffness, of about 60 N/m, and considering that, since the tether runs 180 deg around the pulley attached to the spring (see Fig. 1), the force acting on the spring equals two times the tether force. Such an estimate is plotted in Fig. 5, too, showing that impulses of about 3-8 N peak and 0.3-0.7 s of duration are experienced by the aircraft. These values are acceptable for the glider used in our tests, since they don’t compromise the flight dynamics. The described winch control strategy and its performance represent the main motivation for which, in the remainder of this paper, we will refrain from including a model of the tether or of the ground station to design the aircraft controller. In fact, we will consider a rather simple model of the aircraft dynamics, where the force exerted by the tether is embedded, together with other neglected aspects and high-order dynamics, in an unknown-but-bounded additive disturbance term. 2.4 System operation and control objectives The overall aim of the onboard controller is to reach a repetitive flight pattern above the ground station, starting from a standstill position on the slide. We divided such a control task in two subsequent phases, whose control objectives are 6 Speed (m/s), compression (10-1 m), Est. tether force (N) 12 10 8 6 4 2 0 -2 14 15 16 17 Time (s) 18 19 20 Figure 5: Experimental results: example of transient of spring compression and related loss of speed of the aircraft when the tether is taut. Solid line: airspeed (m/s), dashed: winch speed (m/s), dotted: reference winch speed (m/s), dash-dot: spring compression (10−1 m). Thin dash-dotted line: tether force estimated from the spring compression. described next. Take-Off and climbing: The glider is initially attached to the slide. The take-off maneuver is initiated by the ground station, which accelerates the slide. The onboard controller has to detect this situation (we recall that there is no exchange of information between the ground station controller and the onboard one) and stabilize the aircraft’s attitude until it detaches from the slide, while at the same time powering up the onboard motor to sustain the climb. After detaching from the slide, the first goal of the controller is to reach a safe altitude, before performing any other maneuver. A relatively large climb angle is thus targeted to rapidly reach such a safe altitude. A large climbing angle is also beneficial when the tether is taut, since a smaller component of the tether force adds to the aerodynamic drag. Transition phase and figure-of-eight patterns: Once a safe altitude has been reached, the controller shall carry out a transition maneuver to engage a repetitive figure-of-eight pattern parallel to the ground at a target altitude, withstanding the presence of wind gusts and of the tether. Assuming that the wind flow is mainly parallel to the ground as well, such a pattern gives rise to low tether forces. In a power generating system, this phase can be then exploited to check the system and estimate the wind conditions before carrying out a further transition to crosswind figure-of-eight paths. Such a transition can be achieved by smoothly adjusting the eight-pattern from horizontal to crosswind. At the same time, the winch control system has to be changed from a “low-tether-force” strategy, like the one considered in this paper (which allows the aircraft to take-off notwithstanding the tether), to a “high-tether-force” strategy, e.g. where the reel-in torque is set proportional to the square of the reel-out speed, see e.g. [11]. Since in our study the goal is to demonstrate only the autonomous take-off and the transition to low-force flight, we stop the experiments once the horizontal eight-pattern has been reached. 3 System modeling and control design We will now describe in detail the design of a controller able to achieve the objectives described in section 2.4. The design is model based: we first derive a relatively simple model of the aircraft dynamics and identify its parameters using experimental data collected in preliminary flights, and then we design the final controller on the basis of this model. 3.1 Aircraft modeling and parameter identification 3.1.1 Model equations There exist a vast literature and many textbooks concerned with the flight mechanics of a rigid aircraft like the one considered in this work, albeit without the tether. A frequent approach is to employ a six-degrees-of-freedom (dof) model with lumped parameters accounting for the geometrical, inertial and aerodynamic characteristics of the aircraft. In a preliminary work we used such a model (taken from [25]), together with models of the ground station and of the tether, in order to obtain a simulation tool for our control algorithms [26]. This model is quite realistic as it includes the most 7 important system nonlinearities, e.g. the stall behavior, and considers the coupling among the different states. However, it is rather complex, since it comprises 12 states (three-dimensional position and rotation and their time derivatives) and 5 inputs (motor, rudder, ailerons, elevator, and flaps). If the presence of the ground station (slide, winch and massspring system) and of the tether were also considered (the latter with a simple purely elastic model as done in [26]), the number of states and inputs would raise to 18 and 7, respectively. Such a model is very useful to simulate the system and carry out a preliminary test of control algorithms, however its use for control design is not trivial. In fact, even the parameter identification phase raises difficulties due to the presence of nonlinearities, open-loop unstable behavior and poorly controllable and expensive experimental tests, where the wind vector, which would be required for an accurate identification of the aerodynamic characteristics, is anyways not measured. Therefore, for the sake of control design we decided to take a radically opposite approach and adopt a very simple model of the system dynamics to attain our goals, with the same spirit of previous contributions on AWE control design, [27, 13, 10]. Namely, we consider two main dynamical modes: the first one to describe the turning behavior, and the second one to describe the vertical motion. A third dynamical equation describes the link between the airspeed and the propeller thrust. The couplings among all these modes are neglected and embedded into additive disturbance/uncertainty terms. The core building blocks of the resulting model are either linear time-invariant, second-order dynamical equations whose parameters can be easily identified from the available measurements, or kinematic relationships that feature no parameter at all. Thus, the parameter identification phase is rather straightforward and effective, as shown below. Moreover, the model is readily usable for control design using a hierarchical approach, as detailed in section 3.2. We start by introducing an inertial coordinate system (X, Y, Z) fixed to the ground with the Z−axis pointing up, and a local one (x, y, z) fixed to the aircraft (body frame), with the z−axis pointing down when the aircraft is in horizontal flight, see Fig. 1. The rails’ orientation (take-off direction) forms an angle γref,to with the inertial X-axis. The position vector of . the aircraft is denoted by p (bold letters indicate vectors in a three-dimensional space), its velocity by ṗ = dp/dt, where t is the continuous time variable. When considering the components of a vector, we add as a subscript the corresponding axis, e.g. pX is the component of vector p along the inertial X−axis. We further denote by ϕ, θ, ψ the standard roll, pitch and yaw angles (Euler angles), and with va the magnitude of the airspeed toward the body x−axis direction. The full airspeed vector is in principle computed as W − ṗ, where W is the wind velocity vector, which however is not measured in practice. On the other hand, the value of va is measured thanks to the onboard pitot probe aligned with the body x−axis. Finally, we denote with uϕ , uθ and um the control inputs for the ailerons, elevator, and propeller thrust, respectively. The equations for the first mode (turning behavior) are derived starting from the roll angle dynamics: ϕ̈(t) = aϕ ϕ̇(t) + bϕ uϕ (t) + dϕ (t) (1) where aϕ and bϕ are parameters to be identified, and dϕ is a disturbance term accounting for neglected dynamics, wind, and the presence of the tether. The parameter aϕ is expected to be negative, so to have a stable first-order model linking the aileron input uϕ to the roll rate ϕ̇. Equation (1) is motivated by physical insight, since a constant aileron input gives rise to a constant roll rate in steady-state(due to the equilibrium of the aerodynamic roll moment induced by the aileron with the opposite one generated by the roll rate), by experimental evidence (see section 3.1.2 below) and by the structure of the equation obtained by linearizing a more complex model, like the one derived in [26], in a steady-state, straight-flight configuration. Considering a turning maneuver at constant tangential speed and with constant radius along a circular trajectory parallel to the ground (i.e. the (X, Y )-plane), the roll angle ϕ can be then linked to the lateral acceleration of the aircraft by considering the equilibrium of aerodynamic lift, gravitational force, and centrifugal force during the turn: L sin (ϕ) = malat (2a) L cos (ϕ) = mg (2b) where L is the aerodynamic lift force, m the mass of the aircraft, and alat is the centripetal acceleration. Fig. 6 presents an intuitive representation of equations (2). As mentioned, such equations hold with good approximation when the path is parallel to the ground, such that when ϕ = 0 the lift force points along the inertial Z direction. Moreover, under the considered assumptions the tangential speed equals |ṗ(t)| and from the kinematics of rigid bodies we have: alat = |ṗ(t)|ψ̇ (3) where ψ̇ is the yaw rate. Now, inserting (3) into (2a), dividing (2a) by (2b) and assuming small roll angles, such that we can use the linearization of the trigonometric functions at ϕ = 0 (in our experiments we seldom exceeded 30◦ of roll), we obtain: g ϕ(t) (4) ψ̇(t) = |ṗ(t)| 8 𝜑𝜑 L alat malat z mg y Z Figure 6: Sketch of the considered turning model for the aircraft Finally, it is useful to also introduce the link between the trajectory curvature 1/R(t) (where R(t) is the turning radius) |ṗ(t)| and the roll angle in the model. Considering that ψ̇(t) ' , we have: R(t) 1 g ϕ(t) = R(t) |ṗ(t)|2 (5) Together, equations (1) and (4) form our model for the turning behavior, since they link the aileron input to the roll angle, and the latter to the flown trajectory on a plane parallel to the ground. Such equations have the advantage of having just two parameters to be identified within a second-order, linear time invariant (LTI) system (eq. (1)), while all the other involved quantities are measured by the available sensors, in particular magnetometers for ϕ, gyroscopes for ψ̇, GPS and accelerometers for |ṗ(t)|. About the vertical motion, we start from the pitch dynamics: θ̈(t) = aθ θ̇(t) + bθ uθ (t) + dθ (t) (6) where, in a way similar to equation (1), aθ and bθ are unknown parameters to be identified and dθ accounts for neglected effects. Again, the parameter aθ is expected to be negative, i.e. the dynamical behavior from the elevator input uθ to the pitch rate is asymptotically stable. The model (6) is also based on physical insight and prior knowledge, it is confirmed by the experimental data and it holds within certain limits, in particular for small values of the pitch angle and of the angle of attack. Such conditions are met in our experiments. Assuming now a straight-line flight parallel to the ground at constant forward speed, a constant pitch value θ0 exists, such that this motion is at steady state, i.e. the lift force equals the weight of the aircraft and the propeller’s thrust counteracts the drag. For simplicity and without loss of generality, we assume θ0 = 0. Exploiting again the assumption of small θ values, we can then approximate the link between the pitch angle and the vertical velocity along the inertial Z−axis as: ṗZ (t) = |ṗ(t)|θ(t) (7) Fig. 7 provides a graphical interpretation of (7). Equations (6) and (7) link the pitch dynamics to the vertical inertial 𝑥𝑥 𝑍𝑍 𝒑𝒑̇ (𝑝𝑝̇𝑋𝑋 , 𝑝𝑝̇𝑌𝑌 ) 𝑝𝑝̇𝑍𝑍 𝑧𝑧 Figure 7: Sketch of the considered pitch/vertical motion model for the aircraft component of the aircraft trajectory, and form our model of the vertical dynamics. Also in this case there are only few parameters, which can be easily identified from experimental data. 9 Last, we employ the following equations to model the effect of the propeller thrust on the airspeed va : um (t) = 1 ρACD va (t)2 + dva (t) 2 (8) where ρ is the air density, CD the aerodynamic drag coefficient, A the effective area of the aircraft, and dva (t) a term accounting for neglected effects. Equation (8) is derived by assuming equilibrium between the motor thrust and the aerodynamic drag, and a small angle of attack (i.e. assuming that the apparent wind is mainly aligned with the body x−axis). Similarly to the previous equations of motion, we include the approximation errors arising from such an assumption in the term dva (t). The simple equation (8) is good enough for the considered application. Equations (1), (4), (6), (7) and (8) form the model of the aircraft that we will use for control design. The only unknown parameters are aϕ , bϕ , aθ , bθ , which can be identified from data as shown in the following. Regarding the value of CD in (8), a good estimate can be obtained from the airfoil shape and the aircraft design; moreover such a parameter is not critical for control design as we comment later on in section 3.2.4. 3.1.2 Parameter identification For the sake of brevity, we present here the identification approach and results only for the roll angle dynamics (1). For the pitch angle, we employed the same approach and obtained similar results. Equation (1) involves two parameters to identify, aϕ and bϕ . We first estimated a value for both parameters by linearizing the 6-dof model of [26] and designed a preliminary proportional controller Kid to track a reference roll angle ϕref , and we tested such a controller in fly-by-wire, i.e. with a human pilot issuing the desired roll angle from the ground. Using a batch of the collected data, we then identified the model parameters in closed-loop with the same preliminary controller by solving the following optimization problem: N min {ϕ̃}N 1 − {ϕ}1 aϕ ,bϕ 2 N ˜ N + {ϕ̇} 1 − {ϕ̇}1 2 (9a) subject to ϕ̇(τ + 1) = ϕ̇(τ ) + Ts (aϕ ϕ̇(τ ) + bϕ Kid (ϕ̃ref (τ ) − ϕ(τ ))) (9b) ϕ(0) = ϕ̃(0) ˜ ϕ̇(0) = ϕ̇(0) (9c) (9d) where Ts is the employed sampling time, τ = 0, 1, . . . , N − 1 denotes the discrete-time sampling instants, N is the . T N number of employed samples, {ϕ̃}N 1 = [ϕ̃(1), . . . , ϕ̃(N )] is the sequence of measured roll angle values and {ϕ}1 of N N ˜ 1 , {ϕ̇}1 are the measured and estimated roll rate values). The notation˜in (9) denotes estimated ones (and similarly {ϕ̇} the collected noise-corrupted experimental data. Namely, problem (9) aims to find values of the parameters that minimize the 2-norm of the error between the measured and simulated roll rate, in the presence of the same preliminary controller and applying the measured input reference roll angle. The resulting problem is a nonlinear program (NLP) which we solved for a local minimum by using a sequential quadratic programming approach (the function fmincon in Matlabr ). An example of the obtained results is illustrated in Fig 8, where the roll rate obtained using the parameters computed by solving (9) is compared with the measured one, using a second batch of data not employed for the parameter identification. The obtained results further confirm that the considered second order model (1) approximates the roll motion well and that we can avoid the complexity of the 6-dof model for the controller design. In section 4.1, we present the obtained numerical values of the parameters. 3.2 Control Design 3.2.1 Controller structure We employ a hierarchical control structure (see Fig 9), with low-level controllers designed to track reference values for the roll angle, ϕref , pitch angle, θref , and front airspeed, va,ref , and high-level controllers that compute such references in order to achieve the goals outlined in section 2.4 for each operational phase. Following our modeling approach, we design decoupled low- and high-level controllers for the roll, pitch and forward motion modes. The employed control inputs are those appearing in the model of section 3.1, i.e. the aileron and elevator positions, uϕ and uθ , and the propeller thrust, um . In the next sub-sections, we describe the structure of the low- and high-level controllers, followed by short discussions about the controllers’ tuning and closed-loop stability guarantees. 3.2.2 Low-level controllers Since ϕ, ϕ̇, θ, θ̇, and va are directly measured and their dynamics are approximately linear for the sake of our goals (see section 3.1), we can use static, linear state-feedback control laws to stabilize these quantities and track their reference values. 10 Roll rate (rad/s) Roll angle (rad) 1 0.5 0 -0.5 -1 30 40 50 60 70 Time (s) 80 90 100 2 1.5 1 0.5 0 -0.5 -1 -1.5 30 40 50 60 70 Time (s) 80 90 100 Figure 8: Experimental results. Solid lines: measured roll angle (upper plot) and roll rate (lower plot) obtained in fly-bywire mode with a preliminary controller. Dashed lines: roll angle and rate obtained with the model (1), whose parameters have been identified by solving problem (9). The data shown in the plot are different from those used for the identification. For the roll dynamics, we define the angular tracking error as . eϕ (t) = ϕref (t) − ϕ(t), (10) and employ the state-feedback control law uϕ (t) = Keϕ eϕ (t) + Kėϕ ėϕ (t). (11) From (1) and (10)-(11) we have:  ėϕ (t) ëϕ (t)   = | 0 −bϕ Keϕ   eϕ (t) 1 ėϕ (t) aϕ − bϕ Kėϕ {z } Aϕ,CL   0 + wϕ (t) (12) . where wϕ (t) = (ϕ̈ref (t) − dϕ (t) − aϕ ϕ̇ref ) can be seen as an external, bounded disturbance term accounting for neglected dynamics and the time variation of the reference roll angle and rate issued by the high-level controller. We use a classical pole-placement technique [28] to design the gains Keϕ , Kėϕ in order to assign the eigenvalues of the matrix Aϕ,CL describing the closed-loop dynamics of the tracking error. In particular, in order to easily tune the controller also during flight, we implemented the explicit equations that link Keϕ , Kėϕ to the desired closed-loop eigenvalues of the roll dynamics, denoted as λϕ,1 , λϕ,2 : λϕ,1 λϕ,2 Keϕ = bϕ (13) λϕ,1 + λϕ,2 − aϕ Kėϕ = −bϕ In (13), the only design parameters are λϕ,1 , λϕ,2 , which can be intuitively tuned on the basis of the desired closed-loop bandwidth (we provide the values employed in our experimental tests in section 4.1). Following the same approach, we design the low-level controller for the pitch as: . eθ (t) = θref (t) − θ(t) (14a) uθ (t) = Keθ eθ (t) + Kėθ ėθ (t) λθ,1 + λθ,2 − aθ Kėθ = − −bθ λθ,1 λθ,2 K eθ = bθ λθ,1 + λθ,2 − aθ Kėθ = −bθ 11 (14b) (14c) (14d) (14e) Turning controller 𝜑𝜑ref Altitude controller Roll controller 𝜃𝜃ref 𝑢𝑢𝜑𝜑 Pitch controller High-level 𝑣𝑣 𝑎𝑎,ref airspeed controller Aircraft Airspeed 𝑢𝑢m controller 𝜑𝜑, 𝜑𝜑̇ High-level controller 𝑢𝑢𝜃𝜃 𝜃𝜃, 𝜃𝜃̇ 𝑣𝑣𝑎𝑎 Low-level controller 𝒑𝒑(𝑋𝑋,𝑌𝑌,𝑍𝑍) , 𝒑𝒑̇ (𝑋𝑋,𝑌𝑌,𝑍𝑍) , 𝑝𝑝̈𝑥𝑥 Figure 9: Controller architecture showing the feedback variables used by the three low-level controllers and by the corresponding three high-level controllers. Finally, for the airspeed controller we employ a static law as well, however considering the square of the airspeed and of its reference:  2 um (t) = Km va,ref (t) − va2 (t) , (15) where Km > 0 is a design parameter. From (8) and (15) we obtain the closed-loop relationship: s Km 1 2 va,ref (t) + dv (t) va (t) = 1 Km + 2 ρACD Km + 12 ρACD a (16) which for large enough values of Km (as compared with the terms 21 ρACD and dva (t)) gives: va (t) ≈ va,ref (t). As a final remark before proceeding to the description of the high-level controllers, we note that all the control inputs have hard saturations that need to be enforced, i.e. uϕ ∈ [uϕ , uϕ ], uθ ∈ [uθ , uθ ] and um ∈ [um , um ]. For the sake of simplicity, we did not include such saturations in the control laws (11), (14b) and (15), however in practice we trim the control inputs in order not to violate these bounds. Since we have no integrators in our controllers, the presence of the saturations does not give rise to windup issues. Moreover, as a matter of fact in our tests the saturation values were hit rarely and always for very short time, indicating that the available control authority was large enough to accomplish the targeted task. We provide the actual saturation values of our experimental setup in section 4.1. 3.2.3 High-level controllers We adopt three high-level controllers for the steering, altitude and airspeed dynamics, which respectively compute the references ϕref (t), θref (t), and va,ref (t). While the low-level controllers never change during operation, we design different high-level control strategies according to the operational phases outlined in section 2.4, and we switch among them when a transition from the first phase to the second one is detected. Therefore, in the following we present the high-level controllers organized by operational phase, as well as the conditions that trigger the phase transition. Take-Off and climbing. In this phase, the aircraft is initially at rest on the slide, waiting for the acceleration provided by the latter. A minimum forward acceleration threshold p̈x,to is set by the control designer. When the following condition is detected: p̈x ≥ p̈x,to (17) then a constant airspeed reference is issued: va,ref (t) = va,ref,to , 12 (18) where the design parameter va,ref,to is chosen as a much larger value than the cruise airspeed of the aircraft, in order to provide full propeller thrust during the initial climb. Regarding the altitude controller, a constant, relatively large reference pitch angle θref,to (e.g. 40◦ ) is used: θref (t) = θref,to (19) which gives place to a large vertical speed (see equation (7)). Finally, the roll reference is computed in order to keep a straight trajectory in the inertial (X, Y ) plane. To this end, we consider the course angle:   ṗY (t) γ(t) = arctan (20) ṗX (t) and we employ the following feedback controller: ϕref (t) = Kϕ |ṗ(t)| (γref,to − γ(t)) , g (21) where Kϕ > 0 is a design parameter and γref,to corresponds to the orientation of the ground station’s rails in the inertial reference frame. The latter can be easily and accurately estimated onboard by using the yaw angle provided by the IMU in a time interval before the initial acceleration, hence once again avoiding active communication between the ground station and the aircraft. The rationale behind equation (21) is the following: from (10) we can write ϕ(t) = ϕref (t) − eϕ (t), (22) where the tracking error eϕ (t) can be considered to be small thanks to the low-level controller of the roll dynamics (11), particularly if we assume that the dominant poles of (12) have been assigned such that the closed-loop roll motion is faster than the yaw motion (please see section 3.2.4 for more details on the tuning and section 4.1 for the actual values used in our experiments). We further assume that ψ̇(t) ' γ̇(t), (23) i.e. that the yaw rate and the rate of the course angle are similar, which is a reasonable assumption when the sideslip angle of the aircraft is small like in our application. Then, using (4) and (21)-(23), we have: γ̇(t) ' Kϕ (γto − γ(t)) , (24) which is (since Kϕ > 0) a stable first-order system with time constant τγ = 1/Kϕ . Thus, under the proportional control law (21), the roll angle of the aircraft is controlled in order to track the desired course angle. Finally, we limit the turning radius of the aircraft to a minimum value Rmin by setting the following bounds on the reference yaw rate (see equation (5)): |ṗ(t)|2 |ṗ(t)|2 ≤ ϕref (t) ≤ . (25) − g Rmin g Rmin Similarly to the other design parameters, in section 4.1 we provide the numerical value chosen for Rmin . Transition phase and figure-of-eight patterns. When the “safe-altitude” condition: pZ (t) ≥ Z (26) has been reached, the transition phase begins. The goal is to steer the aircraft back towards the ground station and engage a repetitive figure-of-eight pattern roughly above it, while at the same time continuing to ascend to the target altitude Zref > Z. To achieve this result, in the airspeed controller we set a constant reference airspeed va,ref (t) = va,ref,flight equal to the cruise speed of the aircraft. About the turning controller, we employ the same control law (21), but with a time-varying reference course angle γref (t) (which was set to the constant value γref,to during the climb) in order to steer the aircraft towards two switching target points, which are fixed w.r.t. the ground and suitably chosen to achieve the desired flight patterns. In particular, let us consider two target points p I and p II defined in the inertial (X, Y, Z) plane. On the (X, Y ) plane, these points are computed in order to be symmetrical w.r.t. to the location of the ground station along the take-off direction γto , and slightly shifted to one side along the direction perpendicular to γto . The altitude of the points is set equal to Zref . As an example and without loss of generality, if we assume that the ground station is located at the origin of the inertial frame and that γto = 0 (i.e. the take-off is carried out along the X−direction), then a suitable choice of the target points is:  −∆X   ∆X  ref I ref 2 p =  Yref  , p II =  Zref 2 Yref , (27) Zref where ∆Xref > 0 is the chosen distance between target points along the take-off direction. A graphical example of this type of parametrization of the target points (but for γto ' 15◦ ) is shown in the experimental results of Fig. 10. 13 At the start of the transition phase (i.e. when condition (26) is detected), the target point farthest away from the aircraft is chosen as the active one, denoted as p a . Then, the reference course angle is computed as:  a  pY (t) − pY (t) γref (t) = arctan , (28) pXa (t) − pX (t) i.e. the course angle corresponding to a straight line connecting the current (X, Y ) position of the aircraft with that of the target. The switching of the active target point happens when the aircraft’s (X, Y ) position surpasses the position of the current target point, after projecting both positions on a direction corresponding to the take-off course γref,to . In the previous example (27) with γref,to = 0, the corresponding switching rule would be:  I ref + δX  p if pX (t) < − ∆X 2 a ∆Xref II p (t) = (29) p if pX (t) > 2 − δX  a − p (t ) else where δX > 0 is a small tolerance (e.g. 0.5 m) to avoid possible numerical issues when computing the arctan function in (28), and p a (t− ) is the previous active target point (in the discrete-time implementation of the controller –see section 4.1– this corresponds to the target point at the previous sampling instant). The value of γref (t) computed by (28) is finally plugged into (21) in place of γref,to to close the high-level turning control loop. About the altitude controller, in this phase the aim is to regulate the aircraft Z position close to the reference Zref . To achieve this goal, differently from the initial take-off and climbing phase we employ a static proportional feedback controller to compute θref (t): Kθ (Zref − pZ (t)) (30) θref (t) = |ṗ(t)| where Kθ > 0 is a design parameter. Similarly to what shown in (24) for the turning dynamics, from (14) we have: θ(t) = θref (t) − eθ (t), with small tracking error eθ (t) thanks to the low-level controller. Then, considering also (7) and (30) we obtain: ṗZ (t) ' Kθ (Zref − pZ (t)) , (31) which is a stable first-order system with time constant τθ = 1/Kθ . 3.2.4 Controller tuning and stability/robustness aspects The described controller features several tuning parameters, which can be initially set on the basis of standard control design guidelines and physical insight, and then fine-tuned directly during experimental tests. We now provide for completeness some suggestions about possible tuning choices and procedures. The final numerical values employed in our tests are shown in section 4.1 The closed-loop eigenvalues λϕ,1 , λϕ,2 of the low-level roll controller and the gain Kϕ of the high-level turning controller have to be chosen such that the bandwidth of the inner closed-loop dynamics (12) is sufficiently larger than the one of the outer loop (24), i.e.: |λϕ,1 |, |λϕ,2 | > Kϕ , (32) and similarly for the pitch/altitude controllers: |λθ,1 |, |λθ,2 | > Kθ . (33) The low-level controllers can be fine-tuned in real-world tests by using a fly-by-wire mode, where a pilot on the ground issues reference roll and pitch values to the aircraft and adjusts the values of the closed-loop eigenvalues. When the latter have been fixed, the gains of the outer loop can be also fine-tuned during fully autonomous flight tests. The airspeed controller gain Km can be initially set in order to provide full motor power (resp. stop the motor) when the measured airspeed is larger (resp. smaller) than the reference by a certain amount, e.g. 30 %, and then fine-tuned during experiments. The acceleration threshold p̈x,to should be chosen in order to be sure to detect the slide movement, while avoiding false-positives e.g. due to vibrations induced by wind gusts. The actual acceleration experienced by the glider depends mainly on the rails’ length and on the take-off speed (assuming that all of the available length is exploited in order to limit the peak power consumed during take-off). As an example, in our tests the initial acceleration peak was about 40 N/m2 , and a threshold of 20 N/m2 was large enough to avoid false-positives. As already mentioned, the values of va,ref,to and θref,to shall be chosen large enough to provide full motor thrust (taking into account the value of Km ) and a large climb angle during the take-off, in order to quickly gain altitude and increase 14 the relative angle between the tether and the aircraft’s velocity vector, hence reducing the risk of stall due to the tether’s pulling force. The “safe-altitude” value Z shall be chosen to have enough safety margin in terms of distance from the ground, while avoiding to climb for too long on a straight line, with consequent large values of unreeled tether length. Finally, the minimum radius Rmin , the cruise airspeed va,ref,flight , and the position of the target points p I and p II shall be chosen in order to keep the resulting flight paths compact (to reduce the occupied air volume and the length of the tether) but at the same time avoiding too large roll angles during the turns, taking into account the aerodynamic/manoeuvrability features of the employed aircraft. Before proceeding to the experimental results, we finally comment on the closed-loop stability and robustness of the proposed control approach. Regarding nominal stability (i.e. assuming that the model equations introduced in section 3.1 hold with no uncertainty or disturbances), the choice of closed-loop eigenvalues with negative real-part for the low-level controllers and of positive gains Km , Kϕ and Kθ is sufficient to guarantee that the closed-loop system is asymptotically stable, which implies that bounded exogenous perturbations (e.g. due to the wind or the tether) give rise to bounded tracking errors. Moreover, since all of the feedback variables are directly measured, i.e. there is no observer involved, the use of state-feedback controllers provides good robustness margins against neglected dynamics, couplings between the different modes (which are neglected in our model) and parametric uncertainty [28]. Thus, the control system can tolerate quite large inaccuracies in the estimate of all of the unknown parameters in the model (i.e. aϕ , bϕ , aθ , bθ , CD , see section 3.1) without compromising stability and performance. Albeit these few comments do not represent a rigorous robustness analysis, which lies beyond the scope of this paper, they provide some insight on why a relatively simple approach like the one presented here provides good results in realworld experiments, as shown in the next section. 4 4.1 Experimental results Controller implementation, system and design parameters We implemented the described controller on the Arduino MEGA 2560 board installed on the glider. We employed a sampling frequency of 50 Hz, which is about two orders of magnitude larger than the fastest closed-loop dynamics of the system. Since the controller features only static feedback functions, there is no modification needed due to the discretization. In addition to the main control functions presented in the previous section, we programmed several consistency checks on the measured variables, in order to detect a possible sensor malfunctioning, as well as safety measures, like an automatic tether detach procedure if the distance of the aircraft from the ground station is too close to the maximum tether length (150 m). Since these additional functionalities do not change the system behavior in normal conditions, we omit further details here. The model parameters (resulting either from the identification procedure described in section 3.1 or from prior knowledge of the aircraft) are shown in Table 2, together with the employed values of the controller’s parameters. We followed the tuning guidelines described in the previous section, fine-tuned the parameters during initial flight tests and then fixed them to the values of Table 2 for all the subsequent experiments. 4.2 Results We carried out several outdoor tests using our experimental setup and the described control system. All the tests were carried out close to Leibstadt, Switzerland, at a location with little/moderate wind on average, with prevalent direction from East/North-East. We present here the experimental data of 14 tests carried out with the same take-off course angle γto . During the tests, the wind conditions changed from little/zero wind to front wind of about 4-5 m/s, to side wind of about 3-4 m/s. Thus, we are able to present results with both undisturbed conditions (i.e. either no wind or little front wind) and in presence of moderate wind disturbance coming from different directions. All these considerations hold for the wind at ground level, while at the target altitude (50 m) a moderate wind and wind gusts were always present, of the order of 3-4 m/s as estimated by experienced model glider pilots. Since we had no equipment to measure the wind at altitudes higher than a few meters, we cannot provide more precise estimates of the wind conditions experienced by the glider after the very first take-off instants. A movie is available online [29], showing an autonomous take-off and flight test with the initial take-off, the transition phase and finally the figure-of-eight flights. We first present the results of a test with little wind at ground level. The flight trajectory projected on the inertial (X, Y ) plane centered at the ground station is shown in Fig. 10(a), and the same trajectory overlayed on a satellite image of the corresponding GPS coordinates is presented in Fig. 10(b). The initial take-off phase on a straight line is clearly visible, as well as the transition to the figure-of-eight paths. Figs. 11(a)-(c) show the behavior of the turning dynamics (roll and course angle controllers) during the test. The discontinuities in γref (t) (Fig. 11(a), solid line) correspond to the switching instants between the target points. It can be clearly seen that the actual course angle γ(t) (Fig. 11(a), dashed line) changes at a constant rate during these transitions, which corresponds to the turning rate at cruise speed and with the minimum turning radius of 20 m set in the controller. 15 Table 2: System and controller parameters for the experimental tests System parameters aϕ −2.3 s−1 bϕ 12.6 s−2 aθ −4.65 s−1 bθ 30 s−2 CD 0.05 ρ 1.2 kg m−3 A 0.3 m2 Controller parameters - low level λϕ,1 −2.7 s−1 λϕ,2 −3.1 s−1 λθ,1 −2.7 s−1 λθ,2 −3.1 s−1 Km 0.5 kg m−1 [uϕ uϕ ] [−0.34 0.34] rad [uθ uθ ] [−0.34 0.34] rad [um um ] [0 20] N Controller parameters - high level Kϕ 1 s−1 Kθ 0.1 s−1 p̈x,to 20 m s−1 va,ref,to 16 m s−1 θref,to 0.69 rad Z 20 m Rmin 20 m va,ref,flight 13 m s−1 I I I [pX pY pZ ] [30 55 50] m [pXII pYII pZII ] [−30 40 50] m The corresponding roll angle ϕ(t) (Fig. 11(b)) is approximately constant and equal to about 35◦ during these turns. Finally, the employed roll input values uϕ (Fig. 11(c)) are usually smaller than 10◦ with few peaks at 15◦ , quite far from the saturation values of ±20◦ . Overall, the inner and outer loops for the roll and turning dynamics show very good tracking performance and provided a very consistent and robust behavior. The closed-loop altitude and pitch motions are shown in Fig 12(a)-(b). The aircraft altitude quickly approaches the target of 50 m during the initial take-off and transition. The vertical rate is constant because, similarly to what happens for the rate of the course angle, the aircraft sets to constant pitch and airspeed, which according to our model (7) yields a constant vertical position rate. During flight, the high-level controller is able to track with good accuracy (about 3-4 m of error) the target altitude, see Fig. 12(a) e.g. between 45 s and 60 s, except for periodic, quick drops in the altitude which are limited to less than 10 m of tracking error. A comparison between the distance of the aircraft from the ground station and the tether length, shown in Fig. 12(c), reveals that such disturbances are due to the tether pull: during each figureof-eight pattern the aircraft pulls on the tether for a fraction of the time and some length of slack line (also shown in Fig. 12(c)) is created. After the initial transient, the behavior of such a slack line becomes periodic as well, since the overall system (aircraft and ground station) converges to a stable periodic motion. The length of slack line depends on how fast the winch reels-in the line compared to how fast the glider changes its directions and flies back towards the ground station during the figure-of-eight patterns. The compression of the spring installed on the ground station is depicted in 12(c): we recall that this signal is used by the winch controller to regulate the winch reeling speed and decide whether to reel-out or reel-in (as briefly described in section 2.3 and thoroughly presented in [22]). Overall, the presented results show that the altitude controller behaves as expected and as discussed in section 3.2.4: in nominal/unperturbed conditions the tracking performance is very good, and in the presence of external disturbances the system reacts with bounded tracking errors. Moreover, it is shown that there is quite some room for improvement, either by better tuning or more advanced control strategies of the ground station, or by allowing the aircraft and ground station to communicate and optimize their behavior in a coordinated way. Regarding the propeller controller, Fig. 13 shows the courses of the reference airspeed and of the actual one, as well as the corresponding propeller thrust um . Similarly to the pitch controller, with no tether perturbations a small tracking 16 (a) 100 75 Y (m) 50 25 0 -25 -50 -100 -75 -50 -25 0 X (m) 25 50 75 100 (b) 47.589 Latitude (deg) 47.5888 47.5886 47.5884 47.5882 47.588 8.197 8.1975 8.198 Longitude (deg) 8.1985 8.199 Figure 10: Experimental results of a test with little wind at ground level. (a) Typical flight pattern in the inertial (X, Y ) plane centered at the ground station (marked with ’◦’). The target points p I and p II are marked with ’4’. (b) Flight pattern in GPS coordinates, overlaid to a satellite map of the area. The white dots along the trajectory are position measurements down-sampled at 2 Hz. error of about 0.5 m s−1 is achieved, while when the tether pulls on the aircraft a drop of airspeed is noticed, to which the controller reacts with an increase of thrust up to the maximum value. The loss of airspeed has consequences on all the other motions (pitch and roll), since it changes suddenly the angle of attack and the incoming flow speed. However, as already commented, the proposed controller is able to effectively cope with all such nonlinear effects. Finally, we present the results pertaining to all the 14 tests carried out with the same starting course angle, to show the repeatability and robustness of the controller in conditions with little to moderate wind disturbance. Fig. 14 shows the course of aircraft altitude for all the tests: it can be seen that the trajectories are quite consistent, except for one occurrence. The aircraft position on the (X, Y ) plane (in GPS coordinates) for all the tests is shown in Fig. 15: there is some variability in the initial transient and in the first few figure-of-eight patterns, until the aircraft and the whole system settle to a periodic motion. After such a transient, the patterns are more consistent but still exhibit some variability, which is expected: since the high-level controller relies on a two-point strategy only (instead for example on the tracking of a fully prescribed orbit), the actual obtained patterns can change e.g. depending on the wind conditions, similarly to what happens for the two-point strategies used for crosswind kite control in e.g. [13] and [10]. However, as shown in Fig. 16 where the (X, Y ) trajectories are presented without the initial transient, in all the performed tests the control system was able to reach and consistently follow the figure-of-eight paths, which was the ultimate intended goal of our feasibility study. 17 5 Conclusions and future work We presented a feedback controller for a tethered aircraft, able to consistently carry-out tethered take-off and low-force flight maneuvers. The controller works in combination (yet without any exchange of information) with a ground station that manages the initial acceleration on ground and controls the tether reeling, in order to limit the pulling force. The presented approach includes both modeling and control design aspects and has been extensively tested in experiments, whose results have been reported here as well. Our experimental results lead to essentially two concluding remarks. The first one is that a rather simple control approach, based on proportional controllers only and neglecting system nonlinearities, couplings among the aircraft’s modes and the presence of the tether, is able to achieve satisfactory results in terms of performance and robustness. This indicates that the considered take-off approach appears to be technically viable and, on the basis of our previous studies [20], it has the potential to also be economically viable, since it requires relatively small additional power both on ground and onboard and is able to carry out the take-off in very compact space. In our small-scale prototype, less than 2 m of rails’ length were enough to take-off. According to [20], with a larger wing loading the required take-off distance would still remain of the order of the aircraft’s wingspan, similarly to other AWE technologies which employ e.g. vertical take-off approaches, like Makani Power [7]. The second consideration is that there is quite some room for improvement of the controller, along the following (and possibly more) lines of further research: advanced multi-variable controllers taking into account the couplings among the aircraft’s modes; nonlinear control approaches; adaptive approaches based on the estimation of the wind conditions and on the aircraft’s angle of attack and sideslip; coordinated control of the aircraft and of the ground station; iterative learning approaches; improved/specialized aircraft design also considering the presence of the tether. As a final remark, we believe that the next major technical bottleneck for the considered AWE technology, on which future research efforts should be targeted, is the feasibility proof (theoretical and experimental) of an autonomous landing strategy with the same qualitative features as the take-off approach that we demonstrated in this paper, i.e. small required land area, low cost, repeatability and robustness. It may well be that the removal of such a bottleneck entails not only control technology, but also the development of new aircraft concepts specifically designed for this purpose. Acknowledgment The authors would like to thank Alessandro Lauriola and Stefan Schmidt for their helpful contributions during the project. References [1] U. Ahrens, M. Diehl, and R. Schmehl, Eds., Airborne Wind Energy. Berlin Heidelberg: Springer, 2013. [2] L. Fagiano and M. Milanese, “Airborne wind energy : an overview,” in Proceedings of the 2012 American Control Conference. Montréal, Canada: IEEE, June 2012, pp. 3132–3143. [3] M. L. Loyd, “Crosswind kite power,” Journal of Energy, vol. 4, no. 3, pp. 106–111, 1980. [4] A. Ilzhöfer, B. Houska, and M. Diehl, “Nonlinear MPC of kites under varying wind conditions for a new class of large-scale wind power generators,” International Journal of Robust and Nonlinear Control, vol. 17, no. 17, pp. 1590–1599, 2007. [5] L. Fagiano, M. Milanese, and D. Piga, “High-altitude wind power generation,” IEEE Transactions on Energy Conversion, vol. 25, no. 1, pp. 168–180, 2010. [Online]. Available: http://ieeexplore.ieee.org/xpls/abs_all.jsp? arnumber=5350676 [6] M. Canale, L. Fagiano, and M. Milanese, “High altitude wind energy generation using controlled power kites,” IEEE Transactions on Control Systems Technology, vol. 18, no. 2, pp. 279 –293, mar. 2010. [7] D. Vander Lind, “Analysis and flight test validation of high performance airborne wind turbines,” in Airborne Wind Energy. Berlin Heidelberg: Springer, 2013, ch. 28, pp. 473–490. [8] R. van der Vlugt, J. Peschel, and R. Schmehl, “Design and experimental characterization of a pumping kite power system,” in Airborne Wind Energy, U. Ahrens, M. Diehl, and R. Schmehl, Eds. Berlin Heidelberg: Springer, 2013, ch. 23, pp. 403–425. [9] C. Vermillion, T. Grunnagle, R. Lim, and I. Kolmanovsky, “Modeling, control design, and experimental validation of a prototype lighter-than-air wind energy system,” IEEE Transactions on Control Systems Technology, vol. 22, no. 2, pp. 531–542, 2014. 18 [10] M. Erhard and H. Strauch, “Flight control of tethered kites in autonomous pumping cycles for airborne wind energy,” Control Engineering Practice, vol. 40, pp. 13–26, 2015. [11] A. Zgraggen, L. Fagiano, and M. Morari, “Automatic retraction and full-cycle operation for a class of airborne wind energy generators,” IEEE Transactions on Control Systems Technology, vol. 24, no. 2, pp. 594–698, 2016. [12] R. Ruiterkamp and S. Sieberling, “Description and preliminary test results of a six degrees of freedom rigid wing pumping system,” in Airborne Wind Energy, U. Ahrens, M. Diehl, and R. Schmehl, Eds. Berlin Heidelberg: Springer, 2013, ch. 26, pp. 443–458. [13] L. Fagiano, A. U. Zgraggen, M. Morari, and M. Khammash, “Automatic crosswind flight of tethered wings for airborne wind energy: modeling, control design and experimental results,” IEEE Transactions on Control System Technology, vol. 22, no. 4, pp. 1433–1447, 2014. [14] U. Fechner, R. van der Vlugt, E. Schreuder, and R. Schmehl, “Dynamic model of a pumping kite power system,” Renewable Energy, 2015. [15] Ampyx Power website, http://www.ampyxpower.com/. [16] TwingTec website, http://www.twingtec.ch. [17] S. Gros, M. Zanon, and M. Diehl, “Control of airborne wind energy systems based on nonlinear model predictive control & moving horizon estimation,” in European Control Conference (ECC) 2013, Zuerich, Switzerland, July 2013, 2013, pp. 1017–1022. [18] E. Bontekoe, “Up! - how to launch and retrieve a tethered aircraft,” Master’s thesis, TU Delft, August 2010, accessed in August 2015 at http://repository.tudelft.nl/. [19] L. Fagiano, E. Nguyen Van, and S. Schnez, Linear Take-Off and Landing of a Rigid Aircraft for Airborne Wind Energy Extraction, ser. Green Energy and Technology. Springer Singapore, 2016, vol. Airborne Wind Energy, Advances in Technology Development and Research, iSBN 978-981-10-1947-0. [20] L. Fagiano and S. Schnez, “On the take-off of airborne wind energy systems based on rigid wings,” Submitted, available on arXiv:1510.06701v1. [21] M. Kruijff, “Preparing for a commercially viable awe system in the utility sector,” oral presentation at The International Airborne Wind Energy Conference 2015, available online: https://collegerama.tudelft.nl/Mediasite/Play/2e1f967767d541b1b1f2c912e8eff7df1d (last accessed 26 October 2105). [22] L. Fagiano, E. Nguyen-Van, F. Rager, S. Schnez, and C. Ohler, “A small-scale prototype to study the take-off of tethered rigid aircrafts for airborne wind energy,” Submitted. Preliminary version available on ArXiv e-prints: 1608.01846, vol. http://arxiv.org/abs/1608.01846, 2016, submitted. [23] SBG Systems. (2016) Ellipse-N navigation unit. [Online]. Available: http://www.sbg-systems.com/ [24] Arduino. (2016) Arduino MEGA 2560 board. [Online]. Available: ArduinoBoardMega2560 [25] B. Etkin, Dynamics of Atmospheric Flight. https://www.arduino.cc/en/Main/ Dover, 2005. [26] E. Nguyen-Van, L. Fagiano, and S. Schnez, “On the autonomous take-off and landing of tethered wings for airborne wind energy,” in American Control Conference 2016, Boston, MA, July 2016, pp. 4077–4082 [27] M. Erhard and H. Strauch, “Control of towing kites for seagoing vessels,” IEEE Transactions on Control Systems Technology, vol. 21, no. 5, pp. 1629–1640, 2012. [28] G. C. Goodwin, S. F. Graebe, and M. E. Salgado, Control System Design. 2001. Upper Saddle River, NJ: Prentice-Hall, [29] L. Fagiano, E. Nguyen-Van, F. Rager, S. Schnez, and C. Ohler, “Autonomous tethered take-off and flight for airborne wind energy - movie,” YouTube: https://www.youtube.com/watch?v=UPiTiHPXciE, March 2016. 19 (a) 500 450 400 Course angle (°) 350 300 250 200 150 100 50 0 0 20 40 60 80 100 Time (s) 120 140 160 180 120 140 160 180 120 140 160 180 (b) 60 40 Roll angle (°) 20 0 -20 -40 -60 0 20 40 60 80 100 Time (s) (c) 15 10 Aileron input (°) 5 0 -5 -10 -15 -20 0 20 40 60 80 100 Time (s) Figure 11: Experimental results corresponding to Fig. 10, turning dynamics. (a) Course angle γ (dashed) and its reference γref (solid) during tethered launch, climb and flight. (b) Roll angle ϕ (dashed) and its reference ϕref (solid) in the same test. (c) Aileron input uϕ . 20 (a) 60 Altitude from ground (m) 50 40 30 20 10 0 0 20 40 60 80 100 120 140 160 180 120 140 160 180 Time (s) (b) 50 40 Pitch angle (deg) 30 20 10 0 -10 -20 -30 0 20 40 60 80 100 Time (s) (c) Distance (m), spring compression (10 -2 m) 120 100 80 60 40 20 0 0 30 60 90 Time (s) 120 150 180 Figure 12: Experimental results corresponding to Fig. 10, pitch and altitude dynamics. (a) Courses of the reference altitude pZ,ref (dotted line) and the actual one, pZ (dashed). (b) Courses of the reference pitch angle θref (solid), and the actual one, θ (dash-dot). (c) Courses of the aircraft’s distance from the ground station, kpk2 (solid line), of the tether 21 slack tether length (dash-dotted). All plotted variables are length (dashed), of the spring compression (dotted) and of the −2 in m, except for the spring compression in 10 m. Speed (m/s) 16 12 8 4 0 0 20 40 60 80 100 Time (s) 120 140 160 180 20 40 60 80 100 Time (s) 120 140 160 180 Motor thrust (N) 20 16 12 8 4 0 0 Figure 13: Experimental results corresponding to Fig. 10, airspeed and motor thrust. Upper plot: courses of the reference airspeed va,ref (solid) and of the actual one, va (t) (dashed). Lower plot: propeller thrust um . 60 50 Altitude (m) 40 30 20 10 0 0 5 10 15 20 25 30 Time (s) 35 40 45 50 Figure 14: Experimental results of 14 overlayed tests. Course of the aircraft altitude. 22 47.589 Latitude (deg) 47.5888 47.5886 47.5884 47.5882 47.588 47.5878 8.197 8.1975 8.198 Longitude (deg) 8.1985 8.199 Figure 15: Experimental results of 14 overlayed tests. Aircraft position in GPS coordinates. The white dots correspond to position measurements down-sampled to 1 Hz. The ground station position is marked with ’◦’. The target points p I and p II are marked with ’4’. 47.5892 47.589 Latitude (deg) 47.5888 47.5886 47.5884 47.5882 47.588 8.197 8.1975 8.198 Longitude (deg) 8.1985 8.199 Figure 16: Experimental results of 14 overlayed tests. Aircraft position in GPS coordinates without the initial take-off and transition phases. The white dots correspond to position measurements down-sampled to 1 Hz. The ground station position is marked with ’◦’. The target points p I and p II are marked with ’4’. 23
3cs.SY
arXiv:1608.03137v1 [math.GR] 10 Aug 2016 On the structure of virtually nilpotent compact p-adic analytic groups Billy Woods August 11, 2016 Abstract Let G be a compact p-adic analytic group. We recall the well-understood finite radical ∆+ and FC-centre ∆, and introduce a p-adic analogue of Roseblade’s subgroup nio(G), the unique largest orbitally sound open normal subgroup of G. Further, when G is nilpotent-by-finite, we introduce the finite-by-(nilpotent p-valuable) radical FNp (G), an open characteristic subgroup of G contained in nio(G). By relating the already well-known theory of isolators with Lazard’s notion of p-saturations, we introduce the isolated lower central (resp. isolated derived) series of a nilpotent (resp. soluble) p-valuable group of finite rank, and use this to study the conjugation action of nio(G) on FNp (G). We emerge with a structure theorem for G, 1 ≤ ∆+ ≤ ∆ ≤ FNp (G) ≤ nio(G) ≤ G, in which the various quotients of this series of groups are well understood. This sheds light on the ideal structure of the Iwasawa algebras (i.e. the completed group rings kG) of such groups, and will be used in future work to study the prime ideals of these rings. 1 Contents 1 Preliminaries 7 2 The Roseblade subgroup nio(G) 12 3 p-saturations 16 4 Conjugation action of G 21 5 The finite-by-(nilpotent p-valuable) radical 24 2 Introduction We aim to study the structure of certain compact p-adic analytic groups G. This will crucially underpin later work in which we will explore the ring-theoretic properties of completed group rings kG, where k is a finite field of characteristic p and G is a nilpotent-by-finite compact p-adic analytic group. There is much in common between the theory of polycyclic-by-finite groups (and their group rings) and the theory of polyprocyclic-by-finite compact p-adic analytic groups (and their completed group rings). See [4] and [5], or the more recent survey paper by Ardakov and Brown [3], for an overview of the latter. It is known that ) (     compact p-adic uniform groups p-valuable groups analytic groups , ⊆ ⊆ [4, Definition 4.1] [5, III, 2.1.2] [4, Definition 8.14] with the first inclusion coming from [4, Definition 1.15; notes at end of chapter 4], and the second from [4, Corollary 8.34]. Note also that compact p-adic analytic groups G are profinite groups satisfying Max: every nonempty set of closed subgroups of G contains a maximal element. Indeed, in the case when G is p-valuable, this follows from [5, III, 3.1.7.5]; in the general case, G contains a uniform open normal subgroup U by [4, 8.34]. Indeed, [4, 8.34] implies that compact p-adic analytic groups are precisely extensions of uniform (or p-valuable) groups by finite groups. We aim eventually to extend some of the work of Roseblade [13] and Letzter and Lorenz [6] to the domain of compact p-adic analytic groups, building on work by Ardakov [2]. Our main results are as follows. Let G be a compact p-adic analytic group, and H a closed subgroup. Following Roseblade [13], we will say that H is orbital (or G-orbital ) if it only has finitely many G-conjugates, or equivalently if its normaliser NG (H) is open in G; and H is isolated orbital (or G-isolated orbital ) if H is orbital, and given any other closed orbital subgroup H ′ of G with H H ′ , we have [H ′ : H] = ∞. G is then said to be orbitally sound if all its isolated orbital closed subgroups are in fact normal. We define the Roseblade subgroup nio(G) = \ NG (H), H where this intersection is taken over all isolated orbital closed subgroups H of G. In section 2, we prove: Theorem A. Let G be a compact p-adic analytic group. Then nio(G) is an orbitally sound, open, characteristic subgroup of G, and contains all finite-bynilpotent closed normal subgroups of G. 3 Now let G be a p-valuable group. Ardakov shows, in [2, Lemma 8.4(a)], that the centre Z(G) is isolated orbital in G; we may then deduce from Lemma 1.5(i) that the usual upper central series 1 ≤ Z(G) ≤ Z2 (G) ≤ . . . of G as an abstract group consists of isolated orbital subgroups of G, so that any p-valuation on G naturally induces p-valuations on each Zi (G) and G/Zi (G). Unfortunately, in general, the (abstract) lower central series {γi } (or derived series {Di }) of G will not necessarily consist of isolated orbital subgroups, so G/γi (or G/Di ) will not necessarily remain p-valuable. In section 3, we introduce appropriate “isolated” analogues of these series for p-valuable groups: Theorem B. Let G be a p-valuable group. Then there exists a unique fastest descending series of isolated orbital closed normal subgroups of G, the isolated lower central series, G = G1 ✄ G2 ✄ . . . , with the properties that each Gi is characteristic in G, Gi /Gi+1 is abelian for each i, [Gi , Gj ] ≤ Gi+j for all i and j, and there exists some r with Gr = 1 if and only if G is nilpotent. There exists also a unique fastest descending series of isolated orbital closed normal subgroups of G, the isolated derived series, G = G(0) ✄ G(1) ✄ . . . , with the properties that each G(i) is characteristic in G, G(i) /G(i+1) is abelian for each i, and there exists some r with G(r) = 1 if and only if G is soluble. Now let G be a fixed compact p-adic analytic group. Define the two closed subgroups  ∆ = x ∈ G [G : CG (x)] < ∞ ,  ∆+ = x ∈ ∆ o(x) < ∞ , where o(x) denotes the order of x. We will show that we always have an inclusion of subgroups 1 ≤ ∆+ ≤ ∆ ≤ nio(G) ≤ G. Suppose further that G is a nilpotent-by-finite compact p-adic analytic group. Consider the set of finite-by-(nilpotent p-valuable) open normal subgroups H of G – that is, the set of open normal subgroups H that contain a finite normal subgroup F ✁ H, such that H/F is nilpotent and p-valuable. The main result of section 5 is: 4 Theorem C. This set contains a unique maximal element H, which is characteristic in G. There is an inclusion of subgroups ∆ ≤ H ≤ nio(G), and the quotient group nio(G)/H is isomorphic to a subgroup of the group of torsion units of Zp . We will denote this H by FNp (G), the finite-by-(nilpotent p-valuable) radical of G. Putting this together with the technical results of section 4, we can now understand the conjugation action of nio(G) on FNp (G): Theorem D. Let G be a nilpotent-by-finite compact p-adic analytic group, and H = FNp (G) its finite-by-(nilpotent p-valuable) radical. Write N = N1 ✄ N2 ✄ · · · ✄ Nr = 1 for the isolated lower central series of N = H/∆+ , and let Hi be the full preimage in G of Ni . Then nio(G)/H is isomorphic to a subgroup of t(Z× p ), the group of torsion units of Zp , and so is cyclic; let a be a preimage in nio(G) of a generator of nio(G)/H. Then conjugation by a acts on each Hi , and hence induces an action on the (free, finite-rank) Zp -modules Hi /Hi+1 = Ai . In a ζi multiplicative notation, there is some scalar ζ ∈ t(Z× for p ) such that x = x all x ∈ Ai . Putting these ingredients together allows us to understand the structure of a nilpotent-by-finite compact p-adic analytic group G, which, for convenience, we display in the following diagram. 5 G nio(G) .t(Z× p ) H1  a: ζ H 1∼ Zd p =A1 H2 .. . nilpotent, p-valuable Hr−1  a: ζ r−1 d Zpr−1 ∼ =Ar−1 ∆+ Hr 1 6 1 Preliminaries Definition 1.1. Let G be a profinite group. A closed subgroup H of G is Gorbital (or just orbital, when the group G is clear from context) if H has only finitely many G-conjugates, i.e. if NG (H) is open in G. Similarly, an element x ∈ G is orbital if [G : CG (x)] < ∞. Remark. Note that, if G is compact p-adic analytic, it is profinite (by [4, 8.34]). Definition 1.2. The FC-centre ∆(G) of an arbitrary group G is the subgroup of all orbital elements of G. The finite radical ∆+ (G) of G is the subgroup of all torsion orbital elements of G. Remark. Throughout this paper, we will write as shorthand ∆+ = ∆+ (G) and ∆ = ∆(G). Also throughout this paper, all subgroups will be closed, all homomorphisms continuous, etc. unless otherwise specified. Lemma 1.3. Let G be a compact p-adic analytic group. For convenience, we record a few basic properties of ∆ and ∆+ . (i) ∆+ is finite. (ii) If H is an open subgroup of G, then ∆+ (H) ≤ ∆+ (G) and ∆(H) ≤ ∆(G). (iii) When G is compact p-adic analytic, ∆+ and ∆ are closed in G. (iv) ∆+ and ∆ are characteristic subgroups of G. (v) ∆/∆+ is a torsion-free abelian group. Proof. (i) ∆+ is generated by the finite normal subgroups of G [11, 5.1(iii)]. It is obvious that the compositum of two finite normal subgroups is again finite and normal. Now suppose that ∆+ is infinite, and take an open uniform subgroup H of G [4, 4.3]: then ∆+ ∩ H is non-trivial, and so we must have some finite normal subgroup F with F ∩ H non-trivial. But F is torsion, so this contradicts the fact that H is torsion-free [4, 4.5]. (ii) If an element x ∈ H has finitely many H-conjugates, and H has finite index in G, then x has finitely many G-conjugates. (iii) ∆+ is closed because it is finite. For the case of ∆, suppose first that G is p-valued [5, III, 2.1.2]. Now, any orbital x ∈ G has CG (x) open in G, and so, for any g ∈ G, there n n n exists some n with g p ∈ CG (x), i.e. g p x = xg p . This implies that x pn pn x (g ) = g , and so by [5, III, 2.1.4], we get g = g. Hence CG (x) = G. In other words, ∆ = Z(G), which is closed in G. When G is not p-valued, it still has an open p-valued subgroup N [4, 4.3]. Clearly ∆(N ) = ∆(G) ∩ N , and so [∆(G) : ∆(N )] ≤ [G : N ] < ∞. So 7 ∆(G) is a finite union of translates of Z(N ), which is closed in N and hence closed in G. (iv) See [10, discussion after lemma 4.1.2 and lemma 4.1.6]. (v) See [10, lemma 4.1.6]. Throughout the remainder of this subsection, G is a profinite group unless stated otherwise. Definition 1.4. An orbital closed subgroup H of G is isolated if, for all orbital closed subgroups H ′ of G with H H ′ ≤ G, we have [H ′ : H] = ∞. (We will sometimes say that a closed subgroup is G-isolated orbital as shorthand for isolated as an orbital closed subgroup of G.) Following Passman [11, definition 19.1], if all isolated orbital closed subgroups of G are in fact normal, we shall say that G is orbitally sound. We record a few basic properties, before showing that this definition is the same as the one given in [13, 1.3] and [2, 5.8] (in Lemma 1.10 below). Lemma 1.5. Let N be a closed normal subgroup of G. (i) Suppose H is a closed subgroup of G containing N . Then H/N is (G/N )orbital if and only if H is G-orbital; and H/N is (G/N )-isolated orbital if and only if H is G-isolated orbital. (ii) Suppose G is orbitally sound. Then G/N is orbitally sound. (iii) Suppose N is finite and G/N is orbitally sound. Then G is orbitally sound. Proof. (i) It is easily checked that NG/N (H/N ) = NG (H)/N , and so [G : NG (H)] = [G/N : NG (H)/N ] = [G/N : NG/N (H/N )]. So H is orbital if and only if H/N is orbital. Suppose these two groups are both orbital, and let H ′ be an orbital closed subgroup of G with H H ′ ≤ G: then [H ′ : H] = [H ′ /N : H/N ], so H is isolated if and only if H ′ is isolated. (ii) Let H/N be an isolated orbital closed subgroup of G/N . Then, by (i), H is an isolated orbital subgroup of G, so H ✁ G, and so H/N ✁ G/N . (iii) Let H be an isolated orbital closed subgroup of G, and H ′ an orbital closed subgroup of G with H H ′ ≤ G. If H contains N , then we ′ may apply (i) to show that [H : H] = [H ′ /N : H/N ] = ∞ as G/N is orbitally sound. But H must contain N : indeed, as H is G-orbital, clearly HN/N is G/N -orbital, and so, by (i), HN is G-orbital. But N is finite, so [HN : H] < ∞, and H is isolated, so H = HN . 8 From now on, we assume that G is a profinite group satisfying the maximum condition on closed subgroups: every nonempty set of closed subgroups of G has a maximal element. Remark. Note that, if G is compact p-adic analytic, it satisfies the maximum condition on closed subgroups. Indeed, this is true for p-valuable G by [5, III, 3.1.7.5], and hence true for any compact p-adic analytic group G, as G contains a uniform (hence p-valuable) subgroup of finite index [4, 8.34]. Definition 1.6. If H is an orbital closed subgroup of G, we define its isolator iG (H) in G to be the closed subgroup of G generated by all orbital closed subgroups L of G containing H as an open subgroup, i.e. with [L : H] < ∞. Once we have proved that iG (H) is indeed an isolated orbital closed subgroup of G containing H as an open subgroup, it will be clear from the definition that it is the unique such closed subgroup. We now prove some basic properties of iG (H), following [11]. Proposition 1.7. Suppose H is an orbital closed subgroup of G. Then H is open in iG (H). Proof. We first show that, if L1 and L2 are orbital subgroups of G T containing H as an open subgroup, then [hL1 , L2 i : H] < ∞. Write (−)◦ for g∈G (−)g . Suppose without loss of generality that G = hL1 , L2 i, and that H ◦ = 1 (by passing to G/H ◦ ). For i = 1, 2, as [Li : H] < ∞ and as H, Li are all orbital, we may take an open normal subgroup N of G such that [N, Li ] ⊆ H. Indeed, NG (Li ) is a subgroup of finite index in G, and permutes the (finitely many) left cosets of H in Li by left multiplication; take Ni to be the kernel of this action, and set N = N1 ∩ N2 . Hence [N ∩ H, Li ] ⊆ N ∩ H, i.e. both L1 and L2 normalise N ∩ H, so G normalises N ∩ H. So N ∩ H is a normal subgroup of G contained in H, and by assumption must be trivial. But N was an open subgroup of G, so H must have been finite, and so L1 and L2 must be finite orbital subgroups of G. This implies that Li ≤ ∆+ , and hence G = ∆+ , so that G is finite, as required. Now, in the general case, G satisfies the maximal condition on closed subgroups, so we can choose L maximal subject to L being orbital and [L : H] < ∞. This L is iG (H) and contains H as an open subgroup. Lemma 1.8. (i) Suppose H is an orbital closed subgroup of G. Then iG (H) is an isolated orbital closed subgroup of G. Furthermore, if H is normal in G, then so is iG (H). (ii) Suppose G is orbitally sound and H is a closed subgroup of finite index. Then H is orbitally sound. 9 Proof. (i) If iG (H) is orbital, then by Proposition 1.7, it is isolated (by construction). But H has finite index in iG (H), so iG (H) must be generated by a finite number of subgroups L1 , . . . , Ln containing H as a subgroup of finite index. So n \ NG (Li ) ≤ NG (iG (H)), i=1 and as each NG (Li ) is open in G, so is NG (iG (H)). Now suppose that H is normal in G. To see that iG (H) is normal in G, fix g ∈ G, and note that conjugation by g fixes H and therefore simply permutes the set of orbital closed subgroups L of G containing H as an open subgroup, i.e. permutes the set of subgroups of G that generate iG (H) (see Definition 1.6). (ii) Let K be an isolated H-orbital closed subgroup of H. Then K is G-orbital, so iG (K) is an isolated orbital subgroup of G, and so is normal in G. Hence iG (K)∩H is normal in H. But [iG (K) : K] < ∞, so [iG (K)∩H : K] < ∞, and hence iG (K) ∩ H = K, as K was assumed to be isolated in H. Lemma 1.9. Let H be an open normal subgroup of G. Then there is a oneto-one correspondence o n o n isolated orbital isolated orbital oo // closed subgroups of G closed subgroups of H ′ ✤ // iH (G′ ∩ H), G ✤ ′ iG (H ′ ) oo H. Proof. Suppose first that H ′ is an arbitrary orbital closed subgroup of H. That is, NH (H ′ ) is open in H, hence also in G, and so NG (H ′ ) must be open in G. Therefore H ′ is also G-orbital, and so, by Lemma 1.8(i), iG (H ′ ) is an isolated orbital closed subgroup of G. Conversely, take a G-isolated orbital closed subgroup G′ : then NG (G′ ) is open in G, as G′ is G-orbital, which implies that NH (G′ ∩ H) is open in H, i.e. that G′ ∩ H is H-orbital. Now iH (G′ ∩ H) is H-isolated orbital by Lemma 1.8(i). Now we will show that these correspondences are mutually inverse. In one direction, we must take H ′ as above, assume further that it is H-isolated orbital, and show that iH (iG (H ′ ) ∩ H) = H ′ . To do this, note that iG (H ′ ) contains H ′ as an open subgroup by Proposition 1.7, so iG (H ′ ) ∩ H is an Horbital closed subgroup (by the correspondence above) containing the H-isolated orbital H ′ as an open subgroup, and so by definition the two must be equal. For the converse direction, we must take G′ as above and show that iG (iH (G′ ∩H)) is equal to G′ . But clearly iG iH = iG , and both G′ and iG (G′ ∩H) are G-isolated 10 orbital (G′ by assumption, iG (G′ ∩ H) by definition) and contain G′ ∩ H as an open subgroup, so by uniqueness (see Definition 1.6), they are equal. Lemma 1.10. The following are equivalent: (i) Any isolated orbital closed subgroup H of G is normal. (ii) Any orbital closed subgroup K of G contains a subgroup N of finite index in K which is normal in G. Proof. (i) ⇒ (ii) Let K be an orbital closed subgroup of G. By Lemma 1.8(i), iG (K) is an isolated orbital closed subgroup of G, and so (by assumption) is normal in G. Therefore, as it contains K as a subgroup of finite index (by Proposition 1.7), it must contain each conjugate K g (for any g ∈ G) as a subgroup of finite index. But as K is G-orbital, it only has finitely many G-conjugates, and so their intersection K ◦ still has finite index in iG (K) and hence also in K, and K ◦ is normal in G by construction. (ii) ⇒ (i) Let H be an isolated orbital closed subgroup of G, and write H ◦ for the largest normal subgroup of G contained in H, which by (ii) must have finite index in H. Now clearly H ≤ iG (H ◦ ) by definition of iG (H ◦ ), but also iG (H ◦ ) ≤ H as H is isolated and contains H ◦ . So H is the G-isolator of a normal subgroup, and so by Lemma 1.8(i), H is also normal in G. 11 2 The Roseblade subgroup nio(G) We begin this section by remarking that “orbitally sound” is not too restrictive a condition. Recall: Lemma 2.1. Let G be a p-valuable group. Then G is orbitally sound. Proof. This is [2, Proposition 5.9], after remarking that the definitions of “orbitally sound” given in Definition 1.4 and in [2, 5.8] are equivalent by Lemma 1.10. The following two lemmas will allow us to find a large class of orbitally sound groups. For the next lemma, fix the following notation. Let G be a compact h i p-adic analytic group, and consider its Qp -Iwasawa algebra Qp G := (Zp G) p1 . Write I for its augmentation ideal I = ker(Qp G → Qp ). Recall that I k is generated over Qp G by {(x1 − 1) . . . (xk − 1) xi ∈ G}. Now it is clear that G acts unipotently on the series Qp G > I > I 2 > I 3 > . . . , i.e. for all g ∈ G, we have (g − 1)Qp G ⊆ I and (g − 1)I k ⊆ I k+1 . Write also Un for the subgroup of GLn (Qp ) consisting of upper triangular unipotent matrices. Lemma 2.2. Write Dk = ker(G → (Qp G/I k )× ), the k-th rational dimension subgroup of G, for all k ≥ 1. Then the Dk are a descending chain of isolated orbital closed normal subgroups of G. This chain eventually stabilises: that is, there exists some t such that Dn = Dt for all n ≥ t. Furthermore, if G is torsion-free and nilpotent, Dt = 1, and G is isomorphic to a closed subgroup of Um for some m. Proof. By definition, it is clear that the Dk are closed normal (hence orbital) subgroups of G; to show that they are isolated orbital, we will show that each G/Dk is torsion-free. Fix k. Consider the series of finite-dimensional Qp -vector spaces Qp G/I k > I/I k > I 2 /I k > I 3 /I k > · · · > I k /I k , 12 and choose a basis for Qp G/I k which is filtered relative to this series: i.e. by repeatedly extending a basis for I r /I k to a basis for I r−1 /I k , we get a basis B = {e1 , . . . , er } and integers 0 = nk < nk−1 < nk−2 < · · · < n1 < n0 = r with the property that {e1 , . . . , enr } is a basis for I r /I k for each 0 ≤ r ≤ k (where we write I 0 = Qp G for convenience). As G acts unipotently (by left multiplication) on Qp G/I k , and by definition of the basis B, we see that with respect to B, each g ∈ G acts by a unipotent uppertriangular matrix, i.e. we get a continuous group homomorphism G → Ur . Now Dk is just the kernel of this map; but Ur is torsion-free, so Dk must be isolated. Recall the dimension dim H of a pro-p group H of finite rank from [4, 4.7]. As G has finite rank, it also has finite dimension [4, 3.11, 3.12], and we must have dim Di ≥ dim Di+1 for all i by [4, 4.8]. But if dim Di = dim Di+1 , then Di /Di+1 is a p-valued group (as Di+1 is isolated) of dimension 0 (again by [4, 4.8]), and so must be trivial. Hence the sequence (Di ) stabilises after at most t := 1 + dim G terms, and so \ Dt = Dn . n≥1 Now suppose that G is nilpotent. Then, by [1, Theorem A], it follows that I is localisable. Let R = (Qp G)I be its localisation, and J(R) = m its unique maximal ideal: then the ideal \ A= mn n≥1 satisfies A = mA, so by Nakayama’s lemma [7, 0.3.10], we must have A = 0. This implies that \ I n ⊆ ker(Qp G → R). n≥1 Assuming further that G is torsion-free, we see that Qp G is a domain [9, Theorem 1], and so the localisation map Qp G → R is injective. Hence ∩n≥1 I n = 0, and so     \ \ \ Dt = Dn =  (I n + 1) ∩ G ⊆  I n  + 1 = 1. n≥1 n≥1 n≥1 Now the representation G → Aut(Qp G/I t ) ∼ = GLm (Qp ) is faithful and has image in Um . Lemma 2.3. Let G be a (topologically) finitely generated nilpotent pro-p group. Then G is p-valuable if and only if it is torsion-free. 13 Proof. Lemma 2.2 gives an injective map G → Um . Now, as G is topologically finitely generated, its image in Um must lie inside the set p1t Mm (Zp ) ∩ Um for some t. Hence, by conjugating by the diagonal element diag(p, p2 , . . . , pm )t+ε ∈ GLm (Qp ), where ε= ( 1 2 p > 2, p = 2, we see that G is isomorphic to a subgroup of  Γε = γ ∈ GLm (Zp ) γ ≡ 1(mod pε ) , the εth congruence subgroup of GLm (Zp ), which is uniform (and hence pvaluable) by [4, Theorem 5.2]. The reverse implication is clear from the definition of a p-valuation [5, III, 2.1.2]. Now we have found a large class of orbitally sound compact p-adic analytic groups. Corollary 2.4. If G is a finite-by-nilpotent compact p-adic analytic group, then it is orbitally sound. Proof. G := G/∆+ must be a nilpotent compact p-adic analytic group with ∆+ (G) = 1, and so G is torsion-free by [12, 5.2.7]. Now Lemma 2.3 shows that G is p-valuable, and from Lemma 2.1 we may deduce that G is orbitally sound. But now Lemma 1.5(iii) implies that G is orbitally sound. Remark. It is well known that finite-by-nilpotent implies nilpotent-by-finite, but not conversely. Not all nilpotent-by-finite compact p-adic analytic groups are orbitally sound: indeed, the wreath product G = Zp ≀ C2 = (Zp × Zp ) ⋊ C2 is abelian-by-finite, and the infinite procyclic subgroup H = Zp × {0} is orbital, but the largest G-normal subgroup contained in H is the trivial subgroup. We can now define the Roseblade subgroup. Definition 2.5. As in Roseblade [13, 1.3], write nio(G) for the closed subgroup of G defined by \ nio(G) = NG (H), H where the intersection ranges over the isolated orbital closed subgroups H of G. Theorem 2.6. Let G be a compact p-adic analytic group. 14 (i) An orbitally sound open normal subgroup N ✁ G normalises every closed isolated orbital subgroup H ≤ G. (ii) nio(G) is an orbitally sound open characteristic subgroup of G. Proof. (i) Since H is isolated orbital in G, we must have that H ∩ N is isolated orbital (and hence normal) in N . However, it follows from Proposition 1.7 that H = iG (H ∩ N ). Hence H is generated by all the (finitely many) closed orbital subgroups L1 , . . . , Lk of G containing H ∩ N as a subgroup of finite index. Conjugation by n ∈ N permutes these Li , and so fixes H. (ii) Let N be a complete p-valued open normal subgroup of G (e.g. by [4, 8.34]). Then [2, Proposition 5.9] shows that N is orbitally sound, and hence by (i) N normalises all closed isolated orbital subgroups of G. So, by definition, N ≤ nio(G), and so [G : nio(G)] ≤ [G : N ] < ∞. Therefore nio(G) is open in G as required. But by definition, nio(G) is the largest subgroup that normalises all isolated orbital subgroups of G, so by the correspondence of Lemma 1.9 and Lemma 1.8(i), it normalises all isolated orbital subgroups of nio(G), i.e. it is orbitally sound. Proof of Theorem A. It is clear from Definition 2.5 and Theorem 2.6(i), (ii) that nio(G) is the unique maximal orbitally sound closed normal subgroup of G, and is hence characteristic in G. Corollary 2.4, together with Fitting’s theorem [14, 1B, Proposition 15], implies that it contains all finite-by-nilpotent closed normal subgroups. 15 3 p-saturations Recall [5, III, 2.1.2] that a p-valuation of a group G is a function ω : G → R ∪ {∞} satisfying the following properties: • ω(x) = ∞ if and only if x = 1, • ω(x) > (p − 1)−1 , • ω(x−1 y) ≥ inf{ω(x), ω(y)}, • ω([x, y]) ≥ ω(x) + ω(y), • ω(xp ) = ω(x) + 1, for all x, y ∈ G. The group G, when endowed with the p-valuation ω, is called p-valued. On the other hand, a group G is called p-valuable [5, III, 3.1.6] if there exists a p-valuation ω of G with respect to which G is complete of finite rank. Let G be a p-valuable group, and fix a p-valuation ω on G, so that G is complete p-valued of finite rank. Recall the definition of the p-saturation Sat G of G (with respect to ω) from [5, IV, 3.3.1.1]: this is again a complete p-valued group of finite rank, and there is a natural isometry identifying G with an open subgroup of Sat G [5, IV, 3.3.2.1]. We will prove a few basic facts about p-saturations. Firstly, we will prove a basic relationship between isolators and p-saturations. Lemma 3.1. Let G be a complete p-valued group of finite rank, and let H be a closed normal (and hence orbital) subgroup of G. Then iG (H) = Sat H ∩ G (considered as subgroups of Sat G). Proof. [Sat H : H] < ∞ by [5, IV, 3.4.1], and Sat H is a closed normal subgroup of Sat G by [5, IV, 3.3.3], so S := Sat H ∩ G is a normal (and hence orbital) subgroup of G, and contains H as a subgroup of finite index. Hence, by Definition 1.6, S is contained in iG (H). To show the reverse inclusion, we will consider the group iG (H)/S, which is a finite subgroup of G/S (as it is a quotient of iG (H)/H, which is finite by Proposition 1.7). But G/S is isomorphic to GSat H/Sat H, a subgroup of the torsion-free group Sat G/Sat H (see [5, IV, 3.4.2] or [5, III, 3.3.2.4]). In particular, G/S has no non-trivial finite subgroups, so we must have iG (H) = S. Remark. Of course, iG (H) is independent of the choice of ω. Lemma 3.2. Let G be a complete p-valued group of finite rank, which we again identify with an open subgroup of its p-saturation S. Suppose S ′ is a p-saturated closed normal subgroup of S, and set G′ = S ′ ∩ G. Then there is a natural isometry S/S ′ ∼ = Sat (G/G′ ). 16 Proof. We will show that S/S ′ satisfies the universal property for Sat (G/G′ ) [5, IV, 3.3.2.4]. Clearly we may regard G/G′ ∼ = GS ′ /S ′ as a subgroup of S/S ′ . Note ′ also that S/S is p-saturated, by [5, III, 3.3.2.4]. Also, as G′ is open in S ′ and S ′ is p-saturated, we have that S ′ = Sat G′ . Let H be an arbitrary p-saturated group and ϕ : G/G′ → H a homomorphism of p-valued groups. We must first construct a map ψ : S/S ′ → H. To do this, we first compose ϕ with the natural surjection G → G/G′ to get a map α : G → H, which we may then extend uniquely to a map β : S → H using the universal property of S = Sat G, so that α = β|G and the following diagram commutes. α G _  S // // G/G′ ϕ //&& H ;; β Now we wish to show that β descends to a map S/S ′ → H. To do this, we first study the restriction of α to G′ and of β to S ′ . The following diagram commutes: α|G′ // H G′ _ >> ⑥⑥ ⑥ ⑥ ⑥⑥  ⑥⑥ β|S′ S′ and so, since S ′ = Sat G′ , β|S ′ must be the unique extension of α|G′ to a map S ′ → H, as S ′ = Sat G′ . But α factors through G/G′ , i.e. α|G′ is the trivial homomorphism G′ → H, so it extends to the trivial homomorphism S ′ → H. By uniqueness, we must have S ′ ⊆ ker β. This shows that β induces a map ψ : S/S ′ → H. Finally, suppose ϕ : G/G′ → H has two distinct extensions ψ1 , ψ2 : S/S ′ → H. Then we may compose them with the natural surjection S → S/S ′ to get two distinct maps β1 , β2 : S → H. Their restrictions α1 , α2 : G → H to G must therefore also be distinct, for if not, then the map α1 = α2 : G → H has (at least) two distinct extensions to maps S → H, contradicting the universal property of S = Sat G. Finally, if α1 and α2 are distinct, then they descend to distinct maps ϕ1 , ϕ2 : G/G′ → H, contradicting our assumption. So the extension of ϕ to ψ is unique. Remark. Lemma 3.2 holds even if G does not have finite rank, and hence is only closed (not necessarily open) in its p-saturation S. Definition 3.3. Let G be an arbitrary group. A central series for G is a sequence of subgroups G = G1 ✄ G2 ✄ · · · ✄ Gn = 1 17 with the property that [G, Gi ] ≤ Gi+1 for each i. (For the purposes of this definition, Gj is understood to mean 1 if j > n, and G if j < 1.) We will say that a central series is strongly central if also [Gi , Gj ] ≤ Gi+j for all i and j. An abelian series for G a sequence of subgroups G = G1 ✄ G2 ✄ · · · ✄ Gn = 1 with the property that [Gi , Gi ] ≤ Gi+1 for each i. When G is a topological group, we will insist further that all of the Gi should be closed subgroups of G. Remark. We will be working with nilpotent p-valuable groups G. It will be useful for us to define the isolated lower central series of G, which will turn out to be the fastest descending central series of closed subgroups G = G1 ✄ G2 ✄ · · · ✄ Gr = 1 with the property that the successive quotients Gi /Gi+1 are torsion-free (and hence p-valuable, by [5, IV, 3.4.2]). We will also prove that the isolated lower central series is a strongly central series. (We demonstrate an isolated derived series for soluble p-valued groups at the same time.) Lemma 3.4. Let G be a complete p-valued group of finite rank, and G1 ≥ G2 closed normal subgroups of G with G1 /G2 an abelian pro-p group (which is not necessarily p-valued). Let Si = Sat Gi for i = 1, 2. Then S1 /S2 is abelian and torsion-free (and hence p-valued), and has the same rank as G1 /G2 as a Zp -module. Proof. As S2 is p-saturated, S1 /S2 is torsion-free, and so G1 /(S2 ∩ G1 ) ∼ = G1 S2 /S2 ≤ S1 /S2 is torsion-free. G1 /G2 maps onto G1 /(S2 ∩G1 ) with finite kernel (by Lemma 3.1 and Proposition 1.7, and the assumption that G has finite rank), so G1 /(S2 ∩G1 ) is abelian of the same Zp -rank as G1 /G2 . By Lemma 3.2, S1 /S2 is the psaturation of G1 /(S2 ∩ G1 ), so is still abelian of the same Zp -rank. Before proving the main result of this section, we first need a technical lemma. Lemma 3.5. Let G be a complete p-valued group of finite rank, and let H and N be two closed normal subgroups. Then [iG (H), iG (N )] ≤ iG ([H, N ]). Proof. Write L := iG ([H, N ]). This is normal in G, as G is orbitally sound [2, 5.9], and the quotient G/L is still p-valued as it is torsion-free [5, IV, 3.4.2]. 18 Suppose first that L = 1, so that [H, N ] = 1. Then, for any h ∈ iG (H), there is n n some integer n such that hp ∈ H, so that [g, hp ] = 1 for all g ∈ N . But this pn g pn is the same as saying that h = (h ) ; and, as G is p-valued, [5, III, 2.1.4] implies that h = hg . As g and h were arbitrary, we see that [iG (H), N ] = 1. Repeat this argument for N to show that [iG (H), iG (N )] = 1. If L 6= 1, we may pass to G/L. Write π : G → G/L for the natural surjection, so that  π [iG (H), iG (N )] = [π(iG (H)), π(iG (N ))]. (1) Now, π(H) is a closed orbital subgroup of π(G), and π(iG (H)) is a closed orbital subgroup of π(G) containing π(H) as an open subgroup, so that iπ(G) (π(H)) ≥ π(iG (H)), and similarly for N . Together with (1), this implies that  π [iG (H), iG (N )] ≤ [iπ(G) (π(H)), iπ(G) (π(N ))]. But the right-hand side is now equal to π(1), by the previous case, which shows that [iG (H), iG (N )] ≤ L as required. Corollary 3.6. Let G be a p-valuable ( group. Define two series: γ1 = G, Gi = iG (γi ), where γi+1 = [γi , G] for i ≥ 1; (i) G = iG (Di ), where ( D0 = G, Di+1 = [Di , Di ] for i ≥ 0, where the bars denote topological closure inside G. If G is nilpotent, then (Gi ) is a strongly central series for G, i.e. a central series in which [Gi , Gj ] ≤ Gi+j . If G is soluble, then (G(i) ) is an abelian series for G. The quotients Gi /Gi+1 and G(i) /G(i+1) are torsion-free, and hence p-valuable. Remark. We prove this using p-saturations, but the resulting closed subgroups Gi and G(i) are independent of the choice of p-valuation ω on G. The series (G(i) ) above is a generalisation of the series studied in [8, proof of lemma 2.2.1], there called (Gi ). Proof. Fix a p-valuation ω on G throughout. Firstly, we will show that (Gi ) is an abelian series. The claim that (G(i) ) is an abelian series will follow by an identical argument. The (abstract) lower central series (γi ) is an abelian series for G as an abstract group (i.e. the subgroups γi are not necessarily closed in G), and so the series (γi ) is a series of closed normal subgroups of G, which is still an abelian series by continuity. Now, applying Lemma 3.4 shows that (Sat γi ) is also an abelian 19 series; and by Lemma 3.1, we see that Gi = Sat γi ∩ G for each i, so that (Gi ) is an abelian series. Secondly, we address the claim that the quotients Gi /Gi+1 are torsion-free and hence p-valuable: this follows from [5, III, 3.1.7.6 / IV, 3.4.2], as the Gi+1 are isolated in G. The case of the quotients G(i) /G(i+1) is again identical. Thirdly, we must show that Gi−1 /Gi is central in G/Gi . Certainly γi−1 Gi /Gi is central in G/Gi , because γi ≤ Gi , and so γi−1 Gi /Gi ≤ Z(G/Gi ) by continuity. However, [2, lemma 8.4(a)] says that Z(G/Gi ) is isolated in G/Gi , so by taking (G/Gi )-isolators of both sides, we must have  iG/Gi γi−1 Gi /Gi ≤ Z(G/Gi ); and the left-hand side is clearly equal to Gi−1 /Gi by Lemma 1.5(i) and Definition 1.6. Finally, note that [γi , γj ] ≤ γi+j by [12, 5.1.11(i)], and so by taking closures, [γi , γj ] ≤ γi+j . But [γi , γj ] ≤ [γi , γj ], as the function G × G → G given by (a, b) 7→ [a, b] is continuous. Hence [γi , γj ] ≤ γi+j , which implies [γi , γj ] ≤ γi+j , and so, by Lemma 3.5, we may take isolators to show that   [iG (γi ), iG (γj )] ≤ iG [γi , γj ] ≤ iG (γi+j ), i.e. [Gi , Gj ] ≤ Gi+j . Definition 3.7. When G is a nilpotent (resp. soluble) p-valued group of finite rank, the series (Gi ) (resp. (G(i) )) defined in Corollary 3.6 is the isolated lower central series (resp. isolated derived series) of G. Proof of Theorem B. This is the content of Corollary 3.6. 20 4 Conjugation action of G In this subsection, we will study how nilpotent-by-finite compact p-adic analytic groups G act by conjugation on certain torsion-free abelian and nilpotent subquotients. First, we slightly extend the term “orbitally sound”. Definition 4.1. Let G and H be profinite groups, and suppose G acts (continuously) on H. Then G permutes the closed subgroups of H. We say that the action of G on H is orbitally sound if, for any closed subgroup K of H with finite G-orbit, there exists an open subgroup K ′ of K which is normalised by G. Recall the group of torsion units of Zp : ( {±1} p = 2 × t(Zp ) = F× p > 2. p Lemma 4.2. Let A be a free abelian pro-p group of finite rank. Let G be a profinite group acting orbitally soundly and by automorphisms of finite order on M . Then, for each g ∈ G, there exists ζ = ζg ∈ t(Z× p) such that g · x = ζx for all x ∈ A. This is multiplicative in G, in the sense that ζg ζh = ζgh for all g, h ∈ G. Proof. Write ϕ for the automorphism of A given by conjugation by g. We may view ϕ as an automorphism of the Qp -vector space AQp := A ⊗ Qp . Zp As the action of G on A is orbitally sound, in particular, we have hxi ∩ hϕ(x)i = 6 {0} (as Qp -vector subspaces) for every x ∈ AQp . But this just means that x is an eigenvector of the linear map ϕ. If all elements of AQp are eigenvectors of ϕ, then they must have a common eigenvalue, say ζ. The statement that G acts on A by automorphisms of finite order means that the eigenvalue ζ for x is of finite order, ζ ∈ t(Z× p ). Multiplicativity is clear from the fact that (gh)·x = g ·(h·x) for all g, h ∈ G. Remark. Assume that G is a nilpotent-by-finite, orbitally sound compact p-adic analytic group. In the case when H is an open subgroup of G containing ∆+ , with the property that N := H/∆+ is nilpotent p-valuable, we may consider the isolated lower central series of Corollary 3.6 for N : N = N1 ✄ N2 ✄ · · · ✄ Nr = 1, 21 and take their preimages in G to get a series of characteristic subgroups of H: H = H1 ✄ H2 ✄ · · · ✄ Hr = ∆+ , with the property that each Ai := Hi /Hi+1 is a free abelian pro-p group of finite rank. G clearly acts orbitally soundly on each Ai , as G is itself orbitally sound. Furthermore, as [H, Hi ] ≤ Hi+1 for each i, we see that the action G → Aut(Ai ) contains the open subgroup H in its kernel, and so G acts by automorphisms of finite order. Thus we may apply Lemma 4.2 to see that G acts on each Ai via a homomorphism ξi : G → t(Z× p ). That is, given any g ∈ G and h ∈ Hi , and writing ζ = ξi (g) and a = nNi+1 ∈ Ai , we have (ng )n−ζ ∈ Ni+1 , or equivalently (still in multiplicative notation) ag = aζ . We now show that the action of an automorphism of G on the quotients Ai is strongly controlled by its action on A1 . This is an important property that the isolated lower central series shares with the usual lower central series of abstract nilpotent groups; cf. [12, 5.2.5] and the surrounding discussion. Lemma 4.3. Let H be a finite-by-(nilpotent p-valuable) group, and continue to write Ai := Hi /Hi+1 as in the remark above. Let α be an automorphism of i H inducing multiplication by ζi ∈ t(Z× p ) on each Ai . Then ζi = ζ1 for each i. Proof. The map A1 ⊗ Ai → Ai+1 Zp xH2 ⊗ yHi+1 7→ [x, y]Hi+2 is a Zp hαi-module homomorphism, and its image is open in Ai+1 (by definition of the isolated lower central series). Write ζ1 = ζ, and proceed by induction on i: suppose that ζi = ζ i . Now, for any positive integers a and b, we have [xa , y b ]Hi+2 = [x, y]ab Hi+2 by [4, 0.2(i), (ii)] and by using the fact that [x, y]Hi+2 is central in H/Hi+2 . Hence, by continuity, this is true for any a, b ∈ Zp , and so i α([x, y]Hi+2 ) = [xζ , y ζ ]Hi+2 = [x, y]ζ We deduce: 22 i+1 Hi+2 . Corollary 4.4. Let G be a nilpotent-by-finite, orbitally sound compact p-adic analytic group, and H an open normal subgroup of G containing ∆+ such that H/∆+ is nilpotent p-valuable. Then the conjugation action of G on H induces an action of G on H/H2 given by the map ξ1 : G → t(Z× p ) ≤ Aut(H/H2 ) defined above. Moreover, H ≤ ker ξ1 . Remark. If N = H/∆+ is p-saturable, we may take its corresponding Lie algebra L by Lazard’s isomorphism of categories [5, IV, 3.2.6]. As in [2, proof of lemma 8.5]: using [2, lemma 4.2] and the fact that the N/Ni are torsion-free, we can pick an ordered basis [5, III, 2.2.4] B for N which is filtered relative to the filtration on N : that is, B = {n1 , n2 , . . . , ne }, and there exists a filtration of sets B = B1 ⊃ B2 ⊃ · · · ⊃ Br−1 6= ∅ such that Bi is an ordered basis for Ni for each 1 ≤ i ≤ r − 1. We may order the elements so that, for some integers 1 = k1 < k2 < · · · < kr−1 < e, we have Bi = {nki +1 , . . . , ne } for each 1 ≤ i ≤ r − 1. Taking logarithms of these basis elements gives us a basis for L, and then Lemma 4.3 implies that, with respect to this basis, the automorphism of L induced by α has the special block lower triangular form   0 0 ... 0 ζId1  ∗  0 ... 0 ζ 2 Id2   3  ∗  0 ∗ ζ Id3 . . .  ,  ..  .. . .. .. ..  .  . . . ∗ ∗ ∗ ... ζ r−1 Idr−1 where di = rk(Li /Li+1 ) = rk(Mi ) and I denotes the identity matrix. 23 5 The finite-by-(nilpotent p-valuable) radical Let G be a nilpotent-by-finite compact p-adic analytic group. Consider the set   S(G) = H ✁ G H/∆+ (H) is nilpotent and p-valuable , O where “H ✁ G” means “H is an open normal subgroup of G”. S(G) is nonempty, O as we can pick an open normal nilpotent uniform subgroup of G by [4, 4.1], and hence contains a maximal element. We will show that this maximal element is unique, and we will call this element the finite-by-(nilpotent p-valuable) radical of G, and once we have shown its uniqueness we will denote it by FNp (G). Remark. Once we have shown the existence and uniqueness of FNp (G), it will be clear that it is a characteristic open subgroup of G (as automorphisms of G leave S(G) invariant), and contained in nio(G) (by Corollary 2.4 and Theorem A). The quotient group nio(G)/FNp (G) × is isomorphic to a subgroup of t(Z× p ) by Corollary 4.4. When p > 2, t(Zp ) is a ′ + p -group, and so FNp (G)/∆ is the unique Sylow pro-p subgroup of nio(G)/∆+ . (This fails for p = 2: the “2-adic dihedral group” G = Z2 ⋊ C2 has ∆+ (G) = 1, nio(G) = G, and is its own Sylow 2-subgroup, but FNp (G) = Z2 .) In looking for maximal elements H of S(G), we may make an immediate simplification. By maximality, any such H must have ∆+ (H) = ∆+ , i.e. maximal elements of S(G) are in one-to-one correspondence with maximal elements of   ′ + + S (G) = H ✁ G ∆ ≤ H, H/∆ is nilpotent and p-valuable , O and this set is clearly in order-preserving one-to-one correspondence with the set S(G/∆+ ). Hence we may immediately assume without loss of generality that ∆+ = 1. Lemma 5.1. Let G be a nilpotent-by-finite compact p-adic analytic group with ∆+ = 1. Then (i) there exists a nilpotent uniform open normal subgroup H of G which contains ∆, (ii) any such H satisfies the property that Z(H) = ∆. Proof. First, suppose we are given a nilpotent uniform open normal subgroup H. Take x ∈ ∆: CG (x) is open in G by definition, and so CH (x) = CG (x) ∩ H 24 is open in H. Therefore, for any h ∈ H, we can find some integer k such that k k k hp ∈ CH (x). This means that (x−1 hx)p = hp , and so by [5, III, 2.1.4], we may take (pk )th roots inside H to see that x−1 hx = h. In other words, x ∈ C∆ (H). Now suppose further that H contains ∆. Then x ∈ Z(H). In fact, as we have Z(H) ≤ ∆(H) by definition and ∆(H) ⊆ ∆ by Lemma 1.3(ii), we see that ∆ is all of the centre of H. This establishes (ii). To prove (i), let N be an open normal nilpotent uniform subgroup [4, 4.1] of G. Form H = N ∆, again an open normal subgroup of G. The first paragraph above shows that [N, ∆] = 1; we also know from Lemma 1.3(v) that ∆ is abelian and N is nilpotent. This forces H to be nilpotent and open in G, and to contain ∆ in its centre. It remains only to show that H is uniform. As H is nilpotent, its set t(H) of torsion elements forms a normal subgroup [12, 5.2.7], and if t(H) is non-trivial then t(H) ∩ Z(H) must be non-trivial [12, 5.2.1]; but Z(H) = ∆ is torsion-free by Lemma 1.3(v), so H must be torsion-free. Now it is easy to check that H is powerful as in [4, 3.1], so that H is uniform by [4, 4.5]. Lemma 5.2. Let G be a nilpotent-by-finite compact p-adic analytic group. Then S(G) is closed under finite joins, and hence contains a unique maximal element H, which is characteristic as a subgroup of G. Proof. First, observe that, for an open normal subgroup K of G, we have K ∈ S(G) if and only if K ∈ S(G) (where bars denote quotient by ∆+ ). So we continue to assume without loss of generality that ∆+ = 1. Suppose we are given K, L ∈ S(G): then it remains to show that KL ∈ S(G). As K and L are open and normal, it is obvious that KL is too; and since K and L are also nilpotent, Fitting’s theorem [14, 1B, Proposition 15] implies that KL is nilpotent. But now, again by [12, 5.2.7], t(KL) = ∆+ (KL) ≤ ∆+ = 1 – that is, KL is torsion-free, and hence p-valuable by Lemma 2.3. Now let H be a maximal element of S(G). Assume for contradiction that H does not contain every other element of S(G) as a subgroup. Then we may pick some L ∈ S(G) not contained in H, and form HL ∈ S(G); but now H HL, a contradiction to the maximality of H. So H must be the unique maximal element of S(G). As the set S(G) is invariant under automorphisms of G, this maximal element H is characteristic in G. Definition 5.3. Let G be a nilpotent-by-finite compact p-adic analytic group. Its finite-by-(nilpotent p-valuable) radical FNp (G) is the open characteristic subgroup defined in Lemma 5.2. Proof of Theorem C. The uniqueness of H = FNp (G) is the content of Lemma 5.2. As H is a finite-by-nilpotent closed subgroup of G, Corollary 2.4 and 25 Theorem B show that H is contained in nio(G). The inclusion ∆ ≤ H follows from Lemma 5.1(i). Finally, the isomorphism from nio(G)/H to a subgroup of t(Z× p ) is induced by the map ξ1 : nio(G) → t(Z× p) of Corollary 4.4, whose kernel contains H. Proof of Theorem D. This now follows from Theorem C together with Lemma 4.3. References [1] K. Ardakov. Localisation at augmentation ideals in Iwasawa algebras. Glasgow Mathematical Journal, 48(2):251–267, 2006. [2] K. Ardakov. Prime ideals in nilpotent Iwasawa algebras. Inventiones mathematicae, 190(2):439–503, 2012. [3] K. Ardakov, K.A. Brown. Primeness, semiprimeness and localisation in Iwasawa algebras. Trans. Amer. Math. Soc., 359:1499–1515, 2007. [4] J.D. Dixon, M.P.F. du Sautoy, A. Mann and D. Segal. Analytic Pro-p Groups. Cambridge University Press, 1999. [5] Michel Lazard. Groupes analytiques p-adiques. Publications Mathématiques de l’IHÉS, 26:5–219, 1965. [6] M. Lorenz, E. Letzter. Polycyclic-by-finite group algebras are catenary. Math. Res. Lett., 6:183–194, 1999. [7] J.C. McConnell and J.C. Robson. Noncommutative Noetherian Rings. American Mathematical Society, 2001. [8] J. Nelson. Localisation and Euler Characteristics of Soluble Iwasawa Algebras. PhD thesis, University of Cambridge, 2013. [9] A. Neumann. Completed group algebras without zero divisors. Arch. Math., 51:496–499, 1988. [10] Donald S. Passman. Algebraic Structure of Group Rings. John Wiley & Sons, 1977. [11] Donald S. Passman. Infinite Crossed Products. Academic Press Inc., 1989. [12] Derek J.S. Robinson. A course in the theory of groups. Springer-Verlag New York, 1996. [13] J.E. Roseblade. Prime ideals in group rings of polycyclic groups. Proc. London Math. Soc., 36:385–447, 1978. [14] D. Segal. Polycyclic groups. Cambridge University Press, 2005. 26
4math.GR
Fisher Kernel for Deep Neural Activations Donggeun Yoo, Sunggyun Park, Joon-Young Lee, and In So Kweon arXiv:1412.1628v2 [cs.CV] 19 Dec 2014 KAIST Daejeon, 305-701, Korea. [email protected], [email protected], [email protected], [email protected] Abstract In recent computer vision researches, drastic advances of visual recognition are achieved by deep convolutional neural networks (CNNs) [5], which jointly learn the whole feature hierarchies starting from image pixels to the final class posterior with stacked non-linear processing layers. A deep representation is quite efficient since its intermediate templates are reused. However, the deep CNN is nonlinear and have millions of parameters to be estimated. It requires strong computing power for the optimization and large training data to be generalized well. The recent presence of large scale ImageNet [6] database and the raise of parallel computing contribute to the breakthrough in visual recognition. Krizhevsky et al. [17] achieved an impressive result using a CNN in large-scale image classification. Compared to image representation based on low-level local descriptors, deep neural activations of Convolutional Neural Networks (CNNs) are richer in mid-level representation, but poorer in geometric invariance properties. In this paper, we present a straightforward framework for better image representation by combining the two approaches. To take advantages of both representations, we propose an efficient method to extract a fair amount of multi-scale dense local activations from a pre-trained CNN. We then aggregate the activations by Fisher kernel framework, which has been modified with a simple scale-wise normalization essential to make it suitable for CNN activations. Replacing the direct use of a single activation vector with our representation demonstrates significant performance improvements: +17.76 (Acc.) on MIT Indoor 67 and +7.18 (mAP) on PASCAL VOC 2007. The results suggest that our proposal can be used as a primary image representation for better performances in visual recognition tasks. Instead of training a CNN for a specific task, intermediate activations extracted from a CNN pre-trained on independent large data have been successfully applied as a generic image representation. Combining the CNN activations with a classifier has shown impressive performance in wide visual recognition tasks such as object classification [26, 8, 22, 13, 4], object detection [11, 13], scene classification [26, 12, 36], fine-grained classification [26, 34], attribute recognition [35], image retrieval [2], and domain transfer [8]. 1. Introduction Image representation is one of the most important factors that affect performance on visual recognition tasks. Barbu et al. [3] introduced an interesting experiment that a simple classifier along with human brain-scan data substantially outperforms the state-of-the-art methods in recognizing action from video clips. With a success of local descriptors [19], many researches devoted deep study to global image representation based on a Bag-of-Word (BOW) model [29] that aggregates abundant local statistics captured by hand-designed local descriptors. The BOW representation is further improved with VLAD [14] and Fisher kernel [24, 23] by adding higher order statistics. One major benefit of these global representations based on local descriptors is their invariance property to scale changes, location changes, occlusions and background clutters. For utilizing CNN activations as a generic image representation, a straightforward way is to extract the responses from the first or second fully connected layer of a pretrained CNN by feeding an image and to represent the image with the responses [8, 2, 13, 11]. However, this representation is vulnerable to geometric variations. There are techniques to address the problem. A common practice is exploiting multiple jitterred images (random crops and flips) for data augmentation. Though the data augmentation has been used to prevent over-fitting [17], recent researches show that average pooling, augmenting data and averaging the multiple activation vectors in a test stage, also helps to achieve better geometric invariance of CNNs while improving classification performance by +2.92% in [4] and +3.3% 1 Linear SVM -normalization Norm. … Power normalization Norm. FV 3 Average pooling Norm. FV 2 … FV 1 Dictionary (GMM) … Replaced with convolution … Scale pyramid Multi-scale dense activations Conv. 7 Conv. 6 Conv. 5 Conv. 4 Conv. 3 Conv. 2 Conv. 1 Target task … Activation pyramid Dimensionality Reduction (PCA) Transfer parameters Prob. FC 8 FC 7 FC 6 Conv. 5 Conv. 4 Conv. 3 Conv. 2 Conv. 1 Pre-trained CNN Multi-scale Pyramid Pooling (MPP) layer Figure 1. A pipeline of the proposed method. Given a pre-trained CNN, we replace the first two fully connected layers with the two equivalent convolutional layers to efficiently obtain large amount of multi-scale dense activations. The activations are followed by the Multi-scale Pyramid Pooling (MPP) layer we suggest. The consequent image representation is combined with the linear SVM for the target classification task. in [26] on PASCAL VOC 2007. A different experiment for enhancing the geometric invariance on CNN activations was also presented. Gong et al. [12] proposed a method to exploit multi-scale CNN activations in order to achieve geometric invariance characteristic while improving recognition accuracy. They extracted dense local patches at three different scales and fed each local patch into a pre-trained CNN. The CNN activations are aggregated at finer scales via VLAD encoding which was introduced in [14], and then the encoded activations are concatenated as a single vector to obtain the final representation. In this paper, we introduce a multi-scale pyramid pooling to improve the discriminative power of CNN activations robust to geometric variations. A pipeline of the proposed method is illustrated in Figure 1. Similar to [12], we also utilize multi-scale CNN activations, but present a different pooling method that shows better performance in our experiments. Specifically, we suggest an efficient way to obtain abundant amount of multi-scale local activations from a CNN, and aggregate them using the state-of-the-art Fisher kernel [24, 23] with a simple but important scale-wise normalization, so called multi-scale pyramid pooling. Our proposal demonstrates substantial improvements on both scene and object classification tasks compared to the previous representations including a single activation, the average pooling [26, 4], and the VLAD of activations [12]. Also, we demonstrate object confidence maps which is useful for object detection/localization though only category-level labels without specific object bounding boxes are used in training. According to our empirical observations, replacing a VLAD kernel with a Fisher kernel does not present significant impact, however it shows meaningful performance improvements when our pooling mechanism that takes an average pooling after scale-wise normalization is applied. It implies that the performance improvement of our representation does not come just from the superiority of Fisher kernel but from the careful consideration of neural activation’s property dependent on scales. 2. Multi-scale Pyramid Pooling In this section, we first review the Fisher kernel framework and then introduce a multi-scale pyramid pooling which adds a Fisher kernel based pooling layer on top of a pre-trained CNN. 2.1. Fisher Kernel Review The Fisher kernel framework on a visual vocabulary is proposed by Perronnin et al. in [23]. It extends the conventional Bag-of-Words model to a probabilistic generative model. It models the distribution of low-level descriptors using a Gaussian Mixture Model (GMM) and represents an image by considering the gradient with respect to the model parameters. Although the number of local descriptors varies across images, the consequent Fisher vector has a fixed-length, therefore it is possible to use discriminative classifiers such as a linear SVM. Let x denote a d-dimensional local descriptor and Gλ = {gk , k = 1...K} denote a pre-trained GMM with K Gaussians where λ = {ωk , µk , σk , k = 1...K}. For each visual word gk , two gradient vectors, Gµk ∈ <d and Gσk ∈ <d , are computed by aggregating the gradients of the local descriptors extracted from an image with respect to the mean and the standard deviation of the k th Gaussian. Then, the final image representation, Fisher vector, is obtained by concatenating all the gradient vectors. Accordingly, the Fisher kernel framework represents an image with a 2Kddimensional Fisher vector G ∈ <2Kd . Intuitively, a Fisher vector includes the information 2 Scale pyramid Conv. 1 (11ൈ11ൈ3ൈ96) FC 6 (6ൈ6ൈ256ൈ4,096) … 3 227 55 55 227 Scale 2 … 322 4,096 6 3 322 Reform Multi-scale dense activations 256 6 96 Scale 1 Activation pyramid 4,096 1 1 1 1 256 8 96 78 78 4,096 4,096 3 8 1 1 3 Figure 2. Obtaining multi-scale local activations densely from a pre-trained CNN. In this figure, the target layer is the first fully connected layer (FC6). Because FC6 can be equally implemented by a convolutional layer containing 4,096 filters of 6×6×256 size, we can obtain an activation map where spatial ordering of local descriptors is conserved. A single pre-trained CNN is shared for all scales. Image scales 1∼4 1∼5 1∼6 1∼7 Number of activations 270 754 1,910 4,410 Naive extraction (sec) 1.702 4.941 11.41 27.64 Proposed extraction (sec) 0.0769 0.1265 0.2420 0.4635 2.3. Multi-scale Pyramid Pooling (MPP) For representing an image, we first generate a scale pyramid for the input image where the minimum scale image has a fixed size of a CNN and each scale image has two times larger resolution than the previous scale image. We feed all the scaled images into a pre-trained CNN and extract dense CNN activation vectors. Then, all the activation vectors are merged into a single vector by our multi-scale pyramid pooling. Table 1. Average time for extracting multi-scale dense activations per image. With Caffe reference model [15], FC7 activations are extracted from 100 random images of PASCAL VOC 2007. All timings are based on a server with a CPU of 2.6GHz Intel Xeon and a GPU of GTX TITAN Black. If we consider each activation vector as a local descriptor, it is straightforward to aggregate all the local activations into a Fisher vector as explained in Sec. 2.1. However, CNN activations have different scale properties compared to SIFT-like local descriptors, as will be explained in Sec. 3. To adopt the Fisher kernel suitable to CNN activation characteristics, we introduce adding a multi-scale pyramid pooling layer on top of the modified CNN as follows. about directions of model parameters to best fit the local descriptors of an image to the GMM. The fisher kernel framework is further improved in [24] by the additional two-stage normalizations: power-normalization with the factor of 0.5 followed by `2 -normalization. Refer to [24] for the theoretical proofs and details. 2.2. Dense CNN Activations Given a scale pyramid S containing N scaled image and local activation vectors xs extracted from each scale s ∈ S, we first apply PCA to reduce the dimension of activation vectors and obtain x0s . Then, we aggregate the local activation vectors x0s of each scale s to each Fisher vector G s . After Fisher encoding, we have N Fisher vectors and they are merged into one global vector by average pooling after `2 -normalization as To obtain multi-scale activations from a CNN without modification, previous approach cropped local patches and fed the patches into a network after resizing the patches to the fixed size of CNN input. However, when we extract multi-scale local activations densely, the approach is quite inefficient since many redundant operations are performed in convolutional layers for overlapped regions. To extract dense CNN activations without redundant operations, we simply replace the fully connected layers of an existing CNN with equivalent multiple convolution filters along spatial axises. When an image larger than the fixed size is fed, the modified network outputs multiple activation vectors where each vector is CNN activations from the corresponding local patch. The procedure is illustrated in Fig. 2. With this method, thousands of dense local activations (4,410 per image) from multiple scale levels are extracted in a reasonable extraction time (0.46 seconds per image) as shown in Table 1. GS = 1 X Gs N kG s k2 s∈S s.t. Gs = 1 X ∇λ log Gλ (x), |x0s | 0 x∈xs (1) where |·| denotes the cardinality of a set. We use an average pooling since it is a natural pooling scheme for Fisher kernel rather than vector concatenation. Following the Improved Fisher Kernel framework [24], we finally apply power normalization and `2 -normalization to the Fisher vector G S . The overall pipeline of MPP is illustrated in Figure 1. 3 50 SIFT−Fisher 80 CNN−Fisher MIT Indoor 67 PASCAL VOC 2007 Oxford 102 Flowers 94 Image Scale (Num. of Desc.) Image scales 90 88 86 7 6 1~ 1~ 4 5 Naive Fisher Proposed MPP 84 1~ 7 6 1~ 1~ 4 5 1~ 65 1~ 7 6 1~ 5 1~ Image scales Image Scale (Num. of Desc.) Naive Fisher Proposed MPP 92 1~ Accuracy (%) 75 70 4 60 Image scales Figure 4. Classification performance of our multi-scale pyramid pooling in Eq. (1) and the naive Fisher pooling in Eq. (2). The tick labels of the horizontal axis scale levels in a scale pyramid. Figure 3. Classification performance of SIFT-Fisher and CNNFisher according to image scale on PASCAL VOC 2007. The tick labels of the horizontal axis denote image scales and their average number of local descriptors. empirical analysis with scale-wise classification scores on PASCAL VOC 2007 [9]. For the analysis, we first diversify dataset into seven different scale levels from the smallest scale of 227×227 resolution to the biggest scale of 1, 816× 1, 816 resolution and extract both dense SIFT descriptors and local activation vectors in the seventh layer (FC7) of our CNN. Then, we follow the standard framework to encode Fisher vectors and to train an independent linear SVM for each scale, respectively. In Fig. 3, we show the results of classification performances using SIFT-Fisher and CNN-Fisher according to scale. The figure demonstrates clear contrast between SIFTFisher and CNN-Fisher. CNN-Fisher performs worst at the largest image scale since local activations come from small image regions in an original image, while SIFTFisher performs best at the same scale since SIFT properly captures low-level contents within such small regions. If we aggregate the CNN activations of all scales into one Fisher vector by Eq. (2), the poorly performing 2,500 activations will have dominant influence with the large weight of 2,500/4,410 in the image representation. One possible strategy for aggregating multi-scale CNN activations is to choose activations of a set of scales relatively performing well. However, the selection of good scales is dependent on dataset and the activations from the large image scale can also contribute to geometric invariance property if we balance the influence of each scale. We empirically examined various combinations of pooling as will be shown in Sec. 4 and we found that scale-wise Fisher vector normalization followed by an simple average pooling is effective to balance the influence. We perform an experiment to compare our pooling method in Eq. (1) to the naive Fisher pooling in Eq. (2). In the experiment, we apply both of two pooling methods with five different numbers of scales and perform classification on PASCAL VOC 2007. Despite the simplicity of our multi-scale pyramid pooling, it demonstrates superior 3. Analysis of Multi-scale CNN Activations We compare scale characteristics between traditional local features and CNN activations. It tells us that it is not suitable to directly adopt a Fisher kernel framework to multi-scale local CNN activations for representing an image. To investigate the best way for aggregating the CNN activations into a global representation, we perform empirical studies and conclude that applying scale-wise normalization of Fisher vectors is very important. S A naive way to obtain a Fisher vector G 0 given multiscale local activations X = {x ∈ xs , s ∈ S} is to aggregate them as 1 XX S G0 = ∇λ log Gλ (x). (2) |X| x∈x s∈S 65 1~ 60 70 Naive Fisher Proposed MPP 1(1 ) 2(9 3(6 ) 4(1 4) 9 5( 6) 6(1 484) , 7(2 156) ,50 0) 20 1(1 2 2(6 ) 3(1 5) 7 4( 3) 5(1 456) , 6(2 036) ,35 7(4 4) ,95 0) 65 80 mAP (%) 70 75 1~ 30 Accuracy (%) mAP(%) mAP(%) 75 40 s Here, every multi-scale local activation vector is pooled to one Fisher vector with an equal weight of 1/|X|. To better combine a Fisher kernel with mid-level neural activations, the property of CNN activations according to patch scale should be took in consideration. In the traditional use of Fisher kernel on visual classification tasks, the hand-designed local descriptors such as SIFT [19] have been often densely computed in multi-scale. This local descriptor encodes low-level gradient information within an local region and captures detailed textures or shapes within a small region rather than the global structure within a larger region. In contrast, a mid-level neural activation extracted from a higher layer of CNNs (e.g. FC6 or FC7 of [17]) represents higher level structure information which is closer to class posteriors. As shown in the CNN visualization proposed by Zeiler and Fergus in [33], image regions strongly activated by a certain CNN filter of the fifth layer usually capture a category-level entire object. To figure out the different scale properties between the Fisher vector of traditional SIFT (SIFT-Fisher) and that of neural activation from FC7 (CNN-Fisher), we conduct an 4 performances as depicted in Fig. 4. The performance of the naive Fisher kernel pooling in Eq. (2) deteriorates rapidly when finer scale levels are involved. This is because indistinctive neural activations from finer scale levels become dominant in forming a Fisher vector. Our representation, however, exhibits stable performance that the accuracy is constantly increasing and finally being saturated. It verify that our pooling method aggregates multi-scale CNN activations effectively. the OverFeat [27], is also composed of five convolutional layers (three in [27]) and three fully connected layers. It shows 15.5% top-5 error on the ILSVRC’12 dataset with the same center-crop. Compared to Alex, it uses 7×7 smaller filters but dense stride of 2 in the first convolutional layer. Our experiments are conducted mostly with the Alex by default. The CNNS is used only for the PASCAL VOC 2007 dataset to compare our method with [4], which demonstrates excellent performance with the CNNS. Both of the two pre-trained models are available online [31]. 4. Experiments 4.3. Implementation Details 4.1. Datasets We use an image pyramid of seven scales by default since the seven scales can cover large enough scale variations and performance in all datasets as shown in Fig. 4. The overall procedure of our image representation is as follows. Given an image, we make an image pyramid containing seven scaled images. Each image in the pyramid has twice resolution than the previous scale starting from the standard size defined in each CNN (e.g. 227×227 for Alex). We then feed each scale image to the CNN and obtain 4,410 vectors of 4,096 dimensional dense CNN activations from the seventh layer. The dimensionality of each activation vector is reduced to 128 by PCA where a projection is trained with 256,000 activation vectors sampled from training images. A visual vocabulary (GMM of 256 Gaussian distributions) is also trained with the same samples. Consequently, one 65,536 dimensional Fisher vector is computed by Eq. (1), and further power- and `2 -normalization follow. One-versus-rest linear SVMs with a quadratic regularizer and a hinge loss are trained finally. Our system is mostly implemented using open source libraries including VLFeat [30] for a Fisher kernel framework and MatConvNet [31] for CNNs. To evaluate our proposal as a generic image representation, we conduct three different visual recognition tasks with following datasets. MIT Indoor 67 [25] is used for a scene classification task. The dataset contains 15,620 images with 67 indoor scene classes in total. It is a challenging dataset because many indoor classes are characterized by the objects they contain (e.g. different type of stores) rather than their spatial properties. The performance is measured with top-1 accuracy. PASCAL VOC 2007 [9] is used for an object classification task. It consists of 9,963 images of 20 object classes in total. The task is quite difficult since the scales of the objects fluctuate and multiple objects of different classes are often contained in the same image. The performance is measured with (11-points interpolated) mean average precision. Oxford 102 Flowers [21] is used for a fine-grained object classification task, which distinguishes the sub-classes of the same object class. This dataset consists of 8,189 images with 102 flower classes. Each class consists of various numbers of images from 20 to 258. The performance is measured with top-1 accuracy. 4.4. Results and Analysis We perform comprehensive experiments to compare various methods on the three recognition tasks. We first show the performance of our method and baseline methods. Then, we compare our result with state-of-the-art methods for each dataset. For simplicity, we use a notation protocol “A(B)” where A denotes a pooling method and B denotes descriptors to be pooled by A. The notations are summarized in Table 2. We compare our method with several baseline methods. The baseline methods include intermediate CNN activations from a pre-trained CNN with a standard input, an average pooling with multiple jittered images, and modified versions of our method. The comparison results for each dataset are summarized in Table 3(a), 4(a), 6(a). As expected, the most basic representation, Alex-FC7, performs the worst for all datasets. The average pooling in AP10 and AP50 improves the performance +1.39%∼+3%, how- 4.2. Pre-trained CNNs We use two CNNs pre-trained on the ILSVRC’12 dataset [6] to extract multi-scale local activations. One is the Caffe reference model [15] composed of five convolutional layers and three fully connected layers. This model performed 19.6% top-5 error when a single center-crop of each validation image are used for evaluation on the ILSVRC’12 dataset. Henceforth, we denote this model by “Alex” since it is nearly the same architecture of Krizhevsky et al.’s CNN [17]. The other one is Chatfield et al.’s CNN-S model [4] (“CNNS”, henceforth). This model, a simplified version of 5 ever the improvement is bounded regardless of the number of data augmentation. The other two baseline methods (MPP w/o SN and CSF) exploit multi-scale CNN activations and they show better results than single-scale representations. Compared to the AP10, the performance gains from multi-scale activations exceed +10%, +1%, and +5% for each dataset. It shows that image representation based on CNN activations can be enriched by utilizing multi-scale local activations. Even though baseline methods exploiting multi-scale CNN activations show substantial improvements compared to the single-scale baselines, we can also verify that handling multi-scale activations is important for further improvement. Compared to the naive Fisher kernel pooling (NFK) in Eq. (2), our MPP achieves an extra but significant performance gain of +4.18%, +4.58%, and 2.84% for each dataset. Instead of pooling multi-scale activations as our MPP, concatenating encoded Fisher vectors can be another option as done in Gong et al.’s method [12]. The concatenation (CSF) also improves the performance, however the CSF without an additional dimension reduction raises the dimensionality proportional to the number of scales and the MPP still outperforms the CSF for all datasets. The comprehensive test with various pooling strategies so far shows that the proposed image representation can be used as a primary image representation in wide visual recognition tasks. We also apply the spatial pyramid (SP) kernel [18] to our representation. We construct a spatial pyramid into four sub-regions (whole, top, middle, bottom) and it increases the dimensionality of our representation four times. The results are unequable but the differences are marginal for all datasets. This result is not surprising because the rich activations from smaller image scales already cover the global layout. It makes the SP kernel redundant. In Table 3(b), we compare our result with various stateof-the-art methods on Indoor 67. Similar to ours, Gong et al. [12] proposed a pooling method for multi-scale CNN activations. They performed VLAD pooling at each scale and concatenated them. Compared to [12], our representation largely outperforms the method with a gain of +7.07%. The performance gap possibly comes from 1) the large number of scales, 2) the superiority of the Fisher kernel, and 3) the details of pooling strategy. While they use only three scales, we extract seven-scale activations with a quite efficient way (Fig. 2). Though adding local activations from very finer scales such as 6 or 7 in a naive way may harm the performance, it actually contribute to a better invariance property by the proposed MPP. In addition, as our experiment of the “CSF” was shown, the MPP is more suitable for aggregating multi-scale activations than the concatenation. It implies that our better performance does not just come from the superior Fisher kernel, but from the better handling of multi-scale neural activations. The record holder in the Indoor 67 dataset has been Zuo et al. [37] who combined the Alex-FC6 and their complementary features so called DSFL. The DSFL learns discriminative and shareable filters with a target dataset. When we stack an additional MPP at the Pool5 layer, we already achieve a state-of-the-art performance (77.76%) with a pretrained Alex only. We also stack the DSFL feature1 over our representation and the result shows the performance of 80.78%. It shows that our representation is also improved by combining complementary features. The results on VOC 2007 is summarized in Table 4(b). There are two methods ([22] and [26]) that use the same Alex network. Razavian et al. [26] performed target data augmentation and Oquab et al. [22] used a multi-layer perceptron (MLP) instead of a linear SVM with ground truth bounding boxes. Our representation outperforms the two methods using the pre-trained Alex without data augmentation or the use of bounding box annotations. The gains are +1.84% and +2.34% respectively. There are recent methods outperforming our method. All of them are adopting better CNNs for the source task (i.e. ImageNet classification) or the target task, such as Spatial Pyramid Pooling (SPP) network [13], Multi-label CNN [32] and the CNNS [4]. Our basic MPP(Alex-FC7) demonstrates slightly lower precisions (79.54%) compared to them, however we use the basic Alex CNN without finetuning on VOC 2007. When our representation is equipped with the superior CNNS [4], which is not fine-tuned on VOC 2007, our representation (81.40%) reaches nearly statof-the-art performance and our method is further improved to 82.13% by stacking MPP(CNNS-FC8). The performance is still lower than [4], who conduct target data augmentation and fine-tuning. We believe our method can be further improved by additional techniques such as fine-tuning, target data augmentation, or use of ground truth bounding boxes, we leave the issue as future work because our major focus is a generic image representation with a pre-trained CNN. Table 6(b) shows the classification performances on 102 Flowers. Our method (91.28%) outperforms the previous state-of-the-art method [26] (86.80%). Without the use of a powerful CNN representation, various previous methods show much lower performances. Table 5 shows per-class performances on VOC 2007. Compared to state-of-the-art methods, our method performs best in 6 classes among 20 classes. It is interesting that the 6 classes include “bottle”, “pottedplant”, and “tvmonitor”, which are the representative small objects in the VOC 2007 dataset. The results clearly demonstrates the benefit of our MPP that aggregates activations from very finer-scales as well, which are prone to harm the performance if it is handled inappropriately. 1 Pre-computed DSFL vectors for the MIT Indoor 67 dataset are provided by the authors. 6 Method CNN-FC7 AP10(CNN-FC7) AP50(CNN-FC7) NFK(CNN-FC7) CSF(CNN-FC7) MPP(CNN-FC7) Description A standard activation vector from FC7 of a CNN with a center-crop of a 256 × 256 size input image. Average pooling of a 5 crops and their flips, given a 256 × 256 size input image. Average pooling of a 25 crops and their flips, given a 256 × 256 size input image. Naive Fisher kernel pooling without scale-wise vector normalization, given a multi-scale image pyramid. Concatenation of scale-wise normalized Fisher vectors, given a multi-scale image pyramid. The proposed representation, given a multi-scale image pyramid. Table 2. Summary of our notation protocol. Consequent image representations by the listed methods are finally `2 -normalized. Method Alex-FC7 AP10(Alex-FC7) MPP(Alex-FC7) MPP(CNNS-FC7) Perronnin et al. [24] 10’ Razavian et al. [26] ’14 Oquab et al. [22] ’14 Wei et al. [32] ’14 Chatfieldet al. [4] ’14 FT No. No. No. No. No. No. No. Yes. Yes. plane 85.0 85.7 90.2 90.2 75.7 90.1 88.5 95.1 95.3 bike 79.7 80.8 86.9 88.6 64.8 84.4 81.5 90.1 90.4 bird 82.8 83.3 86.6 89.0 52.8 86.5 87.9 92.8 92.5 boat 80.4 80.7 84.4 84.7 70.6 84.1 82.0 89.9 89.6 bottle 39.7 40.4 54.0 58.2 30.0 48.4 47.5 51.5 54.4 bus 69.3 71.5 80.0 82.8 64.1 73.4 75.5 80.0 81.9 car 82.9 83.8 87.9 88.1 77.5 86.7 90.1 91.7 91.5 cat 81.7 82.7 86.0 89.0 55.5 85.4 87.2 91.6 91.9 chair 58.7 60.7 63.4 64.9 55.6 61.3 61.6 57.7 64.1 cow 57.8 60.5 72.2 77.0 41.8 67.6 75.7 77.8 76.3 table 68.5 70.6 75.7 78.4 56.3 69.6 67.3 70.9 74.9 dog 75.9 79.0 83.1 86.9 41.7 84.0 85.5 89.3 89.7 horse 83.0 84.5 87.8 89.2 76.3 85.4 83.5 89.3 92.2 motor 72.5 75.0 83.9 86.7 64.4 80.0 80.0 85.2 86.9 person 90.6 91.3 93.0 92.8 82.7 92.0 95.6 93.0 95.2 plant 51.7 53.4 64.8 61.2 28.3 56.9 60.8 64.0 60.7 sheep 71.1 70.1 75.8 81.3 39.7 76.7 76.8 85.7 82.9 sofa 60.8 62.6 69.6 70.0 56.6 67.3 58.0 62.7 68.0 train 85.0 86.5 89.9 89.8 79.7 89.1 90.4 94.4 95.5 tv 70.5 72.1 75.9 79.3 51.5 74.9 77.9 78.3 74.4 mAP 72.4 73.7 79.5 81.4 58.3 77.2 77.7 81.5 82.4 Table 5. Per-class classification performances on PASCAL VOC 2007. “FT” represents fine-tuning of a pre-trained CNN on VOC2007. Method Baseline Baseline Baseline Baseline Baseline Ours Ours Ours Ours Description CNN Acc. Alex-FC7 Yes. 57.91 AP10(Alex-FC7) Yes. 60.90 AP50(Alex-FC7) Yes. 60.37 NFK(Alex-FC7) Yes. 71.49 CSF(Alex-FC7) Yes. 72.24 MPP(Alex-FC7) Yes. 75.67 MPP(Alex-FC7)+SP Yes. 75.97 MPP(Alex-FC7,Pool5) Yes. 77.56 MPP(Alex-FC7)+DSFL[37] Yes. 80.78 (a) baselines and our methods. Method Description CNN Singh et al. [28] ’12 Part+GIST+DPM+SP No. Juneja et al. [16] ’13 IFK+Bag-of-Parts No. Doersch et al. [7] ’13 IFK+MidlevelRepresent. No. Zuo et al. [37] ’14 DSFL No. Zuo et al. [37] ’14 DSFL+Alex-FC6 Yes. Zhou et al. [36] ’14 Alex-FC7 Yes. Zhou et al. [36] ’14 Alex-FC7 Yes. Razavian et al. [26] ’14 AP(Alex)+PT+TargetAug. Yes. Gong et al. [12] ’14 VLAD Concat.(Alex-FC7) Yes. (b) state-of-the-art methods on MIT Indoor 67. Method Description FT BB CNN mAP Baseline Alex-FC7 No. No. Yes. 72.36 Baseline AP10(Alex-FC7) No. No. Yes. 73.75 Baseline AP50(Alex-FC7) No. No. Yes. 73.60 Baseline NFK(Alex-FC7) No. No. Yes. 74.96 Baseline CSF(Alex-FC7) No. No. Yes. 78.46 Ours MPP(Alex-FC7) No. No. Yes. 79.54 Ours MPP(Alex-FC7)+SP No. No. Yes. 79.29 Ours MPP(CNNS-FC7) No. No. Yes. 81.40 Ours MPP(CNNS-FC7,FC8) No. No. Yes. 82.13 (a) Baselines and our methods. Method Description FT BB CNN mAP Perronnin et al. [24] 10’ IFK(SIFT+color) No. No. No. 60.3% He et al. [13] ’14 SPPNET-FC7 No. No. Yes. 80.10% Wei et al. [32] ’14 Multi-label CNN Yes. No. Yes. 81.50% Razavian et al. [26] ’14 AP(Alex)+PT+TA No. No. Yes. 77.20% Oquab et al. [22] ’14 Alex-FC7+MLP No. Yes. Yes. 77.70% Chatfield et al. [4] ’14 AP(CNNS-FC7)+TA No. No. Yes. 79.74% Chatfield et al. [4] ’14 AP(CNNS-FC7)+TA Yes. No. Yes. 82.42% (b) state-of-the-art methods on PASCAL VOC 2007 classification. Table 4. Classification performances on PASCAL VOC 2007 classification. “FT” represents fine-tuning of a pre-trained CNN on VOC2007 and “BB” denotes the use of ground truth object bounding boxes in training. (SP: Spatial Pyramid, IFK: Improved Fisher Kernel, SPPNET: Spatial Pyramid Pooling Network, PT: Power Transform, TA: Target data Augmentation in training, MLP: Multilayer Perceptron.) Acc. 49.40 63.18 66.87 52.24 76.23 68.24 70.80 69.00 68.90 Table 3. Classification performances on MIT Indoor 67. (SP: Spatial Pyramid, DPM: Deformable Part-based Model, PT: Power Transform, IFK: Improved Fisher Kernel, DSFL: Discriminative and Shareable Feature Learning.) 7 Method Description Seg. CNN Acc. Baseline Alex-FC7 No. Yes. 81.43 Baseline AP10(Alex-FC7) No. Yes. 83.40 Baseline AP50(Alex-FC7) No. Yes. 83.56 Baseline NFK(Alex-FC7) No. Yes. 88.44 Baseline CSF(Alex-FC7) No. Yes. 89.35 Ours MPP(Alex-FC7) No. Yes. 91.28 Ours MPP(Alex-FC7)+SP No. Yes. 90.05 (a) baselines and our methods. Method Description Seg. CNN Acc. Nilsback and Zisserman [21] ’08 Multple kernel learning Yes. No. 77.70 Angelova and Zhu [1] ’13 Seg+DenseHoG+LLC+MaxPooling Yes. No. 80.70 Murray and Perronnin [20] ’14 GMP of IFK(SIFT+color) No. No. 81.50 Fernando et al. [10] ’14 Bag-of-FLH Yes. No. 72.70 Razavian et al. [26] ’14 AP(Alex)+PT+TA No. Yes. 86.8 (b) state-of-the-art methods on Oxford 102 Flowers. Table 6. Classification performances on Oxford 102 Flowers. “Seg.” denotes the use of ground truth segmentations in training. (SP: spatial pyramid, LLC: Locality-constrained Linear Coding, GMP: generalized max pooling, FLH: Frequent Local Histograms, PT: power transform, TA: target data augmentation in training.) Bottle Bottle Dining Table Dining Table Car Car Sofa Sofa TV monitor TV monitor Train Train Potted plant Potted plant Bus Bus Bicycle Bicycle Aeroplane Aeroplane Person Person Sheep Sheep Figure 5. Examples of object confidence maps obtained by our image representation on the PASCAL VOC 2007. All examples are test images, not training images. 8 4.5. Weakly-Supervised Object Confidence Map One interesting feature of our method is that we can present object confidence maps for object classification tasks, though we train the SVM classifiers without bounding box annotation but only with class-level labels. To recover confidence maps, we trace how much weight is given to each local patch and accumulate all the weights of local activations. Tracing the weight of local activations is possible because our final representation can be formed regardless of the number of scales and the number of local activation vectors. To trace the weight of each patch, we compute our final representation per patch using the corresponding single activation vector only and compute the score from the pre-trained SVM classifiers we used for object classification. Fig. 5 and Fig. 6 show several examples of object confidence map on the VOC 2007 test images. In the figures, we can verify our image representation encodes the discriminative image patches well, despite large within-class variations as well as substantial geometric changes. As we discussed in Sec. 4.4, the images containing small-size objects also present the accurate confidence maps. These maps may further be utilized as an considerable cue for object detection/localization and also be useful for analyzing image representation. Person Boat Car Person Aeroplane Car Bicycle Person Dog Person Bottle Person Cat Dog Car Person Person Sheep 5. Discussion We have proposed the multi-scale pyramid pooling for better use of neural activations from a pre-trained CNN. There are several conclusions we can derive through our study. First, we should take the scale characteristic of neural activations into consideration for the successful combination of a Fisher kernel and a CNN. The activations become uninformative as a patch size becomes smaller, however they can contribute to better scale invariance when they meet a simple scale-wise normalization. Second, dense deep neural activations from multiple scale levels are extracted with reasonable computations by replacing the fully connection with equivalent multiple convolution filters. It enables us to pool the truly multi-scale activations and to achieve significant performance improvements on the visual recognition tasks. Third, reasonable object-level confidence maps can be obtained from our image representation even though only class-level labels are given for supervision, which can be further applied to object detection or localization tasks. In the comprehensive experiments on three different recognition tasks, the results suggest that our proposal can be used as a primary image representation for better performances in various visual recognition tasks. Figure 6. Examples of multi-object confidence map obtained by our image representation on the PASCAL VOC 2007. All examples are test images, not training images. 9 References [15] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [16] M. Juneja, A. Vedaldi, C. V. Jawahar, and A. Zisserman. Blocks that shout: Distinctive parts for scene classification. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2013. [17] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), 2013. [18] S. Lazebnik, C. Schmid, and J. Ponce. Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages II: 2169–2178, 2006. [19] D. G. Lowe. Distinctive image features from scale-invariant keypoints. International Journal on Computer Vision (IJCV), 60(2):91–110, 2004. [20] N. Murray and F. Perronnin. Generalized max pooling. Computing Research Repository (CoRR), abs/1406.0312, 2014. [21] M.-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In Proceedings of the Indian Conference on Computer Vision, Graphics and Image Processing, 2008. [22] M. Oquab, L. Bottou, I. Laptev, and J. Sivic. Learning and transferring mid-level image representations using convolutional neural networks. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [23] F. Perronnin and C. R. Dance. Fisher kernels on visual vocabularies for image categorization. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2007. [24] F. Perronnin, J. Sánchez, and T. Mensink. Improving the fisher kernel for large-scale image classification. In Proceedings of European Conference on Computer Vision (ECCV), 2010. [25] A. Quattoni and A.Torralba. Recognizing indoor scenes. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [26] A. S. Razavian, H. Azizpour, J. Sullivan, and S. Carlsson. CNN features off-the-shelf: an astounding baseline for recognition. In Computing Research Repository (CoRR), 2014. [27] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun. Overfeat: Integrated recognition, localization and detection using convolutional networks. In Proceedings of International Conference on Learning Representations (ICLR), 2014. [28] S. Singh, A. Gupta, and A. A. Efros. Unsupervised discovery of mid-level discriminative patches. In Proceedings of European Conference on Computer Vision (ECCV), 2012. [29] J. Sivic and A. Zisserman. Video google: A text retrieval approach to object matching in videos. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2003. [1] A. Angelova and S. Zhu. Efficient object detection and segmentation for fine-grained recognition. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 811–818. IEEE, 2013. [2] A. Babenko, A. Slesarev, A. Chigorin, and V. Lempitsky. Neural codes for image retrieval. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [3] A. Barbu, D. P. Barrett, W. Chen, S. Narayanaswamy, C. Xiong, J. J. Corso, C. D. Fellbaum, C. Hanson, S. J. Hanson, S. Hélie, E. Malaia, B. A. Pearlmutter, J. M. Siskind, T. M. Talavage, and R. B. Wilbur. Seeing is worse than believing: Reading people’s minds better than computer-vision methods recognize actions. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [4] K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Return of the devil in the details: Delving deep into convolutional nets. In Proceedings of British Machine Vision Conference (BMVC), 2014. [5] Y. L. Cun, B. Boser, J. S. Denker, D. Henderson, R. Howard, W. Hubbard, and L. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1:541–551, 1989. [6] J. Deng, W. Dong, R. Socher, L. J. Li, K. Li, and L. F. Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [7] C. Doersch, A. Gupta, and A. A. Efros. Mid-level visual element discovery as discriminative mode seeking. In Advances in Neural Information Processing Systems (NIPS), 2013. [8] J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. DeCAF: A deep convolutional activation feature for generic visual recognition. In Computing Research Repository (CoRR), 2013. [9] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2007 (VOC2007) Results. http://www.pascalnetwork.org/challenges/VOC/voc2007/workshop/index.html. [10] B. Fernando, É. Fromont, and T. Tuytelaars. Mining midlevel features for image classification. International Journal on Computer Vision (IJCV), 108(3):186–203, 2014. [11] R. B. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [12] Y. Gong, L. Wang, R. Guo, and S. Lazebnik. Multi-scale orderless pooling of deep convolutional activations features. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [13] K. He, X. Zhang, S. Ren, and J. Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [14] H. Jegou, M. Douze, C. Schmid, and P. Pérez. Aggregating local descriptors into a compact image representation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010. 10 [30] A. Vedaldi and B. Fulkerson. VLFeat: An open and portable library of computer vision algorithms. http://www. vlfeat.org/, 2008. [31] A. Vedaldi and K. Lenc. MatConvNet: Convolutional neural networks for matlab. http://www.vlfeat.org/ matconvnet/, 2014. [32] Y. Wei, W. Xia, J. Huang, B. Ni, J. Dong, Y. Zhao, and S. Yan. Cnn: Single-label to multi-label. In Computing Research Repository (CoRR), 2014. [33] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [34] N. Zhang, J. Donahue, R. B. Girshick, and T. Darrell. Part-based R-CNNs for fine-grained category detection. In Proceedings of European Conference on Computer Vision (ECCV), 2014. [35] N. Zhang, M. Paluri, M. Ranzato, T. Darrell, and L. D. Bourdev. PANDA: Pose aligned networks for deep attribute modeling. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [36] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning deep features for scene recognition using places database. In Advances in Neural Information Processing Systems (NIPS), 2014. [37] Z. Zuo, G. Wang, B. Shuai, L. Zhao, Q. Yang, and X. Jiang. Learning discriminative and shareable features for scene classification. In Proceedings of European Conference on Computer Vision (ECCV), 2014. 11
9cs.NE
T HREE FACTORS INFLUENCING MINIMA IN SGD Stanisław Jastrz˛ebski∗†, Zachary Kenton∗‡, Devansh Arpit‡, Nicolas Ballas§, Asja Fischer¶ , Yoshua Bengio‡k, Amos Storkey∗∗ arXiv:1711.04623v1 [cs.LG] 13 Nov 2017 A BSTRACT We study the properties of the endpoint of stochastic gradient descent (SGD). By approximating SGD as a stochastic differential equation (SDE) we consider the Boltzmann-Gibbs equilibrium distribution of that SDE under the assumption of isotropic variance in loss gradients. Through this analysis, we find that three factors – learning rate, batch size and the variance of the loss gradients – control the trade-off between the depth and width of the minima found by SGD, with wider minima favoured by a higher ratio of learning rate to batch size. We have direct control over the learning rate and batch size, while the variance is determined by the choice of model architecture, model parameterization and dataset. In the equilibrium distribution only the ratio of learning rate to batch size appears, implying that the equilibrium distribution is invariant under a simultaneous rescaling of learning rate and batch size by the same amount. We then explore experimentally how learning rate and batch size affect SGD from two perspectives: the endpoint of SGD and the dynamics that lead up to it. For the endpoint, the experiments suggest the endpoint of SGD is invariant under simultaneous rescaling of batch size and learning rate, and also that a higher ratio leads to flatter minima, both findings are consistent with our theoretical analysis. We note experimentally that the dynamics also seem to be invariant under the same rescaling of learning rate and batch size, which we explore showing that one can exchange batch size and learning rate for cyclical learning rate schedule. Next, we illustrate how noise affects memorization, showing that high noise levels lead to better generalization. Finally, we find experimentally that the invariance under simultaneous rescaling of learning rate and batch size breaks down if the learning rate gets too large or the batch size gets too small. 1 I NTRODUCTION Despite being massively over-parameterized (Zhang et al., 2016), deep neural networks (DNNs) have demonstrated good generalization ability and achieved state-of-the-art performances in many application domains such as image (He et al., 2016) and speech recognition (Amodei et al., 2016). The reason for this success has been a focus of research recently but still remains an open question. Our work provides new theoretical insights and useful suggestions for deep learning practitioners. The standard way of training DNNs involves minimizing a loss function using SGD and its variants (Bottou, 1998). In SGD, parameters are updated by taking a small discrete step depending on the learning rate in the direction of the negative loss gradient, which is approximated based on a small subset of training examples (called a mini-batch). Since the loss functions of DNNs are highly non-convex functions of the parameters, with complex structure and potentially multiple minima and saddle points, SGD generally converges to different regions of parameter space depending on optimization hyper-parameters and initialization. ∗ First two authors contributed equally Jagiellonian University ‡ MILA, Université de Montréal § Facebook AI Research ¶ University of Bonn k CIFAR Senior Fellow ∗∗ University of Edinburgh † 1 Recently, several works (Arpit et al., 2017; Advani & Saxe, 2017; Shirish Keskar et al., 2016) have investigated how SGD impacts generalization in DNNs. It has been argued that wide minima tend to generalize better than sharp minima (Hochreiter & Schmidhuber, 1997; Shirish Keskar et al., 2016). This is entirely compatible with a Bayesian viewpoint that emphasizes targeting the probability mass associated with a solution, rather than the density value at a solution (MacKay, 1992). Specifically, (Shirish Keskar et al., 2016) find that larger batch sizes correlate with sharper minima. In contrast, we find that it is the ratio of learning rate to batch size which is correlated with sharpness of minima, not just batch size alone. In this vein, while (Dinh et al., 2017) discuss the existence of sharp minima which behave similarly in terms of predictions compared with wide minima, we argue that SGD naturally tends to find wider minima at higher noise levels in gradients, and such wider minima seem to correlate with better generalization. In order to achieve our goal, we approximate SGD as a continuous stochastic differential equation (Bottou, 1991; Mandt et al., 2017; Li et al., 2017). Assuming isotropic gradient noise, we derive the Boltzmann-Gibbs equilibrium distribution of this stochastic process, and further derive the relative probability of landing in one local minima as compared to another in terms of their depth and width. Our main finding is that the ratio of learning rate to batch-size along with the gradient’s covariances influence the trade-off between the depth and sharpness of the final minima found by SGD, with a high ratio of learning rate to batch size favouring flatter minima. In addition, our analysis provides a theoretical justification for the empirical observation that scaling the learning rate linearly with batch size (up to a limit) leads to identical performance in DNNs (Krizhevsky, 2014; Goyal et al., 2017). We verify our theoretical insights experimentally on different models and datasets. In particular, we demonstrate that high learning rate to batch size ratio (due to either high learning rate or low batchsize) leads to wider minima and correlates well with better validation performance. We also show that a high learning rate to batch size ratio helps prevent memorization. Furthermore, we observe that multiplying each of the learning rate and the batch size by the same scaling factor results in similar training dynamics. Extending this observation, we validate experimentally that one can exchange learning rate and batch size for the recently proposed cyclic learning rate (CLR) schedule (Smith, 2015), where the learning rate oscillates between two levels. Finally, we discuss the limitations of our theory in practice. 2 R ELATED WORK The relationship between SGD and sampling a posterior distribution via stochastic Langevin methods has been the subject of discussion in a number of papers (Chaudhari et al., 2017; Chen et al., 2014; Ding et al., 2014; Vollmer et al., 2015; Welling & Teh, 2011; Shang et al., 2015; Sato & Nakagawa, 2014). In particular, (Mandt et al., 2017) describe the dynamics of stochastic gradient descent (SGD) as a stochastic process that can be divided into three distinct phases. In the first phase, weights diffuse and move away from the initialization. In the second phase the gradient magnitude dominates the noise in the gradient estimate. In the final phase, the weights are near the optimum. (Shwartz-Ziv & Tishby, 2017) make related observations from an information theoretic point of view and suggest the diffusion behaviour of the parameters in the last phase leads to the minimization of mutual information between the input and hidden representation. We also relate the SGD dynamics to the stationary distribution of the stochastic differential equation. Our derivation bears similarity with (Mandt et al., 2017). However, while (Mandt et al., 2017) study SGD as an approximate Bayesian inference method in the final phase of optimization in a locally convex setting, our end goal is to analyze the stationary distribution over the entire parameter space reached by SGD. Further, our analysis allows us to compare the probability of SGD ending up in one minima over another (in terms of width and depth), which is novel in our case. Our work is also closely related to the ongoing discussion about the role of large batch size and the sharpness of minima found in terms of generalization (Shirish Keskar et al., 2016). (Shirish Keskar et al., 2016) showed that SGD ends up in sharp minimum when using large batch size. (Goyal et al., 2017; Hoffer et al., 2017) empirically observed that scaling up the learning rate, and training for more epochs, leads to good generalization when using large batch size. Our novelty is in explaining the importance of the ratio of learning rate to batch size. In particular, our theoretical and empirical 2 results show that simultaneously rescaling the batch size and learning rate by the same amount leads SGD to minima having similar width despite using different batch sizes. Concurrent with this work, (Smith & Le, 2017; Chaudhari & Soatto, 2017) have both analyzed SGD approximated as a continuous time stochastic process and stressed the importance of the learning rate to batch size ratio. (Smith & Le, 2017) focused on the training dynamics while (Chaudhari & Soatto, 2017) explored the stationary non-equilibrium solution for the stochastic differential equation for non-isotropic gradient noise, but assuming other conditions on the covariance and loss to enforce the stationary distribution to be path-independent. Their solution does not have an explicit solution in terms of the loss in this case. In contrast to other work, we strictly focus on the explicitly solvable case of the Boltzmann-Gibbs equilibrium distribution with isotropic noise. This focus allows us to relate the noise in SGD, controlled by the learning rate to batch size ratio, with the width of its endpoint. We empirically verify that the width and height of minima correlates with the learning rate to batch size ratio in practice. Our work continues the line of research on the importance of noise in SGD (Bottou, 1998; Roux et al., 2008; Neelakantan et al., 2015; Mandt et al., 2017). Our novelty is in formalizing the impact of batch size and learning rate (i.e. noise level) on the width and depth of the final minima, and empirical verifications of this. 3 T HEORETICAL R ESULTS Our focus in this section is on finding the relative probability with which we end optimization in a certain minimum, as compared to another minimum. We will find that the relative probability depends on the local geometry of the loss function at each minimum along with batch size, learning rate and the covariance of the loss gradients. To reach this result, we first derive the equilibrium distribution of SGD over the parameter space under a stochastic differential equation treatment. We make the assumption of isotropic covariance of the loss gradients, which allows us to write down an explicit expression for the equilibrium distribution, which turns out to be a Boltzmann-Gibbs distribution. 3.1 S ETUP We follow a theoretical setup similar to (Mandt et al., 2017), approximating SGD with a continuoustime stochastic process, which we now outline. Let us consider a model parameterized by θ = {θ1 , . . . , θq }. For N training examples xi , i ∈ {1, ..., N }, the loss function, L(θ), and the corresponding gradient g(θ), are defined based on the sum over the loss values for all training examples. Stochastic gradients g(S) (θ) arise when we consider a batch B of size S < N of random indices drawn uniformly from {1, ..., N } and form an (unbiased) estimate of loss and gradient based on the corresponding subset of training examples 1 X ∂ (S) L(S) (θ) = l(θ, xn ) , g(S) (θ) = L (θ) . S ∂θ n∈B We consider stochastic gradient descent (SGD) with learning rate η, as defined by the update rule θ(t + 1) = θ(t) − ηg (S) (θ) . We now make the following assumptions: (1) By the central limit theorem (CLT), we assume the noise in the stochastic gradient is Gaussian with covariance matrix S1 C(θ) 1 g(S) (θ) = g(θ) + √ ∆g(θ), where ∆g(θ) ∼ N (0, C(θ)) . S We note that the covariance is symmetric positive-semidefinite, and so can be decomposed into the product of two matrices C(θ) = B(θ)B> (θ) . (2) We assume the discrete process of SGD can be approximated by the continuous time limit of the following stochastic differential equation (known as a Langevin equation) dθ η = −ηg(θ) + √ B(θ)f (t) (1) dt S 3 where f (t) is a normalized Gaussian time-dependent stochastic term. Note that the continuous time approximation of SGD as a stochastic differential equation has been shown to hold in a weak approximation on the condition that the learning rate is small (Li et al., 2017). 3.2 M AIN R ESULTS The Langevin equation is a stochastic differential equation, and we are interested in its equilibrium distribution which gives insights into the behavior of SGD and the properties of the points it converges to. Assuming isotropic noise, the Langevin equation is well known to have a GibbsBoltzmann distribution as its equilibrium distribution. This equilibrium distribution can be derived by finding the stationary solution of the Fokker-Planck equation, with detailed balance, which governs the evolution of the probability density of the value of the parameters with time. The FokkerPlanck equation and its derivation can be found in Appendix A in equation (5). In Appendix C we restate the standard proofs of the stationary distribution of a Langevin system, and provide the resulting Gibbs-Boltzmann equilbirium distribution here, using the notation of this paper: Theorem 1 (Equilibrium Distribution). Assume1 that the gradient covariance is isotropic, i.e. C(θ) = σ 2 I, where σ 2 is a constant. Then the equilibrium distribution of the stochastic differential equation 1 is given by   2L(θ) P (θ) = P0 exp − , (2) nσ 2 where n ≡ Sη and P0 is a normalization constant, which is well defined for loss functions with L2 regularization. Discussion: Here P (θ) defines the density over the parameter space. The above result says that if we run SGD for long enough (under the assumptions made regarding the SGD sufficiently matching the infinitesimal limit), then the probability of the parameters being in a particular state asymptotically follows the above density. Note, that n ≡ Sη is a measure of the noise in the system set by the choice of learning rate η and batch size S. The fact that the loss is divided by n emphasizes that the higher the noise n, the less granular the loss surface appears to SGD. The gradient variance C(θ) on the other hand is determined by the dataset and model priors (e.g. architecture, model parameterization, batch normalization etc.). This reveals an important area of investigation, i.e., how different architectures and model parameterizations affect the gradient’s covariance structure. We note that in the analysis above, the assumption of the gradient covariance C(θ) being fixed and isotropic in the parameter space is unrealistic. However it is a simplification that enables straightforward insights regarding the relationship of the noise, batch size and learning rate in the Gibbs-Boltzmann equilibrium. We empirically show that various predictions based on this relationship hold in practice. Returning to SGD as an optimization method, we can ask, given the probability density P (θ) can we derive the probability of ending at a given minimum, θ A , which we will denote by lowercase pA = p̃A C, where C is a normalization constant which is the same for all minima (the unnormalized probability p̃A is all we are interested in when estimating the relative probability of finishing in a given minimum compared to another one). This probability is derived in Appendix D, and given in the following theorem, which is the core result of our theory. Theorem 2 (Probability of ending in region near minima θ A ). Assume the loss is locally strictly convex with Hessian HA and loss LA at a minimum θ A . Then the unnormalized probability of ending in minima θ A is   1 2LA p̃A = √ exp − 2 (3) nσ det HA where n = η S is the noise used in the SGD process to reach θA . Discussion: For this analysis, we qualitatively categorize a minima θ A by its loss LA (depth) and the determinant of the Hessian det HA (a larger determinant implies a sharper minima). The above 1 Here we also assume a weak regularity condition that the loss L(θ) includes the regularization term τ kθk22 for some τ > 0. 4 result shows that the probability of landing in a specific minimum depends on three factors - learning rate, batch-size and covariance of the gradients. The two factors that we directly control only appear in the ratio given by the noise n = η/S. To study which kind of minima are more likely if we were to reach equilibrium, it is instructive to consider the ratio of probabilities pA and pB at minima θ A and θ B respectively given by r   pA 2 det HB (LB − LA ) . = exp pB det HA nσ 2 To highlight that towards the equilibrium solution SGD favors wider rather than sharper minima, let’s consider the special case when LA = LB , i.e., both minima have the same loss value. Then, r pA det HB = . pB det HA This case highlights that in equilibrium, SGD favors the minimum with lower determinant of the Hessian (i.e. the flatter minima) when all other factors are identical. On the flip side, it can be seen that if two minima have the same curvature (det HA = det HB ), then SGD will favor the minima with lower loss. Finally in the general case when LA ≥ LB , it holds that pA ≥ pB if and only if q  det HB 2 2σ log det HA 1 ≤ ≡Y . n (LA − LB ) That is, there is an upper bound on the inverse of the noise for θ A to be favored in the case that its loss is higher than at θ B , and this upper bound depends on the difference in the heights compared to the ratio of the widths. In particular we can see that if det HB < det HA , then Y < 0, and so no amount of noise will result in θ A being more probable than θ B . In words, if the minimum at θ A is both higher and sharper than the minimum at θ B , it is never reached with higher probability than θ B , regardless of the amount of noise. However, if det HB > det HA then Y > 0, and there is a lower bound on the noise (LA − LB ) q  n> (4) det HB 2σ 2 log det HA to make θ A more probable than θ B . In words, if the minimum at θ A is higher but flatter than the minimum at θ B , it is favored over θ B , as long as the noise is large enough, as defined by eq. (4). To summarize, the presented theory shows that the noise level in SGD (which is defined by the ratio of learning rate to batch size) controls the extent to which optimization favors wider over deeper minima. Increasing the noise by increasing the ratio of learning rate to batch size increases the probability of wider compared to deeper minima. For a discussion on the relative probabilities of critical points that are not strictly minima, see appendix D. 4 4.1 E XPERIMENTS I MPACT OF η S ON THE MINIMA SGD FINDS In this section, we empirically study the impact of learning rate η and batch size S on the local minimum that SGD finds. We first focus on a 4-layer Batch Normalized ReLU MLP trained on Fashion-MNIST (Xiao et al., 2017). We study how the noise ratio n = Sη leads to minima with different curvatures and validation accuracy. To measure the curvature at a minimum, we compute the norm of its Hessian (a higher norm implies higher sharpness of the minimum) using the finite difference method (Wu et al., 2017). In Figure 1a, we report the norm of the Hessian for local minima obtained by SGD for different n = Sη , where η ∈ [5e − 3, 1e − 1] and S ∈ [25, 1000]. Each experiment is run for 200 epochs; most models reach approximately 100% accuracy on train set. As n grows, we observe that the norm of the Hessian at the minima also decreases, suggesting that higher Sη pushes the optimization towards flatter minima. This agrees with Theorem 2, Eq. (3), that higher Sη favors flatter over sharper minima. Figure 1b shows the results from exploring the impact of n = Sη on the final validation performance, which confirms that better generalization correlates with higher n. Taken together, Fig. 1a and 5 Validation performance Log Hessian norm 90% 90% 89% 89% 88% 88% 87% 87%0E+00 1E-03 2E-03 3E-03 4E-03 4E-01 2E-01 0E+00 0E+00 2E-03 4E-03 /S η S (a) Correlation of norm of Hessian. /S with logarithm of (b) Correlation of accuracy. η S with validation Figure 1: Impact on SGD with ratio of learning rate η and batch size S for 4 layer ReLU MLP on FashionMNIST. train accuracy val accuracy train loss val loss 40 20 0 1.0 0.5 (a) left 0.0 0.5 η=0.1 , S=128 1.0 right 1.5 2.0 η=0.1 S=1024 100 train accuracy val accuracy train loss val loss 80 60 40 20 0 1.0 (b) left 0.5 CIFAR10 (Resnet56): /S = 0.1/1024, /S = 0.01/128 Accuracy (and scaled cross-entropy) 80 60 CIFAR10 (Resnet56): /S = 0.1/128, /S = 0.01/128 Accuracy (and scaled cross-entropy) Accuracy (and scaled cross-entropy) CIFAR10 (Resnet56): /S = 0.1/128, /S = 0.1/1024 100 0.0 0.5 η=0.1 , S=128 1.0 right 1.5 η=0.01 S=128 2.0 100 80 60 40 20 0 train accuracy val accuracy train loss val loss 1.0 (c) left 0.5 0.0 η=0.1 , S=1024 0.5 1.0 right 1.5 2.0 η=0.01 S=128 Figure 2: Interpolation of Resnet56 networks trained with different learning rate to batch size ratio, η η S . α (x-axis) corresponds to the interpolation coefficient. As predicted by our theory, lower S ratio leads to sharper minima (as shown by the left and middle plot). Fig. 1b imply wider minima correlate well with better generalization. As n = Sη increases, SGD finds local minima that generalize better. In Appendix F.1, we report similar results for Resnet56 applied on CIFAR10 in Figure 9, for a 20 layer ReLU network with good initialization schemes in Figures 10a and 10c, and with bad initilization in Figure 10b. 100 80 60 40 20 0 CIFAR10 (VGG11): = 1, = 4 Accuracy (and scaled cross-entropy) Accuracy (and scaled cross-entropy) To further illustrate the behavior of SGD with different noise levels, we train three Resnet56 models on CIFAR10 using SGD (with a learning rate of 0.1 and without momentum) with different Sη . η=0.1 η=0.1 Our baseline model uses S=128 . In comparision, we investigate a large batch model with S=1024 train accuracy val accuracy train loss val loss 1.0 0.5 0.0 0.5 1.0 1.5 2.0 CIFAR10 (VGG11): = 1, = 0.25 100 80 train accuracy 60 val accuracy train loss 40 val loss 20 0 1.0 0.5 0.0 0.5 1.0 1.5 2.0 (a) β = 1 corresponds to model at α = 0 and (b) β = 1 corresponds to model at α = 0 and β = 4 corresponds to model at α = 1 β = 0.25 corresponds to model at α = 1 Figure 3: Interpolation between parameters of models trained with the same learning rate (η) to batch-size (S) ratio: η=0.1×β S=50×β , but different η and S values determined by β. As predicted by our theory, the minima for models with identical noise levels should be qualitatively similar as can be seen by these plots. 6 100 80 80 Accuracy Accuracy 100 60 40 20 0 100 Epoch Cyclic BS Train Cyclic LR Train Cyclic BS Test Cyclic LR Test 200 300 60 40 bs=128, lr=0.001 train bs=640, lr0.005 train bs=128, lr=0.001 test bs=640, lr=0.005 test 100 200 300 Epoch 20 0 Figure 4: Learning rate schedule can be replaced by an equivalent batch size schedule. The ratio of learning rate to batch size is equal at all times for both red and blue curves in each plot. Above plots show train and test accuracy for experiments involving VGG-11 architecture on CIFAR10 dataset. Left: cyclic batch size schedule (blue) in range 128 to 640, compared to cyclic learning rate schedule (red) in range 0.001 to 0.005. Right: constant batch size 128 and constant learning rate 0.001 (blue), compared to constant batch size 640 and constant learning rate 0.005 (red). η and a small learning rate model with η=0.01 S=128 , which have approximately the same S ratio. We follow (Goodfellow et al., 2014) by investigating the loss on the line interpolating between the parameters of two models. More specifically, let θ 1 and θ 2 be the final parameters found by SGD using different Sη , we report the loss values L((1 − α)θ 1 + αθ 2 ) for α ∈ [−1, 2]. Results indicate that models with large batch size (Fig. 2-left) or low learning rate (Fig. 2-middle; both having a lower Sη than the baseline) end up in a sharper minimum relative to the baseline model. These plots are consistent with our theoretical analysis that higher n = η/S gives preference to wider minima over sharper minima. On the other hand, figure 2 (right) shows that models trained with roughly the same level of noise end up in minima of similar quality. The following experiment explores this aspect further. We train VGG-11 models (Simonyan & Zisserman, 2014) on CIFAR-10, such that all the models are trained with the same noise level but with different values of learning rate and batch size. Specifically, we use η=0.1×β S=50×β , where we set β = 0.25, 1, 4. We then interpolate between the model parameters found when training with β = 1 and β = 4 (Fig. 3-left), and β = 1 and β = 0.25 (Fig. 3-right). The interpolation results indicate that all the minima have similar width and depth, qualitatively supporting our theoretical observation that for the same noise ratio SGD ends up in minima of similar quality. 4.2 η S RATIO INFLUENCES LEARNING DYNAMICS OF SGD In this section we look at two experimental phenomena: firstly, the equilibrium endpoint of SGD and secondly the dynamical evolution of SGD. The former, was theoretically analysed in the theory section, while the latter is not directly addressed in the theory section, but we note that the two are related - the endpoint is the result of the intermediate dynamics. We experimentally study both phenomena in the following four experiments involving the VGG11 architecture on the CIFAR10 dataset, shown in Fig 4. The left plot compares two experiments: cyclic batch size schedule (blue) in range 128 to 640, compared to cyclic learning rate schedule (red) in range 0.001 to 0.005. The right plot compares two other experiments: constant learning rate to η 0.005 batch-size ratio of Sη = 0.001 128 (blue) and S = 640 (red). Regarding the first phenomena, of the endpoint of SGD, the test accuracy when training with a cyclic batch size and cyclic learning rate is 89.39% and 89.24%, respectively, and we emphasize that these are similar scores. For a constant learning rate to batch-size ratio of Sη = 0.001 128 and η 0.005 = , the test accuracy is 87.25% and 86.92%, respectively, and we again emphasize that these S 640 two scores are similar to each other. That in each of these experiments the endpoint test accuracies 7 Random label accuracy 25.0% random labels 55% 50.0% random labels 76% 74% 50% 72% 45% 70% 68% 40% 65% 63% 35% 62% 60%0% 20% 40% 60% 80% 100% 30%0% 20% 40% 60% 80% 100% Validation accuracy Validation accuracy 25.0% random labels 55% 50.0% random labels 76% 74% 50% 72% 45% 70% 68% 40% 65% 63% 35% 62% 60%0% 20% 40% 60% 80% 100% 30%0% 20% 40% 60% 80% 100% Random label accuracy Random label accuracy Random label accuracy Figure 5: Impact of Sη on memorization of MNIST when 25% and 50% of labels in the training set are replaced with random labels, using no momentum (on the right) or a momentum with parameter 0.9 (on the left). We observe that for a specific level of memorization, high Sη leads to better generalization. Red has higher value of Sη than blue. are similar shows exchangability of learning rate for batch size for the endpoint, and is consistent with our theoretical calculation which says characteristics of the minima found at the endpoint are determined by the ratio of learning rate to batch-size, but not individually on learning rate or batch size. Regarding the second phenomena of the dynamical evolution, we note the similarity of the training and test accuracy curves for each pair of same-noise curves in each experiment. Our theoretical analysis does not explain this phenomena, as it does not determine the dynamical distribution. Nonetheless, we report it here as an interesting observation, and point to Appendix B for some intuition on why this may occur from the Fokker-Planck equation. In Appendix F.2, Fig. 11 we show in more detail the loss curves. While the epoch-averaged loss curves match well when exchanging batch size for learning rate, the per-iteration loss is not invariant to switching batch size for learning rate. In particular, we note that each run with smaller batch-size has higher variance in per-iteration loss than it’s same-noise pair. This is expected, since from one iteration to the next, the examples will have higher variance for a smaller batch-size. The take-away message from this section is that the endpoint and dynamics of SGD are approximately invariant if the batch size and learning rate are simultaneously rescaled by the same amount. This is in contrast to a commonly used heuristic consisting √ of scaling the learning rate with the square root of the batch size, i.e. of keeping the ratio η/ S constant. This is used for example by (Hoffer et al., 2017) as a way of keeping the covariance matrix of the parameter update step the same for any batch size. However, our theory and experiments suggest changing learning rate and batch size in a way that keeps the ratio n = η/S constant instead, since this results in the same equilibrium distribution. 4.3 I MPACT OF SGD ON M EMORIZATION To generalize well, a model must identify the underlying pattern in the data instead of simply perfectly memorizing each training example. An empirical approach to test for memorization is to analyze how good a DNN can fit a training set when the true labels are partly replaced by random labels (Zhang et al., 2016; Arpit et al., 2017). The experiments described in this section highlight that SGD with a sufficient amount of noise improves generalization at a given level of memorization. Experiments are performed on the MNIST dataset with an MLP similar to the one used by (Arpit et al., 2017), but with 256 hidden units. We train the MLP with different amounts of random labels in the training set. For each level of label noise, we evaluate the impact of Sη on the generalization performance. Specifically, we run experiments with Sη taking values in a grid with batch size in {50, 100, 200, 500, 1000}, learning rate in {0.005, 0.01, 0.02, 0.05, 0.07, 0.1}, and momentum in {0.0, 0.9}. Models are trained for 300 epochs. Fig. 5 reports the MLPs performances on both the noisy training set and the validation set. The results show that larger noise in SGD (regardless if induced by using a smaller batch size or a larger learning rate) leads to solutions which generalize better for the same amount of random labels memorized on the training set. Thus, our analysis highlights that SGD with low noise n = Sη steers the endpoint of optimization towards a minimum with low generalization ability. 8 Discrete S Hessian norm Loss 1.6E+05 Discrete 1.6E+05 Triangle = 0.001 1.6E+05 1.4E+05 1.4E+05 1.4E+05 1.2E+05 1.2E+05 1.2E+05 1.2E+05 1.2E+05 1.0E+05 1.0E+05 1.0E+05 1.0E+05 1.0E+05 8.0E+04 8.0E+04 8.0E+04 8.0E+04 8.0E+04 6.0E+04 6.0E+04 6.0E+04 6.0E+04 6.0E+04 4.0E+04 4.0E+04 4.0E+04 4.0E+04 4.0E+04 2.0E+04 2.0E+04 2.0E+04 2.0E+04 2.0E+04 0 50 100 150 200 250 300 Epoch 0 50 100 150 200 250 300 Epoch 0 50 100 150 200 250 300 Epoch = 0.005 1.6E+05 1.4E+05 Hessian norm 1.4E+05 0 50 100 150 200 250 300 Epoch 2.0 1.5 Train loss 1.6E+05 1.0 0.5 0 50 100 150 200 250 300 Epoch 0.0 Figure 6: Cyclical schemes oscillate between sharp and wide regions. Additionally, cyclical schemes find wider minima than baseline run for same level of loss, which might explain their better generalization. All cyclical schedules use base η = 0.005 and cycle length 15 epochs, which approximate convergence at the end of each cycle. Plots from left to right: discrete S, discrete η, triangle η, constant learning rate η = 0.001, constant learning rate η = 0.005. On vertical axis we report loss (red) and approximated norm of Hessian (blue). Discrete η Discrete S Triangle η Baseline Test acc Valid acc Loss Hessian norm. 90.04% ± 0.18% 90.07% ± 0.32% 90.03% ± 0.10% 87.70% ± 0.56% 90.30% ± 0.07% 90.25% ± 0.06% 90.04% ± 0.23% 88.36% ± 0.13% 0.048 ± 0.001 0.050 ± 0.002 0.068 ± 0.002 0.033 ± 0.001 36470 13918 35310 57838 Table 1: Comparison between different cyclical training schedules (cycle length and learning rate are optimized using a grid search). Discrete schedules perform similarly, or slightly better than triangular. Additionally, discrete S schedule leads to much wider minima for similar loss. Hessian norm is approximated on 1 out of 6 repetitions and measured at minimum value (usually endpoint of training). While Fig 5 reports the generalization at the endpoint, we observe that SGD with larger noise continuously steers away from sharp solutions throughout the dynamics. We also reproduce the observation reported by (Arpit et al., 2017): that memorization roughly starts after reaching maximum generalization. For runs with momentum we exclude learning rates higher than 0.02 as they lead to divergence. Full learning curves are reported in Fig. 12 included in Appendix F.3. 4.4 C YCLICAL BATCH AND L EARNING R ATE S CHEDULES It has been observed that a cyclic learning rate (CLR) schedule leads to better generalization (Smith, 2015). In Sec. 4.2 we demonstrated that one can exchange cyclic learning rate schedule (CLR) with cyclic batch size (CBS) and approximately preserve the practical benefit of CLR. This exchangeability shows that the generalization benefit of CLR must come from the varying noise level, rather than just from cycling the learning rate. To explore why this helps generalization, we run VGG11 on CIFAR10 using 4 training schedules: we compared two discrete schedules (where either η or S switches discretely from one value to another between epochs) and two baseline schedules, one constant (η is constant) and one triangle (η is interpolated linearly between its maximum and minimum value). We track the norm of the Hessian and the training loss throughout training. Each experiment is repeated six times. For each schedule we optimize η in [1e − 3, 5e − 2] and cycle length in {5, 10, 15} on a validation set. In all cyclical schedules the maximum value (of η or S) is 5× larger than the minimum value. First, we observe that cyclical schemes oscillate between sharp and wide regions of the parameter space, see Fig. 6. Next, we empirically demonstrate that a discrete schedule varying either S or η performs similarly, or slightly better than triangular CLR schedule, see Tab. 1. Finally, we observe that cyclical schemes reach wider minima at the same loss value, see Fig. 6 and Tab. 1. All of the above suggest that by changing noise levels cyclical schemes reach different endpoints than constant learning rate schemes with same final noise level. We leave the exploration of the implications and a more thorough comparison with other learning schedules for future work. 9 90 70 = 1 (83.0±0.15) = 3 (82.7±0.07) = 5 (82.5±0.29) = 7 (82.1±0.06) = 9 (81.4±0.27) = 11 (81.0±0.3) = 13 (69.3±7.83) = 15 (77.5±1.05)* 60 50 40 30 20 10 0 25 50 75 100 epoch 125 150 175 validation accuracy validation accuracy 80 80 70 50 40 30 20 10 200 = 1 (87.1±0.13) = 3 (87.0±0.2) = 5 (86.6±0.15) = 7 (86.4±0.14) = 9 (86.3±0.17) = 11 (77.8±13.9) = 13 (85.8±0.01)* = 15 (80.4±3.09)* 60 0 (a) Train dataset size 12000 50 75 100 epoch 125 150 175 200 (b) Train dataset size 22500 90 80 70 = 1 (90.4±0.12) = 3 (90.3±0.12) = 5 (90.3±0.14) = 7 (90.2±0.09) = 9 (90.0±0.11) = 11 (89.7±0.22) = 13 (89.1±0.42) = 15 (88.6±0.0)* 60 50 40 30 20 10 0 25 50 75 100 epoch 125 150 175 validation accuracy 90 validation accuracy 25 80 70 50 40 30 20 10 200 = 1 (89.8±0.09) = 5 (89.6±0.14) = 9 (89.5±0.11) = 13 (89.3±0.11) = 17 (89.2±0.1) = 21 (88.9±0.16) = 25 (85.4±5.43) = 29 (85.1±1.01)* 60 (c) Train dataset size 45000 0 25 50 75 100 epoch 125 150 175 200 (d) Half the noise Figure 7: Breaking point analysis: Our theory suggests the final performance should be similar when β×η the SGD noise level β×S is kept the same. Here we study its breaking point in terms of too large a learning rate or too small a batch size. (a,b,c)- Validation accuracy for different dataset sizes and different β values for a VGG-11 architecture trained on CIFAR10. In each experiment, we multiply the learning rate (η) and batch size (S) with β such that the ratio β×(η=0.1) β×(S=50) is fixed. We observe that for the same ratio, increasing the learning rate and batch size yields similar performance up to a certain β value, for which the performance drops significantly. (d)- Breaking point analysis when half the noise level β×(η=0.05) β×(S=50) is used. The breaking point happens for much larger β when using a smaller noise. All experiments are repeated 5 times with different random seeds. The graphs denote the mean validation accuracies and the numbers in the brackets denote the mean and standard deviation of the maximum validation accuracy across different runs. The * denotes at least one seed lead to divergence. 4.5 B REAKING P OINT OF THE T HEORY IN P RACTICE Our analysis relies on the assumption that the gradient step is sufficiently small to guarantee that the first order approximation of a Taylor’s expansion is a good estimate of the loss function. In the case where the learning rate becomes too high, this approximation is no longer suitable, and the continuous limit of the discrete SGD update equation will no longer be valid. In this case, the stochastic differential equation doesn’t hold, and hence neither does the Fokker-Planck equation, and so we don’t expect our theory to be valid. In particular, we don’t expect to arrive at the same stationary distribution as indicated by a fixed ratio η/S, if the learning rate gets too high. This is exemplified by the empirical results reported in Fig. 7, where similar learning dynamics and final performance can be observed when simultaneously multiplying the learning rate and batch size by a factor β up to a certain limit. This is done for different training set sizes to investigate if the breaking point depends on this factor (Fig. 7 a,b,c). The plots suggest that the breaking point happens for smaller β values if the dataset size is smaller. We also investigate the influence of β 10 when half the noise level is used, due to halving the learning rate, in (figure 7 d). These experiments strongly suggest that the reason behind breaking point is the use of a high learning rate because the performance drops at much higher β when the base learning rate is halved. A similar experiment is performed on Resnets (for results see Fig 8 in the appendix). We highlight other limitations of our theory in appendix E. 5 D ISCUSSION In the theoretical section of this work we treat the learning rate as fixed throughout training. However, in practical applications, the learning rate is annealed to a lower value, either gradually or in discrete jumps. When viewed within our framework, at the beginning with high noise, SGD favors width over depth of a region, then as the noise decreases, SGD prioritizes the depth more strongly this can be seen from Theorem 3 and the comments that follow. In the theoretical section we made the additional assumption that the covariance of the gradients is isotropic, in order to be able to derive a closed form solution for the equilibrium distribution. We do not expect this assumption to hold in practice, but speculate that there may be mechanisms which drive the covariance towards isotropy, for example one may be able to tune learning rates on a per-parameter basis in such a way that the combination of learning rate and covariance matrix is approximately isotropic – this may lead to improvements in optimization. Perhaps some existing mechanisms such as batch normalization or careful initialization give rise to more equalized covariance - we leave study of this for future work. We note further that our theoretical analysis considered an equilibrium distribution, which was independent of the intermediate dynamics. However, this may not be the case in practice. Without the isotropic covariance, the system of partial differential equations in the late time limit will in general have a solution which will depend on the path through which optimization occurs, unless other restrictive assumptions are made to force this path dependence to disappear (Chaudhari & Soatto, 2017). Despite this simplifying assumption, our empirical results are consistent with the developed theory. We leave study of path dependence and dynamics to future work. In experiments investigating memorization we explored how the noise level changes the preference of wide minima over sharp ones. (Arpit et al., 2017) argues that SGD first learns true labels, before focusing on random labels. Our insight is that in the second phase the high level of noise maintains generalization. This illustrates the trade-off between width of minima and depth in practice. When the noise level is lower, DNNs are more likely to fit random labels better, at the expense of generalizing less well on true ones. 6 C ONCLUSIONS We shed light on the role of noise in SGD optimization of DNNs and argue that three factors (batch size, learning rate and gradient variance) strongly influence the properties (loss and width) of the final minima at which SGD converges. The learning rate and batch size of SGD can be viewed as one effective hyper-parameter acting as a noise factor n = η/S. This, together with the gradient covariance influences the trade-off between the loss and width of the final minima. Specifically, higher noise favors wider minima, which in turn correlates with better generalization. Further, we experimentally verify that the noise n = η/S determines the width and height of the minima towards which SGD converges. We also show the impact of this noise on the memorization phenomenon. We discuss the limitations of the theory in practice, exemplified by when the learning rate gets too large. We also experimentally verify that η and S can be simultaneously rescaled as long as the noise η/S remains the same. ACKNOWLEDGMENTS We thank Jason Jo, and Nicolas Le Roux, Mike Rabbat, Leon Bottou, and James Griffin for helpful discussions. SJ was supported by Grant No. DI 2014/016644 from Ministry of Science and Higher Education, Poland and ETIUDA stipend No. 2017/24/T/ST6/00487 from National Science Centre, Poland. ZK was supported in part by an EA Grant from the Centre for Effective Altruism. We 11 acknowledge the computing resources provided by ComputeCanada and CalculQuebec. We made use of the following frameworks TensorFlow (Abadi et al., 2015), Theano (Theano Development Team, 2016) and PyTorch. R EFERENCES Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org. Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017. Dario Amodei, Sundaram Ananthanarayanan, Rishita Anubhai, Jingliang Bai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Qiang Cheng, Guoliang Chen, et al. Deep speech 2: Endto-end speech recognition in english and mandarin. In International Conference on Machine Learning, pp. 173–182, 2016. Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 233–242, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/ v70/arpit17a.html. Léon Bottou. Stochastic gradient learning in neural networks. Proceedings of Neuro-Nımes, 91(8), 1991. Léon Bottou. Online learning and stochastic approximations. On-line learning in neural networks, 17(9):142, 1998. Pratik Chaudhari and Stefano Soatto. Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks. arXiv preprint arXiv:1710.11029, 2017. Pratik Chaudhari, Adam Oberman, Stanley Osher, Stefano Soatto, and Guillame Carlier. Deep relaxation: partial differential equations for optimizing deep neural networks. arXiv preprint arXiv:1704.04932, 2017. T. Chen, E. B. Fox, and C. Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In Proceedings of the 31st International Conference on Machine Learning, pp. 1683–1691, 2014. N. Ding, Y. Fang, R. Babbush, C. Chen, R. D. Skeel, and H. Neven. Bayesian sampling using stochastic gradient thermostats. In Advances in Neural Information Processing Systems 27, pp. 3203–3211, 2014. L. Dinh, R. Pascanu, S. Bengio, and Y. Bengio. Sharp Minima Can Generalize For Deep Nets. ArXiv e-prints, March 2017. C. Gardiner. Stochastic Methods: A Handbook for the Natural and Social Sciences. Springer Series in Synergetics. Springer Berlin Heidelberg, 2010. ISBN 9783642089626. URL https: //books.google.ca/books?id=321EuQAACAAJ. Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014. 12 P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. ArXiv e-prints, June 2017. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997. E. Hoffer, I. Hubara, and D. Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. ArXiv e-prints, May 2017. Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014. Qianxiao Li, Cheng Tai, and Weinan E. Stochastic modified equations and adaptive stochastic gradient algorithms. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2101–2110, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/li17f.html. David JC MacKay. Bayesian methods for adaptive models. PhD thesis, California Institute of Technology, 1992. S. Mandt, M. D. Hoffman, and D. M. Blei. Stochastic Gradient Descent as Approximate Bayesian Inference. ArXiv e-prints, April 2017. A. Neelakantan, L. Vilnis, Q. V. Le, I. Sutskever, L. Kaiser, K. Kurach, and J. Martens. Adding Gradient Noise Improves Learning for Very Deep Networks. ArXiv e-prints, November 2015. Nicolas L. Roux, Pierre antoine Manzagol, and Yoshua Bengio. Topmoumoute online natural gradient algorithm. In J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis (eds.), Advances in Neural Information Processing Systems 20, pp. 849– 856. Curran Associates, Inc., 2008. URL http://papers.nips.cc/paper/ 3234-topmoumoute-online-natural-gradient-algorithm.pdf. Issei Sato and Hiroshi Nakagawa. Approximation analysis of stochastic gradient langevin dynamics by using fokker-planck equation and ito process. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 982–990, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/satoa14.html. Xiaocheng Shang, Zhanxing Zhu, Benedict Leimkuhler, and Amos J Storkey. Covariance-controlled adaptive Langevin thermostat for large-scale Bayesian sampling. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 37–45, 2015. N. Shirish Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang. On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima. ArXiv e-prints, September 2016. Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. CoRR, abs/1703.00810, 2017. URL http://arxiv.org/abs/1703.00810. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. L. N. Smith. Cyclical Learning Rates for Training Neural Networks. ArXiv e-prints, June 2015. Samuel L Smith and Quoc V Le. Understanding generalization and stochastic gradient descent. arXiv preprint arXiv:1710.06451, 2017. Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/ 1605.02688. 13 S. J. Vollmer, K. C. Zygalakis, and Y. W. Teh. (Non-) asymptotic properties of stochastic gradient Langevin dynamics. arXiv preprint arXiv:1501.00438, 2015. M. Welling and Y. W. Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning, pp. 681–688, 2011. Lei Wu, Zhanxing Zhu, et al. Towards understanding generalization of deep learning: Perspective of loss landscapes. arXiv preprint arXiv:1706.10239, 2017. H. Xiao, K. Rasul, and R. Vollgraf. Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. ArXiv e-prints, August 2017. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. A PPENDIX A D ERIVATION OF THE F OKKER -P LANCK E QUATION In this appendix we derive the Fokker-Planck equation. For any stochastic differential equation, since the evolution is noisy we can’t say exactly where in parameter space the parameter values will be at any given time. But we can talk about the probability P (θ, t|θ 0 , t0 ) that a parameter takes a certain value θ at a certain time t, given that it started at θ 0 , t0 . That is captured by the Fokker-Planck equation, which reads   ∂P (θ, t) η2 = ∇θ · ηg(θ)P (θ, t) + ∇θ · [C(θ)P (θ, t)] . (5) ∂t 2S In this appendix we will derive the above equation from the stochastic differential equation (6). We will not be interested in pure mathematical rigour, but intend the proof to add intuition for the machine learning audience. For brevity we will sometimes write the probability just as P (θ, t). We will sometimes make use of tensor index notation, where a tensor is denoted by its components, (for example θi are the components of the vector θ), and we will use the index summation convention, where a repeated index is to be summed over. We start with the stochastic differential equation dθ η = −ηg(θ) + √ B(θ)f (t). dt S (6) A formal expression for the probability for a given noise function f is given by P (θ, t) = δ(θ − θ f ), but since we don’t know the noise, we instead average over all possible noise functions to get P (θ, t) = E[δ(θ − θ f )]. (7) While this is just a formal solution we will make use of it later in the derivation. We now consider a small step in time δt, working at first order in δt, and ask how far the parameters move, denoted δθ, which is given by integrating (6) Z t+δt η δθ = −ηgδt + √ B f (t0 )dt0 (8) S t where we’ve assumed that δθ is small enough that we can evaluate g at the original θ. We now look at expectations of δθ. Using the fact that the noise is normalized Gaussian, E(f (t)) = 0, we get (switching to index notation for clarity) E(δθi ) = −ηgi δt (9) 14 and using that the noise is normalized Gaussian again, we have that E(f (t)f (t0 )) = Iδ(t − t0 ), leading to η2 Cij δt + O(δt2 ). (10) S If at time t we are at position θ 0 and end up at position θ = θ 0 + δθ at time t + δt, then we can take (7) with θ f = θ 0 and Taylor expand it in δθi ! ∂ 1 ∂2 0 2 P (θ, t + δt|θ , t) = 1 + E(δθi ) 0 + E(δθi δθj ) 0 0 + O(δt ) δ(θ − θ 0 ). (11) ∂θi 2 ∂θi ∂θj E(δθi δθj ) = We deal with the derivatives of the delta functions in the following way. We will use the following identity, called the Chapman-Kolmogorov equation, which reads Z +∞ dθ 0 P (θ, t + δt|θ 0 , t0 )P (θ 0 , t0 |θ 0 , t0 ) (12) P (θ, t + δt|θ 0 , t0 ) = −∞ 0 0 for any t , such that t0 ≤ t ≤ t + δt. This identity is an integral version of the chain rule of probability, stating there are multiple paths of getting from an initial position θ 0 to θ at time t + δt and one should sum all of these paths. We will now substitute (11) into the first term on the right hand side of (12) with t0 set to be t, and apply integration by parts (assuming vanishing boundary conditions at infinity) to move the derivatives off of the delta functions and onto the other terms. We end up with ∂ (E(δθi )P (θ, t|θ 0 , t0 )) ∂θi 1 ∂2 (E(δθi δθj )P (θ, t|θ 0 , t0 )) . + 2 ∂θi0 ∂θj0 P (θ, t + δt|θ 0 , t) = P (θ, t|θ 0 , t0 ) − (13) We can then take the first term on the right hand side of (13) to the other side, insert (9) and (10), divide by δt and take the limit δt → 0, getting a partial derivative with respect to time on the left hand side, leading directly to the Fokker-Planck equation quoted in the text (5) (where we have reverted back to vector notation from index notation for conciseness)   η2 ∂P (θ, t) = ∇θ · ηg(θ)P (θ, t) + ∇θ · [C(θ)P (θ, t)] . (14) ∂t 2S B I NTUITIONS FROM F OKKER -P LANCK In this appendix we will give some supplementary comments about the intuition we can gain from the Fokker-Planck equation (5). If the learning rate, batch size are constant and the covariance is proportional to the identity C = σ 2 I and σ 2 is constant, then we can rewrite the Fokker-Planck equation in the following form ∂P (θ, tη ) ησ 2 2 = ∇θ · [g(θ)P (θ, tη )] + ∇ P (θ, tη ) , ∂tη 2S θ (15) where we have rescaled the time coordinate to be tη ≡ tη. One can now see that in terms of this rescaled time coordinate, the ratio between the drift and diffusion terms is governed by the following ratio ησ 2 . (16) 2S In terms of the balance between drift and diffusion, we see that a higher value of this ratio gives rise to a more diffusive evolution, while a lower value allows the potential drift term to dominate. In the next section we will see how this ratio controls the stationary distribution at which SGD converges to. For now we highlight that in terms of this rescaled coordinate, only this ratio controls the evolution towards this stationary distribution (not just its endpoint), in terms of the rescaled time tη . That is, learning rate and batch size are interchangable in the sense that the ratio is invariant 15 under transformations S → aS, η → aη, for a > 0. But note that the time it takes to reach the stationary distribution depends on η as well, because of the rescaled time variable. For example, for a higher learning rate, but constant ratio, one arrives at the same stationary distribution, but in a quicker time by a factor of 1/η. However, a caution here is necessary. The first order SGD update equation only holds for small enough η that a first order approximation to a Taylor expansion is valid, and hence we expect the first order approximation of SGD as a continuous stochastic differential equation to break down for high η. Thus, we expect learning rate and batch size to be interchangable up to a maximum value of η at which the approximation breaks. C S TATIONARY D ISTRIBUTION In this appendix we will prove equation (2) quoted in the main text, which claims that for an isotropic covariance, C(θ) = σ 2 I, with σ constant, the equilibrium solution of the Fokker-Planck equation has the following form   2L(θ) P (θ) = P0 exp − , (17) nσ 2 where n ≡ Sη and P0 is a normalization constant, which is well defined for loss functions with L2 regularization. In order to prove this is the equilibrium distribution, we need to solve the Fokker-Planck equation (5) with the left hand side set equal to zero (which would give a stationary distribution) and further we require for equilibrium that detailed balance holds. To do this, we begin by writing the FokkerPlanck equation in a slightly different form, making use of a probability current J , defined η2 J ≡ ηg(θ)P (θ, t) + ∇θ · (C(θ)P (θ, t)) (18) 2S in which the Fokker-Planck equation becomes ∂P (θ, t) = ∇θ · J . (19) ∂t 2 At this point we use the assumption that C(θ) = σ I to get η2 σ2 J = ηg(θ)P (θ, t) + ∇θ P (θ, t). (20) 2S (θ,t) The stationary solution has ∂P∂t = 0 and hence ∇θ · J = 0. But we require the equilibrium solution, which is a stronger demand than just the stationary solution. The equuilibrium solution is a particular stationary solution in which detailed balance occurs. Detailed balance means that in the stationary solution, each individual transition balances precisely with its time reverse, resulting in zero probability currents, see §5.3.5 of (Gardiner, 2010), i.e. that J = 0. Detailed balance is a sufficient condition for having entropy increasing with time. Non-zero J with ∇θ · J = 0 would correspond to a non-equilibrium stationary distribution, which we don’t consider here. For the equilibrium solution, J = 0, we get the result for the probability distribution   2S (21) P (θ) = P0 exp − 2 L(θ) . ησ which is the desired stationary solution we intended to find. Finally, to ensure that P0 is a finite value, we note that the loss function L(θ) can be decomposed as, L(θ) = L0 (θ) + τ kθk2 (22) where τ is some non-negative constant controlling L2 regularization. Then we see that,   Z 2S P0 = exp − 2 L(θ) (23) ησ θ   Z 2S (24) = exp − 2 L0 (θ) − τ kθk2 ησ θ   Z  2S (25) = exp − 2 L0 (θ) exp −τ kθk2 ησ θ 16   2S 2S Since L0 (θ) ≥ 0 and ησ − ησ ≤ 1, thus, 2 > 0, we have that exp 2 L0 (θ)   Z Z   2S exp −τ kθk2 (26) exp − 2 L0 (θ) exp −τ kθk2 ≤ ησ θ θ and we now note that the right hand side of (26) is finite because it is just a multidimensional Gaussian integral. Thus, P0 has a finite value and hence the stationary distribution P (θ) is well defined. D D ERIVATION OF P ROBABILITY OF E NDING IN A GIVEN M INIMA In this appendix we derive the discrete set of probabilities of ending at each minima, as given in (3). Essentially, we will use Laplace’s method to approximate the integral of the probability density in the region near a minimum. We work locally near θ A and take the following approximation of the loss function, since it is near a minimum, 1 L(θ) ≈ LA + (θ − θ A )> HA (θ − θ A ). (27) 2 where HA is the Hessian, and is positive definite for a minimum. The distribution PA (θ) is a probability density, while we are interested in the discrete set of probabilities of ending at a given minimum, which we will denote by lowercase pA . To calculate this discrete set of probabilities, for each minimum we need to integrate this stationary distribution over an interval containing the minimum. Integrating (17) in some region RA around θ A and using (27)   Z 2S p A ≈ P0 (28) exp − 2 L(θ) ησ RA    Z 2S 1 ≈ P0 (29) exp − 2 LA + (θ − θ A )> HA (θ − θ A ) ησ 2 RA  r 2SLA 1 ≈ P̃0 exp − (30) ησ 2 det HA where in the last line we assume the region is large enough that an approximation to the full Gaussian integral can be used (i.e. that the tails don’t contribute, which is fine as long as the region is sufficiently larger than det HA ) – note that the region can’t be too large, otherwise we would invalidate our local assumption. The picture is that the minima are sufficiently far apart that the region can be taken sufficiently large for this approximation to be valid. Note that P̃0 is different to P0 and includes the normalization factors from performing the Gaussian integral, which are the same for all minima. Since we are interested in relative probabilities between different minima, so we can consider the unnormalized probability, dropping factors that are common amongst all minima we get r  1 2SLA p̃A = exp − (31) ησ 2 det HA This is the required expression given in the main text. We note that the derivation used above talks about strict minima, i.e., minima with a positive definite Hessian. In practice however, for deep neural networks with a large number of parameters, it is unrealistic to expect the endpoint of training to be in a strict minimum. Instead, it is more likely to be a point at which the Hessian has positive eigenvalues in a few directions, while the other eigenvalues are (approximately) zero. In such cases, to understand which minima SGD favors, we can consider the fact that at equilibrium, the iterate of SGD follows the distribution,   2L(θ) P (θ) = P0 exp − (32) nσ 2 By definition this means that at any time during equilibrium, the iterate is more likely to be found in a region of higher probability. In the restrictive case of strict minimum, we model it as a Gaussian and characterize the probability of landing in a minimum depending on the curvature and depth of the loss around that minimum. In the general case of minima with degenerate (flat) directions, we can say that a minimum with more volume is a more probable one. 17 Valid Acc 80 60 baseline times 2 times 3 times 4 times 5 times 6 times 7 times 8 times 9 40 20 0 50 100 150 Epoch 200 250 300 Figure 8: Experiments involving Resnet56 architecture on CIFAR10 dataset. In each curve, we multiply the Sη ratio by a given factor (increasing both batch size and learning rate). We observe that multiplying the ratio by a factor up to 5 results in similar performances. However, the performances degrades for factor superior to 5. E L IMITATIONS OF OUR A NALYSIS Due to our assumptions, we expect the theory to become unreliable when the discrete to continuous approximation fails, when the covariance in gradients is non-isotropic, when the batch size becomes comparable to the finite size of the training set and when momentum is considered. We discussed the limits of the discrete to continous approximation in 4.5 (further illustrated in 8). When the covariance in gradients is highly non-isotropic, the equilibrium solution to the FokkerPlanck equation is the solution to a complicated partial differential equation, and one can’t easily spot the solution by inspection as we do in Appendix C. We expect this approximation to break down especially in the case of complicated architectures where different gradient directions will be have very different gradient covariances. Our theory does not involve the finite size of the training set, which is a drawback of the theory. This may be especially apparent when the batch size becomes large, compared to the training set size, and we expect the theory to break down at this point. Finally, we mention that momentum is used in practical deep learning optimization algorithms. Our theory does not consider momentum, which is a drawback of the theory and we expect it to break down in models in which momentum is important. We can write a Langevin equation for the case of momentum, with momentum damping coefficient µ, dv ηB = −µv − ηg + √ f (t) dt S where the velocity is v = dθ/dt. The Fokker-Planck equation corresponding to this Langevin equation with momentum is     ∂ µ η2 σ2 2 + v · ∇θ P = η∇θ · vP + gP + ∇ P ∂t η 2S θ where P is now a function of velocity v as well as θ and t, and we’ve again assumed the gradient covariance varies slowly compared to the loss. From this more complicated Fokker-Planck equation, it is hard to spot the equilibrium distribution. We leave the study of this for further work. For now, we just note that a factor of η can be taken from the right hand side, and then the ratio between the diffusion and drift terms will again be the ratio ησ 2 /(2S). 18 92 91 Validation Accuracy 90 89 88 87 86 85 84 10 4 LR/BS 10 3 Figure 9: Validation accuracy of Resnet56 networks against different ratios learning rate to batch size on CIFAR10. Trained with SGD. 89% 8E-02 88% 87% 4E-02 86% 85% 0E+00 0E+00 4E-04 (a) Correlation of Hessian Norm. /S η S 8E-04 89% 89% 88% 88% 87% 87% 86% 86% 85% Validation performance Validation performance Log. Hessian norm 1E-01 0E+001E-04 2E-04 3E-04 4E-04 5E-04 6E-04 /S η S 0E+00 2E-04 4E-04 6E-04 8E-04 1E-03 with Log (b) Correlation of with valida- (c) Correlation of tion accuracy for bad initializa- tion accuracy. tion. /S η S with valida- Figure 10: Impact on SGD with ratio of learning rate η and batch size S for 20 layer ReLU MLP without Batch Normalization on FashionMNIST. F F.1 OTHER E MPIRICAL R ESULTS F URTHER I MPACTS OF SGD ON M INIMA In this appendix we look at other experiments exploring the correlation between learning rate to batch-size ratio and sharpness of minima, and to validation performance. In Figure 9, we report the validation accuracy for Resnet56 models trained on CIFAR10 with different learning rate to batchsize ratio. We notice there is a peak validation accuracy at a learning rate to batch-size ratio of around 2 × 10−3 . In particular, this example emphasizes that higher learning rate to batch-size ratio doesn’t necessarily lead to higher validation accuracy. Instead, it acts as a control on the validation accuracy, and there is an optimal learning rate to batch-size ratio. Figures 10a and 10c show the results of a variant of 4 layer ReLU experiment, where we use 20 layers and remove Batch Normalization. The inspiration is to test predictions of theory in the more challenging setup. We again observe a correlation of Hessian norm with learning rate to batch-size ratio (though weaker), and similarly between validation performance and learning rate to batch-size ratio. F.2 M ORE L EARNING R ATE & BATCH S IZE E XCHANGEABILITY In this appendix we show in more detail the experiments of Section 4.2 which show the exchangeability of learning rate and batch size. In Fig. 11 we show the log cross entropy loss, the epochaveraged log cross entropy loss, train, validation and test accuracy as well as the batch size schedule, learning rate schedule. We see in the learning rate to batch-size ratio plot that the orange and blue lines (cyclic schedules) have the same ratio of learning rate to batch-size as each other throughout, and that their dynamics are very similar to each other. The same holds for the green and red lines, of constant batch size and learning rate. This supports the theoretical result of this paper, that the ratio S/η governs the stationary distribution of SGD. 19 Figure 11: We show in more detail exchangeability of batch size and learning rate in a one-to-one ratio. In blue, cyclic batch size schedule between size 128 and 640 and fixed learning rate 0.005, is exchangeable with orange cyclic learning rate schedule between learning rates 0.001 and 0.005 with fixed batch size 128. In green, constant batch size 640 and constant learning rate 0.005 is exchangeable with, in red, constant batch size 128 and constant learning rate 0.005. We note that it is not just in the stationary distribution that the exchangeability holds in these plots - it appears throughout training, highlighted especially in the cyclic schedules. We postulate that due to the scaling relation in the Fokker-Planck equation, the exchangeability holds throughout learning as well as just at the end, as long as the learning rate does not get so high as to ruin the approximations under which the Fokker-Planck equation holds. We note similar behaviour occurs also for standard learning rate annealing schedules, which we omit here for brevity. 20 25.0% random labels Accuracy 100% 100% 80% 80% 60% 60% 40% 40% 20% 20% 0 50 100 150 200 250 300 50.0% random labels 100% Accuracy 25.0% random labels 0 50 100 150 200 250 300 100% 80% 80% 60% 60% 40% 40% 20% 20% 0 50 100 150 200 250 300 Epoch 50.0% random labels 0 50 100 150 200 250 300 Epoch Figure 12: Learning curves for memorization experiment with momentum 0.0. Solid lines represent training accuracy, dotted validation accuracy. Warm color indicates higher Sη ratio. 6.8E+00 Log. Hessian norm 6.6E+00 6.4E+00 6.2E+00 6.0E+00 5.8E+00 5.6E+00 0.0E+00 1.0E-03 /S 0.0E+00 2.0E-03 1.0E-03 /S 2.0E-03 Figure 13: Correlation between (approximate) norm of Hessian of best validation minima and learning rate to batch-size ratio for 0.0 (left) and 0.9 (right) momentum. F.3 D ETAILS ON MEMORIZATION EXPERIMENT We report learning curves from memorization experiment with 0.0 momentum, see Fig. 12. We additionally confirm similar results to the previous experiments and show correlation between batch size and learning rate ratio and norm of Hessian, see Fig. 13 without momentum (left) and with momentum 0.9 (right). 21
1cs.CV
arXiv:1705.06057v1 [cs.CV] 17 May 2017 Joint Learning from Earth Observation and OpenStreetMap Data to Get Faster Better Semantic Maps Nicolas Audebert, Bertrand Le Saux ONERA, The French Aerospace Lab F-91761 Palaiseau, France Sébastien Lefèvre Univ. Bretagne-Sud, UMR 6074, IRISA F-56000 Vannes, France (nicolas.audebert,bertrand.le_saux)@onera.fr [email protected] Abstract In this work, we investigate the use of OpenStreetMap data for semantic labeling of Earth Observation images. Deep neural networks have been used in the past for remote sensing data classification from various sensors, including multispectral, hyperspectral, SAR and LiDAR data. While OpenStreetMap has already been used as ground truth data for training such networks, this abundant data source remains rarely exploited as an input information layer. In this paper, we study different use cases and deep network architectures to leverage OpenStreetMap data for semantic labeling of aerial and satellite images. Especially, we look into fusion based architectures and coarseto-fine segmentation to include the OpenStreetMap layer into multispectral-based deep fully convolutional networks. We illustrate how these methods can be successfully used on two public datasets: ISPRS Potsdam and DFC2017. We show that OpenStreetMap data can efficiently be integrated into the vision-based deep learning models and that it significantly improves both the accuracy performance and the convergence speed of the networks. 1. Introduction Dense labeling of remote sensing data is a common task to generate semantic maps of large areas automatically, either to perform cartography of urban areas or to determine land use covers at a large scale. Many techniques that originated in the computer vision community for semantic segmentation can be applied on Red-Green-Blue (RGB) remote sensing data to this end and has been successfully used with state-of-the-art results, e.g. Convolutional Neural Networks (CNN) for land use classification [4] or Fully Convolutional Networks (FCN) for semantic labeling of urban areas [1]. Yet, remote sensing data is rarely limited to RGB channels. Often, multiple sensors are used to obtain complementary physical information about the observed area, with the final products being co-registered multispectral, LiDAR and SAR data. Several works successfully investigated semantic labeling of remote sensing data using fusion of multiple heterogeneous sensors [1, 26, 16] to leverage complementary informations sources. However, there is still a huge untapped source of information: the public geo-information system (GIS) databases that rely on voluntary crowdsourced annotations. These databases, such as the very popular OpenStreetMap (OSM), are an extremely valuable source of information, that is mostly used as a training ground truth [24] as it contains data layers such as roads, buildings footprints or forest coverage. But this data can also be seen as an alternative input layer that will provide another information channel compared to the classical sensors. Consequently, we investigate here the following question: how can we use OSM data to improve sensorbased semantic labeling of remote sensing data ? 2. Related work Semantic labeling of aerial and satellite images using deep neural networks has been investigated several times in the literature. Since the early work on road extraction using CNN [24], many studies investigated deep neural networks for automatic processing of aerial and satellite data. The most recent works using deep learning mostly focus on the use of Fully Convolutional Networks [20], an architecture initially designed for semantic segmentation of multimedia images, and later successfully applied to remote sensing data at various resolutions. This type of deep models obtained excellent results on very high resolution datasets [28], often combined with multiscale analysis [1], graphical model post-processing [33] and boundary prediction [22]. The same architectures were also successful for building and roads extraction from satellite images [21, 31, 34] at a significantly lower resolution. Although most of the works are limited to optical data, e.g. RGB or multispectral images, the fusion of heterogeneous data layers has also been investigated in several works. Notably, multimodal processing of very high resolution images has been successfully applied to a combination of deep features and superpixel classification in [3], while a deep framework for the fusion of video and multispectral data was proposed in [25]. Fusion of multitemporal data for joint registration and change detection was investigated in [32]. Heterogeneous data fusion was also explored through deep features mixed with hand-crafted features for random forest classification [26], and later using end-to-end deep networks in [1] for LiDAR and RGB data, and [16] for hyperspectral and SAR data. While all these works investigated data fusion of various sensors, they did not study the inclusion of highly processed, semantically richer data such as OpenStreetMap layers. Indeed, since the launch of OpenStreetMap (OSM) and Google Maps in 2004, map data became widely available and have been largely used within remote sensing applications. First, they can be used as targets for deep learning algorithms, such as in the seminal work of Mnih [24, 23], since those layers already provide accurate information about the buildings and roads footprints. More recent works in simultaneous registration and classification [32] and large-scale classification [21, 6] also rely on OSM data to perform supervised learning. The generation of OpenStreetMap rasters from optical images with Generative Adversarial Networks has also been investigated [17], but the authors did not evaluate their method with classification metrics as they were only interested by perceptually coherent image-to-image translation. Second, the map layers can be used as inputs of a processing flow to produce new geo-spatial data. Although the coverage and the quality of the annotations from open GIS vary a lot depending on the users’ knowledge and number of contributors, this data may contain relevant information for mapping specific areas and classes. A deterministic framework to create land use and land cover maps from crowdsourced maps such as OSM data was proposed in [10]. Machine learning tools (a random forest variant) also allow coupling remote sensing and volunteered geographic information (VGI) to predict natural hazard exposure [11] and local climate zones [8], while active deep learning helps finding unlabeled objects in OSM [5]. However, to the best of our knowledge, no VGI has been used as an input (opposite of a target) in deep neural networks yet. 3. Method In this work, we investigate two use cases for highly structured semantic data as input to deep networks. The first one occurs when the semantic data is close to the ground truth, in our case where OpenStreetMap already contains a part of the information we want to label, e.g. finding roads in airborne images. The second one occurs when what we want to label can be inferred from OpenStreetMap but only indirectly, for example when we want to derive the type of settlement based on building footprints. 3.1. Coarse-to-fine segmentation In some cases, OpenStreetMap data can be used as a coarse approximation from the ground truth, e.g. for objects such as buildings and roads. Therefore, we would need only to learn how to refine this coarse map to obtain the final very high resolution pixel-wise segmentation. Especially, learning only this difference can be seen as a form of residual learning [15] which should help the training process. This was also suggested in [19] to help the classification process by first learning coarse approximations of the ground truth before iteratively refining the predictions. In our case, we can use a simple FCN with only two layers to convert the raw rasterized OSM data into a semantic map that approximates the ground truth, trained with the usual backpropagation technique. This FCN will be denoted OSMNet in the following sections. OSMNet only manipulates the original OSM map to project it in a representation space compatible with the ground truth classes. The optical data will then be used as input to a FCN model to infer a semantic segmentation that will complete the approximate map derived from OSM. In this work, we will use the SegNet architecture [2] that we will train following the guidelines from [1]. SegNet is an encoder-decoder deep neural network that projects an input image into a semantic map with the same resolution. Using these two models, we can compute the average prediction computed using the two data sources. In this framework, if we denote I the input image, O the input OSM raster, Popt the prediction function for SegNet and Posm the prediction function for OSMNet, the final prediction P is: P (I, O) = 1 (Popt (I) + Posm (O)) . 2 (1) If Posm (O) is already an adequate approximation of the ground truth GT , then the training process will try to minimize: Popt ∝ GT − Posm (O)  GT , (2) which should have a similar effect on the training process than the residual learning from [15]. Moreover, to refine even further this average map, we use a residual correction network [1]. This module consists in a residual three-layer FCN that learns how to correct the average prediction using the complementary information from the OSM and optical data sources. If we denote C the prediction function of the residual correction network, we finally have: P (I, O) = 1 (Popt (I)+Posm (O))+C(Zopt (I), Zosm (O)) , 2 (3) (a) Optical and OSM data fusion using residual correction [1]. (b) FuseNet [13] architecture applied to optical and OSM data. Figure 1: Deep learning architectures for joint processing of optical and OpenStreetMap data. where Zopt and Zosm are the last feature maps from SegNet and OSMNet, respectively. The residual learning using this module can be seen as learning an error correction to refine and correct occasional errors in the prediction. The full pipeline is illustrated in the Fig. 1a. The whole architecture is trained jointly. 3.2. Dual-stream convolutional neural networks FCN with several sources have been investigated several times in the past, notably for processing RGB-D (or 2.5D) images in the computer vision community [9]. In this work, we use the FuseNet architecture [13] to combine optical and OSM data. It is based on the popular SegNet [2] model. FuseNet has two encoders, one for each source. After each convolutional block, the activations maps from the second encoder are summed into the activations maps from the first encoder. This allows the two encoders to learn a joint representation of the two modalities. Then, a single decoder performs both the spatial upsampling and the pixel-wise classification. As detailed in Fig. 1b, one main branch learns this joint summed representation while the ancillary branch learns only OSM-dependent activations. If we denote P the prediction function from FuseNet, I the input image, O the {opt,osm} input OSM rasters, Ei the encoded feature maps {opt,osm} after the ith block, Bi the encoding functions for the ith block and D the decoding function: P (I, O) = D(E5opt (I, O)) (4) and opt Ei+1 (I, O) = Biopt (Eiopt (I, O))+Biosm (Eiosm (O)) . (5) This architecture allows us to fuse both data streams in the internal representation learnt by the network. This model is illustrated in Fig. 1b. 4. Experiments 4.1. Datasets ISPRS Potsdam The ISPRS Potsdam Semantic Labeling dataset [27]1 is comprised of 38 ortho-rectified aerial IRRGB images (6000 × 6000 px) at 5cm spatial resolution, taken over the city of Potsdam (Germany). A comprehensive pixel-level ground truth is provided for 24 tiles with annotations for the following classes: “impervious surface”, “building”, “low vegetation”, “tree”, “car” and “clutter”, as illustrated in Fig. 2a. As the tiles are geo-referenced, we download and generate the corresponding OpenStreetMap rasters with the footprints for roads, buildings, vegetation and water bodies using Maperitive2 . Results on this dataset are cross-validated on a 3-fold train/test split (18 tiles for training, 6 tiles for testing). Data Fusion Contest 2017 The Data Fusion Contest (DFC) 2017 dataset3 or “grss_dfc_2017” [12] is comprised of various acquisitions over 8 different cities: Berlin, Hong Kong, Paris, Rome and Sao Paulo for training, and Amsterdam, Chicago, Madrid an Xi’an for testing. It includes multispectral Sentinel-2 and Landsat data, OpenStreetMap rasters for the roads, vegetation, land use types, buildings and water bodies and a sparse ground truth containing an1 http://www2.isprs.org/commissions/comm3/wg4/ semantic-labeling.html 2 http://maperitive.net/ 3 http://www.grss-ieee.org/community/ technical-committees/data-fusion/ data-fusion-contest/ Potsdam (RGB) Potsdam (GT) (a) ISPRS Potsdam dataset DFC 2017 (false RGB) DFC 2017 (GT) (b) DFC 2017 dataset (extract from São Paulo) Figure 2: Extract of the ISPRS Potsdam and DFC2017 datasets notations for several Local Climate Zones (LCZ), as illustrated in Fig. 2b. The LCZ define urban or rural areas such as “sparsely built urban area”, “water body”, “dense trees” and so on, using the taxonomy from [30]. The annotations cover only a part of the cities and are provided at 100m/pixel resolution. The goal is to generalize those annotations to the testing cities. In this work, we use the multispectral 20m/pixel resolution Sentinel-2 data and the OSM raster for roads, buildings, vegetation and water bodies. We preprocess the multispectral data by clipping the 2% highest values. All 13 bands are kept and stacked as input to the neural network. As Sentinel-2 multispectral data includes bands at 10m/pixel, 20m/pixel and 60m/pixel resolutions, bands that have a resolution lower or higher than 20m/pixel are rescaled using bilinear interpolation. Results on this dataset are computed on the held-out testing set from the benchmark. 4.2. Experimental setup We train our models on the ISPRS Potsdam dataset in an end-to-end fashion, following the guidelines from [1]. We randomly extract 128×128 patches from the RGB and OSM training tiles on which we apply random flipping or mirroring as data augmentation. The optimization is performed with a batch size of 10 on the RGB tiles using a Stochastic Gradient Descent (SGD) with a learning rate of 0.01 divided by 10 every 2 epochs (' 30 000 iterations). SegNet’s encoder for the RGB data is initialized using VGG16 [29] weights trained on ImageNet, while the decoder is randomly initialized using the MSRA [14] scheme. The learning rate for the encoder is set to half the learning rate for the decoder. During testing, each tile is processed by sliding a 128 × 128 window with a stride of 64 (i.e. 50% overlap). Multiple predictions for overlapping regions are averaged to smooth the map and reduce visible stitching on the patch borders. Training until convergence (' 150,000 iterations) takes around 20 hours on a NVIDIA K20c, while (a) Binary representation. (b) Signed distance transform. Figure 3: Representations of the OSM layer for roads. evaluating on the validation set takes less than 30 minutes. On the DFC2017, we re-train SegNet from scratch and the weights are initialized using the MSRA scheme. As the input data has a resolution of 20m/pixel and the output LCZ are expected to be at 100m/pixel resolution, we use a smaller decoder by removing the last three convolutional blocks and the associated pooling layers. The resulting predictions have a resolution of 1:4 the input data and are interpolated to the 100m/pixel resolution. We train the network on randomly flipped 160 × 160 patches with a 50% overlap. The patches are randomly selected but have to contain at least 5% of annotated pixels. To avoid learning on non-labeled pixels from the sparse LCZ annotations, we ignore the undefined pixels in the ground truth during loss computation. The network is trained using the Adam [18] optimizer with a learning rate of 0.01 with a batch size of 10. Training until convergence (' 60,000 iterations) takes around 6 hours on a NVIDIA Titan Pascal, while evaluating on the test set takes less than 5 minutes. OSM data modelization has to be carefully investigated. Most sensor data is continuous both in the numerical meaning but also in the spatial repartition. In many cases, if the original data is not continuous but sparse, well-chosen representations are used to get the continuity back, e.g. the Digital Surface Model which is a continuous topology extracted from the sparse LiDAR point cloud. In our case, the OSM data is sparse and discrete like the labels. Therefore, it is dubious if the deep network will be able to handle all the information using such a representation. We compare two representations, illustrated in Fig. 3: • Sparse tensor representation, which is discrete. For each raster, we have an associated channel in the tensor which is a binary map denoting the presence of the raster class in the specified pixel (cf. Fig. 3a). • Signed distance transform (SDT) representation, which is continuous. We generate for each raster the associated channel corresponding to the distance transform d, with d > 0 if the pixel is inside the class and d < 0 if not (cf. Fig. 3b, with a color range from blue to red). The signed distance transform was used in [34] for building extraction in remote sensing data. The continuous representation helped densifying the sparse building footprints that were extracted from a public GIS database and successfully improved the classification accuracy. 4.3. Results OSM data representation As can be seen in Table 1, learning and testing on the signed distance transform (SDT) representation for the OpenStreetMap layers performs slightly worse than its binary counterpart. This might seem counter-intuitive, as the distance transform contains a denser information. However, we suggest that this information might be too diffuse and that the model loses the sharp boundaries and clear transitions of the binary raster on some parts of the dataset. Yet, the difference between the two representations does not impact strongly the final accuracy. ISPRS Potsdam We report in Table 1 the results of our methods on our validation set of the ISPRS Potsdam dataset. In accordance with the dataset guidelines, we compare our predictions with the ground-truth where the borders have been eroded by a disk of radius 3 pixels. We report the overall pixel-wise accuracy and the F1 score for each class, computed as follows: F 1i = 2 precisioni × recalli , precisioni + recalli (6) tpi tpi , precisioni = , (7) Ci Pi where tpi the number of true positives for class i, Ci the number of pixels belonging to class i, and Pi the number of pixels attributed to class i by the model. recalli = As could be expected, the inclusion of OSM data improves the semantic labeling performance, with significant improvements on “road” and “building” classes. This is not surprising considering that those classes already have a representation in the OSM layers which can help disambiguating predictions coming from the optical source. This is illustrated qualitatively in Fig. 4 and quantitatively in Fig. 5. Moreover, OSM data accelerates the training process as it allows the main network to focus on the harder parts of the image. Indeed, OSM data already covers the majority of the roads and the buildings, therefore simplifying the inference of the “impervious surface” and “building” classes. OSM data also helps discriminating between buildings and roads that have similar textures. An interesting side effect of the integration of the OSM data into the learning process is the significant speedup in convergence time that can be observed. Indeed, on the same dataset, the coarse-to-fine model converges approximately 25% faster to the same overall accuracy compared to the classical RGB SegNet, i.e. the network requires 25% less iterations to reach the same classification performance. Moreover, this accuracy is reached with a mean loss of 0.45 for the latter, while the former has a mean loss of only 0.39, which indicates a better generalization capability. This is similar to the findings from [15] on residual learning. Finally, the inclusion of the OSM data helps regularizing spatially the predictions when the network is still in early training. Fig. 6 illustrates how the same patch, classified at several stages in the training, is visually better represented using both OSM and RGB sources compared to the RGB image only. DFC2017 We report in Table 2 the detailed results of our methods on the DFC2017 dataset. The evaluations metrics are the overall accuracy (OA) and the pixel-wise accuracies for each class. The integration of the OSM layers is mostly useful for two types of classes: the high density urban areas and the dense vegetation. Indeed, classes 1, 2 and 3 denote different sorts of compact urban areas. The buildings footprints from OSM help detecting those classes and estimating the local building density. For the vegetation, the relevant OSM annotations are in the natural terrain layer. These annotations are mostly concentrated on forests and large meadows, which belong to the classes 11 (“dense trees”) and 14 (“low plants”). Consequently, those classes obtain a significant increase in classification accuracy when fusing OSM and multispectral data. A qualitative example on the city of Chicago is shown in Fig. 7. 5. Discussion The methods presented in this work allow us to improve semantic labeling of aerial and satellite multispectral images thanks to the integration of several OSM rasters, no- Table 1: Test results on the ISPRS Potsdam dataset (pixel-wise overall accuracy and F1 score per class). OSM Method imp. surfaces buildings low veg. trees cars Overall Binary ∅ OSMNet SegNet RGB 54.8 93.0 90.0 92.9 51.5 85.0 0.0 85.1 0.0 95.1 60.3 89.7 Binary Residual Correction RGB+OSM FuseNet RGB+OSM 93.9 95.3 92.8 95.9 85.1 86.3 85.2 85.1 95.8 96.8 90.6 92.3 SDT Residual Correction RGB+OSM FuseNet RGB+OSM 93.8 95.2 92.7 95.9 85.2 86.4 84.8 85.0 95.9 96.5 90.5 92.3 Table 2: Test results on the DFC2017 dataset (pixel-wise accuracies) Urban LCZ Compact 1 2 Open 3 4 5 6 Rural Misc. Trees Vegetation Soils and water buildings 7 8 9 10 11 12 13 14 15 16 17 OA SegNet multispectral 34.7 25.4 8.6 19.7 14.6 17.5 0.0 62.3 0.0 1.0 66.9 4.3 13.1 62.5 0.0 0.0 89.2 41.7 FuseNet multispectral + OSM 34.3 39.1 26.0 16.7 6.2 37.1 0.0 45.2 9.2 0.0 83.4 1.8 0.0 80.2 1.4 0.0 87.3 46.5 tably the roads, buildings and vegetation land use. However, OpenStreetMap data is much more exhaustive than such layers and also contains specific information (e.g. swamps, agriculture fields, industrial areas, different categories of roads. . . ). However, if all information are stacked by using one map per layer of interest, the OSM memory footprint would become huge very quickly, especially considering that OSM provides vector information that can be rasterized at any spatial resolution. In our case, we rasterize the OSM layers to the same resolution as our input image, which can be very high for airborne acquisitions. Moreover, we have not addressed here the question of the subclassification, while this is definitely a source of future improvement. Indeed, thanks to OSM data, we can know that some specific buildings have a particular type, e.g. a building can be a church, a grocery store or a house. Point annotations, such as parking lots, are also dismissed but could provide meaningful insights about the semantics of the area. Furthermore, we underline that even though the OSM layers that we used were more recent (2 years) than to the optical data, there were few enough disagreements so that the models were robust to those conflicts. Yet, data fusion should be done carefully if the sources do not represent the same underlying reality. In the case of the OSM data, this could be worked around by extracting the layers from the OSM archives if the optical data is not recent enough. Finally, mapping style and coverage can vary a lot based on the observed regions. For example, urban areas in developed countries are thoroughly mapped, whereas annotations are very scarce in rural areas in developing countries. This enforces the need for the model to be robust to errors and miss- ing OSM input data for very large scale mapping. 6. Conclusion In this work, we showed how to integrate ancillary GIS data in deep learning-based semantic labeling. We presented two methods: one for coarse-to-fine segmentation, using deep learning on RGB data to refine OpenStreetMap semantic maps, and one for data fusion to merge multispectral data and OSM rasters to predict local climate zones. We validated our methods on two public datasets: the ISPRS Potsdam 2D Semantic Labeling Challenge and the Data Fusion Contest 2017. We increase our semantic labeling overall accuracy by 2.5% on the former and by nearly 5% on the latter by integrating OpenStreetMap data in the learning process. Moreover, on the ISPRS Potsdam dataset, using OSM layers in a residual correction fashion accelerates the model convergence by 25%. Our findings show that GIS sparse data can be leveraged successfully for semantic labeling on those two use cases, as it improves significantly the classification accuracy of the models. We think that using crowdsourced and open GIS data is an exciting topic of research, and this work provides new insights on how to use this data to improve and accelerate learning based on traditional sensors. Acknowledgements The Vaihingen dataset was provided by the German Society for Photogrammetry, Remote Sensing and Geoinformation (DGPF) [7]: http://www.ifp. uni-stuttgart.de/dgpf/DKEP-Allg.html. (c) Target ground truth (b) OSM input (a) RGB input (d) SegNet (RGB) (e) FuseNet (OSM+RGB) Figure 4: Excerpt from the classification results on Potsdam The authors thank the ISPRS for making the Vaihingen and Potsdam datasets available and organizing the semantic labeling challenge. The authors would like to thank the WUDAPT (http://www.wudapt.org/) and GeoWIKI (http://geo-wiki.org/) initiatives and the IEEE GRSS Image Analysis and Data Fusion Technical Committee. Nicolas Audebert’s work is supported by the Total-ONERA research project NAOMI. References [1] N. Audebert, B. Le Saux, and S. Lefèvre. Semantic Segmentation of Earth Observation Data Using Multimodal and Multi-scale Deep Networks. In Computer Vision – ACCV 2016, pages 180–196. Springer, Cham, Nov. 2016. [2] V. Badrinarayanan, A. Kendall, and R. Cipolla. SegNet: A Deep Convolutional Encoder-Decoder Architecture for Scene Segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, PP(99):1–1, 2017. [3] M. Campos-Taberner, A. Romero-Soriano, C. Gatta, G. Camps-Valls, A. Lagrange, B. Le Saux, A. Beaupère, A. Boulch, A. Chan-Hon-Tong, S. Herbin, H. Randrianarivo, M. Ferecatu, M. Shimoni, G. Moser, and D. Tuia. Processing of Extremely High-Resolution LiDAR and RGB Data: Outcome of the 2015 IEEE GRSS Data Fusion Contest Part A: 2D Contest. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, PP(99):1–13, 2016. 1e7 1126605 1878448 725054 21838 buildings 1664120 51520875 2967059 111546 76285 low vegetation 1108857 558643 35856853 2083046 352 521341 57615 3122028 19490186 44788 trees 49485 14444 impervious surfaces buildings 1754 35150 3010013 low vegetation trees cars 6.0 6.0 62840673 906387 1553010 697701 28881 buildings 1316018 52340387 2541862 112340 90877 low vegetation 1485836 485991 35536974 2206183 658 561322 66035 3004559 19578633 39992 impervious surfaces 4.5 3.0 trees 1.5 cars 1e7 1e7 6.0 62297705 impervious surfaces 1084647 1848230 860691 30171 4.5 buildings 2549169 50056828 3264962 133645 77819 3.0 low vegetation 1218568 583730 35235082 2715956 213 trees 474568 49960 2658349 20038376 44156 cars 48348 25658 2871 37085 3001551 57425 18174 impervious surfaces buildings 665 39127 2999795 low vegetation trees cars low vegetation trees cars 4.5 3.0 1.5 1.5 cars (a) SegNet RGB 62461202 impervious surfaces impervious surfaces buildings (b) Residual Correction OSM+RGB (c) FuseNet OSM+RGB Figure 5: Confusion matrices on Potsdam using the different methods. RGB only RGB RGB + OSM GT iteration 10,000 20,000 50,000 80,000 120,000 Figure 6: Evolution of the predictions coming from SegNet using RGB only vs. RGB + OSM. Integrating OSM data makes the output more visually coherent, even in the early learning stages. Legend: white: impervious surfaces, blue: buildings, cyan: low vegetation, green: trees, yellow: vehicles, red: clutter, black: undefined. (a) RGB (composite) (b) Prediction (FuseNet) Figure 7: Partial results on the city of Chicago (DFC2017) Legend: cyan: compact high rise, blue: compact mid-rise, yellow: open high rise, brown: dense trees, grey: water [4] M. Castelluccio, G. Poggi, C. Sansone, and L. Verdoliva. Land use classification in remote sensing images by convolutional neural networks. arXiv:1508.00092 [cs], Aug. 2015. [5] J. Chen and A. Zipf. DeepVGI: Deep Learning with Volunteered Geographic Information. In 26th International World Wide Web Conference (Poster). ACM, 2017. [6] D. Costea and M. Leordeanu. Aerial image geolocalization from recognition and matching of roads and intersections. arXiv:1605.08323 [cs], May 2016. arXiv: 1605.08323. [7] M. Cramer. The DGPF test on digital aerial camera evaluation – overview and test design. Photogrammetrie – Fernerkundung – Geoinformation, 2:73–82, 2010. [8] O. Danylo, L. See, B. Bechtel, D. Schepaschenko, and S. Fritz. Contributing to WUDAPT: A Local Climate Zone Classification of Two Cities in Ukraine. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 9(5):1841–1853, May 2016. [9] A. Eitel, J. T. Springenberg, L. Spinello, M. Riedmiller, and W. Burgard. Multimodal deep learning for robust RGB-D object recognition. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 681– 687, Sept. 2015. [10] C. C. Fonte, J. A. Patriarca, M. Minghini, V. Antoniou, L. See, and M. A. Brovelli. Using OpenStreetMap to Create Land Use and Land Cover Maps. In C. E. C. Campelo, M. Bertolotto, and P. Corcoran, editors, Volunteered Geographic Information and the Future of Geospatial Data, pages 113–137. IGI Global, IGI Global, 2017. [11] C. Geiß, A. Schauß, T. Riedlinger, S. Dech, C. Zelaya, N. Guzmán, M. A. Hube, J. J. Arsanjani, and H. Taubenböck. Joint use of remote sensing data and volunteered geographic information for exposure estimation: evidence from Valparaíso, Chile. Natural Hazards, 86(1):81–105, Mar. 2017. [12] GRSS. 2017 IEEE GRSS Data Fusion Contest, 2017. [13] C. Hazirbas, L. Ma, C. Domokos, and D. Cremers. FuseNet: Incorporating Depth into Semantic Segmentation via FusionBased CNN Architecture. In Computer Vision – ACCV 2016, pages 213–228. Springer, Cham, Nov. 2016. [14] K. He, X. Zhang, S. Ren, and J. Sun. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 1026–1034, 2015. [15] K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770– 778, June 2016. [16] J. Hu, L. Mou, A. Schmitt, and X. X. Zhu. FusioNet: A Two-Stream Convolutional Neural Network for Urban Scene Classification using PolSAR and Hyperspectral Data. In 2017 Joint Urban Remote Sensing Event (JURSE), Mar. 2017. [17] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-toImage Translation with Conditional Adversarial Networks. arXiv:1611.07004 [cs], Nov. 2016. arXiv: 1611.07004. [18] D. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs], Dec. 2014. arXiv: 1412.6980. [19] G. Lin, A. Milan, C. Shen, and I. Reid. RefineNet: Multi-Path Refinement Networks with Identity Mappings for High-Resolution Semantic Segmentation. arXiv preprint arXiv:1611.06612, 2016. [20] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3431–3440, June 2015. [21] E. Maggiori, Y. Tarabalka, G. Charpiat, and P. Alliez. Fully convolutional neural networks for remote sensing image classification. In 2016 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), pages 5071–5074, July 2016. [22] D. Marmanis, K. Schindler, J. D. Wegner, S. Galliani, M. Datcu, and U. Stilla. Classification With an Edge: Improving Semantic Image Segmentation with Boundary Detection. arXiv:1612.01337 [cs], Dec. 2016. arXiv: 1612.01337. [23] V. Mnih. Machine Learning for Aerial Image Labeling. PhD thesis, University of Toronto, 2013. [24] V. Mnih and G. E. Hinton. Learning to Detect Roads in HighResolution Aerial Images. In K. Daniilidis, P. Maragos, and N. Paragios, editors, Computer Vision – ECCV 2010, number 6316 in Lecture Notes in Computer Science, pages 210–223. Springer Berlin Heidelberg, Sept. 2010. [25] L. Mou and X. X. Zhu. Spatiotemporal scene interpretation of space videos via deep neural network and tracklet analysis. In Geoscience and Remote Sensing Symposium (IGARSS), 2016 IEEE International, pages 1823–1826. IEEE, 2016. [26] S. Paisitkriangkrai, J. Sherrah, P. Janney, and A. Van Den Hengel. Effective semantic pixel labelling with convolutional networks and Conditional Random Fields. In 2015 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 36–43, June 2015. [27] F. Rottensteiner, G. Sohn, J. Jung, M. Gerke, C. Baillard, S. Benitez, and U. Breitkopf. The ISPRS benchmark on urban object classification and 3d building reconstruction. ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, 1:3, 2012. [28] J. Sherrah. Fully Convolutional Networks for Dense Semantic Labelling of High-Resolution Aerial Imagery. arXiv:1606.02585 [cs], June 2016. [29] K. Simonyan and A. Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv:1409.1556 [cs], Sept. 2014. [30] I. D. Stewart and T. R. Oke. Local Climate Zones for Urban Temperature Studies. Bulletin of the American Meteorological Society, 93(12):1879–1900, 2012. [31] M. Vakalopoulou, K. Karantzalos, N. Komodakis, and N. Paragios. Building detection in very high resolution multispectral data with deep learning features. In Geoscience and Remote Sensing Symposium (IGARSS), 2015 IEEE International, pages 1873–1876. IEEE, 2015. [32] M. Vakalopoulou, C. Platias, M. Papadomanolaki, N. Paragios, and K. Karantzalos. Simultaneous registration, segmentation and change detection from multisensor, multitemporal satellite image pairs. July 2016. [33] M. Volpi and D. Tuia. Dense Semantic Labeling of Subdecimeter Resolution Images With Convolutional Neural Networks. IEEE Transactions on Geoscience and Remote Sensing, 55(2):881–893, 2017. [34] J. Yuan. Automatic Building Extraction in Aerial Scenes Using Convolutional Networks. arXiv preprint arXiv:1602.06564, 2016.
9cs.NE
Error Reporting in Parsing Expression Grammars André Murbach Maidl Polytechnic School – PUCPR – Curitiba – Brazil Fabio Mascarenhas Department of Computer Science – UFRJ – Rio de Janeiro – Brazil arXiv:1405.6646v3 [cs.PL] 13 Jul 2016 Sérgio Medeiros School of Science and Technology – UFRN – Natal – Brazil Roberto Ierusalimschy Department of Computer Science – PUC-Rio – Rio de Janeiro – Brazil Abstract Parsing Expression Grammars (PEGs) describe top-down parsers. Unfortunately, the errorreporting techniques used in conventional top-down parsers do not directly apply to parsers based on Parsing Expression Grammars (PEGs), so they have to be somehow simulated. While the PEG formalism has no account of semantic actions, actual PEG implementations add them, and we show how to simulate an error-reporting heuristic through these semantic actions. We also propose a complementary error reporting strategy that may lead to better error messages: labeled failures. This approach is inspired by exception handling of programming languages, and lets a PEG define different kinds of failure, with each ordered choice operator specifying which kinds it catches. Labeled failures give a way to annotate grammars for better error reporting, to express some of the error reporting strategies used by deterministic parser combinators, and to encode predictive top-down parsing in a PEG. Keywords: parsing, error reporting, parsing expression grammars, packrat parsing, parser combinators 1. Introduction When a parser receives an erroneous input, it should indicate the existence of syntax errors. Errors can be handled in various ways. The easiest is just to report that an error Email addresses: [email protected] (André Murbach Maidl), [email protected] (Fabio Mascarenhas), [email protected] (Sérgio Medeiros), [email protected] (Roberto Ierusalimschy) Preprint submitted to Science of Computer Programming July 14, 2016 was found, where is was found and what was expected at that point and then abort. At the other end of the spectrum we find mechanisms that attempt to parse the complete input, and report as many errors as best as possible. The LL(k) and LR(k) methods detect syntax errors very efficiently because they have the viable prefix property, that is, these methods detect a syntax error as soon as k tokens are read and cannot be used to extend the thus far accepted part of the input into a viable prefix of the language [1]. LL(k) and LR(k) parsers can use this property to produce suitable, though generic, error messages. Parsing Expression Grammars (PEGs) [2] are a formalism for describing the syntax of programming languages. We can view a PEG as a formal description of a top-down parser for the language it describes. PEGs have a concrete syntax based on the syntax of regexes, or extended regular expressions. Unlike Context-Free Grammars (CFGs), PEGs avoid ambiguities in the definition of the grammar’s language due to the use of an ordered choice operator. More specifically, a PEG can be interpreted as a the specification of a recursive descent parser with restricted (or local) backtracking. This means that the alternatives of a choice are tried in order; as soon as an alternative recognizes an input prefix, no other alternative of this choice will be tried, but when an alternative fails to recognize an input prefix, the parser backtracks to try the next alternative. On the one hand, PEGs can be interpreted as a formalization of a specific class of topdown parsers [2]; on the other hand, PEGs cannot use error handling techniques that are often applied to predictive top-down parsers, because these techniques assume the parser reads the input without backtracking [3]. In top-down parsers without backtracking, it is possible to signal a syntax error as soon as the next input symbol cannot be accepted. In PEGs, it is more complicated to identify the cause of an error and the position where it occurs, because failures during parsing are not necessarily errors, but just an indication that the parser cannot proceed and a different choice should be made elsewhere. Ford [3] has already identified this limitation of error reporting in PEGs, and, in his parser generators for PEGs, included an heuristic for better error reporting. This heuristic simulates the error reporting technique that is implemented in top-down parsers without backtracking. The idea is to track the position in the input where the farthest failure occurred, as well as what the parser was expecting at that point, and report this to the user in case of errors. Tracking the farthest failure position and context gives us PEGs that produce error messages similar to the automatically produced error messages of other top-down parsers; they tell the user the position where the error was encountered, what was found in the input at that position, and what the parser was expecting to find. In this paper, we show how grammar writers can use this error reporting technique even in PEG implementations that do not implement it, by making use of semantic actions that expose the current position in the input and the possibility to access some form of mutable state associated with the parsing process. We also propose a complementary approach for error reporting in PEGs, based on the concept of labeled failures, inspired by the standard exception handling mechanisms as found 2 Tiny CmdSeq Cmd IfCmd RepeatCmd AssignCmd ReadCmd WriteCmd Exp SimpleExp Term Factor ← CmdSeq ← (Cmd SEMICOLON) (Cmd SEMICOLON)∗ ← IfCmd / RepeatCmd / AssignCmd / ReadCmd / WriteCmd ← IF Exp THEN CmdSeq (ELSE CmdSeq / ε) END ← REPEAT CmdSeq UNTIL Exp ← NAME ASSIGNMENT Exp ← READ NAME ← WRITE Exp ← SimpleExp ((LESS / EQUAL) SimpleExp / ε) ← Term ((ADD / SUB) Term)∗ ← Factor ((MUL / DIV) Factor )∗ ← OPENPAR Exp CLOSEPAR / NUMBER / NAME Figure 1: A PEG for the Tiny language in programming languages. Instead of just failing, a labeled PEG can produce different kinds of failure labels using a throw operator. Each label can be tied to a more specific error message. PEGs can also catch such labeled failures, via a change to the ordered choice operator. We formalize labeled failures as an extension of the semantics of regular PEGs. With labeled PEGs we can express some alternative error reporting techniques for topdown parsers with local backtracking. We can also encode predictive parsing in a PEG, and we show how to do that for LL(∗) parsing, a powerful predictive parsing strategy. The rest of this paper is organized as follows: Section 2 contextualizes the problem of error handling in PEGs, explains in detail the failure tracking heuristic, and shows how it can be realized in PEG implementations that do not support it directly; Section 3 discusses related work on error reporting for top-down parsers with backtracking; Section 4 introduces and formalizes the concept of labeled failures, and shows how to use it for error reporting; Section 5 compares the error messages generated by a parser based on the failure tracking heuristic with the ones generated by a parser based on labeled failures; Section 6 shows how labeled failures can encode some of the techniques of Section 3, as well as predictive parsing; finally, Section 7 gives some concluding remarks. 2. Handling Syntax Errors with PEGs In this section, we use examples to present in more detail how a PEG behaves badly in the presence of syntax errors. After that, we present a heuristic proposed by Ford [3] to implement error reporting in PEGs. Rather than using the original notation and semantics of PEGs given by Ford [2], our examples use the equivalent and more concise notation and 3 semantics proposed by Medeiros et al. [4, 5, 6]. We will extend both the notation and the semantics in Section 4 to present PEGs with labeled failures. A PEG G is a tuple (V, T, P, pS ) where V is a finite set of non-terminals, T is a finite set of terminals, P is a total function from non-terminals to parsing expressions and pS is the initial parsing expression. We describe the function P as a set of rules of the form A ← p, where A ∈ V and p is a parsing expression. A parsing expression, when applied to an input string, either fails or consumes a prefix of the input and returns the remaining suffix. The abstract syntax of parsing expressions is given as follows, where a is a terminal, A is a non-terminal, and p, p1 and p2 are parsing expressions: p = ε | a | A | p1 p2 | p1 /p2 | p ∗ | !p Intuitively, ε successfully matches the empty string, not changing the input; a matches and consumes itself or fails otherwise; A tries to match the expression P (A); p1 p2 tries to match p1 followed by p2 ; p1 /p2 tries to match p1 ; if p1 fails, then it tries to match p2 ; p∗ repeatedly matches p until p fails, that is, it consumes as much as it can from the input; the matching of !p succeeds if the input does not match p and fails when the the input matches p, not consuming any input in either case; we call it the negative predicate or the lookahead predicate. Figure 1 presents a PEG for the Tiny language [7]. Tiny is a simple programming language with a syntax that resembles Pascal’s. We will use this PEG, which can be seen as the equivalent of an LL(1) CFG, to show how error reporting differs between top-down parsers without backtracking and PEGs. PEGs usually express the language syntax at the character level, without the need of a separate lexer. For instance, we can write the lexical rule IF as follows, assuming we have non-terminals Skip, which consumes whitespace, and IDRest, which consumes any character that may be present on a proper suffix of an identifier1 : IF ← if !IDRest Skip Now, we present an example of erroneous Tiny code so we can compare approaches for error reporting. The program in Figure 2 is missing a semicolon (;) in the assignment in line 5. A predictive top-down parser that aborts on the first error presents an error message like: factorial.tiny:6:1: syntax error, unexpected ’until’, expecting ’;’ The error is reported in line 6 because the parser cannot complete a valid prefix of the language, since it unexpectedly finds the token until when it was expecting a command terminator (;). In PEGs, we can try to report errors using the remaining suffix, but this approach usually does not help the PEG produce an error message like the one shown above. In general, when 1 In the presented PEG, we omitted the lexical rules for brevity. 4 01 02 03 04 05 06 07 n := 5; f := 1; repeat f := f * n; n := n - 1 until (n < 1); write f; Figure 2: Program for the Tiny Language with a Syntax Error a PEG finishes parsing the input, a remaining non-empty suffix means that parsing did not reach the end of file due to a syntax error. However, this suffix usually does not indicate the actual place of the error, as the error will have caused the PEG to backtrack to another place in the input. In our example, the problem happens when the PEG tries to recognize the sequence of commands inside the repeat command. Even though the program has a missing semicolon (;) in the assignment in line 5, making the PEG fail to recognize the sequence of commands inside the repeat command, this failure is not treated as an error. Instead, this failure makes the recognition of the repeat command also fail. For this reason, the PEG backtracks the input to line 3 to try to parse other alternatives for CmdSeq, and since these do not exist, its ancestor Cmd. Since it is not possible to recognize a command other than repeat at line 3, the parsing finishes without consuming all the input. Hence, if the PEG uses the remaining suffix to produce an error message, the PEG reports line 3 instead of line 6 as the location where no further progress can be made. There is no perfect method to identify which information is the most relevant to report an error. In our example it is easy for the parser to correctly report what the error is, but it is easy to construct examples where this is not the case. If we add the semicolon in the end of line 6 and remove line 3, a predictive top-down parser would complain about finding an until where it expected another statement, while the actual error is a missing repeat. According to Ford [3], using the information of the farthest position that the PEG reached in the input is a heuristic that provides good results. PEGs define top-down parsers and try to recognize the input from left to right, so the position farthest to the right in the input that a PEG reaches during parsing usually is close to the real error [3]. The same idea for error reporting in top-down parsings with backtracking was also mentioned in Section 16.2 of [8]. Ford used this heuristic to add error reporting to his PEG implementation using packrat parsers [3]. A packrat parser generated by Pappy [9], Ford’s PEG parser generator, tracks the farthest position and uses this position to report an error. In other words, this heuristic helps packrat parsers to simulate the error reporting technique that is implemented in deterministic parsers. Although Ford only has discussed his heuristic in relation to packrat parsers, we can use the farthest position heuristic to add error reporting to any implementation of PEGs that 5 provides semantic actions. The idea is to annotate the grammar with semantic actions that track this position. While this seems onerous, we just need to add annotations to all the lexical rules to implement error reporting. For instance, in Leg [10], a PEG parser generator with Yacc-style semantic actions, we can annotate the rule for SEMICOLON as follows, where | is Leg’s ordered choice operator, and following it is a semantic action (in the notation used by Leg): SEMICOLON = ";" Skip | &{ updateffp() } The function updateffp that the semantic action calls updates the farthest failure position in a global variable if the current parsing position is greater than the position that is stored in this global, then makes the whole action fail so parsing continues as if the original failure had occurred. However, storing just the farthest failure position does not give the parser all the information it needs to produce an informative error message. That is, the parser has the information about the position where the error happened, but it lacks the information about what terminals failed at that position. Thus, we extend our approach by including the terminals in the annotations so the parser can also track these names in order to compute the set of expected terminals at a certain position: SEMICOLON = ";" Skip | &{ updateffp(";") } The extended implementation of updateffp keeps, for a given failure position, the names of all the symbols expected there. If the current position is greater than the farthest failure, updateffp initializes this set with just the given name. If the current position equals the farthest failure, updateffp adds this name to the set. Parsers generated by Pappy also track the set of expected terminals, but with limitations. The error messages include only symbols and keywords that were defined in the grammar as literal strings. That is, the error messages do not include terminals that were defined through character classes. Our approach of naming terminals in the semantic actions avoids the kind of limitation found in Pappy, though it increases the annotation burden because the implementor of the PEG is also responsible for adding one semantic action for each terminal and its respective name. The annotation burden can be lessened in implementations of PEGs that treat parsing expressions as first-class objects, because this makes it possible to define functions that annotate the lexical parts of the grammar to track errors, record information about the expected terminals to produce good error messages, and enforce lexical conventions such as the presence of surrounding whitespace. For instance, in LPEG [11, 12], a PEG implementation for Lua that defines patterns as first-class objects, we can annotate the rule CmdSeq as follows, where the patterns V"A", p1 * p2, and p^0 are respectively equivalent to parsing expressions A, p1 p2 , and p∗ (in the notation used by LPEG): CmdSeq = V"Cmd" * symb(";") * (V"Cmd" * symb(";"))^0; 6 The function symb receives a string as its only argument and returns a parser that is equivalent to the parsing expression that we used in the Leg example. That is, symb(";") is equivalent to ";" Skip | &{ updateffp(";") }. We implemented error tracking and reporting using semantic actions as a set of parsing combinators on top of LPeg and used these combinators to implement a PEG parser for Tiny. It produces the following error message for the example we have been using in this section: factorial.tiny:6:1: syntax error, unexpected ’until’, expecting ’;’, ’=’, ’<’, ’-’, ’+’, ’/’, ’*’ We tested this PEG parser for Tiny with other erroneous inputs and in all cases the parser identified an error in the same place as a top-down parser without backtracking. In addition, the parser for Tiny produced error messages that are similar to the error messages produced by packrat parsers generated by Pappy. We annotated other grammars and successfully obtained similar results. However, the error messages are still generic; they are not as specific as the error messages of a hand-written top-down parser. 3. Error Reporting in Top-Down Parsers with Backtracking In this section, we discuss alternative approaches for error reporting in top-down parsers with backtracking. Mizushima et al. [13] proposed a cut operator (↑) to reduce the space consumption of packrat parsers; the authors claimed that the cut operator can also be used to implement error reporting in packrat parsers, but the authors did not give any details on how the cut operator could be used for this purpose. The cut operator is borrowed from Prolog to annotate pieces of a PEG where backtracking should be avoided. PEGs’ ordered choice works in a similar way to Prolog’s green cuts, that is, they limit backtracking to discard unnecessary solutions. The cut proposed for PEGs is a way to implement Prolog’s white cuts, that is, they prevent backtracking to rules that will certainly fail. The semantics of cut is similar to the semantics of an if-then-else control structure and can be simulated through predicates. For instance, the PEG (with cut) A ← B ↑ C/D is functionally equivalent to the PEG (without cut) A ← BC/!BD that is also functionally equivalent to the rule A ← B[C, D] on Generalized Top-Down Parsing Language (GTDPL), one of the parsing techniques that influenced the creation of PEGs [3, 9, 2]. On the three cases, the expression D is tried only if the expression B fails. Nevertheless, this translated PEG still backtracks whenever B successfully matches and C fails. Thus, it is not trivial to use this translation to implement error reporting in PEGs. Rats! [14] is a popular packrat parser that implements error reporting with a strategy similar to Ford’s, with the change that it always reports error positions at the start of productions, and pretty-prints non-terminal names in the error message. For example, an error in a ReturnStatement non-terminal becomes return statement expected. Even though error handling is an important task for parsers, we did not find any other research results about error handling in PEGs, beyond the heuristic proposed by Ford and 7 the cut operator proposed by Mizushima et al. However, parser combinators [15] present some similarities with PEGs so we will briefly discuss them for the rest of this section. In functional programming it is common to implement recursive descent parsers using parser combinators [15]. A parser is a function that we use to model symbols of the grammar. A parser combinator is a higher-order function that we use to implement grammar constructions such as sequencing and choice. One kind of parser combinator implements parsers that return a list of all possible results of a parse, effectively implementing a recursive descent parser with full backtracking. Despite being actually deterministic in behavior (parsing the same input always yields the same list of results), these combinators are called non-deterministic parser combinators due to their use of a non-deterministic choice operator. We get parser combinators that have the same semantics as PEGs by changing the return type from list of results to Maybe. That is, we use deterministic parser combinators that return Maybe to implement recursive descent parsers with limited backtracking [16]. In the rest of this paper, whenever we refer to parser combinators we intend to refer to these parser combinators with limited backtracking. Like PEGs, most deterministic parser combinator libraries also use ordered choice, and thus suffer from the same problems as PEGs with erroneous inputs, where the point that the parser reached in the input is ususally far away from the point of the error. Hutton [15] introduced the nofail combinator to implement error reporting in a quite simple way: we just need to distinguish between failure and error during parsing. More specifically, we can use the nofail combinator to annotate the grammar’s terminals and non-terminals that should not fail; when they fail, the failure should be transformed into an error. The difference between an error and a failure is that an ordered choice just propagates an error in its first alternative instead of backtracking and trying its second alternative, so any error aborts the whole parser. This technique is also called the three-values technique [17] because the parser finishes with one of the following values: OK, Fail or Error. Röjemo [18] presented a cut combinator that we can also use to annotate the grammar pieces where parsing should be aborted on failure, on behalf of efficiency and error reporting. The cut combinator is different from the cut operator2 (↑) for PEGs because the combinator is abortive and unary while the operator is not abortive and nullary. The cut combinator introduced by Röjemo has the same semantics as the nofail combinator introduced by Hutton. Partridge and Wright [17] showed that error detection can be automated in parser combinators when we assume that the grammar is LL(1). Their main idea is: if one alternative successfully consumes at least one symbol, no other alternative can successfully consume any symbols. Their technique is also known as the four-values technique because the parser finishes with one of the following values: Epsn, when the parser finishes with success without consuming any input; OK, when the parser finishes with success consuming some input; Fail, when the parser fails without consuming any input; and Error, when the parser fails consuming some input. Three values were inspired by Hutton’s work [15], but with new 2 Throughout this paper, we refer to combinators of parser combinators and to operators of PEGs, but these terms are effectively interchangeable. 8 p1 Error Error Error Error Fail Fail Fail Fail Epsn Epsn Epsn Epsn OK (x) OK (x) OK (x) OK (x) p2 Error Fail Epsn OK (x) Error Fail Epsn OK (x) Error Fail Epsn OK (x) Error Fail Epsn OK (y) p1 p2 Error Error Error Error Fail Fail Fail Fail Error Fail Epsn OK (x) Error Error OK (x) OK (y) p1 | p2 Error Error Error Error Error Fail Epsn OK (x) Error Epsn Epsn OK (x) OK (x) OK (x) OK (x) OK (x) Table 1: Behavior of sequence and choice in the four-values technique meanings. In the four-values technique, we do not need to annotate the grammar because the authors changed the semantics of the sequence and choice combinators to automatically generate the Error value according to the Table 1. In summary, the sequence combinator propagates an error when the second parse fails after consuming some input while the choice combinator does not try further alternatives if the current one consumed at least one symbol from the input. In case of error, the four-values technique detects the first symbol following the longest parse of the input and uses this symbol to report an error. The four-values technique assumes that the input is composed by tokens which are provided by a separate lexer. However, being restricted to LL(1) grammars can be a limitation because parser combinators, like PEGs, usually operate on strings of characters to implement both lexer and parser together. For instance, a parser for Tiny that is implemented with Parsec [19] does not parse the following program: read x;. That is, the matching of read against repeat generates an error. Such behavior is confirmed in Table 1 by the third line from the bottom. Parsec is a parser combinator library for Haskell that employs a technique equivalent to the four-values technique for implementing LL(1) predictive parsers that automatically report errors [19]. To overcome the LL(1) limitation, Parsec introduced the try combinator, a dual of Hutton’s nofail combinator. The effect of try is to translate an error into a backtrackeable failure. The idea is to use try to annotate the parts of the grammar where arbitrary lookahead is needed. Parsec’s restriction to LL(1) grammars made it possible to implement an error reporting 9 technique similar to the one used in top-down parsers. Parsec produces error messages that include the error position, the character at this position and the FIRST and FOLLOW sets of the productions that were expected at this position. Parsec also implements the error injection combinator (<?>) for naming productions. This combinator gets two arguments: a parser p and a string exp. The string exp replaces the FIRST set of a parser p when all the alternatives of p failed. This combinator is useful to name terminals and non-terminals to get better information about the context of a syntax error. Swierstra and Duponcheel [20] showed an implementation of parser combinators for error recovery, although most libraries and parser generators that are based on parser combinators implement only error reporting. Their work relies on the fact that the grammar is LL(1) and shows an implementation of parser combinators that repairs erroneous inputs, produces an appropriated message, and continues parsing the rest of the input. This approach was later extended to also deal with grammars that are not LL(1), including ambiguous grammars [21]. The extended approach relies heavily on some features that the implementation language should have, such as lazy evaluation. 4. Labeled Failures Exceptions are a common mechanism for signaling and handling errors in programming languages. Exceptions let programmers classify the different errors their programs may signal by using distinct types for distinct errors, and decouple error handling from regular program logic. In this section we add labeled failures to PEGs, a mechanism akin to exceptions and exception handling, with the goal of improving error reporting while preserving the composability of PEGs. In the next section we discuss how to use PEGs with labeled failures to implement some of the techniques that we have discussed in Section 3: the nofail combinator [15], the cut combinator [18], the four-values technique [17] and the try combinator [19]. A labeled PEG G is a tuple (V, T, P, L, pS ) where L is a finite set of labels that must include the fail label, and the expressions in P have been extended with the throw operator, explained below. The other parts use the same definitions from Section 2. The abstract syntax of labeled parsing expressions adds the throw operator ⇑l , which generates a failure with label l, and adds an extra argument S to the ordered choice operator, which is the set of labels that the ordered choice should catch. S must be a subset of L. p = ε | a | A | p1 p2 | p1 /S p2 | p ∗ | !p | ⇑l Figure 3 presents the semantics of PEGs with labels as a set of inference rules. The PEG semantics of PEGs with labels is defined by the relation among a parsing expression, an PEG input string and a result. The result is either a string or a label. The notation G[p] xy y means that the expression p matches the input xy, consumes the prefix x and leaves the PEG suffix y as the output. The notation G[p] xy l indicates that the matching of p fails with label l on the input xy. Now a matches and consumes itself and fails with label fail otherwise; p1 p2 tries to match p1 , if p1 matches an input prefix, then it tries to match p2 with the suffix left by p1 , 10 Empty G[ε] x Terminal PEG (empty.1) x PEG G[a] ax (char.1) x G[P (A)] x Non-terminal G[A] x PEG G[p1 ] xy Concatenation PEG PEG PEG PEG G[p] x PEG G[p∗] x PEG PEG G[p] x G[p∗] x PEG Negative Predicate PEG fail l l l PEG y PEG l /S G[p1 G[⇑l ] x G[p2 ] y G[p1 /S p2 ] xy G[p1 ] x Throw y G[p1 ] xy y , b 6= a (char.2) G[a] ε fail p2 ] x PEG X X (ord.1) G[p2 ] x PEG (rep.1) x PEG PEG X X PEG G[p1 p2 ] x G[p1 ] x PEG G[p1 /S p2 ] x l l PEG l PEG G[!p] x (char.3) fail fail PEG y G[p∗] xy G[p] x PEG l G[!p] x PEG l x (not.1) , l 6∈ S (ord.2) PEG l G[p∗] y PEG PEG X X G[p] xy G[!p] xy PEG PEG y fail , l 6= fail (not.3) (throw.1) Figure 3: Semantics of PEGs with labels 11 (con.2) , l ∈ S (ord.3) PEG G[p] xy G[p1 ] x (con.1) (rep.2) , l 6= fail (rep.3) G[p] x PEG (var.1) X G[p1 p2 ] xy Ordered Choice Repetition X G[b] ax (not.2) the label l is propagated otherwise; p1 /S p2 tries to match p1 in the input and tries to match p2 in the same input only if p1 fails with a label l ∈ S, the label l is propagated otherwise; p∗ repeatedly matches p until the matching of p silently fails with label fail, and propagates a label l when p fails with this label; !p successfully matches if the input does not match p with the label fail, fails producing the label fail when the input matches p, and propagates a label l when p fails with this label, not consuming the input in all cases; ⇑l produces the label l. We faced some design decisions in our formulation that are worth discussing. First, we use a set of labels in the ordered choice as a convenience. We could have each ordered choice handling a single label, and it would just lead to duplication: an expression p1 /{l1 ,l2 ,...,ln} p2 would become ( ... ((p1 /l1 p2 ) /l2 p2 ) ... /ln p2 ). Second, we require the presence of a fail label to maintain compatibility with the original semantics of PEGs, where we only have fail to signal both error and failure. For the same reason, we define the expression p1 /p2 as syntactic sugar for p1 /{fail} p2 . Another choice was how to handle labels in a repetition. We chose to have a repetition stop silently only on the fail label to maintain the following identity, which holds for unlabeled PEGs: an expression p∗ is equivalent to a fresh non-terminal A with the rule A ← p A / ε. Finally, the negative predicate succeeds only on the fail label to allow the implementation of the positive predicate: the expression &p that implements the positive predicate in the original semantics of PEGs [3, 9, 2] is equivalent to the expression !!p. Both expressions successfully match if the input matches p, fail producing the label fail when the input does not match p, and propagate a label l when p fails with this label, not consuming the input in all cases. Figure 4 presents a PEG with labels for the Tiny language from Section 2. The expression l [p] is syntactic sugar for (p / ⇑l ). The strategy we used to annotate the grammar was the following: first, annotate every terminal that should not fail, that is, making the PEG backtrack on failure of that terminal would be useless, as the whole parse would either fail or not consume the whole input in that case. For an LL(1) grammar like the one in the example, that means all terminals in a production except the one in the very beginning of the production. After annotating the terminals, we do the same for whole productions. We annotate productions where failing the whole production always implies an error in the input, adding a new alternative that throws an error label specific to that production. For Tiny, we end up annotating just two productions, Factor and CmdSeq. Productions Exp, SimpleExp, and Term also should not fail, but after annotating Factor they always either succeed or throw the label exp. The Cmd production can fail, because it controls whether the repetition inside CmdSeq stops or continue. Notice that this is just an example of how a grammar can be annotated. More thorough analyses are possible: for example, we can deduce that Cmd is not allowed to fail unless the next token is one of ELSE, END, UNTIL, or the end of the input (the FOLLOW set of Cmd), and instead of ⇑cmd add !(ELSE / END / UNTIL / !.) ⇑cmd as a new alternative. This would remove the need for the ⇑cmd annotation of CmdSeq. 12 Tiny ← CmdSeq CmdSeq Cmd IfCmd RepeatCmd AssignCmd ReadCmd WriteCmd Exp SimpleExp Term Factor ← (Cmd [SEMICOLON]sc ) (Cmd [SEMICOLON]sc )∗ / ⇑cmd ← IfCmd / RepeatCmd / AssignCmd / ReadCmd / WriteCmd ← IF Exp [THEN]then CmdSeq (ELSE CmdSeq / ε) [END]end ← REPEAT CmdSeq [UNTIL]until Exp ← NAME [ASSIGNMENT]bind Exp ← READ [NAME]read ← WRITE Exp ← SimpleExp ((LESS / EQUAL) SimpleExp / ε) ← Term ((ADD / SUB) Term)∗ ← Factor ((MUL / DIV) Factor )∗ ← OPENPAR Exp [CLOSEPAR]cp / NUMBER / NAME / ⇑exp Figure 4: A PEG with labels for the Tiny language The PEG reports an error when parsing finishes with an uncaught label. Each label is associated with a meaningful error message. For instance, if we use this PEG for Tiny to parse the code example from Section 2, parsing finishes with the sc label and the PEG can use it to produce the following error message: factorial.tiny:6:1: syntax error, there is a missing ’;’ Note how the semantics of the repetition works with the rule CmdSeq. Inside the repetition, the fail label means that there are no more commands to be matched and the repetition should stop while the sc label means that a semicolon (;) failed to match. It would not be possible to write the rule CmdSeq using repetition if we had chosen to stop the repetition with any label, instead of stopping only with the fail label, because the repetition would accept the sc label as the end of the repetition whereas it should propagate this label. Although the semantics of PEGs with labels presented in Figure 3 allows us to generate specific error messages, it does not give us information about the location where the failure probably is, so it is necessary to use some extra mechanism (e.g., semantic actions) to get this information. To avoid this, we can adapt the semantics of PEGs with labels to give us a tuple (l, y) in case of a failure, where y the suffix of the input that PEG was trying to match when label l was thrown. Updating the semantics of Figure 3 to reflect this change is straightforward. In the next section, we try to establish a comparison between the farthest failure position heuristic and the labeled failure mechanism by contrasting two different implementations of a parser for a dialect of the Lua language. 13 5. Labeled Failures versus Farthest Failure Position In this section we will compare two parser implementations for the Typed Lua language, one that uses the farthest failure position heuristic for error reporting, which was implemented first, and one based on labeled failures. Typed Lua [22] is an optionally-typed extension of the Lua programming language [23]. The Typed Lua parser recognizes plain Lua programs, and also Lua programs with type annotations. The first version of the parser was implemented using Ford’s heuristic and the LPeg library 3 . As LPeg does not have a native error reporting mechanism based on Ford’s strategy, the failure tracking heuristic was implemented following the approach described in Section 2, which uses semantic actions. Below we have the example of a Lua statement with a syntax error: a = function (a,b,) end In this case, the parser gives us the following error message, which is quite precise: test.lua:1:19: syntax error, unexpected ’)’, expecting ’...’, ’Name’ In the previous case, the list of expected tokens had only two candidates, but this is not always the case. For example, let us consider the following Lua program, where there is no expression after the elseif in line 5: 01 02 03 04 05 06 07 if a then return x elseif b then return y elseif end The corresponding error message has a lengthy list of tokens, which does not help much to fix the error: test.lua:7:1: syntax error, unexpected ’end’, expecting ’(’, ’Name’, ’{’, ’function’, ’...’, ’true’, [9 more tokens] When using the Typed Lua parser based on Ford’s heuristic it is not uncommon to get a message like this. An analysis of the test cases available in the parser package shows us that around half of the expected error messages have a list of at least eight expected tokens (there were messages with a list of 39 expected tokens). 3 The first version of Typed Lua parser is available at https://github.com/andremm/typedlua/blob/master/typedlua 14 The second implementation of the Typed Lua parser was based on labeled failures and used the LPegLabel library [24], which is an extension of the LPeg library that supports labeled failures 4 . The use of labeled failures implies in an annotation burden to specify when each label should be thrown. In the case of Typed Lua grammar, we defined almost 50 different labels, using the same basic strategy that we used to annotate the Tiny grammar of Section 4. Given the previous Lua program, the error message presented now is: test.lua:7:1: expecting <exp> after ’elseif’ This error message is more informative than the previous one, which was generated automatically. We analyzed the error messages generated by the two parsers in 53 examples, and considered that in more than half of these examples the parser based on labeled failures produced a better error message. In about 20% of the cases we considered the error messages of both approaches similar, and in other 20% of the cases the parser based on Ford’s heuristic generated better error messages. The error location indicated by the two parsers in the examples analyzed was essentially the same. This seems to indicate that the main difference in practice between both approaches is related to the length of the error message generated. By using labeled failures we can probably get a simple error message at the cost of annotating the grammar, while by using the farthest failure tracking heuristic we can automatically generate error messages, which sometimes may contain a long list of expected tokens. A point that is worth mentioning about the labeled failure approach is that it is not mandatory to annotate the entire grammar. The grammar can be annotated incrementally, at the points where the current error message is not good enough, and when no specific label is thrown, i.e., when the label fail is thrown, an error message can be generated automatically by using the position where the failure occurred. This means that combining labeled failures with the farthest failure position reduces the annotation burden, and helps to identify the places in the parser where the a label is desirable. In the next section, we discuss some applications of labeled failures: we can use labeled PEGs to express the error reporting techniques that we have discussed in Section 3 [15, 18, 17, 19], and also to efficiently parse context-free grammars that can use the LL(∗) parsing strategy [25]. 6. Applications of Labeled Failures This section shows that PEGs with labeled failures can express several error reporting techniques used in the realm of parsing combinators. They can also efficiently parse contextfree grammars that are parseable by the LL(∗) top-down parsing strategy. In Hutton’s deterministic parser combinators [15], the nofail combinator is used to distinguish between failure and error. We can express the nofail combinators using PEGs 4 The second version of Typed Lua parser is available at https://github.com/sqmedeiros/lpeglabel/tree/master/ex 15 with labels as follows: nofail p ≡ p / ⇑error That is, nofail is an expression that transforms the failure of p into an error to abort backtracking. Note that the error label should not be caught by any ordered choice. Instead, the ordered choice propagates this label and catches solely the fail label. The idea is that parsing should finish with one of the following values: success, fail or error. The annotation of the Tiny grammar to use nofail is similar to the annotation we have done using labeled failures. Basically, we just need to change the grammar to use nofail instead of [p]l . For instance, we can write the rule CmdSeq as follows: CmdSeq ← (Cmd (nofail SEMICOLON)) (Cmd (nofail SEMICOLON))∗ If we are writing a grammar from scratch, there is no advantage to use nofail instead of more specific labels, as the annotation burden is the same and with nofail we lose more specific error messages. The cut combinator [18] was introduced to reduce the space inefficiency of backtracking parsers, where the possibility of backtracking implies that any input that has already been processed must be kept in memory until the end of parsing. Semantically it is identical to nofail, differing only in the way the combinators are implemented: to implement cut the parser combinators use continuation-passing style, so cut can drop the failure continuation and consequently any pending backtrack frames. Hutton’s nofail is implemented in direct style, and is not able to drop pending backtrack frames. Expressing a cut operator with the same properties is not possible in our semantics of PEGs. The four-values technique changed the semantics of parser combinators to implement predictive parsers for LL(1) grammars that automatically identify the longest input prefix in case of error, without needing annotations in the grammar. We can express this technique using labeled failures by transforming the original PEG with the following rules: JεK ≡ ⇑epsn JaK ≡ a JAK ≡ A Jp1 p2 K ≡ Jp1 K (Jp2 K / ⇑error /{epsn} ε) /{epsn} Jp2 K Jp1 /p2 K ≡ Jp1 K /{epsn} (Jp2 K / ⇑epsn ) / Jp2 K (1) (2) (3) (4) (5) This translation is based on three labels: epsn means that the expression successfully finished without consuming any input, fail means that the expression failed without consuming any input, and error means that the expression failed after consuming some input. In our translation we do not have an ok label because a resulting suffix means that the expression successfully finished after consuming some input. It is straightforward to check that the translated expressions behave according to the Table 1 from Section 3. Parsec introduced the try combinator to annotate parts of the grammar where arbitrary lookahead is needed. We need arbitrary lookahead because PEGs and parser combinators 16 usually operate at the character level. The authors of Parsec also showed a correspondence between the semantics of Parsec as implemented in their library and Partridge and Wright’s four-valued combinators, so we can emulate the behavior of Parsec using labeled failures by building on the five rules above and adding the following rule for try: Jtry pK ≡ JpK /{error} ⇑fail (6) If we take the Tiny grammar of Figure 1 from Section 2, insert try in the necessary places, and pass this new grammar through the transformation J K, then we get a PEG that automatically identifies errors in the input with the error label. For instance, we can write the rule RepeatCmd as follows: RepeatCmd ← (try REPEAT) CmdSeq UNTIL Exp LL(∗) [25] is a parsing strategy used by the popular parsing tool ANTLR [26, 27] 5 . An LL(∗) parser is a top-down parser with arbitrary lookahead. The main idea of LL(∗) parsing is to build a deterministic finite automata for each rule in the grammar, and use this automata to predict which alternative of the rule the parser should follow, based on the rest of the input. Each final state of the DFA should correspond to a single alternative, or we have an LL(∗) parsing conflict. Mascarenhas et al. [6] shows how CFG classes that correspond to top-down predictive parsing strategies can be encoded with PEGs by using predicates to encode the lookahead necessary for each alternative. As translating a Deterministic Finite Automata (DFA) to a PEG is straightforward [12, 6], this gives us one way of encoding an LL(∗) parsing strategy in a PEG, at the cost of encoding a different copy of the lookahead DFA for each alternative. Labeled PEGs provide a more straightforward encoding, where instead of a predicate for each alternative, we use a single encoding of the lookahead DFA, where each final state ends with a label corresponding to one of the alternatives. Each alternative is preceded by a choice operator that catches its label. To make the translation clearer, let us consider the following example, from Parr and Fisher [25], where non-terminal S uses non-terminal Exp (omitted) to match arithmetic expressions: S → ID | ID ‘=’ Exp | ‘unsigned’ ‘∗’ ‘int’ ID | ‘unsigned’ ‘∗’ ID ID After analyzing this grammar, ANTLR produces the DFA of Figure 5. When trying to match S, ANTLR runs this DFA on the input until it reaches a final state that indicates which alternative of the choice of rule S should be tried. For example, ANTLR chooses the second alternative if the DFA reaches state s4 . Figure 6 gives a labeled PEG that encodes the LL(∗) parsing strategy for rule S. Rules S0 , S1 , and S2 encode the lookahead DFA of Figure 5, and correspond to states s0 , s1 , and s2 , respectively. The throw expressions correspond to the final states. As the throw expressions make the input backtrack to where it was prior to parsing S0 , we do not need to use a predicate. We can also turn any uncaught failures into errors. 5 The recently released version 4 of ANTLR uses adaptive LL(∗) as its parsing strategy. 17 s4 → 2 = s1 EOF ID start s0 s6 → 1 ID unsigned s2 ID s5 → 4 unsigned int int s3 → 3 Figure 5: LL(∗) lookahead DFA for rule S 7. Conclusions In this paper, we discussed error reporting strategies for Parsing Expression Grammars. PEGs behave badly on the presence of syntax errors, because backtracking often makes the PEG lose track of the position where the error happened. This limitation was already known by Ford, and he tried to fix it in his PEG implementation by having the implementation track the farthest position in the input where a failure has happened [3]. We took Ford’s failure tracking heuristic and showed that it is not necessary to modify a PEG implementation to track failure positions as long as the implementation has mechanisms to execute semantic actions, and the current parsing position is exposed to these actions. In addition, we also showed how it is easy to extend the semantics of PEGs to incorporate failure tracking, including information that can indicate what the PEG was expecting when the failure happened. Tracking the farthest failure position, either by changing the PEG implementation, using semantic actions, or redefining the semantics of PEGs, helps PEG parsers produce error messages that are close to error messages that predictive top-down parsers are able to produce, but these are generic error messages, sometimes with a long list of expected tokens. As a way of generating more specific error messages, we introduced a mechanism of labeled failures to PEGs. This mechanism closely resembles standard exception handling in programming languages. Instead of a single kind of failure, we introduced a throw operator ⇑l that can throw different kinds of failures, identified by their labels, and extended the 18 S S0 S1 S2 ← S0 /1 ID /2 ID ‘=’ Exp /3 ‘unsigned’ ‘∗’ ‘int’ ID /4 ‘unsigned’ ‘∗’ ID ID / ⇑error ← ID S1 / ‘unsigned’ S2 / ‘int’ ⇑3 ← ‘=’ ⇑2 / !. ⇑1 / ID ⇑4 ← ‘unsigned’ S2 / ID ⇑4 / ‘int’ ⇑3 Figure 6: PEG with Labels that Simulates the LL(∗) Algorithm ordered choice operator to specify the set of labels that it catches. The implementation of these extensions in parser generator tools based on PEGs is straightforward. We showed how labeled failures can be used as a way to annotate error points in a grammar, and tie them to more meaningful error messages. Labeled failures are orthogonal to the failure tracking approach we discussed earlier, so grammars can be annotated incrementally, at the points where better error messages are judged necessary. We also showed that the labeled failures approach can express several techniques for error reporting used in parsers based on deterministic parser combinators, as presented in related work [15, 18, 17, 19]. Labeled failures can also be used as a way of encoding the decisions made by a predictive top-down parser, as long as the decision procedure can be encoded as a PEG, and showed an example of how to encode an LL(∗) grammar in this way. Annotating a grammar with labeled failures demands care: if we mistakenly annotate expressions that should be able to fail, this modifies the behavior of the parser beyond error reporting. In any case, the use of labeled PEGs for error reporting introduces an annotation burden that is lesser than the annotation burden introduced by error productions in LR parsers, which also demand care, as their introduction usually lead to reduce-reduce conflicts [28]. We showed the error reporting strategies in the context of a small grammar for a toy language, and we also discussed the implementation of parsers for the Typed Lua language, an extension of the Lua language, based on these strategies. Moreover, we also implemented parsers for other languages, such as Céu [29], based on theses approaches, improving the quality of error reporting either with generic error messages or with more specific error messages. References [1] A. V. Aho, M. S. Lam, R. Sethi, J. D. Ullman, Compilers: Principles, Techniques, and Tools, 2nd Edition, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2006. [2] B. Ford, Parsing expression grammars: A recognition-based syntactic foundation, in: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’04, ACM, New York, NY, USA, 2004, pp. 111–122. [3] B. Ford, Packrat parsing: a practical linear-time algorithm with backtracking, Master’s thesis, Massachusetts Institute of Technology (September 2002). [4] S. Medeiros, F. Mascarenhas, R. Ierusalimschy, From regular expressions to parsing expression grammars, in: Brazilian Symposium on Programming Languages, 2011. 19 [5] S. Medeiros, F. Mascarenhas, R. Ierusalimschy, Programming Languages: 16th Brazilian Symposium, SBLP 2012, Nat Springer Berlin Heidelberg, Berlin, Heidelberg, 2012, Ch. Left Recursion in Parsing Expression Grammars, pp. 27–41. doi:10.1007/978-3-642-33182-4\_4. URL http://dx.doi.org/10.1007/978-3-642-33182-4_4 [6] F. Mascarenhas, S. Medeiros, R. Ierusalimschy, On the relation between context-free grammars and parsing expression grammars, Science of Computer Programmingdoi:http://dx.doi.org/10.1016/j.scico.2014.01.012. [7] K. C. Louden, Compiler Construction: Principles and Practice, PWS Publishing Co., Boston, MA, USA, 1997. [8] D. Grune, C. J. Jacobs, Parsing Techniques: A Practical Guide, 2nd Edition, Springer Publishing Company, Incorporated, 2010. [9] B. Ford, Packrat parsing: Simple, powerful, lazy, linear time, in: Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming, ICFP ’02, ACM, New York, NY, USA, 2002, pp. 36–47. [10] I. Piumarta, peg/leg — recursive-descent parser generators for C, http://piumarta.com/software/peg/, [Visited on March 2013] (2007). [11] R. Ierusalimschy, LPeg parsing expression grammars for Lua, http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html, [Visited on March 2013] (2008). [12] R. Ierusalimschy, A text pattern-matching tool based on parsing expression grammars, Software: Practice & Experience 39 (3) (2009) 221–258. [13] K. Mizushima, A. Maeda, Y. Yamaguchi, Packrat parsers can handle practical grammars in mostly constant space, in: Proceedings of the 9th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE ’10, ACM, New York, NY, USA, 2010, pp. 29–36. [14] R. Grimm, Better extensibility through modular syntax, in: Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’06, ACM, New York, NY, USA, 2006, pp. 38–51. doi:10.1145/1133981.1133987. URL http://doi.acm.org/10.1145/1133981.1133987 [15] G. Hutton, Higher-order functions for parsing, Journal of Functional Programming 2 (3) (1992) 323– 343. [16] M. Spivey, When maybe is not good enough, Journal of Functional Programming 22 (2012) 747–756. doi:10.1017/S0956796812000329. URL http://journals.cambridge.org/article_S0956796812000329 [17] A. Partridge, D. Wright, Predictive parser combinators need four values to report errors, Journal of Functional Programming 6 (2) (1996) 355–364. [18] N. Röjemo, Efficient parsing combinators, Tech. rep., Department of Computer Science, Chalmers University of Technology (1995). [19] D. Leijen, E. Meijer, Parsec: Direct style monadic parser combinators for the real world, Tech. Rep. UU-CS-2001-35, Department of Computer Science, Utrecht University (2001). [20] S. D. Swierstra, L. Duponcheel, Deterministic, error-correcting combinator parsers, in: Advanced Functional Programming, Vol. 1129 of Lecture Notes in Computer Science, Springer, 1996, pp. 184–207. [21] S. D. Swierstra, Combinator parsers: a short tutorial, in: A. Bove, L. Barbosa, A. Pardo, J. Sousa Pinto (Eds.), Language Engineering and Rigorous Software Development, Vol. 5520 of LNCS, Springer-Verlag, 2009, pp. 252–300. [22] A. M. Maidl, F. Mascarenhas, R. Ierusalimschy, Typed Lua: An optional type system for Lua, in: Proceedings of the Workshop on Dynamic Languages and Applications, Dyla’14, ACM, New York, NY, USA, 2014, pp. 3:1–3:10. doi:10.1145/2617548.2617553. URL http://doi.acm.org/10.1145/2617548.2617553 [23] R. Ierusalimschy, Programming in Lua, 3rd Edition, Lua.Org, 2013. [24] S. Medeiros, LPegLabel - an extension of LPeg that supports labeled failures, https://github.com/sqmedeiros/lpeglabel, [Visited on October 2015] (2014). [25] T. Parr, K. Fisher, Ll(*): The foundation of the antlr parser generator, in: Proceedings of the 32Nd 20 [26] [27] [28] [29] ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, ACM, New York, NY, USA, 2011, pp. 425–436. doi:10.1145/1993498.1993548. URL http://doi.acm.org/10.1145/1993498.1993548 T. Par, The Definitive ANTLR 4 Reference, 2nd Edition, Pragmatic Bookshelf, 2013. T. Parr, ANTLR, http://www.antlr.org, [Visited on March 2014]. C. L. Jeffery, Generating LR syntax error messages from examples, ACM Transactions on Programming Languages and Systems (TOPLAS) 25 (5) (2003) 631–640. F. Sant’Anna, Safe system-level concurrency on resource-constrained nodes with céu, Ph.D. thesis, PUC–Rio (2013). 21 Appendix A. Formalization of Farthest Failure Tracking In Section 2, we saw that a common approach to report errors in PEGs is to inform the position of the farthest failure, and how we can use semantic actions to implement this approach in common PEG implementations. In this appendix, we show a conservative extension of the PEG formalism that expresses this error reporting approach directly, making it a part of the semantics of PEGs instead of an ad-hoc extension to PEG implementations. The result of a PEG on a given input is either fail or a suffix of the input. Returning a suffix of the input means that the PEG succeeded and consumed a prefix of the input. PEGs with farthest failure tracking return the product of the original result and either another suffix of the input, to denote the position of the farthest failure during parsing, or nil to denote that there were no failures. Figure A.7 presents a formal semantics of PEGs with farthest failure tracking as a set PEG of inference rules. The notation G[p] xy (y, v?) represents a successful match of the parsing expression p in the context of a PEG G against the subject xy, consuming x and PEG leaving the suffix y. In a similar way, G[p] xy (fail, v?) represents an unsuccessful match. The term v? denotes a value that is either a suffix v of the original input or nil. We cannot use an empty string to denote that there were no failures, as an empty string already means that a failure has occurred after the last position of the input. The term X denotes a value that is either a suffix of the current input or fail. The auxiliary function smallest that appears on Figure A.7 compares two possible error positions, denoted by a suffix of the input string, or nil if no failure has occurred, and returns the furthest: any suffix of the input is a further possible error position than nil and a shorter suffix is a further possible error position than a longer suffix. Rule empty.1 deals with the empty expression. This expression never fails, so the failure position is always nil. Rule var.1 deals with non-terminals, so it just propagates the result of matching the right-hand side of the non-terminal. Rules char.1, char.2, and char.3 deal with terminals. The latter two rules denote failures, so they return the subject as the failure position. Rules con.1 and con.2 deal with concatenation. The second rule just propagates the failure position, but rule con.1 needs to take the farthest position between the two parts of the concatenation. The rules for ordered choice (ord.1 and ord.2) and repetition (rep.1 and rep.2) work in a similar way: whenever there are two possible farthest failure positions, we use smallest to take the farthest of them. Finally, rules not.1 and not.2 deal with the syntactic predicate. Fitting this predicate in this error reporting framework is subtle. The rules not only need to make sense for the predicate in isolation, but also have to make sense for !!p, which works as a “positive lookahead” predicate that succeeds if p succeeds but fails if p fails while never consuming any input. For not.1, the case where !p succeeds, we have two choices: either propagate p’s farthest failure position, or ignore it (using nil). The first choice can lead to an odd case, where the failure that made !p succeed can get the blame for the overall failure of the PEG, so not.1 takes the second choice. 22 Empty G[ε] x PEG Terminal (x, nil) G[a] ax PEG G[b] ax Concatenation Ordered Choice Repetition PEG (empty.1) (x, nil) (fail, ax) G[p1 ] xy PEG (y, v?) G[p1 p2 ] xy G[p1 ] xy PEG G[p1 / p2 ] xy G[p] x PEG G[p∗] x Negative Predicate (y, v?) (fail, v?) PEG (x, v?) G[p] x PEG G[!p] x G[p2 ] y (y, v?) (rep.1) (x, nil) PEG (X, w?) (ord.1) (fail, v?) PEG PEG G[a] ε (X, smallest(v?, w?)) PEG G[A] x PEG PEG (X, v?) (X, v?) (var.1) (char.1) , b 6= a (char.2) PEG G[P (A)] x Non-terminal G[p] xyz (con.1) G[p1 ] x PEG PEG (yz, v?) PEG G[p1 ] x PEG G[p1 p2 ] x PEG (fail, v?) PEG (fail, v?) G[p2 ] x G[p∗] yz PEG PEG PEG (con.2) (X, w?) (X, smallest(v?, w?)) PEG (z, w?) (z, smallest(v?, w?)) G[p] xy G[!p] xy (char.3) (fail, v?) G[p1 / p2 ] x G[p∗] xyz (not.1) (fail, ε) (y, v?) (fail, xy) (rep.2) (not.2) Figure A.7: Semantics of PEGs with farthest failure tracking We also have two choices for the case where !p fails: either propagate the failure position from p or just use the current position. The first choice can also lead to an odd cases where the overall failure of the PEG might be blamed on something in p that, if corrected, still makes p succeed and !p fail, so not.2 also takes the second choice. The end result is that what happens inside a predicate simply does not take part in error reporting at all, which is the simplest approach, and also gives a consistent result for !!p. As an example that shows the interaction of these rules, let us consider again the Tiny program in Figure 1, reproduced below: 01 02 03 04 05 06 07 n := 5; f := 1; repeat f := f * n; n := n - 1 until (n < 1); write f; 23 (ord.2) The missing “;” at the end of line 5 makes the repetition (Cmd SEMICOLON)* inside CmdSeq succeed through rule rep.1 and propagate the failure position to the concatenation inside this same non-terminal. Rule con.2 then propagates the same failure position to the concatenation inside RepeatCmd. Another failure occurs in RepeatCmd when until does not match n, but rule con.2 again propagates the position of the missing “;”, which is farthest. This leads to a failure inside the repetition on CmdSeq again, which propagates the position of the missing “;” through rule rep.2. Finally, rules con.2 and var.1 propagate this failure position to the top of the grammar so the missing semicolon gets the blame for the PEG not consuming the whole program. We can translate the failure suffix into a line and column number inside the original subject, and extract the first token from the beginning of this suffix to produce an error message similar to the error messages in Section 2: factorial.tiny:6:1: syntax error, unexpected ’until’ While this message correctly pinpoints the location of the error, it could be more informative. Appendix B shows how we can extend the semantics of Figure A.7 to gather more information than just the farthest failure position, thus making us able to generate error messages as informative as the ones produced by Pappy, which we discussed in the end of Section 2. In the next section, we will introduce another approach for error reporting in PEGs, which can produce more precise error messages, at the cost of annotating the grammar. Appendix B. Formalization of Farthest Failure Tracking and Error Lists In this appendix we show how the formalization of the farthest failure tracking from Appendix A can easily be adapted to build a more elaborate error object, instead of just returning a position. The new semantics formalizes a strategy similar to the one used by Ford [3] in his PEG implementation. The basic idea is to keep a list of the simple expressions that the PEG was expecting to match when a failure occurred, and use this list to build an error message. PEG Figure B.8 gives inference rules for the relation of this new semantics. The result of the matching of a PEG G against an input x is still a pair, but the second component is now another pair, the error pair. The first component of the error pair is the farthest error position, same as in the previous semantics. The second component is a list of parsing expressions that were expected at this error position. If the grammar does not have syntactic predicates, the expressions in this list are just terminals and non-terminals. Rules empty.1 and char.1 do not change, and rules char.2 and char.3 just return a list with the terminal that they tried to match. 24 Empty G[ε] x PEG Terminal G[A] x (X, joinVar((v?, L), x, A)) G[a] ax PEG (x, (nil, {})) PEG PEG G[p1 p2 ] x (fail, (ax, {b})) G[p1 ] xy (fail, (v?, L)) G[p1 / p2 ] xy (fail, (v?, L1 )) G[p2 ] y (y, (v?, L)) PEG (y, (v?, L)) G[p2 ] x PEG G[p] x PEG (fail, (v?, L)) G[p] xyz PEG (x, (v?, L)) (yz, (v?, L1 )) G[p∗] xyz PEG Negative Predicate G[p∗] yz PEG G[!p] x (char.3) (con.1) PEG (z, (w?, L2 )) (fail, (v?, L)) PEG (ord.2) (rep.1) (z, join((v?, L1 ), (w?, L2 ))) G[p] x (X, (w?, L2 )) (X, (w?, L2 )) (X, join((v?, L1 ), (w?, L2 ))) G[p∗] x (fail, (ε, {a})) (ord.1) G[p1 / p2 ] x PEG PEG PEG (X, join((v?, L1 ), (w?, L2 ))) PEG Repetition G[a] ε (con.2) PEG G[p1 ] xy , b 6= a (char.2) PEG (var.1) (char.1) (y, (v?, L1 )) (fail, (v?, L)) PEG PEG PEG G[p1 p2 ] xy Ordered Choice G[p1 ] x (X, (v?, L)) PEG Concatenation G[p1 ] x PEG G[P (A)] x Non-terminal G[b] ax (empty.1) (x, (nil, {})) (x, (nil, {})) (not.1) (rep.2) G[p] xy G[!p] xy PEG PEG (y, (v?, L)) (fail, (xy, {!p})) Figure B.8: Semantics of PEGs with farthest failure tracking and error lists 25 (not.2) Rule var.1 uses an auxiliary function joinVar, defined as follows: joinVar((x, L), x, A) = (x, {A}) joinVar((nil, {}), x, A) = (nil, {}) joinVar((v, L), x, A) = (v, L) where x 6= v The idea behind joinVar is simple: if the right-hand side of terminal A has a farthest error position that is the same as the current position in the input, it means that we can treat this possible error as an error while expecting A itself. This is expressed in the first case of joinVar by replacing the list of expected expressions L with just {A}. The other cases just propagate the failure information returned by P (A). To further understand how joinVar works, let us consider an example, adapted from the grammar in Figure 1: Factor ← “(” Exp “)” / Digit Digit∗ Digit ← “0” / “1” / “2” / “3” / “4” / “5” / “6” / “7” / “8” / “9” When we try to match Factor against an input that does not match either “(” or Digit, such as id, both alternatives of the ordered choice fail and the farthest failure position of both matches is the same input that we were trying to match with Factor. So, instead of keeping an error list that would later give us an error message like the following one: Unexpected ’id’, expecting ’(’ or ’0’ or ’1’ or ’2’ or ’3’ or ’4’ or ’5’ or ’6’ or ’7’ or ’8’ or ’9’ Or even an error message like this one: Unexpected ’id’, expecting ’(’ or Digit We replace the error list built during the matching of the right-hand side of Factor with just {Factor}. From this new list we can get the following higher-level error message: Unexpected ’id’, expecting Factor If the failure occurred in the middle of the first alternative of Factor (for example, because of a missing “)’, we would keep the original error list instead of replacing it with {Factor}. Using the names of the non-terminals in the error message instead of a list of terminals that might have started this non-terminal might not be better if the names of the nonterminals give no indication to the user of what was expected. It is easy to replace joinVar with just (v?, L), propagating the failure information from the expansion of the non-terminal and keeping the error message just with symbols that the user can add to the input. Another possibility is to have two kinds of non-terminals, and use joinVar for informative nonterminals and simple propagation for the others. In the case of concatenation, a failure in the first expression of the concatenation means we just need to propagate the error list, so case con.2 is straightforward. If both expressions 26 succeed, we might need to merge both error lists, if the two parts of the concatenation have the same failure position. Rule con.1 uses the auxiliary join function, defined below: join((x, L), (nil, {})) = (x, L) join((nil, {}), (x, L)) = (x, L) join((xy, L1 ), (y, L2)) = (y, L2 ) join((y, L1 ), (xy, L2)) = (y, L1 ) join((x, L1 ), (x, L2 )) = (x, L1 where x 6= ε where x = 6 ε L2 ) The first four cases of join keep the furthest and associated set of expected expressions. In the first two cases, nilmeans that no error has occurred, so any error automatically becomes the farthest error position. In the next two cases, one of the furthest error positions is a strict suffix of the other, so is the furthest of the two and the other is discarded. The only remaining possibility, expressed in the last case, is that the two positions are identical, and we merge their expected sets. The rules for ordered choice and repetition use the same join function, where applicable. Finally, the rules for the syntactic predicate !p also ignore the error information inside p. Rule not.2 blames the failure on the predicate itself. Going back to our running example (Figure 2), our error tracking semantics will give an error list that lets us generate the following error message: factorial.tiny:6:1: syntax error, unexpected ’until’, expecting ’;’, ’=’, ’<’, ’-’, ’+’, ’/’, ’*’ The operators also end up in the error list because their lexical rules all fail in the same position as the semicolon. This error message is similar to the error message we get using the error tracking combinators that we implemented on LPeg, at the end of Section 2. We might try to tweak the error tracking heuristics of repetition and ordered choice to ignore errors that happen in the first symbol of the input, which would let us take out the operators from the error list in our previous example, and give a more succinct error message: factorial.tiny:6:1: syntax error, unexpected ’until’, expecting ’;’ This heuristic is not sound in the general case, though. Suppose we replace line 6 of Figure 2 with the following line: 6 n ; until (n < 1); The tweaked heuristic would still produce an error list with just the semicolon, which is clearly wrong, as the problem is now a missing operator. It is common in PEGs to mix scanning and parsing in the same grammar, as syntactic predicates and repetition make lexical patterns convenient to express. But this can lead to problems in the automatic generation of error messages because failures are expected while 27 recognizing a token, and these failures related to scanning can pollute the error list that we use to generate the error message. As an example, let us consider the lexical rule THEN from the PEG for the Tiny language of Section 2: THEN ← then !IDRest Skip The pattern in the right-hand side fails if any alphanumeric character follows then in the input, putting the predicate in the error list. The error will be reported to the user as an unexpected character after then instead of a missing then keyword. One solution is to split the set of non-terminals into lexical and non-lexical non-terminals. Non-lexical non-terminals follow rule var.1, but lexical terminals follow a pair of new rules: G[P (A)] xy G[A] xy PEG G[P (A)] x G[A] x PEG (y, (nil, {})) PEG PEG (y, (v?, L)) (lvar.1) (fail, (v?, L)) (fail, (x, {A})) (lvar.2) Intuitively, a lexical non-terminal reports errors just like a terminal. Any failures that happen in a successful match are ignored, as they are considered to be expected, and a failed match of the whole non-terminal gets blamed on the non-terminal itself, at its starting position in the input. All the extensions to the semantics of PEGs that we discussed in this section are conservative: if a PEG fails with some subject in the original semantics, it will also fail in all of our extensions, and if a PEG matches some subject and leaves a suffix, it will also match and leave the same suffix in all of our extensions. This is stated by the following lemma, PEG where we use the symbol to represent the regular semantics of PEGs [6], and the symbol PEGF to represent the extended semantics of PEGs presented in Figure A.7: Lemma Appendix B.1 (Conservativeness of farthest failure tracking). Given a PEG G, a PEG PEGF parsing expression p and a subject xy, we have that G[p] xy y iff G[p] xy (y, v?), PEG PEGF and that G[p] xy fail iff G[p] xy (fail, v?). Proof. By induction on the height of the respective proof trees. The proof is straightforward, PEG PEGF since the only difference between the rules of and is presence of the farthest failure position, but this position has no influence on whether the expression successfully consumes part of the input or fails. A similar Lemma for the semantics with expected expression lists of Figure B.8 is also PEGL straightforward to prove, where we use the symbol to represent those extended semantics: Lemma Appendix B.2 (Conservativeness of farthest failure tracking with expected lists). PEG Given a PEG G, a parsing expression p and a subject xy, we have that G[p] xy y iff PEGL PEG PEGL G[p] xy (y, (v?, L)), and that G[p] xy fail iff G[p] xy (fail, (v?, L)). 28 Proof. By induction on the height of the respective proof trees. The proof is also straightPEG PEGL forward, since the only difference between the rules of and is presence of the farthest failure position and list of expected expressions, but this extra information has no influence on whether the expression successfully consumes part of the input or fails. 29
6cs.PL
Automatic estimation of the regularization parameter in 2-D focusing gravity inversion: an application to the Safo manganese mine in northwest of Iran Saeed Vatankhaha , Vahid E Ardestania , Rosemary A Renautb,∗ a arXiv:1310.0068v2 [cs.CE] 10 Jan 2014 b Institute of Geophysics, University of Tehran,Tehran, Iran School of Mathematical and Statistical Sciences, Arizona State University, Tempe, AZ 85287-1804, USA Abstract We investigate the use of Tikhonov regularization with the minimum support stabilizer for underdetermined 2-D inversion of gravity data. This stabilizer produces models with nonsmooth properties which is useful for identifying geologic structures with sharp boundaries. A very important aspect of using Tikhonov regularization is the choice of the regularization parameter that controls the trade off between the data fidelity and the stabilizing functional. The L-curve and generalized cross validation techniques, which only require the relative sizes of the uncertainties in the observations are considered. Both criteria are applied in an iterative process for which at each iteration a value for regularization parameter is estimated. Suitable values for the regularization parameter are successfully determined in both cases for synthetic but practically relevant examples. Whenever the geologic situation permits, it is easier and more efficient to model the subsurface with a 2-D algorithm, rather than to apply a full 3-D approach. Then, because the problem is not large it is appropriate to use the generalized singular value decomposition for solving the problem efficiently. The method is applied on a profile of gravity data acquired over the Safo mining camp in MakuIran, which is well known for manganese ores. The presented results demonstrate success in reconstructing the geometry and density distribution of the subsurface source. Keywords: Gravity inversion, manganese exploration, regularization parameter, L-curve criterion, generalized cross validation, generalized singular value decomposition PACS: 93.30.Bz,, 93.85.Hj 1. Introduction Gravity inversion reconstructs models of subsurface density distribution using measured data on the surface. There are two important ambiguities in the inversion of gravity data. Corresponding Author: Rosemary Renaut, 480 965 3795 Email addresses: [email protected] (Saeed Vatankhah), [email protected] (Vahid E Ardestani), [email protected] ( Rosemary A Renaut) ∗ Preprint submitted to Journal of Geophysics and Engineering January 13, 2014 Theoretical ambiguity is caused by the nature of gravity; many equivalent sources in the subsurface can produce the same data at the surface. Algebraic ambiguity occurs when parameterization of the problem creates an underdetermined situation with more unknowns than observations. Then, there is no unique density distribution which satisfies the observed data. Further, the measurement process at the Earth’s surface is necessarily error-contaminated and such errors can introduce arbitrarily large changes in the reconstructed solutions; namely the solutions are sensitive to errors in the measurements. Thus, the inversion of gravity data with under sampling is a typical example of an ill-posed problem that requires the inclusion of a priori information in order to find a feasible reconstruction. Tikhonov regularization is a well-known and well-studied method for stabilizing the solutions of ill-posed problems, (Hansen, 1998; Vogel, 2002, e.g.). The objective function of the Tikhonov formulation includes a data fidelity (misfit term), and a stabilizing term that controls the growth of the solution with respect to a chosen weighted norm. The choice of the weighting for the regularization term impacts the properties of the solution. For example, a smoothing stabilizer which employs the first or second derivative of the model parameters, such as used in (Li and Oldenburg, 1996, 1998, e.g.) produces smooth images of the subsurface density distribution. There are, however, situations in which the potential field sources are localized and have material properties that vary over relatively short distances. Then, a regularization that does not not penalize sharp boundaries should be used. Last and Kubik (1983) presented a compactness criteria for gravity inversion that seeks to minimize the volume of the causative body. This concept was developed by introducing minimum support (MS) and minimum gradient support (MGS) stabilizers Portniaguine and Zhdanov (1999), Zhdanov ( 2002), which are applied iteratively, generating repeatedly updated weighted quadratic stabilizers. In any regularization method, the trade off between the data fit and the regularization term is controlled by a regularization parameter. Methods to find this regularization parameter, called parameter-choice methods, can be divided into two classes Hansen (1998): (i) those that are based on knowledge of, or a good estimate of, the error in the observations, such as Morozov’s discrepancy principle (MDP), and (ii) those that, in contrast, seek to extract such information from the observations, such as the L-curve or generalized crossvalidation (GCV) methods. The use of the MDP is dominant in papers related to potential field inversion,(Li and Oldenburg, 1996, 1998, e.g.), and the original paper for focusing inversion Portniaguine and Zhdanov (1999). In many practical applications, little knowledge about the noise or error in the data measurements is available. The MDP then reduces to a trial and error procedure for finding the optimal regularization parameter Li and Oldenburg (1999). Here we discuss the use of the L-curve and GCV methods for use in focusing inversion of gravity data in situations in which there is information about the relative magnitudes of the standard deviations across the measured data Farquharson and Oldenburg (2004). Due to the iterative nature of the algorithm, the regularization parameter is determined each iteration. Depending on the type of problem to be tackled, gravity inversion can be carried out either in two or three dimensions (2-D or 3-D). 2-D methods are suitable for the recovery 2 of geologic structures such as faults, dikes and rift zones for which the length of the source body in one direction is much longer than its extension in other directions. Then, it may be possible to consider the gravitational sources as completely invariant in the direction parallel to the length direction. Additionally, 2-D sources are both easier to conceptualize and model than their 3-D counterparts, Blakely (1996). The outline of this paper is as follows. In Section 2 we review the derivation of the analytic calculation of the gravity anomaly derived from a 2-D cell model and then present an overview of numerical methods for focusing inversion. The use, and rationale for the use, of the generalized singular value decomposition, Paige and Saunders ( 1981), for the solution is given in Section 2.2.1. The L-curve and GCV parameter-choice methods are discussed in Section 2.3. Results for synthetic data are illustrated in Section 3. The approach is applied on a profile of gravity data acquired from the Safo mining camp in Maku-Iran in Section 4. Future directions and conclusions follow in Section 5. 2. Gravity modeling 2.1. The theoretical model A simple 2-D model is obtained by dividing the subsurface under the survey area in to a large number of infinitely long horizontal prisms in the invariant y−direction, with variations in densities only assumed for the x and z directions. The cross-section of the subsurface under the gravity profile for the model is shown in Figure 1 in which the cells have square cross section and unknown densities. The dimensions of the cells are equal to the distances between two observation points and the unknown density is considered to be constant for each block. This type of parameterization, originally used by Last and Kubik (1983), could indeed be improved. Yet, increasing the resolution of the models, and hence the number of parameters, by dividing the subsurface into smaller cells, makes the problem more ill-posed. Here the unknown density is considered to be constant for each block and the data and model parameters are linearly related. The vertical component of the gravitational attraction gi of a two-dimensional body at the origin using Cartesian coordinates is given by, Blakely (1996), Z Z ′ ′ ′ z dx dz gi = 2Γρ . (1) x′ 2 + z ′ 2 Here Γ is the universal gravitational constant and the density ρ is assumed to be constant within the body. A solution of this integral for an ℓ-sided polygon is given by, Blakely (1996),   ℓ X gi rp+1 νp log = 2Γ − ψp (θp+1 − θp ) , ρj 1 + ψp2 rp p=1 (2) where ψp = (xp+1 − xp )/(zp+1 − zp ) and νp = xp − ψp zp . The variables rp , rp+1 , θp , and θp+1 are as displayed for the upper side of a square block in Figure 1. The term on the right-hand side of (2), which quantifies the contribution to the ith datum of a unit density in the jth 3 Figure 1: The cross-section of the subsurface under the gravity profile. Gravity stations are located at the centers of the blocks at the ground surface, indicated by the ∆ symbols. The cells are square and their dimensions are equal to the distances between two observation points. Each cell extends as an infinitely long prism in the invariant y−direction. cell, is denoted by the kernel weight Gij , and is valid only at station i for cell j. The total response for station i is obtained by summing over all cells giving gi = n X Gij ρj , i = 1, . . . , m, j=1 m ≤ n, (3) which leads to the matrix equation d = Gm + e, (4) where we have used the standard notation that vector d is the set of measurements given by the gi , m is the vector of unknown model parameters, here the densities ρj , and e represents the error in the measurements. The purpose of the gravity inverse problem is to find a geophysically plausible density model that reproduces d. 2.2. Numerical approaches for focusing inversion The conventional method for solving ill-posed inverse problems as described by (4) is based on minimization of the parametric functional P α (m) = φ(d) + α2 S(m). (5) Here φ(d) measures the data fidelity, which is usually measured by the weighted discrepancy φ(d) = kWd (d − dobs )k22 , (6) where d = Gm is the vector of predicted data, dobs contains the observations and Wd is a data weighting matrix. Under the assumption that the noise e is Gaussian and uncorrelated, 4 Wd = diag(1/σ1 , . . . , 1/σm ) where σi is the standard deviation of the noise in the ith datum. Following Farquharson and Oldenburg (2004), rather than always assuming that the absolute magnitudes of the error are known, we assume that the relative magnitudes of the error can be estimated. Then for an unknown σ0 each σi is reexpressed as σi = σ0 σ̃i and Wd = diag(1/σ̃1 , . . . , 1/σ̃m ). In (5) S(m) is a stabilizing regularization functional and α is a regularization parameter. Different choices are possible for S(m). Here we use the minimum support (MS) stabilizer introduced in Last and Kubik (1983) and used in Portniaguine and Zhdanov (1999). This stabilizer generates a compact image of a geophysical model with sharp boundaries and, following Zhdanov ( 2002), is of the form: SMS (m) = (m − mapr )T (m̂ − m̂apr )2 + ǫ2 I) = (m − mapr )T We2 (m − mapr ), −1 (m − mapr ) We = (m̂ − m̂apr )2 + ǫ2 I (7) −1/2 , (8) where m̂ and m̂apr are diagonal matrices of the current model parameters m and an estimate of the model parameters mapr . If good prior knowledge of the properties of the subsurface distribution exists, a full model of the expected physical properties can be used for mapr , otherwise it is often set to 0. In We , ǫ ≥ 0 is a focusing parameter that is introduced to provide stability as m → mapr component wise. Small values for ǫ lead to compact models but also increase the instability in the solution. For large ǫ the image will not be focused. In general we are interested in the case where ǫ → 0. A trade-off curve method can be used to select ǫ, Zhdanov and Tolstaya (2004); Ajo et al (2007); Vatankhah et al (2013). It is well known that in potential data inversion the reconstructed models tend to concentrate near the surface. The depth weighting matrix, Wdepth = 1/(zj + ζ)β introduced in Li and Oldenburg (1996, 1998); Pilkington (1997) can then be incorporated into the stabilizer term. Here zj is the mean depth of cell j and ζ > 0 is a small number imposed to avoid singularity at the surface. The choice for β is important. Small β provide a shallow reconstruction for the solution and large values concentrate the solution at depth. For all inversions considered here β = 0.6 is selected. The hard constraint matrix Whard is also important for the inversion process. If field operation geological and geophysical information are able to provide the value of the density of cell j this information should be included in mapr . Then, Whard is the diagonal identity matrix but with (Whard )jj = 100 for those diagonal entries j for which information on the density is known. Combining the diagonal weighting matrices, Whard , We and Wdepth , (5) is replaced by P α (m) = kWd (Gm − dobs )k2 + α2 kD(m − mapr )k2 , D = We Whard Wdepth . (9) To obtain solution m := arg minm P α (m) linear transformation of the original model parameters is introduced via m(α) = m − mapr . Then m(α) solves the normal equations (GT Wd2 G + α2 D T D)m(α) = GT Wd2 (dobs − Gmapr ) providing m = mapr + m(α). 5 (10) (11) When (9) is solved iteratively due to the dependence of We on k, we use mapr = m(k−1) , (k) m(0) = 0 and D (k) = We Whard Wdepth with We(k) = (m̂(k−1) − m̂(k−2) )2 + ǫ2 I −1/2 k > 1, We(1) = I. (12) Then m(k) is obtained from the iteratively regularized equation, with updated regularization parameter α(k) , (GT Wd2 G + (α(k) )2 (D (k) )T D (k) )m(α(k) ) = GT Wd2 (dobs − Gm(k−1) ) yielding m(k) = m(k−1) + m(α(k) ). (13) (14) This technique in which the weighting in We is frozen at each iteration, creating the possibility to solve using the standard Tikhonov update, was introduced in the context of focusing inversion in Zhdanov ( 2002). Because the MS stabilizer tends to produce the smallest possible anomalous domain we follow the approach of Portniaguine and Zhdanov (1999); Boulanger and Chouteau (2001) to produce a reliable image of the subsurface when using focusing inversion. Based on geologic information, upper and lower bounds, mmin ≤ mj ≤ mmax , can be determined for the model parameters. If during the iterative process a given density value falls outside the bounds, projection is employed to force the value back to the exceeded value, and a hard constraint is imposed at that cell via (Whard )jj = 100. 2.2.1. Numerical Solution by the Generalized Singular Value Decomposition We now discuss the numerical procedure for finding the solution to (13). For large scale problems, iterative methods such as conjugate gradients, or other Krylov methods should be employed to find m(α(k) ), (Hansen, 1998, e.g.). For small scale problems it is feasible to use the singular value decomposition (SVD) for the matrix G̃ = Wd G, when matrix D is the identity. Otherwise the generalized singular value decomposition (GSVD), Paige and Saunders ( 1981), is needed. But again is effective to use for this problem because it facilitates efficient determination of the regularization parameter. We assume G̃ ∈ Rm×n , m < n, D ∈ Rn×n and N (G̃) ∩ N (αD) = 0, where N (G̃) is the null space of matrix G̃. Then there exist orthogonal matrices U ∈ Rm×m , V ∈ Rn×n and a nonsingular matrix X ∈ Rn×n such that G̃ = UΛX T , D = V MX T where Λ of size m × n is zero except for entries 0 < Λ1,q+1 ≤ . . . Λm,n < 1 with q = n − m, M is diagonal of size n × n with entries 1 = M1,1 = . . . Mq,q > Mq+1,q+1 ≥ M2,2 ≥ . . . Mn,n > 0. The generalized singular values of the matrix pair G̃, D are γi = λi /µi , where γ1 = · · · = γq = 0 < γq+1 ≤ · · · ≤ γn , and ΛT Λ = diag(0, . . . 0, λ2q+1 , . . . , λ2n ), M T M = diag(1, . . . , 1, µ2q+1, . . . , µ2n ), and λ2i + µ2i = 1, ∀i = 1 : n, i.e. M T M + ΛT Λ = In . Using the GSVD, introducing ui as the ith column of matrix U and r̃(k) = Wd (dobs − 6 Gm(k−1) ), we may immediately write the solution of (13) as (k) m(α ) = (k) m n X uTi−q r̃(k) T −1 γi2 (X )i , γ 2 + (α(k) )2 λi i=q+1 i (k−1) =m + n X i=q+1 fi (15) uTi−q r̃(k) T −1 γi2 (X )i , fi = 2 , q < i ≤ n, fi = 0, 1 ≤ i ≤ q, λi γi + (α(k) )2 (16) is the ith column of the inverse of the matrix X T and fi are the filter factors. where (X T )−1 i Therefore the algorithm proceeds by first updating the matrix We at step k using (12), calculating the GSVD for the matrix pair [G̃, D (k)] and then updating m(k) using (16) which depends on α(k) . Three criteria are used to terminate the iterative procedure. Following Farquharson and Oldenburg (2004) the iteration is seen to have converged and is thus terminated when either (i) a suffi(k−1) (k) (k) cient decrease in the functional is observed,√P α − P α < τ (1 + P α ), or (ii) the change in the density satisfies km(k−1 − m(k) k < τ (1 + km(k) k). If neither of these conditions is satisfied by an upper limit on the number of iterations, the procedure is terminated without convergence as measured in this manner. The parameter τ is taken as τ = .01 for the inversions considered here. The remaining issue is the determination of the regularization parameter at each step of the iteration. As noted, when a priori information in the form of the standard deviations on the noise in the data is available, the MDP can be used to find α. Here, in the absence of the exact information on the error in the data we investigate the use of the L-curve and GCV methods to find α(k) for which the formulation using the GSVD is advantageous. 2.3. Regularization Parameter Estimation 2.3.1. The L-curve The L-curve approach developed by Hansen (1992, 1998) for linear inverse problems is a robust criterion for determining the regularization parameter. It is based on the tradeoff between the norm of the regularized solution and the norm of the corresponding fidelity term residual as the regularization parameter varies. According to Hansen (1992, 1998) when these two norms are plotted on a log-log scale, the curve has an L shape with an obvious corner. This corner separates the flat and vertical parts of the curve where the solution is dominated by regularization errors and perturbation errors, respectively. Picking αopt as the α responsible for the corner point gives the optimal trade off between the two terms, and the corresponding model is selected as the optimal solution. For α > αopt the regularized solution does not change dramatically, while the residual does. In contrast, for α < αopt the regularized solution increases rapidly with little decrease in the residual. Because of the relation of αopt with the shape of the curve, Hansen (1998) recommends estimating αopt by finding the maximum of the local curvature in the neighborhood of the dominant corner of the plot. Although the L-curve technique can be robust for problems generating welldefined corners, it may not work so well in other cases. For an underdetermined problem the 7 recovered model can change more slowly with the degree of regularization, Li and Oldenburg (1999), and the L-curve is thus smoother. This makes it difficult to find maximum point of curvature of the curve. On the other hand, given the solution of the regularized problem in terms of the GSVD, as in (15), finding the L-curve is relatively efficient and is thus one of the conventional ways to estimate αopt . It was shown by Farquharson and Oldenburg (2004) that the L-curve choice for λ at early iterations may be too small which may lead to inclusion of excessive structure in the model that needs to be eventually removed, hence requiring more iterations for the inversion. Hence here we follow the approach suggested by Farquharson and Oldenburg (2004)  and (k) (k) (k−1) ∗ impose a so-called cooling process in which α is given by α = max c α , α where ∗ 0.01 ≤ c ≤ 0.5 and α is the point of maximum curvature of the L-curve. Moreover, choosing a relatively large value for α(1) improves the performance of the algorithm. We use α(1) = max(γi )/mean(γi ) and c = 0.4 which work well for the presented inversion examples. 2.3.2. Generalized Cross Validation The major motivation of using the GCV to find an optimal value for α is that a good value should predict missing data values. Specifically, if an arbitrary measurement is removed from the data set, then the corresponding regularized solution should be able to predict the missing observation. The choice of α should be independent of an orthogonal transformation of the data, Hansen (1998). The GCV functional is given by P k ni=q+1 (1 − fi )uTi−q r̃k2 kG̃m(α) − r̃k2 kG̃m(k) − d̃obs k2 P P = , (17) GCV (α) = = (m − ni=q+1 fi )2 (m − ni=q+1 fi )2 trace(Im − G̃G(α))2 where the final expressions follow immediately from the GSVD, with G(α) = (G̃T G̃ + α2 D T D)−1 G̃T . Here the numerator is the squared residual norm and the denominator is effectively the square of the number of degrees of freedom, Hansen (1998). It can be shown that the value of α which minimizes the expected value of the GCV function is near the minimizer of the expected value of the predictive mean-square error, kGm(α) − dexact k2 , Hansen (1998). Hence, finding the minimum for GCV (α) should lead to a reasonable estimate for α. We have seen in our experiments that when the GCV does not fail, in which case it produces a very small α, it usually leads to α which is slightly larger than the optimal value. Failure occurs when GCV (α) is almost flat near the optimal alpha, leading to numerical difficulties in computing its minimum. The cooling procedure, as described for the L-curve, is also applied to the GCV estimation of α(k) but with α∗ now chosen as the current minimum of the GCV function. For clarity we summarize the steps of the inversion that are applied every iteration in Algorithm 1. Here we state this for the L-curve method. The GCV solutions are found equivalently but at all steps using the L-curve instead the GCV method is applied. Algorithm 1. The steps taken for the inversion at every iteration assuming the use of the L-curve to find the regularization parameter 1. Calculate the GSVD for matrix pair [G̃, D]. 8 2. Calculate the solutions, and the associated L-curve function, for a range of α , the optimal α is found using the L-curve. 3. The cooling process is implemented for deciding whether the obtained α from step 2 should be used or not. 4. With α from step 3, the model parameters are computed using equation (16). 5. Density limits are implemented on model parameters, from step 4 , and then We and Whard are updated. 6. Data misfit, S(m) and P α (m) are computed for model parameters obtained from step 5. 7. If the termination criteria are satisfied the iteration terminates. Otherwise, the a priori density model is set equal to the density model from step 5 and the iteration returns to step 1. 3. Numerical Results: Simulated Model We evaluated the use of the L-curve and GCV in focusing inversion, as described in Sections 2.3.1 and 2.3.2, for several synthetic data examples. In these simulations data are calculated at 50 stations with 10m spacing on the surface and the inversion is required at the subsurface on a rectangular grid of 50 × 10 with cell size 10m, hence in this case m = 50 and n = 500. The iterations are initialized with m(0) = 0, Whard = We = I and bound constraints on the density are set such that 0gr/cm3 ≤ mj ≤ 1gr/cm3 . The focusing parameter is fixed as ǫ = 0.02 for the inversions. It should be noted that the regularization parameter depends on the choice for ǫ, a large value requires a larger value for α and generates a smoother model. In these simulations the maximum number of iterations is set to 20. The synthetic gravity data are generated in each case for the rectangular body that has density contrast equal to 1gr/cm3 with an homogeneous background, Figure 2(a). In generating noise-contaminated data we use zero mean Gaussian noise with a standard deviation σ̃i = (η1 (dexact )i + η2 kdexact k), as indicated in Figure 2(b) for η1 = .03 and η2 = .001. In each case we calculated the χ2 measure of the actual noise in the noisy data and report the data fidelity values, relative error k(mexact − m(K) )k2 /kmexact k2 , and final values α(K) for each inversion in Table 1. The density models obtained for the first data set, Figure 2(b) are presented in Figures 5(a) and 5(b) for the L-curve and GCV inversions, respectively. In each case the geometry and density of the reconstructed models are close to those of the original model, although the inversion using the L-curve criterion is more focused. This feature was present in all the examples we have analyzed; inversion using GCV always provides a smoother reconstruction than that obtained using the L-curve. Figures 4(a)-4(b) demonstrate the progression of the solutions with iteration k for the data fidelity φ(d(k) ), the stabilizer S(m(k) ), the parametric (k) functional P α (m(k) ), and regularization parameter, α(k) , again for the L-curve and GCV respectively for this first example. In our experience the behavior indicated is consistent when using the GCV to find the regularization parameter α; it generally decreases initially, but then increases to converge to a fixed value by the maximum number of iterations. On 9 (a) Simulated Model (b) Gravity anomaly contaminated by uncorrelated noise Figure 2: In 2(a) the synthetic model of a body set in a grid of square cells each of size 10m, the density contrast of the body is 1gr/cm3 . In 2(b) the gravity anomaly due to the synthetic model contaminated by uncorrelated noise with η1 = 0.03 and η2 = .001. The exact anomaly indicated by the solid line and the contaminated data by the symbols. (a) L-curve (b) GCV Figure 3: Density model obtained from inverting the data of Figure 2(a) with MS stabilizer and noise level with η1 = 0.03 and η2 = .001 using bounds on density 0gr/cm3 ≤ mj ≤ 1gr/cm3 . The regularization parameter was found using in (a) the L-curve and in (b) the GCV. the other hand, for the L-curve the progression of α(k) is more erratic, generally oscillating in final iterations toward a converged value as shown in Figure 4(a). Manual intervention may then be needed to force the overall convergence of the algorithm Ajo et al (2007). The main problem for the L-curve, as mentioned in section section 2.3.1, is its smooth shape, that makes it difficult to find the corner, namely the point of maximum curvature. To illustrate we plot the L-curve for all iterations in Figure 5(a), showing that overall the approach is successful, although at a given middle iteration the apparent corner is missed, Figure 5(c). Still the starting and final iterations in Figure 5(b) and Figure 5(d) do find useful corners. The same formulation was used to generate two further synthetic data sets, with quantitative results shown also in Table 1. Noise generated using η1 = 0.01 and η = 0.05 was considered, with in both cases η2 = .001. The results of the inversions are illustrated in Figures 6 and 7, respectively. We note from Table 1 that the fidelity values at convergence (K) (K) are less than the initial χ2 measure of the noise, that always αL−curve < αGCV , but that there is no fixed conclusion about the relation between the final relative errors and fidelity estimates by the L-curve and GCV inversions. We conclude that both the GCV and the 10 (a) L-curve (b) GCV Figure 4: The data fidelity φ(d), the stabilizer S(m), the parametric functional P α (m), and the regularization parameter, α ,all plotted against iteration k. The regularization parameter was found using in (a) the L-curve and in (b) the GCV. L-curve are successful in providing reasonable solutions. It should be noted that increasing the focusing parameter ǫ can yield solutions which are not focused, especially as shown in Figure 7. Table 1: Relative error and final values of the regularization parameter for the inverted models. Figure 3 6 7 8 9a-b 9c-d χ2 measure 51.23 47.26 40.03 51.23 51.23 51.23 α(K) Relative L-curve GCV L-curve 0.62 7.41 0.4270 0.87 14.15 0.3376 0.50 6.85 0.4014 0.63 8.20 0.7708 27.04 429.38 0.4264 27.23 441.86 0.4404 Error Fidelity GCV L-curve 0.4025 19.14 0.3506 26.27 0.4013 21.63 0.6910 17.21 0.4026 19.64 0.4069 17.95 φ(d) GCV 21.93 24.96 13.61 20.80 16.77 16.10 To assess both the impact of the choice of the bounds on the convergence properties for the solution and choice of the regularization parameter α, we investigated two additional situations. First we implemented the same problem as given in figure 2, with noise η1 = 0.03 and η2 = 0.001, but inverted now with upper bounds on the density changed to 2gr/cm3 . The results are illustrated in figure 8 and detailed as before in Table 1. We see that the solutions are more focused, as anticipated from the previous work of Portniaguine and Zhdanov (1999) but the relative error overall is increased and the fidelity of the solution is also decreased. On the other hand, it is of greater interest for the purposes of this study to observe that the performance of the parameter choice techniques is independent of the upper bound, 11 (a) (b) (c) (d) Figure 5: The L-curve for all iterations with in each case the circle showing point with maximum curvature. In figures 5(b)-5(d) we show the individual curves at iterations 1, 10 and the final stage. and the parameters are found stably independent of the constraint bounds. To determine the necessity of using the MS instead of a smoothness stabilizer, we also considered the results obtained using smoothness stabilizer, i.e. the We in (9) replaced with the approximation for the second derivative of the model parameters, for the situations in figures 3 and 8. These results are also detailed in Table 1 and illustrated in figures 9(a)-9(b) and 9(c)-9(d), respectively. They demonstrate the relative insensitivity to density limits of the smoothness-stabilizer obtained solutions. On the other hand, the solutions lack the contrast that is achieved using the MS regularization. Overall, the solutions obtained with GCV are apparently more robust than those with the L-curve. It should be noted that using a non-ℓ2 measure of the derivative in geophysical inversion leads to a strongly piecewice constant, or blocky, reconstruction with sharp jumps, see e.g. Farquharson and Oldenburg (1998). 4. Numerical Results: Practical Data 4.1. Geological Context The data used for inversion was acquired over the Safo mining camp in Maku-Iran which is well known for manganese ores. Geologically this area is located in the Khoy ophiolite 12 (a) L-curve (b) GCV Figure 6: Density model obtained from inverting the data of Figure 2(b) with MS stabilizer: and noise level with η1 = 0.01 and η2 = .001. The regularization parameter was found using in (a) the L-curve and in (b) the GCV. (a) L-curve (b) GCV Figure 7: Density model obtained from inverting the data of Figure 2(b) with MS stabilizer and noise level with η = 0.05 and η2 = .001. The regularization parameter was found using in (a) the L-curve and in (b) the GCV. zone, in the northwest of Iran. Some manganese and iron-manganese deposits are found within sedimentary pelagic rocks and radiolarian cherts which are accompanied by Khoy ophiolite, Imamalipour (2005). Most of these deposits have little reserve; the Safo deposit is the only viable area distinguished so far for mining. In the Safo deposit, depositions of manganese have been found to occur in different horizons within pelagic rocks. Mineralogically, pyrolusite, bixibite, braunite and hematite are the main minerals present in ore, of which the pyrolusite is the dominant ore Imamalipour (2005), and Calcite with quartz and barite present as minor phases. The banded, massive and disseminated textures are seen in orebodies. Manganese content varies from 7.4% to 69.1% in different regions of the area Imamalipour (2005). 4.2. Gravity anomaly The area of the gravity survey extends between UTM coordinates [438276 438609] west and [4342971 4343187] north, Z38. The gravity survey was performed by the gravity branch of the institute of Geophysics, University of Tehran. The measurements were corrected for effects caused by instruments and tidal drift, latitude, free air and the Bouguer correction to yield the Bouguer gravity anomaly, Figure 10(a). The Bouguer anomaly displays extreme magnitudes in the central of the area in the north-south direction, related to mineral oc13 (a) L-curve (b) GCV Figure 8: Density model obtained from inverting the first data set η1 = 0.03 and η2 = .001 with MS stabilizer and density limits 0gr/cm3 ≤ mj ≤ 2gr/cm3 . The regularization parameter was found using in 8(a) the L-curve; and in 8(b) the GCV. currence which has high density contrast with the host rocks. This geologic structure is therefore clearly suitable for using a 2-D algorithm. The residual anomaly was obtained by subtracting the regional anomaly from the Bouguer anomaly using a polynomial fitting method, Figure 10(b). One of the recommended steps in potential field inversion is upward continuation of data to a height of half the thickness of the shallowest cell which removes near surface effects without noticeably degrading the data. Figure 11 shows upward continuation of the residual data up to 2.5m. 4.3. Inversion result A profile of the anomaly (SA) consisting of 49 data measurements, sampled every 5m, is chosen for inversion. The subsurface is divided into 49 × 15 square cells of size 5m, hence in this case m = 49 and n = 735. Based on geological information Imamalipour (2005), the background density is set to 2.8gr/cm3 and the density limits for the inversion are 2.4gr/cm3 ≤ mj ≤ 4.7gr/cm3 . The maximum number of iterations was set to 20. Each datum is assigned a Gaussian error as in the simulated cases, here with η1 = .05 and η2 = .001. Figures 12a-b illustrate the reconstructed density model from the inversion of profile SA using the L-curve and GCV methods for estimating the regularization parameter, (K) (K) yielding αL−curve = 0.65 and αGCV = 4.87 respectively. Figures 13(a)-13(b) illustrate the profile of the anomaly (SA) which is used for the inversion, indicated by the stars, and the resulting values obtained from reconstructed models in figures 12(a)-12(b), denoted in each case by the circles. Both solutions clearly represent the density contrast and geometry for the occurrence of manganese ore, figures 12(a)-12(b). The horizontal extension of the obtained model is about 30m and the vertical extension shows a depth interval approximately between 5m and 35m. These results are close to those obtained by Borehole drilling on the site; which show extension of manganese ores from 3−4m to 25−30m in the subsurface along the north-south direction Noorizadeh (2010). The data fidelity, the stabilizer, the parametric functional and regularization parameter, with iteration k , are shown in Figures 14(a)-14(b). The convergence histories have properties for the practical data that are similar to those for the simulated data sets. 14 (a) L-curve (b) GCV (c) L-curve (d) GCV Figure 9: Density model obtained from inverting the first data set η1 = 0.03 and η2 = .001 with smoothness stabilizer. In 9(a) and 9(b) density limits are 0gr/cm3 ≤ mj ≤ 1gr/cm3 . In 9(c) and 9(d) density limits are 0gr/cm3 ≤ mj ≤ 2gr/cm3 . The regularization parameter was found using in 9(a) and 9(c) the L-curve; and in 9(b) and 9(d) the GCV. 5. Conclusions Tikhonov regularization with the minimum support stabilizer has been demonstrated to yield non-smooth solutions and is thus an appropriate approach for recovery of geological structures with sharp boundaries. The presented algorithm is flexible and allows variable weighting in the stabilizer, including depth weighting, a priori density ranges for the domain and the inclusion of hard constraints for the a priori information in the inversion process. The L-curve criterion and GCV method for estimating the regularization parameter were discussed, and characteristics of each of them for obtaining a solution were introduced. Numerical tests using synthetic data have demonstrated feasibility of applying both methods in the iteratively reweighted algorithm. The regularization parameter is seen to converge as the number of iterations increases. Although GCV leads to inverse solutions which are slightly smoother than those obtained by the L-curve, both recovered models are close to the original model. For this small-scale problem, it is shown that the GSVD can be used in the algorithm, demonstrating the filtering of the solution. Moreover, this use of the GSVD, which might generally be assumed to be too expensive, is beneficial and worthwhile in the context of regularization parameter estimation as shown here. For large-scale problems it is anticipated that a randomized GSVD needs to be developed, along the lines of the randomized SVD that was introduced in Liberty et al (2007). Finally the method was used on a profile of gravity data acquired over the Safo manganese mine in the northwest of Iran. The result shows a density distribution in subsurface from about 5m to 35m in depth and about 30m horizontally. Future work will consider the inclusion of statistical weighting in 15 (a) L-curve (b) GCV Figure 10: Bouguer anomaly over the Safo manganese mine in 10(a) and the residual anomaly over the Safo manganese mine in 10(b). Figure 11: Upward continuation of the residual anomaly to height 2.5m. the solution and the use of regularization parameter estimation using statistical approaches, Mead and Renaut (2009). 6. Acknowledgements Rosemary Renaut acknowledges the support of AFOSR grant 025717: “Development and Analysis of Non-Classical Numerical Approximation Methods”, and NSF grant DMS 1216559: “Novel Numerical Approximation Techniques for Non-Standard Sampling Regimes”. We would also like to thank the two anonymous referees who raised interesting questions that lead us to include additional results and clarifications of the method. 16 (a) L-curve (b) GCV Figure 12: The density models obtained by inverting field gravity data (profile SA). The regularization parameter was found using in (a) the L-curve and in (b) the GCV. (a) L-curve (b) GCV Figure 13: The field gravity data (stars) and computed data for the reconstructed density model (circles). The regularization parameter was found using in 13(a) the L-curve; in 13(b) the GCV. References References Ajo-Franklin J B Minsley B J and Daley T M 2007 Applying compactness constraints to differential traveltime tomography Geophysics 72 R67-R75 Blakely R J 1996 Potential Theory in Gravity & Magnetic Applications Cambridge University Press Cambridge United Kingdom Boulanger O and Chouteau M 2001 Constraints in 3D gravity inversion Geophysical Prospecting 49 2 265-280 Farquharson C G and Oldenburg D W 1998 Non-linear inversion using general measure of data misfit and model structure Geophysical Journal International 134 213-227 Farquharson C G and Oldenburg D W 2004 A comparison of automatic techniques for estimating the regularization parameter in non-linear inverse problems Geophysical Journal International 156 411-425 17 (a) L-curve (b) GCV Figure 14: The data fidelity φ(d), the stabilizer S(m), the parametric functional P α (m), and the regularization parameter, α ,all plotted against iteration k. The regularization parameter was found using in (a) the L-curve and in (b) the GCV. Hansen P C 1992 Analysis of discrete ill-posed problems by means of the L-curve SIAM Review 34 561-580 Hansen P C 1998 Rank-Deficient and Discrete Ill-Posed Problems: Numerical Aspects of Linear Inversion SIAM Monographs on Mathematical Modeling and Computation 4 Philadelphia Imamalipour A 2005 Geochemistry mineralogy and origin of Safo manganese deposit Ninth meeting of Geological Society of Iran (in Persian) Last B. J. and Kubik K 1983 Compact gravity inversion Geophysics 48 713-721 Li Y and Oldenburg D W 1996 3D inversion of magnetic data Geophysics 61 394-408 Li Y and Oldenburg D W 1998 3D inversion of gravity data Geophysics 63 109-119 Li Y and Oldenburg D W 1999 3D Inversion of DC resistivity data using an L-curve criterion 69th Ann. Internat. Mtg. Soc. Expl. Geophys. Expanded Abstracts 251-254 Liberty E Woolfe F Martinsson PG Rokhlin V and Tygert M 2007 Randomized algorithms for the low-rank approximation of matrices Proceedings of the National Academy of Sciences 104 20167-20172 Mead J L and Renaut R A 2009 A Newton root-finding algorithm for estimating the regularization parameter for solving ill-conditioned least squares problems Inverse Problems 25 025002 doi: 10.1088/0266-5611/25/2/025002 Noorizadeh A 2010 Geological report, Bore-hole results of Safo manganese mine Spadana Mining Company 18 Paige C C and Saunders M A 1981 Towards a generalized singular value decomposition SIAM Journal on Numerical Analysis 18 3 398-405 Pilkington M 1997 3-D magnetic imaging using conjugate gradients Geophysics 62 1132-1142 Portniaguine O and Zhdanov M S 1999 Focusing geophysical inversion images Geophysics 64 874-887 Vatankhah S Ardestani E V and Ashtar J M 2013 A method for 2D inversion of gravity data Journal of Earth and Space Physics (accepted) Vogel C R 2002 Computational Methods for Inverse Problems SIAM Frontiers in Applied Mathematics SIAM Philadelphia U.S.A. Zhdanov M S 2002 Geophysical Inverse Theory and Regularization Problems Elsevier Amsterdam Zhdanov M S and Tolstaya E 2004 Minimum support nonlinear parameterization in the solution of 3−D magnetotelluric inverse problem Inverse Problems 30 937-952 19
5cs.CE
MATROIDS: A MACAULAY2 PACKAGE arXiv:1511.04618v1 [math.CO] 14 Nov 2015 JUSTIN CHEN Abstract. We give an overview of the Macaulay2 package Matroids, which contains functionality to create and compute with matroids. Examples highlighting the use of all major functions in the package are provided, along with explanations of some of the algorithms. Interesting connections of matroids to various branches and areas are also given. Introduction. A matroid is a combinatorial object which abstracts the notions of (linear algebraic, graphtheoretic) independence. Since their introduction by Whitney [8], matroids have found diverse applications in combinatorics, graph theory, optimization, and algebraic geometry, in addition to being studied as interesting objects in their own right. One striking feature of matroids is the multitude of distinct ways to define them. This variety of equivalent (or cryptomorphic) ways to characterize matroids is one of the greatest strengths of matroid theory, and one of the reasons for its ubiquity. The first and foremost definition is via bases: Definition. Let E be a finite set, and B ⊆ 2E a set of subsets of E. The pair (E, B) is a matroid if B satisfies the following conditions: (B1) B 6= ∅, and (B2) (Basis exchange) For any B1 , B2 ∈ B and b1 ∈ B1 \ B2 , there exists b2 ∈ B2 \ B1 with B1 \ {b1 } ∪ {b2 } ∈ B. E is called the ground set of the matroid M = (E, B), B is the set of bases, and an element of B is a basis. Any subset of a basis is an independent set. A subset of E that is not independent is dependent. The minimal (with respect to inclusion) dependent sets are circuits. It is easy to see that the sets of bases, independent sets, and circuits all give the same amount of information; and any one of these determines the other two: the independent and dependent sets partition 2E , and the bases are precisely the independent sets which are maximal with respect to inclusion. Important notes: For the reader already familiar with matroids: this package provides capabilities for converting between various representations of matroids, forming linear and graphic matroids from a matrix or graph, creating and detecting existence of minors, computing Tutte polynomials, and some additional functions for matroid applications in other areas. Each of these will in turn be illustrated with examples in this article. Virtually all notation and results mentioned below are from Oxley [5]. In this package, a matroid is, by default, internally represented by its list of bases. Moreover, the ground set is always internally treated as a list {0, . . . , n − 1}. Although the actual elements of the ground set can be arbitrary (e.g. integers, column vectors, edges in a graph), all computations involving elements of the ground set are done by referring to an element by its index in the ground set, which is an integer in {0, . . . , |E| − 1} (in Macaulay2, enumeration starts at 0). For convenience, methods are provided to easily convert between an actual subset of the ground set and its list of indices. Basic properties. For the latest version of the package, see 1. We start with a minimal running example: i1 : loadPackage "Matroids" o1 = Matroids o1 : Package 2010 Mathematics Subject Classification. 05-04, 05B35, 52B40, 05C31. 1https://github.com/jchen419/Matroids-M2 1 2 JUSTIN CHEN i2 : M = matroid({a,b,c,d},{{0,1},{0,2}}) o2 = M o2 : Matroid This creates a matroid on the ground set {a, b, c, d} with 2 bases, whose indices (as subsets of the ground set) are {0, 1} and {0, 2}. We can view the list of bases: i3 : bases M o3 = {set {0, 1}, set {0, 2}} o3 : List Notice that the bases are returned as sets of indices. To view the actual subsets of the ground set corresponding to the indices, use the method groundSet (notice that groundSet converts sets to lists): i4 : apply(bases M, B -> groundSet_M B) o4 = {{a, b}, {a, c}} o4 : List To convert a subset of the ground set to its list of indices, use the method indicesOf, which is an inverse to groundSet: i5 : apply(oo, B -> indicesOf_M B) o5 = {{0, 1}, {0, 2}} o5 : List So far, no attempt has been made to check that M is actually a matroid, i.e. the set of bases satisfies the basis exchange property. We verify this now, and also give a non-example: i6 : isValid M o6 = true i7 : isValid matroid({a,b,c,d},{{0,1},{2,3}}) o7 = false We can obtain plenty of matroid-theoretic information for this example: i8 : rk M -- the rank of M = size of any basis of M o8 = 2 i9 : rk_M {0,3} -- {0,3} corresponds to the subset {a,d} o9 = 1 i10 : circuits M o10 = {set {1, 2}, set {3}} o10 : List i11 : isDependent_M {1} o11 = false i12 : independents(M, 2) -- independent sets of M of size 2 o12 = {set {0, 1}, set {0, 2}} o12 : List We also recall the following definitions: Definition. A loop in M is a 1-element dependent set, and a coloop in M is an element contained in every basis. The closure of a subset A ⊆ E is A := {x ∈ E | rk(A) = rk(A ∪ {x})}. A flat of M is a closed subset, i.e. A = A. A hyperplane of M is a flat of rank equal to rk M − 1. i13 o13 o13 i14 o14 o14 i15 o15 o15 i16 : = : : = : : = : : loops M {3} List coloops M {0} List closure_M {2,3} {1, 2, 3} List hyperplanes M MATROIDS: A MACAULAY2 PACKAGE 3 o16 = {set {0, 3}, set {1, 2, 3}} o16 : List i17 : flats M o17 = {{set {3}}, {set {0, 3}, set {1, 2, 3}}, {set {0, 1, 2, 3}}} o17 : List i18 : fvector M o18 = {1, 2, 1} o18 : List (here the f-vector records the number of flats of rank i, for i = 0, . . . , rk M - notice that f0 = frk M = 1 always, as the set of loops is the unique flat of rank 0 and E is the unique flat of maximal rank). We remark that the set of flats is closed under intersections, and thus (being finite, with a maximal element) is a lattice, with meet = intersection, and join given by X ∨ Y := X ∪ Y . Analogous to the basis exchange property, there are abstract axioms that characterize which sets of subsets of E can be the set of circuits, flats, or hyperplanes of a matroid on E. Similarly, there are axioms characterizing which functions 2E → Z≥0 and 2E → 2E are the rank functions and closure operators of a matroid on E, respectively. Lattices of flats of matroids can also be characterized among all finite lattices. Any one of the following – bases, circuits, rank function, closure operator, lattice of flats, hyperplanes – determines all others. Constructing types of matroids. The simplest family of matroids are the uniform matroids, i.e. where the set of bases equals all subsets of a fixed size: i19 : U = uniformMatroid(2,4); bases U o20 = {set {0, 1}, set {0, 2}, set {1, 2}, set {0, 3}, set {1, 3}, set {2, 3}} o20 : List Another family of fundamental importance is the class of linear matroids, which arise naturally from a matrix. The columns of the matrix form the ground set, and a set of column vectors is declared independent if they are linearly independent in the vector space of columns. i21 : A = matrix{{0,4,-1,6},{0,2/3,7,1}}; MA = matroid A; groundSet MA 2 4 o21 : Matrix QQ <--- QQ o23 = {0, | 4 |, | -1 |, | 6 |} | 2/3 | | 7 | | 1 | o23 : List An abstract matroid M is called representable or realizable over a field k if M is isomorphic to a linear matroid over k, where an isomorphism of matroids is a bijection between ground sets that induces a bijection on bases. We verify that the matroid M we started with is isomorphic to M A, hence is representable over Q: i24 : isomorphic(MA, M) Isomorphism: {3, 1, 0, 2} o24 = true Note that the bijection giving the isomorphism is printed: here {3, 1, 0, 2} represents the permutation σ of {0, 1, 2, 3} with σ(0) = 3, σ(1) = 1, σ(2) = 0, σ(3) = 2. This indicates that the map f : M A → M sending the ith element of M A to the σ(i)th element of M is an isomorphism. An important class of representable matroids (over any field) are the graphic matroids, derived from a graph. If G is a graph, then the graphic matroid M (G) has ground set equal to the edge set of G, and circuits given by cycles in G (a cycle in G is a connected subgraph where every vertex has degree 2). This package uses the Graphs package to provide functionality for creating and obtaining information about graphs. Conversely, the graphic matroid also captures a great deal of information about the graph, much of which has (at the time of this writing) not yet been exposed by the Graphs package. The first example of this is the set of cycles. As the graphic matroid is defined in terms of the cycles of the graph, it was important for this package to have an efficient method of listing all cycles. To this end, two methods are provided in this package: a local helper function which returns all closed walks of a given length centered at a given vertex, and a global wrapper function which identifies oppositely oriented closed walks into a single cycle 4 JUSTIN CHEN (each cycle through a vertex v gives rise to exactly 2 closed walks at v, by reversing orientation). The global wrapper function also includes significant optimizations to speed up computation time, such as eliminating cases with few cycles before starting a search, and recursively deleting all previously visited vertices. In the end though, finding all cycles is an NP-complete problem (e.g. existence of a Hamiltonian cycle can be simply read off from the list of cycles), so efficiency is – even theoretically – still limited. In real use cases, the algorithm performs quite well for relatively small graphs; the sparser the better. i25 : time #getCycles generalizedPetersenGraph(5,2) -- used 0.0597035 seconds o25 = 57 i26 : time #getCycles completeGraph 8 -- used 1.64614 seconds o26 = 8018 i27 : K5 = completeGraph 5 o27 = Graph{0 => {1, 2, 3, 4}} 1 => {0, 2, 3, 4} 2 => {0, 1, 3, 4} 3 => {0, 1, 2, 4} 4 => {0, 1, 2, 3} o27 : Graph i28 : M5 = matroid K5; groundSet M5 o29 = {set {0, 1}, set {0, 2}, set {0, 3}, set {0, 4}, set {1, 2}, set {1, 3}, set {1, · · · o29 : List i30 : #bases M5 o30 = 125 The above computation verifies Cayley’s theorem, which states that the number of spanning trees on n vertices is nn−2 (note that the bases of the graphic matroid are precisely the spanning trees, when the underlying graph is connected). As one may suspect from the discussion on cycles, the graphic matroid is created from the list of cycles, i.e. by specifying circuits. This can be done for an abstract matroid as well, using the optional argument EntryMethod => "circuits" in the constructor function. Regardless of the value of EntryMethod, the bases are automatically computed upon creation. We recreate the matroid M from before, by specifying its circuits. Note that two matroids are considered equal iff they have the same set of bases and same size ground sets, or equivalently, the identity permutation is an isomorphism between them. i31 : M1 = matroid({a,b,c,d},{{1,2},{3}}, EntryMethod => "circuits", TargetRank => 2) o31 = M1 o31 : Matroid i32 : M == M1 o32 = true Often specific matroids of importance are close to uniform, in the sense that relatively few subsets of size rk M are dependent, so the set of nonbases (i.e. dependent sets of size rk M ) can also be specified, using EntryMethod => "nonbases". i33 : fanoNB = {{0,1,2},{0,4,5},{0,3,6},{1,3,5},{1,4,6},{2,3,4},{2,5,6}}; i34 : F7 = matroid(toList (1..7), fanoNB, EntryMethod => "nonbases"); #bases F7 o35 = 28 We can also construct a new matroid from smaller ones by taking direct sums: if M1 = (E1 , B1 ) and M2 = (E2 , B2 ) are matroids, then their direct sum is M1 ⊕ M2 := (E1 ⊔ E2 , {B1 ⊔ B2 | B1 ∈ B1 , B2 ∈ B2 }). i36 : S = directsum(U, matroid completeGraph 3); groundSet S o37 = {(0, 0), (1, 0), (2, 0), (3, 0), (set {0, 1}, 1), (set {0, 2}, 1), (set {1, 2}, 1)} o37 : List i38 : bases S o38 = {set {0, 1, 4, 6}, set {0, 1, 4, 5}, set {0, 1, 5, 6}, set {0, 2, 4, 6}, set {0, · · · MATROIDS: A MACAULAY2 PACKAGE 5 o38 : List Notice that although elements of the ground set of the direct sum receive a placeholder index to ensure disjointness (and thus become increasingly more complex with repeated direct sums), the bases only change by shifting the indices of the second argument up. This is one instance where the representation of bases as indices is more useful than as elements. A matroid that cannot be written as a direct sum of nonempty matroids is called connected or irreducible. Every matroid is a direct sum of connected matroids, its connected components. To find the connected components, use the method componentsOf: i39 : C = componentsOf S o39 = {Matroid, Matroid} o39 : List i40 : S == directsum(C#0, C#1) o40 = true Duality and minors. One of the most important features of matroid theory is the existence of a duality. It is straightforward to check that if M = (E, B) is a matroid, then {E − B | B ∈ B} also satisfies (B1) and (B2), and thus is the set of bases of a matroid on E, called the dual matroid of M , denoted by M ∗ . i41 : D = dualMatroid M; bases D o42 = {set {2, 3}, set {1, 3}} o42 : List i43 : M == dualMatroid D o43 = true i44 : loops D o44 = {0} o44 : List i45 : circuits D o45 = {set {1, 2}, set {0}} o45 : List Notice that loops of D are coloops of M , and circuits of D are complements of hyperplanes of M (this is in fact how the method hyperplanes works). Indeed, virtually any matroid-theoretic property or operation can be enriched by considering its dual version, which is often distinct, and/or interesting as well. One such operation is deletion, which dualizes to contraction, which we discuss now: Definition. Let M = (E, B) be a matroid, and S ⊆ E. The restriction of M to S, denoted M |S , is the matroid on S with bases {B ∩ S | B ∈ B, |B ∩ S| = rk S}. The deletion of S, denoted M \ S, is the restriction of M to E − S. The contraction of M by S, denoted M/S, is defined as (M ∗ \ S)∗ . i46 : N1 = deletion_M {3}; (groundSet N1, bases N1) o47 = ({a, b, c}, {set {0, 1}, set {0, 2}}) o47 : Sequence i48 : N2 = contraction_M {1}; (groundSet N2, bases N2) o49 = ({a, c, d}, {set {0}}) o49 : Sequence A minor of M is any matroid which can be obtained from M by a sequence of deletions and contractions. It is a fact that any minor of M is of the form (M/X) \ Y for X, Y disjoint subsets of E (in fact, even more can be said about the structure of minors, as we shall see shortly). i50 : minorM5 = minor(M5, {9}, {3,5,8}) -- contracts {9}, then deletes {3,5,8} o50 = minorM5 o50 : Matroid i51 : (groundSet minorM5, #bases minorM5) o51 = ({set {0, 1}, set {0, 2}, set {0, 3}, set {1, 2}, set {1, 4}, set {2, 3}}, 16) o51 : Sequence 6 JUSTIN CHEN Minor-theoretic properties can be used to describe many important classes of matroids. For example, a class C of matroids is said to be minor-closed if every minor of a matroid in C is again in C. The classes of uniform, krepresentable (for arbitrary k), and graphic matroids are all minor-closed. Furthermore, certain classes of matroids can be characterized by their forbidden or excluded minors, namely the matroids not in the class, but with every proper minor in the class. Theorem 1. (Tutte) [6, 7] Let M be a matroid. i) M is binary (i.e. representable over F2 ) iff M has no U2,4 minor (i.e. no minor of M is isomorphic to U2,4 ). ii) M is regular (i.e. representable over any field) iff M has no U2,4 , F7 , or F7∗ minor. iii) M is graphic iff M has no U2,4 , F7 , F7∗ , M (K5 )∗ , or M (K3,3 )∗ minor. Here U2,4 is the uniform matroid of rank 2 on 4 elements, and F7 is the Fano matroid. We illustrate this by verifying that M (K5 ) is regular (alternatively, one can simply write down a 0-1 matrix representing M (K5 )): i52 : hasMinor(M5, U) o52 = false i53 : hasMinor(M5, F7) o53 = false i54 : hasMinor(M5, dualMatroid F7) o54 = false A word about the algorithm behind the method hasMinor is in order. First, the problem of testing for minors (even a fixed minor among a specific class of matroids) is NP-complete. Despite this, there are significantly fewer checks necessary to determine existence of a minor than may initially seem. Indeed, every minor of M is in fact of the form (M/I) \ I ∗ , where I, I ∗ are disjoint, I is independent, and I ∗ is coindependent (i.e. is independent in M ∗ ). Such a minor has rank equal to that of M/I, which in turn equals rk M − |I|. Thus checking existence of a minor N in M can be realized as a two-step process, where the first step contracts independent sets of M of a fixed size down to the rank of N , and the second step deletes coindependent sets down to the size of N . In the case of a successful minor test, the sets I and I ∗ are printed (as well as the isomorphism from (M/I) \ I ∗ to N as usual). Note that the indices of I, I ∗ are given with respect to the ground set of M (as opposed to giving the indices of I ∗ with respect to the ground set of M/I), to agree with the syntax of the method minor. i55 : M4 = matroid completeGraph 4 o55 = M4 o55 : Matroid i56 : hasMinor(M5, M4) Isomorphism: matroids are equal Contract set {9}, delete set {3, 5, 8} o56 = true i57 : minorM5 == M4 o57 = true Finally, the single most useful piece of information about a matroid that can be obtained from deletions and contractions is the Tutte polynomial TM (x, y). It is a bivariate polynomial with integer coefficients which satisfies the deletion-contraction recurrence TM (x, y) = TM\e (x, y) + TM/e (x, y), e ∈ E not a loop or coloop with the initial condition TM (x, y) = xa y b if M consists of a coloops and b loops. i58 : tuttePolynomial M5 6 5 4 3 4 3 2 2 3 2 2 o58 = y + 4y + x + 5x*y + 10y + 6x + 10x y + 15x*y + 15y + 11x + 20x*y + 15y · · · o58 : ZZ[x, y] The Tutte polynomial is the universal invariant satisfying deletion-contraction, in the sense that any numerical invariant of matroids which satisfies a (weighted) deletion-contraction recurrence is an evaluation of the Tutte polynomial, up to a scale factor. For instance, the number of bases is equal to TM (1, 1): MATROIDS: A MACAULAY2 PACKAGE 7 i59 : tutteEvaluate(M5, 1, 1) o59 = 125 Even for graphic matroids, the Tutte polynomial contains a wealth of information about the graph; e.g. the Tutte polynomial specializes to the chromatic polynomial, the flow polynomial, and the reliability polynomial. For specific points, TM(G) (2, 1) counts the number of forests in G, and TM(G) (2, 0) counts the number of acyclic orientations of G. i60 : tutteEvaluate(M5, 2, 1) o60 = 291 i61 : tutteEvaluate(M5, 2, 0) o61 = 120 i62 : factor chromaticPolynomial K5 o62 = (x)(x - 4)(x - 3)(x - 2)(x - 1) o62 : Expression of class Product Connections. We conclude by presenting some connections of matroids to other areas of mathematics. First, the matroid polytope PM : let M = ([n], B) be a matroid on the ground set {1, . . . , n}. In the Euclidean space Rn with standard basis {e1 , . . . , en }, one can form the convex hull of the indicator vectors of the bases of M , namely: ! X PM := conv ei | B ∈ B i∈B The matroid polytope can be created as follows: i63 : needsPackage "Polyhedra" o63 = Polyhedra o63 : Package i64 : convexHull matroidPolytope M4 o64 = {ambient dimension => 6 } dimension of lineality space => 0 dimension of polyhedron => 5 number of facets => 16 number of rays => 0 number of vertices => 16 o64 : Polyhedron A theorem of Gelfand, Goresky, MacPherson, and Serganova [3] classifies the subsets B ⊆ 2[n] which are the bases of a matroid on [n] in terms of the polytope PM . Next is optimization: let E be a finite set, and I ⊆ 2E a set of subsets that is downward closed: i.e. if X ∈ I and Y ⊆ X, thenX Y ∈ I. Let w be a weight function on E, i.e. a function w : E → R, extended to w : 2E → R by setting w(X) := w(x). Consider the optimization problem: x∈X (*) Find a maximal member of I of maximum weight, with respect to w. One attempt to try to solve (*) is to apply the greedy algorithm: namely, after having already selected elements {x1 , . . . , xi }, choose an element xi+1 ∈ E of maximum weight such that {x1 , . . . , xi , xi+1 } ∈ I, and repeat. It turns out that the greedy algorithm will always work if I is the independent sets of a matroid, and for nothing else in general, as the following theorem shows (curiously, this was proved before Whitney introduced matroids): Theorem 2. [2] Let E be a finite set, and I ⊆ 2E . Then I is the set of independent sets of a matroid on E iff I is downward closed and for all weight functions w : E → R, the greedy algorithm successfully solves (*). A solution to (*) provided by the greedy algorithm can be obtained using the method greedyAlgorithm (the weight function is specified by its list of values on E): i65 : w = {0, log(2), 4/3, 1, -4, 2, pi_RR}; 8 JUSTIN CHEN i66 : greedyAlgorithm(F7, w) o66 = {6, 5, 3} o66 : List Last but not least is algebraic geometry: analogous to an Orlik-Solomon algebra (the cohomology ring of the complement of a hyperplane arrangement), one can define a cohomology ring associated to a matroid. For a matroid M on ground set E with no loops, set R := Z[xF ]/(I1 + I2 ), I1 := X i1 ∈F xF − X ! i1 , i2 ∈ E distinct , i2 ∈F ′ I2 := (xF xF ′ | F, F incomparable) ′ where F (and F ) runs over all nonempty proper flats of M . When M is realizable over C, R is the cohomology ring of the complement of a subspace arrangement corresponding to the lattice of flats of M , without the minimal and maximal elements. It is easy to see that (taking R with coefficients in a field k instead of Z) R is a standard graded Artinian k-algebra of Castelnuovo-Mumford regularity r = rk M − 1. A recent result of Adiprasito, Katz, and Huh [1] states that R is a Poincare duality algebra (in particular, is Gorenstein), and also satisfies the Lefschetz property: for sufficiently general l ∈ R1 , and for j ≤ r/2, multiplication by lr−2j is an isomorphism Rj → Rr−j . We illustrate the Gorenstein property for R with the Vamos matroid (the smallest matroid not realizable over any field): i67 : V = specificMatroids("vamos") o67 = V o67 : Matroid i68 : (#groundSet V, #bases V, rk V, #flatten flats V) o68 = (8, 65, 4, 79) o68 : Sequence i69 : I = idealCohomologyRing V; -- ideal in polynomial ring with 77 = 79 - 2 variables o69 : Ideal of QQ[x , x , x , x , x , x , x , x , x , x , x , x , x , x , x , x · · · 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 ··· i70 : time toList(0..<rk V)/(i -> hilbertFunction(i, I)) -- used 32.3128 seconds o70 = {1, 70, 70, 1} o70 : List Acknowledgements. This project was partially supported by NSF grant DMS-1001867. The author is very grateful to June Huh for explaining the connection of the cohomology ring of a matroid. The author would also like to thank David Eisenbud and Daniel Grayson for advice with Macaulay2, and Joe Kileel for helpful discussions. References [1] Adiprasito, K., Katz, E., and Huh, J. Hodge theory for combinatorial geometries. In preparation. [2] Borůvka, O. O jistém problému minimálnı̀m. Práce Mor. Prı́rodoved. Spol. v Brne 3, 37-58, 1926. [3] Gelfand, I. M., Goresky, R. M., MacPherson, R. D., and Serganova, V. V. Combinatorial geometries, convex polyhedra, and Schubert cells. Advances in Mathematics 63 (3): 301-316, 1987. [4] Grayson, D. R. and Stillman, M. E. Macaulay2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/Macaulay2/ [5] Oxley, J. G. Matroid Theory. Second Edition, Oxford University Press, New York, 2011. [6] Tutte, W. T. A homotopy theorem for matroids, I, II. Trans. Amer. Math. Soc. 88, 144-174, 1958. [7] Tutte, W. T. Matroids and graphs. Trans. Amer. Math. Soc. 90, 527-552, 1959. [8] Whitney, H. On the abstract properties of linear dependence. Amer. J. Math. 57, 509-533, 1935. Department of Mathematics, University of California, Berkeley, California, 94720 U.S.A E-mail address: [email protected]
0math.AC
HIERARCHICALLY HYPERBOLIC SPACES II: COMBINATION THEOREMS AND THE DISTANCE FORMULA arXiv:1509.00632v3 [math.GR] 14 Feb 2017 JASON BEHRSTOCK, MARK F. HAGEN, AND ALESSANDRO SISTO Abstract. We introduce a number of tools for finding and studying hierarchically hyperbolic spaces (HHS), a rich class of spaces including mapping class groups of surfaces, Teichmüller space with either the Teichmüller or Weil-Petersson metrics, right-angled Artin groups, and the universal cover of any compact special cube complex. We begin by introducing a streamlined set of axioms defining an HHS. We prove that all HHSs satisfy a Masur-Minsky-style distance formula, thereby obtaining a new proof of the distance formula in the mapping class group without relying on the Masur-Minsky hierarchy machinery. We then study examples of HHSs; for instance, we prove that when M is a closed irreducible 3–manifold then π1 M is an HHS if and only if it is neither N il nor Sol. We establish this by proving a general combination theorem for trees of HHSs (and graphs of HH groups). We also introduce a notion of “hierarchical quasiconvexity”, which in the study of HHS is analogous to the role played by quasiconvexity in the study of Gromov-hyperbolic spaces. Contents Introduction 1. The main definition and background on hierarchically hyperbolic spaces 2. Tools for studying HHSs 3. Realization of consistent tuples 4. Hierarchy paths and the distance formula 5. Hierarchical quasiconvexity and gates 6. Hulls 7. The coarse median property 8. Combination theorems for hierarchically hyperbolic spaces 9. Hyperbolicity relative to HHGs 10. Hierarchical hyperbolicity of 3-manifold groups 11. A new proof of the distance formula for mapping class groups References 1 8 14 17 20 27 31 34 36 47 49 51 53 Introduction One of the most remarkable aspects of the theory of mapping class groups of surfaces is that the coarse geometry of the mapping class group, MCGpSq, can be fully reconstructed from its shadows on a collection of hyperbolic spaces — namely the curve graphs of subsurfaces of the underlying surface. Each subsurface of the surface S is equipped with a hyperbolic curve graph and a projection, the subsurface projection, to this graph from MCGpSq; there Behrstock was supported as a Simons Fellow. Hagen was supported by NSF Grant Number 1045119 and by EPSRC. Sisto was supported by the Swiss National Science Foundation project 144373. 1 HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 2 are also projections between the various curve graphs. The powerful Masur–Minsky distance formula [MM00] shows that the distance between points of MCGpSq is coarsely the sum over all subsurfaces of the distances between the projections of these points to the various curve graphs. Meanwhile, the consistency/realization theorem [BKMM12] tells us that tuples with coordinates in the different curve graphs that obey “consistency” conditions characteristic of images of actual points in MCGpSq are, coarsely, images of points in MCGpSq. Finally, any two points in MCGpSq are joined by a uniform-quality quasigeodesic projecting to a uniform unparameterized quasigeodesic in each curve graph — a hierarchy path [MM00]. It is perhaps surprising that analogous behavior should appear in CAT(0) cube complexes, since the mapping class group cannot act properly on such complexes, c.f., [Bri10, Hag07, KL96]. However, mapping class groups enjoy several properties reminiscent of nonpositively/negatively curved spaces, including: automaticity (and, thus, quadratic Dehn function) [Mos95], having many quasimorphisms [BF02], super-linear divergence [Beh06], etc. Mapping class groups also exhibit coarse versions of some features of CAT(0) cube complexes, including coarse centroids/medians [BM11] and, more generally, a local coarse structure of a cube complex as made precise in [Bow13], applications to embeddings in trees, [BDS11], etc. Accordingly, it is natural to seek a common thread joining these important classes of groups and spaces. In [Hag14] it was shown that, for an arbitrary CAT(0) cube complex X , the intersectiongraph of the hyperplane carriers — the contact graph — is hyperbolic, and in fact quasiisometric to a tree. This object seems at first glance quite different from the curve graph (which records, after all, non-intersection), but there are a number of reasons this is quite natural, two of which we now mention. First, the curve graph can be realized as a coarse intersection graph of product regions in MCG. Second, the contact graph is closely related to the intersection graph of the hyperplanes themselves; when X is the universal cover of the Salvetti complex of a right-angled Artin group, the latter graph records commutation of conjugates of generators, just as the curve graph records commutation of Dehn twists. The cube complex X coarsely projects to its contact graph. Moreover, using disc diagram techniques, it is not hard to show that any two 0–cubes in a CAT(0) cube complex are joined by a combinatorial geodesic projecting to a geodesic in the contact graph [BHS14]. This observation — that CAT(0) cube complexes have “hierarchy paths” with very strong properties — motivated a search for an analogue of the theory of curve graphs and subsurface projections in the world of CAT(0) cube complexes. This was largely achieved in [BHS14], where a theory completely analogous to the mapping class group theory was constructed for a wide class of CAT(0) cube complexes, with (a variant of) the contact graph playing the role of the curve graph. These results motivated us to define a notion of “spaces with distance formulae”, which we did in [BHS14], by introducing the class of hierarchically hyperbolic spaces (HHSs) to provide a framework for studying many groups and spaces which arise naturally in geometric group theory, including mapping class groups and virtually special groups, and to provide a notion of “coarse nonpositive curvature” which is quasi-isometry invariant while still yielding some of those properties available via local geometry in the classical setting of nonpositively-curved spaces. As mentioned above, the three most salient features of hierarchically hyperbolic spaces are: the distance formula, the realization theorem, and the existence of hierarchy paths. In the treatment given in [BHS14], these attributes are part of the definition of a hierarchically hyperbolic space. This is somewhat unsatisfactory since, in the mapping class group and cubical settings, proving these theorems requires serious work. In this paper, we show that although the definition of hierarchically hyperbolic space previously introduced identifies the right class of spaces, there exist a streamlined set of axioms for that class of spaces which are much easier to verify in practice than those presented HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 3 in [BHS14, Section 13] and which don’t require assuming a distance formula, realization theorem, or the existence of hierarchy paths. Thus, a significant portion of this paper is devoted to proving that those results can be derived from the simplified axioms we introduce here. Along the way, we obtain a new, simplified proof of the actual Masur-Minsky distance formula for the mapping class group. We then examine various geometric properties of hierarchically hyperbolic spaces and groups, including many reminiscent of the world of CAT(0) spaces and groups; for example, we show that hierarchically hyperbolic groups have quadratic Dehn function. Finally, taking advantage of the simpler set of axioms, we prove combination theorems enabling the construction of new hierarchically hyperbolic spaces/groups from old. The definition of a hierarchically hyperbolic space still has several parts, the details of which we postpone to Section 1. However, the idea is straightforward: a hierarchically hyperbolic space is a pair pX , Sq, where X is a metric space and S indexes a set of δ– hyperbolic spaces with several features (to each U P S the associated space is denoted CU ). Most notably, S is endowed with 3 mutually exclusive relations, nesting, orthogonality, and transversality, respectively generalizing nesting, disjointness, and overlapping of subsurfaces. For each U P S, we have a coarsely Lipschitz projection πU : X Ñ CU , and there are relative projections CU Ñ CV when U, V P S are non-orthogonal. These projections are required to obey “consistency” conditions modeled on the inequality identified by Behrstock in [Beh06], as well as a version of the bounded geodesic image theorem and large link lemma of [MM00], among other conditions. A finitely generated group G is hierarchically hyperbolic if it can be realized as a group of HHS automorphisms (“hieromorphisms”, as defined in Section 1) so that the induced action on X by uniform quasi-isometries is geometric and the action on S is cofinite. Hierarchically hyperbolic groups, endowed with word-metrics, are hierarchically hyperbolic spaces, but the converse does not appear to be true. Combination theorems. One of the main contributions in this paper is to provide many new examples of hierarchically hyperbolic groups, thus showing that mapping class groups and various cubical complexes/groups are just two of many interesting families in this class of groups and spaces. We provide a number of combination theorems, which we will describe below. One consequence of these results is the following classification of exactly which 3– manifold groups are hierarchically hyperbolic: Theorem 10.1 (3–manifolds are hierarchically hyperbolic). Let M be a closed 3– manifold. Then π1 pM q is a hierarchically hyperbolic space if and only if M does not have a Sol or Nil component in its prime decomposition. This result has a number of applications to the many fundamental groups of 3–manifolds which are HHS. For instance, in such cases, it follows from results in [BHS14] that: except for Z3 , the top dimension of a quasi-flat in such a group is 2, and any such quasi-flat is locally close to a “standard flat” (this generalizes one of the main results of [KL97, Theorem 4.10]); up to finite index, Z and Z2 are the only finitely generated nilpotent groups which admit quasi-isometric embeddings into π1 pM q; and, except in the degenerate case where π1 pM q is virtually abelian, such groups are all acylindrically hyperbolic (as also shown in [MO14]). Remark (Hierarchically hyperbolic spaces vs. hierarchically hyperbolic groups). There is an important distinction to be made between a hierarchically hyperbolic space, which is a metric space X equipped with a collection S of hyperbolic spaces with certain properties, and a hierarchically hyperbolic group, which is a group acting geometrically on a hierarchically hyperbolic space in such a way that the induced action on S is cofinite. The latter property is considerably stronger. For example, Theorem 10.1 shows that π1 M , with any word-metric, is a hierarchically hyperbolic space, but, as we discuss in Remark 10.2, π1 M probably fails HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 4 to be a hierarchically hyperbolic group in general; for instance we conjecture this is the case for those graph manifolds which can not be cocompactly cubulated. In the course of proving Theorem 10.1, we establish several general combination theorems, including one about relative hyperbolicity and one about graphs of groups. The first is: Theorem 9.1 (Hyperbolicity relative to HHGs). Let the group G be hyperbolic relative to a finite collection P of peripheral subgroups. If each P P P is a hierarchically hyperbolic space, then G is a hierarchically hyperbolic space. Further, if each P P P is a hierarchically hyperbolic group, then so is G. Another of our main results is a combination theorem establishing when a tree of hierarchically hyperbolic spaces is again a hierarchically hyperbolic space. Theorem 8.6 (Combination theorem for HHS). Let T be a tree of hierarchically hyperbolic spaces. Suppose that: ‚ edge-spaces are uniformly hierarchically quasiconvex in incident vertex spaces; ‚ each edge-map is full; ‚ T has bounded supports; ‚ if e is an edge of T and Se is the Ď–maximal element of Se , then for all V P Se˘ , the elements V and φ♦ pS q are not orthogonal in Se˘ . e˘ e Then XpT q is hierarchically hyperbolic. Hierarchical quasiconvexity is a natural generalization of both quasiconvexity in the hyperbolic setting and cubical convexity in the cubical setting, which we shall discuss in some detail shortly. The remaining conditions are technical and explained in Section 8, but are easily verified in practice. As a consequence, we obtain a set of sufficient conditions guaranteeing that a graph of hierarchically hyperbolic groups is a hierarchically hyperbolic group. Corollary 8.22 (Combination theorem for HHG). Let G “ pΓ, tGv u, tGe u, tφ˘ e uq be a finite graph of hierarchically hyperbolic groups. Suppose that G equivariantly satisfies the hypotheses of Theorem 8.6. Then the total group G of G is a hierarchically hyperbolic group. Finally, we prove that products of hierarchically hyperbolic spaces admit natural hierarchically hyperbolic structures. As mentioned earlier, we will apply the combination theorems to fundamental groups of 3– manifolds, but their applicability is broader. For example, they can be applied to fundamental groups of higher dimensional manifolds such as the ones considered in [FLS11]. The distance formula and realization. As defined in [BHS14], the basic definition of a hierarchically hyperbolic space is modeled on the essential properties underlying the “hierarchy machinery” of mapping class groups. In this paper, we revisit the basic definition and provide a new, refined set of axioms; the main changes are the removal of the “distance formula” and “hierarchy path” axioms and the replacement of the “realization” axiom by a far simpler “partial realization”. These new axioms are both more fundamental and more readily verified. An important result in mapping class groups which provides a starting point for much recent research in the field is the celebrated “distance formula” of Masur–Minsky [MM00] which provides a way to estimate distances in the mapping class group, up to uniformly bounded additive and multiplicative distortion, via distances in the curve graphs of subsurfaces. We give a new, elementary, proof of the distance formula in the mapping class group. The first step in doing so is verifying that mapping class groups satisfy the new axioms of a hierarchically hyperbolic space. We provide elementary, simple proofs of the axioms for which elementary proofs do not exist in the literature (most notably, the uniqueness axiom); this HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 5 is done in Section 11. This then combines with our proof of the following result which states that any hierarchically hyperbolic space satisfies a “distance formula” (which in the case of the mapping class group provides a new proof of the Masur–Minsky distance formula): Theorem 4.5 (Distance formula for HHS). Let pX, Sq be hierarchically hyperbolic. Then there exists s0 such that for all s ě s0 there exist constants K, C such that for all x, y P X , ÿ dX px, yq —pK,Cq ttdW px, yquus , W PS where dW px, yq denotes the distance in the hyperbolic space CW between the projections of x, y and ttAuuB “ A if A ě B and 0 otherwise. Moreover, we show in Theorem 4.4 that any two points in X are joined by a uniform quasigeodesic γ projecting to a uniform unparameterized quasigeodesic in CU for each U P S. The existence of such hierarchy paths was hypothesized as part of the definition of a hierarchically hyperbolic space in [BHS14], but now it is proven as a consequence of the other axioms. The Realization Theorem for the mapping class group was established by Behrstock– Kleiner–Minsky–Mosher in [BKMM12, Theorem 4.3]. This theorem states that given a surface S and, for each subsurface W Ď S, a point in the curve complex of W : this sequence of points arises as the projection of a point in the mapping class group (up to bounded error), whenever the curve complex elements satisfy certain pairwise “consistency conditions.” Thus the Realization Theorem provides another sense in which all of the quasi-isometry invariant geometry of the mapping class group is encoded by the projections onto the curve graphs of subsurfaces.1 In Section 3 we show that an arbitrary hierarchically hyperbolic space satisfies a realization theorem. Given our elementary proof of the new axioms for mapping class groups in Section 11, we thus obtain a new proof of [BKMM12, Theorem 4.3]. Hulls and the coarse median property. Bowditch introduced a notion of coarse median space to generalize some results about median spaces to a more general setting, and, in particular, to the mapping class group [Bow13]. Bowditch observed in [Bow15] that any hierarchically hyperbolic space is a coarse median space; for completeness we provide a short proof of this result in Theorem 7.3. Using Bowditch’s results about coarse median spaces, we obtain a number of applications as corollaries. For instance, Corollary 7.9 is obtained from [Bow14a, Theorem 9.1] and says that any hierarchically hyperbolic space satisfies the Rapid Decay Property and Corollary 7.5 is obtained from [Bow13, Corollary 8.3] to show that all hierarchically hyperbolic groups are finitely presented and have quadratic Dehn functions. This provides examples of groups that are not hierarchically hyperbolic, for example: Corollary 7.6 (OutpFn q is not an HHG). For n ě 3, the group OutpFn q is not a hierarchically hyperbolic group. Indeed, OutpFn q was shown in [BV95, HM13b, BV] to have exponential Dehn function. This result is interesting as a counter-point to the well-known and fairly robust analogy between OutpFn q and the mapping class group of a surface; especially in light of the fact that OutpFn q is known to have a number of properties reminiscent of the axioms for an HHS, c.f., [BF14b, BF14a, HM13a, SS]. The coarse median property, via work of Bowditch, also implies that asymptotic cones of hierarchically hyperbolic spaces are contractible. Moreover, in Corollary 6.7, we bound the homological dimension of any asymptotic cone of a hierarchically hyperbolic space. This 1In [BKMM12], the name Consistency Theorem is used to refer to the necessary and sufficient conditions for realization; since we find it useful to break up these two aspects, we refer to this half as the Realization Theorem, since anything that satisfies the consistency conditions is realized. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 6 latter result relies on the use of hulls of finite sets of points in the HHS X . This construction generalizes the Σ–hull of a finite set, constructed in the mapping class group context in [BKMM12]. (It also generalizes a special case of the ordinary combinatorial convex hull in a CAT(0) cube complex.) A key feature of these hulls is that they are coarse retracts of X (see Proposition 6.3), and this plays an important role in the proof of the distance formula. Hierarchical spaces. We also introduce the more general notion of a hierarchical space (HS). This is the same as a hierarchically hyperbolic space, except that we do not require the various associated spaces CU , onto which we are projecting, to be hyperbolic. Although we mostly focus on HHS in this paper, a few things are worth noting. First, the realization theorem 3.1 actually makes no use of hyperbolicity of the CU , and therefore holds in the more general context of HS; see Section 3. Second, an important subclass of the class of HS is the class of relatively hierarchically hyperbolic spaces, which we introduce in Section 6.2. These are hierarchical spaces where the spaces CU are uniformly hyperbolic except when U is minimal with respect to the nesting relation. As their name suggests, this class includes all metrically relatively hyperbolic spaces; see Theorem 9.3. With an eye to future applications, in Section 6.2 we prove a distance formula analogous to Theorem 4.5 for relatively hierarchically hyperbolic spaces, and also establish the existence of hierarchy paths. The strategy is to build, for each pair of points x, y, in the relatively hierarchically hyperbolic space, a “hull” of x, y, which we show is hierarchically hyperbolic with uniform constants. We then apply Theorems 4.5 and 4.4. Standard product regions and hierarchical quasiconvexity. In Section 5.1, we introduce the notion of a hierarchically quasiconvex subspace of a hierarchically hyperbolic space pX , Sq. In the case where X is hyperbolic, this notion coincides with the usual notion of quasiconvexity. The main technically useful features of hierarchically quasiconvex subspaces generalize key features of quasiconvexity: they inherit the property of being hierarchically hyperbolic (Proposition 5.6) and one can coarsely project onto them (Lemma 5.5). Along with the hulls discussed above, the most important examples of hierarchically quasiconvex subspaces are standard product regions: for each U P S, one can consider the set PU of points x P X whose projection to each CV is allowed to vary only if V is nested into or orthogonal to U ; otherwise, x projects to the same place in CV as CU does under the relative projection. The space PU coarsely decomposes as a product, with factors corresponding to the nested and orthogonal parts. Product regions play an important role in the study of boundaries and automorphisms of hierarchically hyperbolic spaces in the forthcoming paper [DHS15], as well as in the study of quasi-boxes and quasiflats in hierarchically hyperbolic spaces carried out in [BHS14]. Some questions and future directions. Before embarking on the discussion outlined above, we raise a few questions about hierarchically hyperbolic spaces and groups that we believe are of significant interest. The first set of questions concern the scope of the theory, i.e., which groups and spaces are hierarchically hyperbolic and which operations preserve the class of HHS: Question A (Cubical groups). Let G act properly and cocompactly on a CAT(0) cube complex. Is G a hierarchically hyperbolic group? Conversely, suppose that pG, Sq is a hierarchically hyperbolic group; are there conditions on the elements of S which imply that G acts properly and cocompactly on a CAT(0) cube complex? Substantial evidence for this conjecture was provided in [BHS14] where we established that a CAT(0) cube complex X containing a factor system is a hierarchically hyperbolic space, and the associated hyperbolic spaces are all uniform quasi-trees. (Roughly speaking, HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 7 X contains a factor-system if the following collection of subcomplexes has finite multiplicity: the smallest collection of convex subcomplexes that contains all combinatorial hyperplanes and is closed under collecting images of closest-point projection maps between its elements.) The class of cube complexes that are HHS in this way contains all universal covers of special cube complexes with finitely many immersed hyperplanes, but the cube complexes containing factor systems have not been completely characterized. In the forthcoming paper [DHS15], we show that the above question is closely related to a conjecture of the first two authors on the simplicial boundary of cube complexes [BH, Conjecture 2.8]. More generally, we ask the following: Question B (Factor systems in median spaces). Is there a theory of factor systems in median spaces generalizing that in CAT(0) cube complexes, such that median spaces/groups admitting factor systems are hierarchically hyperbolic? Presumably, a positive answer to Question B would involve the measured wallspace structure on median spaces discussed in [CDH10]. One would have to develop an analogue of the contact graph of a cube complex to serve as the underlying hyperbolic space. One must be careful since, e.g., the Baumslag-Solitar group BSp1, 2q is median but has exponential Dehn function [Ger92] and is thus not a hierarchically hyperbolic space, by Corollary 7.5. On the other hand, if the answer to Question B is positive, one might try to do the same thing for coarse median spaces. There are a number of other groups and spaces where it is natural to inquire whether or not they are hierarchically hyperbolic. For example: Question C (Handlebody group). Let H be a compact oriented 3–dimensional genus g handlebody, and let Gg ď MCGpBHq be the group of isotopy classes of diffeomorphisms of H. Is Gg a hierarchically hyperbolic group? Question D (Graph products). Let G be a (finite) graph product of hierarchically hyperbolic groups. Is G hierarchically hyperbolic? The answer to Question C is presumably no, while the answer to D is most likely yes. The positive answer to Question D would follow from a strengthened version of Theorem 8.6. There are other candidate examples of hierarchically hyperbolic spaces. For example, it is natural to ask whether a right-angled Artin group with the syllable-length metric, introduced in [KK14], which is analogous to Teichmüller space with the Weil-Petersson metric, is hierarchically hyperbolic. As far as the difference between hierarchically hyperbolic spaces and groups is concerned, we conjecture that the following question has a positive answer: Question E. Is it true that the fundamental group G of a non-geometric graph manifold is a hierarchically hyperbolic group if and only if G is virtually compact special? It is known that G as above is virtually compact special if and only if it is chargeless in the sense of [BS05], see [HP13]. There remain a number of open questions about the geometry of hierarchically hyperbolic spaces in general. Theorem 7.3 ensures, via work of Bowditch, that every asymptotic cone of a hierarchically hyperbolic space is a median space [Bow13]; further properties in this direction are established in Section 6. Motivated by combining the main result of [Sis11] on 3–manifold groups with Theorem 10.1, we ask: Question F. Are any two asymptotic cones of a given hierarchically hyperbolic space biLipschitz equivalent? HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 8 The notion of hierarchical quasiconvexity of a subgroup of a hierarchically hyperbolic group pG, Sq generalizes quasiconvexity in word-hyperbolic groups and cubical convex-cocompactness in groups acting geometrically on CAT(0) cube complexes with factor-systems. Another notion of quasiconvexity is stability, defined by Durham-Taylor in [DT14]. This is a quite different notion of quasiconvexity, since stable subgroups are necessarily hyperbolic. In [DT14], the authors characterize stable subgroups of the mapping class group; it is reasonable to ask for a generalization of their results to hierarchically hyperbolic groups. Many hierarchically hyperbolic spaces admit multiple hierarchically hyperbolic structures. However, as discussed in [BHS14], a CAT(0) cube complex with a factor-system has a “minimal” factor-system, i.e., one that is contained in all other factor systems. In this direction, it is natural to ask whether a hierarchically hyperbolic space pX , Sq admits a hierarchically hyperbolic structure that is canonical in some way. Organization of the paper. Section 1 contains the full definition of a hierarchically hyperbolic space (and, more generally, a hierarchical space) and some discussion of background. Section 2 contains various basic consequences of the definition, and some tricks that are used repeatedly. In Section 3, we prove the realization theorem (Theorem 3.1). In Section 4 we establish the existence of hierarchy paths (Theorem 4.4) and the distance formula (Theorem 4.5). Section 5 is devoted to hierarchical quasiconvexity and product regions, and Section 6 to coarse convex hulls and relatively hierarchically hyperbolic spaces. The coarse median property and its consequences are detailed in Section 7. The combination theorems for trees of spaces, graphs of groups, and products are proved in Section 8, and groups hyperbolic relative to HHG are studied in Section 9. This is applied to 3-manifolds in Section 10. Finally, in Section 11, we prove that mapping class groups are hierarchically hyperbolic. Acknowledgments. MFH and AS thank the organizers of the Ventotene 2015 conference, and JB and MFH thank CIRM and the organizers of GAGTA 2015, where some of the work on this paper was completed. 1. The main definition and background on hierarchically hyperbolic spaces 1.1. The axioms. We begin by defining a hierarchically hyperbolic space. We will work in the context of a quasigeodesic space, X , i.e., a metric space where any two points can be connected by a uniform-quality quasigeodesic. Obviously, if X is a geodesic space, then it is a quasigeodesic space. Most of the examples we are interested in are geodesic spaces, but in order to construct hierarchically hyperbolic structures on naturally-occurring subspaces of hierarchically hyperbolic spaces, we must work in the slightly more general setting of quasigeodesic spaces. Definition 1.1 (Hierarchically hyperbolic space). The q–quasigeodesic space pX , dX q is a hierarchically hyperbolic space if there exists δ ě 0, an index set S, and a set tCW : W P Su of δ–hyperbolic spaces pCU, dU q, such that the following conditions are satisfied: (1) (Projections.) There is a set tπW : X Ñ 2CW | W P Su of projections sending points in X to sets of diameter bounded by some ξ ě 0 in the various CW P S. Moreover, there exists K so that each πW is pK, Kq–coarsely Lipschitz. (2) (Nesting.) S is equipped with a partial order Ď, and either S “ H or S contains a unique Ď–maximal element; when V Ď W , we say V is nested in W . We require that W Ď W for all W P S. For each W P S, we denote by SW the set of V P S such that V Ď W . Moreover, for all V, W P S with V Ĺ W there is a specified CV . subset ρVW Ă CW with diamCW pρVW q ď ξ. There is also a projection ρW V : CW Ñ 2 V (The similarity in notation is justified by viewing ρW as a coarsely constant map CV Ñ 2CW .) HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 9 (3) (Orthogonality.) S has a symmetric and anti-reflexive relation called orthogonality: we write V KW when V, W are orthogonal. Also, whenever V Ď W and W KU , we require that V KU . Finally, we require that for each T P S and each U P ST for which tV P ST | V KU u ‰ H, there exists W P ST ´ tT u, so that whenever V KU and V Ď T , we have V Ď W . Finally, if V KW , then V, W are not Ď–comparable. (4) (Transversality and consistency.) If V, W P S are not orthogonal and neither is nested in the other, then we say V, W are transverse, denoted V &W . There exists κ0 ě 0 such that if V &W , then there are sets ρVW Ď CW and ρW V Ď CV each of diameter at most ξ and satisfying: ( min dW pπW pxq, ρVW q, dV pπV pxq, ρW V q ď κ0 for all x P X . For V, W P S satisfying V Ď W and for all x P X , we have: ( min dW pπW pxq, ρVW q, diamCV pπV pxq Y ρW V pπW pxqqq ď κ0 . & The preceding two inequalities are the consistency inequalities for points in X . V Finally, if U Ď V , then dW pρU W , ρW q ď κ0 whenever W P S satisfies either V Ĺ W or V &W and W U . (Finite complexity.) There exists n ě 0, the complexity of X (with respect to S), so that any set of pairwise–Ď–comparable elements has cardinality at most n. (Large links.) There exist λ ě 1 and E ě maxtξ, κ0 u such that the following holds. Let W P S and let x, x1 P X . Let N “ λdW pπW pxq, πW px1 qq ` λ. Then there exists tTi ui“1,...,tN u Ď SW ´ tW u such that for all T P SW ´ tW u, either T P STi for some i, or dT pπT pxq, πT px1 qq ă E. Also, dW pπW pxq, ρTWi q ď N for each i. (Bounded geodesic image.) For all W P S, all V P SW ´ tW u, and all geodesics V γ of CW , either diamCV pρW V pγqq ď E or γ X NE pρW q ‰ H. (Partial Realization.) There exists a constant α with the following property. Let tVj u be a family of pairwise orthogonal elements of S, and let pj P πVj pX q Ď CVj . Then there exists x P X so that: ‚ dVj px, pj q ď α for all j, (5) (6) (7) (8) V ‚ for each j and each V P S with Vj Ď V , we have dV px, ρVj q ď α, and V ‚ if W &Vj for some j, then dW px, ρWj q ď α. (9) (Uniqueness.) For each κ ě 0, there exists θu “ θu pκq such that if x, y P X and dpx, yq ě θu , then there exists V P S such that dV px, yq ě κ. We say that the q–quasigeodesic metric spaces tXi u are uniformly hierarchically hyperbolic if each Xi satisfies the axioms above and all constants, including the complexities, can be chosen uniformly. We often refer to S, together with the nesting and orthogonality relations, the projections, and the hierarchy paths, as a hierarchically hyperbolic structure for the space X . Observe that X is hierarchically hyperbolic with respect to S “ H, i.e., hierarchically hyperbolic of complexity 0, if and only if X is bounded. Similarly, X is hierarchically hyperbolic of complexity 1 with respect to S “ tX u, if and only if X is hyperbolic. Notation 1.2. Where it will not cause confusion, given U P S, we will often suppress the projection map πU when writing distances in CU , i.e., given x, y P X and p P CU we write dU px, yq for dU pπU pxq, πU pyqq and dU px, pq for dU pπU pxq, pq. Note that when we measure distance between a pair of sets (typically both of bounded diameter) we are taking the minimum distance between the two sets. Given A Ă X and U P S we let πU pAq denote YaPA πU paq. Remark 1.3 (Surjectivity of projections). One can always replace each CU with a thickening of πU pX q, and hence make each πU coarsely surjective. The details can be found in the HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 10 forthcoming paper [DHS15], where this procedure gets used; the resulting spaces are termed normalized hierarchically hyperbolic spaces. Remark 1.4 (Large link function). It appears as though there is no actual need to require in Definition 1.1.(6) that N depend linearly on dW px, x1 q. Instead, we could have hypothesized that for any C ě 0, there exists N pCq so that the statement of the axiom holds with N “ N pCq whenever dW px, x1 q ď C. However, one could deduce from this and the rest of the axioms that N pCq grows linearly in C, so we have elected to simply build linearity into the definition. Remark 1.5 (Summary of constants). Each hierarchically hyperbolic space pX , Sq is associated with a collection of constants often, as above, denoted δ, ξ, n, κ0 , E, θu , K, where: (1) CU is δ–hyperbolic for each U P S, (2) each πU has image of diameter at most ξ and each πU is pK, Kq–coarsely Lipschitz, and each ρU V has (image of) diameter at most ξ, (3) for each x P X , the tuple pπU pxqqU PS is κ0 –consistent, (4) E is the constant from the bounded geodesic image axiom. Whenever working in a fixed hierarchically hyperbolic space, we use the above notation freely. We can, and shall, assume that E ě q, E ě δ, E ě ξ, E ě κ0 , E ě K, and E ě α. Remark 1.6. We note that in Definition 1.1.(1), the assumption that the projections are Lipschitz can be replaced by the weaker assumption that there is a proper function of the projected distance which is a lower bound for the distance in the space X . From this weaker assumption, the fact that the projections are actually coarsely Lipschitz then follows from the fact that we assume X to be quasi-geodesic. Since the Lipschitz hypothesis is cleaner to state and, in practice, fairly easy to verify, we just remark on this for those that might find this fact useful in proving that more exotic spaces are hierarchically hyperbolic. & 1.2. Comparison to the definition in [BHS14]. Definition 1.1 is very similar to the definition of a hierarchically hyperbolic space given in [BHS14], with the following differences: (1) The existence of hierarchy paths and the distance formula were stated as axioms in [BHS14]; below, we deduce them from the other axioms. Similarly, the below realization theorem was formerly an axiom, but has been replaced by the (weaker) partial realization axiom. (2) We now require X to be a quasigeodesic space. In [BHS14], this follows from the existence of hierarchy paths, which was an axiom there. (3) We now require the projections πU : X Ñ CU to be coarsely Lipschitz; although this requirement was not imposed explicitly in [BHS14], it follows from the distance formula, which was an axiom there. (4) In [BHS14], there were five consistency inequalities; in Definition 1.1.(4), there are two. The last three inequalities in the definition from [BHS14] follow from Proposition 1.7 below. (Essentially, the partial realization axiom has replaced part of the old consistency axiom.) V (5) In Definition 1.1.(4), we require that, if U Ď V , then dW pρU W , ρW q ď κ0 whenever W P S satisfies either V Ĺ W or V &W and W U . In the context of [BHS14], this follows by considering the standard product regions constructed using realization (see [BHS14, Section 13.1] and Section 5.2 of the present paper). Proposition 1.7 (ρ–consistency). There exists κ1 so that the following holds. Suppose that U, V, W P S satisfy both of the following conditions: U Ĺ V or U &V ; and U Ĺ W or U &W . Then, if V &W , then ( V U W min dCW pρU W , ρW q, dCV pρV , ρV q ď κ1 HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 11 and if V Ĺ W , then ( V U W U min dCW pρU W , ρW q, diamCV pρV Y ρV pρW qq ď κ1 . Proof. Suppose that U Ĺ V or U &V and the same holds for U, W . Suppose that V &W or V Ď W . Choose p P πU pX q. There is a uniform α so that partial realization (DefiniU tion 1.1.(8)) provides x P X so that dU px, pq ď α and dT px, ρU T q ď α whenever ρT is defined U and coarsely constant. In particular, dV px, ρU V q ď α and dW px, ρW q ď α. The claim now follows from Definition 1.1.(4), with κ1 “ κ0 ` α. l In view of the discussion above, we have: Proposition 1.8. The pair pX , Sq satisfies Definition 1.1 if and only if it is hierarchically hyperbolic in the sense of [BHS14]. In particular, as observed in [BHS14]: Proposition 1.9. If pX , Sq is a hierarchically hyperbolic space, and X 1 is a quasigeodesic space quasi-isometric to X , then there is a hierarchically hyperbolic space pX 1 , Sq. 1.3. A variant on the axioms. Here we introduce two slightly simpler versions of the HHS axioms and show that in the case, as in most situations which arise naturally, that the projections are coarsely surjective, then it suffices to verify the simpler axioms. The following is a subset of the nesting axiom; here we remove the definition of the CV in the case V Ĺ W . projection map ρW V : CW Ñ 2 Definition 1.1.(2)1 (Nesting variant). S is equipped with a partial order Ď, and either S “ H or S contains a unique Ď–maximal element; when V Ď W , we say V is nested in W . We require that W Ď W for all W P S. For each W P S, we denote by SW the set of V P S such that V Ď W . Moreover, for all V, W P S with V Ĺ W there is a specified subset ρVW Ă CW with diamCW pρVW q ď ξ. The following is a subset of the transversality and consistency axiom. Definition 1.1.(4)1 (Transversality). If V, W P S are not orthogonal and neither is nested in the other, then we say V, W are transverse, denoted V &W . There exists κ0 ě 0 such that if V &W , then there are sets ρVW Ď CW and ρW V Ď CV each of diameter at most ξ and satisfying: ( min dW pπW pxq, ρVW q, dV pπV pxq, ρW V q ď κ0 & for all x P X . V Finally, if U Ď V , then dW pρU W , ρW q ď κ0 whenever W P S satisfies either V Ĺ W or V &W and W U . The following is a variant of the bounded geodesic image axiom: Definition 1.1.(7)1 (Bounded geodesic image variant). Suppose that x, y P X and V Ĺ W have the property that there exists a geodesic from πW pxq to πW pyq which stays pE ` 2δq-far from ρVW . Then dV px, yq ď E. Proposition 1.10. Given a quasigeodesic space X and an index set S, then pX , Sq is an HHS if it satisfies the axioms of Definition 1.1 with the following changes: ‚ Replace Definition 1.1.(2) by Definition 1.1.(2)1 . ‚ Replace Definition 1.1.(4) by Definition 1.1.(4)1 . ‚ Replace Definition 1.1.(7) by Definition 1.1.(7)1 . ‚ Assume that for each CU the map πU pX q is uniformly coarsely surjective. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 12 Proof. To verify Definition 1.1.(2), for each V, W P S with V Ĺ W , we define a map CV as follows. If p P CW ´ N pρV q, then let ρW ppq “ π pxq for some x P X ρW E W V V : CW Ñ 2 V with πW pxq — p. Since p does not lie E–close to ρVW , this definition is coarsely independent of x by Definition 1.1.(7)1 . On NE pρVW q, we define ρW V arbitrarily. By definition, the resulting map satisfies Definition 1.1.(4). Moreover, coarse surjectivity of πW and Definition 1.1.(7)1 ensure that Definition 1.1.(7) holds. The rest of the axioms hold by hypothesis. l Remark 1.11. The definition of an HHS provided by Proposition 1.10 is convenient because it does not require one to define certain maps between hyperbolic spaces: Definition 1.1.(2)1 is strictly weaker than Definition 1.1.(2). On the other hand, it is often convenient to work with HHSes in which some of the projections πU are not coarsely surjective; for example, this simplifies the proof that hierarchically quasiconvex subspaces inherit HHS structures in Proposition 5.6. Hence we have included both definitions. In practice, we almost always apply consistency and bounded geodesic image in concert, which involves applying bounded geodesic image to geodesics of CW joining points in πW pX q. Accordingly, Definition 1.1.(7)1 is motivated by the following easy observation: Proposition 1.12. Let pX , Sq be an HHS. Then the conclusion of Definition 1.1.(7)1 holds for all x, y P X and V, W P S with V Ĺ W . 1.4. Hierarchical spaces. Although most of our focus in this paper is on hierarchically hyperbolic spaces, there are important contexts in which hyperbolicity of the spaces CU, U P S is not used; notably, this is the case for the realization theorem (Theorem 3.1). Because of the utility of a more general definition in later applications, we now define the following more general notion of a hierarchical space; the reader interested only in the applications to the mapping class group, 3–manifolds, cube complexes, etc. may safely ignore this subsection. Definition 1.13 (Hierarchical space). A hierarchical space is a pair pX , Sq as in Definition 1.1, with X a quasigeodesic space and S an index set, where to each U P S we associate a geodesic metric space CU , which we do not require to be hyperbolic. As before, there are coarsely Lipschitz projections πU : X Ñ CU and relative projections ρU V : CU Ñ CV whenever U, V are non-orthogonal. We require all statements in the Definition 1.1 to hold, except for hyperbolicity of the CU . Remark 1.14. Let X be a quasigeodesic space that is hyperbolic relative to a collection P of subspaces. Then X has a hierarchical space structure: the associated spaces onto which we project are the various P, together with the space Xp obtained by coning off the elements of P in X . When the elements of P are themselves hierarchically hyperbolic, we obtain a hierarchically hyperbolic structure on X (see Section 9). Otherwise, the hierarchical structure need not be hierarchically hyperbolic since Xp is the only one of the elements of S known to be hyperbolic. Remark 1.15. Other than hierarchically hyperbolic spaces, we are mainly interested in hierarchical spaces pX , Sq where for all U P S, except possibly when U is Ď–minimal, we have that CU is hyperbolic. This is the case, for example, in relatively hyperbolic spaces. 1.5. Consistency and partial realization points. The following definitions, which abstract the consistency inequalities from Definition 1.1.(4) and the partial realization axiom, Definition 1.1.(8), play important roles throughout our discussion. We will consider this topic in depth in Section 3. ś Definition 1.16 (Consistent). Fix κ ě 0 and let ~b P U PS 2CU be a tuple such that for each U P S, the coordinate bU is a subset of CU with diamCU pbU q ď κ. The tuple ~b is κ–consistent HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 13 if, whenever V &W , ( min dW pbW , ρVW q, dV pbV , ρW V q ďκ and whenever V Ď W , ( min dW pbW , ρVW q, diamCV pbV Y ρW V pbW qq ď κ. Definition 1.17 (Partial realization point). Given θ ě 0 and a κ–consistent tuple ~b, we say that x is a θ–partial realization point for tVj u Ď S if (1) dVj px, bVj q ď θ for all j, V (2) for all j, we have dV px, ρVj q ď θ for any V P S with Vj Ď V , and V (3) for all W such that W &Vj for some j, we have dW px, ρWj q ď θ. 1.6. Level. The following definition is very useful for proving statements about hierarchically hyperbolic spaces inductively. Although it is natural, and sometimes useful, to induct on complexity, it is often better to induct on level: Definition 1.18 (Level). Let pX, Sq be hierarchically hyperbolic. The level `U of U P S is defined inductively as follows. If U is Ď-minimal then we say that its level is 1. The element U has level k ` 1 if k is the maximal integer such that there exists V Ď U with `V “ k and V ‰ U . Given U P S, for each ` ě 0, let S`U be the set of V Ď U with `U ´ `V ď ` and let T`U “ S`U ´ S`´1 U . 1.7. Maps between hierarchically hyperbolic spaces. Definition 1.19 (Hieromorphism). Let pX , Sq and pX 1 , S1 q be hierarchically hyperbolic structures on the spaces X , X 1 respectively. A hieromorphism, consists of a map f : X Ñ X 1 , an injective map f ♦ : S Ñ S1 preserving nesting, transversality, and orthogonality, and, for each U P S a map f ˚ pU q : CU Ñ Cpf ♦ pU qq which is a quasi-isometric embedding where the constants are uniform over all elements of S and for which the following two diagrams coarsely commute (with uniform constants) for all nonorthogonal U, V P S: f X πU  CpU q f ˚ pU q / X1  πf ♦ pU q / Cpf ♦ pU qq and CU ρU V f ˚ pU q / Cpf ♦ pU qq ♦  CV f ˚ pV q f pU q  ρf ♦ pV q / Cpf ♦ pV qq where ρU V : CU Ñ CV is the projection from Definition 1.1, which, by construction, is coarsely constant if U &V or U Ď V . As the functions f, f ˚ pU q, and f ♦ all have distinct domains, it is often clear from the context which is the relevant map; in that case we periodically abuse notation slightly by dropping the superscripts and just calling all of the maps f . Definition 1.20 (Automorphism, hierarchically hyperbolic group). An automorphism of the hierarchically hyperbolic space pX , Sq is a hieromorphism f : pX , Sq Ñ pX , Sq such that f ♦ is bijective and each f ˚ pU q is an isometry; hence f : X Ñ X is a uniform quasi-isometry by the distance formula (Theorem 4.5). The full automorphism group of pX , Sq is denoted AutpSq. The finitely generated group G is hierarchically hyperbolic if there exists a hierarchically hyperbolic space pX , Sq and an action G Ñ AutpSq so that the uniform quasi-action of G on X is metrically proper and cobounded and S contains finitely many G–orbits. Note that HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 14 if G is hierarchically hyperbolic by virtue of its action on the hierarchically hyperbolic space pX , Sq, then pG, Sq is a hierarchically hyperbolic structure with respect to any word-metric on G; for any U P S the projection is the composition of the projection X Ñ CU with a G–equivariant quasi-isometry G Ñ X . In this case, pG, Sq (with the implicit hyperbolic spaces and projections) is a hierarchically hyperbolic group structure. Definition 1.21 (Equivariant hieromorphism). Let pX , Sq and pX 1 , G1 q be hierarchically hyperbolic spaces and consider actions G Ñ AutpSq and G1 Ñ AutpS1 q. For each g P G, let pfg , fg♦ , tfg˚ pU quq denote its image in AutpSq (resp., for g 1 P G1 we obtain pfg1 , fg♦1 , tfg˚1 pU quq in AutpS1 q). Let φ : G Ñ G1 be a homomorphism. The hieromorphism pf, f ♦ , tf ˚ pU quq : pX , Sq Ñ ♦ pX 1 , S1 q is φ–equivariant if for all g P G and U P S, we have f ♦ pfg♦ pU qq “ fφpgq pf ♦ pU qq and the following diagram (uniformly) coarsely commutes: f ˚ pU q CU fg˚ pU q  Cpfg♦ pU qq f ˚ pfg♦ pU qq / Cpf ♦ pU qq / ˚ pU qq fφpgq ♦ ♦ Cpf pfg pU qqq  œ œ In this case, f : X Ñ X 1 is (uniformly) coarsely φ-equivariant in the usual sense. Also, we ♦ : S1 , and f ♦ : S Ñ S1 . note for the reader that fg♦ : S , while fφpgq 2. Tools for studying HHSs We now collect some basic consequences of the axioms that are used repeatedly throughout the paper. However, this section need not all be read in advance. Indeed, the reader should feel free to skip this section on a first reading and return to it later when necessary. Throughout this section, we work in a hierarchically hyperbolic space pX , Sq. 2.1. Handy basic consequences of the axioms. Lemma 2.1 (“Finite dimension”). Let pX , Sq be a hierarchically hyperbolic space of complexity n and let U1 , . . . , Uk P S be pairwise-orthogonal. Then k ď n. Proof. By Definition 1.1.(3), there exists W1 P S, not Ď–maximal, so that U2 , . . . , Uk Ď W1 . Applying Definition 1.1 inductively yields a sequence Wk´1 Ď Wk´2 Ď . . . Ď W1 Ď S of distinct elements, where S is Ď–maximal, so that Ui´1 , . . . , Uk Ď Wi for 1 ď i ď k ´ 1. Hence k ď n by Definition 1.1.(5). l Lemma 2.2. There exists χ so that |S1 | ď χ whenever S1 Ď S does not contain a pair of transverse elements. Proof. Let S1 Ď S be a collection of pairwise non-transverse elements, and let n be large enough that any collection of pairwise orthogonal (resp. pairwise Ď-comparable) elements of S has cardinality at most n; the complexity provides such an n, by Definition 1.1.(5) and Lemma 2.1. By Ramsey’s theorem, there exists N so that if |S1 | ą N then S1 either contains a collection of elements, of cardinality at least n ` 1, that are pairwise orthogonal elements or pairwise Ď-comparable. Hence, |S1 | ď N . l Lemma 2.3 (Consistency for pairs of points). Let x, y P X and V, W P S satisfy V &W and dV px, yq, dW px, yq ą 10E. Then, up to exchanging V and W , we have dV px, ρW V q ď E and V dW py, ρW q ď E. V Proof. Suppose that dV px, ρW V q ą E, which then, by consistency, implies dW px, ρW q ď V E. Then, either dW py, ρW q ď 9E, in which case dW px, yq ď 10E, a contradiction, or dW py, ρVW q ą E, in which case consistency implies that dV py, ρW l V q ď E. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 15 Corollary 2.4. For x, y, V, W as in Lemma 2.3, and any z P X , there exists U P tV, W u such that dU pz, tx, yuq ď 10E. V Proof. By Lemma 2.3, we may assume that dV px, ρW V q, dW py, ρW q ď E. Suppose that dW pz, tx, yuq ą 10E. Then dW pz, ρVW q ą 9E, so that, by consistency, dV pz, ρW V q ď E, whence dV pz, xq ď 2E. l The following is needed for Theorem 3.1 and in the forthcoming [DHS15]. Lemma 2.5 (Passing large projections up the Ď–lattice). For every C ě 0 there exists N with the following property. Let V P S, let x, y P X , and let tSi uN i“1 Ď SV be distinct and satisfy dCSi px, yq ě E. Then there exists S P SV and i so that Si Ĺ S and dCS px, yq ě C. Proof. The proof is by induction on the level k of a Ď-minimal S P SV into which each Si is nested. The base case k “ 1 is empty. Suppose that the statement holds for a given N “ N pkq when the level of S is at most k. Suppose further that |tSi u| ě N pk ` 1q (where N pk ` 1q is a constant much larger than N pkq that will be determined shortly) and there exists a Ď-minimal S P SV of level k ` 1 into which each Si is nested. There are two cases. If dCS px, yq ě C, then we are done. If not, then the large link axiom (Definition 1.1.(6)) yields K “ KpCq and T1 , . . . , TK , each properly nested into S (and hence of level less than k ` 1), so that any given Si is nested into some Tj . In particular, if N pk ` 1q ě KN pkq, there exists a j so that at least N pkq elements of tSi u are nested into Tj . By the induction hypothesis and the finite complexity axiom (Definition 1.1.(5)), we are done. l The next lemma is used in the proof of Proposition 4.12, on which the existence of hierarchy paths (Theorem 4.4) relies. It is used again in Section 7 to construct coarse media. Lemma 2.6 (Centers are consistent). There exists κ with the following property. Let x, y, z P X . Let ~b “ pbW qW PS be so that bW is a point in CW with the property that there exists a geodesic triangle in CW with vertices in πW pxq, πW pyq, πW pzq each of whose sides contains a point within distance δ of bW . Then ~b is κ–consistent. Proof. Recall that for w P tx, y, zu the tuple pπV pwqqV PS is E–consistent. Let U, V P S be transverse. Then, by E–consistency, up to exchanging U and V and substituting z for one U U of x, y, we have dV px, ρU V q, dV py, ρV q ď E, so dV px, yq ď 3E (recall that the diameter of ρV is at most E). Since bV lies at distance δ from the geodesic joining πV pxq, πV pyq, we have dV pbV , ρU V q ď 3E ` δ, whence the lemma holds with κ “ 3E ` δ. Suppose now U Ĺ V . If bV is within distance 10E of ρU V , then we are done. Otherwise, up to permuting x, y, z, any geodesic rπV pxq, πV pyqs is 5E–far from ρU V . By consistency of pπW pxqq, pπW pyqq and bounded geodesic image, we have dU px, yq ď 10E, diamU pρVU pπV pyqqYπU pyqq ď E, and diamU pρVU pbV Y πV pyqqq ď 10E. The first inequality and the definition of bU imply dU pbU , yq ď 20E, and taking into account the other inequalities we get diamU pρVU pbV qYbU q ď 100E. l 2.2. Partially ordering sets of maximal relevant elements of S. In this subsection, we describe a construction used several times in this paper, including: in the proof of realization (Theorem 3.1), in the construction of hierarchy paths (Theorem 4.4), and in the proof of the distance formula (Theorem 4.5). We expect that this construction will have numerous other applications, as is the case with the corresponding partial ordering in the case of the mapping class group, see for example [BKMM12, BM11, CLM12]. ś Fix x P X and a tuple ~b P U PS 2impπU q , where the U –coordinate bU is a set of diameter at most some fixed ξ ě 0. For example, ~b could be the tuple pπU pyqq for some y P X . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 16 In the remainder of this section, we choose κ ě 0 and require that ~b is κ–consistent. (Recall that if ~b is the tuple of projections of a point in X , then ~b is E–consistent.) Definition 2.7 (Relevant). First, fix θ ě 100 maxtκ, Eu. Then U P S is relevant (with respect to x, ~b, θ) if dU px, bU q ą θ. Denote by Relpx, ~b, θq the set of relevant elements. Let Relmax px, ~b, θq be a subset of Relpx, ~b, θq whose elements are pairwise Ď–incomparable (for example, they could all be Ď–maximal in Relpx, ~b, θq, or they could all have the same level). Define a relation ĺ on Relmax px, ~b, θq as follows. Given U, V P Relmax px, ~b, θq, we have U ĺ V if U “ V or if U &V and dU pρVU , bU q ď κ. Figure 1 illustrates U ă V . Figure 1. Heuristic picture of U ă V (for ~b the coordinates of y P X , for concreteness). The idea is that “on the way” from x to y one “first encounters” U and is forced to change the projection from πU pxq to πU pyq „ ρVU . In doing so the projection to V is not affected. Proposition 2.8. The relation ĺ is a partial order. Moreover, either U, V are ĺ–comparable or U KV . Proof. Clearly ĺ is reflexive. Antisymmetry follows from Lemma 2.9. Suppose that U, V are ĺ–incomparable. If U KV , we are done, and we cannot have U Ď V or V Ď U , so suppose U &V . Then, by ĺ–incomparability of U, V , we have dU pρVU , bU q ą κ and dV pρU V , bV q ą ~ κ, contradicting κ–consistency of b. This proves the assertion that transverse elements of Relmax px, ~b, θq are ĺ–comparable. Finally, transitivity follows from Lemma 2.10. l Lemma 2.9. The relation ĺ is antisymmetric. Proof. If U ĺ V and U ‰ V , then dU pbU , ρVU q ď κ, so dU px, ρVU q ą θ ´ κ ě 99κ ą E. Then, U dV px, ρU l V q ď E, by consistency. Thus dV pbV , ρV q ą κ, and so, by definition V ł U . Lemma 2.10. The relation ĺ is transitive. Proof. Suppose that U ĺ V ĺ W . If U “ V or V “ W , then U ĺ W , and by Lemma 2.9, we cannot have U “ W unless U “ V “ W . Hence suppose U &V and dU pρVU , bU q ď κ, while ~ V &W and dV pρW V , bV q ď κ. By the definition of Relmax px, b, θq, we have dT px, bT q ą 100κ for T P tU, V, W u. W V V We first claim that dV pρU V , ρV q ą 10E. Indeed, dU pbU , ρU q ď κ, so dU pρU , xq ě 90κ, U whence dV pρV , xq ď E ď κ by E–consistency of the tuple pπT pxqqT PS . On the other hand, U W dV pρW V , bV q ď κ, so dV pρV , ρV q ą 10E as claimed. Hence, by Lemma 2.11, we have U &W . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 17 Since diampimpπW qq ą 100κ — indeed, dW px, bW q ą 100κ and bW P impπW pX qq — partial V realization (Definition 1.1.(8)) provides a P X satisfying dW pa, tρU W , ρW uq ě 10κ. We thus have dU pa, ρW U q ď E by E–consistency of pπT paqqT PS , and the same is true V with V replacing U . Hence dV pρU V , aq ą E, so consistency implies dU pa, ρU q ď E. Thus W W dU pρVU , ρW U q ď 2E. Thus dU pbU , ρU q ď 2E ` κ ă 10κ, whence dU px, ρU q ą 50κ ą E, so U dW px, ρW q ď E by consistency and the fact that U &W . It follows that dW pbW , ρU Wq ě 100κ ´ E ą κ, so, again by consistency, dU pbU , ρU q ď κ, i.e., U ĺ W . l W Lemma 2.11. Let U, V, W P S satisfy diampimpπU qq, diampimpπV qq, diampimpπW qq ą 10E, W and U &V, W &V , and dV pρU V , ρV q ą 10E. Suppose moreover that U and W are Ď–incomparable. Then U &W . Proof. If U KW , then by the partial realization axiom (Definition 1.1.(8)) and the lower bound on diameters, there exists an E–partial realization point x for tU, W u so that dU pρVU , xq, dW pρVW , xq ą E. W U This contradicts consistency since dV pρU V , ρV q ą 10E; indeed, by consistency dV pρV , xq ď W U W E, dV pρV , xq ď E, i.e., dV pρV , ρV q ď 2E. Hence U &W . l 2.3. Coloring relevant elements. In this subsection, the key result is Lemma 2.14, which we will apply in proving the existence of hierarchy paths in Section 4.3. Fix x, y P X . As above, let Relpx, y, 100Eq consist of those V P S for which dV px, yq ą 100E. Recall that, given U P S, we denote by T`U the set of V P SU such that `U ´`V “ `. In particular, if V, V 1 P T`U and V Ď V 1 , then V “ V 1 . Let Rel`U px, y, 100Eq “ Relpx, y, 100EqX T`U , the set of V Ď U so that dV px, yq ą 100E and `U ´ `V “ `. By Proposition 2.8, the relation ĺ on Rel`U px, y, 100Eq defined as follows is a partial order: 1 V ĺ V 1 if either V “ V 1 or dV py, ρVV q ď E. Definition 2.12 (Relevant graph). Denote by G the graph with vertex-set Rel`U px, y, 100Eq, with two vertices adjacent if and only if the corresponding elements of Rel`U px, y, 100Eq are orthogonal. Let G c denote the complementary graph of G, i.e., the graph with the same vertices and edges corresponding to ĺ–comparability. The next lemma is an immediate consequence of Proposition 2.8: Lemma 2.13. Elements of V, V 1 P Rel`U px, y, 100Eq are adjacent in G if and only if they are ĺ–incomparable. Lemma 2.14 (Coloring relevant elements). Let χ be the maximal cardinality of a set of pairwise orthogonal elements of T`U . Then there exists a χ–coloring of the set of relevant elements of T`U such that non–transverse elements have different colors. Proof. Since each clique in G — i.e., each ĺ–antichain in Rel`U px, y, 100Eq — has cardinality at most χ, Dilworth’s theorem [Dil50, Theorem 1.1] implies that G can be colored with χ colors in such a way that ĺ–incomparable elements have different colors; hence non-transverse elements have different colors. l Remark 2.15. The constant χ provided by Lemma 2.14 is bounded by the complexity of pX , Sq, by Lemma 2.2. 3. Realization of consistent tuples The goal of this section is to prove Theorem 3.1. In this section we will work with a fixed hierarchical space pX , Sq. We will use the concepts of consistency and partial realization points; see Definition 1.16 and Definition 1.17. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 18 Theorem 3.1 (Realization of consistent tuples). For each κ ě 1 there exist θe , θu ě 0 such ś that the following holds. Let ~b P W PS 2CW be κ–consistent; for each W , let bW denote the CW –coordinate of ~b. Then there exists x P X so that dW pbW , πW pxqq ď θe for all CW P S. Moreover, x is coarsely unique in the sense that the set of all x which satisfy dW pbW , πW pxqq ď θe in each CW P S, has diameter at most θu . Proof. The main task is to prove the following claim about a κ–consistent tuple ~b: Claim 1. Let tVj u be a family of pairwise orthogonal elements of S, all of level at most `. Then there exists θe “ θe p`, κq ą 100Eκα and pairwise-orthogonal tUi u so that: (1) each Ui is nested into some Vj , (2) for each Vj there exists some Ui nested into it, and (3) any E–partial realization point x for tUi u satisfies dW pbW , xq ď θe for each W P S for which there exists j with W Ď Vj . Applying Claim 1 when ` “ `S , where S P S is the unique Ď–maximal element, along with the Partial Realization axiom (Definition 1.1.(8)), completes the existence proof, giving us a constant θe . If x, y both have the desired property, then dV px, yq ď 2θe ` κ for all V P S, whence the uniqueness axiom (Definition 1.1.(9)) ensures that dpx, yq ď θu , for an appropriate θu . Hence to prove the theorem it remains to prove Claim 1, which we do now. The claim when ` “ 1 follows from the partial realization axiom (Definition 1.1.8), so we assume that the claim holds for ` ´ 1 ě 1, with θe p` ´ 1, κq “ θe1 , and prove it for level `. Reduction to the case |tVj u| “ 1: It suffices to prove the claim in the case where tVj u has a single element, V . To see this, note that once we prove the claim for each Vj separately, yielding a collection of pairwise-orthogonal sets tUij Ď Vj u with the desired properties, then we take the union of these sets to obtain the claim for the collection tVj u. The case tVj u “ tV u: Fix V P S so that `V “ `. If for each x P X that satisfies dV px, bV q ď E we have dW pbW , xq ď 100Eκα for W P SV , then the claim follows with tUi u “ tV u. Hence, we can suppose that this is not the case. We are ready for the main argument, which is contained in Lemma 3.2 below. We will construct tUi u incrementally, using Lemma 3.2, which essentially says that either we are done at a certain stage or we can add new elements to tUi u. We will say that the collection U of elements of SV is totally orthogonal if any pair of distinct elements of U are orthogonal. Given a totally orthogonal family U we say that W P SV is U–generic if there exists U P U so that W is not orthogonal to U . Notice that no W is H–generic. A totally orthogonal collection U Ď SV is C–good if any E–partial realization point x for U has the property that for each W P SV we have dW px, bW q ď C. (Notice that our goal is to find such U.) A totally orthogonal collection U Ď SV is C–generically good if any E–partial realization point x for U has the property that for each U–generic W P SV we have dW px, bW q ď C (e.g., for U “ H). We can now quickly finish the proof of the claim using Lemma 3.2 about extending generically good sets, which we state and prove below. Start with U “ H. If U is C–good for C “ 100Eκα, then we are done. Otherwise we can apply Lemma 3.2 and get U1 “ U1 as in the lemma. Inductively, if Un is not 10n C–good, we can apply the lemma and extend Un to a new totally orthogonal set Un`1 . Since there is a bound on the cardinality of totally orthogonal sets by Lemma 2.1, in finitely many steps we necessarily get a good totally orthogonal set, and this concludes the proof of the claim, and hence of the theorem. l HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 19 Lemma 3.2. For every C ě 100Eκα the following holds. Let U Ď SV ´ tV u be totally orthogonal and C–generically good but not C–good. Then there exists a totally orthogonal, 10C–generically good collection U1 Ď SV with U Ĺ U1 . Proof. Let x0 be an E–partial realization point for U so that there exists some W Ď V for which dW pbW , x0 q ą C. The idea is to try to “move towards” ~b starting from x0 , by looking at all relevant elements of SV that lie between them and finding out which ones are the “closest” to ~b. Let Vmax be the set of all W Ď V for which: (1) dW pbW , x0 q ą C and (2) W is not properly nested into any element of SV satisfying the above inequality. We now establish two facts about Vmax . Applying Proposition 2.8 to partially order Vmax : For U, U 1 P Vmax , write U ĺ U 1 1 if either U “ U 1 or U &U 1 and dU pρU U , bU q ď 10Eκ; this is a partial order by Proposition 2.8, which also implies that if U, U 1 P Vmax are transverse then they are ĺ-comparable. Hence any two ĺ–maximal elements of Vmax are orthogonal, and we denote by V1max the set of ĺ–maximal (hence pairwise-orthogonal) elements of Vmax . Finiteness of Vmax : We now show that |Vmax | ă 8. By Lemma 2.2 and Ramsey’s theorem, if Vmax was infinite then it would contain an infinite subset of pairwise transverse elements, so, in order to conclude that |Vmax | ă 8, it suffices to bound the cardinality of a pairwise-transverse subset of Vmax . Suppose that W1 ă ¨ ¨ ¨ ă Ws P Vmax are pairwise transverse. By partial realization s (Definition 1.1.(8)) there exists z P X such that dWs pz, bWs q ď α and dWi pρW Wi , zq ď α s ~ for each i ‰ s, and such that dV pz, ρW V q ď α. By consistency of b and bounded geodesic s image, ρW V has to be within distance 10Eκ of a geodesic in CV from x0 to bV . In particular dV px0 , zq ď θe1 ` 100Eκα ` 10Eκ. Also, for each i ‰ s, Ws s dWi px0 , zq ě dWi px0 , bWi q ´ dWi pbWi , ρW Wi q ´ dWi pρWi , zq ě 100Eκα ´ 10Eκ ´ α ě 50Eκα ě 50E. Ws s Indeed, dWi pbWi , ρW Wi q ď 10Eκ since Wi ă Ws , while dWi pρWi , zq ď α by our choice of z. Lemma 2.5 now provides the required bound on s. Choosing U1 : Since `U ă `V for all U P V1max , by induction there exists a totally orthogonal set tUi u so that any E–partial realization point x for tUi u satisfies dT pbT , xq ď θe1 for each T P S nested into some U P V1max . Let U1 “ tUi u Y U. Choose such a partial realization point x and let W Ď V be U1 –generic. Our goal is to bound dW px, bW q, and we will consider 4 cases. If there exists U P U that is not orthogonal to W , then we are done by hypothesis, since any E–partial realization point for U1 is also an E–partial realization point for U. Hence, from now on, assume that W is orthogonal to each U P U, i.e. W is not U–generic. If W Ď U for some U P V1max , then we are done by induction. Suppose that W &U for some U P V1max . For each Ui Ď U — and our induction hypothesis i implies that there is at least one such Ui — we have dW px, ρU W q ď E since x is a partial realization point for tUi u and either Ui Ď W or Ui &W (since W is U1 –generic but not U–generic). The triangle inequality therefore yields: U U i dW px, bW q ď E ` dW pρU W , ρW q ` dW pbW , ρW q. U U i By Definition 1.1.(4), dW pρU W , ρW q ď E, and we will show that dW pbW , ρW q ď 2C, so that dW px, bW q ď 2E ` 2C. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 20 W Suppose, for a contradiction, that dW pbW , ρU W q ą 2C. If dU pρU , x0 q ď E, then dU pρW U , bU q ě C ´ E ą κ, by consistency, whence dW pρU W , bW q ď κ, a contradiction. U On the other hand, if dU pρW U , x0 q ą E, then dW px0 , ρW q ď E by consistency. Hence dW px0 , bW q ě 2C ´ E. Hence there exists a Ď–maximal W 1 ‰ V with the property that W Ď W 1 Ď V and dW 1 px0 , bW q ą C (possibly W 1 “ W ). Such a W 1 is in Vmax by definition. Since W &U , and W 1 and U are Ď–incomparable, W 1 &U . Thus U and W 1 are ĺ– comparable, by Proposition 2.8. Since W 1 ‰ U and U is ĺ–maximal, we have W 1 ĺ U , i.e., W1 dW 1 pbW 1 , ρU W 1 q ď 10Eκ. Since ĺ is antisymmetric, by Lemma 2.9, we have dU pbU , ρU q ą W1 W 10Eκ. Since dU pρW U , ρU q ď E (from Definition 1.1.(4)), we have dU pbU , ρU q ą 10Eκ ´ E ą U κ, since E ě 1, so, by consistency, dW pbW , ρW q ď κ, a contradiction. Finally, suppose U Ĺ W for some U P V1max . In this case, by Ď–maximality of U , we i have dW px0 , bW q ď C. Also, dW px, ρU W q ď E for any Ui Ď U since x is a partial realization Ui U point, so that dW px, ρU W q ď 2E, since dW pρW , ρW q ď E by Definition 1.1.(4). If dW px, bW q ą 2C, then we claim dU px0 , bU q ď 10Eκ, a contradiction. Indeed, any geodesic in CW from πW px0 q to bW does not enter the E–neighborhood of ρU W . By bounded geodesic image, W W diamU pρU pπW px0 qq Y ρU pbW qq ď E and by consistency, diamU pρW U pπW px0 qq Y πU px0 qq ď E and diamU pρW pb qYb q ď κ, and we obtain the desired bound on dU px0 , bU q. This completes W U U the proof of the lemma. l 4. Hierarchy paths and the distance formula Throughout this section, fix a hierarchically hyperbolic space pX , Sq. 4.1. Definition of hierarchy paths and statement of main theorems. Our goal is to deduce the existence of hierarchy paths (Theorem 4.4) from the other axioms and to prove the distance formula (Theorem 4.5). Definition 4.1 (Quasigeodesic, unparameterized quasigeodesic). A pD, Dq–quasigeodesic in the metric space M is a pD, Dq–quasi-isometric embedding f : r0, `s Ñ M ; we allow f to be a coarse map, i.e., to send points in r0, `s to uniformly bounded sets in M . A (coarse) map f : r0, `s Ñ M is a pD, Dq–unparameterized quasigeodesic if there exists a strictly increasing function g : r0, Ls Ñ r0, `s such that f ˝ g : r0, Ls Ñ M is a pD, Dq–quasigeodesic and for each j P r0, Ls X N, we have diamM pf pgpjqq Y f pgpj ` 1qqq ď D. Definition 4.2 (Hierarchy path). For D ě 1, a (not necessarily continuous) path γ : r0, `s Ñ X is a D–hierarchy path if (1) γ is a pD, Dq-quasigeodesic, (2) for each W P S, the path πW ˝ γ is an unparameterized pD, Dq–quasigeodesic. Notation 4.3. Given A, B P R, we denote by ttAuuB the quantity which is A if A ě B and 0 otherwise. Given C, D, we write A —C,D B to mean C ´1 A ´ D ď B ď CA ` D. Theorem 4.4 (Existence of Hierarchy Paths). Let pX , Sq be hierarchically hyperbolic. Then there exists D0 so that any x, y P X are joined by a D0 -hierarchy path. Theorem 4.5 (Distance Formula). Let pX, Sq be hierarchically hyperbolic. Then there exists s0 such that for all s ě s0 there exist constants K, C such that for all x, y P X , ÿ dX px, yq —pK,Cq ttdW px, yquus . W PS HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 21 The proofs of the above two theorems are intertwined, and we give the proof immediately below. This relies on several lemmas, namely Lemma 4.11, proved in Section 4.3, and Lemmas 4.19 and 4.18, proved in Section 4.4. Proof of Theorems 4.5 and 4.4. The lower bound demanded by Theorem 4.5 is given by Lemma 4.19 below. By Lemma 4.11 and Lemma 4.18, there is a monotone path (see Definition 4.8) whose length realizes the upper bound on dX px, yq, and the same holds for any subpath of this path, which is therefore a hierarchy path, proving Theorem 4.4 and completing the proof of Theorem 4.5. l 4.2. Good and proper paths: definitions. We now define various types of (non-continuous) paths in X that will appear on the way to hierarchy paths. Definition 4.6 (Discrete path). A K–discrete path is a map γ : I Ñ X , where I is an interval in Z and dX pγpiq, γpi ` 1qq ď K whenever i, i ` 1 P I. The length |α| of a discrete path α is max I ´ min I. Definition 4.7 (Efficient path). A discrete path α with endpoints x, y is K–efficient if |α| ď KdX px, yq. Definition 4.8 (Monotone path). Given U P S, a K–discrete path α and a constant L, we say that α is L–monotone in U if whenever i ď j we have dU pαp0q, αpiqq ď dU pαp0q, αpjqq`L. A path which is L–monotone in U for all U P S is said to be L–monotone. Definition 4.9 (Good path). A K–discrete path that is L–monotone in U is said to be pK, Lq–good for U . Given S1 Ď S, a path α that is pK, Lq–good for each V P S1 is pK, Lq– good for S1 . Definition 4.10 (Proper path). A discrete path α : t0, . . . , nu Ñ X is pr, Kq–proper if for 0 ď i ă n ´ 1, we have dX pαpiq, αpi ` 1qq P rr, r ` Ks and dX pαpn ´ 1q, αpnqq ď r ` K. Observe that pr, Kq-properness is preserved by passing to subpaths. 4.3. Good and proper paths: existence. Our goal in this subsection is to join points in X with proper paths, i.e., to prove Lemma 4.11. This relies on the much more complicated Proposition 4.12, which produces good paths (which are then easily made proper). Lemma 4.11. There exists K so that for any r ě 0, any x, y P X are joined by a Kmonotone, pr, Kq–proper discrete path. Proof. Let α0 : t0, . . . , n0 u Ñ X be a K–monotone, K–discrete path joining x, y, which exists by Proposition 4.12. We modify α0 to obtain the desired path in the following way. Let j0 “ 0 and, proceeding inductively, let ji be the minimal j ď n such that either dX pα0 pji´1 q, α0 pjqq P rr, r ` Ks or j “ n. Let m be minimal so that jm “ n and define α : t0, . . . , mu Ñ X by αpjq “ α0 pij q. The path α is pr, Kq-proper by construction; it is easily checked that K–monotonicity is not affected by the above modification; the new path is again discrete, although for a larger discreteness constant. l It remains to establish the following proposition, whose proof is postponed until the end of this section, after several preliminary statements have been obtained. Proposition 4.12. There exists K so that any x, y P X are joined by path that is pK, Kq– good for each U P S. Definition 4.13 (Hull of a pair of points). For each x, y P X , θ ě 0, let Hθ px, yq be the set of all p P X so that, for each W P S, the set πW ppq lies at distance at most θ from a geodesic in CW joining πW pxq to πW pyq. Note that x, y P Hθ px, yq. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 22 Remark 4.14. The notion of a hull is generalized in Section 6 to hulls of arbitrary finite sets, but we require only the version for pairs of points in this section. Lemma 4.15 (Retraction onto hulls). There exist θ, K ě 0 such that, for each x, y P X , there exists a pK, Kq–coarsely Lipschitz map r : X Ñ Hθ px, yq that restricts to the identity on Hθ px, yq. Proof. Let κ be the constant from Lemma 2.6, let θe be chosen as in the realization theorem ś (Theorem 3.1), and let p P X ´ Hθe px, yq. Define a tuple ~b “ pbpW q P W PS 2CW so that bpW is on a geodesic in CW from πW pxq to πW pyq and is within distance δ of the other two sides of a triangle with vertices in πW pxq, πW pyq, πW ppq. By the realization theorem (Theorem 3.1), there exists rppq P Hθe px, yq so that dW pπW prppqq, bpW q ď θe . For p P Hθe px, yq, let rppq “ p. To see that r is coarsely Lipschitz, it suffices to bound dX prppq, rpqqq when p, q P X satisfy dX pp, qq ď 1. For such p, q we have dW pbpW , bqW q ď 100E, so that Theorem 3.1 implies dX prppq, rpqqq ď θu p100Eq, as required. l Corollary 4.16. There exist θ, K ě 0 such that, for each x, y P X , there exists a K–discrete and K–efficient path that lies in Hθ px, yq and joins x to y. Proof. We can assume that dX px, yq ě 1. Since X is a quasigeodesic space, there exists C “ CpX q ě 1 and a pC, Cq–quasi-isometric embedding γ : r0, Ls Ñ X with γp0q “ x, γpLq “ y. Let ρ be the path obtained by restricting r ˝ γ : r0, Ls Ñ Hθ px, yq to r0, Ls X N, where r is the retraction obtained in Lemma 4.15. Then dX pρpiq, ρpi ` 1qq ď 10KC since r is pK, Kq– coarsely Lipschitz and γ is pC, Cq–coarsely Lipschitz, i.e., ρ is 10KC–discrete. Finally, ρ is efficient because L ď CdX px, yq ` C ď 2CdX px, yq. l The efficiency part of the corollary is used in Lemma 4.19. 4.3.1. Producing good paths. We will need the following lemma, which is a special case of Proposition 6.4.2. We give a proof in the interest of a self-contained exposition. Lemma 4.17. For any θ0 there exists a constant θ such that for every x, y P X and every x1 , y 1 P Hθ0 px, yq, we have Hθ0 px1 , y 1 q Ď Hθ px, yq. Proof. For any z P Hθ0 px1 , y 1 q and W P S the projection πW pzq lies 2pδ ` θ0 q–close to a geodesic in CW from πW pxq to πW pyq, by a thin quadrilateral argument. l We now prove the main proposition of this subsection. Proof of Proposition 4.12. Recall that, for ` ě 0 and U P S, the set S`U consists of those V P SU with `U ´ `V ď `, and that T`U consists of those V P SU with `U ´ `V “ `. We prove by induction on ` that there exist θ, K such that for any ` ě 0, x, y P X and U P S, there is a path α in Hθ px, yq connecting x to y such that α is pK, Kq–good for S`U . It then follows that for any x, y P X , there exists a path α in Hθ px, yq connecting x to y such that α is pK, Kq–good for S; this latter statement directly implies the proposition. For a, b P X , denote by ra, bsW a geodesic in CW from πW paq to πW pbq. Fix U P S. The case ` “ 0: In this case, S0U “ tU u. By Corollary 4.16, there exists θ0 , K and a K–discrete path α01 : t0, . . . , ku Ñ Hθ0 px, yq joining x to y. Similarly, for each x1 , y 1 P Hθ0 px, yq there exists a K–discrete path β contained in Hθ0 px1 , y 1 q, joining x1 to y 1 , and recall that Hθ0 px1 , y 1 q is contained in Hθ px, yq for a suitable θ in view of Lemma 4.17. We use the term straight path to refer to a path, such as β, which for each V P S projects uniformly close to a geodesic of CpV q. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 23 We now fix U P S, and, using the observation in the last paragraph explain how to modify α01 to obtain a K–discrete path α0 in Hθ px, yq that is K–monotone in U ; the construction will rely on replacing problematic subpaths with straight paths. A point t P t0, . . . , ku is a U –omen if there exists t1 ą t so that dU pα01 p0q, α01 ptqq ą dU pα01 p0q, α01 pt1 qq ` 5KE. If α01 has no U –omens, then we can take α0 “ α01 , so suppose that there is a U –omen and let t0 be the minimal U –omen, and let t10 ą t0 be maximal so that dU pα01 p0q, α01 pt0 qq ą dU pα01 p0q, α01 pt10 qq. Inductively define tj to be the minimal U –omen with tj ě t1j´1 , if such tj exists; and when tj exists, we define t1j to be maximal in t0, . . . , ku satisfying dU pα01 p0q, α01 ptj qq ą dU pα01 p0q, α01 pt1j qq. For each j ě 0, let x1j “ α01 ptj q and let yj1 “ α01 pt1j q. See Figure 2. α01 pt1j q Ðx α01 ptj q yÑ Figure 2. The picture above shows part of α01 in X , and that below shows its projection to U . The point tj is an omen, as witnessed by the point marked with a square. Inserting the dashed path βj , and deleting the corresponding subpath of α01 , makes tj cease to be an omen. For each j, there exists a K–discrete path βj which lies in Hθ0 px1j , yj1 q Ď Hθ px, yq and is a straight path from x1j to yj1 . Let α0 be obtained from α01 by replacing each α01 prtj , t1j sq with βj . Clearly, α0 connects x to y, is K–discrete, and is contained in Hθ px, yq. For each j we have that diamCU pβj q ď dU px1j , yj1 q ` 2θ0 . Notice that dU px1j , yj1 q ă 2KE ` 10θ0 . In fact, since α01 p0q, α01 ptj q, α01 pt1j q lie θ0 -close to a common geodesic and dU pα01 p0q, α01 ptj qq ě dU pα01 p0q, α01 pt1j qq, we would otherwise have dU pα01 p0q, α01 ptj qq ´ dU pα01 p0q, α01 pt1j qq ě dU px1j , yj1 q ´ 5θ0 ě 2KE ` θ0 . However, dU pα01 ptj q, α01 ptj ` 1qq ď 2KE because of K–discreteness and the projection map to CU being E-coarsely Lipschitz. Hence, the inequality above implies dU pα01 p0q, α01 ptj qq ą dU pα01 p0q, α01 pt1j qq ` 2KE ě dU pα01 ptj q, α01 ptj ` 1qq, which contradicts the maximality of t1j . (Notice that t1j ‰ k, and hence t1j ` 1 P t0, . . . , ku because dU pα01 p0q, α01 pt1j qq ` θ0 ă dU pα01 p0q, α01 ptj qq ď dU pα01 p0q, α01 pkqq ` θ0 .) In particular, we get diamCU pβj q ď 2KE ` 12θ0 , and it is then easy to check that α0 is maxt5KE, 2KE ` 12θ0 u–monotone in U . By replacing K with maxt5KE, 2KE ` 12θ0 u, we thus have a K–discrete path α0 Ă Hθ px, yq that joins x, y and is K–monotone in U . We now proceed to the inductive step. Specifically, we fix ` ě 0 and we assume there exist θind , K such that for any x, y P X and U P S, there is a path α in Hθind px, yq connecting x to y such that α is pK, Kq–good for S`U . Let now x, y, U be as above. The coloring: For short, we will say that V P S is A–relevant if dU px, yq ě A, see Definition 2.7. Notice that to prove that a path in Hθ px, yq is monotone, it suffices to restrict our attention to only those W P S which are, say, 10KE–relevant. By Lemma 2.14, there exists χ ě 0, bounded by the complexity of X , and a χ–coloring c of the 10KE–relevant elements of T`U such that cpV q “ cpV 1 q only if V &V 1 . In other words, HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 24 Ůχ´1 ´1 the set of 10KE–relevant elements of T`U has the form i“0 c piq, where c´1 piq is a set of pairwise-transverse relevant elements of T`U . Induction hypothesis: Given p ă χ ´ 1, assume by induction (on ` and p) that there exist θp ě θind , Kp ě K, independent of x, y, U , and a path αp : t0, . . . , ku Ñ Hθp px, yq, Ů joining x, y, that is pK, Kq–good for pi“0 c´1 piq and good for S`´1 U . Resolving backtracks in the next color: Let θp`1 be provided by Lemma 4.17 with input θp . We will modify αp to construct a Kp`1 –discrete path αp`1 in Hθp`1 px, yq, for some Ůp`1 ´1 Kp`1 ě Kp , that joins x, y and is pKp`1 , Kp`1 q–good in i“0 c piq. Notice that we can restrict our attention to the set Cp`1 of 100pKp E`θp q–relevant elements of c´1 pp ` 1q. A point t P t0, . . . , ku is a pp ` 1q–omen if there exists V P Cp`1 and t1 ą t so that dV pαp p0q, αp ptqq ą dV pαp p0q, αp pt1 qq ` 5Kp E. If αp has no pp ` 1q–omens, then we can take αp`1 “ αp , since αp is good in each V with cpV q ă p ` 1. Therefore, suppose that there is a pp ` 1q–omen, let t0 be the minimal pp ` 1q–omen, witnessed by V0 P Cp`1 . We can assume that t0 satisfies dV0 ptx, yu, αp pt0 qq ą 10Kp E. Let t10 ą t0 be maximal so that dV0 pαp p0q, αp pt0 qq ą dV0 pαp p0q, αp pt10 qq. In particular dV0 py, αp pt10 qq ě 10E. Let x10 “ α0 pt0 q and y01 “ α0 pt10 q. Inductively, define tj as the minimal pp ` 1q–omen, witnessed by Vj P Cp`1 , with tj ě t1j´1 , if such tj exists and let t1j be maximal so that dVj pαp p0q, αp ptj qq ą dVj pαp p0q, αp pt1j qq and dVj py, αp pt1j qq ą 100E. We can assume that tj satisfies dVj ptx, yu, αp ptj qq ą 10Kp E. Also, let x1j “ αp ptj q, yj1 “ αp pt1j q. Let βj be a path in Hθp px1j , yj1 q joining x1j to yj1 that is pKp , Kp q–good for each relevant V with cpV q ď p and each relevant V P S`´1 U . Such paths can be constructed by induction. By Lemma 4.17 βj lies in Hθp`1 px, yq. Let αp`1 be obtained from αp by replacing each αp pttj , . . . , t1j uq with βj . Clearly, αp`1 connects x to y, is Kp –discrete, and is contained in Hθp`1 px, yq. We observe that the same argument as in the case ` “ 0 gives dVj px1j , yj1 q ď 2Kp E ` 10θp . Verification that αp`1 is good for current colors: We next check that each βj is Ůp`1 ´1 103 pKp E ` θp q–monotone in each W P i“0 c piq. We have to consider the following cases. (We can and shall assume below W is 100pKp E ` θp q–relevant.) ‚ If W Ď Vj , then W “ Vj , since `W “ `Vj . Since the projections on CW of the endpoints of the straight path βj coarsely coincide, βj is p2Kp E ` 12θp q–monotone in W . (See the case ` “ 0.) ‚ Suppose Vj Ď W , and Vj ‰ W . We claim that the projections of the endpoints of βj lie at a uniformly bounded distance in CW . V We claim that ρWj has to be E–close to either rx, x1j sW or ryj1 , ysW . In fact, if this was not the case, we would have dVj px, yq ď dVj px, x1j q ` dVj px1j , yj1 q ` dVj pyj1 , yq ď 2E ` 2Kp E ` 10θp , where we applied bounded geodesic image (Definition 1.1.(7)) to the first and last terms. This is a contradiction with Vj being 100pKp E ` θp q–relevant. Suppose by contradiction that dW px1j , yj1 q ě 500pKp E ` θp q. Suppose first that V V ρWj is E–close to rx, x1j sW . Then, by monotonicity, ρWj is E–far from rαp pt1j q, ysW . V By bounded geodesic image, this contradicts dVj py, αp pt1j qq ě 10E. If instead ρWj is E–close to ryj1 , ysW , then by bounded geodesic image we have dVj px, αp ptj qq ď E, contradicting that tj is an omen witnessed by Vj . See Figure 3. Hence dW px1j , yj1 q ě 500pKp E ` θp q and βj is 103 pKp E ` θp q–monotone in W . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 25 y α0 pt1j ´ 1q yj1 “ α0 pt1j q V ρWj x1j x CW Figure 3. The situation in CW . ‚ Suppose W &Vj . We again claim that the projections of the endpoints of βj are V uniformly close in CW , by showing that they both coarsely coincide with ρWj . Since W Vj is relevant, either dVj px, ρW Vj q ě E or dVj py, ρVj q ě E. Thus, by consistency, V dW pρWj , tx, yuq ď E. Suppose for a contradiction, that dW px1j , yj1 q ą 100pKp E ` θp q. V V We consider separately the cases where dW px, ρWj q ď E and dW py, ρWj q ď E V V First, suppose that dW px, ρWj q ď E. Then dW py, ρWj q ě 10Kp E ´ E ą E, so by 1 1 consistency, dVj py, ρW Vj q ď E. If dVj px, txj , yj uq ą E, then consistency implies that V V dW px1j , ρWj q ď E and dW pyj1 , ρWj q ď E, whence dW px1j , yj1 q ď 2E, a contradiction. If dVj px, tx1j , yj1 uq ď E, then since dVj px1j , yj1 q ď 2Kp E ` 10θp , we have dVj px, x1j q ď 5Kp E ` 10θp , contradicting that, since tj was a pp ` 1q–omen witnessed by Vj , we must have dVj px, x1j q ą 5Kp E. V Second, suppose dW py, ρWj q ď E. Then by relevance of W and consistency, 1 1 1 dVj px, ρW Vj q ď E. As above, we have dVj pxj , xq ą 5Kp E ` 10θp , so dVj px, txj , yj uq ą Kp E ą 3E (since dVj px1j , yj1 q ď 2Kp E ` 10θp and we may assume Kp ą 3), so 1 1 1 1 dVj pρW Vj , txj , yj uq ą E. Thus, by consistency, πW pxj q, πW pyj q both lie at distance at V most E from ρWj , whence dW px1j , yj1 q ď 3E. ‚ Finally, suppose that W KVj . Then either cpW q ă cpVj q and βj is Kp –monotone in W , or W is irrelevant. Hence, each βj is 103 pKp E ` θp q–monotone in each W P c´1 pt0, . . . , p ` 1uq. Verification that αp`1 is monotone: Suppose that there exist t, t1 such that t ă t1 and dV pαp`1 p0q, αp`1 ptqq ą dV pαp`1 p0q, αp`1 pt1 qq ` 104 pKp E ` θp q for some V P c´1 pt0, . . . , p ` 1uq. We can assume t, t1 R Yi pti , t1i q. Indeed, if t P pti , t1i q (respectively, t1 P ptj , t1j q), then since all βm are 103 pKp E ` θp q–monotone, we can replace t with t1i (respectively, t1 with tj ). After such a replacement, we still have dV pαp`1 p0q, αp`1 ptqq ą dV pαp`1 p0q, αp`1 pt1 qq ` 5Kp E. Let i be maximal so that t1i ď t (or let i “ ´1 if no such t1i exists). By definition of ti`1 , we have ti`1 ď t, and hence ti`1 “ t. But then t1i`1 ą t1 , which is not the case. Conclusion: Continuing the above procedure while p ă χ produces the desired path which is pKχ , Kχ q–good for S`U . In particular, when U “ S is Ď–maximal and ` is the length of a maximal Ď–chain, the proposition follows. l HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 26 4.4. Upper and lower distance bounds. We now state and prove the remaining lemmas needed to complete the proof of Theorem 4.5 and 4.4. Lemma 4.18 (Upper bound). For every K, s there exists r with the following property. Let α : t0, . . . , nu Ñ X be a K-monotone, pr, Kq-proper discrete path connecting x to y. Then ÿ |α| ´ 1 ď ttdW px, yquus . W PS Proof. Let r “ rpK, E, sq be large enough that, for any a, b P X , if dX pa, bq ě r, then there exists W P S so that dW pa, bq ě 100KEs. This r is provided by Definition 1.1.(9). For 0 ď j ď n ´ 1, choose Vj P S so that dVj pαpjq, αpj ` 1qq ě 100KEs. By monotonicity of α in Vj , for any j 1 ą j we have dVj pαp0q, αpj 1 qq ě dVj pαp0q, αpjqq ` 50KEs. ř It follows by induction on j ď n that W PS ttdW pαp0q, αpjqquus ě mintj, n ´ 1u. l Lemma 4.19 (Lower bound). There exists s0 such that for all s ě s0 , there exists C with the following property. 1 ÿ ttdW px, yquus . dX px, yq ě C W PS Proof. From Corollary 4.16, we obtain a K–discrete path α : t0, nu Ñ X joining x, y and having the property that the (coarse) path πV ˝ α : t0, . . . , nu Ñ CV lies in the K–neighborhood of a geodesic from πV pxq to πV pyq. Moreover, α is K–efficient, by the same corollary. Fix s0 ě 103 KE. A checkpoint for x, y in V P S is a ball Q in CV so that πV ˝ α intersects Q and dV ptx, yu, Qq ě 10KE ` 1. Note that any ball of radius 10KE centered on a geodesic from πV pxq to πV pyq is a checkpoint for x, y in V , provided Q it isUsufficiently far from tx, yu. px,yq 3 For each V P Relpx, y, 10 KEq, choose a set CV of dV 10 checkpoints for x, y in V , subject to the requirement that dV pC1 , C2 q ě 10KE for all distinct C1 , C2 P CV . For each V P Relpx, y, 103 KEq, we have 10|CV | ě dV px, yq, so ÿ |CV | ě V PS 1 ÿ ttdW px, yquus0 . 10 W PS Each j P t0, . . . , nu is a door if there exists V P Relpx, y, 103 KEq and C P CV such that πV pαpjqq P C but πV pαpj ´ 1qq R C. The multiplicity of a door j is the cardinality of the set Mpjq of V P Relpx, y, 103 KEq for which there exists C P CV with πV pαpjqq P C and πV pαpj ´ 1qq R C. Since CV is a set of pairwise-disjoint checkpoints, j is a door for at most one element of CV , for each V . Hence the multiplicity of j is precisely the total number of checkpoints in YV PRelpx,y,103 KEq CV for which j is a door. We claim that the set Mpjq does not contain a pair of transverse elements. Indeed, suppose that U, V P Mpjq, satisfy U &V . Let QV P CV , QU P CU be the checkpoints containing πV pαpjqq, πU pαpjqq respectively, so that dU pαpjq, tx, yuq, dV pαpjq, tx, yuq ě 10KE `1 ą 10E, contradicting Corollary 2.4. Lemma 2.2řthus gives |MV | ď χ. Now, |α| is at least the number of doors in t0, . . . , nu, whence |α| ě χ1 V PS |CV |. Since α is K–efficient, we obtain dX px, yq ě For s ě s0 , ř W PS ttdW px, yquus ď ř ÿ 1 ttdW px, yquus0 . 10χK W PS W PS ttdW px, yquus0 , so the claim follows. l HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 27 5. Hierarchical quasiconvexity and gates We now introduce the notion of hierarchical quasiconvexity, which is essential for the discussion of product regions, the combination theorem of Section 8, and in the forthcoming [DHS15]. Definition 5.1 (Hierarchical quasiconvexity). Let pX , Sq be a hierarchically hyperbolic space. Then Y Ď X is k–hierarchically quasiconvex, for some k : r0, 8q Ñ r0, 8q, if the following hold: (1) For all U P S, the projection πU pYq is a kp0q–quasiconvex subspace of the δ– hyperbolic space CU . ś (2) For all κ ě 0 and κ-consistent tuples ~b P U PS 2CU with bU Ď πU pYq for all U P S, each point x P X for which dU pπU pxq, bU q ď θe pκq (where θe pκq is as in Theorem 3.1) satisfies dpx, Yq ď kpκq. Remark 5.2. Note that condition (2) in the above definition is equivalent to: For every κ ą 0 and every point x P X satisfying dU pπU pxq, πU pYqq ď κ for all U P S, has the property that dpx, Yq ď kpκq. The following lemma and its corollary allow us to check the second condition of hierarchical quasiconvexity for one value of κ only, which is convenient. Lemma 5.3. For each Q there exists κ so that the following holds. Let Y Ď X be such that πV pYq is Q–quasiconvex for each V P S. Let x P X and, for each V P S, let pV satisfy dV px, pV q ď dV px, Yq ` 1. Then ppV q is κ–consistent. Proof. For each V , choose yV P Y so that πV pyV q “ pV . Suppose that V &W or V Ď W . By Lemma 2.6 and Theorem 3.1, there exists z P X so that for all U P S, the projection πU pzq lies C–close to each of the geodesics rπU pxq, πU pyV qs, rπU pxq, πU pyW qs, and rπU pyW q, πU pyV qs, where C depends on X . Hence dV ppV , zq and dW ppW , zq are uniformly bounded, by quasiconvexity of πV pYq and πW pYq. Suppose that V &W . Since the tuple pπU pzqq is consistent, either yV lies uniformly close in CV to ρW V , or the same holds with V and W interchanged, as required. Suppose that V Ď W . Suppose that dW ppW , ρVW q is sufficiently large, so that we have to bound diamV pρW V ppW q Y pV q. Since dW pz, pW q is uniformly bounded, dW pz, ρVW q is sufficiently large that consistency ensures that diamV pρW V pπW pzqq Y πV pzqq is uniformly bounded. Since any geodesic from pW W to z lies far from ρVW , the sets ρW V pπW pzqq and ρV ppV q coarsely coincide. Since πV pzq coarsely coincides with pV by construction of z, we have the required bound. Hence the tuple with V –coordinate pV is κ–consistent for uniform κ. l Definition 5.4 (Gate). A coarsely Lipschitz map gY : X Ñ Y is called a gate map if for each x P X it satisfies: gY pxq is a point y P Y such that for all V P S, the set πV pyq (uniformly) coarsely coincides with the projection of πV pxq to the kp0q–quasiconvex set πV pYq. The point gpxq is called the gate of x in Y. The uniqueness axiom implies that when such a map exists it is coarsely well-defined. We first establish that, as should be the case for a (quasi)convexity property, one can coarsely project to hierarchically quasiconvex subspaces. The next lemma shows that gates exist for k–hierarchically quasiconvex subsets. Lemma 5.5 (Existence of coarse gates). If Y Ď X is k–hierarchically quasiconvex and nonempty, then there exists a gate map for Y, i.e., for each x P X there exists y P Y such that for all V P S, the set πV pyq (uniformly) coarsely coincides with the projection of πV pxq to the kp0q–quasiconvex set πV pYq. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 28 Proof. For each V P S, let pV satisfy dV px, pV q ď dV px, Yq ` 1. Then ppV q is κ–consistent for some κ independent of x by Lemma 5.3. Theorem 3.1 and the definition of hierarchical quasiconvexity combine to supply y 1 P Nkpκq pYq with the desired projections to all V P S; this point lies at distance kpκq from some y P Y with the desired property. We now check that this map is coarsely Lipschitz. Let x0 , xn P X be joined by a uniform quasigeodesic γ. By sampling γ, we obtain a discrete path γ 1 : t0, . . . , nu Ñ X such that dX pγ 1 piq, γ 1 pi ` 1qq ď K for 0 ď i ď n ´ 1, where K depends only on X , and such that řn´1 dX pgY pγ 1 piqq, gY pγ 1 pi`1qqq, γ 1 p0q “ x0 , γ 1 pnq “ xn . Observe that dX pgY px0 q, gY pxn qq ď i“0 1 so it suffices to exhibit C such that dX pgY pxq, gY px qq ď C whenever dX px, x1 q ď K. But if dX px, x1 q ď K, then each dU px, x1 q ď K 1 for some uniform K 1 , by Definition 1.1.(1), whence the claim follows from the fact that each CU Ñ πU pYq is coarsely Lipschitz (with constant depending only on δ and kp0q) along with the uniqueness axiom (Definition 1.1.(9)). l 5.1. Hierarchically quasiconvex subspaces are hierarchically hyperbolic. Proposition 5.6. Let Y Ď X be a hierarchically k-quasiconvex subset of the hierarchically hyperbolic space pX , Sq. Then pY, dq is a hierarchically hyperbolic space, where d is the metric inherited from X . Proof. There exists K so that any two points in Y are joined by a uniform quasigeodesic. Indeed, any two points in Y are joined by a hierarchy path in X , which must lie uniformly close to Y. We now define a hierarchically hyperbolic structure. For each U , let rU : CU Ñ πU pYq be the coarse projection, which exists by quasiconvexity. The index set is S, and the associated hyperbolic spaces are the various CU . For each U , define a projection πU1 : ÑCU by πU1 “ rU ˝ πU , and for each non-orthogonal pair U, V P S, the corresponding relative projection CU Ñ CV is given by rV ˝ ρU V . All of the requirements of Definition 1.1 involving only the various relations on S are obviously satisfied, since we have only modified the projections. The consistency inqualities continue to hold since each rU is uniformly coarsely Lipschitz. The same is true for bounded geodesic image and the large link lemma. Partial realization holds by applying the map gY to points constructed using partial realization in pX , Sq. l Remark 5.7 (Alternative hierarchically hyperbolic structures). In the above proof, one can replace each CU by a thickening CUY of πU pYq (this set is quasiconvex; the thickening is to make a hyperbolic geodesic space). This yields a hierarchically hyperbolic structure with coarsely surjective projections. 5.2. Standard product regions. In this section, we describe a class of hierarchically quasiconvex subspaces called standard product regions that will be useful in future applications. We first recall a construction from [BHS14, Section 13]. Definition 5.8 (Nested partial tuple). ś Recall SU “ tV P S : V Ď U u. Fix κ ě κ0 and let FU be the set of κ–consistent tuples in V PSU 2CV . Definition 5.9 (Orthogonal partial tuple). Let SK U “ tV P S : V KU u Y tAu, where A is a Ď–minimal element W ś such that V Ď W for all V KU . Fix κ ě κ0 , let EU be the set of κ–consistent tuples in V PSK ´tAu 2CV . U Construction 5.10 (Product regions in X ). Given X and U P S, there are coarsely welldefined maps φĎ , φK : FU , EU Ñ X whose images are hierarchically quasiconvex and which extend to a coarsely well-defined map φU : FU ˆ EU Ñ X with hierarchically quasiconvex image. Indeed, for each p~a, ~bq P FU ˆ EU , and each V P S, define the co-ordinate pφU p~a, ~bqqV HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 29 as follows. If V Ď U , then pφU p~a, ~bqqV “ aV . If V KU , then pφU p~a, ~bqqV “ bV . If V &U , then pφU p~a, ~bqqV “ ρU a, ~bqqV “ ρU V . Finally, if U Ď V , and U ‰ V , let pφU p~ V. ~ We now verify that the tuple φU p~a, bq is consistent. If W, V P S, and either V or W is transverse to U , then the consistency inequality involving W and V is satisfied in view of Proposition 1.7. The same holds if U Ď W or U Ď V . Hence, it remains to consider the cases where V and W are each either nested into or orthogonal to U : if V, W Ď U or V, W KU then consistency holds by assumption; otherwise, up to reversing the roles of V and W we have V Ď U and W KU , in which case V KW and there is nothing to check. Theorem 3.1 thus supplies the map φU , and the maps φĎ and φK come from restricting to the appropriate factor. Where it will not introduce confusion, we abuse notation and regard FU , EU as subspaces of X , i.e., FU “ im φĎ , EU “ im φK . Proposition 5.11. When EU , FU are endowed with the subspace metric d, the spaces pFU , SU q and pEU , SK U q are hierarchically hyperbolic; if U is not Ď–maximal, then their complexity is strictly less than that of pX , Sq. Moreover, φĎ and φK determine hieromorphisms pFU , SU q, pEU , SK U q Ñ pX , Sq. Proof. For each V Ď U or V KU , the associated hyperbolic space CV is exactly the one used in the hierarchically hyperbolic structure pX , Sq. For A, use an appropriate thickening C ˚ A of πA pim φK q to a hyperbolic geodesic space. All of the projections FU Ñ CV, V P SU and K ˚ EU Ñ CV, V P SK U are as in pX , Sq (for A, compose with a quasi-isometry πA pim φ q Ñ C A). K Observe that pFU , SU q and pEU , SU q are hierarchically hyperbolic (this can be seen using a simple version of the proof of Proposition 5.6). If U is not Ď–maximal in S, then neither is A, whence the claim about complexity. K The hieromorphisms are defined by the inclusions SU , SK U Ñ S and, for each V P SU YSU , ˚ K the identity CV Ñ CV , unless V “ A, in which case we use C A Ñ πA pim φ q ãÑ CA. These give hieromorphisms by definition. l & Remark 5.12 (Dependence on A). Note that A need not be the unique Ď–minimal element of S into which each V KU is nested. Observe that EU (as a set and as a subspace of X ) is defined independently of the choice of A. It is the hierarchically hyperbolic structure from Proposition 5.11 that a priori depends on A. However, note that A ­Ď U , since there exists V Ď A with V KU , and we cannot have V Ď U and V KU simultaneously. Likewise, A U by definition. Finally, if U Ď A, then the axioms guarantee the existence of B, properly nested into A, into which each V KU is nested, contradicting Ď–minimality of A. Hence U &A. It follows that πA pEU q is bounded — it coarsely coincides with ρU A . Thus the hierarchically hyperbolic structure on EU , and the hieromorphism structure of φK , is actually essentially canonical: we can take the hyperbolic space associated to the Ď–maximal element to be a point, whose image in each of the possible choices of A must coarsely coincide with ρU A. Remark 5.13 (Orthogonality and product regions). If U KV , then we have FU Ď EV and FV Ď EU , so there is a hierarchically quasiconvex map φU ˆ φV : FU ˆ FV Ñ X extending K to φU ˆ φK U and φV ˆ φV . Remark 5.14. Since FU , EU are hierarchically quasiconvex spaces, Definition 5.4 provides coarse gates gFU : X Ñ FU and gEU : X Ñ EU . These are coarsely the same as the following maps: given x P X , let ~x be the tuple defined by xW “ πW pxq when W Ď U and xW “ πW pxq when W KU and ρU x is consistent and coarsely equals gFU ˆEU pxq. W otherwise. Then ~ Definition 5.15 (Standard product region). For each U P S, let PU “ im φU , which is coarsely FU ˆ EU . We call this the standard product region in X associated to U . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 30 & The next proposition follows from the definition of the product regions and the fact that, V if U Ď V , then ρU W , which holds W , ρW coarsely coincide whenever V Ď W or V &W and U by Definition 1.1.(4). Proposition 5.16 (Parallel copies). There exists ν ě 0 such that for all U P S, all V P SU , and all u P EU , there exists v P EV so that φV pFV ˆ tvuq Ď Nν pφU pFU ˆ tuuqq. 5.2.1. Hierarchy paths and product regions. Recall that a D–hierarchy path γ in X is a pD, Dq–quasigeodesic γ : I Ñ X such that πU ˝γ is an unparameterized pD, Dq–quasigeodesic for each U P S, and that Theorem 4.4 provides D ě 1 so that any two points in X are joined by a D–hierarchy path. In this section, we describe how hierarchy paths interact with standard product regions. Given x, y P X , declare V P S to be relevant if dV px, yq ě 200DE. Proposition 5.17 (“Active” subpaths). There exists ν ě 0 so that for all x, y P X , all V P S with V relevant for px, yq, and all D–hierarchy paths γ joining x to y, there is a subpath α of γ with the following properties: (1) α Ă Nν pPV q; (2) πU |γ is coarsely constant on γ ´ α for all U P SV Y SK V. Proof. We may assume γ : t0, nu Ñ X is a 2D–discrete path. Let xi “ γpiq for 0 ď i ď n. First consider the case where V is Ď–maximal among relevant elements of S. Lemma 5.18 provides ν 2 ě 0, independent of x, y, and also provides i ď n, such that dS pxi , ρVS q ď ν 2 . Let i be minimal with this property and let i1 be maximal with this property. Observe that there exists ν 1 ě ν 2 , depending only on ν 2 and the (uniform) monotonicity of γ in CS, such that dS pxj , ρVS q ď ν 1 for i ď j ď i1 . For j P ti, . . . , i1 u, let x1j “ gPV pxj q. Let U P S. By definition, if U Ď V or U KV , then πU pxj q coarsely coincides with πU px1j q, while πU px1j q coarsely coincides with ρVU if V Ď U or V &U . We claim that there exist i1 , i11 with i ď i1 ď i11 ď i1 such that for i1 ď i ď i11 and U P S with V Ď U or U &V , the points πU pxj q and πU px1j q coarsely coincide; this amounts to claiming that πU pxj q coarsely coincides with ρVU . If V Ď U and some geodesic σ in CU from πU pxq to πU pyq fails to pass through the Eneighborhood of ρVU , then bounded geodesic image shows that ρU V pσq has diameter at most E. On the other hand, consistency shows that the endpoints of ρU V pσq coarsely coincide with πV pxq and πV pyq, contradicting that V is relevant. Thus σ passes through the E– neighborhood of ρVU . Maximality of V implies that U is not relevant, so that πV pxq, πV pyq, and πV pxj q all coarsely coincide, whence πV pxj q coarsely coincides with ρVU . If U &V and U is not relevant, then πU pxj q coarsely coincides with both πU pxq and πU pyq, each of which coarsely coincides with ρVU , for otherwise we would have dV px, yq ď 2E by consistency and the triangle inequality, contradicting that V is relevant. If U &V and U is relevant, then, by consistency, we can assume that πU pyq,ρVU coarsely coincide, as do V πV pxq,ρU V . Either πU pxj q coarsely equals ρU , or πV pxj q coarsely equals πV pxq, again by consistency. If dV px, xj q ď 10E or dV py, xj q ď 10E, discard xj . Our discreteness assumption and the fact that V is relevant imply that there exist i1 ď i11 between i and i1 so that xj is not discarded for i1 ď j ď i11 . For such j, the distance formula now implies that dpxj , x1j q is bounded by a constant ν independent of x, y. We thus have i1 , i11 such that xj P Nν pPV q for i ď j ď i1 and xj R Nν pPV q for j ă i or j ą i1 , provided V is Ď–maximal relevant. If W Ď V and W is relevant, and there is no relevant W 1 ‰ W with W Ď W 1 Ď V , then we may apply the above argument to γ 1 “ gPV pγ|i,...,i1 q to produce a subpath of γ 1 lying ν–close to PW Ď PV , and hence a subpath of γ lying 2ν–close to PW . Finiteness of the complexity (Definition 1.1.(5)) then yields assertion (1). Assertion (2) is immediate from our choice of i1 , i11 . l HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 31 Lemma 5.18. There exists ν 1 ě 0 so that for all x, y P X , all relevant V P S, and all D–hierarchy paths γ joining x to y, there exists t P γ so that dS pt, ρVS q ď ν 1 . Proof. Let σ be a geodesic in CS joining the endpoints of πS ˝ γ. Since dV px, yq ě 200DE, the consistency and bounded geodesic image axioms (Definition 1.1.(4),(7)) imply that σ enters the E–neighborhood of ρVS in CS, whence πS ˝ σ comes uniformly close to ρVS . l 6. Hulls In this section we build “convex hulls” in hierarchically hyperbolic spaces. This construction is motivated by, and generalizes, the concept in the mapping class group called Σ–hull, as defined by Behrstock–Kleiner–Minsky–Mosher [BKMM12]. Recall that given a set A of points in a δ–hyperbolic space H, its convex hull, denoted hullH pAq, is the union of geodesics between pairs of points in this set. We will make use of the fact that the convex hull is 2δ–quasiconvex (since, if p P rx, ys, q P rx1 , y 1 s, then rp, qs Ď N2δ prp, xs Y rx, x1 s Y rx1 , qsq Ď N2δ pry, xs Y rx, x1 s Y rx1 , y 1 sq). The construction of hulls is based on Proposition 6.3, which generalizes Lemma 4.15; indeed, the construction of hulls in this section generalizes the hulls of pairs of points used in Section 4 to prove the distance formula. The second part of Proposition 6.3 (which is not used in Section 4) relies on the distance formula. Definition 6.1 (Hull of a set). For each set A Ă X and θ ě 0, let Hθ pAq be the set of all p P X so that, for each W P S, the set πW ppq lies at distance at most θ from hullCW pAq. Note that A Ă Hθ pAq. Lemma 6.2. There exists θ0 so that for each θ ě θ0 there exists k : R` Ñ R` and each A Ď X , we have that Hθ pAq is k–hierarchically quasiconvex. Proof. For any θ and U P S, due to δ–hyperbolicity we have that πU pHθ pAqq is 2δ–quasiconvex, so we only have to check the condition on realization points. Let A1 be the union of all D0 –hierarchy paths joining points in A, where D0 is the constant from Theorem 4.4. Then the Hausdorff distance between πU pA1 q and πU pAq is bounded by C “ Cpδ, D0 q for each U P S. Also, πU pA1 q is Q “ Qpδ, D0 q–quasiconvex. Let κ be the constant from Lemma 5.3, and let θ0 “ θe pκq be as in Theorem 3.1. Fix any θ ě θ0 , and any κ ě 0. Let pbU q be a κ1 –consistent tuple with bU Ď Nθ phullCU pAqq for each U P S. Let x P X project θe pκ1 q–close to each bU . We have to find y P Hθ pAq uniformly close to x. By Lemma 5.3, ppU q is κ–consistent, where pU P hullCW pAq satisfies dU px, pU q ď dU px, hullCW pAqq ` 1. It is readily seen from the uniqueness axiom (Definition 1.1.9) that any y P X projecting close to each pU has the required property, and such a y exists by Theorem 3.1. l We denote the Hausdorff distance in the metric space Y by dHaus,Y p¨, ¨q. The next proposition directly generalizes [BKMM12, Proposition 5.2] from mapping class groups to general hierarchically hyperbolic spaces. Proposition 6.3 (Retraction onto hulls). For each sufficiently large θ there exists C ě 1 so that for each set A Ă X there is a pK, Kq–coarsely Lipschitz map r : X Ñ Hθ pAq restricting to the identity on Hθ pAq. Moreover, if A1 Ă X also has cardinality at most N , then dX prA pxq, rA1 pxqq is C–coarsely Lipschitz in dHaus,X pA, A1 q. Proof. By Lemma 6.2, for all sufficiently large θ, Hθ pAq is hierarchically quasiconvex. Thus, by Lemma 5.5 there exists a map r : X Ñ Hθ pAq, which is coarsely Lipschitz and which is the identity on Hθ pAq. We now prove the moreover clause. By Definition 1.1.(1), for each W the projections πW are each coarsely Lipschitz and thus dHaus,CW pπW pAq, πW pA1 qq is bounded by a coarsely HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 32 Lipschitz function of dHaus,X pA, A1 q. It is then easy to conclude using the distance formula (Theorem 4.5) and the construction of gates (Definition 5.4) used to produce the map r. l 6.1. Homology of asymptotic cones. In this subsection we make a digression to study homological properties of asymptotic cones of hierarchically hyperbolic spaces. This subsection is not needed for the proof of distance formula, and in fact we will use the distance formula in a proof. Using Proposition 6.3, the identical proof as used in [BKMM12, Lemma 5.4] for mapping class groups, yields: Proposition 6.4. There exists θ0 ě 0 depending only on the constants of the hierarchically hyperbolic space pX , Sq such that for all θ, θ1 ě θ0 there exist K, C, and θ2 such that given two sets A, A1 Ă X , then: (1) diampHθ pAqq ď K diampAq ` C (2) If A1 Ă Hθ pAq then Hθ pA1 q Ă Hθ2 pAq. (3) dHaus,X pHθ pAq, Hθ pA1 qq ď KdHaus,X pA, A1 q ` C. (4) dHaus,X pHθ pAq, Hθ1 pAqq ď C Remark 6.5. Proposition 6.4 is slightly stronger than the corresponding [BKMM12, Lemma 5.4], in which A, A1 are finite sets and the constants depend on their cardinality. The source of the strengthening is just the observation that hulls in δ–hyperbolic spaces are 2δ–quasiconvex regardless of the cardinality of the set (cf. [BKMM12, Lemma 5.1]). It is an easy observation that given a sequence A of sets An Ă X with bounded cardinality, the retractions to the corresponding hulls Hθ pAn q converge in any asymptotic cone, Xω , to a Lipschitz retraction from that asymptotic cone to the ultralimit of the hulls, HpAq. A general argument, see e.g., [BKMM12, Lemma 6.2] implies that the ultralimit of the hulls is then contractible. The proofs in [BKMM12, Section 6] then apply in the present context using the above Proposition, with the only change needed that the reference to the rank theorem for hierarchically hyperbolic spaces as proven in [BHS14, Theorem J] must replace the application of [BM08]. In particular, this yields the following two results: Corollary 6.6. Let X be a hierarchically hyperbolic space and Xω one of its asymptotic cones. Let X Ă Xω be an open subset and suppose that for any sequence, A, of finite subsets of X we have HpAq Ă X. Then X is acyclic. Corollary 6.7. If pU, V q is an open pair in Xω , then Hk pU, V q “ t0u for all k greater than the complexity of X . 6.2. Relatively hierarchically hyperbolic spaces and the distance formula. In this section, we work in the following context: Definition 6.8 (Relatively hierarchically hyperbolic spaces). The hierarchical space pX , Sq is relatively hierarchically hyperbolic if there exists δ such that for all U P S, either U is Ď–minimal or CU is δ–hyperbolic. Our goal is to prove the following two theorems, which provide hierarchy paths and a distance formula in relatively hierarchically hyperbolic spaces. We will not use these theorems in the remainder of this paper, but they are required for future applications. Theorem 6.9 (Distance formula for relatively hierarchically hyperbolic spaces). Let pX , Sq be a relatively hierarchically hyperbolic space. Then there exists s0 such that for all s ě s0 , there exist constants C, K such that for all x, y P X , ÿ ttdU px, yquus . dX px, yq —K,C U PS HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 33 Proof. By Proposition 6.14 below, for some suitably-chosen θ ě 0 and each x, y P X , there exists a subspace Mθ px, yq of X (endowed with the induced metric) so that pMθ px, yq, Sq is a hierarchically hyperbolic space (with the same nesting relations and projections from pX , Sq, so that for all U P S, we have that πU pMθ px, yqq Ă Nθ pγU q, where γU is an arbitrarilychosen geodesic in CU from πU pxq to πU pyq. We emphasize that all of the constants from Definition 1.1 (for Mθ px, yq) are independent of x, y. The theorem now follows by applying the distance formula for hierarchically hyperbolic spaces (Theorem 4.5) to pMθ px, yq, Sq. l Theorem 6.10 (Hierarchy paths in relatively hierarchically hyperbolic spaces). Let pX , Sq be a relatively hierarchically hyperbolic space. Then there exists D ě 0 such that for all x, y P X , there exists a pD, Dq–quasigeodesic γ in X joining x, y so that πU pγq is an unparameterized pD, Dq–quasigeodesic. Proof. Proceed exactly as in Theorem 6.9, but apply Theorem 4.4 instead of Theorem 4.5. l We now define hulls of pairs of points in the relatively hierarchically hyperbolic space pX , Sq. Let θ be a constant to be chosen (it will be the output of the realization theorem for a consistency constant depending on the constants associated to pX , Sq), and let x, y P X . For each U P S, fix a geodesic γU in CU joining πU pxq to πU pyq. Define maps rU : CU Ñ γU as follows: if CU is hyperbolic, let rU be the coarse closest-point projection map. Otherwise, if CU is not hyperbolic (so U is Ď–minimal), define rU as follows: parametrize γU by arc length with γU p0q “ x, and for each p P CU , let mppq “ mintdU px, pq, dU px, yqu. Then rU ppq “ γU pmppqq. This rU is easily seen to be an L–coarsely Lipschitz retraction, with L independent of U and x, y. (When U is minimal, rU is 1–Lipschitz.) Next, define the hull Mθ px, yq to be the set of points x P X such that dU px, γU q ď θ for all U P S. In the next proposition, we show that Mθ px, yq is a hierarchically hyperbolic space, with the following hierarchically hyperbolic structure: (1) the index set is S; (2) the nesting, orthogonality, and transversality relations on S are the same as in pX , Sq; (3) for each U P S, the associated hyperbolic space is γU ; (4) for each U P S, the projection πU1 : Mθ px, yq Ñ γU is given by πU1 “ rU ˝ πU ; (5) for each pair U, V P S of distinct non-orthogonal elements, the relative projection CU Ñ CV is given by rV ˝ ρU V. Since there are now two sets of projections (those defined in the original hierarchical space pX , Sq, denoted π˚ , and the new projections π˚1 ), in the following proofs we will explicitly write all projections when writing distances in the various CU . Lemma 6.11 (Gates in hulls). Let Mθ px, yq be as above. Then there exists a uniformly coarsely Lipschitz retraction r : X Ñ Mθ px, yq such that for each U P S, we have, up to uniformly (independent of x, y) bounded error, πU ˝ r “ rU ˝ πU . Remark 6.12. It is crucial in the following proof that CU is δ–hyperbolic for each U P S that is not Ď–minimal. Proof of śLemma 6.11. Let z P X and, for each U , let tU “ rU ˝ πU pzq; this defines a tuple ptU q P U PS 2CU which we will check is κ–consistent for κ independent of x, y. Realization (Theorem 3.1) then yields m P X such that dU pπU pmq, tU q ď θ for all U P S. By definition, tU P γU , so m P Mθ px, yq and we define gx,y pzq “ m. Note that up to perturbing slightly, we may take gx,y pzq “ z when z P Mθ . Hence it suffices to check consistency of ptU q. First let U, V P S satisfy U &V . Then dV pπV pxq, πV pyqq ď 2E (up to exchanging U and V ), and moreover each of πU pxq, πU pyq is E–close to ρU V . Since tV lies on γV , it follows that U dV ptV , ρV q ď 2E. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 34 Next, let U, V P S satisfy U Ĺ V . Observe that in this case, CV is δ–hyperbolic because V is not Ď–minimal. First suppose that dV pγV , ρU V q ą 1. Then by consistency and bounded geodesic image, dU px, yq ď 3E, and diamU pρVU pγV qq ď E. It follows that diamU ptU Y ρU V ptV qq ď 10E. U Hence, suppose that dV pρU V , γV q ď 10E but that dV ptV , ρV q ą E. Without loss of gener1 ality, ρU V lies at distance ď E from the subpath of γV joining tV to πV pyq. Let γV be the subpath joining x to tV . By consistency, bounded geodesic image, and the fact that CV is δ–hyperbolic and tV “ rV ˝ πV pzq, the geodesic triangle between πV pxq, πV pzq, and tV projects under ρVU to a set, of diameter bounded by some uniform ξ, containing πU pxq, πU pzq, and ρVU ptV q. Hence, since tU “ rU ˝ πU pzq, and πU pxq P γU , the triangle inequality yields a uniform bound on diamU ptU Y ρVU ptV qq. Hence there exists a uniform κ, independent of x, y, so that ptU q is κ–consistent. Finally, gx,y is coarsely Lipschitz by the uniqueness axiom (Definition 1.1.(9)), since each rU is uniformly coarsely Lipschitz. l Lemma 6.13. Let m, m1 P Mθ px, yq. Then there exists C ě 0 such that m, m1 are joined by a pC, Cq–quasigeodesic in Mθ px, yq. Proof. Since X is a quasigeodesic space, there exists K ě 0 so that m, m1 are joined by a K–discrete pK, Kq–quasigeodesic σ : r0, `s Ñ X with σp0q “ m, σp`q “ m1 . Note that gx,y ˝ σ is a K 1 –discrete, efficient path for K 1 indepdent of x, y, since the gate map is uniformly coarsely Lipschitz. A minimal-length K 1 –discrete efficient path in Mθ px, yq from x to y has the property that each subpath is K 1 –efficient, and is a uniform quasigeodesic, as needed. l Proposition 6.14. For all sufficiently large θ, the data (1)–(5) above makes pMθ px, yq, Sq a hierarchically hyperbolic space, where Mθ px, yq inherits its metric as a subspace of X . Moreover, the associated constants from Definition 1.1 are independent of x, y. Proof. By Lemma 6.13, Mθ px, yq is a uniform quasigeodesic space. We now verify that the enumerated axioms from Definition 1.1 are satisfied. Each part of the definition involving only S and the Ď, K, & relations is obviously satisfied; this includes finite complexity. The consistency inequalities hold because they hold in pX , Sq and each rU is L–coarsely Lipschitz. The same holds for bounded geodesic image and the large link lemma. We now verify the two remaining claims: Uniqueness: Let m, m1 P Mθ px, yq, so that dU pπU pmq, γU q, dU pπU pm1 q, γU q ď θ for all U P S. The definition of rU ensures that dU prU ˝ πU pmq, rU ˝ πU pm1 qq ě dU pπU pmq, πU pm1 qq ´ 2θ, and uniqueness follows. Partial realization: Let tUi u be a totally orthogonal subset of S and choose, for each i, some pi P γUi . By partial realization in pX , Sq, there exists z P X so that dUi pπUi pzq, pi q ď E 1 i for each i and dV pπV pzq, ρU V q ď E provided Ui Ĺ V or Ui &V . Let z “ gx,y pzq P Mθ px, yq. Then, by the definition of the gate map and the fact that each rU is L–coarsely Lipschitz, there i exists α, independent of x, y, so that dUi prUi ˝ πUi pz 1 q, pi q ď α, while dV prV ˝ πV pz 1 q, ρU V qďα 1 whenever Ui &V or Ui Ď V . Hence z is the required partial realization point. This completes the proof that pMθ px, yq, Sq is an HHS. l 7. The coarse median property In this section, we study the relationship between hierarchically hyperbolic spaces and spaces that are coarse median in the sense defined by Bowditch in [Bow13]. In particular, this discussion shows that OutpFn q is not a hierarchically hyperbolic space, and hence not a hierarchically hyperbolic group, for n ě 3. Definition 7.1 (Median graph). Let Γ be a graph with unit-length edges and path-metric d. Then Γ is a median graph if there is a map m : Γ3 Ñ Γ such that, for all x, y, z P Γ, we have HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 35 dpx, yq “ dpx, mq ` dpm, yq, and likewise for the pairs x, z and y, z, where m “ mpx, y, zq. Note that if x “ y, then mpx, y, zq “ x. Chepoi established in [Che00] that Γ is a median graph precisely when Γ is the 1-skeleton of a CAT(0) cube complex. Definition 7.2 (Coarse median space). Let pM, dq be a metric space and let m : M 3 Ñ M be a ternary operation satisfying the following: (1) (Triples) There exist constants κ, hp0q such that for all a, a1 , b, b1 , c, c1 P M , ` ˘ dpmpa, b, c, q, mpa1 , b1 , c1 qq ď κ dpa, a1 q ` dpb, b1 q ` dpc, c1 q ` hp0q. (2) (Tuples) There is a function h : N Y t0u Ñ r0, 8q such that for any A Ď M with p0q 1 ď |A| “ p ă 8, there is a CAT(0) cube complex Fp and maps π : A Ñ Fp and p0q λ : Fp Ñ M such that dpa, λpπpaqqq ď hppq for all a P A and such that dpλpmp px, y, zqq, mpλpxq, λpyq, λpzqqq ď hppq p0q for all x, y, z P Fp , where mp is the map that sends triples from Fp to their median. Then pM, d, mq is a coarse median space. The rank of pM, d, mq is at most d if each Fp above can be chosen to satisfy dim Fp ď d, and the rank of pM, d, mq is exactly d if d is the minimal integer such that pM, d, mq has rank at most d. The next fact was observed by Bowditch [Bow15]; we include a proof for completeness. Theorem 7.3 (Hierarchically hyperbolic implies coarse median). Let pX , Sq be a hierarchically hyperbolic space. Then X is coarse median of rank at most the complexity of pX , Sq. Proof. Since the spaces CU, U P S are δ-hyperbolic for some δ independent of U , there exists for each U a ternary operation mU : CU 3 Ñ CU so that pCU, dU , mU q is a coarse median space of rank 1, and the constant κ and function h : N Y t0u Ñ r0, 8q from Definition 7.2 can be chosen to depend only on δ (and not on U ). Definition of the median: Define a map m : X 3 Ñ X as follows. Let x, y, z P X and, for ś each U P S, let bU “ mU pπU pxq, πU pyq, πU pzqq. By Lemma 2.6, the tuple ~b P U PS 2CU whose U -coordinate is bU is κ–consistent for an appropriate choice of κ. Hence, by the realization theorem (Theorem 3.1), there exists θe and m “ mpx, y, zq P X such that dU pm, bU q ď θu for all U P S. Moreover, this is coarsely well-defined (up to the constant θe from the realization theorem). Application of [Bow13, Proposition 10.1]: Observe that, by Definition 1.1.1, the projections πU : X Ñ CU, U P S are uniformly coarsely Lipschitz. Moreover, for each U P S, the projection πU : X Ñ CU is a “quasimorphism” in the sense of [Bow13, Section 10], i.e., dU pmU pπU pxq, πU pyq, πU pzqq, πU pmpx, y, zqqq is uniformly bounded, by construction, as U varies over S and x, y, z vary in X . Proposition 10.1 of [Bow13] then implies that m is a coarse median on X , since that the hypothesis pP 1q of that proposition holds in our situation by the distance formula. l The following is a consequence of Theorem 7.3 and work of Bowditch [Bow13, Bow14a]: Corollary 7.4 (Contractibility of asymptotic cones). Let X be a hierarchically hyperbolic space. Then all the asymptotic cones of X are contractible, and in fact bi-Lipschitz equivalent to CAT(0) spaces. Corollary 7.5 (HHGs have quadratic Dehn function). Let G be a finitely generated group that is a hierarchically hyperbolic space. Then G is finitely presented and has quadratic Dehn function. In particular, this conclusion holds when G is a hierarchically hyperbolic group. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA Proof. This follows from Theorem 7.3 and [Bow13, Corollary 8.3]. 36 l Corollary 7.6. For n ě 3, the group OutpFn q is not a hierarchically hyperbolic space, and in particular is not a hierarchically hyperbolic group. Proof. This is an immediate consequence of Corollary 7.5 and the exponential lower bound on the Dehn function of OutpFn q given by the combined results of [BV95, HM13b, BV]. l We also recover a special case of Theorem I of [BHS14], using Corollary 7.5 and a theorem of Gersten-Holt-Riley [GHR03, Theorem A]: Corollary 7.7. Let N be a finitely generated virtually nilpotent group. Then G is quasiisometric to a hierarchically hyperbolic space if and only if N is virtually abelian. Corollary 7.8. Let S be a symmetric space of non-compact type, or a thick affine building. Suppose that the spherical type of S is not Ar1 . Then S is not hierarchically hyperbolic. Proof. This follows from Theorem 7.3 and Theorem A of [Hae14]. l Finally, Theorem 9.1 of [Bow14a] combines with Theorem 7.3 to yield: Corollary 7.9 (Rapid decay). Let G be a group whose Cayley graph is a hierarchically hyperbolic space. Then G has the rapid decay property. 7.1. Coarse media and hierarchical quasiconvexity. The natural notion of quasiconvexity in the coarse median setting is related to hierarchical quasiconvexity. Definition 7.10 (Coarsely convex). Let pX , Sq be a hierarchically hyperbolic space and let m : X 3 Ñ X be the coarse median map constructed in the proof of Theorem 7.3. A closed subspace Y Ď X is µ–convex if for all y, y 1 P Y and x P X , we have mpy, y 1 , xq P Nµ pYq. Remark 7.11. We will not use µ–convexity in the remainder of the paper. However, it is of independent interest since it parallels a characterization of convexity in median spaces: a subspace Y of a median space is convex exactly when, for all y, y 1 P Y and x in the ambient median space, the median of x, y, y 1 lies in Y. Proposition 7.12 (Coarse convexity and hierarchical quasiconvexity). Let pX , Sq be a hierarchically hyperbolic space and let Y Ď X . If Y is hierarchically k-quasiconvex, then there exists µ ě 0, depending only on k and the constants from Definition 1.1, such that Y is µ–convex. Proof. Let Y Ď X be k–hierarchically quasiconvex, let y, y 1 P Y and x P X . Let m “ mpx, y, y 1 q. For any U P S, the projection πU pYq is by definition kp0q-quasiconvex, so that, for some k 1 “ k 1 pkp0q, δq, we have dU pmU , πU pYqq ď k 1 , where mU is the coarse median of πU pxq, πU pyq, πU py 1 q coming from hyperbolicity of CU . The tuple pmU qU PS was shown above to be κ–consistent for appropriately-chosen κ (Lemma 2.6), and dU pmU , mpx, y, y 1 qq ď θe pκq, so, by hierarchical quasiconvexity dX pmpx, y, y 1 q, Yq is bounded by a constant depending on kpκq and k 1 . l 8. Combination theorems for hierarchically hyperbolic spaces The goal of this section is to prove Theorem 8.6, which enables the construction of new hierarchically hyperbolic spaces and groups from a tree of given ones. We postpone the statement of the theorem until after the relevant definitions. Definition 8.1 (Quasiconvex hieromorphism, full hieromorphism). Let pf, f ♦ , tf ˚ pU quU PS q be a hieromorphism pX , Sq Ñ pX 1 , S1 q. We say f is k–hierarchically quasiconvex if its image is k–hierarchically quasiconvex. The hieromorphism is full if: HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 37 (1) there exists ξ ě 0 such that each f ˚ pU q : CU Ñ Cpf ♦ pU qq is a pξ, ξq–quasi-isometry, and (2) for each U P S, if V 1 P S1 satisfies V 1 Ď f ♦ pU q, then there exists V P S such that V Ď U and f ♦ pV q “ V 1 . Remark 8.2. Observe that Definition 8.1.(2) holds automatically unless V 1 is bounded. Definition 8.3 (Tree of hierarchically hyperbolic spaces). Let V, E denote the vertex and edge-sets, respectively, of the simplicial tree T . A tree of hierarchically hyperbolic spaces is a quadruple ` ˘ T “ T, tXv u, tXe u, tφe˘ : v P V, e P Eu satisfying: (1) tXv u and tXe u are uniformly hierarchically hyperbolic: each Xv has index set Sv , and each Xe has index set Se . In particular, there is a uniform bound on the complexities of the hierarchically hyperbolic structures on the Xv and Xe . (2) Fix an orientation on each e P E and let e` , e´ denote the initial and terminal vertices of e. Then, each φe˘ : Xe Ñ Xe˘ is a hieromorphism with all constants bounded by some uniform ξ ě 0. (We adopt the hieromorphism notation from Definition 1.19. Hence we actually have maps φe˘ : Xe Ñ Xe˘ , and maps φ♦ e˘ : Se Ñ Se˘ preserving nesting, transversality, and orthogonality, and coarse ξ–Lipschitz maps φ˚e˘ pU q : CU Ñ Cpφ♦ e˘ pU qq satisfying the conditions of that definition.) Given a tree TŮ of hierarchically hyperbolic spaces, denote by X pT q the metric space constructed from vPV Xv by adding edges of length 1 as follows: if x P Xe , we declare φe´ pxq to be joined by an edge to φe` pxq. Given x, x1 P X in the same vertex space Xv , define d1 px, x1 q to be dXv px, x1 q. Given x, x1 P X joined by an edge, define d1 px, x1 q “ 1. Given a sequence x0 , x1 , . . . , xk P X , with consecutive points either joined by an edge or in a common vertex ř 1 1 1 space, define its length to be k´1 i“1 d pxi , xi`1 q. Given x, x P X , let dpx, x q be the infimum of the lengths of such sequences x “ x0 , . . . , xk “ x1 . Remark 8.4. Since the vertex spaces are (uniform) quasigeodesic spaces, pX , dq is a quasigeodesic space. Definition 8.5 (Equivalence, support, bounded support). Let T be a tree of hierarchically hyperbolic spaces. For each e P E, and each We´ P Se´ , We` P Se` , write We´ „d We` ♦ The transitive closure „ of „d is an if there exists We P Se so that φ♦ e´ pWe q “ φe` pWe q. Ť Ť equivalence relation on v Sv . The „–class of W P v Sv is denoted rW s. The support of an equivalence class rW s is the induced subgraph TrW s of T whose vertices are those v P T so that Sv contains a representative of rW s. Observe that TrW s is connected. The tree T of hierarchically hyperbolic spaces has bounded supports if there exists n P N such that each „–class has support of diameter at most n. We can now state the main theorem of this section: Theorem 8.6 (Combination theorem for hierarchically hyperbolic spaces). Let T be a tree of hierarchically hyperbolic spaces. Suppose that: (1) there exists a function k so that each edge–hieromorphism is k–hierarchically quasiconvex; (2) each edge–hieromorphism is full; (3) T has bounded supports of diameter at most n; (4) if e is an edge of T and Se is the Ď–maximal element of Se , then for all V P Se˘ , the elements V and φ♦ pS q are not orthogonal in Se˘ . e˘ e Then XpT q is hierarchically hyperbolic. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 38 We postpone the proof until after the necessary lemmas and definitions. For the remainder of this section, fix a tree of hierarchically hyperbolic spaces T “ pT, tXv u, tXe u, tφe˘ uq satisfying the hypotheses of Theorem 8.6; let n be the constant Ť implicit in assumption 3. Denote by S the union of tT u with the set of all „–classes in v Sv . Definition 8.7 (Nesting, orthogonality, transversality in S). For all rW s P S, declare rW s Ď T . If rV s, rW s are „–classes, then rV s Ď rW s if and only if there exists v P T such that rV s, rW s are respectively represented by Vv , Wv P Sv and Vv Ď Wv ; this relation is nesting. For convenience, for A P S, we write SA to denote the set of B P S such that B Ď A. Likewise, rV sKrW s if and only if there exists a vertex v P T such that rV s, rW s are respectively represented by Vv , Wv P Sv and Vv KWv ; this relation is orthogonality. If rV s, rW s P S are not orthogonal and neither is nested into the other, then they are transverse, written rV s&rW s. Equivalently, rV s&rW s if for all v P TrV s X TrW s , the representatives Vv , Wv P Sv of rV s, rW s satisfy Vv &Wv . Fullness (Definition 8.1.(2)) was introduced to enable the following two lemmas: Lemma 8.8. Let T be a tree of hierarchically hyperbolic spaces, let v be a vertex of the underlying tree T , and let U, U 1 P Sv satisfy U Ď U 1 . Then either U “ U 1 or U  U 1 . Proof. Suppose that U „ U 1 , so that there is a closed path v “ v0 , v1 , . . . , vn “ v in T and a sequence U “ U0 , U1 , . . . , Un “ U 1 such that Ui P Svi and Ui „d Ui`1 for all i. If U ‰ U 1 , then Condition (2) (fullness) from Definition 8.1 and the fact that hieromorphisms preserve nesting yields U 2 P Sv , different from U 1 , such that U 2 „ U and U 2 Ĺ U 1 Ĺ U (where Ĺ denotes proper nesting). Repeating this argument contradicts finiteness of complexity. l Lemma 8.9. The relation Ď is a partial order on S, and T is the unique Ď–maximal element. Moreover, if rV sKrW s and rU s Ď rV s, then rU sKrW s and rV s, rW s are not Ď–comparable. Proof. Reflexivity is clear. Suppose that rVv s Ď rUu s Ď rWw s. Then there are vertices v1 , v2 P V and representatives Vv1 P rVv s, Uv1 P rUu s, Uv2 P rUu s, Wv2 P rWw s so that Vv1 Ď Uv1 and Uv2 Ď Wv2 . Since edge–hieromorphisms are full, induction on dT pv1 , v2 q yields Vv2 Ď Uv2 so that Vv2 „ Vv1 . Transitivity of the nesting relation in Sv2 implies that Vv2 Ď Wv2 , whence rVv s Ď rWw s. Suppose that rUu s Ď rVv s and rVv s Ď rUu s, and suppose by contradiction that rUu s ‰ rVv s. Choose v1 , v2 P V and representatives Uv1 , Uv2 , Vv1 , Vv2 so that Uv1 Ď Vv1 and Vv2 Ď Uv2 . The definition of „ again yields Uv2 „ Uv1 with Uv2 Ď Vv2 ‰ Uv2 . This contradicts Lemma 8.8 below. Hence Ď is antisymmetric, whence it is a partial order. The underlying tree T is the unique Ď–maximal element by definition. Suppose that rV sKrW s and rU s Ď rV s. Then there are vertices v1 , v2 and representatives Vv1 , Wv1 , Uv2 , Vv2 such that Vv1 KWv1 and Uv2 KVv2 . Again by fullness of the edge– hieromorphisms, there exists Uv1 „ Uv2 with Uv1 Ď Vv1 , whence Uv1 KWv1 . Thus rU sKrW s as required. Finally, Ď–incomparability of rV s, rW s follows from fullness and the fact that edge-hieromorphisms preserve orthogonality and nesting. l Lemma 8.10. Let rW s P S and let rU s Ď rW s. Suppose moreover that ( rV s P SrW s : rV sKrU s ‰ H. Then there exists rAs P SrW s ´ trW su such that rV s Ď rAs for all rV s P SrW s with rV sKrU s. Proof. Choose some v P V so that there exists Vv P Sv and Uv P Sv with rUv s “ rU s and Vv KUv . Then by definition, there exists Av P Sv so that Bv Ď Av whenever Bv KUv and so that rBv s Ď rW s. It follows from the fact that the edge-hieromorphisms are full and preserve (non)orthogonality that rBs Ď rAv s whenever rBsKrU s. l HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 39 Lemma 8.11. There exists χ ě 0 such that if tV1 , . . . , Vc u Ă S consists of pairwise orthogonal or pairwise Ď–comparable elements, then c ď χ. Proof. For each v P T , let χv be the complexity of pXv , Sv q and let χ “ maxv χv ` 1. Let rV1 s, . . . , rVc s P S´ tT u be „–classes that are pairwise orthogonal or pairwise Ď–comparable. The Helly property for trees yields a vertex v lying in the support of each rVi s; let Viv P Sv represent rVi s. Since edge–hieromorphisms preserve nesting, orthogonality, and transversality, c ď χv . However, each Vi Ď T , whence χ is the correct upper bound. l Definition 8.12 (Favorite representative, hyperbolic spaces associated to equivalence classes). Let CT “ T . For each „–class rW s, choose a favorite vertex v of TrW s and let Wv P SWv be the favorite representative of rW s. Let CrW s “ CWv . Note that each CrW s is δ–hyperbolic, where δ is the uniform hyperbolicity constant for T . Definition 8.13 (Gates in vertex spaces). For each vertex v of T , define a gate map gv : X Ñ Xv as follows. Let x P Xu for some vertex u of T . We define gv pxq inductively on dT pu, vq. If u “ v, then set gv pxq “ x. Otherwise, u “ e´ for some edge e of T so that dT pe` , vq “ dT pu, vq´1. Then set gv pxq “ gv pφe` pφ´1 pg pxqqqq. We also have a map βVv : X Ñ CVv , e´ φe´ pXe q defined by βVv pxq “ πVv pgv pxqq. (Here, gφe´ pXe q : Xe´ “ Xu Ñ φe´ pXe q is the usual gate map to a hierarchically quasiconvex subspace, described in Definition 5.4, and φ´1 is a quasie˘ inverse for the edge-hieromorphism.) Lemma 8.14. There exists K, depending only on E and ξ, such that the following holds. Let e, f be edges of T and v a vertex so that e´ “ f ´ “ v. Suppose for some V P Sv that there exist x, y P φe´ pXe q Ď Xv with dV pgφf ´ pXf q pxq, gφf ´ pXf q pyqq ą 10K. Then V P φ♦ pSe q X φ♦ pSf q. e´ f´ Proof. Let Ye “ φe´ pXe q and let Yf “ φf ´ pXf q; these spaces are uniformly hierarchically quasiconvex in Xv . Moreover, by fullness of the edge-hieromorphisms, we can choose K ě 100E so that the map πV : Ye Ñ CV is K–coarsely surjective for each V P φ♦ pSe q, and e´ ♦ ♦ likewise for φf ´ pSf q and Yv . If V P Sv ´ φf ´ pSf q, then πV is K–coarsely constant on Yf , by the distance formula, since Xf is quasi-isometrically embedded. Likewise, πV is coarsely constant on Ye if V R φ♦ pSe q. (This also follows from consistency when V is transverse e´ to some unbounded element of φ♦ pSe q and from consistency and bounded geodesic image e´ otherwise.) Suppose that there exists V P Sv such that dV pgφf ´ pXf q pxq, gφf ´ pXf q pyqq ą 10K. Since gφf ´ pXf q pxq, gφf ´ pXf q pyq P Xf , we therefore have that V P φ♦ pSf q. On the other hand, the f´ definition of gates implies that dV px, yq ą 8K, so V P φ♦ pSe q. e´ l Lemma 8.15. There exists a constant K 1 such that the following holds. Let e, f be edges of T and suppose that there do not exist Ve P Se , Vf P Sf for which φ♦ pV q „ φ♦ pV q. Then e´ e f´ f 1 ge´ pXf q has diameter at most K . In particular, the conclusion holds if dT pe, f q ą n, where n bounds the diameter of the supports. Proof. The second assertion follows immediately from the first in light of how n was chosen. We now prove the first assertion by induction on the number k of vertices on the geodesic in T from e to f . The base case, k “ 1, follows from Lemma 8.14. For k ě 1, let v0 , v1 , . . . , vk be the vertices on a geodesic from e to f , in the obvious order. Let b be the edge joining vk´1 to vk , with b´ “ vk . It follows from the definition of gates that ge´ pXf q has diameter (coarsely) bounded above by that of gφb´ pXb q pXf q and that of ge´ pXb q. Hence suppose that diampgφb´ pXb q pXf qq ą 10K HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 40 Xe Xb Xb´ Xf Figure 4. Schematic of the subset of X near Xb´ . and diampge´ pXb qq ą 10K. Then, by induction and Lemma 8.14, we see that there exists Ve P Se , Vf P Sf for which φ♦ pV q „ φ♦ pV q, a contradiction. l e´ e f´ f Lemma 8.16. The map gv : X Ñ Xv is coarse Lipschitz, with constants independent of v. Proof. Let x, y P X . If the projections of x, y to T lie in the ball of radius 2n ` 1 about v, then this follows since gv is the composition of a bounded number of maps, each of which is uniformly coarsely Lipschitz by Lemma 5.5. Otherwise, by Remark 8.4, it suffices to consider x, y with dX px, yq ď C, where C depends only on the metric d. In this case, let vx , vy be the vertices in T to which x, y project. Let v 1 be the median in T of v, vx , vy . Observe that there is a uniform bound on dT pvx , v 1 q and dT pvy , v 1 q, so it suffices to bound dv pgv pgv1 pxqq, gv pgv1 pyqqq. Either dT pv, v 1 q ď 2n ` 1, and we are done, or Lemma 8.15 gives the desired bound, since equivalence classes have support of diameter at most n. l Definition 8.17 (Projections). For each rW s P S, define the projection πrW s : X Ñ CrW s by πrW s pxq “ βWv pxq, where Wv is the favorite representative of rW s. Note that these projections take points to uniformly bounded sets, since the collection of vertex spaces is uniformly hierarchically hyperbolic. Define πT : X Ñ T to be the usual projection to T . Lemma 8.18 (Comparison maps). There exists a uniform constant ξ ě 1 such that for all Wv P Sv , Ww P Sw with Wv „ Ww , there exists a pξ, ξq–quasi-isometry c : Wv Ñ Ww such that c ˝ βv “ βw up to uniformly bounded error. Definition 8.19. A map c as given by Lemma 8.18 is called a comparison map. Proof of Lemma 8.18. We first clarify the situation by stating some consequences of the definitions. Let e` , e´ be vertices of T joined by an edge e. Suppose that there exists W ` P Se` , W ´ P Se´ such that W ` „ W ´ , so that there exists W P Se with πpφe˘ qpW q “ W ˘ . Then the following diagram coarsely commutes (with uniform constants): X ge´ ge`   Xe´ πW ´ X` ? e _  CW ´_   Xe  πW ´ ` CW ? πW    CW where Xe Ñ Xe˘ is the uniform quasi-isometry φe˘ , while Xe˘ Ñ Xe is the composition of a quasi-inverse for φe˘ with the gate map Xe˘ Ñ φe˘ pXe q, and the maps CW Ø CW ˘ are the quasi-isometries implicit in the edge hieromorphism or their quasi-inverses. The proof HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 41 essentially amounts to chaining together a sequence of these diagrams as e varies among the edges of a geodesic from v to w; an important ingredient is played by the fact that such a geodesic has length at most n. Let v “ v0 , v1 , . . . , vm , vm`1 “ w be the geodesic sequence in T from v to w and let ei be the edge joining vi to vi`1 . For each i, choose Wi P Sei and Wi˘ P Sei so that (say) W0´ “ Wv ˘ ` “ W and so that φ♦ pW q “ W ˘ for all i. For each i, let q ˘ : CW Ñ CW ˘ be and Wm w i i i i i ei ˘ qi “ φ˚ei pWi q be the pξ 1 , ξ 1 q–quasi-isometry packaged in the edge–hieromorphism, and let q̄i˘ ˘ be a quasi-inverse; the constant ξ 1 is uniform by hypothesis, and m ď n since T has bounded supports. The hypotheses on the edge–hieromorphisms ensure that the Wi˘ are uniquely determined by Wv , Ww , and we define c by 1 1 m m c “ qm q̄m ¨ ¨ ¨ q11 q̄11 , where i , 1i P t˘u depend on the orientation of ei , and 1i “ ` if and only if i “ ´. This is a pξ, ξq–quasi-isometry, where ξ “ ξpξn1 q. If v “ w, then c is the identity and c ˝ βv “ βv . Let d ě 1 “ dT pv, wq and let w1 be the penultimate vertex on the geodesic of T from v to w. Let c1 : CWv Ñ CWw1 be a comparison map, so that, by induction, there exists λ1 ě 0 so that dCWw1 pc1 ˝ βv pxq, βw1 pxqq ď λ1 for all x P X . Let c2 “ q̄k` qk´ : CWw1 Ñ CWw be the pξ 1 , ξ 1 q–quasi-isometry packaged in the edge–hieromorphism, so that the following diagram coarsely commutes: X gv Xv πWv z  CWv  gw gw1 $ / Xw1 / Xw gw πWw gw 1 πW c1 w1  / CWw1  / CWw 2 c c2 ˝c1 Since c “ and the constants implicit in the coarse commutativity of the diagram depend only on the constants of the hieromorphism and on d ď n, the claim follows. l Lemma 8.20. There exists K such that each πrW s is pK, Kq–coarsely Lipschitz. Proof. For each vertex v of T and each V P Sv , the projection πV : Xv Ñ CV is uniformly coarsely Lipschitz, by definition. By Lemma 8.16, each gate map gv : X Ñ Xv is uniformly coarsely Lipschitz. The lemma follows since πrW s “ πWv ˝ gv , where v is the favorite vertex carrying the favorite representative Wv of rW s. l Definition 8.21 (Projections between hyperbolic spaces). If rV s Ď rW s, then choose vertices v, v 1 , w P V so that Vv , Ww are respectively the favorite representatives of rV s, rW s, while Vv1 , Wv1 are respectively representatives of rV s, rW s with Vv1 , Wv1 P Sv1 and Vv1 Ď Wv1 . Let cV : CVv1 Ñ CVv and cW : CWv1 Ñ CWw be comparison maps. Then define ´ ¯ V 1 rV s ρrW s “ cW ρWv 1 , v rW s which is a uniformly bounded set, and define ρrV s : CrW s Ñ CrV s by W rW s 1 ρrV s “ cV ˝ ρV v1 ˝ c̄W , v W 1 where c̄W is a quasi–inverse of cW and ρV v1 : CWv1 Ñ CVv1 is the map provided by Definiv tion 1.1.(2). Similarly, if rV s&rW s, and there exists w P T so that Sw contains representatives Vw , Ww of rV s, rW s, then let ´ ¯ rV s ρrW s “ cW ρVWww . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 42 Otherwise, choose a closest pair v, w so that Sv (respectively Sw ) contains a representative of rV s (respectively rW s). Let e be the first edge of the geodesic in T joining v to w, so v “ e´ (say). Let S be the Ď–maximal element of Se , and let ¯ ´ πpφ ´ qpSq rW s . ρrV s “ cV ρVv e This is well-defined by hypothesis (4). rW s For each „–class rW s, let ρT be the support of rW s (a uniformly bounded set since T has bounded supports). Define ρTrW s : T Ñ CW as follows: given v P T not in the support of rW s, let e be the unique edge with e´ (say) separating v from the support of rW s. Let rφ ´ pSqs . If v is in the support of rW s, then let S P Se be Ď–maximal. Then ρTrW s pvq “ ρrWe s ρTrW s pvq be chosen arbitrarily. We are now ready to complete the proof of the combination theorem. Proof of Theorem 8.6. We claim that pX pT q, Sq is hierarchically hyperbolic. We take the nesting, orthogonality, and transversality relations for a tree of spaces given by Definition 8.7. In Lemmas 8.9 and 8.10, it is shown that these relations satisfy all of the conditions (2) and (3) of Definition 1.1 not involving the projections. Moreover, the complexity of pX pT q, Sq is finite, by Lemma 8.11, verifying Definition 1.1.(5). The set of δ–hyperbolic spaces tCA : A P Su is provided by Definition 8.12, while the projections πrW s : X Ñ CrW s required by Definition 1.1.(1) are defined in Definition 8.17 and are uniformly coarsely LipsrV s chitz by Lemma 8.20. The projections ρrW s when rV s, rW s are non-orthogonal are described in Definition 8.21. To complete the proof, it thus suffices to verify the consistency inequalities (Definition 1.1.(4)), the bounded geodesic image axiom (Definition 1.1.(7)), the large link axiom (Definition 1.1.(6)), partial realization (Definition 1.1.(8)), and uniqueness (Definition 1.1.(9)). Consistency: Suppose that rU s&rV s or rU s Ď rV s and let x P X . Choose representatives Uu P Su , Vu P Sv of rU s, rV s so that dT pu, vq realizes the distance between the supports of rU s, rV s. By composing the relevant maps in the remainder of the argument with comparison maps, we can assume that Uu , Vv are favorite representatives. Without loss of generality, there exists a vertex w P T so that x P Xw . If u “ v, then consistency follows since it holds in each vertex space, so assume that u, v have disjoint supports and in particular rU s&rV s. If w R ru, vs, then (say) u separates w from v. Then πrV s pxq “ πVv pgv pxqq. Let e be the rV s edge of the geodesic ru, vs emanating from u, so that ρrU s “ ρSUu , where S is the image in & Su of the Ď–maximal element of Se . If dCUu pgu pxq, ρSUu q ď E, then we are done. Otherwise, u by consistency in Su , we have dCS pgu pxq, ρU S q ď E, from which consistency follows. Hence suppose that w P ru, vs. Then without loss of generality, there is an edge e containing v and separating w from v. As before, projections to V factor through the Ď-maximal element of Se , from which consistency follows. It remains to verify consistency for T, rW s for each „–class rW s. Choose x P Xv . If dT pv, TrW s q ě n ` 1, then let e be the edge incident to TrW s separating it from v, so that (up to a comparison map) ρTrW s pvq “ ρSW , where W P Se` represents W , and e` P TrW s , and S is the image in Se` of the Ď–maximal element of Se . (Note that W &S by hypothesis (4) of the theorem and the choice of e). On the other hand (up to a comparison map) πrW s pxq “ πW pge` pxqq — πW pge` pXv qq — πW pFS q “ ρSW , as desired. Finally, suppose that rU s Ď rV s and that either rV s Ĺ rW s or rV s&rW s and rU s rW s. We rU s rV s claim that drW s pρrW s , ρrW s q is uniformly bounded. Choose representatives Uu P Su , Vu P Su of rU s, rV s with Uu Ď Vu . Choose representatives Vw , Ww P Sw so that Vw Ď Ww or Vw &Uw HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 43 & according to whether rV s Ď rW s or rV s&rW s, and choose representatives Uv , Wv P Sv of rU s, rW s so that Uv Ď Wv or Uv &Wv according to whether rU s Ď rW s or rU s&rW s. Let m P T be the median of u, v, w. Since u, w lie in the support of rU s, rW s, so does m, since supports are connected. Likewise, m lies in the support of rV s. Let Um , Vm , Wm be the representatives of rU s, rV s, rW s in m. Since edge-maps are full hieromorphisms, we have Um Ď Vm and Um Wm and either Vm Ď Wm or Vm &Wm . Hence Definition 1.1.(4) implies Vm m that dWm pρU Wm , ρWm q is uniformly bounded. Since the comparison maps are uniform quasirU s rV s isometries, it follows that drW s pρrW s , ρrW s q is uniformly bounded, as desired. Bounded geodesic image and large link axiom in T : Let γ be a geodesic in T and rW s let rW s be a „–class so that dT pγ, ρT q ą 1, which is to say that γ does not contain vertices in the support of rW s. Let e be the terminal edge of the geodesic joining γ to the support of rSs rW s. Then for all u P γ, we have by definition that ρTrW s puq “ ρrW s for some fixed „–class rSs. This verifies the bounded geodesic image axiom for T, rW s. By Lemma 8.15, there exists a constant K 2 such that if x, x1 P X respectively project to vertices v, v 1 , then any rW s P S ´ tT u with drW s px, x1 q ě K 2 is supported on a vertex vrW s on the geodesic rv, v 1 s and is hence nested into rSvW s, where SvW is maximal in SvrW s . Indeed, choose w in the support of rW s. Then either drW s px, x1 q is smaller than some specified constant, or dXw pgw pxq, gw px1 q ą K 1 . Thus gXw pXm q has diameter at least K 1 , where m is the median of v, v 1 , w. Hence m lies in the support of rW s, and m P rv, v 1 s, and rW s Ď rSs, where rSv s S is Ď–maximal in Sm . Finally, for each such SvW , it is clear that dT px, ρT W q ď dT px, x1 q, verifying the conclusion of the large link axiom for T . Bounded geodesic image and large link axiom in W Ă T : Let rW s be non-Ď– maximal, let rV s Ď rW s, and let γ be a geodesic in CrW s. Then γ is a geodesic in CWw , by definition, where w is the favorite vertex of rW s with corresponding representative Ww . Let rV s Vw be the representative of rV s supported on w, so that ρrW s “ ρVWww , so that γ avoids the rV s E–neighborhood of ρrW s exactly when it avoids the E–neighborhood of ρVWww . The bounded geodesic image axiom now follows from bounded geodesic image in Sw , although the constant E has been changed according to the quasi-isometry constant of comparison maps. Now suppose x, x1 P Xv , Xv1 and choose w to be the favorite vertex in the support of rW s. Suppose for some rV s Ď rW s that drV s px, x1 q ě E 1 , where E 1 depends on E and the quasi-isometry constants of the edge-hieromorphisms. Then dVw pgw pxq, gw px1 qq ě E, for some representative Vw P Sw of rV s, by our choice of E 1 . Hence, by the large link axiom in Sw , we have that Vw Ď Ti , where tTi u is a specified set of N “ tdWw pgw pxq, gw px1 qqu “ tdrW s px, x1 qu elements of Sw , with each Ti Ă Ww . Moreover, the large link axiom in Sw rT s implies that drW s px, ρrWi s q “ dWw pgw pxq, ρTWi w q ď N for all i. This verifies the large link axiom for pX pT q, Sq. Partial realization: Let rV1 s, . . . , rVk s P S be pairwise–orthogonal, and, for each i ď k, let pi P CrVi s. For each i, let Ti Ď T be the induced subgraph spanned by the vertices w such that rVi s has a representative in Sw . The definition of the „–relation implies that each Ti is connected, so by the Helly property of trees, there exists a vertex v P T such that for each i, there exists Vvi P Sv representing rVi s. Moreover, we have Vvi KVvj for i ‰ j, since the edge–hieromorphisms preserve the orthogonality relation. Applying the partial realization axiom (Definition 1.1.(8)) to tp1i P CVvi u, where p1i is the image of pi under the appropriate comparison map, yields a point x P Xv such that πVvi pxq is coarsely equal to p1i for all i, whence drVi s px, pi q is uniformly bounded. If rVi s Ď rW s, then W has a representative Wv P Sv such rV s that Vvi Ď W , whence drW s px, ρWi q is uniformly bounded since x is a partial realization HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 44 point for tVvi u in Sv . Finally, if rW s&rVi s, then either the subtrees of T supporting rW s and rV s rVi s are disjoint, in which case drW s px, ρrWi s q is bounded, or rW s has a representative in Sv transverse to Vvi , in which case the same inequality holds by our choice of x. Uniqueness of realization points: Suppose x, y P X satisfy drV s px, yq ď K for all rV s P S. Then for each vertex v P T , applying the uniqueness axiom in Xv to gv pxq, gv pyq shows that, since dXv pgv pxq, gv pyqq ď ζ “ ζpKq. Indeed, otherwise we would have dV pgv pxq, gv pyqq ą ξK`ξ for some V P Sv , whence drV s px, yq ą K. There exists k ď K and a sequence v0 , . . . , vk of vertices in T so that x P Xv0 , y P Xvk . For each j, let xj “ gvj pxq and yj “ gvj pyq. Then x “ x0 , y0 , x1 , y1 , . . . , yj´1 , xj , yj , . . . , xk , yk “ y is a path of uniformly bounded length joining x to y. Indeed, dXvj pxj , yj q ď ζ and k ď K by the preceding discussion, while xj coarsely coincides with a point on the opposite side of an edge-space from yj´1 by the definition of the gate of an edge-space in a vertex-space and the fact that xj´1 and yj´1 coarsely coincide. This completes the proof. l 8.1. Equivariant definition of pX pT q, Sq. Let T denote the tree of hierarchically hyperbolic spaces pT , tXv u, tXe u, tπe˘ uq, and let pX pT q, Sq be the hierarchically hyperbolic structure defined in the proof of Theorem 8.6. Various arbitrary choices were made in defining the constituent hyperbolic spaces and projections in this hierarchically hyperbolic structure, and we now insist on a specific way of making these choices in order to describe automorphisms of pX pT q, Sq. Recall that an automorphism of pX pT q, Sq is determined by a bijection g : S Ñ S and a set of isometries g : CrV s Ñ CgrV s, for rV s P S. Via the distance formula, this determines a uniform quasi-isometry X pT q Ů Ñ X pT q. Ů A bijection g : vPV Sv Ñ vPV Sv is T –coherent if there is an induced isometry g of the Ů underlying tree, T , so that f g “ gf , where f : vPV Sv Ñ T sends each V P Sv to v, for all v P V. The T –coherent bijection g is said to be T –coherent if it also preserves the relation „. Noting that the composition of T –coherent bijections is T –coherent, denote by PT the group of T –coherent bijections. For each g P PT , there is an induced bijection g : S Ñ S. Recall that the hierarchically hyperbolic structure pX pT q, Sq was completely determined except for the following three types of choices which were made arbitrarily. (1) For each rV s P S, we chose an arbitrary favorite vertex v in the support of rV s; and, (2) we chose an arbitrary favorite representative Vv P Sv with rV s “ rVv s. (Note that if, as is often the case in practice, edge-hieromorphisms Se Ñ Sv are injective, then Vv is the unique representative of its „–class that lies in Sv , and hence our choice is uniquely determined.) (3) For each rW s P S, the point ρTrW s is chosen arbitrarily in CW , where W is the favorite representative of rW s. We now constrain these choices so that they are equivariant. For each PT –orbit in S, choose a representative rV s of that orbit, choose a favorite vertex v arbitrarily in its support, and choose a favorite representative Vv P Sv of rV s. Then declare gVv P Sgv to be the favorite representative, and gv the favorite vertex, associated to grV s, for each g P PT . Recall that, for each rW s P S, we defined CrW s to be CW , where W is the favorite representative of rW s. Suppose that we have specified a subgroup G ď PT and, for each rW s P S and g P PT , an isometry g : CrW s Ñ CgrW s. Then we choose ρTrW s in such a way that ρTgrW s “ gρTrW s for each rW s P S and g P G. 8.2. Graphs of hierarchically hyperbolic groups. Recall that the finitely generated group G is hierarchically hyperbolic if there is a hierarchically hyperbolic space pX , Sq such that G ď AutpSq and the action of G on X is metrically proper and cobounded and the HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 45 action of G on S is co-finite (this, together with the definition of an automorphism, implies that only finitely many isometry types of hyperbolic space are involved in the HHS structure). Endowing G with a word-metric, we see that pG, Sq is a hierarchically hyperbolic space. If pG, Sq and pG1 , S1 q are hierarchically hyperbolic groups, then a homomorphism of hierarchically hyperbolic groups φ : pG, Sq Ñ pG1 , S1 q is a homomorphism φ : G Ñ G1 that is also a φ–equivariant hieromorphism as in Definition 1.21. Recall that a graph of groups G is a graph Γ “ pV, Eq together with a set tGv : v P V u of vertex groups, a set tGe : e P Eu of edge groups, and monomorphisms φ˘ e : Ge Ñ Ge˘ , where e˘ are the vertices incident to e. As usual, the total group G of G is the quotient of p˚vPV Gv q ˚ FE , where FE is the free group generated by E, obtained by imposing the following relations: ‚ e “ 1 for all e P E belonging to some fixed spanning tree T of Γ; ´ ´1 for e P E and g P G . ‚ φ` e e pgq “ eφe pgqe We are interested in the case where Γ is a finite graph and, for each v P V, e P E, we have sets Sv , Se so that pGv , Sv q and pGe , Se q are hierarchically hyperbolic group structures for which φ˘ e : Ge Ñ Ge˘ is a homomorphism of hierarchically hyperbolic groups. In this case, G is a finite graph of hierarchically hyperbolic groups. If in addition each φ˘ e has hierarchically quasiconvex image, then G has quasiconvex edge groups. r denote the Bass-Serre tree, observe that T “ Gr “ pΓ, r tGṽ u, tGẽ u, tφẽ ˘uq is a Letting Γ r and each tree of hierarchically hyperbolic spaces, where ṽ ranges over the vertex set of Γ, r Gṽ is a conjugate in the total group G to Gv , where ṽ ÞÑ v under Γ Ñ Γ, and an analogous statement holds for edge-groups. Each φ˘ ẽ is conjugate to an edge-map in G in the obvious way. We say G has bounded supports if T does. Corollary 8.22 (Combination theorem for HHGs). Let G “ pΓ, tGv u, tGe u, tφ˘ e uq be a finite graph of hierarchically hyperbolic groups. Suppose that: (1) G has quasiconvex edge groups; (2) each φ˘ e , as a hieromorphism, is full; (3) G has bounded supports; (4) if e is an edge of Γ and Se the Ď–maximal element of Se , then for all V P Se˘ , the elements V and πpφe˘ qpSe q are not orthogonal in Se˘ . Then the total group G of G is a hierarchically hyperbolic group. Proof. By Theorem 8.6, pG, Sq is a hierarchically hyperbolic space. Observe that G ď PG , r and this action is induced by an action on Ť since G acts on the Bass-Serre tree Γ, vPV Sv preserving the „–relation. Hence the hierarchically hyperbolic structure pG, Sq can be chosen according to the constraints in Section 8.1, whence it is easily checked that G acts by automorphisms on pG, Sq. The action is obviously proper and cocompact; the action on S is co-finite since each Gv is a hierarchically hyperbolic group. l If we apply the Corollary to hyperbolic groups, we immediately recover the following special case of the celebrated Bestvina–Feighn Combination theorem [BF92]. The bounded supports condition appears to be an obstruction to obtaining any substantially larger portion of their theorem. Remark 8.23 (Combination theorem for some graphs of hyperbolic groups). Corollary 8.22 implies that, if G is a finite graph of hyperbolic groups such that: (1) for all edges e of Γ, Ge is quasiconvex in Ge˘ and (2) for all vertices v of Γ, the collection tGe : v P te˘ uu is almost malnormal in Gv then the total group G admits a hierarchically hyperbolic structure with trivial orthogonality relation, from which it follows that G is again hyperbolic, by a result in [DHS15]. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 46 Remark 8.24 (Examples where the combination theorem does not apply). Examples where one cannot apply Theorem 8.6 or Corollary 8.22 are likely to yield examples of groups that are not hierarchically hyperbolic groups, or even hierarchically hyperbolic spaces. (1) Let G be a finite graph of groups with Z2 vertex groups and Z edge groups, i.e., a tubular group. In [Wis14], Wise completely characterized the tubular groups that act freely on CAT(0) cube complexes, and also characterized those that admit cocompact such actions; Woodhouse recently gave a necessary and sufficient condition for the particular cube complex constructed in [Wis14] to be finite-dimensional [Woo15]. These results suggest that there is little hope of producing hierarchically hyperbolic structures for tubular groups via cubulation, except in particularly simple cases. This is because the obstruction to cocompact cubulation is very similar to the obstruction to building a hierarchically hyperbolic structure using Theorem 8.6. Indeed, if some vertex-group Gv – Z2 has more than 2 independent incident edge-groups, then, if G satisfied the hypotheses of Theorem 8.6, the hierarchically hyperbolic structure on Gv would include 3 pairwise-orthogonal unbounded elements, contradicting partial realization. This shows that such a tubular group does not admit a hierarchically hyperbolic structure by virtue of the obvious splitting, and in fact shows that there is no hierarchically hyperbolic structure in which Gv and the incident edge-groups are hierarchically quasiconvex. (2) Let G “ F ¸φ Z, where F is a finite-rank free group and φ : F Ñ F an automorphism. When F is atoroidal, G is a hierarchically hyperbolic group simply by virtue of being hyperbolic [BF92, Bri00]. There is also a more refined hierarchically hyperbolic structure in this case, in which all of the hyperbolic spaces involved are quasi-trees. Indeed, by combining results in [HW15] and [Ago13], one finds that G acts freely, cocompactly, and hence virtually co-specially on a CAT(0) cube complex, which therefore contains a G-invariant factor system in the sense of [BHS14] and is hence a hierarchically hyperbolic group; the construction in [BHS14] ensures that the hierarchically hyperbolic structure for such cube complexes always uses a collection of hyperbolic spaces uniformly quasi-isometric to trees. However, the situation is presumably quite different when G is not hyperbolic. In this case, it seems that G is rarely hierarchically hyperbolic. 8.3. Products. In this short section, we briefly describe a hierarchically hyperbolic structure on products of hierarchically hyperbolic spaces. Proposition 8.25 (Product HHS). Let pX0 , S0 q and pX1 , S1 q be hierarchically hyperbolic spaces. Then X “ X0 ˆ X1 admits a hierarchically hyperbolic structure pX , Sq such that for each of i P t0, 1u the inclusion map Xi Ñ X induces a quasiconvex hieromorphism. Proof. Let pXi , Si q be hierarchically hyperbolic spaces for i P t0, 1u. Let S be a hierarchically hyperbolic structure consisting of the disjoint union of S0 and S1 (together with their intrinsic hyperbolic spaces, projections, and nesting, orthogonality, and transversality relations), along with the following domains whose associated hyperbolic spaces are points: S, into which everything will be nested; Ui , for i P t0, 1u, into which everything in Si is nested; for each U P Si a domain VU , with |CVU | “ 1, into which is nested everything in Si`1 and everything in Si orthogonal to U . The elements VU are pairwise–transverse, and are all transverse to U0 and U1 . Projections πU : X0 ˆ X1 Ñ U P S are defined in the obvious way when U R S0 Y S1 ; otherwise, they are the compositions of the existing projections with projection to the relevant factor. Projections of the form ρU V are either defined already, uniquely determined, or are chosen to coincide with the projection of some fixed basepoint (when V P S0 YS1 and U is not). It is easy to check that this gives a hierarchically hyperbolic structure on X1 ˆ X2 . HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 47 The hieromorphisms pXi , Si q Ñ pX , Sq are inclusions on Xi and S; for each U P Si , the map Si Q CU Ñ CU P S is the identity. It follows immediately from the definitions that the diagrams from Definition 1.19 coarsely commute, so that these maps are indeed hieromorphisms. Hierarchical quasiconvexity likewise follows from the definition. l Product HHS will be used in defining hierarchically hyperbolic structures on graph manifolds in Section 10. The next result follows directly from the proof of the previous proposition. Corollary 8.26. Let G0 and G1 be hierarchically hyperbolic groups. Then G0 ˆ G1 is a hierarchically hyperbolic group. 9. Hyperbolicity relative to HHGs Relatively hyperbolic groups possess natural hierarchically hyperbolic structures: Theorem 9.1 (Hyperbolicity relative to HHGs). Let the group G be hyperbolic relative to a finite collection P of peripheral subgroups. If each P P P is a hierarchically hyperbolic space, then G is a hierarchically hyperbolic space. Further, if each P P P is a hierarchically hyperbolic group, then so is G. Proof. We prove the statement about hierarchically hyperbolic groups; the statement about spaces follows a fortiori. For each P P P, let pP, SP q be a hierarchically hyperbolic group structure. For convenience, assume that the P P P are pairwise non-conjugate (this will avoid conflicting hierarchically hyperbolic structures). For each P and each left coset gP , let SgP be a copy of SP (with associated hyperbolic spaces and projections), so that there is a hieromorphism pP, SP q Ñ pgP, SgP q, equivariant with respect to the conjugation isomorphism P Ñ P g . p be the usual hyperbolic space formed from G by coning off each left coset of each Let G p YŮ P P P. Let S “ tGu gP PGP SgP . The nesting, orthogonality, and transversality relations on each SgP are as defined above; if U, V P SgP , Sg1 P 1 and gP ‰ g 1 P 1 , then declare U &V . p The hyperbolic space C G p is G, p while the hyperbolic space Finally, for all U P S, let U Ď G. CU associated to each U P SgP was defined above. p is the inclusion. For each U P SgP , let The projections are defined as follows: πGp : G Ñ G ggP : G Ñ gP be the closest-point projection onto gP and let πU “ πU ˝ ggP , to extend the domain of πU from gP to G. Since each πU was coarsely Lipschitz on U , and the closest-point projection is uniformly coarsely Lipschitz, the projection πU is uniformly coarsely Lipschitz. For each U, V P SgP , the coarse maps ρVU and ρU V were already defined. If U P SgP and U 1 1 1 1 V P Sg P , then ρV “ πV pgg P pgP qq, which is a uniformly bounded set (here we use relative hyperbolicity, not just the weak relative hyperbolicity that is all we needed so far). Finally, p we define ρU to be the cone-point over the unique gP with U P SgP , and for U ‰ G, p G p p p G p is a cone-point ρ : G Ñ CU is defined as follows: for x P G, let ρG pxq “ πU pxq. If x P G U S U 1 1 g P over g 1 P 1 ‰ gP , let ρG , where Sg1 P 1 P Sg1 P 1 is Ď–maximal. The cone-point over U pxq “ ρU gP may be sent anywhere in U . By construction, to verify that pG, Sq is a hierarchically hyperbolic group structure, it suffices to verify that it satisfies the remaining axioms for a hierarchically hyperbolic space given in Definition 1.1, since the additional G–equivariance conditions hold by construction. Specifically, it remains to verify consistency, bounded geodesic image and large links, partial realization, and uniqueness. Consistency: The nested consistency inequality holds automatically within each SgP , so p but this follows directly from the definition: it remains to verify it only for U P SgP versus G, p from the cone-point over gP , then ρGp pxq “ πU pxq, by definition. To if x P G is far in G U p HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 48 verify the transverse inequality, it suffices to consider U P SgP , V P Sg1 P 1 with gP ‰ g 1 P 1 . Let x P G and let z “ gg1 P 1 pxq. Then, if dU px, zq is sufficiently large, then dgP px, zq is correspondingly large, so that by Lemma 1.15 of [Sis13], gg1 P 1 pxq and gg1 P 1 pgP q coarsely coincide, as desired. The last part of the consistency axiom, Definition 1.1.(4), holds as follows. Indeed, if U Ď V , then either U “ V , and there is nothing to prove. Otherwise, if U Ď V and either p The latter V Ĺ W or W &V , then either U, V P SgP for some g, P , or U P SgP and V “ G. situation precludes the existence of W , so we must be in the former situation. If W P SgP , we p then U, V both project to the cone-point are done since the axiom holds in SgP . If W “ G, U V over gP , so ρW “ ρW . In the remaining case, W P Sg1 P 1 for some g 1 P 1 ‰ gP , in which case V ρU W , ρW both coincide with πW pgg 1 P 1 pgP qq. Bounded geodesic image: Bounded geodesic image holds within each SgP by construcp Let γ̂ be a geodesic in tion, so it suffices to consider the case of U P SgP nested into G. p G avoiding gP and the cone on gP . Lemma 1.15 of [Sis13] ensures that any lift of γ̂ has p uniformly bounded projection on gP , so ρG U ˝ γ̂ is uniformly bounded. Large links: The large link axiom (Definition 1.1.(6)) can be seen to hold in pG, Sq by combining the large link axiom in each gP with malnormality of P and Lemma 1.15 of [Sis13]. Partial realization: This follows immediately from partial realization within each SgP and the fact that no new orthogonality was introduced in defining pG, Sq, together with the p and the definition of projection between elements of SgP and Sg1 P 1 when definition of G 1 1 gP ‰ g P . More precisely, if U P SgP and p P CU , then by partial realization within gP , there exists x P gP so that dU px, pq ď α for some fixed constant α and dV px, ρU Vq ď α U for all V P SgP with U Ď V or U &V . Observe that dGp px, ρ p q “ 1, since x P gP and G ρUp is the cone-point over gP . Finally, if g 1 P 1 ‰ gP and V P Sg1 P 1 , then dV px, ρU Vq “ G dV pπV pgg1 P 1 pxqq, πV pgg1 P 1 pgP qqq “ 0 since x P gP . p then either they are uniformly close in G, Uniqueness: If x, y are uniformly close in G, or they are uniformly close to a common cone-point, over some gP , whence the claim follows from the uniqueness axiom in SgP . l Remark 9.2. The third author established a characterization of relative hyperbolicity in terms of projections in [Sis13]. Further, there it was proven that like mapping class groups, there was a natural way to compute distances in relatively hyperbolic groups from certain related spaces, namely: if pG, Pq is relatively hyperbolic, then distances in G are coarsely p together obtained by summing the corresponding distance in the coned-off Cayley graph G with the distances between projections in the various P P P and their cosets. We recover a new proof of Sisto’s formula as a consequence of Theorem 9.1 and Theorem 4.5. Theorem 9.1 will be used in our analysis of 3–manifold groups in Section 10. However, there is a more general statement in the context of metrically relatively hyperbolic spaces (e.g., what Drutu–Sapir call asymptotically tree-graded [DS05], or spaces that satisfy the equivalent condition on projections formulated in [Sis12]). For instance, arguing exactly as in the proof of Theorem 9.1 shows that if the space X is hyperbolic relative to a collection of uniformly hierarchically hyperbolic spaces, then X admits a hierarchically hyperbolic structure (in which each peripheral subspace embeds hieromorphically). More generally, let the geodesic metric space X be hyperbolic relative to a collection P of subspaces, and let Xp be the hyperbolic space obtained from X by coning off each P P P. Then we can endow X with a hierarchical space structure as follows: ‚ the index-set S consists of P together with an additional index S; HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 49 ‚ for all P, Q P P, we have P &Q, while P Ĺ S for all P P P (the orthogonality relation is empty and there is no other nesting); ‚ for each P P P, we let CP “ P ; ‚ we declare CS “ Xp; ‚ the projection πS : X Ñ Xp is the inclusion; ‚ for each P P P, let πP : X Ñ P be the closest-point projection onto P ; ‚ for each P P P, let ρPS be the cone-point in Xp associated to P ; ‚ for each P P P, let ρSP : Xp Ñ P be defined by ρSP pxq “ πP pxq for x P X , while ρSP pxq “ πP pQq whenever x lies in the cone on Q P P. ‚ for distinct P, Q P P, let ρPQ “ πQ pP q (which is uniformly bounded since X is hyperbolic relative to P). The above definition yields: Theorem 9.3. Let the geodesic metric space X be hyperbolic relative to the collection P of subspaces. Then, with S as above, we have that pX , Sq is a hierarchical space, and is moreover relatively hierarchically hyperbolic. Proof. By definition, for each U P S, we have that either U “ S and CS “ Xp is hyperbolic, or U is Ď–minimal. The rest of the conditions of Definition 1.1 are verified as in the proof of Theorem 9.1. l 10. Hierarchical hyperbolicity of 3-manifold groups In this section we show that fundamental groups of most 3–manifolds admit hierarchical hyperbolic structures. More precisely, we prove: Theorem 10.1 (3–manifolds are hierarchically hyperbolic). Let M be a closed 3–manifold. Then π1 pM q is a hierarchically hyperbolic space if and only if M does not have a Sol or Nil component in its prime decomposition. Proof. It is well known that for a closed irreducible 3–manifold N the Dehn function of π1 pN q is linear if N is hyperbolic, cubic if N is Nil, exponential if N is Sol, and quadratic in all other cases. Hence by Corollary 7.5, if π1 pM q is a hierarchically hyperbolic space, then M does not contain Nil or Sol manifolds in its prime decomposition. It remains to prove the converse. Since the fundamental group of any reducible 3–manifold is the free product of irreducible ones, the reducible case immediately follows from the irreducible case by Theorem 9.1. When M is geometric and not Nil or Sol, then π1 pM q is quasi-isometric to one of the following: ‚ R3 is hierarchically hyperbolic by Proposition 8.25; ‚ H3 , S3 , S2 ˆ R are (hierarchically) hyperbolic; ‚ H2 ˆ R and P SL2 pRq: the first is hierarchically hyperbolic by Proposition 8.25, whence the second is also since it is quasi-isometric to the first by [Rie01]. We may now assume M is not geometric. Our main step is to show that any irreducible non-geometric graph manifold group is a hierarchically hyperbolic space. Let M be an irreducible non-geometric graph manifold. By [KL98, Theorem 2.3], by replacing M by a manifold whose fundamental group is quasi-isometric to that of M , we may assume that our manifold is a flip graph manifold, i.e., each Seifert fibered space component is a trivial circle bundles over a surfaces of genus at least 2 and each pair of adjacent Seifert fibered spaces are glued by flipping the base and fiber directions. Let X be the universal cover of M . The decomposition of M into geometric components induces a decomposition of X into subspaces tSv u, one for each vertex v of the Bass-Serre HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 50 tree T of M . Each such subspace Sv is bi-Lipschitz homeomorphic to the product of a copy Rv of the real line with the universal cover Σv of a hyperbolic surface with totally geodesic boundary, and there are maps φv : Sv Ñ Σv and ψv : Sv Ñ Rv . Notice that Σv is hyperbolic, and in particular hierarchically hyperbolic. However, for later purposes, we endow Σv with the hierarchically hyperbolic structure originating from the fact that Σv is hyperbolic relative to its boundary components, see Theorem 9.1. By Proposition 8.25 each Sv is a hierarchically hyperbolic space and thus we have a tree of hierarchically hyperbolic spaces. Each edge space is a product B0 Σv ˆ Rv , where B0 Σv is a particular boundary component of Σv determined by the adjacent vertex. Further, since the graph manifold is flip, we also have that for each vertices v, w of the tree, the edgehieromorphism between Sv and Sw sends B0 Σv to Rw and Rv to B0 Σw . We now verify the hypotheses of Corollary 8.22. The first hypothesis is that there exists k so that each edge-hieromorphism is k–hierarchically quasiconvex. This is easily seen since the edge-hieromorphisms have the simple form described above. The second hypothesis of Theorem 8.6, fullness of edge-hieromorphisms, also follows immediately from the explicit description of the edges here and the simple hierarchically hyperbolic structure of the edge spaces. The third hypothesis of Theorem 8.6 requires that the tree has bounded supports. We can assume that the product regions Sv are maximal in the sense that each edge-hieromorphism sends the fiber direction Rv to B0 Σw in each adjacent Sw . It follows that the support of each „–class (in the language of Theorem 8.6) consists of at most 2 vertices. The last hypothesis of Theorem 8.6 is about non-orthogonality of maximal elements and again follows directly from the explicit hierarchically hyperbolic structure. All the hypotheses of Theorem 8.6 are satisfied, so π1 M (with any word metric) is a hierarchically hyperbolic space for all irreducible non-geometric graph manifolds M . The general case that the fundamental group of any non-geometric 3–manifold is an hierarchically hyperbolic space now follows immediately by Theorem 9.1, since any 3–manifold group is hyperbolic relative to its maximal graph manifold subgroups. l Remark 10.2 ((Non)existence of HHG structures for 3–manifold groups). The proof of Theorem 10.1 shows that for many 3–manifolds M , the group π1 M is not merely a hierarchically hyperbolic space (when endowed with the word metric arising from a finite generating set), but is actually a hierarchically hyperbolic group. Specifically, if M is virtually compact special, then π1 M acts freely and cocompactly on a CAT(0) cube complex X that is the universal cover of a compact special cube complex. Hence X contains a π1 M –invariant factor system (see [BHS14, Section 8]) consisting of a π1 M –finite set of convex subcomplexes. This yields a hierarchically hyperbolic structure pX , Sq where π1 M ď AutpSq acts cofinitely on S and geometrically on X , i.e., π1 M is a hierarchically hyperbolic group. The situation is quite different when π1 M is not virtually compact special. Indeed, when M is a nonpositively-curved graph manifold, π1 M virtually acts freely, but not necessarily cocompactly, on a CAT(0) cube complex X , and the quotient is virtually special; this is a result of Liu [Liu11] which was also shown to hold in the case where M has nonempty boundary by Przytycki and Wise [PW11]. Moreover, π1 M acts with finitely many orbits of hyperplanes. Hence the π1 M –invariant factor system on X from [BHS14] yields a π1 M –equivariant HHS structure pX , Sq with S π1 M –finite. However, this yields an HHG structure on π1 M only if the action on X is cocompact. In [HP13], the second author and Przytycki showed that π1 M virtually acts freely and cocompactly on a CAT(0) cube complex, with special quotient, only in the very particular situation where M is chargeless. This essentially asks that the Ă from the proof of Theorem 10.1 construction of the hierarchically hyperbolic structure on M Ă can be done π1 M –equivariantly. In general, this is impossible: recall that we passed from M HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 51 to the universal cover of a flip manifold using a (nonequivariant) quasi-isometry. Motivated by this observation and the fact that the range of possible HHS structures on the universal cover of a JSJ torus is very limited, we conjecture that π1 M is a hierarchically hyperbolic group if and only if π1 M acts freely and cocompactly on a CAT(0) cube complex. 11. A new proof of the distance formula for mapping class groups We now describe the hierarchically hyperbolic structure of mapping class groups. In [BHS14] we gave a proof of this result using several of the main results of [Beh06, BKMM12, MM99, MM00]. Here we give an elementary proof which is independent of the Masur–Minsky “hierarchy machinery.” One consequence of this is a new and concise proof of the celebrated Masur–Minsky distance formula [MM00, Theorem 6.12], which we obtain by combining Theorem 11.1 and Theorem 4.5. (1) Let S be closed connected oriented surface of finite type and let MpSq be its marking complex. (2) Let S be the collection of isotopy classes of essential subsurfaces of S, and for each U P S let CU be its curve complex. (3) The relation Ď is nesting, K is disjointness and & is overlapping. (4) For each U P S, let πU : MpSq Ñ CU be the (usual) subsurface projection. For U, V P S satisfying either U Ď V or U &V , denote ρU V “ πV pBU q P CV , while for CV be the subsurface projection. : CU Ñ 2 V Ď U let ρU V Theorem 11.1. Let S be closed connected oriented surface of finite type. Then, pMpSq, Sq is a hierarchically hyperbolic space, for S as above. In particular the mapping class group MCGpSq is a hierarchically hyperbolic group. Proof. Hyperbolicity of curve graphs is the main result of [MM99]; more recently, elementary proofs of this were found in [Aou13, Bow14b, CRS15, HPW13, PS15]. Axioms 1, 2, 3 and 5 are clear. Both parts of axiom 4 can be found in [Beh06]. The nesting part is elementary, and a short elementary proof in the overlapping case was obtained by Leininger and can be found in [Man10]. Axiom 7 was proven in [MM00], and an elementary proof is available in [Web13]. In fact, in the aforementioned papers it is proven that there exists a constant C so that for any subsurface W , markings x, y and geodesic from πW pxq to πW pyq the following holds. If V Ď W and V ‰ W satisfies dV px, yq ě C then some curve along the given geodesic does not intersect BV . This implies Axiom 6, since we can take the Ti to be the complements of curves appearing along the aforementioned geodesic. Axiom 8 follows easily from the following statement, which clearly holds: For any given collection of disjoint subsurfaces and curves on the given subsurfaces, there exists a marking on S that contains the given curves as base curves (or, up to bounded error, transversals in the case that the corresponding subsurface is an annulus). Axiom 9 is hence the only delicate one. We are finished modulo this last axiom which we verify below in Proposition 11.2. l Proposition 11.2. pMpSq, Sq satisfies the uniqueness axiom, i.e., for each κ ě 0, there exists θu “ θu pκq such that if x, y P MpSq satisfy dU px, yq ď κ for each U P S then dMpSq px, yq ď θu . Proof. Note that when the complexity (as measured by the quantity 3g ` p ´ 3 where g is the genus and p the number of punctures) is less than 2 then MpSq is hyperbolic and thus the axiom holds. We thus will proceed by inducting on complexity: thus we will fix S to have HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 52 complexity at least 2 and assume that all the axioms for a hierarchically hyperbolic space, including the uniqueness axiom, hold for each proper subsurface of S. Now, fixed our surface S, the proof is by induction on dCS pbasepxq, basepyqq. If dCS pbasepxq, basepyqq “ 0, then x and y share some non-empty multicurve σ “ c1 Y ¨ ¨ ¨ Y ck . For x1 , y 1 the restrictions of x, y to S ´ σ we have that, by induction, dMpS´σq px1 , y 1 q is bounded in terms of κ. We then take the markings in a geodesic in MpS ´ σq from x1 to y 1 and extend these all in the same way to obtain markings in MpSq which yield a path in MpSq from x to ŷ whose length is bounded in terms of κ, where ŷ is the marking for which: ‚ ŷ has the same base curves as y, ‚ the transversal for each ci is the same as the corresponding transversal for x, and ‚ the transversal for each curve in basepyq ´ tci u is the same as the corresponding transversal for y. Finally, it is readily seen that dMpSq pŷ, yq is bounded in terms of κ because the transversals of each ci in the markings x and y are within distance κ of each other. This completes the proof of the base case of the Proposition. Suppose now that that the statement holds whenever dCS pbasepxq, basepyqq ď n, and let us prove it in the case dCS pbasepxq, basepyqq “ n ` 1. Let cx P basepxq and cy P basepyq satisfy dCS pcx , cy q “ n ` 1. Let cx “ σ0 , . . . , σn`1 “ cy be a tight geodesic (hence, each σi is a multicurve). Let σ be the union of σ0 and σ1 . Using the realization theorem in the subsurface S ´ σ we can find a marking x1 in S ´ σ whose projections onto each CU for U Ď S ´ σ coarsely coincide with πU pyq. Let x̂ be the marking for which: ‚ basepx̂q is the union of basepx1 q and σ, ‚ the transversal in x̂ of curves in basepx̂q X basepx1 q are the same as those in x1 , ‚ the transversal of cx in x̂ is the same as the one in x, ‚ the transversal in x̂ of a curve c in σ1 is πAc pyq, where Ac is an annulus around y. Note that dCS pbasepx̂q, basepyqq “ n. Hence, the following two claims conclude the proof. Claim 1. dMpSq px, x̂q is bounded in terms of κ. Proof. It suffices to show that we have a bound on dCU px, x̂q in terms of κ for each U Ď S ´ cx . In fact, once we do that, by induction on complexity we know that we can bound dMpS´cx q pz, ẑq, where z, ẑ are the restrictions of x, x̂ to S ´ cx , whence the conclusion easily follows. If U is contained in S ´ σ, then the required bound follows since πU px̂q coarsely coincides with πU px1 q in this case. If instead BU intersects σ1 , then πU px̂q coarsely coincides with πU pσ1 q. At this point, we only have to show that πU pσ1 q coarsely coincides with πU pyq, and in order to do so we observe that we can apply the bounded geodesic image theorem to the geodesic σ1 , . . . , σn`1 . In fact, σ1 intersects BU by hypothesis and σi intersects BU for i ě 3 because of the following estimate that holds for any given boundary component c of BU dCpSq pσi , cq ě dCpSq pσi , σ0 q ´ dCpSq pσ0 , cq ě i ´ 1 ą 1. Finally, σ2 intersects BU because of the definition of tightness: BU intersects σ1 , hence it must intersect σ0 Y σ2 . However, it does not intersect σ0 , whence it intersects σ2 .  Claim 2. There exists κ1 , depending on κ, so that for each subsurface U of S we have dCU px̂, yq ď κ1 . Proof. If σ0 intersects BU , then πU px̂q coarsely coincides with πU pσ0 q. In turn, πU pσ0 q coarsely coincides with πU pxq, which is κ–close to πU pyq. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA 53 On the other hand, if U does not intersect σ, then we are done by the definition of x1 . Hence, we can assume that U is contained in S´σ0 and that σ1 intersects BU . In particular, πU px̂q coarsely coincides with πU pσ1 q. But we showed in the last paragraph of the proof of Claim 1 that πU pσ1 q coarsely coincides with πU pyq, so we are done.  As explained above, the proofs of the above two claims complete the proof. l References [Ago13] Ian Agol. The virtual Haken conjecture (with an appendix by Ian Agol, Daniel Groves and Jason Manning). Doc. Math., J. DMV, 18:1045–1087, 2013. [Aou13] Tarik Aougab. Uniform hyperbolicity of the graphs of curves. Geometry & Topology, 17(5):2855– 2875, 2013. [BDS11] J. Behrstock, C. Druţu, and M. Sapir. Median structures on asymptotic cones and homomorphisms into mapping class groups. Proc. London Math. Soc., 102(3):503–554, 2011. [Beh06] J. Behrstock. Asymptotic geometry of the mapping class group and Teichmüller space. Geometry & Topology, 10:2001–2056, 2006. [BF92] M. Bestvina and M. Feighn. A combination theorem for negatively curved groups. J. Differential Geometry, 35:85–101, 1992. [BF02] M. Bestvina and K. Fujiwara. Bounded cohomology of subgroups of mapping class groups. Geometry & Topology, 6:69–89 (electronic), 2002. [BF14a] Mladen Bestvina and Mark Feighn. Hyperbolicity of the complex of free factors. Adv. Math., 256:104–155, 2014. [BF14b] Mladen Bestvina and Mark Feighn. Subfactor projections. J. Topol., 7(3):771–804, 2014. [BH] Jason Behrstock and Mark F. Hagen. Cubulated groups: thickness, relative hyperbolicity, and simplicial boundaries. Arxiv:1212.0182. To appear in Groups, Geometry, and Dynamics. [BHS14] Jason Behrstock, Mark F. Hagen, and Alessandro Sisto. Hierarchically hyperbolic spaces I: curve complexes for cubical groups. arXiv:1412.2171, 2014. [BKMM12] Jason Behrstock, Bruce Kleiner, Yair Minsky, and Lee Mosher. Geometry and rigidity of mapping class groups. Geom. Topol, 16(2):781–888, 2012. [BM08] Jason A Behrstock and Yair N Minsky. Dimension and rank for mapping class groups. Annals of Mathematics, 167:1055–1077, 2008. [BM11] Jason A. Behrstock and Yair N. Minsky. Centroids and the rapid decay property in mapping class groups. J. Lond. Math. Soc. (2), 84(3):765–784, 2011. [Bow13] Brian H. Bowditch. Coarse median spaces and groups. Pacific J. Math, 261(1):53–93, 2013. [Bow14a] Brian H Bowditch. Embedding median algebras in products of trees. Geometriae Dedicata, 170(1):157–176, 2014. [Bow14b] Brian H. Bowditch. Uniform hyperbolicity of the curve graphs. Pacific J. Math, 269(2):269–280, 2014. [Bow15] Brian H. Bowditch. Large–scale rigidity properties of the mapping class groups. Preprint, 2015. [Bri00] Peter Brinkmann. Hyperbolic automorphisms of free groups. Geometric & Functional Analysis, 10(5):1071–1089, 2000. [Bri10] Martin R Bridson. Semisimple actions of mapping class groups on CAT(0) spaces. Geometry of Riemann surfaces, 368:1–14, 2010. [BS05] S Buyalo and P Svetlov. Topological and geometric properties of graph-manifolds. St. Petersburg Mathematical Journal, 16(2):297–340, 2005. [BV] M R Bridson and K Vogtmann. The Dehn functions of OutpFn q and AutpFn q. arXiv:1011.1506. [BV95] M R Bridson and K Vogtmann. On the geometry of the automorphism group of a free group. Bulletin of the London Mathematical Society, 27(6):544–552, 1995. [CDH10] Indira Chatterji, Cornelia Druţu, and Frédéric Haglund. Kazhdan and Haagerup properties from the median viewpoint. Advances in Mathematics, 225(2):882–921, 2010. [Che00] Victor Chepoi. Graphs of some CATp0q complexes. Adv. in Appl. Math., 24(2):125–179, 2000. [CLM12] Matt T. Clay, Christopher J. Leininger, and Johanna Mangahas. The geometry of right-angled Artin subgroups of mapping class groups. Groups Geom. Dyn., 6(2):249–278, 2012. [CRS15] Matt Clay, Kasra Rafi, and Saul Schleimer. Uniform hyperbolicity of the curve graph via surgery sequences. Algebraic and Geometric Topology, 14(6):3325–3344, 2015. [DHS15] Matthew Gentry Durham, Mark F. Hagen, and Alessandro Sisto. Boundaries of hierarchically hyperbolic spaces. In preparation, 2015. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA [Dil50] [DS05] [DT14] [FLS11] [Ger92] [GHR03] [Hae14] [Hag07] [Hag14] [HM13a] [HM13b] [HP13] [HPW13] [HW15] [KK14] [KL96] [KL97] [KL98] [Liu11] [Man10] [MM99] [MM00] [MO14] [Mos95] [PS15] [PW11] [Rie01] [Sis11] [Sis12] [Sis13] [SS] [Web13] [Wis14] [Woo15] 54 R. P. Dilworth. A decomposition theorem for partially ordered sets. Ann. of Math, 51:161–166, 1950. C. Druţu and M. Sapir. Tree-graded spaces and asymptotic cones of groups. Topology, 44(5):959– 1058, 2005. With an appendix by Denis Osin and Mark Sapir. Matthew Gentry Durham and Samuel J Taylor. Convex cocompactness and stability in mapping class groups. arXiv:1404.4803, 2014. Roberto Frigerio, Jean-François Lafont, and Alessandro Sisto. Rigidity of high dimensional graph manifolds. arXiv:1107.2019, 2011. To appear in Asterisque. Stephen M Gersten. Dehn functions and `1 -norms of finite presentations. Springer, 1992. Steve M Gersten, Derek F Holt, and Tim R Riley. Isoperimetric inequalities for nilpotent groups. Geometric & Functional Analysis, 13(4):795–814, 2003. Thomas Haettel. Higher rank lattices are not coarse median. arXiv:1412.1714, 2014. Frédéric Haglund. Isometries of CAT(0) cube complexes are semi-simple. arXiv:0705.3386, 2007. Mark F. Hagen. Weak hyperbolicity of cube complexes and quasi-arboreal groups. J. Topol., 7(2):385–418, 2014. Michael Handel and Lee Mosher. The free splitting complex of a free group, I: hyperbolicity. Geom. Topol., 17(3):1581–1672, 2013. Michael Handel and Lee Mosher. Lipschitz retraction and distortion for subgroups of OutpFn q. Geometry & Topology, 17(3):1535–1579, 2013. Mark F. Hagen and Piotr Przytycki. Cocompactly cubulated graph manifolds. To appear in Isr. J. Math. arXiv:1310.1309, 2013. Sebastian Hensel, Piotr Przytycki, and Richard CH Webb. Slim unicorns and uniform hyperbolicity for arc graphs and curve graphs. arXiv:1301.5577, 2013. Mark F. Hagen and Daniel T. Wise. Cubulating hyperbolic free-by-cyclic groups: the general case. Geometric and Functional Analysis, 25(1):134–179, 2015. Sang-Hyun Kim and Thomas Koberda. The geometry of the curve graph of a right-angled Artin group. International Journal of Algebra and Computation, 24(02):121–169, 2014. Michael Kapovich and Bernhard Leeb. Actions of discrete groups on nonpositively curved spaces. Math. Ann., 306(2):341–352, 1996. M. Kapovich and B. Leeb. Quasi-isometries preserve the geometric decomposition of Haken manifolds. Invent. Math., 128(2):393–416, 1997. M. Kapovich and B. Leeb. 3-manifold groups and nonpositive curvature. Geom. Funct. Anal., 8(5):841–852, 1998. Yi Liu. Virtual cubulation of nonpositively curved graph manifolds. ArXiv:1110.1940, 2011. Johanna Mangahas. Uniform uniform exponential growth of subgroups of the mapping class group. Geometric and Functional Analysis, 19(5):1468–1480, 2010. Howard A Masur and Yair N Minsky. Geometry of the complex of curves I: Hyperbolicity. Inventiones mathematicae, 138(1):103–149, 1999. Howard A Masur and Yair N Minsky. Geometry of the complex of curves II: Hierarchical structure. Geometric and Functional Analysis, 10(4):902–974, 2000. Ashot Minasyan and Denis Osin. Acylindrical hyperbolicity of groups acting on trees. Mathematische Annalen, pages 1–51, 2014. L. Mosher. Mapping class groups are automatic. Ann. of Math., 142:303–384, 1995. Piotr Przytycki and Alessandro Sisto. A note on acylindrical hyperbolicity of mapping class groups. arXiv:1502.02176, 2015. Piotr Przytycki and Daniel T. Wise. Graph manifolds with boundary are virtually special. ArXiv:1110.3513, 2011. E. Rieffel. Groups quasi-isometric to H2 ˆ R. J. London Math. Soc. (2), 64(1):44–60, 2001. Alessandro Sisto. 3-manifold groups have unique asymptotic cones. arXiv:1109.4674, 2011. Alessandro Sisto. On metric relative hyperbolicity. arXiv:1210.8081, 2012. Alessandro Sisto. Projections and relative hyperbolicity. Enseignment Math., (59):165–181, 2013. L. Sabalka and D. Savchuk. Submanifold projection. arXiv:1211.3111. Richard CH Webb. A short proof of the bounded geodesic image theorem. arXiv:1301.6187, 2013. Daniel Wise. Cubular tubular groups. Transactions of the American Mathematical Society, 366(10):5503–5521, 2014. Daniel J Woodhouse. Classifying finite dimensional cubulations of tubular groups. arXiv:1502.02619, 2015. HHS II: COMBINATION THEOREMS AND THE DISTANCE FORMULA Lehman College and The Graduate Center, CUNY, New York, New York, USA Current address: Barnard College, Columbia University, New York, New York, USA E-mail address: [email protected] Dept. of Pure Maths and Math. Stat., University of Cambridge, Cambridge, UK E-mail address: [email protected] ETH, Zürich, Switzerland E-mail address: [email protected] 55
4math.GR
A Self-Taught Artificial Agent for Multi-Physics Computational Model Personalization Dominik Neumanna,c,∗, Tommaso Mansib , Lucian Itud,e , Bogdan Georgescub , Elham Kayvanpourf , Farbod Sedaghat-Hamedanif , Ali Amrf , Jan Haasf , Hugo Katusf , Benjamin Mederf , Stefan Steidlc , Joachim Horneggerc , Dorin Comaniciub arXiv:1605.00303v1 [cs.CE] 1 May 2016 a Medical Imaging Technologies, Siemens Healthcare GmbH, Erlangen, Germany b Medical Imaging Technologies, Siemens Healthcare, Princeton, USA c Pattern Recognition Lab, FAU Erlangen-Nürnberg, Erlangen, Germany d Siemens Corporate Technology, Siemens SRL, Brasov, Romania e Transilvania University of Brasov, Brasov, Romania f Department of Internal Medicine III, University Hospital Heidelberg, Germany Abstract Personalization is the process of fitting a model to patient data, a critical step towards application of multi-physics computational models in clinical practice. Designing robust personalization algorithms is often a tedious, time-consuming, model- and data-specific process. We propose to use artificial intelligence concepts to learn this task, inspired by how human experts manually perform it. The problem is reformulated in terms of reinforcement learning. In an off-line phase, Vito, our self-taught artificial agent, learns a representative decision process model through exploration of the computational model: it learns how the model behaves under change of parameters. The agent then automatically learns an optimal strategy for on-line personalization. The algorithm is model-independent; applying it to a new model requires only adjusting few hyper-parameters of the agent and defining the observations to match. The full knowledge of the model itself is not required. Vito was tested in a synthetic scenario, showing that it could learn how to optimize cost functions generically. Then Vito was applied to the inverse problem of cardiac electrophysiology and the personalization of a whole-body circulation model. The obtained results suggested that Vito could achieve equivalent, if not better goodness of fit than standard methods, while being more robust (up to 11% higher success rates) and with faster (up to seven times) convergence rate. Our artificial intelligence approach could thus make personalization algorithms generalizable and self-adaptable to any patient and any model. ∗ Corresponding author Email address: [email protected] (Dominik Neumann) Preprint submitted to Medical Image Analysis May 3, 2016 Keywords: Computational Modeling, Model Personalization, Reinforcement Learning, Artificial Intelligence. 1. Introduction Computational modeling attracted significant attention in cardiac research over the last decades (Clayton et al., 2011; Frangi et al., 2001; Hunter and Borg, 2003; Kerckhoffs et al., 2008; Krishnamurthy et al., 2013; Kuijpers et al., 2012; Noble, 2002). It is believed that computational models can improve patient stratification and therapy planning. They could become the enabling tool for predicting disease course and therapy outcome, ultimately leading to improved clinical management of patients suffering from cardiomyopathies (Kayvanpour et al., 2015). A crucial prerequisite for achieving these goals is precise model personalization: the computational model under consideration needs to be fitted to each patient. However, the high complexity of cardiac models and the often noisy and sparse clinical data still hinder this task. A wide variety of manual and (semi-)automatic model parameter estimation approaches have been explored, including Aguado-Sierra et al. (2010, 2011); Augenstein et al. (2005); Chabiniok et al. (2012); Delingette et al. (2012); Itu et al. (2014); Konukoglu et al. (2011); Le Folgoc et al. (2013); Marchesseau et al. (2013); Neumann et al. (2014a,b); Prakosa et al. (2013); Schmid et al. (2006); Seegerer et al. (2015); Sermesant et al. (2009); Wallman et al. (2014); Wang et al. (2009); Wong et al. (2015); Xi et al. (2013); Zettinig et al. (2014). Most methods aim to iteratively reduce the misfit between model output and measurements using optimization algorithms, for instance variational (Delingette et al., 2012) or filtering (Marchesseau et al., 2013) approaches. Applied blindly, those techniques could easily fail on unseen data, if not supervised, due to parameter ambiguity, data noise and local minima (Konukoglu et al., 2011; Neumann et al., 2014a; Wallman et al., 2014). Therefore, complex algorithms have been designed combining cascades of optimizers in a very specific way to achieve high levels of robustness, even on larger populations, i.e. 10 or more patients (Kayvanpour et al., 2015; Neumann et al., 2014b; Seegerer et al., 2015). However, those methods are often designed from tedious, trial-and-error-driven manual tuning, they are model-specific rather than generic, and their generalization to varying data quality cannot be guaranteed. On the contrary, if the personalization task is assigned to an experienced human, given enough time, he almost always succeeds in manually personalizing a model for any subject (although solution uniqueness is not guaranteed, but this is inherent to the problem). There are several potential reasons why a human expert is often superior to standard automatic methods in terms of personalization accuracy and success rates. First, an expert is likely to have an intuition of the 2 model’s behavior from his prior knowledge of the physiology of the modeled organ. Second, knowledge about model design and assumptions, and model limitations and implementation details certainly provide useful hints on the “mechanics” of the model. Third, past personalization of other datasets allows the expert to build up experience. The combination of prior knowledge, intuition and experience enables to solve the personalization task more effectively, even on unseen data. Inspired by humans and contrary to previous works, we propose to address the personalization problem from an artificial intelligence (AI) perspective. In particular, we apply reinforcement learning (RL) methods (Sutton and Barto, 1998) developed in the AI community to solve the parameter estimation task for computational physiological models. With its roots in control theory on the one hand, and neuroscience theories of learning on the other hand, RL encompasses a set of approaches to make an artificial agent learn from experience generated by interacting with its environment. Contrary to standard (supervised) machine learning (Bishop, 2006), where the objective is to compute a direct mapping from input features to a classification label or regression output, RL aims to learn how to perform tasks. The goal of RL is to compute an optimal problem-solving strategy (agent behavior), e.g. a strategy to play the game “tic-tac-toe” successfully. In the AI field, such a behavior is often represented as a policy, a mapping from states, describing the current “situation” the agent finds itself in (e.g. the current locations of all “X” and “O” on the tic-tac-toe grid), to actions, which allow the agent to interact with the environment (e.g. place “X” on an empty cell) and thus influence that situation. The key underlying principle of RL is that of reward (Kaelbling et al., 1996), which provides an objective means for the agent to judge the outcome of its actions. In tic-tac-toe, the agent receives a high, positive reward if the latest action led to a horizontal, vertical or diagonal row full of “X” marks (winning), and a negative reward (punishment) if the latest action would allow the opponent to win in his next move. Based on such rewards, the artificial agent learns an optimal winning policy through trial-and-error interactions with the environment. RL was first applied to game (e.g. Tesauro, 1994) or simple control tasks. However, the past few years saw tremendous breakthroughs in RL for more complex, real-world problems (e.g. Barreto et al., 2014; Kveton and Theocharous, 2012; Nguyen-Tuong and Peters, 2011). Some noteworthy examples include Mülling et al. (2013), where the control entity of a robot arm learned to select appropriate motor primitives to play table tennis, and Mnih et al. (2015), where the authors combine RL with deep learning to train an agent to play 49 Atari games, yielding better performance than an expert in the majority of them. Motivated by these recent successes and building on our previous work (Neumann et al., 2015), we propose an RL-based personalization approach, henceforth called Vito, with the goal of designing a framework that can, for 3 Off-line phase Assimilate model behavior On-line phase Learn optimal personalization strategy Personalize model for new patients Figure 1: Overview of Vito: a self-taught artificial agent for computational model personalization, inspired by how human operators approach the personalization problem. the first time to our knowledge, learn by itself how to estimate model parameters from clinical data while being model-independent. As illustrated in Fig. 1, first, like a human expert, Vito assimilates the behavior of the physiological model under consideration in an off-line, one-time only, data-driven exploration phase. From this knowledge, Vito learns the optimal strategy using RL (Sutton and Barto, 1998). The goal of Vito during the on-line personalization phase is then to sequentially choose actions that maximize future rewards, and therefore bring Vito to the state representing the solution of the personalization problem. To setup the algorithm, the user needs to define what observations need to be matched, the allowed actions, and a single hyper-parameter related to the desired granularity of the state-space. Then everything is learned automatically. The algorithm does not depend on the underlying model. Vito was evaluated on three different tasks. First, in a synthetic experiment, convergence properties of the algorithm were analyzed. Then, two tasks involving real clinical data were evaluated: the inverse problem of cardiac electrophysiology and the personalization of a lumped-parameter model of whole-body circulation. The obtained results suggested that Vito can achieve equivalent (or better) goodness of fit as standard optimization methods, increased robustness and faster convergence rates. A number of novelties and improvements over Neumann et al. (2015) are featured in this manuscript. First, an automatic, data-driven statespace quantization method is introduced that replaces the previous manual technique. Second, the need to provide user-defined initial parameter values is eliminated by employing a new data-driven technique to initialize personalization of unseen data. Third, a stochastic personalization policy is introduced, for which the previously used standard deterministic policy is a special case. Fourth, the convergence properties are evaluated in parameter space using a synthetic personalization scenario. In addition, thorough evaluation of Vito’s performance with increasing amount of training samples was conducted and personalization of the whole-body circulation model was extended to several variants involving two to six parameters. Finally, the patient database used for experimentation was extended from 28 to 83 patients for the cardiac electrophysiology experiments, and from 27 to 56 for the whole-body circulation experiments. 4 The remainder of this manuscript is organized as follows. Sec. 2 presents the method. In Sec. 3, the experiments are described and the results are presented. Sec. 4 concludes the manuscript with a summary and discussions about potential limitations and extensions of the method. 2. Method This section presents the reinforcement-learning (RL) framework for computational model personalization. Sec. 2.1 introduces Markov decision process (MDP). Sec. 2.2 defines the personalization problem and how it can be reformulated in terms of an MDP. Sec. 2.3 describes how the artificial agent, Vito, learns how the model behaves. Next, Sec. 2.4 provides details about state-space quantization, and Sec. 2.5 describes how the model knowledge is encoded in the form of transition probabilities. All steps mentioned so far are performed in an off-line training phase. Finally, Sec. 2.6 explains how the learned knowledge is applied on-line to personalize unseen data. 2.1. Model-based Reinforcement Learning 2.1.1. MDP Definition A crucial prerequisite for applying RL is that the problem of interest, here personalization, can be modeled as a Markov decision process (MDP). An MDP is a mathematical framework for modeling decision making when the decision outcome is partly random and partly controlled by a decision maker (Sutton and Barto, 1998). Formally, an MDP is a tuple M = (S, A, T , R, γ), where: • S is the finite set of states that describe the agent’s environment, nS is the number of states, and st ∈ S is the state at time t. • A is the finite set of actions, which allow the agent to interact with the environment, nA is the number of actions, and at ∈ A denotes the action performed at time t. • T : S × A × S → [0; 1] is the stochastic transition function, where T (st , at , st+1 ) describes the probability of arriving in state st+1 after the agent performed action at in state st . • R : S × A × S → R is the scalar reward function, where rt+1 = R(st , at , st+1 ) is the immediate reward the agent receives at time t + 1 after performing action at in state st resulting in state st+1 . • γ ∈ [0; 1] is the discount factor that controls the importance of future versus immediate rewards. 5 2.1.2. Value Iteration The value of a state, V ∗ (s), is the expected discounted reward the agent accumulates when it starts in state s and acts optimally in each step: (∞ ) X ∗ k V (s) = E γ rt+k+1 st = s , (1) k=0 where E{} denotes the expected value given the agent always selects the optimal action, and t is any time step. Note that the discount factor γ is a constant and the superscript k its exponent. V ∗ can be computed using value iteration (Sutton and Barto, 1998), an iterative algorithm based on dynamic programming. In the first iteration i = 0, let Vi : S → R denote an initial guess for the value function that maps states to arbitrary values. Further, let Qi : S × A → R denote the ith “state-action value function”guess, which is computed as: X   Qi (s, a) = T (s, a, s0 ) R(s, a, s0 ) + γVi (s0 ) . (2) s0 ∈S Value iteration iteratively updates Vi+1 from the previous Qi : ∀s ∈ S : Vi+1 (s) = max Qi (s, a) , a∈A (3) until the left- and right-hand side of Eq. 3 are equal for all s ∈ S; then V ∗ ← Vi+1 and Q∗ ← Qi+1 . From this equality relation, also known as the Bellman equation (Bellman, 1957), one can obtain an optimal problemsolving strategy for the problem described by the MDP (assuming that all components of the MDP are known precisely). It is encoded in terms of a deterministic optimal policy π ∗ : S → A: π ∗ (s) = arg max Q∗ (s, a) , (4) a∈A i.e. a mapping that tells the agent in each state the optimal action to take. 2.1.3. Stochastic Policy In this work not all components of the MDP are known precisely, instead some are approximated from training data. Value iteration, however, assumes an exact MDP to guarantee optimality of the computed policy. Therefore, instead of relying on the deterministic policy π ∗ (Eq. 4), a generalization to stochastic policies π̃ ∗ is proposed here to mitigate potential issues due to approximations. Contrary to Eq. 4, where for each state only the one action with maximum Q∗ -value is considered, a stochastic policy stores several candidate actions with similar high Q∗ -value and returns one 6 Model parameters Model Model state Objectives Measured data Patient Figure 2: A computational model f is a dynamic system that maps model input parameters x to model state (output) variables y. The goal of personalization is to tune x such that the objectives c, defined as the misfit between y and the corresponding measured data z of a given patient, are optimized (the misfit is minimized). of them through a random process each time it is queried. To this end, the Q∗ (s, ·)-values for a given state s are first normalized: Q̃∗s (a) = Q∗ (s, a) − mina0 ∈A [Q∗ (s, a0 )] . maxa0 ∈A [Q∗ (s, a0 )] − mina0 ∈A [Q∗ (s, a0 )] (5) All actions whose normalized Q̃∗s -value is below a threshold of  = 54 (set empirically and used throughout the entire manuscript) are discarded, while actions with large values are stored as potential candidates. Each time the stochastic policy is queried, a = π̃∗ (s), it returns one of the candidate actions P a selected randomly with probability proportional to its Q̃∗s -value: ∗ Q̃s (a)/ a0 Q̃∗s (a0 ); the sum is over all candidate actions a0 . 2.2. Reformulation of the Model Personalization Problem into an MDP 2.2.1. Problem Definition As illustrated in Fig. 2, any computational model f is governed by a set of parameters x = (x1 , . . . , xnx )> , where nx denotes the number of parameters. x is bounded within a physiologically plausible domain Ω, and characterized by a number of ny (observable) state variables y = (y1 , . . . , yny )> . The state variables can be used to estimate x. Note that some parameters may be pre-estimated or assigned fixed values. The goal of personalization is to optimize a set of nc objectives c = (c1 , . . . , cnc )> . The objectives are scalars defined as ci = d(yi , zi ), where d is a measure of misfit, and zi denotes the patient’s measured data (z) corresponding to yi . In this work d(yi , zi ) = yi −zi . Personalization is considered successful if all user-defined convergence criteria ψ = (ψ1 , . . . , ψnc )> are met. The criteria are defined in terms of maximum acceptable misfit per objective: ∀i ∈ {1, . . . , nc } : |ci | < ψi . 2.2.2. Problem Reformulation Personalization is mapped to a Markov decision process as follows: States: An MDP state encodes the misfit between the computed model state (outcome of forward model run) and the patient’s measurements. Thus, MDP states carry the same type of information as objective vectors c, yet the number of MDP states has to be finite (Sec. 2.1), while there are an infinite number of different objective vectors due to their continuous nature. Therefore the space of objective vectors in Rnc is reduced to a finite set of 7 representative states: the MDP states S, each s ∈ S covering a small region in that space. One of those states, ŝ ∈ S, encodes personalization success as it is designed such that it covers exactly the region where all convergence criteria are satisfied. The goal of Vito is to learn how to reach that state. Actions: Vito’s actions modify the parameters x to fulfill the objectives c. An action a ∈ A consists in either in- or decrementing one parameter xi by 1×, 10× or 100× a user-specified reference value δi with δ = (δ1 , . . . , δnx )> . This empirically defined quantization of the intrinsically continuous action space yielded good results for the problems considered in this work. Transition function: T encodes the agents knowledge about the computational model f and is learned automatically as described in Sec. 2.5. Rewards: Inspired by the “mountain car” benchmark (Sutton and Barto, 1998), the rewards are defined as always being equal to R(s, a, s0 ) = −1 (punishment), except when the agent performs an action resulting in personalization success, i.e. when s0 = ŝ. In that case, R(·, ·, ŝ) = 0 (no punishment). Discount factor: The large discount factor γ = 0.99 encourages policies that favor future over immediate rewards, as Vito should always prefer the long-term goal of successful personalization to short-term appealing actions in order to reduce the risk of local minima. 2.3. Learning Model Behavior through Model Exploration Like a human operator, Vito first learns how the model “behaves” by experimenting with it. This is done through a “self-guided sensitivity analysis”. A batch of sample transitions is collected through model exploration episodes E p = {ep1 , ep2 , . . . }. An episode epi is a sequence of ne-steps consecutive transitions generated from the model f and the patient p for whom the target measurements zp are known. An episode is initiated at time t = 0 by generating random initial model parameters xt within the physiologically plausible domain Ω. From the outputs of a forward model run yt = f (xt ), the misfits to the patient’s corresponding measurements are computed, yielding the objectives vector ct = d(yt , zp ). Next, a random exploration policy πrand that selects an action according to a discrete uniform probability distribution over the set of actions is employed. The obtained at ∈ A is then applied to the current parameter vector, yielding modified parameter values xt+1 = at (xt ). From the output of the forward model run yt+1 = f (xt+1 ) the next objectives ct+1 are computed. The next action at+1 is then selected according to πrand , and this process is repeated ne-steps − 1 times. Hence, each episode can be seen as a set of consecutive tuples: e = {(xt , yt , ct , at , xt+1 , yt+1 , ct+1 ), t = 0, . . . , ne-steps − 1} . (6) In this work, ne-steps = 100 transitions are created in each episode as a tradeoff between sufficient length of an episode to cover a real personalization scenario and sufficient exploration of the parameter space. 8 The model is explored with many different training patients and the S resulting episodes are combined into one large training episode set E = p E p . The underlying hypothesis (verified in experiments) is that the combined E allows to cancel out peculiarities of individual patients, i.e. to abstract from patient-specific to model-specific knowledge. 2.4. From Computed Objectives to Representative MDP State As mentioned above, the continuous space of objective vectors is quantized into a finite set of representative MDP states S. A data-driven approach is proposed. First, all objective vectors observed during training are clustered according to their distance to each other. Because the ranges of possible values for the individual objectives can vary significantly depending on the selected measurements (due to different types of measurements, different units, etc.), the objectives should be normalized during clustering to avoid bias towards objectives with relatively large typical values. In this work the distance measure performs implicit normalization to account for these differences: the distance between two objective vectors (c1 , c2 ) is defined relative to the inverse of the convergence criteria ψ: q kc1 − c2 kψ = (c1 − c2 )> diag(ψ)−1 (c1 − c2 ) , (7) where diag(ψ)−1 denotes a diagonal matrix with ( ψ11 , ψ12 , . . . ) along its diagonal. The centroid of a cluster is the centroid of a representative state. In addition, a special “success state” ŝ representing personalization success is created, which covers the region in state-space where all objectives are met: ∀i : |ci | < ψi . The full algorithm is described in Appendix A. Finally, an operator φ : Rnc → S that maps continuous objective vectors c to representative MDP states is introduced: φ(c) = arg min kc − ξs kψ (8) s∈S where ξs denotes the centroid corresponding to state s. For an example state-space quantization see Fig. 3. 2.5. Transition Function as Probabilistic Model Representation In this work, the stochastic MDP transition function T encodes the agent’s knowledge about the computational model f . It is learned from the training data E. First, the individual samples (xt , yt , ct , at , xt+1 , yt+1 , ct+1 ) are converted to state-action-state transition tuples Ê = {(s, a, s0 )}, where s = φ(ct ), a = at and s0 = φ(ct+1 ). Then, T is approximated from statistics over the observed transition samples: T (s, a, s0 ) = P {(s, a, s0 ) ∈ Ê} , s00 ∈S 9 {(s, a, s00 ) ∈ Ê} (9) Data-driven quantization Manual quantization 150 150 100 100 50 50 0 0 -50 -50 -100 -100 -150 -150 -150 -100 -50 0 50 100 150 -150 -100 -50 0 50 100 150 Figure 3: State-space quantization. Left: Example data-driven quantization of a twodimensional state-space into nS = 120 representative states. The states are distributed according to the observed objective vectors c in one of the experiments in Sec. 3.2. The objectives were QRS duration [ms] (c1 ) and electrical axis [deg] (c2 ). The center rectangle (green region) denotes the success state ŝ where all objectives are met (∀i : |ci | < ψi ); see text for details. Right: Manual quantization as used in Neumann et al. (2015). where |{·}| denotes the cardinality of the set {·}. If nS and nA are large compared to the total number of samples it may occur that some stateaction combinations are not observed: |{(s, a, ·) ∈ Ê}| = 0. In that case uniformity is assumed: ∀s00 ∈ S : T (s, a, s00 ) = 1/nS . M is now fully defined. Value iteration (Sec. 2.1) is applied and the stochastic policy π̃∗ is computed, which completes the off-line phase. 2.6. On-line Model Personalization On-line personalization, as illustrated in Fig. 4, can be seen as a two-step procedure. First, Vito initializes the personalization of unseen patients from training data. Second, Vito relies on the computed policy π̃∗ to guide the personalization process. 2.6.1. Data-driven Initialization Good initialization can be decisive for a successful personalization. Vito’s strategy is to search for forward model runs in the training database E for which the model state f (x) = y ≈ zp is similar to the patient’s measurements. To this end, Vito examines all parameters Ξ = {x ∈ E | f (x) ≈ zp } that yielded model states similar to the patient’s measurements. Due to ambiguities induced by the different training patients, data noise and model assumptions, Ξ could contain significantly dissimilar parameters. Hence, picking a single x ∈ Ξ might not yield the best initialization. Analyzing Ξ probabilistically instead helps Vito to find likely initialization candidates. The details of the initialization procedure are described in Appendix B. 10 Unseen patient Personalized parameters Initialization Run forward model Update parameters Check convergence Observe state Select action and detect oscillations Figure 4: Vito’s probabilistic on-line personalization phase. See text for details. Given the patient’s measurements zp , the procedure outputs a list of initialization candidates X0 = (x00 , x000 , . . . ). The list is sorted by likelihood with the first element, x00 , being the most likely one. 2.6.2. Probabilistic Personalization The first personalization step initializes the model parameter vector x0 with the most likely among all initialization candidates, x0 ∈ X0 (see previous section for details). Then, as illustrated in Fig. 4, Vito computes the forward model y0 = f (x0 ) and the misfit between the model output and the patient’s measurements c0 = d(y0 , zp ) to derive the first state s0 = φ(c0 ). Given s0 , Vito decides from its policy the first action to take a0 = π̃∗ (s0 ), and walks through state-action-state sequences to personalize the computational model f by iteratively updating the model parameters through MDP actions. Bad initialization could lead to oscillations between states as observed in previous RL works (Kveton and Theocharous, 2012; Neumann et al., 2015). Therefore, upon detection of an oscillation, which is done by monitoring the parameter traces to detect recurring sets of parameter values, the personalization is re-initialized at the second-most-likely x0 ∈ X0 , etc. If all |X0 | initialization candidates have been tested, a potential re-initialization defaults to fully random within the physiologically plausible parameter domain Ω. The process terminates once Vito reaches state ŝ (success), or when a pre-defined maximum number of iterations is reached (failure). 3. Experiments Vito was applied to a synthetic parameter estimation problem and to two challenging problems involving real clinical data: personalization of a cardiac electrophysiology (EP), and a whole-body-circulation (WBC) model. All experiments were conducted using leave-one-out cross-validation. The numbers of datasets and transition samples used for the different experiments are denoted ndatasets and nsamples , respectively. 3.1. Synthetic Experiment: the Rosenbrock Function First, Vito was employed in a synthetic scenario, where the ground-truth model parameters were known. The goals were to test the ability of Vito to 11 5 ≥5 0.25 4.5 4 2 3.5 0.25 3 1 3 0 2.5 2 0.25 -1 -2 1.5 1 -4 0.5 -5 -5 -4 -3 -2 -1 0.25 -3 0 1 2 3 4 5 -5 -4 -3 -2 -1 0 1 2 3 4 5 -5 -4 -3 -2 -1 0 1 2 3 4 5 Maximum observerd error 4 0 Figure 5: Synthetic experiment. Left: Contour plot of the Rosenbrock function f α=1 with global minimum at x = (1, 1)> (red dot). The color scale is logarithmic for visualization purposes: the darker, the lower the function value. Mid: Maximum L2 -error in parameter space after personalization over all functions for varying initial parameter values. See text for details. Yellow represents errors ≥ 5 (maximum observed error ≈ 110). Right: Same as mid panel, except the extended action set was used. The red dots are the 100 groundtruth parameters x = (α, α2 )> generated for random α. optimize cost functions generically, and to directly evaluate the performance in the parameter space. 3.1.1. Forward Model Description The Rosenbrock function (Rosenbrock, 1960), see Fig. 5, left panel, is a non-convex function that is often used to benchmark optimization algorithms. It was treated as the forward model in this experiment: f α (x1 , x2 ) = (α − x1 )2 + 100 · (x2 − x21 )2 , (10) where x = (x1 , x2 )> were the model parameters to estimate for any α, and f α : Ω → R. As described in Sec. 2.2.2, each of Vito’s actions a ∈ A in- or decrements a parameter value by multiples (1×, 10×, 100×) of parameterspecific reference values. The reference values were set to δ = (0.01, 0.01)> , determined as 0.1% of the defined admissible parameter space per dimension, Ω = [−5; 5]2 . The parameter α ∈ R defines a family of functions {f α }. The goal was to find generically arg minx1 ,x2 f α (x1 , x2 ). The Rosenbrock function has a unique global minimum at x = (α, α2 )> , where both terms T1 = (α − x1 ) and T2 = (x2 − x21 ) evaluate to 0. The personalization objectives were therefore defined as c = (|T1 − 0|, |T2 − 0|)> , with the measured data z = (0, 0)> were zero for both objectives and the computed data y = (T1 , T2 )> . The convergence criteria were set empirically to ψ = (0.05, 0.05)> . 3.1.2. Evaluation Vito was evaluated on ndatasets = 100 functions f α with randomly generated α ∈ [−2, 2]. In the off-line phase, for each function, nsamples = 12 10 · ne-steps = 1000 samples, i.e. ten training episodes, each consisting in ne-steps = 100 transitions (Sec. 2.3), were generated to learn the policy. The number of representative states was set to nS = 100. To focus on Vito’s on-line personalization capabilities, both the data-driven initialization and the re-initialization on oscillation (Sec. 2.6) were disabled. In total, 441 experiments with different initializations (sampled on a 21 × 21 uniform grid spanned in Ω) were conducted. For each experiment all 100 functions were personalized using leave-one-family-function-out cross validation, and the error value from the function exhibiting the maximum L2 -error (worst-case scenario) between ground-truth (α, α2 ) and estimated parameters was plotted. As one can see from the large blue region in Fig. 5, mid panel, for the majority of initial parameter values Vito always converged to the solution (maximum L2 -error < 0.25; the maximum achievable accuracy depended on the specified convergence criteria ψ and on the reference values δ, which “discretized” the parameter space). However, especially for initializations far from the ground-truth (near border regions of Ω), Vito was unable to personalize some functions properly, which was likely due to the high similarity of the Rosenbrock function shape in these regions. To investigate this issue, the experiment was repeated after additional larger parameter steps were added to the set of available actions: A0 = A ∪ {±500δ1 ; ±500δ2 }. As shown in Fig. 5, right panel, Vito could now personalize successfully starting from any point in Ω. The single spot with larger maximum error (bright spot at approximately x = (−1, 2)> ) can be explained by Vito’s stochastic behavior: Vito may have become unlucky if it selected many unfavorable actions in sequence due to the randomness introduced by the stochastic policy. Enabling re-initialization on oscillation solved this issue entirely. In conclusion, this experiment showed that Vito can learn how to minimize a cost function generically. 3.2. Personalization of Cardiac Electrophysiology Model Vito was then tested in a scenario involving a complex model of cardiac electrophysiology coupled with 12-lead ECG. Personalization was performed for real patients from actual clinical data. A total of ndatasets = 83 patients were available for experimentation. For each patient, the end-diastolic bi-ventricular anatomy was segmented from short-axis cine magnetic resonance imaging (MRI) stacks as described in Zheng et al. (2008). A tetrahedral anatomical model including myofibers was estimated and a torso atlas affinely registered to the patient based on MRI scout images. See Zettinig et al. (2014) for more details. 3.2.1. Forward Model Description The depolarization time at each node of the tetrahedral anatomical model was computed using a shortest-path graph-based algorithm, similar 13 to the one proposed in Wallman et al. (2012). Tissue anisotropy was modeled by modifying the edge costs to take into account fiber orientation. A time-varying voltage map was then derived according to the depolarization time: at a given time t, mesh nodes whose depolarization time was higher than t were assigned a trans-membrane potential of −70 mV, 30 mV otherwise. The time-varying potentials were then propagated to a torso model where 12-lead ECG acquisition was simulated, and QRS duration (QRSd) and electrical axis (EA) were derived (Zettinig et al., 2014). The model was controlled by the conduction velocities (in m/s) of myocardial tissue and left and right Purkinje network: x = (vMyo , vLV , vRV )> . The latter two domains were modeled as fast endocardial conducting tissue. The admissible parameter space Ω was set to [200; 1000] for vMyo and [500; 5000] for both vLV and vRV . Reference increment values to build the action set A were set to δ = (5, 5, 5)> m/s for the three model parameters. The goal of EP personalization was to estimate x from the measured QRSd and EA. Accounting for uncertainty in the measurements and errors in the model, a patient was considered personalized if QRSd and EA misfits were below ψ = (5 ms, 10◦ )> , respectively. 3.2.2. Number of Representative States In contrast to Neumann et al. (2015), where state-space quantization required manual tuning of various threshold values, the proposed approach relies on a single hyper-parameter only: nS , the number of representative states (Sec. 2.4). To specify nS , eight patients were selected for scouting. Exhaustive search was performed for nS ∈ {10, 20, . . . , 490, 500} representative states. The goodness of a given configuration was evaluated based on the success rate (relative number of successfully personalized cases according to convergence criteria ψ) over five independent, consecutive, leaveone-patient-out cross-validated personalization runs of the eight patients. Furthermore, the average number of required forward model runs was considered. To this end, 100 training episodes (100·ne-steps = 104 transition samples) per patient were generated for each personalization run as described in Sec. 2.3. As one can see from Fig. 6, good performance was achieved from 50 to 300 representative states. The large range of well performing nS indicates a certain level of robustness with respect to that hyper-parameter. A slight performance peak at 120 representative states was observed. Therefore, nS = 120 was selected for further experimentation as compromise between maintaining a low number of states and sufficient state granularity. An example quantization with nS = 120 is visualized in Fig. 3. The eight scouting datasets were discarded for the following experiments to avoid bias in the analysis. 14 0.8 80 0.6 60 0.4 40 0.2 20 0 10 50 100 150 200 250 300 350 Number of representative states 400 450 0 500 Average # forward model runs 100 120 Success rate 1 Figure 6: Hyper-parameter scouting. Vito’s performance for varying number of representative states nS on eight scouting datasets. The solid and dashed curves represent success rate and average number of forward runs until convergence, respectively, aggregated over five personalization runs with varying training data. 3.2.3. Reference Methods Vito’s results were compared to two standard personalization methods based on BOBYQA (Powell, 2009), a widely-used gradient-free optimizer known for its robust performance and fast convergence. The first approach, “BOBYQA simple”, mimicked the most basic estimation setup, where only the minimum level of model and problem knowledge were assumed. Pnc The objective function was the sum of absolute QRSd and EA errors: i=1 |ci |. It was minimized in a single optimizer run where all three parameters in x were tuned simultaneously. The algorithm terminated once all convergence criteria ψ were satisfied (success) or if the number of forward model evaluations exceeded 100 (failure). The second approach, “BOBYQA cascade”, implemented an advanced estimator with strong focus on robustness, which computed the optimum parameters in a multi-step iterative fashion. It is based on Seegerer et al. (2015), where tedious manual algorithm and cost function tuning was performed on a subset of the data used in this manuscript. In a first step, the myocardial conduction velocity was tuned to yield good match between computed and measured QRS duration. Second, left and right endocardial conduction velocities were optimized to minimize electrical axis error. Both steps were repeated until all parameter estimates were stable. To remove bias towards the choice of initial parameter values, for each of the two methods all datasets were personalized 100 times with different random initializations within the range of physiologically plausible values Ω. The differences in performance were striking: only by changing the initialization, the number of successfully personalized cases varied from 13 to 37 for BOBYQA simple, and from 31 to 51 for BOBYQA cascade (variability of more than 25% of the total number of patients). These results highlight the non-convexity of the cost function to minimize. 15 0 135 Data-driven initialization 90 Full personalization Absolute EA error [deg] 50 Full personalization Fixed initialization Absolute QRSd error [ms] 100 Data-driven initialization Fixed initialization 180 150 45 0 Training samples per dataset Training samples per dataset Figure 7: Absolute errors over all patients after initialization with fixed parameter values (blue), after data-driven initialization for increasing amount of training data (white), and after full personalization with Vito (green). Data-driven initialization yielded significantly reduced errors if sufficient training data were available (> 102 ) compared to initialization with fixed values. Full personalization further reduced the errors by a significant margin. The red bar and the box edges indicate the median absolute error, and the 25 and 75 percentiles, respectively. Left: QRS duration errors. Right: Electrical axis errors. 3.2.4. Full Personalization Performance First, Vito’s overall performance was evaluated. The full personalization pipeline consisting in off-line learning, initialization, and on-line personalization was run on all patients with leave-one-patient-out cross-validation using 1000 training episodes (nsamples = 1000 · ne-steps = 105 transition samples) per patient. The maximum number of iterations was set to 100. The green box plots in the two panels of Fig. 7 summarize the results. The mean absolute errors were 4.1 ± 5.6 ms and 12.4 ± 13.3◦ in terms of QRSd and EA, respectively, a significant improvement over the residual error after initialization. In comparison to the reference methods, the best BOBYQA simple run yielded absolute errors of 4.4 ± 10.8 ms QRSd and 15.5 ± 18.6◦ EA on average, and the best BOBYQA cascade run 0.1 ± 0.2 ms QRSd and 11.2 ± 15.8◦ EA, respectively. Thus, in terms of EA error all three methods yielded comparable performance, and while BOBYQA simple and Vito performed similarly in terms of QRSd, BOBYQA cascade outperformed both in this regard. However, considering success rates, i.e. successfully personalized patients according to the defined convergence criteria (ψ) divided by total number of patients, both the performance of Vito (67%) and BOBYQA cascade (68%) were equivalent, while BOBYQA simple reached only 49% or less. In terms of run-time, i.e. average number of forward model runs until convergence, Vito (31.8) almost reached the high efficiency of BOBYQA simple (best: 20.1 iterations) and clearly outperformed BOBYQA cascade (best: 86.6 iterations), which means Vito was ≈ 2.5× faster. 16 3.2.5. Residual Error after Initialization A major advantage over standard methods such as the two BOBYQA approaches is Vito’s automated, data-driven initialization method (Sec. 2.6.1), which eliminates the need for user-provided initial parameter values. To evaluate the utility of this step, personalization using Vito was stopped directly after initialization (the most likely x0 was used) and the errors in terms of QRSd and EA resulting from a forward model run f with the computed initial parameter values were quantified. This experiment was repeated for increasing number of transition samples per dataset: nsamples = 100 . . . 105 , and the results were compared to the error after initialization when fixed initial values were used (the initialization of the best performing BOBYQA experiment was used). As one can see from Fig. 7, with increasing amount of training data both errors decreased notably. As few as 102 transitions per dataset already provided more accurate initialization than the best tested fixed initial values. Thus, not only does this procedure simplify the setup of Vito for new problems (no user-defined initialization needed), this experiment showed that it can reduce initial errors by a large margin, even when only few training transitions were available. It should be noted that Vito further improves the model fit in its normal operating mode (continue personalization after initialization), as shown in the previous experiment. 3.2.6. Convergence Analysis An important question in any RL application relates to the amount of training needed until convergence of the artificial agent’s behavior. For Vito in particular, this translates to the amount of transition samples required to accurately estimate the MDP transition function T to compute a solid policy on the one hand, and to have enough training data for reliable parameter initialization on the other hand. To this end, Vito’s overall performance (off-line learning, initialization, personalization) was evaluated for varying number of training transition samples per dataset. As one can see from the results in Fig. 8, with increasing amount of training data the performance increased, suggesting that the learning process was working properly. Even with relatively limited training data of only nsamples = 102 samples per patient, Vito outperformed the best version of BOBYQA simple (49% success rate). Starting from nsamples ≈ 3000, a plateau at ≈66% success rate was reached, which remained approximately constant until the maximum tested number of samples. This was almost on par with the top BOBYQA cascade performance (68% success rate). Also the run-time performance increased with more training data. For instance, Vito’s average number of iterations was 36.2 at 103 samples, 31.5 at 104 samples, or 31.8 at 105 samples. These results suggested that not only Vito can achieve similar performance as an advanced, manually engineered method, but also the number of required training samples was not excessive. In fact, a rather limited and thus well manageable amount of data, which can be computed in a 17 60 0.4 40 # Forward model runs 0.2 0 100 101 102 103 Training samples per dataset 104 20 0 0.6 0.4 0.2 0 BOBYQA simple BOBYQA cascade 100 80 60 40 20 0 Average # forward model runs 0.6 # Forward model runs 0.8 Success rate 80 Reference Methods # Forward model runs Success rate 1 Success rate Success rate 0.8 100 Average # forward model runs Success rate Vito 1 Figure 8: EP personalization results. Personalization success rate in blue and average number of iterations in red. Left: Vito’s performance for increasing number of training transition samples per dataset. Each dot represents results from one experiment (crossvalidated personalization of all 75 datasets), solid/dashed line is low-pass filtered mean, shaded areas represent 0.5× and 1× standard deviation. Right: Performance of both reference methods. Each shade represents 10% of the results, sorted by performance. reasonable time-frame, sufficed. 3.3. Personalization of Whole-Body Circulation Model Next, Vito was asked to personalize a lumped-parameter whole-body circulation (WBC) model from pressure catheterization and volume data. A subset of ndatasets = 56 patients from the EP experiments were used for experimentation. The discrepancy was due to missing catheterization data for some patients, which was required for WBC personalization only. For each patient, the bi-ventricular anatomy was segmented and tracked from short-axis cine MRI stacks throughout one full heart cycle using shapeconstraints, learned motion models and diffeomorphic registration (Wang et al., 2013). From the time-varying endocardial meshes, ventricular volume curves were derived. Manual editing was performed whenever necessary. 3.3.1. Forward Model Description The WBC model to personalize was based on Itu et al. (2014). It contained a heart model (left ventricle (LV) and atrium, right ventricle and atrium, valves), the systemic circulation (arteries, capillaries, veins) and the pulmonary circulation (arteries, capillaries, veins). Time-varying elastance models were used for all four chambers of the heart. The valves were modeled through a resistance and an inertance. A three-element Windkessel model was used for the systemic and pulmonary arterial circulation, while a twoelement Windkessel model was used for the systemic and pulmonary venous circulation. We refer the reader to Itu et al. (2014); Neumann et al. (2015); Westerhof et al. (1971) for more details. Personalization was performed with respect to the patient’s heart rate as measured during catheterization. The goal of this experiment was to compare Vito’s personalization performance for the systemic part of the model in setups with increasing number of parameters to tune and objectives to match. To this end, Vito was 18 x Initial volume LV max. elastance Aortic resistance Aortic compliance Dead volume Time to Emax Default value 400 mL 2.4 mmHg/mL 1100 g/(cm4 s) 1.4 ·109 cm4 s2 /g 10 mL 300 ms Ω [200; 1000] mL [0.2; 5] mmHg/mL [500; 2500] g/(cm4 s) [0.5; 6] ·109 cm4 s2 /g [−50; 500] mL [100; 600] ms Setups 6, 5, 3, 2 6, 5, 3, 2 6, 5, 3 6, 5 6, 5 6 Table 1: WBC parameters x, their default values and domain Ω. The last column denotes the experiment setups in which a parameter was personalized (e.g. “5”: parameter was among the estimated parameters in 5p experiment). Default values were used in experiments where the respective parameters were not personalized. c End-diastolic LV volume End-systolic LV volume Mean aortic pressure Peak-systolic aortic pressure End-diastolic aortic pressure Ejection time ψ 20 mL 20 mL 10 mmHg 10 mmHg 10 mmHg 50 ms Measured range [129; 647] mL [63; 529] mL [68; 121] mmHg [83; 182] mmHg [48; 99] mmHg [115; 514] ms Setups 6, 5, 3, 2 6, 5, 3, 2 6, 5, 3 6, 5 6, 5 6 Table 2: WBC objectives c, their convergence criteria ψ and range of measured values in the patient population used for experimentation. employed on setups with two to six parameters (2p, 3p, 5p, 6p): initial blood volume, LV maximum elastance, time until maximum elastance is reached, total aortic resistance and compliance, and LV dead volume. The reference values δ to define Vito’s allowed actions A were set to .5% of the admissible parameter range Ω for each individual parameter, see Table 1 for details. The personalization objectives were MRI-derived end-diastolic and end-systolic LV volume, ejection time (time duration during which the aortic valve is open and blood is ejected), and peak-systolic, end-diastolic, and mean aortic blood pressures as measured during cardiac catheterization, see Fig. 9. To account for measurement noise, personalization was considered successful if the misfits per objective were below acceptable threshold values ψ as listed in Table 2. 3.3.2. Number of Representative States Along the same lines as Sec. 3.2.2, the hyper-parameter for state-space quantization was tuned based on the eight scouting patients. The larger the dimensionality of the state-space, the more representative states were needed to yield good performance. In particular, for the different WBC setups, the numbers of representative states (nS ) yielding the best scouting performance were 70, 150, 400 and 600 for the 2p, 3p, 5p and 6p setup, respectively. The scouting datasets were discarded for the following experiments. 19 LV volume [mL] Aortic pressure [mmHg] 160 140 WBC 2p Measured Computed 160 WBC 3p 160 140 140 120 120 120 100 100 100 80 80 60 60 60 40 40 40 20 200 20 200 20 200 185 End-diastolic volume 185 Mean pressure 80 End-diastolic volume 185 WBC 5p Peak-systolic pressure 160 140 100 Mean pressure 80 End-diastolic volume 40 20 200 End-diastolic volume Ejection time 170 155 155 155 155 140 140 140 110 0 0.2 0.4 0.6 0.8 1 Time [s] 125 110 125 110 0 0.2 0.4 0.6 0.8 1 Time [s] Endsystolic volume 0 0.2 0.4 0.6 0.8 1 Time [s] End-diastolic aortic pressure 185 170 125 Mean pressure 60 End-diastolic aortic pressure 170 Endsystolic volume Peak-systolic pressure 120 170 Endsystolic volume WBC 6p 140 125 110 Endsystolic volume 0 0.2 0.4 0.6 0.8 1 Time [s] Figure 9: Goodness of fit in terms of time-varying LV volume and aortic pressure for Vito personalizing an example patient based on the different WBC setups. The added objectives per setup are highlighted in the respective column. With increasing number of parameters and objectives Vito manages to improve the fit between model and measurements. 3.3.3. Reference Method A gradient-free optimizer (Lagarias et al., 1998) based on the simplex method was used to benchmark Vito. The objective function was the sum of squared differences between computed and measured values, weighted by the inverse of the convergence criteria to counter the different ranges of objective values (e.g. due to different types of measurements and different units): kckψ (Eq. 7). Compared to non-normalized optimization, the algorithm converged up to 20% faster and success rates increased by up to 8% under otherwise identical conditions. Personalization was terminated once all convergence criteria were satisfied (success), or when the maximum number of iterations was reached (failure). To account for the increasing complexity of optimization with increasing number of parameters nx , the maximum number of iterations was set to 50 · nx for the different setups. As one can see from Fig. 10, right panels, with increasing number of parameters to be estimated, the performance in terms of success rate and number of forward model runs decreased slightly. This is expected as the problem becomes harder. To suppress bias originating from (potentially poor) initialization, the reference method was run 100 times per setup (as in EP experiments), each time with a different, randomly generated set of initial parameter values. The individual performances varied significantly for all setups. 20 Vito Success rate 1 1 0.8 0.8 0.6 0.6 0.4 0.4 2p 3p 5p 6p Average # forward model runs 0.2 0 0 10 300 1 10 2 10 3 0.2 0 4 10 10 2p 3p 5p 6p 300 2p 3p 5p 6p 250 200 250 200 150 150 100 100 50 50 0 100 Reference Method 101 102 103 Training samples per dataset 104 0 2p 3p 5p #Parameters 6p Figure 10: WBC model personalization results (top: success rate, bottom: average number of forward model runs until convergence) for various estimation setups (different colors), see text for details. Left: Vito’s performance for increasing number of training transition samples per dataset. Each dot represents results from one experiment (cross-validated personalization of all 48 datasets), solid/dashed lines are low-pass filtered mean, shaded areas represent 0.5× and 1× standard deviation. Right: Performance of reference method. Each shade represents 10% of the results, sorted by performance; darkest shade: best 10%. 21 3.3.4. Convergence Analysis For each WBC setup the full Vito personalization pipeline was evaluated for increasing training data (nsamples = 100 . . . 105 ) using leave-one-patientout cross-validation. The same iteration limits as for the reference method were used. The results are presented in Fig. 10, left panels. With increasing data, Vito’s performance, both in terms of success rate and run-time (iterations until convergence), increased steadily until reaching a plateau. As one would expect, the more complex the problem, i.e. the more parameters and objectives involved in the personalization, the more training data was needed to reach the same level of performance. For instance, Vito reached 80% success rate with less than nsamples = 50 training samples per dataset in the 2p setup, whereas almost 90× as many samples were required to achieve the same performance in the 6p setup. Compared to the reference method, given enough training data, Vito reached equivalent or better success rates (e.g. up to 11% higher success rate for 6p) while significantly outperforming the reference method in terms of run-time performance. In the most basic setup (2p), if nsamples ≥ 103 , Vito converged after 3.0 iterations on average, while the best reference method run required 22.6 iterations on average, i.e. Vito was seven times faster. For the more complex setups (3p, 5p, 6p), the speed-up was not as drastic. Yet, in all cases Vito outperformed even the best run of the reference method by a factor of 1.8 or larger. 4. Conclusion 4.1. Summary and Discussion In this manuscript, a novel personalization approach called Vito has been presented. To our knowledge, it is the first time that biophysical model personalization is addressed using artificial intelligence concepts. Inspired by how humans approach the personalization problem, Vito first learns the characteristics of the computational model under consideration using a datadriven approach. This knowledge is then utilized to learn how to personalize the model using reinforcement learning. Vito is generic in the sense that it requires only minimal and intuitive user input (parameter ranges, authorized actions, number of representative states) to learn by itself how to personalize a model. Vito was applied to a synthetic scenario and to two challenging personalization tasks in cardiac computational modeling. The problem setups and hyper-parameter configurations are listed in Table 3. In most setups the majority of hyper-parameters were identical and only few (nS ) required manual tuning, suggesting good generalization properties of Vito. Another key result was that Vito was up to 11% more robust (higher success rates) compared to standard personalization methods. Vito’s ability to generalize 22 Application Rosenbrock Rosenbrock ext. EP WBC 2p WBC 3p WBC 5p WBC 6p nx 2 2 3 2 3 5 6 nc 2 2 2 2 3 5 6 ndatasets 100 100 83 (75) 56 (48) 56 (48) 56 (48) 56 (48) nS 100 100 120 70 150 400 600 nA /nx 6 8 6 6 6 6 6 nplateau n/a n/a 3 000 450 2 000 3 500 20 000 Table 3: Applications considered in this manuscript described in terms of the number of parameters (nx ), objectives (nc ) and datasets (ndatasets ) used for experimentation (in brackets: excluding scouting patients, if applicable); and Vito’s hyper-parameters: the number of representative MDP states (nS ) and the number of actions per parameter (nA /nx ). The last column (nplateau ) denotes the approximate number of samples needed to reach the performance “plateau” (see convergence analyses in Sec. 3.2.6 and Sec. 3.3.4). the knowledge obtained from a set of training patients to personalize unseen patients was shown as all experiments reported in this manuscript were based on cross-validation. Furthermore, Vito’s robustness against training patients for whom we could not find a solution was tested. In particular, for about 20% of the patients, in none of the electrophysiology experiments in Sec. 3.2 any personalization (neither Vito nor the reference methods) could produce a result that satisfied all convergence criteria. Hence, for some patients no solution may exist under the given electrophysiology model configuration1 . Still, all patients were used to train Vito, and surprisingly Vito was able to achieve equivalent success rate as the manually engineered personalization approach for cardiac EP. Generating training data could be considered Vito’s computational bottleneck. However, training is i) performed off-line and one-time only, and ii) it is independent for each training episode and each patient. Therefore, large computing clusters could be employed to perform rapid training by parallelizing this phase. On-line personalization, on the contrary, is not parallelizable in its current form: the parameters for each forward model run depend on the outcome of the previous iteration. Since the forward computations are the same for every “standard” personalization method (not including surrogate-based approaches), the number of forward model runs until convergence was used for benchmarking: Vito was up to seven times faster compared to the reference methods. The on-line overhead introduced by Vito (convert data into an MDP state, then query policy) is negligible. As such, Vito could become a unified framework for personalization of any computational physiological model, potentially eliminating the need for 1 Potential solution non-existence may be due to possibly invalid assumptions of the employed EP model for patients with complex pathologies. 23 an expert operator with in-depth knowledge to design and engineer complex optimization procedures. 4.2. Challenges and Outlook Important challenges still remain, such as the incorporation of continuous actions, the definition of states and their quantization. In this work we propose a data-driven state-space quantization strategy. Contrary to Neumann et al. (2015), where a threshold-based state-quantization involving several manually tuned threshold values (Fig. 3) was employed, the new method is based on a single hyper-parameter only: the number of representative states. Although it simplifies the setup of Vito, this quantization strategy may still not be optimal, especially if only little training data is available. Therefore, advanced approaches for continuous reinforcement learning with value function approximation (Mnih et al., 2015; Sutton and Barto, 1998) could be integrated to fully circumvent quantization issues. At the same time, such methods could improve Vito’s scalability towards high-dimensional estimation tasks. In this work we showed that Vito can be applied to typical problems emerging in cardiac modeling, which could be described as medium-scale problems with moderate number of parameters to personalize and objectives to match. In unreported experiments involving >10 parameters, however, Vito could no longer reach satisfactory performance, which is likely due to the steeply increasing number of transition samples needed to sample the continuous state-space of increasing dimensionality sufficiently during training. The trends in Sec. 3.3 confirm the need for more data. In the future, experience replay (Adam et al., 2012; Lin, 1993) or similar techniques could be employed to increase training data efficiency. Furthermore, massively parallel approaches (Nair et al., 2015) are starting to emerge, opening up new avenues for large-scale reinforcement learning. Although the employed reinforcement learning techniques guarantee convergence to an optimal policy, the computed personalization strategy may not be optimal for the model under consideration as the environment is only partially observable and the personalization problem ill-posed: there is no guarantee for solution existence or uniqueness. Yet, we showed that Vito can solve personalization more robustly and more effectively than standard methods under the same conditions. However, a theoretical analysis in terms of convergence guarantees and general stability of the method would be desirable, in particular with regards to the proposed re-initialization strategy. As a first step towards this goal, in preliminary (unreported) experiments on the EP and the WBC model we observed that the number of patients which do not require re-initialization (due to oscillation) to converge to a successful personalization consistently increased with increasing training data. The data-driven initialization proposed in this work simplifies Vito’s setup by eliminating the need for user-provided initialization. However, currently there is no guarantee that the first initialization candidate is the 24 one that will yield the “best” personalization outcome. Therefore, one could investigate the benefits of a fuzzy personalization scheme: many personalization processes could be run in parallel starting from the different initialization candidates. Parameter uncertainty quantification techniques (Neumann et al., 2014a) could then be applied to compute a probability density function over the space of model parameters. Such approaches aim to gather complete information about the solution-space, which can be used to study solution uniqueness and other interesting properties. An important characteristic of any personalization algorithm is its stability against small variations of the measured data. A preliminary experiment indicated good stability of Vito: the computed parameters from several personalization runs, each involving small random perturbations of the measurements, were consistent. Yet in a small group of patients some parameter variability was observed, however, it was below the variability of the reference method under the same conditions. To what extent certain degrees of variability will impact other properties of the personalized model such as its predictive power will be subject of future research. We will also investigate strategies to improve Vito’s stability further. For instance, the granularity of the state-space could provide some flexibility to tune the stability: less representative states means a larger region in state space per state, thus small variations in the measured data might have less impact on personalization outcome. However, this could in turn have undesirable effects on other properties of Vito such as success rate or convergence speed (see Sec. 3.2.2). Beyond these challenges, Vito showed promising performance and versatility, making it a first step towards an automated, self-taught model personalization agent. The next step will be to investigate the predictive power of the personalized models, for instance for predicting acute or long-term response in cardiac resynchronization therapy (Kayvanpour et al., 2015; Sermesant et al., 2009). Appendix A. Data-driven State-Space Quantization This section describes the details of the proposed data-driven quantization approach to define the set of representative MDP states S (see Sec. 2.4). It is based on clustering, in particular on the weighted k -means algorithm described in Arthur and Vassilvitskii (2007). To this end, all objective vectors C = {c ∈ E} are extracted from the training data (Sec. 2.3). C ⊂ Rnc represents all observed “continuous states”. The goal is to convert C into the finite set of representative MDP states S while taking into account that Vito relies on a special “success state” ŝ encoding personalization success. The success state ŝ does not depend on the data, but on the maximum acceptable misfit ψ. In particular, since personalization success implies that all objectives are met, ŝ should approximate a hyperrectangle centered at 25 Figure A.11: Preprocessing of k -means input data to enforce the success state ŝ. Left: Continuous state-space with observed objective vectors c (blue points). The points with dashed outline will be canceled out. Right: Delineation of ŝ in green, enforced by inserted vectors (green / red points) with large weights. See text for details. 0 and bounded at ±ψ, i.e. a small region in Rnc where ∀i : |ci | < ψi . To enforce ŝ, the input to weighted k -means is preprocessed as follows. First, the 0-vector is inserted into C, along with two vectors per dimension i, where all components are zero, except the ith component, which is set to ±2ψi . These 2nc + 1 inserted vectors are later converted into centroids of representative states to delineate the desired hyperrectangle for ŝ as illustrated in Fig. A.11. Furthermore, to avoid malformation of ŝ, no other representative state should emerge within that region. Therefore, all vectors c ∈ C, where ∀i : |ci | < 2ψi (except for the inserted vectors) are canceled out by assigning zero weight, while the inserted vectors are assigned large weights → ∞ and all remaining vectors weights of 1. Next, k -means is initialized by placing a subset of the initial centroids at the locations of the inserted states, and the remaining nS − 2nc − 1 centroids at random vectors in C. Both the large weight and the custom initialization enforce the algorithm to converge to a solution where one cluster centroid is located at each inserted vector, while the other centroids are distributed according to the training data. To ensure equal contribution of all objectives (cancel out different units, etc.), similarity is defined relative to the inverse of the user-defined convergence criteria (Eq. 7). Finally, after k -means converged, the resulting centroids, denoted ξs , are used to delineate the region in Rnc assigned to a representative state s. Appendix B. Data-driven Initialization This section describes the details of the proposed data-driven initialization approach to compute a list of candidate initialization parameter vectors X0 = (x00 , x000 , . . . ) for a new patient p based on the patient’s measurements zp and the training database E (see Sec. 2.6.1). 26 First, all model states are extracted from the training database: Υ = {y ∈ E}. Next, Υ is fed to a clustering algorithm (e.g. k -means). As in Appendix A, the distance measure is defined relative to the inverse of the convergence criteria (Eq. 7). The output is a set of centroids (for simplicity, in this work the number of centroids was set to nS ), and each vector is assigned to one cluster based on its closest centroid. Let Υp ⊆ Υ denote the members of the cluster whose centroid is closest to zp and Ξp = {x ∈ E | f (x) ∈ Υp } the set of corresponding model parameters. For each cluster, an approximation of the likelihood over the generating parameters is computed in terms of a probability density function. In this work a Gaussian mixture model is assumed: GMMp (x) = M X νm N (x; µm , Σm ) . (B.1) m=1 The parameter vectors in Ξp are treated as random samples drawn from GMMp . Its properties, namely the number of mixture components M , their weights νm , and their means µm and covariance matrices Σm , are estimated from these samples using a multivariate kernel density estimator with automated kernel bandwidth estimation, see Kristan et al. (2011) for more details. Finally, the M estimated means are selected as initialization candidates and stored in a list X0 = (µm0 , µm00 , . . . ). The elements of X0 are sorted in descending order according to their corresponding νm -values to prioritize more likely initializations: µm0 is the mean with m0 = arg maxm νm . References References Adam, S., Busoniu, L., Babuska, R., 2012. Experience replay for real-time reinforcement learning control. IEEE Sys. Man. Cybern. 42 (2), 201–212. Aguado-Sierra, J., Kerckhoffs, R. C. P., Lionetti, F., Hunt, D., Villongco, C., Gonzales, M., Campbell, S. G., McCulloch, A. D., 2010. A computational framework for patient-specific multi-scale cardiac modeling. In: Kerckhoffs, R. C. (Ed.), Patient-Specific Modeling of the Cardiovascular System. Springer, pp. 203–223. Aguado-Sierra, J., Krishnamurthy, A., Villongco, C., Chuang, J., Howard, E., Gonzales, M. J., Omens, J., Krummen, D. E., Narayan, S., Kerckhoffs, R. C. P., McCulloch, A. D., 2011. Patient-specific modeling of dyssynchronous heart failure: a case study. Prog. Biophys. Mol. Bio. 107 (1), 147–155. Arthur, D., Vassilvitskii, S., 2007. k-means++: The advantages of careful seeding. In: ACM-SIAM Symp. Discr. Algorithm. pp. 1027–1035. 27 Augenstein, K. F., Cowan, B. R., LeGrice, I. J., Nielsen, P. M., Young, A. A., 2005. Method and apparatus for soft tissue material parameter estimation using tissue tagged magnetic resonance imaging. J. Biomech. Eng. 127 (1), 148–157. Barreto, A., Precup, D., Pineau, J., 2014. Practical kernel-based reinforcement learning. arXiv preprint arXiv:1407.5358. Bellman, R., 1957. Dynamic Programming. Princeton University Press. Bishop, C. M., 2006. Pattern recognition and machine learning. Vol. 4. Springer New York. Chabiniok, R., Moireau, P., Lesault, P.-F., Rahmouni, A., Deux, J.-F., Chapelle, D., 2012. Estimation of tissue contractility from cardiac cinemri using a biomechanical heart model. Biomech. Model. Mechan. 11 (5), 609–630. Clayton, R., Bernus, O., Cherry, E., Dierckx, H., Fenton, F., Mirabella, L., Panfilov, A., Sachse, F., Seemann, G., Zhang, H., 2011. Models of cardiac tissue electrophysiology: progress, challenges and open questions. Prog. Biophys. Mol. Bio. 104 (1), 22–48. Delingette, H., Billet, F., Wong, K. C. L., Sermesant, M., Rhode, K., Ginks, M., Rinaldi, C. A., Razavi, R., Ayache, N., 2012. Personalization of cardiac motion and contractility from images using variational data assimilation. IEEE T. Biomed. Eng. 59 (1), 20–24. Frangi, A. F., Niessen, W. J., Viergever, M., 2001. Three-dimensional modeling for functional analysis of cardiac images, a review. IEEE T. Med. Imaging 20 (1), 2–5. Hunter, P. J., Borg, T. K., 2003. Integration from proteins to organs: the physiome project. Nat. Rev. Mol. Cell Bio. 4 (3), 237–243. Itu, L., Sharma, P., Georgescu, B., Kamen, A., Suciu, C., Comaniciu, D., 2014. Model based non-invasive estimation of PV loop from echocardiography. IEEE Eng. Med. Biol. Soc., 6774–6777. Kaelbling, L. P., Littman, M. L., Moore, A. W., 1996. Reinforcement learning: A survey. J. Artif. Intell. Res., 237–285. Kayvanpour, E., Mansi, T., Sedaghat-Hamedani, F., Amr, A., Neumann, D., Georgescu, B., Seegerer, P., Kamen, A., Haas, J., Frese, K. S., Irawati, M., Wirsz, E., King, V., Buss, S., Mereles, D., Zitron, E., Keller, A., Katus, H. A., Comaniciu, D., Meder, B., 2015. Towards personalized cardiology: Multi-scale modeling of the failing heart. PLoS ONE 10 (7), e0134869. 28 Kerckhoffs, R. C. P., Lumens, J., Vernooy, K., Omens, J., Mulligan, L., Delhaas, T., Arts, T., McCulloch, A., Prinzen, F., 2008. Cardiac resynchronization: insight from experimental and computational models. Prog. Biophys. Mol. Bio. 97 (2), 543–561. Konukoglu, E., Relan, J., Cilingir, U., Menze, B. H., Chinchapatnam, P., Jadidi, A., Cochet, H., Hocini, M., Delingette, H., Jaı̈s, P., Haı̈ssaguerre, M., Ayache, N., Sermesant, M., 2011. Efficient probabilistic model personalization integrating uncertainty on data and parameters: Application to eikonal-diffusion models in cardiac electrophysiology. Prog. Biophys. Mol. Bio. 107 (1), 134–146. Krishnamurthy, A., Villongco, C. T., Chuang, J., Frank, L. R., Nigam, V., Belezzuoli, E., Stark, P., Krummen, D. E., Narayan, S., Omens, J. H., McCulloch, A. D., Kerckhoffs, R. C. P., 2013. Patient-specific models of cardiac biomechanics. J. Comput. Phys. 244, 4–21. Kristan, M., Leonardis, A., Skočaj, D., 2011. Multivariate online kernel density estimation with gaussian kernels. Pattern Recogn. 44 (10), 2630– 2642. Kuijpers, N. H., Hermeling, E., Bovendeerd, P. H., Delhaas, T., Prinzen, F. W., 2012. Modeling cardiac electromechanics and mechanoelectrical coupling in dyssynchronous and failing hearts. J. Cardiovasc. Transl. Res. 5 (2), 159–169. Kveton, B., Theocharous, G., 2012. Kernel-based reinforcement learning on representative states. In: Association for the Advancement of Artificial Intelligence. pp. 977–983. Lagarias, J. C., Reeds, J. A., Wright, M. H., Wright, P. E., 1998. Convergence properties of the Nelder-Mead simplex method in low dimensions. SIAM J. Optimiz. 9 (1), 112–147. Le Folgoc, L., Delingette, H., Criminisi, A., Ayache, N., 2013. Current-based 4D shape analysis for the mechanical personalization of heart models. In: Medical Computer Vision. Recognition Techniques and Applications in Medical Imaging. Vol. 7766 of LNCS. Springer, pp. 283–292. Lin, L.-J., 1993. Reinforcement learning for robots using neural networks. Tech. rep., DTIC Document. Marchesseau, S., Delingette, H., Sermesant, M., Cabrera-Lozoya, R., TobonGomez, C., Moireau, P., Figueras i Ventura, R. M., Lekadir, K., Hernandez, A., Garreau, M., Donal, E., Leclercq, C., Duckett, S. G., Rhode, K., Rinaldi, C. A., Frangi, A. F., Razavi, R., Chapelle, D., Ayache, N., 2013. Personalization of a cardiac electromechanical model using reduced 29 order unscented kalman filtering from regional volumes. Med. Image Anal. 17 (7), 816–829. Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., Petersen, S., Beattie, C., Sadik, A., Antonoglou, I., King, H., Kumara, D., Wierstra, D., Legg, S., Hassabis, D., 2015. Human-level control through deep reinforcement learning. Nature 518 (7540), 529–533. Mülling, K., Kober, J., Kroemer, O., Peters, J., 2013. Learning to select and generalize striking movements in robot table tennis. Int. J. Robot. Res. 32 (3), 263–279. Nair, A., Srinivasan, P., Blackwell, S., Alcicek, C., Fearon, R., De Maria, A., Panneershelvam, V., Suleyman, M., Beattie, C., Petersen, S., Legg, S., Mnih, V., Kavukcuoglu, K., Silver, D., 2015. Massively parallel methods for deep reinforcement learning. arXiv:1507.04296. Neumann, D., Mansi, T., Georgescu, B., Kamen, A., Kayvanpour, E., Amr, A., Sedaghat-Hamedani, F., Haas, J., Katus, H., Meder, B., Hornegger, J., Comaniciu, D., 2014a. Robust image-based estimation of cardiac tissue parameters and their uncertainty from noisy data. In: MICCAI. Vol. 8674 of LNCS. Springer, pp. 9–16. Neumann, D., Mansi, T., Grbic, S., Voigt, I., Georgescu, B., Kayvanpour, E., Amr, A., Sedaghat-Hamedani, F., Haas, J., Katus, H., Meder, B., Hornegger, J., Kamen, A., Comaniciu, D., 2014b. Automatic image-tomodel framework for patient-specific electromechanical modeling of the heart. In: IEEE Int. Symp. Biomed. Imaging. pp. 935–938. Neumann, D., Mansi, T., Itu, L., Georgescu, B., Kayvanpour, E., SedaghatHamedani, F., Haas, J., Katus, H., Meder, B., Steidl, S., Hornegger, J., Comaniciu, D., 2015. Vito – a generic agent for multi-physics model personalization: Application to heart modeling. In: MICCAI. Vol. 9350 of LNCS. Springer, pp. 442–449. Nguyen-Tuong, D., Peters, J., 2011. Model learning for robot control: a survey. Cogn. Process. 12 (4), 319–340. Noble, D., 2002. Modeling the heart – from genes to cells to the whole organ. Science 295 (5560), 1678–1682. Powell, M. J., 2009. The BOBYQA algorithm for bound constrained optimization without derivatives. Cambridge NA Report NA2009/06. Prakosa, A., Sermesant, M., Allain, P., Villain, N., Rinaldi, C., Rhode, K., Razavi, R., Delingette, H., Ayache, N., 2013. Cardiac electrophysio30 logical activation pattern estimation from images using a patient-specific database of synthetic image sequences. IEEE T. Biomed. Eng. Rosenbrock, H., 1960. An automatic method for finding the greatest or least value of a function. Comput. J. 3 (3), 175–184. Schmid, H., Nash, M., Young, A., Hunter, P., 2006. Myocardial material parameter estimation – a comparative study for simple shear. J. Biomech. Eng. 128 (5), 742–750. Seegerer, P., Mansi, T., Jolly, M.-P., Neumann, D., Georgescu, B., Kamen, A., Kayvanpour, E., Amr, A., Sedaghat-Hamedani, F., Haas, J., Katus, H., Meder, B., Comaniciu, D., 2015. Estimation of regional electrical properties of the heart from 12-lead ECG and images. In: Statistical Atlases and Computational Models of the Heart – Imaging and Modelling Challenges. Vol. 8896 of LNCS. Springer, pp. 204–212. Sermesant, M., Billet, F., Chabiniok, R., Mansi, T., Chinchapatnam, P., Moireau, P., Peyrat, J.-M., Rhode, K., Ginks, M., Lambiase, P., Arridge, S., Delingette, H., Sorine, M., Rinaldi, C. A., Chapelle, D., Razavi, R., Ayache, N., 2009. Personalised electromechanical model of the heart for the prediction of the acute effects of cardiac resynchronisation therapy. In: Functional Imaging and Modeling of the Heart. Vol. 5528 of LNCS. Springer, pp. 239–248. Sutton, R. S., Barto, A. G., 1998. Reinforcement learning: An introduction. Vol. 1. MIT press Cambridge. Tesauro, G., 1994. Td-gammon, a self-teaching Backgammon program, achieves master-level play. Neural Comput. 6 (2), 215–219. Wallman, M., Smith, N. P., Rodriguez, B., 2012. A comparative study of graph-based, eikonal, and monodomain simulations for the estimation of cardiac activation times. IEEE T. Biomed. Eng. 59 (6), 1739–1748. Wallman, M., Smith, N. P., Rodriguez, B., 2014. Computational methods to reduce uncertainty in the estimation of cardiac conduction properties from electroanatomical recordings. Med. Image Anal. 18 (1), 228–240. Wang, V. Y., Lam, H., Ennis, D. B., Cowan, B. R., Young, A. A., Nash, M. P., 2009. Modelling passive diastolic mechanics with quantitative mri of cardiac structure and function. Med. Image. Anal. 13 (5), 773–784. Wang, Y., Georgescu, B., Chen, T., Wu, W., Wang, P., Lu, X., Ionasec, R., Zheng, Y., Comaniciu, D., 2013. Learning-based detection and tracking in medical imaging: a probabilistic approach. In: Deformation Models. Vol. 7 of LNCVB. Springer, pp. 209–235. 31 Westerhof, N., Elzinga, G., Sipkema, P., 1971. An artificial arterial system for pumping hearts. J. Appl. Physiol. 31 (5), 776–781. Wong, K. C., Sermesant, M., Rhode, K., Ginks, M., Rinaldi, C. A., Razavi, R., Delingette, H., Ayache, N., 2015. Velocity-based cardiac contractility personalization from images using derivative-free optimization. J. Mech. Behav. Biomed. 43, 35–52. Xi, J., Lamata, P., Niederer, S., Land, S., Shi, W., Zhuang, X., Ourselin, S., Duckett, S. G., Shetty, A. K., Rinaldi, C. A., Rueckert, D., Razavi, R., Smith, N. P., 2013. The estimation of patient-specific cardiac diastolic functions from clinical measurements. Med. Image. Anal. 17 (2), 133–146. Zettinig, O., Mansi, T., Neumann, D., Georgescu, B., Rapaka, S., Seegerer, P., Kayvanpour, E., Sedaghat-Hamedani, F., Amr, A., Haas, J., Steen, H., Katus, H., Meder, B., Navab, N., Kamen, A., Comaniciu, D., 2014. Data-driven estimation of cardiac electrical diffusivity from 12-lead ECG signals. Med. Image Anal., 1361–1376. Zheng, Y., Barbu, A., Georgescu, B., Scheuering, M., Comaniciu, D., 2008. Four-chamber heart modeling and automatic segmentation for 3-D cardiac CT volumes using marginal space learning and steerable features. IEEE T. Med. Imaging 27 (11), 1668–1681. 32
5cs.CE
1 Model-Free MLE Estimation for Online Rotor Angle Stability Assessment with PMU Data arXiv:1702.03629v1 [cs.SY] 13 Feb 2017 Shaopan Wei, Student Member, IEEE, Ming Yang, Member, IEEE, Junjian Qi, Member, IEEE, Jianhui Wang, Senior Member, IEEE, Shiying Ma, and Xueshan Han Abstract—Recent research has demonstrated that the rotor angle stability can be assessed by identifying the sign of the system’s maximal Lyapunov exponent (MLE). A positive (negative) MLE implies unstable (stable) rotor angle dynamics. However, because the MLE may fluctuate between positive and negative values for a long time after a severe disturbance, it is difficult to determine the system stability when observing a positive or negative MLE without knowing its further fluctuation trend. In this paper, a new approach for online rotor angle stability assessment is proposed to address this problem. The MLE is estimated by a recursive least square (RLS) based method based on real-time rotor angle measurements, and two critical parameters, the Theiler window and the MLE estimation initial time step, are carefully chosen to make sure the calculated MLE curves present distinct features for different stability conditions. By using the proposed stability assessment criteria, the developed approach can provide timely and reliable assessment of the rotor angle stability. Extensive tests on the New-England 39-bus system and the Northeast Power Coordinating Council 140-bus system verify the effectiveness of the proposed approach. Index Terms—Lyapunov exponent, model-free, online stability assessment, phasor measurement unit, rotor angle stability, Theiler window. I. I NTRODUCTION T RANSIENT rotor angle stability refers to the ability of synchronous generators of an interconnected power system to remain in synchronism after a severe disturbance [1]. With the development of synchrophasor technologies, utilities are now able to track rotor angle deviations and take actions to respond to emergency events. However, since the dynamics of power systems are complex, online rotor angle stability assessment is still very challenging [2], [3]. In [4], an adaptive out-of-step relay is proposed for the Florida-Georgia system. The equal area criterion is applied to change the settings of the protection system based on This work was supported by the National Basic Research Program of China (973 Program) under Grant 2013CB228205, State Grid Corporation of China under Grant XT71-15-056, and the National Science Foundation of China under Grant 51007047 and 51477091. M. Yang (Corresponding Author) is with Key Laboratory of Power System Intelligent Dispatch and Control, Shandong University, Jinan, Shandong 250061 China. He was a visiting scholar with Argonne National Laboratory, Argonne, IL 60439 USA (e-mail: [email protected]). S. Wei and X. Han are with Key Laboratory of Power System Intelligent Dispatch and Control, Shandong University, Jinan, Shandong 250061 China (e-mail: spw [email protected]; [email protected]). J. Qi and J. Wang are with the Energy Systems Division, Argonne National Laboratory, Argonne, IL 60439 USA (e-mail: [email protected]; [email protected]). S. Ma is with Institute of Electric Power System, China Electric Power Research Institute, Haidian District, Beijing 100192 China (e-mail: [email protected]). phasor measurement unit (PMU) measurements. In [5], the dynamics of the power transfer paths are monitored based on the energy functions of the two-machine equivalent system, and the PMU data are used to identify the parameters of the energy functions. In [6], PMU measurements are used as inputs for estimating the differential/algebraic equation model to predict the post-fault dynamics. In [7], an online dynamic security assessment scheme is proposed based on self-adaptive decision trees, where the PMU data are used for online identification of the system critical attributes. In [8], the rotor angle stability is estimated by using artificial neural networks and the measured voltage and current phasors are used as inputs of the offline trained estimation model. In [9], a systematic scheme for building fuzzy rule-based classifiers for fast stability assessment is proposed. By testing on a large and highly diversified database, it is demonstrated that the analysis of post-fault short-term PMU data can extract useful features satisfying the requirements of stability assessment. Lyapunov exponents (LEs) those characterize the separation rate of infinitesimally close trajectories are important indices for quantifying the stability of dynamical systems. If the system’s maximal Lyapunov exponent (MLE) is positive, the system is unstable, and vice versa. LEs are first applied to power system stability analysis in [10], in which it is verified that LEs can predict the out-of-step conditions of power systems. In [2], a model-based MLE method is proposed for online prediction of the rotor angle stability with PMU measurements. The work builds solid analytical foundations for the LE-based rotor angle stability assessment. In [11], the LEs are calculated with dynamic component and network models to identify the coherent groups of generators. Although the model-based MLE estimation approaches have made significant progresses on online rotor angle stability assessment, they are usually computationally expensive especially when applied to large power systems. Therefore, two model-free MLE estimation approaches have been proposed for transient voltage stability assessment [12] and rotor angle stability assessment [3], for which the MLEs can be estimated by only using PMU measurements. The model-free LE-based stability assessment approaches are attractive, because they can eliminate model errors and simplify the calculation. However, when applying these approaches, a time window has to be pre-specified for the MLE observation. The window size is crucial for obtaining reliable and timely assessment results, i.e., too small window size will lead to unreliable assessment results while too large window size will lead to accurate but untimely results. The window 2 size is difficult to be determined in advance, because the estimated MLEs may fluctuate between positive and negative values for quite a long time after disturbances and the window size should change with different fault scenarios. In this paper, a LE-based model-free rotor angle stability assessment approach is proposed. The MLEs are estimated by a recursive least square (RLS) based method based on real-time rotor angle measurements. By properly choosing two critical parameters according to the characteristics of the relative rotor angles of the selected generator pairs, the calculated MLE curves will present distinct features for different stability conditions, based on which the stability criteria are correspondingly designed to capture the MLE features and perform online rotor angle stability assessment. Compared with the existing approaches, the proposed approach does not need a pre-specified time window to identify the sign of MLEs. Instead, the proposed approach can always make a reliable and timely assessment as soon as the crucial features are observed from the estimated MLE curves. The remainder of this paper is organized as follows. Section II introduces the theoretical basis of model-free MLE estimation. Section III proposes a rotor angle stability assessment approach, and discusses the parameter selection principles and stability criteria. In Section IV, simulation results on the New-England 39-bus system and the Northeast Power Coordinating Council (NPCC) 140-bus system are presented to validate the effectiveness of the proposed approach. Finally, the conclusions are drawn in Section V. II. MLE E STIMATION F ROM T IME S ERIES LEs can reflect the exponential divergence or convergence of neighboring trajectories in the state space of a dynamic system [13]. An N -dimensional dynamic system has N LEs and the largest one is defined as the MLE of the system. MLE is a useful indicator of system stability: A positive MLE indicates unstable system dynamics while a negative MLE indicates asymptotically stable dynamics [2]. The MLE can be estimated by using Jacobian matrix based (model-based) methods [2], [13] or direct model-free methods [3], [12], [13]. Compared with the Jacobin matrix based methods, direct methods are more suitable for online stability assessment mainly because they do not need the repeated computing of the Jacobian matrix or even the dynamic model of the system. According to Oseledec’s multiplicative ergodic theorem [13]–[15], for a reference point X 0 and its neighboring point X m(0) chosen from the state space of a nonlinear dynamic system, the distance between the trajectories emerged from X 0 and X m(0) , i.e., the original trajectory and the neighboring trajectory, will have three different growth phases as illustrated in Fig. 1. In Phase I, the difference vector between the states of the trajectories gradually converges towards the most expanding direction, and the distance between the trajectories will exhibit fluctuations. In Phase II, the distance experiences an exponential growth characterized by the MLE, which corresponds to a linear segment in the semi-logarithmic plot. Finally, in Phase III the separation of the trajectories is saturated and the distance converges to a constant value. Fig. 1. Logarithmic distance of neighboring states on different trajectories. As proved by [13] and [15]–[17], the MLE can be estimated from the mean logarithmic separation rate of the trajectories in Phase II as   d (m(n), n, k) 1 log λk ≈ k∆t d (m(n), n, 0)   ||X m(n)+k − X n+k || 1 log , = k∆t ||X m(n) − X n || X n , X m(n) , X n+k , and X m(n)+k ∈ Phase II, (1) where λk is the estimated MLE, k is the lagged time steps for the MLE estimation, ∆t is the time duration for each time step, X n and X m(n) are the initial points for the MLE estimation on the original and neighboring trajectories, respectively, X n+k is the kth point behind X n on the original trajectory, X m(n)+k is the kth point behind X m(n) on the neighboring trajectory, d (m(n), n, 0) is the Euclidean distance between the MLE estimation initial points, d (m(n), n, k) is the Euclidean distance between the kth points behind the MLE estimation initial points, and ||A − B|| denotes the Euclidean distance between points A and B. It should be noted that the original and the neighboring trajectories are usually from the same observed time series with different initial points, as illustrated in Fig. 2. In order to make sure the trajectories are temporally separated and thus can be seen as different trajectories, the trajectory initial points should satisfy |m(0) − 0| > w, where w is called the Fig. 2. Trajectories and the effect of the Theiler window. 3 Theiler window [13] and should be determined according to the characteristics of the system. III. LE-BASED ROTOR A NGLE S TABILITY A SSESSMENT Here we propose a rotor angle stability assessment approach based on MLE estimation. It is data-driven and can perform online stability assessment only using the rotor angle and rotor speed of the generators [2], [3]. Although the rotor angle and rotor speed may not be directly available from PMU measurements, they can be estimated by various dynamic state estimation methods [18]–[22]. A. State Variable Selection Even a moderate-size power system may still have hundreds of state variables. Due to both the calculation intractability and the insufficiency of measurements, it is impractical to use all these variables to form the state space for MLE estimation. It is more feasible to reconstruct the power system dynamics only with a small number of state variables. According to Takens’ theorem [23], [24], the dynamics of a nonlinear system can be reconstructed by the observations of a single state variable, and the reconstructed state vector can be expressed as > Θt = [θt , θt−τ , θt−2τ , · · · , θt−2N τ ] , of the severely disturbed generators, if |ωtc ,g | /ωt∗c > σ, where σ is a predetermined threshold. In this paper σ is chosen as 0.7, as in [27]. 3) Find the least disturbed generator with the minimal absolute value of the rotor speed. 4) Form a SDGP by combing one of the severely disturbed generators and the least disturbed generator. Iterate over the severely disturbed generators and form all SDGPs. B. RLS-Based MLE Estimation The MLE can be estimated by calculating the slope of the logarithmic distance curve in Phase II. Considering the influences of measurement errors and nonlinear fluctuations, we adopt the least square algorithm to estimate the MLE. From (1) and Fig. 2 it is seen that the MLE is estimated starting from time step m(n). From this time step, k + 1 sequential logarithmic distances can be obtained as L(m(n) + i) = log (d (m(n), n, i))  = log |θm(n)+i − θn+i | , i = 0, 1, . . . , k. (5) Then, the MLE estimation model can be expressed as L(m(n) + i) = λk · (m(n) + i)∆t + Ck + ξk , i = 0, 1, . . . , k, (2) (6) where N is the dimension of the original system, τ is the lag time, and θt , θt−τ , θt−2τ , · · · , θt−2N τ are the observations of the observed variable at the corresponding time steps. In the reconstructed state space, the Euclidean distance in (1) becomes where λk is the MLE to be estimated, Ck is the constant term, and ξk is the residual term. The solution of the least square estimation is   λk −1 Ê k = (7) X> = (X > k Y k, k Xk) Ck d(m(n), n, i) = ||Θm(n)+i − Θn+i ||, i ∈ {0, k}, where X k is the coefficient matrix and Y k is the observation vector. According to the aforementioned definitions, X k and Y k can be expressed as (3) where Θn+i and Θm(n)+i are the observations on the reconstructed trajectory. Moreover, another simplification can be made based on [13] and [17], in which it is shown that it is sufficient to only consider the first component of the reconstructed state vector to estimate MLE, because all components will grow exponentially at the rate of MLE. Therefore, the Θn+i and Θm(n)+i in (3) can be replaced by their first components, and the distance in (1) can be calculated by d(m(n), n, i) = |θm(n)+i − θn+i |, i ∈ {0, k}. (4) In this paper, the relative rotor angle of the severely disturbed generator pair (SDGP) is selected as the observed state variable, because these SDGPs are, in general, responsible for the system dynamics after considerable disturbances [25]. An SDGP should be composed of a severely disturbed generator and the least disturbed generator in order to reflect the dynamics of the severely disturbed generators [26]. In particular, the SDGPs can be identified as follows. 1) Obtain the rotor speed of all generators at the fault clearing moment, ωtc ,n , n = 1, 2, . . . , NG , from PMU measurements, where NG is the number of generators. 2) Obtain the maximal absolute value of the rotor speed, i.e., ωt∗c = max |ωtc ,n |. Define generator g as one n=1,2,...,NG m(n)∆t  (m(n) + 1)∆t Xk =  ··· (m(n) + k)∆t   1 1  , ···  1  L(m(n))  L(m(n) + 1)  Y k = . ··· L(m(n) + k) (8)  (9) Moreover, to avoid the repeated calculation of the inverse matrix in (7), a recursive estimation algorithm is applied [28], which can be formulated as h i Ê k+1 = Ê k + Gk+1 yk+1 − x> k+1 Ê k , Gk+1 = P k xk+1 , 1 + x> k+1 P k xk+1 P k+1 = P k − Gk+1 x> k+1 P k , > (10) where xk+1 is [(m(n) + k + 1)∆t 1] , yk+1 is the new observation L(m(n)+k +1), Ê k and Ê k+1 are the estimation results before and after obtaining the new observation, P k and P k+1 are the covariance matrices, and Gk+1 is the gain vector. The algorithm includes the following three steps: 4 1) With the first 2 groups of data (k = 1 in (5)), set the −1 initial values of Ê 1 and P 1 to be (X > X> 1 X 1) 1Y1 > −1 and (X 1 X 1 ) , respectively. 2) Obtain a new observation of the logarithmic distance between the trajectories, and then sequentially calculate Gk+1 , Ê k+1 , and P k+1 according to (10). 3) Set k = k + 1 and return to step 2. • Pattern I: In this pattern, the relative rotor speed increases after fault clearing. No decelerating area exists for the SDGP and the system will lose stability during the first swing. Since the original and the neighboring trajectories separate rapidly, w is set to 1 (the smallest positive integer) to minimize the estimation waiting time. • Pattern II: In this pattern, the relative rotor speed decreases after fault clearing. However, since the decelerating area is relatively small, the relative rotor speed increases again after a short time period, and the increasing trend continues until the system loses stability. The key feature of this pattern is that the relative rotor speed at the fault clearing moment, denoted by v0 in Fig. 3, appears again after the initial decrease. In order to achieve obvious separation between the trajectories, w is set to be the time step lags of the reappearance of v0 . • Pattern III: In this pattern, the relative rotor speed first decreases to −v0 , and then exhibits periodic oscillations. The decelerating area is large enough to reduce the relative rotor speed to zero, and the system stability depends on the damping characteristics of the post-fault equilibrium point. In this case, w is set to be the time step lags of the first appearance of −v0 . • Pattern IV: In this pattern, the relative rotor speed first decreases to some value greater than −v0 , and then oscillates periodically. The key feature of this pattern is that the relative rotor speed v0 and −v0 cannot be observed after fault clearing. This pattern is a special case of Pattern III, and w is set to be the time step lags of the first appearance of the local minimal relative rotor speed after fault clearing. • Pattern V: This pattern is similar to Pattern III, and usually appears after very quick fault clearing. The key feature of this pattern is that the relative rotor speed shows decelerated growth immediately after fault clearing, and the relative rotor speed −v0 can be observed after that. The w is set in the same way as in Pattern III. • Pattern VI: This pattern is a special case of Pattern V. The key feature of this pattern is that the relative rotor speed shows decelerated growth immediately after the fault clearing, and the relative rotor speed −v0 cannot be observed during the oscillations. The w is set in the same way as in Pattern IV. C. Parameter Setting Because the Theiler window w and the MLE estimation initial time step m(n) determine the shape of the estimated MLE curve, they are crucial for a quick and reliable rotor angle stability assessment. Here, we discuss how to choose these parameters according to the rotor angle swing features. (1) Theiler window selection The Theiler window w determines the temporal separation between the initial points θ0 and θm(0) . It should be large enough to ensure that θ0 and θm(0) are the initial points of different trajectories. However, too large w will cause unnecessary waiting time and delay the stability assessment. The post-fault rotor angles of the SDGPs have significant swing patterns [29]–[31]. According to the features of the relative rotor speed of the SDGPs, six distinct swing patterns can be identified as shown in Fig. 3. Different w are chosen for different patterns as follows. (2) MLE estimation initial time step selection Fig. 3. Relative rotor speed curves of different patterns. The MLE estimation initial time step m(n) should ensure that the slope estimation is performed for Phase II of the logarithmic distance growth. In this phase, the original and neighboring trajectories have been sufficiently separated, and thus the logarithmic distance curve has shown clear development trend [13]. In fact, the distance between the rotor angle trajectories has a close relationship with the relative rotor speed of the SDGP. According to the definition of the Theiler window, the distance between the corresponding points of the original 5 and the neighboring trajectories at any time step j can be reformulated as dj = d(m(0), 0, j) = θm(0)+j − θ0+j   j+w j+w X X vt ·∆t , vt ·∆t−θ0+j = ≈ θ0+j + t=j+1 (11) t=j+1 where vt is the relative rotor speed at the relevant time step. It is revealed in (11) that the distance dj is equal to the area enclosed by the time axis and the relative rotor speed curve within the Theiler window, as indicated by the shaded regions in Fig. 3. Therefore, m(n) can be determined as follows. • Patterns I–II: With the selected w, it is seen in Fig. 3 that the distance dj of these patterns monotonically increases after fault clearing, which indicates that the logarithmic distance growth is in Phase II as soon as the fault is cleared. Therefore, in these two patterns, m(n) is set to be w to minimize the estimation waiting time. • Patterns III–VI: For these patterns the distance will exhibit periodic fluctuations after fault clearing. To ensure the trajectories have been sufficiently separated and to catch the main trend of the fluctuations, m(n) is set to be w + j ∗ , where j ∗ is the time step when dj reaches its first local maximum after fault clearing. Criteria II and III correspond to Patterns III–VI. In these patterns, the relative rotor angle will oscillate after fault clearing. However, by using the selected parameters, the logarithmic distance will exhibit significant development trend as illustrated in Fig. 5. If the relative rotor speed has a undamped oscillation, the SDGP is unstable and the logarithmic distance curve will fluctuate periodically as shown in Fig. 5(a). Since the MLE is the average slope of the logarithmic distance curve from the MLE estimation initial time step, it will first decrease and then increase to a positive peak value, as in Fig. 4. By contrast, if the relative rotor speed has a damped oscillation, the SDGP is stable and the logarithmic distance curve will look like Fig. 5(b). The MLE will first decrease and then increase to a negative peak value, as in Fig. 4. Fig. 5. The logarithmic distance curves for Pattern III–VI. D. Rotor Angle Stability Assessment Criteria When the MLE curve of a SDGP is estimated, the following criteria can be used to determine the stability of the SDGP. Criterion I: If the MLE of the SDGP increases at the beginning, the SDGP is unstable. • Criterion II: If the MLE decreases at the beginning, it will have oscillations. If the first peak point of the oscillation is positive, the SDGP is unstable. • Criterion III: If the MLE decreases at the beginning and the first peak point of the oscillation is negative, the SDGP is stable. Typical MLE curves corresponding to these criteria are shown in Fig. 4. If the condition in Criterion I is satisfied, Pattern I or II in Fig. 3 will happen, for which the distance will increase immediately after the MLE estimation initial time step and the trend will last until the SDGP loses stability. • Fig. 4. Typical MLE curves for Criterion I–III. Because SDGPs are responsible for the system dynamics after disturbances [25], we finally have the following criterion on the angle stability of the system. • Criterion IV: If all SDGPs are stable, the system is stable; otherwise, the system is unstable. E. Rotor Angle Stability Assessment Procedure The proposed online rotor angle stability assessment procedure is shown in Fig. 6, which includes the measurement data preparation module, the parameter setting module, the MLE estimation module, and the stability assessment module. Specifically, 1) When a fault is detected, the measurement data preparation module will be immediately activated to identify the SDGPs and collect the corresponding relative rotor angle and rotor speed measurements in real time. 2) The relative rotor speed variation patterns are identified online according to the rules described in Section III-C, and the parameters are assigned accordingly. 3) The MLE sequences can be calculated by using the RLSbased algorithm in Section III-B. 4) Finally the stability condition can be assessed by using the criteria provided in Section III-D according to the features of the estimated MLE curves. IV. C ASE S TUDIES The proposed approach is tested on the New-England 39bus system and the NPCC 140-bus system. Simulations are performed with Power System Analysis Toolbox (PSAT) [32] in MATLAB. 6 Fig. 6. Flow chart of the assessment procedure. A. New-England 39-Bus System The New-England 39-bus system has 10 generators and 46 branches. The parameters can be found in [33]. Unless otherwise specified, all generators in the tests are described by the fourth-order transient model with Type I turbine governor (TG), Type II automatic voltage regulator (AVR), and Type II power system stabilizer (PSS) (see PSAT documentation). All loads are described by the ZIP model and the ratios of the constant impedance, constant current, and constant power loads are 0.4, 0.5, and 0.1, respectively. The sampling rate of the PMU measurements used for MLE estimation is 120 samples/s [3]. To verify the effectiveness of the proposed approach, a three-phase-to-ground fault is applied at bus 2 at t = 1 s, and the fault is cleared by opening line 2–3 at tc = 1.243 s and tc = 1.244 s for Scenarios I and II, respectively. According to the time-domain simulation, the system is stable under Scenario I and unstable under Scenario II. By using the method in Section III-A, the generator pairs 38–39 and 37–39 are identified as the SDGPs for both scenarios. Figs. 7–8 show the relative rotor angles and the estimated MLEs of the SDGPs. From Fig. 7(a), it is seen that the relative rotor angles of the SDGPs tend to be stable after a long period of oscillations. In Fig. 7(b), the MLEs of the SDGPs decrease immediately after fault clearing, and their first peak points of the oscillations are both less than 0. Therefore, according to Criteria III and IV, the system is stable under this scenario. By contrast, under Scenario II the MLE of the generator pair 38–39 increases immediately after fault clearing, as shown in Fig. 8(b). Therefore, according to Criteria I and IV, the system is unstable under this scenario. For the two scenarios, the system stability can be assessed, respectively, within 2.82 s and 1.40 s after fault clearing, which demonstrates that the proposed approach can provide early detection of instability. In fact, according to the proposed approach, the first-swing instability can be identified very quickly, because the instability can be detected at the beginning of the MLE curve. On the other hand, for the multiswing stability or instability, the assessment time is a little longer since the approach needs to check the first peak point of the MLE curve after fault clearing. In industrial applications, a predetermined relative rotor angle value, i.e., π rad, is usually set as the threshold for determining rotor angle stability [34]. Although this pragmatic criterion is easy to execute, the relative rotor angle corresponding to rotor angle instability may change significantly with the change of topologies, parameters, and operating conditions. For instance, under Scenario I, the relative rotor angle between generators 38 and 39 can reach up to 3.207 rad while the system is still stable. It should also be noted that there are foundational differences between the proposed approach and that in [3]. In the proposed approach, the system stability can be explicitly determined at latest when the first peak point of the MLE curve is observed. By contrast, for the approach in [3], the MLE curve must be observed for a long period to ensure the sign of MLE. Unfortunately, it is actually difficult for the approach in [3] to predetermine the observing window size to provide reliable and timely assessment results (for instance, see Figs. Fig. 7. Simulation results of Scenario I. Fig. 8. Simulation results of Scenario II. 7 1–2 in [3]). From this perspective, the proposed approach is more time efficient and more reliable. In order to further verify the accuracy of the proposed approach, extensive tests are performed on the New-England 39-bus system. Specifically, a three-phase-to-ground fault is created for each bus (except the generator buses) at t = 1 s, and is cleared at 1.08 s, 1.16 s, 1.24 s, and 1.32 s, respectively. According to the test results, the proposed approach successfully determines the rotor angle stability in all 224 tests. The occurrence frequencies of the fault patterns and the success rate of the proposed stability assessment approach are summarized in Table I. TABLE I S UMMARY OF THE T ESTS ON THE N EW-E NGLAND 39-B US S YSTEM tc /s 1.08 1.16 1.24 1.32 Success Rate I N/A N/A 4 38 100% time is 2.36 s, which is much shorter than the time required for directly looking at the relative rotor angle curve. B. NPCC 140-Bus System The proposed approach is also tested on the NPCC 140bus system [35]. The settings are the same as those for the New-England 39-bus system. A three-phase-to-ground fault is first applied at bus 35 at t = 0.1 s, and is cleared by opening line 34–35 at tc = 0.307 s (Scenario III, stable) and tc = 0.308 s (Scenario IV, unstable), respectively. Generator pairs 1–48 and 2–48 are identified as the SDGPs for both cases. The relative rotor angle curves and MLE curves under these two scenarios are shown in Figs. 10–11, respectively. Occurrence Times of the Swing Patterns II III IV V VI N/A 4 43 6 3 6 10 36 3 1 13 9 27 2 1 12 2 4 N/A N/A 100% 100% 100% 100% 100% It is seen in Table I that Patterns I and II those correspond to first-swing instability usually occur with longer fault clearing time. In contrast, Patterns V and IV usually occur with the shorter fault clearing time, and the system will have a good chance to maintain stability in these patterns. Among the tests, the first-swing instability identification time ranges from 1.2 s to 1.5 s, and the multi-swing stability assessment time ranges from 2.2 s to 2.5 s, which further confirms the efficient of the proposed approach. Because the system has sufficient damping to ensure the stability of the post-fault equilibrium points, there are no multiswing instability cases. In order to generate a multi-swing instability case, all of the PSSs are removed and the parameters of the AVRs are tuned. In the modified system, a three-phaseto-ground fault is applied at bus 28 at t = 1 s, and is cleared by opening line 27–28 at tc = 1.12 s. In this test, only generator pair 38–39 is identified as the SDGP, whose relative rotor angle curve and MLE curve are shown in Fig. 9. Fig. 9. Simulation results of the multi-swing unstable case. In Fig. 9(b), the MLE decreases immediately after fault clearing, and the following peak MLE is positive. According to Criteria II and IV, the MLE variation pattern indicates that the system is multi-swing unstable, which is verified by the relative rotor angle curve. In this case, the stability assessment Fig. 10. Simulation results of Scenario III. Fig. 11. Simulation results of Scenario IV. In Fig. 10, it is seen that the curves of Scenario III are similar to those of Scenario I. In this case, the system is determined as stable because of the same reason as Scenario I. As shown in Fig. 11, under Scenario IV the MLE curves of both SDGPs exhibit unstable features, which indicates that both generator pairs will lose stability and thus the system is unstable. Extensive tests are also executed on the NPCC 140-bus system. A three-phase-to-ground fault is applied at each bus (except the generator buses) at t = 0.1 s, and is cleared at 0.18 s, 0.26 s, 0.32 s and 0.40 s, respectively. Table II lists the occurrence frequencies of the fault patterns and the success rate of the proposed stability assessment approach during the tests. According to the test results, the proposed approach can accurately determine system stability in all 716 tests. The firstswing instability identification time ranges from 1.1 s to 1.7 8 TABLE II S UMMARY OF THE T ESTS ON THE NPCC 140-B US S YSTEM tc /s 0.18 0.26 0.32 0.40 Success Rate I N/A N/A 8 60 100% Occurrence Times of II III N/A 6 10 26 57 38 12 49 100% 100% the Swing Patterns IV V VI 166 2 5 143 N/A N/A 76 N/A N/A 58 N/A N/A 100% 100% 100% s, and the multi-swing stability assessment time ranges from 1.8 s to 2.4 s. V. C ONCLUSION In this paper, a model-free approach for online rotor angle stability assessment is proposed based on MLE. By using the proposed MLE estimation algorithm, parameter setting rules and the stability criteria, the approach can online identify the system stability condition with PMU measurements. The approach does not need a predetermined observing window to identify the sign of the MLE, and can provide reliable and timely assessment results by analyzing the features of the estimated MLE curve. To verify the performance of the proposed approach, extensive tests are performed on the NewEngland 39-bus system and the NPCC 140-bus system. The proposed approach can successfully determine the system stability conditions in all 945 tests. Moreover, among all the tests, the first-swing stability can be assessed within 1.7 s and the multi-swing stability can be assessed within 2.5 s. R EFERENCES [1] P. Kundur, J. Paserba, V. Ajjarapu, G. Andersson, A. Bose et al., “Definition and classification of power system stability,” IEEE Trans. Power Syst., vol. 19, no. 3, pp. 1387–1401, Aug. 2004. [2] J. Yan, C. C. Liu, and U. Vaidya, “PMU-based monitoring of rotor angle dynamics,” IEEE Trans. Power Syst., vol. 26, no. 4, pp. 2125–2133, Mar. 2011. [3] S. Dasgupta, M. Paramasivam, U. Vaidya, and V. Ajjarapu, “PMU-based model-free approach for real-time rotor angle monitoring,” IEEE Trans. Power Syst., vol. 30, no. 5, pp. 2818–2819, Sep. 2015. [4] V. Centeno, A. Phadke, A. Edris, J. Benton, M. Gaudi, and G. Michel, “An adaptive out-of-step relay,” IEEE Trans. Power Delivery, vol. 12, no. 1, pp. 61–71, Jan. 1997. [5] J. H. Chow, A. Chakrabortty, M. Arcak, B. Bhargava, and A. Salazar, “Synchronized phasor data based energy function analysis of dominant power transfer paths in large power systems,” IEEE Trans. Power Syst., vol. 22, no. 2, pp. 727–734, May 2007. [6] C. W. Liu and J. S. Thorp, “New methods for computing power system dynamic response for real-time transient stability prediction,” IEEE Trans. Circuits Syst. I, vol. 47, no. 3, pp. 324–337, Mar. 2000. [7] K. Sun, S. Likhate, V. Vittal et al., “An online dynamic security assessment scheme using phasor measurements and decision trees,” IEEE Trans. Power Syst., vol. 22, no. 4, pp. 1935–1943, Nov. 2007. [8] A. Del Angel, P. Geurts, D. Ernst, M. Glavic, and L. Wehenkel, “Estimation of rotor angles of synchronous machines using artificial neural networks and local PMU-based quantities,” Neurocomputing, vol. 70, no. 16, pp. 2668–2678, Oct. 2007. [9] I. Kamwa, S. Samantaray, and G. Joos, “Development of rule-based classifiers for rapid stability assessment of wide-area post-disturbance records,” IEEE Trans. Power Syst., vol. 24, no. 1, pp. 258–270, Feb. 2009. [10] C. W. Liu, J. S. Thorp, J. Lu et al., “Detection of transiently chaotic swings in power systems using real-time phasor measurements,” IEEE Trans. Power Syst., vol. 9, no. 3, pp. 1285–1292, Aug. 1994. [11] S. K. Khaitan and J. D. McCalley, “Vantage: A lyapunov exponents based technique for identification of coherent groups of generators in power systems,” Electr. Pow. Syst. Res., vol. 105, pp. 33–38, Dec. 2013. [12] S. Dasgupta, M. Paramasivam, U. Vaidya, and V. Ajjarapu, “Real-time monitoring of short-term voltage stability using PMU data,” IEEE Trans. Power Syst., vol. 28, no. 4, pp. 3702–3711, Nov. 2013. [13] C. Skokos, G. A. Gottwald, and J. Laskar, Chaos Detection and Predictability. Heidelberg, Germany: Springer, 2016. [14] V. I. Oseledec, “A multiplicative ergodic theorem. lyapunov characteristic numbers for dynamical systems,” Trans. Moscow Math. Soc, vol. 19, no. 2, pp. 197–231, Dec. 1968. [15] M. T. Rosenstein, J. J. Collins, and C. J. De Luca, “A practical method for calculating largest lyapunov exponents from small data sets,” Physica D, vol. 65, no. 1-2, pp. 117–134, May 1993. [16] J. Gao and Z. Zheng, “Local exponential divergence plot and optimal embedding of a chaotic time series,” Phys. Lett. A, vol. 181, no. 2, pp. 153–158, Oct. 1993. [17] H. Kantz, “A robust method to estimate the maximal lyapunov exponent of a time series,” Phys. Lett. A, vol. 185, no. 1, pp. 77–87, Jan. 1994. [18] Z. Huang, K. Schneider, and J. Nieplocha, “Feasibility studies of applying kalman filter techniques to power system dynamic state estimation,” in 2007 International Power Engineering Conference (IPEC 2007). IEEE, Dec. 2007, pp. 376–382. [19] E. Ghahremani and I. Kamwa, “Dynamic state estimation in power system by applying the extended kalman filter with unknown inputs to phasor measurements,” IEEE Trans. Power Syst., vol. 26, no. 4, pp. 2556–2566, Nov. 2011. [20] K. Sun, J. Qi, and W. Kang, “Power system observability and dynamic state estimation for stability monitoring using synchrophasor measurements,” Control Eng. Pract., vol. 53, pp. 160–172, Aug. 2016. [21] E. Ghahremani and I. Kamwa, “Local and wide-area pmu-based decentralized dynamic state estimation in multi-machine power systems,” IEEE Trans. Power Syst., vol. 31, no. 1, pp. 547–562, Jan. 2016. [22] J. Qi, K. Sun, J. Wang, and H. Liu, “Dynamic state estimation for multi-machine power system by unscented Kalman filter with enhanced numerical stability,” IEEE Trans. Smart Grid, to be published. [23] F. Takens, “Detecting strange attractors in turbulence,” in Dynamical systems and turbulence, Warwick 1980. Heidelberg, Germany: Springer, 1981, pp. 366–381. [24] N. H. Packard, J. P. Crutchfield, J. D. Farmer, and R. S. Shaw, “Geometry from a time series,” Phys. Rev. Lett., vol. 45, no. 9, pp. 712–716, Nov. 1980. [25] M. Haque and A. Rahim, “Determination of first swing stability limit of multimachine power systems through taylor series expansions,” IEE Proc.-C, vol. 136, no. 6, pp. 373–380, Nov. 1989. [26] M. Yin, C. Chung, K. Wong, Y. Xue, and Y. Zou, “An improved iterative method for assessment of multi-swing transient stability limit,” IEEE Trans. Power Syst., vol. 26, no. 4, pp. 2023–2030, Nov. 2011. [27] M. Haque, “Further developments of the equal-area criterion for multimachine power systems,” Electr. Pow. Syst. Res., vol. 33, no. 3, pp. 175–183, Jun. 1995. [28] P. C. Young, Recursive estimation and time-series analysis: An introduction for the student and practitioner. Heidelberg, Germany: Springer, 2011. [29] B. Spalding, H. Yee, and D. Goudie, “Coherency recognition for transient stability studies using singular points,” IEEE Trans. Power App. Syst., vol. 96, no. 4, pp. 1368–1375, Jul. 1977. [30] M. Takahashi, K. Matsuzawa, M. Sato, K. Omata, R. Tsukui, T. Nakamura, and S. Mizuguchi, “Fast generation shedding equipment based on the observation of swings of generators,” IEEE Trans. Power Syst., vol. 3, no. 2, pp. 439–446, May 1988. [31] G. G. Karady, A. A. Daoud, and M. A. Mohamed, “On-line transient stability enhancement using multi-agent technique,” in Proc. IEEE Power Eng. Soc. Winter Meeting, 2002, vol. 2, pp. 893–899. [32] F. Milano, “An open source power system analysis toolbox,” IEEE Trans. Power Syst., vol. 20, no. 3, pp. 1199–1206, Aug. 2005. [33] A. Pai, Energy function analysis for power system stability. Boston, MA, USA: Kluwer Academic Publishers, 1989. [34] Y. Xu, Z. Y. Dong, J. H. Zhao, P. Zhang, and K. P. Wong, “A reliable intelligent system for real-time dynamic security assessment of power systems,” IEEE Trans. Power Syst., vol. 27, no. 3, pp. 1253–1263, Aug. 2012. [35] J. H. Chow, R. Galarza, P. Accari, and W. Price, “Inertial and slow coherency aggregation algorithms for power system dynamic model reduction,” IEEE Trans. Power Syst., vol. 10, no. 2, pp. 680–685, May 1995.
3cs.SY